From ef974fb08972483d6852c9d5b2f23e1d33343b76 Mon Sep 17 00:00:00 2001 From: Michael Hanson Date: Tue, 30 Nov 2010 23:52:49 +0000 Subject: Housekeeping --- abs/core/audiofile/aclocal-fixes.patch | 11 - abs/core/coreutils/coreutils-8.5-2-i686.pkg.tar.gz | 1 - abs/core/cpio/cpio-2.9-gcc43.patch | 31 - abs/core/curl/ChangeLog | 69 - abs/core/curl/m4-typo.patch | 13 - abs/core/device-mapper/ChangeLog | 103 - abs/core/device-mapper/PKGBUILD | 64 - abs/core/device-mapper/lvm2_hook | 25 - abs/core/device-mapper/lvm2_install | 30 - abs/core/directfb/ChangeLog | 5 - abs/core/directfb/dfb_serial.diff | 10 - abs/core/faac/libmp4v2.patch | 11 - abs/core/faac/pipe-output.patch | 18 - abs/core/freetype2/bytecode.patch | 29 - abs/core/freetype2/freetype-2.2.1-memcpy-fix.patch | 14 - abs/core/freetype2/freetype-2.3.3-ftbitmap.patch | 25 - abs/core/freetype2/freetype2.install | 23 - abs/core/ftgl/ftgl-gcc411.patch | 12 - abs/core/gawk/gawk-3.1.5-segfault_fix-1.patch | 43 - abs/core/grep/01-fgrep.patch | 145 - abs/core/grep/02-bracket.patch | 11 - abs/core/grep/03-i18n.patch | 303 - abs/core/grep/04-oi.patch | 48 - abs/core/grep/05-manpage.patch | 19 - abs/core/grep/06-color.patch | 10 - abs/core/grep/07-icolor.patch | 36 - abs/core/grep/08-skip.patch | 42 - abs/core/grep/09-egf-speedup.patch | 823 -- abs/core/grep/10-dfa-optional.patch | 67 - abs/core/grep/11-tests.patch | 138 - abs/core/grep/12-w.patch | 121 - abs/core/grep/13-P.patch | 14 - abs/core/grep/14-mem-exhausted.patch | 15 - abs/core/grep/15-empty-pattern.patch | 36 - abs/core/grep/64-egf-speedup.patch | 791 -- abs/core/groff/man-utf8.tmac | 9 - abs/core/gzip/gzip-fixpaths.patch | 37 - abs/core/gzip/gzip-fixutimens.patch | 36 - abs/core/gzip/gzip-security-update.patch | 186 - .../iproute2/iproute2-2.4.7-now-ss020116.patch | 9823 -------------------- abs/core/iproute2/libdir.patch | 129 - abs/core/iproute2/tc.patch | 26 - abs/core/iptables/PKGBUILD.orig | 36 - abs/core/libcap/libcap-1.10-debian.patch | 766 -- abs/core/libcap/libcap-1.10-fixcflags.patch | 22 - abs/core/libcap/libcap-1.10-shared.patch | 17 - abs/core/libpcap/libpcap-shared.patch | 51 - abs/core/libpng/ChangeLog | 55 - abs/core/libpng/libpng-1.2.29-apng.patch | 1671 ---- abs/core/libpng/libpng-1.2.31-apng.patch | 1644 ---- abs/core/libtool/libtool-2.2.10-3-i686.pkg.tar.gz | 1 - abs/core/libx86/lrmi.patch | 16 - abs/core/linux-atm/linux-atm-2.5.0-glibc28.patch | 11 - abs/core/mdadm/raid-partitions_hook | 21 - abs/core/mdadm/raid-partitions_install | 32 - abs/core/php/db-configure.patch | 51 - abs/core/pm-utils/pm-utils.install | 15 - abs/core/pm-utils/service.patch | 15 - abs/core/projectm/projectm.install | 13 - .../shadow/shadow-4.0.18.2-useradd-fix-1.patch | 26 - abs/core/shadow/shadow-UID_GID.patch | 34 - abs/core/shadow/useradd | 6 - abs/core/shadow/useradd-default.patch | 14 - .../sqlite3/build_fts_as_part_of_libsqlite.patch | 139 - .../sqlite3/sqlite-3.5.8-pkgconfig-version.patch | 12 - abs/core/squashfs-tools/mksquashfs-fix-race.patch | 23 - abs/core/sysvinit/halt-init.patch | 17 - abs/core/udev/arch-udev-rules.patch | 50 - abs/core/udev/logitech-rules.patch | 14 - abs/core/udev/root-link.sh | 7 - .../community/lua/lua-5.1.3-official-patch3.diff | 21 - .../community/lua/lua-5.1.3-official-patch4.diff | 18 - abs/extra/miro/ChangeLog | 34 - abs/extra/miro/Changelog | 2 - abs/extra/miro/Miro-xulrunner.patch | 64 - abs/extra/miro/boost_1.36.0_fix.patch | 32 - abs/extra/miro/miro-xine.patch | 12 - abs/extra/miro/miro.exec.patch | 9 - abs/extra/miro/miro_python26.patch | 16 - abs/extra/miro/missing-headers.patch | 33 - abs/extra/monitorix-linhes.tar.gz | Bin 1970 -> 0 bytes abs/extra/xine-lib/xine-header.patch | 11 - abs/extra/xine-lib/xine-imagemagick.patch | 11 - 83 files changed, 18444 deletions(-) delete mode 100644 abs/core/audiofile/aclocal-fixes.patch delete mode 120000 abs/core/coreutils/coreutils-8.5-2-i686.pkg.tar.gz delete mode 100644 abs/core/cpio/cpio-2.9-gcc43.patch delete mode 100644 abs/core/curl/ChangeLog delete mode 100644 abs/core/curl/m4-typo.patch delete mode 100644 abs/core/device-mapper/ChangeLog delete mode 100644 abs/core/device-mapper/PKGBUILD delete mode 100644 abs/core/device-mapper/lvm2_hook delete mode 100644 abs/core/device-mapper/lvm2_install delete mode 100644 abs/core/directfb/ChangeLog delete mode 100644 abs/core/directfb/dfb_serial.diff delete mode 100644 abs/core/faac/libmp4v2.patch delete mode 100644 abs/core/faac/pipe-output.patch delete mode 100644 abs/core/freetype2/bytecode.patch delete mode 100644 abs/core/freetype2/freetype-2.2.1-memcpy-fix.patch delete mode 100644 abs/core/freetype2/freetype-2.3.3-ftbitmap.patch delete mode 100644 abs/core/freetype2/freetype2.install delete mode 100644 abs/core/ftgl/ftgl-gcc411.patch delete mode 100644 abs/core/gawk/gawk-3.1.5-segfault_fix-1.patch delete mode 100644 abs/core/grep/01-fgrep.patch delete mode 100644 abs/core/grep/02-bracket.patch delete mode 100644 abs/core/grep/03-i18n.patch delete mode 100644 abs/core/grep/04-oi.patch delete mode 100644 abs/core/grep/05-manpage.patch delete mode 100644 abs/core/grep/06-color.patch delete mode 100644 abs/core/grep/07-icolor.patch delete mode 100644 abs/core/grep/08-skip.patch delete mode 100644 abs/core/grep/09-egf-speedup.patch delete mode 100644 abs/core/grep/10-dfa-optional.patch delete mode 100644 abs/core/grep/11-tests.patch delete mode 100644 abs/core/grep/12-w.patch delete mode 100644 abs/core/grep/13-P.patch delete mode 100644 abs/core/grep/14-mem-exhausted.patch delete mode 100644 abs/core/grep/15-empty-pattern.patch delete mode 100644 abs/core/grep/64-egf-speedup.patch delete mode 100644 abs/core/groff/man-utf8.tmac delete mode 100644 abs/core/gzip/gzip-fixpaths.patch delete mode 100644 abs/core/gzip/gzip-fixutimens.patch delete mode 100644 abs/core/gzip/gzip-security-update.patch delete mode 100644 abs/core/iproute2/iproute2-2.4.7-now-ss020116.patch delete mode 100644 abs/core/iproute2/libdir.patch delete mode 100644 abs/core/iproute2/tc.patch delete mode 100644 abs/core/iptables/PKGBUILD.orig delete mode 100644 abs/core/libcap/libcap-1.10-debian.patch delete mode 100644 abs/core/libcap/libcap-1.10-fixcflags.patch delete mode 100644 abs/core/libcap/libcap-1.10-shared.patch delete mode 100644 abs/core/libpcap/libpcap-shared.patch delete mode 100644 abs/core/libpng/ChangeLog delete mode 100644 abs/core/libpng/libpng-1.2.29-apng.patch delete mode 100644 abs/core/libpng/libpng-1.2.31-apng.patch delete mode 120000 abs/core/libtool/libtool-2.2.10-3-i686.pkg.tar.gz delete mode 100644 abs/core/libx86/lrmi.patch delete mode 100644 abs/core/linux-atm/linux-atm-2.5.0-glibc28.patch delete mode 100644 abs/core/mdadm/raid-partitions_hook delete mode 100644 abs/core/mdadm/raid-partitions_install delete mode 100644 abs/core/php/db-configure.patch delete mode 100644 abs/core/pm-utils/pm-utils.install delete mode 100644 abs/core/pm-utils/service.patch delete mode 100644 abs/core/projectm/projectm.install delete mode 100644 abs/core/shadow/shadow-4.0.18.2-useradd-fix-1.patch delete mode 100644 abs/core/shadow/shadow-UID_GID.patch delete mode 100644 abs/core/shadow/useradd delete mode 100644 abs/core/shadow/useradd-default.patch delete mode 100644 abs/core/sqlite3/build_fts_as_part_of_libsqlite.patch delete mode 100644 abs/core/sqlite3/sqlite-3.5.8-pkgconfig-version.patch delete mode 100644 abs/core/squashfs-tools/mksquashfs-fix-race.patch delete mode 100644 abs/core/sysvinit/halt-init.patch delete mode 100644 abs/core/udev/arch-udev-rules.patch delete mode 100644 abs/core/udev/logitech-rules.patch delete mode 100755 abs/core/udev/root-link.sh delete mode 100644 abs/extra/community/lua/lua-5.1.3-official-patch3.diff delete mode 100644 abs/extra/community/lua/lua-5.1.3-official-patch4.diff delete mode 100644 abs/extra/miro/ChangeLog delete mode 100644 abs/extra/miro/Changelog delete mode 100644 abs/extra/miro/Miro-xulrunner.patch delete mode 100644 abs/extra/miro/boost_1.36.0_fix.patch delete mode 100644 abs/extra/miro/miro-xine.patch delete mode 100644 abs/extra/miro/miro.exec.patch delete mode 100644 abs/extra/miro/miro_python26.patch delete mode 100644 abs/extra/miro/missing-headers.patch delete mode 100644 abs/extra/monitorix-linhes.tar.gz delete mode 100644 abs/extra/xine-lib/xine-header.patch delete mode 100644 abs/extra/xine-lib/xine-imagemagick.patch diff --git a/abs/core/audiofile/aclocal-fixes.patch b/abs/core/audiofile/aclocal-fixes.patch deleted file mode 100644 index ef4d258..0000000 --- a/abs/core/audiofile/aclocal-fixes.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- audiofile.m4.orig 2006-03-05 13:06:01.000000000 +0000 -+++ audiofile.m4 2006-03-05 13:06:17.000000000 +0000 -@@ -9,7 +9,7 @@ - dnl AM_PATH_AUDIOFILE([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) - dnl Test for Audio File Library, and define AUDIOFILE_CFLAGS and AUDIOFILE_LIBS. - dnl --AC_DEFUN(AM_PATH_AUDIOFILE, -+AC_DEFUN([AM_PATH_AUDIOFILE], - [dnl - dnl Get compiler flags and libraries from the audiofile-config script. - dnl diff --git a/abs/core/coreutils/coreutils-8.5-2-i686.pkg.tar.gz b/abs/core/coreutils/coreutils-8.5-2-i686.pkg.tar.gz deleted file mode 120000 index 3eef1a4..0000000 --- a/abs/core/coreutils/coreutils-8.5-2-i686.pkg.tar.gz +++ /dev/null @@ -1 +0,0 @@ -/data/pkg_repo/packages/coreutils-8.5-2-i686.pkg.tar.gz \ No newline at end of file diff --git a/abs/core/cpio/cpio-2.9-gcc43.patch b/abs/core/cpio/cpio-2.9-gcc43.patch deleted file mode 100644 index da9004a..0000000 --- a/abs/core/cpio/cpio-2.9-gcc43.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- tar-1.19/lib/argp-fmtstream.h.gcc43 2007-09-28 15:11:36.000000000 +0200 -+++ tar-1.19/lib/argp-fmtstream.h 2008-02-13 16:56:58.000000000 +0100 -@@ -198,7 +198,11 @@ extern int __argp_fmtstream_ensure (argp - #endif - - #ifndef ARGP_FS_EI --#define ARGP_FS_EI extern inline -+# ifdef __GNUC_STDC_INLINE__ -+# define ARGP_FS_EI extern inline __attribute__((__gnu_inline__)) -+# else -+# define ARGP_FS_EI extern inline -+# endif - #endif - - ARGP_FS_EI size_t -diff -up tar-1.19/lib/argp.h.gcc43 tar-1.19/lib/argp.h ---- tar-1.19/lib/argp.h.gcc43 2007-09-28 15:11:36.000000000 +0200 -+++ tar-1.19/lib/argp.h 2008-02-13 16:55:36.000000000 +0100 -@@ -580,7 +580,11 @@ extern void *__argp_input (const struct - # endif - - # ifndef ARGP_EI --# define ARGP_EI extern __inline__ -+# if defined __GNUC_STDC_INLINE__ -+# define ARGP_EI extern __inline__ __attribute__((__gnu_inline__)) -+# else -+# define ARGP_EI extern __inline__ -+# endif - # endif - - ARGP_EI void diff --git a/abs/core/curl/ChangeLog b/abs/core/curl/ChangeLog deleted file mode 100644 index abcd7af..0000000 --- a/abs/core/curl/ChangeLog +++ /dev/null @@ -1,69 +0,0 @@ -2010-02-09 Eric Belanger - - * curl 7.20.0-1 - * Upstream update - -2009-11-04 Eric Belanger - - * curl 7.19.7-1 - * Upstream update - -2009-10-03 Robson Peixoto - - * curl 7.19.6-2 - * Compile with ca-path like Debian and Gentoo - -2009-08-12 Eric Belanger - - * curl 7.19.6-1 - * Upstream update - -2009-05-18 Eric Belanger - - * curl 7.19.5-1 - * Upstream update - -2009-03-03 Eric Belanger - - * curl 7.19.4-1 - * Upstream update - -2009-01-21 Eric Belanger - - * curl 7.19.3-1 - * Upstream update - -2008-11-14 Eric Belanger - - * curl 7.19.2-1 - * Upstream update - -2008-11-08 Eric Belanger - - * curl 7.19.1-1 - * Upstream update - -2008-09-20 Eric Belanger - - * curl 7.19.0-1 - * Upstream update - -2008-06-04 Eric Belanger - - * curl 7.18.2-1 - * Upstream update - * Switched to the CA Root Certificates provided by the ca-certificates package (close FS#10569) - * Removed bundled certificates - * Removed perl-libwww makedepends - -2008-04-30 Eric Belanger - - * curl 7.18.1-2 - * Added CA Root Certificates (close FS#10129) - * Added perl-libwww makedepends - -2008-03-31 Eric Belanger - - * curl 7.18.1-1 - * Upstream update - * Added ChangeLog diff --git a/abs/core/curl/m4-typo.patch b/abs/core/curl/m4-typo.patch deleted file mode 100644 index 2e46dff..0000000 --- a/abs/core/curl/m4-typo.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/docs/libcurl/libcurl.m4 b/docs/libcurl/libcurl.m4 -index ce8e476..50dc20d 100644 ---- a/docs/libcurl/libcurl.m4 -+++ b/docs/libcurl/libcurl.m4 -@@ -198,7 +198,7 @@ x=CURLOPT_VERBOSE; - - # We don't have --protocols, so just assume that all - # protocols are available -- _libcurl_protocols="HTTP FTP FILE TELNET LDAP DICT TFTP -+ _libcurl_protocols="HTTP FTP FILE TELNET LDAP DICT TFTP" - - if test x$libcurl_feature_SSL = xyes ; then - _libcurl_protocols="$_libcurl_protocols HTTPS" diff --git a/abs/core/device-mapper/ChangeLog b/abs/core/device-mapper/ChangeLog deleted file mode 100644 index 5809ab5..0000000 --- a/abs/core/device-mapper/ChangeLog +++ /dev/null @@ -1,103 +0,0 @@ -2010-07-11 Thomas Bächler - - * lvm2/device-mapper 2.02.70-1 - * Upstream update - * Do not move the dmeventd manpage, has been fixed upstream - * Remove all the || return 1 in PKGBUILD - -2010-07-01 Eric Belanger - - * lvm2/device-mapper 2.02.69-1 - * Upstream update - * Moved dmeventd man page from lvm2 to device-mapper package - -2010-06-25 Eric Belanger - - * lvm2/device-mapper 2.02.68-1 - * Upstream update - * Fixed tr path in lvmdump - -2010-04-05 Eric Belanger - - * lvm2/device-mapper 2.02.62-1 - * Upstream update - * Fixed license - -2010-02-27 Eric Belanger - - * lvm2/device-mapper 2.02.61-1 - * Upstream update - -2010-01-24 Thomas Bächler - * lvm2/device-mapper 2.02.60-2 - * Rebuilt without -Wl,--as-needed, it breaks dmeventd monitoring - -2010-01-24 Thomas Bächler - * lvm2/device-mapper update to 2.02.60-1 - * Clean up PKGBUILD, fix internal paths to dmeventd and its helpers - -2009-11-27 Eric Belanger - - * lvm2 2.02.56-1 - * device-mapper 1.02.40-1 - * Upstream update - -2009-10-31 Eric Belanger - - * lvm2 2.02.54-1 - * device-mapper 1.02.39-1 - * Upstream update - * Enabled the device-mapper event daemon - * Moved the udev rule from /etc to /lib - -2009-09-27 Eric Belanger - - * lvm2 2.02.53-1 - * device-mapper 1.02.38-1 - * Upstream update - -2009-09-18 Eric Belanger - - * lvm2 2.02.52-1 - * device-mapper 1.02.37-1 - * Upstream update - * Implemented split packages - * PKGBUILD clean up - * Renamed pkgconfig file (close FS#15909) - -2009-07-09 Eric Belanger - - * lvm2 2.02.48-1 - * device-mapper 1.02.33-1 - * Upstream update - * Removed unneeded readline depends (close FS#15205) - -2009-05-24 Eric Belanger - - * lvm2 2.02.47-1 - * device-mapper 1.02.32-1 - * Upstream update - * Added dmsetup.static - -2009-03-07 Eric Belanger - - * lvm2 2.02.45-1 - * device-mapper 1.02.31-1 - * Upstream update - -2009-01-31 Eric Belanger - - * lvm2 2.02.44-1 - * device-mapper 1.02.30-1 - * Upstream update - * Added bash depends - * Added readline depends - * Added pkgconfig file - -2008-11-11 Eric Belanger - - * lvm2 2.02.43-1 - * device-mapper 1.02.29-1 - * Upstream update - * Disabled SMP build - * Added ChangeLog diff --git a/abs/core/device-mapper/PKGBUILD b/abs/core/device-mapper/PKGBUILD deleted file mode 100644 index b4be343..0000000 --- a/abs/core/device-mapper/PKGBUILD +++ /dev/null @@ -1,64 +0,0 @@ -# $Id: PKGBUILD 85275 2010-07-11 10:26:53Z thomas $ -# Maintainer: Eric Belanger - -pkgbase=lvm2 -pkgname=('lvm2' 'device-mapper') -pkgver=2.02.70 -_pkgverdm=1.02.52 -_pkgverlvm=${pkgver} -pkgrel=1 -arch=('i686' 'x86_64') -url="http://sourceware.org/lvm2/" -license=('GPL2' 'LGPL2.1') -groups=('base') -conflicts=('mkinitcpio<0.5.99') -changelog=ChangeLog -source=(ftp://sources.redhat.com/pub/lvm2/LVM2.${_pkgverlvm}.tgz - lvm2_install - lvm2_hook) -md5sums=('39c26d5a821754cc347d7a19e82d4a24' - 'f781c9f5dd4f9934952c687b73d26a18' - '95bed25bdbc2c2d8500e7a07aeff7f65') -sha1sums=('6f88114e72204feee491befd5f0e203036b90f11' - '583424bb0a6f89ffe4e4ea446b912f0fedac7050' - '0dc0c0d620f634c4d078afdb78e3bae15ccf957b') - -build() { - cd "${srcdir}/LVM2.${_pkgverlvm}" - sed -i 's|/usr/bin/tr|/bin/tr|' scripts/lvmdump.sh - unset LDFLAGS - ./configure --prefix= --sysconfdir=/etc --localstatedir=/var --datarootdir=/usr/share \ - --includedir=/usr/include --with-usrlibdir=/usr/lib \ - --enable-pkgconfig --enable-readline --enable-dmeventd --enable-cmdlib --enable-applib \ - --with-udevdir=/lib/udev/rules.d/ --enable-udev_sync --enable-udev_rules - make -} - -package_device-mapper() { - pkgdesc="Device mapper userspace library and tools" - url="http://sourceware.org/dm/" - depends=('glibc' 'udev') - - cd "${srcdir}/LVM2.${_pkgverlvm}" - make DESTDIR="${pkgdir}" install_device-mapper -} - -package_lvm2() { - pkgdesc="Logical Volume Manager 2 utilities" - depends=('bash' "device-mapper>=${pkgver}" 'udev' 'readline') - conflicts=('lvm' 'mkinitcpio<0.5.99') - backup=('etc/lvm/lvm.conf') - options=('!makeflags') - - cd "${srcdir}/LVM2.${_pkgverlvm}" - make DESTDIR="${pkgdir}" install_lvm2 - # install applib - cd liblvm - make DESTDIR="${pkgdir}" install - cd .. - # /etc directories - install -d "${pkgdir}"/etc/lvm/{archive,backup} - # mkinitcpio hook - install -D -m644 "${srcdir}/lvm2_hook" "${pkgdir}/lib/initcpio/hooks/lvm2" - install -D -m644 "${srcdir}/lvm2_install" "${pkgdir}/lib/initcpio/install/lvm2" -} diff --git a/abs/core/device-mapper/lvm2_hook b/abs/core/device-mapper/lvm2_hook deleted file mode 100644 index 13183c6..0000000 --- a/abs/core/device-mapper/lvm2_hook +++ /dev/null @@ -1,25 +0,0 @@ -# vim:set ft=sh: -run_hook () -{ - /sbin/modprobe -q dm-mod >/dev/null 2>&1 - if [ -e "/sys/class/misc/device-mapper" ]; then - if [ ! -e "/dev/mapper/control" ]; then - /bin/mknod "/dev/mapper/control" c $(cat /sys/class/misc/device-mapper/dev | sed 's|:| |') - fi - - # If the lvmwait= parameter has been specified on the command line - # wait for the device(s) before trying to activate the volume group(s) - if [ -n "${lvmwait}" ]; then - for pvdev in $(echo ${lvmwait} | sed 's|,| |g'); do - poll_device ${pvdev} ${rootdelay} - done - fi - - [ "${quiet}" = "y" ] && LVMQUIET=">/dev/null" - - msg "Scanning logical volumes..." - eval /sbin/lvm vgscan --ignorelockingfailure $LVMQUIET - msg "Activating logical volumes..." - eval /sbin/lvm vgchange --ignorelockingfailure --ignoremonitoring -ay $LVMQUIET - fi -} diff --git a/abs/core/device-mapper/lvm2_install b/abs/core/device-mapper/lvm2_install deleted file mode 100644 index 4ce9f18..0000000 --- a/abs/core/device-mapper/lvm2_install +++ /dev/null @@ -1,30 +0,0 @@ -# vim: set ft=sh: - -install () -{ - MODULES=" dm-mod dm-snapshot dm-mirror" - BINARIES="" - FILES="" - SCRIPT="lvm2" - - add_dir "/dev/mapper" - add_binary "/sbin/lvm" - add_binary "/sbin/dmsetup" - add_binary "/sbin/dmeventd" - add_file "/lib/udev/rules.d/10-dm.rules" - add_file "/lib/udev/rules.d/13-dm-disk.rules" - add_file "/lib/udev/rules.d/95-dm-notify.rules" - add_file "/lib/udev/rules.d/11-dm-lvm.rules" -} - -help () -{ -cat< - - * directfb 1.2.0-1 - * Upstream update - * Added ChangeLog diff --git a/abs/core/directfb/dfb_serial.diff b/abs/core/directfb/dfb_serial.diff deleted file mode 100644 index 638467b..0000000 --- a/abs/core/directfb/dfb_serial.diff +++ /dev/null @@ -1,10 +0,0 @@ ---- lib/direct/serial.h.orig 2009-02-11 05:40:20.000000000 +0000 -+++ lib/direct/serial.h 2009-02-11 05:40:44.000000000 +0000 -@@ -31,6 +31,7 @@ - - #include - #include -+#include - - struct __D_DirectSerial { - int magic; diff --git a/abs/core/faac/libmp4v2.patch b/abs/core/faac/libmp4v2.patch deleted file mode 100644 index b2c0165..0000000 --- a/abs/core/faac/libmp4v2.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- faac/configure.in 2006-08-13 14:17:26.000000000 +0000 -+++ faac-patched/configure.in 2007-01-29 19:18:45.000000000 +0000 -@@ -35,6 +35,8 @@ - - if test x$external_mp4v2 = xyes; then - AC_MSG_NOTICE([*** Building with external mp4v2 ***]) -+ MY_DEFINE(HAVE_LIBMP4V2) -+ LIBS="-lmp4v2 $LIBS" - else - if test x$WITHMP4V2 = xyes; then - AC_MSG_NOTICE([*** Building with internal mp4v2 ***]) diff --git a/abs/core/faac/pipe-output.patch b/abs/core/faac/pipe-output.patch deleted file mode 100644 index a8581f3..0000000 --- a/abs/core/faac/pipe-output.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- faac/frontend/main.c 2004-12-08 11:07:17.000000000 +0000 -+++ faac-patched/frontend/main.c 2007-01-29 19:17:26.000000000 +0000 -@@ -918,7 +918,14 @@ - { - #endif - /* open the aac output file */ -- outfile = fopen(aacFileName, "wb"); -+ if (aacFileName[0] == '-') -+ { -+ outfile = stdout; -+ } -+ else -+ { -+ outfile = fopen(aacFileName, "wb"); -+ } - if (!outfile) - { - fprintf(stderr, "Couldn't create output file %s\n", aacFileName); diff --git a/abs/core/freetype2/bytecode.patch b/abs/core/freetype2/bytecode.patch deleted file mode 100644 index dd901ad..0000000 --- a/abs/core/freetype2/bytecode.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- include/freetype/config/ftoption.h.old 2006-05-12 02:05:49.000000000 +0800 -+++ include/freetype/config/ftoption.h 2006-10-02 01:22:50.000000000 +0800 -@@ -436,7 +436,7 @@ - /* Do not #undef this macro here, since the build system might */ - /* define it for certain configurations only. */ - /* */ --/* #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER */ -+#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER - - - /*************************************************************************/ -@@ -448,7 +448,7 @@ - /* FT_PARAM_TAG_UNPATENTED_HINTING; or when the debug hook */ - /* FT_DEBUG_HOOK_UNPATENTED_HINTING is globally activated. */ - /* */ --#define TT_CONFIG_OPTION_UNPATENTED_HINTING -+#undef TT_CONFIG_OPTION_UNPATENTED_HINTING - - - /*************************************************************************/ -@@ -480,7 +480,7 @@ - /* http://partners.adobe.com/asn/developer/opentype/glyf.html */ - /* http://fonts.apple.com/TTRefMan/RM06/Chap6glyf.html */ - /* */ --#undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED -+#define TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED - - - /*************************************************************************/ diff --git a/abs/core/freetype2/freetype-2.2.1-memcpy-fix.patch b/abs/core/freetype2/freetype-2.2.1-memcpy-fix.patch deleted file mode 100644 index 67a1c07..0000000 --- a/abs/core/freetype2/freetype-2.2.1-memcpy-fix.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- freetype-2.2.1/src/psaux/psobjs.c~ 2006-04-26 16:38:17.000000000 +0200 -+++ freetype-2.2.1/src/psaux/psobjs.c 2006-09-10 15:01:13.000000000 +0200 -@@ -165,6 +165,11 @@ - return PSaux_Err_Invalid_Argument; - } - -+ if ( length < 0 ) { -+ FT_ERROR(( "ps_table_add: invalid length\n" )); -+ return PSaux_Err_Invalid_Argument; -+ } -+ - /* grow the base block if needed */ - if ( table->cursor + length > table->capacity ) - { diff --git a/abs/core/freetype2/freetype-2.3.3-ftbitmap.patch b/abs/core/freetype2/freetype-2.3.3-ftbitmap.patch deleted file mode 100644 index bbb8b2b..0000000 --- a/abs/core/freetype2/freetype-2.3.3-ftbitmap.patch +++ /dev/null @@ -1,25 +0,0 @@ -=================================================================== -RCS file: /var/lib/cvs/sources/freetype/freetype2/src/base/ftbitmap.c,v -retrieving revision 1.17 -retrieving revision 1.18 -diff -u -r1.17 -r1.18 ---- freetype/freetype2/src/base/ftbitmap.c 2007/03/29 11:56:21 1.17 -+++ freetype/freetype2/src/base/ftbitmap.c 2007/04/06 08:19:04 1.18 -@@ -149,15 +149,15 @@ - if ( bit_last < bit_width ) - { - FT_Byte* line = bitmap->buffer + ( bit_last >> 3 ); -+ FT_Byte* end = bitmap->buffer + pitch; - FT_Int shift = bit_last & 7; - FT_UInt mask = 0xFF00U >> shift; - FT_Int count = height; - - -- for ( ; count > 0; count--, line += pitch ) -+ for ( ; count > 0; count--, line += pitch, end += pitch ) - { - FT_Byte* write = line; -- FT_Byte* end = line + pitch; - - - if ( shift > 0 ) diff --git a/abs/core/freetype2/freetype2.install b/abs/core/freetype2/freetype2.install deleted file mode 100644 index 704adac..0000000 --- a/abs/core/freetype2/freetype2.install +++ /dev/null @@ -1,23 +0,0 @@ -# arg 1: the new package version -post_install() { - echo -n "updating font cache... " - /sbin/ldconfig -r . - /usr/bin/fc-cache -f - echo "done." -} - -# arg 1: the new package version -# arg 2: the old package version -post_upgrade() { - post_install $1 -} - -# arg 1: the old package version -pre_remove() { - /bin/true -} - -op=$1 -shift - -$op $* diff --git a/abs/core/ftgl/ftgl-gcc411.patch b/abs/core/ftgl/ftgl-gcc411.patch deleted file mode 100644 index f52d48b..0000000 --- a/abs/core/ftgl/ftgl-gcc411.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -ruN FTGL.org/include/FTTextureGlyph.h FTGL/include/FTTextureGlyph.h ---- FTGL.org/include/FTTextureGlyph.h 2006-07-11 17:49:42.000000000 +0200 -+++ FTGL/include/FTTextureGlyph.h 2006-07-11 17:50:23.000000000 +0200 -@@ -52,7 +52,7 @@ - * Reset the currently active texture to zero to get into a known state before - * drawing a string. This is to get round possible threading issues. - */ -- static void FTTextureGlyph::ResetActiveTexture(){ activeTextureID = 0;} -+ static void ResetActiveTexture(){ activeTextureID = 0;} - - private: - /** diff --git a/abs/core/gawk/gawk-3.1.5-segfault_fix-1.patch b/abs/core/gawk/gawk-3.1.5-segfault_fix-1.patch deleted file mode 100644 index aa2f17b..0000000 --- a/abs/core/gawk/gawk-3.1.5-segfault_fix-1.patch +++ /dev/null @@ -1,43 +0,0 @@ -Submitted By: Matthew Burgess -Date: 2005-09-24 -Initial Package Version: 3.1.5 -Upstream Status: From Upstream -Origin: http://lists.gnu.org/archive/html/bug-gnu-utils/2005-08/msg00047.html -Description: Fixes a bug which causes gawk to segfault when operating on a non-existent file. - -diff -Naur gawk-3.1.5.orig/io.c gawk-3.1.5/io.c ---- gawk-3.1.5.orig/io.c 2005-07-26 18:07:43.000000000 +0000 -+++ gawk-3.1.5/io.c 2005-09-24 14:43:13.771380264 +0000 -@@ -2480,9 +2480,12 @@ - { - struct stat sbuf; - struct open_hook *oh; -+ int iop_malloced = FALSE; - -- if (iop == NULL) -+ if (iop == NULL) { - emalloc(iop, IOBUF *, sizeof(IOBUF), "iop_alloc"); -+ iop_malloced = TRUE; -+ } - memset(iop, '\0', sizeof(IOBUF)); - iop->flag = 0; - iop->fd = fd; -@@ -2495,7 +2498,8 @@ - } - - if (iop->fd == INVALID_HANDLE) { -- free(iop); -+ if (iop_malloced) -+ free(iop); - return NULL; - } - if (isatty(iop->fd)) -@@ -2503,7 +2507,7 @@ - iop->readsize = iop->size = optimal_bufsize(iop->fd, & sbuf); - iop->sbuf = sbuf; - if (do_lint && S_ISREG(sbuf.st_mode) && sbuf.st_size == 0) -- lintwarn(_("data file `%s' is empty"), name); -+ lintwarn(_("data file `%s' is empty"), name); - errno = 0; - iop->count = iop->scanoff = 0; - emalloc(iop->buf, char *, iop->size += 2, "iop_alloc"); diff --git a/abs/core/grep/01-fgrep.patch b/abs/core/grep/01-fgrep.patch deleted file mode 100644 index c7f8f96..0000000 --- a/abs/core/grep/01-fgrep.patch +++ /dev/null @@ -1,145 +0,0 @@ ---- grep-2.5.1/src/search.c.fgrep 2001-04-19 04:42:14.000000000 +0100 -+++ grep-2.5.1/src/search.c 2004-02-26 13:09:32.000000000 +0000 -@@ -360,13 +360,7 @@ - /* Find a possible match using the KWset matcher. */ - size_t offset = kwsexec (kwset, beg, buflim - beg, &kwsm); - if (offset == (size_t) -1) -- { --#ifdef MBS_SUPPORT -- if (MB_CUR_MAX > 1) -- free(mb_properties); --#endif -- return (size_t)-1; -- } -+ goto failure; - beg += offset; - /* Narrow down to the line containing the candidate, and - run it through DFA. */ -@@ -379,7 +373,7 @@ - while (beg > buf && beg[-1] != eol) - --beg; - if (kwsm.index < kwset_exact_matches) -- goto success; -+ goto success_in_beg_and_end; - if (dfaexec (&dfa, beg, end - beg, &backref) == (size_t) -1) - continue; - } -@@ -398,7 +392,7 @@ - } - /* Successful, no backreferences encountered! */ - if (!backref) -- goto success; -+ goto success_in_beg_and_end; - } - else - end = beg + size; -@@ -413,14 +407,11 @@ - end - beg - 1, &(patterns[i].regs)))) - { - len = patterns[i].regs.end[0] - start; -- if (exact) -- { -- *match_size = len; -- return start; -- } -+ if (exact && !match_words) -+ goto success_in_start_and_len; - if ((!match_lines && !match_words) - || (match_lines && len == end - beg - 1)) -- goto success; -+ goto success_in_beg_and_end; - /* If -w, check if the match aligns with word boundaries. - We do this iteratively because: - (a) the line may contain more than one occurence of the -@@ -434,7 +425,7 @@ - if ((start == 0 || !WCHAR ((unsigned char) beg[start - 1])) - && (len == end - beg - 1 - || !WCHAR ((unsigned char) beg[start + len]))) -- goto success; -+ goto success_in_beg_and_end; - if (len > 0) - { - /* Try a shorter length anchored at the same place. */ -@@ -461,19 +452,26 @@ - } - } /* for Regex patterns. */ - } /* for (beg = end ..) */ -+ -+ failure: - #ifdef MBS_SUPPORT - if (MB_CUR_MAX > 1 && mb_properties) - free (mb_properties); - #endif /* MBS_SUPPORT */ - return (size_t) -1; - -- success: -+ success_in_beg_and_end: -+ len = end - beg; -+ start = beg - buf; -+ /* FALLTHROUGH */ -+ -+ success_in_start_and_len: - #ifdef MBS_SUPPORT - if (MB_CUR_MAX > 1 && mb_properties) - free (mb_properties); - #endif /* MBS_SUPPORT */ -- *match_size = end - beg; -- return beg - buf; -+ *match_size = len; -+ return start; - } - - static void -@@ -516,28 +514,15 @@ - { - size_t offset = kwsexec (kwset, beg, buf + size - beg, &kwsmatch); - if (offset == (size_t) -1) -- { --#ifdef MBS_SUPPORT -- if (MB_CUR_MAX > 1) -- free(mb_properties); --#endif /* MBS_SUPPORT */ -- return offset; -- } -+ goto failure; - #ifdef MBS_SUPPORT - if (MB_CUR_MAX > 1 && mb_properties[offset+beg-buf] == 0) - continue; /* It is a part of multibyte character. */ - #endif /* MBS_SUPPORT */ - beg += offset; - len = kwsmatch.size[0]; -- if (exact) -- { -- *match_size = len; --#ifdef MBS_SUPPORT -- if (MB_CUR_MAX > 1) -- free (mb_properties); --#endif /* MBS_SUPPORT */ -- return beg - buf; -- } -+ if (exact && !match_words) -+ goto success_in_beg_and_len; - if (match_lines) - { - if (beg > buf && beg[-1] != eol) -@@ -551,6 +536,7 @@ - goto success; - } - -+ failure: - #ifdef MBS_SUPPORT - if (MB_CUR_MAX > 1) - free (mb_properties); -@@ -583,7 +569,11 @@ - end++; - while (buf < beg && beg[-1] != eol) - --beg; -- *match_size = end - beg; -+ len = end - beg; -+ /* FALLTHROUGH */ -+ -+ success_in_beg_and_len: -+ *match_size = len; - #ifdef MBS_SUPPORT - if (MB_CUR_MAX > 1) - free (mb_properties); diff --git a/abs/core/grep/02-bracket.patch b/abs/core/grep/02-bracket.patch deleted file mode 100644 index f99571c..0000000 --- a/abs/core/grep/02-bracket.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- grep-2.5.1/src/dfa.c.bracket 2003-10-30 16:21:14.000000000 +0000 -+++ grep-2.5.1/src/dfa.c 2003-10-30 16:22:38.000000000 +0000 -@@ -586,7 +586,7 @@ - work_mbc->coll_elems[work_mbc->ncoll_elems++] = elem; - } - } -- wc = -1; -+ wc1 = wc = -1; - } - else - /* We treat '[' as a normal character here. */ diff --git a/abs/core/grep/03-i18n.patch b/abs/core/grep/03-i18n.patch deleted file mode 100644 index 8dc3dfe..0000000 --- a/abs/core/grep/03-i18n.patch +++ /dev/null @@ -1,303 +0,0 @@ ---- grep-2.5.1/src/dfa.c 2004-02-26 13:09:54.000000000 +0000 -+++ grep-2.5.1/src/dfa.c 2004-05-18 16:43:31.189200479 +0100 -@@ -414,7 +414,7 @@ - - /* This function fetch a wide character, and update cur_mb_len, - used only if the current locale is a multibyte environment. */ --static wchar_t -+static wint_t - fetch_wc (char const *eoferr) - { - wchar_t wc; -@@ -423,7 +423,7 @@ - if (eoferr != 0) - dfaerror (eoferr); - else -- return -1; -+ return WEOF; - } - - cur_mb_len = mbrtowc(&wc, lexptr, lexleft, &mbs); -@@ -459,7 +459,7 @@ - static void - parse_bracket_exp_mb () - { -- wchar_t wc, wc1, wc2; -+ wint_t wc, wc1, wc2; - - /* Work area to build a mb_char_classes. */ - struct mb_char_classes *work_mbc; -@@ -496,7 +496,7 @@ - work_mbc->invert = 0; - do - { -- wc1 = -1; /* mark wc1 is not initialized". */ -+ wc1 = WEOF; /* mark wc1 is not initialized". */ - - /* Note that if we're looking at some other [:...:] construct, - we just treat it as a bunch of ordinary characters. We can do -@@ -586,7 +586,7 @@ - work_mbc->coll_elems[work_mbc->ncoll_elems++] = elem; - } - } -- wc1 = wc = -1; -+ wc1 = wc = WEOF; - } - else - /* We treat '[' as a normal character here. */ -@@ -600,7 +600,7 @@ - wc = fetch_wc(("Unbalanced [")); - } - -- if (wc1 == -1) -+ if (wc1 == WEOF) - wc1 = fetch_wc(_("Unbalanced [")); - - if (wc1 == L'-') -@@ -630,17 +630,17 @@ - } - REALLOC_IF_NECESSARY(work_mbc->range_sts, wchar_t, - range_sts_al, work_mbc->nranges + 1); -- work_mbc->range_sts[work_mbc->nranges] = wc; -+ work_mbc->range_sts[work_mbc->nranges] = (wchar_t)wc; - REALLOC_IF_NECESSARY(work_mbc->range_ends, wchar_t, - range_ends_al, work_mbc->nranges + 1); -- work_mbc->range_ends[work_mbc->nranges++] = wc2; -+ work_mbc->range_ends[work_mbc->nranges++] = (wchar_t)wc2; - } -- else if (wc != -1) -+ else if (wc != WEOF) - /* build normal characters. */ - { - REALLOC_IF_NECESSARY(work_mbc->chars, wchar_t, chars_al, - work_mbc->nchars + 1); -- work_mbc->chars[work_mbc->nchars++] = wc; -+ work_mbc->chars[work_mbc->nchars++] = (wchar_t)wc; - } - } - while ((wc = wc1) != L']'); -@@ -2552,6 +2552,8 @@ - } - - /* match with a character? */ -+ if (case_fold) -+ wc = towlower (wc); - for (i = 0; inchars; i++) - { - if (wc == work_mbc->chars[i]) ---- grep-2.5.1/src/grep.c.i18n 2002-03-26 15:54:12.000000000 +0000 -+++ grep-2.5.1/src/grep.c 2004-02-26 13:09:54.000000000 +0000 -@@ -30,6 +30,12 @@ - # include - # include - #endif -+#if defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H && defined HAVE_MBRTOWC -+/* We can handle multibyte string. */ -+# define MBS_SUPPORT -+# include -+# include -+#endif - #include - #include "system.h" - #include "getopt.h" -@@ -1697,6 +1703,37 @@ - if (!install_matcher (matcher) && !install_matcher ("default")) - abort (); - -+#ifdef MBS_SUPPORT -+ if (MB_CUR_MAX != 1 && match_icase) -+ { -+ wchar_t wc; -+ mbstate_t cur_state, prev_state; -+ int i, len = strlen(keys); -+ -+ memset(&cur_state, 0, sizeof(mbstate_t)); -+ for (i = 0; i <= len ;) -+ { -+ size_t mbclen; -+ mbclen = mbrtowc(&wc, keys + i, len - i, &cur_state); -+ if (mbclen == (size_t) -1 || mbclen == (size_t) -2 || mbclen == 0) -+ { -+ /* An invalid sequence, or a truncated multibyte character. -+ We treat it as a singlebyte character. */ -+ mbclen = 1; -+ } -+ else -+ { -+ if (iswupper((wint_t)wc)) -+ { -+ wc = towlower((wint_t)wc); -+ wcrtomb(keys + i, wc, &cur_state); -+ } -+ } -+ i += mbclen; -+ } -+ } -+#endif /* MBS_SUPPORT */ -+ - (*compile)(keys, keycc); - - if ((argc - optind > 1 && !no_filenames) || with_filenames) ---- grep-2.5.1/src/search.c.i18n 2004-02-26 13:09:54.000000000 +0000 -+++ grep-2.5.1/src/search.c 2004-02-26 13:17:12.000000000 +0000 -@@ -149,15 +149,16 @@ - static char* - check_multibyte_string(char const *buf, size_t size) - { -- char *mb_properties = malloc(size); -+ char *mb_properties = xmalloc(size); - mbstate_t cur_state; -+ wchar_t wc; - int i; - memset(&cur_state, 0, sizeof(mbstate_t)); - memset(mb_properties, 0, sizeof(char)*size); - for (i = 0; i < size ;) - { - size_t mbclen; -- mbclen = mbrlen(buf + i, size - i, &cur_state); -+ mbclen = mbrtowc(&wc, buf + i, size - i, &cur_state); - - if (mbclen == (size_t) -1 || mbclen == (size_t) -2 || mbclen == 0) - { -@@ -165,6 +166,14 @@ - We treat it as a singlebyte character. */ - mbclen = 1; - } -+ else if (match_icase) -+ { -+ if (iswupper((wint_t)wc)) -+ { -+ wc = towlower((wint_t)wc); -+ wcrtomb(buf + i, wc, &cur_state); -+ } -+ } - mb_properties[i] = mbclen; - i += mbclen; - } -@@ -233,7 +242,7 @@ - static char const line_end[] = "\\)$"; - static char const word_beg[] = "\\(^\\|[^[:alnum:]_]\\)\\("; - static char const word_end[] = "\\)\\([^[:alnum:]_]\\|$\\)"; -- char *n = malloc (sizeof word_beg - 1 + size + sizeof word_end); -+ char *n = xmalloc (sizeof word_beg - 1 + size + sizeof word_end); - size_t i; - strcpy (n, match_lines ? line_beg : word_beg); - i = strlen (n); -@@ -316,7 +325,7 @@ - static char const line_end[] = ")$"; - static char const word_beg[] = "(^|[^[:alnum:]_])("; - static char const word_end[] = ")([^[:alnum:]_]|$)"; -- char *n = malloc (sizeof word_beg - 1 + size + sizeof word_end); -+ char *n = xmalloc (sizeof word_beg - 1 + size + sizeof word_end); - size_t i; - strcpy (n, match_lines ? line_beg : word_beg); - i = strlen(n); -@@ -339,14 +348,20 @@ - char eol = eolbyte; - int backref, start, len; - struct kwsmatch kwsm; -- size_t i; -+ size_t i, ret_val; - #ifdef MBS_SUPPORT - char *mb_properties = NULL; --#endif /* MBS_SUPPORT */ -- --#ifdef MBS_SUPPORT -- if (MB_CUR_MAX > 1 && kwset) -- mb_properties = check_multibyte_string(buf, size); -+ if (MB_CUR_MAX > 1) -+ { -+ if (match_icase) -+ { -+ char *case_buf = xmalloc(size); -+ memcpy(case_buf, buf, size); -+ buf = case_buf; -+ } -+ if (kwset) -+ mb_properties = check_multibyte_string(buf, size); -+ } - #endif /* MBS_SUPPORT */ - - buflim = buf + size; -@@ -455,8 +470,13 @@ - - failure: - #ifdef MBS_SUPPORT -- if (MB_CUR_MAX > 1 && mb_properties) -- free (mb_properties); -+ if (MB_CUR_MAX > 1) -+ { -+ if (mb_properties) -+ free (mb_properties); -+ if (match_icase) -+ free ((char *) buf); -+ } - #endif /* MBS_SUPPORT */ - return (size_t) -1; - -@@ -467,8 +487,13 @@ - - success_in_start_and_len: - #ifdef MBS_SUPPORT -- if (MB_CUR_MAX > 1 && mb_properties) -- free (mb_properties); -+ if (MB_CUR_MAX > 1) -+ { -+ if (mb_properties) -+ free (mb_properties); -+ if (match_icase) -+ free ((char *) buf); -+ } - #endif /* MBS_SUPPORT */ - *match_size = len; - return start; -@@ -504,10 +529,19 @@ - register size_t len; - char eol = eolbyte; - struct kwsmatch kwsmatch; -+ size_t ret_val; - #ifdef MBS_SUPPORT -- char *mb_properties; -+ char *mb_properties = NULL; - if (MB_CUR_MAX > 1) -- mb_properties = check_multibyte_string (buf, size); -+ { -+ if (match_icase) -+ { -+ char *case_buf = xmalloc(size); -+ memcpy(case_buf, buf, size); -+ buf = case_buf; -+ } -+ mb_properties = check_multibyte_string(buf, size); -+ } - #endif /* MBS_SUPPORT */ - - for (beg = buf; beg <= buf + size; ++beg) -@@ -565,7 +599,12 @@ - failure: - #ifdef MBS_SUPPORT - if (MB_CUR_MAX > 1) -- free (mb_properties); -+ { -+ if (match_icase) -+ free((char *) buf); -+ if (mb_properties) -+ free(mb_properties); -+ } - #endif /* MBS_SUPPORT */ - return -1; - -@@ -581,7 +620,12 @@ - *match_size = len; - #ifdef MBS_SUPPORT - if (MB_CUR_MAX > 1) -- free (mb_properties); -+ { -+ if (mb_properties) -+ free (mb_properties); -+ if (match_icase) -+ free ((char *) buf); -+ } - #endif /* MBS_SUPPORT */ - return beg - buf; - } diff --git a/abs/core/grep/04-oi.patch b/abs/core/grep/04-oi.patch deleted file mode 100644 index eb997ad..0000000 --- a/abs/core/grep/04-oi.patch +++ /dev/null @@ -1,48 +0,0 @@ ---- grep-2.5.1/lib/posix/regex.h.oi 2004-01-05 12:09:12.984391131 +0000 -+++ grep-2.5.1/lib/posix/regex.h 2004-01-05 12:09:24.717990622 +0000 -@@ -109,6 +109,10 @@ - If not set, \{, \}, {, and } are literals. */ - #define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1) - -+/* If this bit is set, then ignore case when matching. -+ If not set, then case is significant. */ -+#define RE_ICASE (RE_INVALID_INTERVAL_ORD << 1) -+ - /* If this bit is set, +, ? and | aren't recognized as operators. - If not set, they are. */ - #define RE_LIMITED_OPS (RE_INTERVALS << 1) ---- grep-2.5.1/src/search.c.oi 2004-01-05 12:07:00.550199415 +0000 -+++ grep-2.5.1/src/search.c 2004-01-05 12:07:00.566197505 +0000 -@@ -31,7 +31,7 @@ - - #include "system.h" - #include "grep.h" --#include "regex.h" -+#include - #include "dfa.h" - #include "kwset.h" - #include "error.h" -@@ -190,7 +190,7 @@ - size_t total = size; - char const *motif = pattern; - -- re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE); -+ re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE | (match_icase ? RE_ICASE : 0)); - dfasyntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE, match_icase, eolbyte); - - /* For GNU regex compiler we have to pass the patterns separately to detect -@@ -268,12 +268,12 @@ - - if (strcmp (matcher, "awk") == 0) - { -- re_set_syntax (RE_SYNTAX_AWK); -+ re_set_syntax (RE_SYNTAX_AWK | (match_icase ? RE_ICASE : 0)); - dfasyntax (RE_SYNTAX_AWK, match_icase, eolbyte); - } - else - { -- re_set_syntax (RE_SYNTAX_POSIX_EGREP); -+ re_set_syntax (RE_SYNTAX_POSIX_EGREP | (match_icase ? RE_ICASE : 0)); - dfasyntax (RE_SYNTAX_POSIX_EGREP, match_icase, eolbyte); - } - diff --git a/abs/core/grep/05-manpage.patch b/abs/core/grep/05-manpage.patch deleted file mode 100644 index 284f0c4..0000000 --- a/abs/core/grep/05-manpage.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- grep-2.5.1/doc/grep.1.manpage 2002-01-22 13:20:04.000000000 +0000 -+++ grep-2.5.1/doc/grep.1 2003-10-08 09:37:32.000000000 +0100 -@@ -191,6 +191,7 @@ - .I PATTERN - as a list of fixed strings, separated by newlines, - any of which is to be matched. -+.TP - .BR \-P ", " \-\^\-perl-regexp - Interpret - .I PATTERN -@@ -302,7 +303,7 @@ - This is especially useful for tools like zgrep, e.g. - .B "gzip -cd foo.gz |grep --label=foo something" - .TP --.BR \-\^\-line-buffering -+.BR \-\^\-line-buffered - Use line buffering, it can be a performance penality. - .TP - .BR \-q ", " \-\^\-quiet ", " \-\^\-silent diff --git a/abs/core/grep/06-color.patch b/abs/core/grep/06-color.patch deleted file mode 100644 index f54c258..0000000 --- a/abs/core/grep/06-color.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- grep-2.5.1/src/grep.c.color 2004-11-16 16:46:22.845505847 +0000 -+++ grep-2.5.1/src/grep.c 2004-11-16 16:46:27.961530537 +0000 -@@ -607,6 +607,7 @@ - fputs ("\33[00m", stdout); - beg = b + match_size; - } -+ fputs ("\33[K", stdout); - } - fwrite (beg, 1, lim - beg, stdout); - if (ferror (stdout)) diff --git a/abs/core/grep/07-icolor.patch b/abs/core/grep/07-icolor.patch deleted file mode 100644 index 14b2617..0000000 --- a/abs/core/grep/07-icolor.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- grep-2.5.1a/src/grep.c.icolor 2005-01-07 12:05:20.877785250 +0000 -+++ grep-2.5.1a/src/grep.c 2005-01-07 12:05:44.690194388 +0000 -@@ -564,33 +564,6 @@ - { - size_t match_size; - size_t match_offset; -- if(match_icase) -- { -- /* Yuck, this is tricky */ -- char *buf = (char*) xmalloc (lim - beg); -- char *ibeg = buf; -- char *ilim = ibeg + (lim - beg); -- int i; -- for (i = 0; i < lim - beg; i++) -- ibeg[i] = tolower (beg[i]); -- while ((match_offset = (*execute) (ibeg, ilim-ibeg, &match_size, 1)) -- != (size_t) -1) -- { -- char const *b = beg + match_offset; -- if (b == lim) -- break; -- fwrite (beg, sizeof (char), match_offset, stdout); -- printf ("\33[%sm", grep_color); -- fwrite (b, sizeof (char), match_size, stdout); -- fputs ("\33[00m", stdout); -- beg = b + match_size; -- ibeg = ibeg + match_offset + match_size; -- } -- fwrite (beg, 1, lim - beg, stdout); -- free (buf); -- lastout = lim; -- return; -- } - while (lim-beg && (match_offset = (*execute) (beg, lim - beg, &match_size, 1)) - != (size_t) -1) - { diff --git a/abs/core/grep/08-skip.patch b/abs/core/grep/08-skip.patch deleted file mode 100644 index fb6645f..0000000 --- a/abs/core/grep/08-skip.patch +++ /dev/null @@ -1,42 +0,0 @@ ---- grep-2.5.1a/src/grep.c.skip 2006-05-31 09:26:58.000000000 +0100 -+++ grep-2.5.1a/src/grep.c 2006-05-31 09:28:24.000000000 +0100 -@@ -261,19 +261,6 @@ - bufbeg[-1] = eolbyte; - bufdesc = fd; - -- if (fstat (fd, &stats->stat) != 0) -- { -- error (0, errno, "fstat"); -- return 0; -- } -- if (directories == SKIP_DIRECTORIES && S_ISDIR (stats->stat.st_mode)) -- return 0; --#ifndef DJGPP -- if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode) || S_ISSOCK(stats->stat.st_mode))) --#else -- if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode))) --#endif -- return 0; - if (S_ISREG (stats->stat.st_mode)) - { - if (file) -@@ -875,6 +862,19 @@ - } - else - { -+ if (stat (file, &stats->stat) != 0) -+ { -+ suppressible_error (file, errno); -+ return 1; -+ } -+ if (directories == SKIP_DIRECTORIES && S_ISDIR (stats->stat.st_mode)) -+ return 1; -+#ifndef DJGPP -+ if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode) || S_ISSOCK(stats->stat.st_mode) || S_ISFIFO(stats->stat.st_mode))) -+#else -+ if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode))) -+#endif -+ return 1; - while ((desc = open (file, O_RDONLY)) < 0 && errno == EINTR) - continue; - diff --git a/abs/core/grep/09-egf-speedup.patch b/abs/core/grep/09-egf-speedup.patch deleted file mode 100644 index 08e92c7..0000000 --- a/abs/core/grep/09-egf-speedup.patch +++ /dev/null @@ -1,823 +0,0 @@ ---- grep-2.5.1/src/search.c 2004-12-31 15:28:35.720391036 +0000 -+++ grep-2.5.1a/src/search.c 2005-01-07 14:53:10.308860193 +0000 -@@ -18,9 +18,13 @@ - - /* Written August 1992 by Mike Haertel. */ - -+#ifndef _GNU_SOURCE -+# define _GNU_SOURCE 1 -+#endif - #ifdef HAVE_CONFIG_H - # include - #endif -+#include - #include - #if defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H && defined HAVE_MBRTOWC - /* We can handle multibyte string. */ -@@ -39,6 +43,9 @@ - #ifdef HAVE_LIBPCRE - # include - #endif -+#ifdef HAVE_LANGINFO_CODESET -+# include -+#endif - - #define NCHAR (UCHAR_MAX + 1) - -@@ -70,9 +77,10 @@ - call the regexp matcher at all. */ - static int kwset_exact_matches; - --#if defined(MBS_SUPPORT) --static char* check_multibyte_string PARAMS ((char const *buf, size_t size)); --#endif -+/* UTF-8 encoding allows some optimizations that we can't otherwise -+ assume in a multibyte encoding. */ -+static int using_utf8; -+ - static void kwsinit PARAMS ((void)); - static void kwsmusts PARAMS ((void)); - static void Gcompile PARAMS ((char const *, size_t)); -@@ -84,6 +92,15 @@ - static size_t Pexecute PARAMS ((char const *, size_t, size_t *, int)); - - void -+check_utf8 (void) -+{ -+#ifdef HAVE_LANGINFO_CODESET -+ if (strcmp (nl_langinfo (CODESET), "UTF-8") == 0) -+ using_utf8 = 1; -+#endif -+} -+ -+void - dfaerror (char const *mesg) - { - error (2, 0, mesg); -@@ -141,47 +158,6 @@ - } - } - --#ifdef MBS_SUPPORT --/* This function allocate the array which correspond to "buf". -- Then this check multibyte string and mark on the positions which -- are not singlebyte character nor the first byte of a multibyte -- character. Caller must free the array. */ --static char* --check_multibyte_string(char const *buf, size_t size) --{ -- char *mb_properties = xmalloc(size); -- mbstate_t cur_state; -- wchar_t wc; -- int i; -- memset(&cur_state, 0, sizeof(mbstate_t)); -- memset(mb_properties, 0, sizeof(char)*size); -- for (i = 0; i < size ;) -- { -- size_t mbclen; -- mbclen = mbrtowc(&wc, buf + i, size - i, &cur_state); -- -- if (mbclen == (size_t) -1 || mbclen == (size_t) -2 || mbclen == 0) -- { -- /* An invalid sequence, or a truncated multibyte character. -- We treat it as a singlebyte character. */ -- mbclen = 1; -- } -- else if (match_icase) -- { -- if (iswupper((wint_t)wc)) -- { -- wc = towlower((wint_t)wc); -- wcrtomb(buf + i, wc, &cur_state); -- } -- } -- mb_properties[i] = mbclen; -- i += mbclen; -- } -- -- return mb_properties; --} --#endif -- - static void - Gcompile (char const *pattern, size_t size) - { -@@ -190,6 +166,7 @@ - size_t total = size; - char const *motif = pattern; - -+ check_utf8 (); - re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE | (match_icase ? RE_ICASE : 0)); - dfasyntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE, match_icase, eolbyte); - -@@ -266,6 +243,7 @@ - size_t total = size; - char const *motif = pattern; - -+ check_utf8 (); - if (strcmp (matcher, "awk") == 0) - { - re_set_syntax (RE_SYNTAX_AWK | (match_icase ? RE_ICASE : 0)); -@@ -350,18 +328,9 @@ - struct kwsmatch kwsm; - size_t i, ret_val; - #ifdef MBS_SUPPORT -- char *mb_properties = NULL; -- if (MB_CUR_MAX > 1) -- { -- if (match_icase) -- { -- char *case_buf = xmalloc(size); -- memcpy(case_buf, buf, size); -- buf = case_buf; -- } -- if (kwset) -- mb_properties = check_multibyte_string(buf, size); -- } -+ int mb_cur_max = MB_CUR_MAX; -+ mbstate_t mbs; -+ memset (&mbs, '\0', sizeof (mbstate_t)); - #endif /* MBS_SUPPORT */ - - buflim = buf + size; -@@ -373,21 +342,63 @@ - if (kwset) - { - /* Find a possible match using the KWset matcher. */ -- size_t offset = kwsexec (kwset, beg, buflim - beg, &kwsm); -+#ifdef MBS_SUPPORT -+ size_t bytes_left = 0; -+#endif /* MBS_SUPPORT */ -+ size_t offset; -+#ifdef MBS_SUPPORT -+ /* kwsexec doesn't work with match_icase and multibyte input. */ -+ if (match_icase && mb_cur_max > 1) -+ /* Avoid kwset */ -+ offset = 0; -+ else -+#endif /* MBS_SUPPORT */ -+ offset = kwsexec (kwset, beg, buflim - beg, &kwsm); - if (offset == (size_t) -1) - goto failure; -+#ifdef MBS_SUPPORT -+ if (mb_cur_max > 1 && !using_utf8) -+ { -+ bytes_left = offset; -+ while (bytes_left) -+ { -+ size_t mlen = mbrlen (beg, bytes_left, &mbs); -+ if (mlen == (size_t) -1 || mlen == 0) -+ { -+ /* Incomplete character: treat as single-byte. */ -+ memset (&mbs, '\0', sizeof (mbstate_t)); -+ beg++; -+ bytes_left--; -+ continue; -+ } -+ -+ if (mlen == (size_t) -2) -+ /* Offset points inside multibyte character: -+ * no good. */ -+ break; -+ -+ beg += mlen; -+ bytes_left -= mlen; -+ } -+ } -+ else -+#endif /* MBS_SUPPORT */ - beg += offset; - /* Narrow down to the line containing the candidate, and - run it through DFA. */ - end = memchr(beg, eol, buflim - beg); - end++; - #ifdef MBS_SUPPORT -- if (MB_CUR_MAX > 1 && mb_properties[beg - buf] == 0) -+ if (mb_cur_max > 1 && bytes_left) - continue; --#endif -+#endif /* MBS_SUPPORT */ - while (beg > buf && beg[-1] != eol) - --beg; -- if (kwsm.index < kwset_exact_matches) -+ if ( -+#ifdef MBS_SUPPORT -+ !(match_icase && mb_cur_max > 1) && -+#endif /* MBS_SUPPORT */ -+ (kwsm.index < kwset_exact_matches)) - goto success_in_beg_and_end; - if (dfaexec (&dfa, beg, end - beg, &backref) == (size_t) -1) - continue; -@@ -395,13 +406,47 @@ - else - { - /* No good fixed strings; start with DFA. */ -+#ifdef MBS_SUPPORT -+ size_t bytes_left = 0; -+#endif /* MBS_SUPPORT */ - size_t offset = dfaexec (&dfa, beg, buflim - beg, &backref); - if (offset == (size_t) -1) - break; - /* Narrow down to the line we've found. */ -+#ifdef MBS_SUPPORT -+ if (mb_cur_max > 1 && !using_utf8) -+ { -+ bytes_left = offset; -+ while (bytes_left) -+ { -+ size_t mlen = mbrlen (beg, bytes_left, &mbs); -+ if (mlen == (size_t) -1 || mlen == 0) -+ { -+ /* Incomplete character: treat as single-byte. */ -+ memset (&mbs, '\0', sizeof (mbstate_t)); -+ beg++; -+ bytes_left--; -+ continue; -+ } -+ -+ if (mlen == (size_t) -2) -+ /* Offset points inside multibyte character: -+ * no good. */ -+ break; -+ -+ beg += mlen; -+ bytes_left -= mlen; -+ } -+ } -+ else -+#endif /* MBS_SUPPORT */ - beg += offset; - end = memchr (beg, eol, buflim - beg); - end++; -+#ifdef MBS_SUPPORT -+ if (mb_cur_max > 1 && bytes_left) -+ continue; -+#endif /* MBS_SUPPORT */ - while (beg > buf && beg[-1] != eol) - --beg; - } -@@ -469,15 +514,6 @@ - } /* for (beg = end ..) */ - - failure: --#ifdef MBS_SUPPORT -- if (MB_CUR_MAX > 1) -- { -- if (mb_properties) -- free (mb_properties); -- if (match_icase) -- free ((char *) buf); -- } --#endif /* MBS_SUPPORT */ - return (size_t) -1; - - success_in_beg_and_end: -@@ -486,24 +522,144 @@ - /* FALLTHROUGH */ - - success_in_start_and_len: --#ifdef MBS_SUPPORT -- if (MB_CUR_MAX > 1) -- { -- if (mb_properties) -- free (mb_properties); -- if (match_icase) -- free ((char *) buf); -- } --#endif /* MBS_SUPPORT */ - *match_size = len; - return start; - } - -+#ifdef MBS_SUPPORT -+static int f_i_multibyte; /* whether we're using the new -Fi MB method */ -+static struct -+{ -+ wchar_t **patterns; -+ size_t count, maxlen; -+ unsigned char *match; -+} Fimb; -+#endif -+ - static void - Fcompile (char const *pattern, size_t size) - { -+ int mb_cur_max = MB_CUR_MAX; - char const *beg, *lim, *err; - -+ check_utf8 (); -+#ifdef MBS_SUPPORT -+ /* Support -F -i for UTF-8 input. */ -+ if (match_icase && mb_cur_max > 1) -+ { -+ mbstate_t mbs; -+ wchar_t *wcpattern = xmalloc ((size + 1) * sizeof (wchar_t)); -+ const char *patternend = pattern; -+ size_t wcsize; -+ kwset_t fimb_kwset = NULL; -+ char *starts = NULL; -+ wchar_t *wcbeg, *wclim; -+ size_t allocated = 0; -+ -+ memset (&mbs, '\0', sizeof (mbs)); -+# ifdef __GNU_LIBRARY__ -+ wcsize = mbsnrtowcs (wcpattern, &patternend, size, size, &mbs); -+ if (patternend != pattern + size) -+ wcsize = (size_t) -1; -+# else -+ { -+ char *patterncopy = xmalloc (size + 1); -+ -+ memcpy (patterncopy, pattern, size); -+ patterncopy[size] = '\0'; -+ patternend = patterncopy; -+ wcsize = mbsrtowcs (wcpattern, &patternend, size, &mbs); -+ if (patternend != patterncopy + size) -+ wcsize = (size_t) -1; -+ free (patterncopy); -+ } -+# endif -+ if (wcsize + 2 <= 2) -+ { -+fimb_fail: -+ free (wcpattern); -+ free (starts); -+ if (fimb_kwset) -+ kwsfree (fimb_kwset); -+ free (Fimb.patterns); -+ Fimb.patterns = NULL; -+ } -+ else -+ { -+ if (!(fimb_kwset = kwsalloc (NULL))) -+ error (2, 0, _("memory exhausted")); -+ -+ starts = xmalloc (mb_cur_max * 3); -+ wcbeg = wcpattern; -+ do -+ { -+ int i; -+ size_t wclen; -+ -+ if (Fimb.count >= allocated) -+ { -+ if (allocated == 0) -+ allocated = 128; -+ else -+ allocated *= 2; -+ Fimb.patterns = xrealloc (Fimb.patterns, -+ sizeof (wchar_t *) * allocated); -+ } -+ Fimb.patterns[Fimb.count++] = wcbeg; -+ for (wclim = wcbeg; -+ wclim < wcpattern + wcsize && *wclim != L'\n'; ++wclim) -+ *wclim = towlower (*wclim); -+ *wclim = L'\0'; -+ wclen = wclim - wcbeg; -+ if (wclen > Fimb.maxlen) -+ Fimb.maxlen = wclen; -+ if (wclen > 3) -+ wclen = 3; -+ if (wclen == 0) -+ { -+ if ((err = kwsincr (fimb_kwset, "", 0)) != 0) -+ error (2, 0, err); -+ } -+ else -+ for (i = 0; i < (1 << wclen); i++) -+ { -+ char *p = starts; -+ int j, k; -+ -+ for (j = 0; j < wclen; ++j) -+ { -+ wchar_t wc = wcbeg[j]; -+ if (i & (1 << j)) -+ { -+ wc = towupper (wc); -+ if (wc == wcbeg[j]) -+ continue; -+ } -+ k = wctomb (p, wc); -+ if (k <= 0) -+ goto fimb_fail; -+ p += k; -+ } -+ if ((err = kwsincr (fimb_kwset, starts, p - starts)) != 0) -+ error (2, 0, err); -+ } -+ if (wclim < wcpattern + wcsize) -+ ++wclim; -+ wcbeg = wclim; -+ } -+ while (wcbeg < wcpattern + wcsize); -+ f_i_multibyte = 1; -+ kwset = fimb_kwset; -+ free (starts); -+ Fimb.match = xmalloc (Fimb.count); -+ if ((err = kwsprep (kwset)) != 0) -+ error (2, 0, err); -+ return; -+ } -+ } -+#endif /* MBS_SUPPORT */ -+ -+ - kwsinit (); - beg = pattern; - do -@@ -522,6 +678,76 @@ - error (2, 0, err); - } - -+#ifdef MBS_SUPPORT -+static int -+Fimbexec (const char *buf, size_t size, size_t *plen, int exact) -+{ -+ size_t len, letter, i; -+ int ret = -1; -+ mbstate_t mbs; -+ wchar_t wc; -+ int patterns_left; -+ -+ assert (match_icase && f_i_multibyte == 1); -+ assert (MB_CUR_MAX > 1); -+ -+ memset (&mbs, '\0', sizeof (mbs)); -+ memset (Fimb.match, '\1', Fimb.count); -+ letter = len = 0; -+ patterns_left = 1; -+ while (patterns_left && len <= size) -+ { -+ size_t c; -+ -+ patterns_left = 0; -+ if (len < size) -+ { -+ c = mbrtowc (&wc, buf + len, size - len, &mbs); -+ if (c + 2 <= 2) -+ return ret; -+ -+ wc = towlower (wc); -+ } -+ else -+ { -+ c = 1; -+ wc = L'\0'; -+ } -+ -+ for (i = 0; i < Fimb.count; i++) -+ { -+ if (Fimb.match[i]) -+ { -+ if (Fimb.patterns[i][letter] == L'\0') -+ { -+ /* Found a match. */ -+ *plen = len; -+ if (!exact && !match_words) -+ return 0; -+ else -+ { -+ /* For -w or exact look for longest match. */ -+ ret = 0; -+ Fimb.match[i] = '\0'; -+ continue; -+ } -+ } -+ -+ if (Fimb.patterns[i][letter] == wc) -+ patterns_left = 1; -+ else -+ Fimb.match[i] = '\0'; -+ } -+ } -+ -+ len += c; -+ letter++; -+ } -+ -+ return ret; -+} -+#endif /* MBS_SUPPORT */ -+ - static size_t - Fexecute (char const *buf, size_t size, size_t *match_size, int exact) - { -@@ -531,80 +757,258 @@ - struct kwsmatch kwsmatch; - size_t ret_val; - #ifdef MBS_SUPPORT -- char *mb_properties = NULL; -- if (MB_CUR_MAX > 1) -- { -- if (match_icase) -- { -- char *case_buf = xmalloc(size); -- memcpy(case_buf, buf, size); -- buf = case_buf; -- } -- mb_properties = check_multibyte_string(buf, size); -- } -+ int mb_cur_max = MB_CUR_MAX; -+ mbstate_t mbs; -+ memset (&mbs, '\0', sizeof (mbstate_t)); -+ const char *last_char = NULL; - #endif /* MBS_SUPPORT */ - - for (beg = buf; beg <= buf + size; ++beg) - { -- size_t offset = kwsexec (kwset, beg, buf + size - beg, &kwsmatch); -+ size_t offset; -+ offset = kwsexec (kwset, beg, buf + size - beg, &kwsmatch); -+ - if (offset == (size_t) -1) - goto failure; - #ifdef MBS_SUPPORT -- if (MB_CUR_MAX > 1 && mb_properties[offset+beg-buf] == 0) -- continue; /* It is a part of multibyte character. */ -+ if (mb_cur_max > 1 && !using_utf8) -+ { -+ size_t bytes_left = offset; -+ while (bytes_left) -+ { -+ size_t mlen = mbrlen (beg, bytes_left, &mbs); -+ -+ last_char = beg; -+ if (mlen == (size_t) -1 || mlen == 0) -+ { -+ /* Incomplete character: treat as single-byte. */ -+ memset (&mbs, '\0', sizeof (mbstate_t)); -+ beg++; -+ bytes_left--; -+ continue; -+ } -+ -+ if (mlen == (size_t) -2) -+ /* Offset points inside multibyte character: no good. */ -+ break; -+ -+ beg += mlen; -+ bytes_left -= mlen; -+ } -+ -+ if (bytes_left) -+ continue; -+ } -+ else - #endif /* MBS_SUPPORT */ - beg += offset; -+#ifdef MBS_SUPPORT -+ /* For f_i_multibyte, the string at beg now matches first 3 chars of -+ one of the search strings (less if there are shorter search strings). -+ See if this is a real match. */ -+ if (f_i_multibyte -+ && Fimbexec (beg, buf + size - beg, &kwsmatch.size[0], exact)) -+ goto next_char; -+#endif /* MBS_SUPPORT */ - len = kwsmatch.size[0]; - if (exact && !match_words) - goto success_in_beg_and_len; - if (match_lines) - { - if (beg > buf && beg[-1] != eol) -- continue; -+ goto next_char; - if (beg + len < buf + size && beg[len] != eol) -- continue; -+ goto next_char; - goto success; - } - else if (match_words) -- for (try = beg; len; ) -- { -- if (try > buf && WCHAR((unsigned char) try[-1])) -- break; -- if (try + len < buf + size && WCHAR((unsigned char) try[len])) -- { -- offset = kwsexec (kwset, beg, --len, &kwsmatch); -- if (offset == (size_t) -1) -- { -+ { -+ while (len) -+ { -+ int word_match = 0; -+ if (beg > buf) -+ { - #ifdef MBS_SUPPORT -- if (MB_CUR_MAX > 1) -- free (mb_properties); -+ if (mb_cur_max > 1) -+ { -+ const char *s; -+ int mr; -+ wchar_t pwc; -+ -+ if (using_utf8) -+ { -+ s = beg - 1; -+ while (s > buf -+ && (unsigned char) *s >= 0x80 -+ && (unsigned char) *s <= 0xbf) -+ --s; -+ } -+ else -+ s = last_char; -+ mr = mbtowc (&pwc, s, beg - s); -+ if (mr <= 0) -+ memset (&mbs, '\0', sizeof (mbstate_t)); -+ else if ((iswalnum (pwc) || pwc == L'_') -+ && mr == (int) (beg - s)) -+ goto next_char; -+ } -+ else - #endif /* MBS_SUPPORT */ -- return offset; -- } -- try = beg + offset; -- len = kwsmatch.size[0]; -- } -- else -- goto success; -- } -+ if (WCHAR ((unsigned char) beg[-1])) -+ goto next_char; -+ } -+#ifdef MBS_SUPPORT -+ if (mb_cur_max > 1) -+ { -+ wchar_t nwc; -+ int mr; -+ -+ mr = mbtowc (&nwc, beg + len, buf + size - beg - len); -+ if (mr <= 0) -+ { -+ memset (&mbs, '\0', sizeof (mbstate_t)); -+ word_match = 1; -+ } -+ else if (!iswalnum (nwc) && nwc != L'_') -+ word_match = 1; -+ } -+ else -+#endif /* MBS_SUPPORT */ -+ if (beg + len >= buf + size || !WCHAR ((unsigned char) beg[len])) -+ word_match = 1; -+ if (word_match) -+ { -+ if (!exact) -+ /* Returns the whole line now we know there's a word match. */ -+ goto success; -+ else -+ /* Returns just this word match. */ -+ goto success_in_beg_and_len; -+ } -+ if (len > 0) -+ { -+ /* Try a shorter length anchored at the same place. */ -+ --len; -+ offset = kwsexec (kwset, beg, len, &kwsmatch); -+ -+ if (offset == -1) -+ goto next_char; /* Try a different anchor. */ -+#ifdef MBS_SUPPORT -+ if (mb_cur_max > 1 && !using_utf8) -+ { -+ size_t bytes_left = offset; -+ while (bytes_left) -+ { -+ size_t mlen = mbrlen (beg, bytes_left, &mbs); -+ -+ last_char = beg; -+ if (mlen == (size_t) -1 || mlen == 0) -+ { -+ /* Incomplete character: treat as single-byte. */ -+ memset (&mbs, '\0', sizeof (mbstate_t)); -+ beg++; -+ bytes_left--; -+ continue; -+ } -+ -+ if (mlen == (size_t) -2) -+ { -+ /* Offset points inside multibyte character: -+ * no good. */ -+ break; -+ } -+ -+ beg += mlen; -+ bytes_left -= mlen; -+ } -+ -+ if (bytes_left) -+ { -+ memset (&mbs, '\0', sizeof (mbstate_t)); -+ goto next_char; /* Try a different anchor. */ -+ } -+ } -+ else -+#endif /* MBS_SUPPORT */ -+ beg += offset; -+#ifdef MBS_SUPPORT -+ /* The string at beg now matches first 3 chars of one of -+ the search strings (less if there are shorter search -+ strings). See if this is a real match. */ -+ if (f_i_multibyte -+ && Fimbexec (beg, len - offset, &kwsmatch.size[0], -+ exact)) -+ goto next_char; -+#endif /* MBS_SUPPORT */ -+ len = kwsmatch.size[0]; -+ } -+ } -+ } - else - goto success; -+next_char:; -+#ifdef MBS_SUPPORT -+ /* Advance to next character. For MB_CUR_MAX == 1 case this is handled -+ by ++beg above. */ -+ if (mb_cur_max > 1) -+ { -+ if (using_utf8) -+ { -+ unsigned char c = *beg; -+ if (c >= 0xc2) -+ { -+ if (c < 0xe0) -+ ++beg; -+ else if (c < 0xf0) -+ beg += 2; -+ else if (c < 0xf8) -+ beg += 3; -+ else if (c < 0xfc) -+ beg += 4; -+ else if (c < 0xfe) -+ beg += 5; -+ } -+ } -+ else -+ { -+ size_t l = mbrlen (beg, buf + size - beg, &mbs); -+ -+ last_char = beg; -+ if (l + 2 >= 2) -+ beg += l - 1; -+ else -+ memset (&mbs, '\0', sizeof (mbstate_t)); -+ } -+ } -+#endif /* MBS_SUPPORT */ - } - - failure: -+ return -1; -+ -+ success: - #ifdef MBS_SUPPORT -- if (MB_CUR_MAX > 1) -+ if (mb_cur_max > 1 && !using_utf8) - { -- if (match_icase) -- free((char *) buf); -- if (mb_properties) -- free(mb_properties); -+ end = beg + len; -+ while (end < buf + size) -+ { -+ size_t mlen = mbrlen (end, buf + size - end, &mbs); -+ if (mlen == (size_t) -1 || mlen == (size_t) -2 || mlen == 0) -+ { -+ memset (&mbs, '\0', sizeof (mbstate_t)); -+ mlen = 1; -+ } -+ if (mlen == 1 && *end == eol) -+ break; -+ -+ end += mlen; -+ } - } -+ else - #endif /* MBS_SUPPORT */ -- return -1; -- -- success: - end = memchr (beg + len, eol, (buf + size) - (beg + len)); -+ - end++; - while (buf < beg && beg[-1] != eol) - --beg; -@@ -613,15 +1017,6 @@ - - success_in_beg_and_len: - *match_size = len; --#ifdef MBS_SUPPORT -- if (MB_CUR_MAX > 1) -- { -- if (mb_properties) -- free (mb_properties); -- if (match_icase) -- free ((char *) buf); -- } --#endif /* MBS_SUPPORT */ - return beg - buf; - } - diff --git a/abs/core/grep/10-dfa-optional.patch b/abs/core/grep/10-dfa-optional.patch deleted file mode 100644 index 784eba9..0000000 --- a/abs/core/grep/10-dfa-optional.patch +++ /dev/null @@ -1,67 +0,0 @@ ---- grep-2.5.1a/src/search.c.dfa-optional 2005-01-07 14:58:45.714869815 +0000 -+++ grep-2.5.1a/src/search.c 2005-01-07 14:58:45.725867716 +0000 -@@ -327,12 +327,34 @@ - int backref, start, len; - struct kwsmatch kwsm; - size_t i, ret_val; -+ static int use_dfa; -+ static int use_dfa_checked = 0; - #ifdef MBS_SUPPORT - int mb_cur_max = MB_CUR_MAX; - mbstate_t mbs; - memset (&mbs, '\0', sizeof (mbstate_t)); - #endif /* MBS_SUPPORT */ - -+ if (!use_dfa_checked) -+ { -+ char *grep_use_dfa = getenv ("GREP_USE_DFA"); -+ if (!grep_use_dfa) -+ { -+#ifdef MBS_SUPPORT -+ /* Turn off DFA when processing multibyte input. */ -+ use_dfa = (MB_CUR_MAX == 1); -+#else -+ use_dfa = 1; -+#endif /* MBS_SUPPORT */ -+ } -+ else -+ { -+ use_dfa = atoi (grep_use_dfa); -+ } -+ -+ use_dfa_checked = 1; -+ } -+ - buflim = buf + size; - - for (beg = end = buf; end < buflim; beg = end) -@@ -400,7 +422,8 @@ - #endif /* MBS_SUPPORT */ - (kwsm.index < kwset_exact_matches)) - goto success_in_beg_and_end; -- if (dfaexec (&dfa, beg, end - beg, &backref) == (size_t) -1) -+ if (use_dfa && -+ dfaexec (&dfa, beg, end - beg, &backref) == (size_t) -1) - continue; - } - else -@@ -409,7 +432,9 @@ - #ifdef MBS_SUPPORT - size_t bytes_left = 0; - #endif /* MBS_SUPPORT */ -- size_t offset = dfaexec (&dfa, beg, buflim - beg, &backref); -+ size_t offset = 0; -+ if (use_dfa) -+ offset = dfaexec (&dfa, beg, buflim - beg, &backref); - if (offset == (size_t) -1) - break; - /* Narrow down to the line we've found. */ -@@ -451,7 +476,7 @@ - --beg; - } - /* Successful, no backreferences encountered! */ -- if (!backref) -+ if (use_dfa && !backref) - goto success_in_beg_and_end; - } - else diff --git a/abs/core/grep/11-tests.patch b/abs/core/grep/11-tests.patch deleted file mode 100644 index 2934a21..0000000 --- a/abs/core/grep/11-tests.patch +++ /dev/null @@ -1,138 +0,0 @@ ---- grep-2.5.1/tests/Makefile.am.jj 2001-03-07 05:11:27.000000000 +0100 -+++ grep-2.5.1/tests/Makefile.am 2004-12-31 11:42:41.595492300 +0100 -@@ -3,7 +3,8 @@ - AWK=@AWK@ - - TESTS = warning.sh khadafy.sh spencer1.sh bre.sh ere.sh \ -- status.sh empty.sh options.sh backref.sh file.sh -+ status.sh empty.sh options.sh backref.sh file.sh \ -+ fmbtest.sh - EXTRA_DIST = $(TESTS) \ - khadafy.lines khadafy.regexp \ - spencer1.awk spencer1.tests \ ---- grep-2.5.1/tests/fmbtest.sh 2004-12-31 13:30:23.942871250 +0100 -+++ grep-2.5.1/tests/fmbtest.sh 2004-12-31 14:09:13.219463855 +0100 -@@ -0,0 +1,111 @@ -+#!/bin/sh -+ -+: ${srcdir=.} -+ -+# If cs_CZ.UTF-8 locale doesn't work, skip this test silently -+LC_ALL=cs_CZ.UTF-8 locale -k LC_CTYPE 2>/dev/null | ${GREP} -q charmap.*UTF-8 \ -+ || exit 77 -+ -+failures=0 -+ -+cat > csinput < cspatfile <= 0) - { -- if ((start == 0 || !WCHAR ((unsigned char) beg[start - 1])) -- && (len == end - beg - 1 -- || !WCHAR ((unsigned char) beg[start + len]))) -- goto success_in_beg_and_end; -+ int lword_match = 0; -+ if (start == 0) -+ lword_match = 1; -+ else -+ { -+ assert (start > 0); -+#ifdef MBS_SUPPORT -+ if (mb_cur_max > 1) -+ { -+ const char *s; -+ size_t mr; -+ wchar_t pwc; -+ -+ /* Locate the start of the multibyte character -+ before the match position (== beg + start). */ -+ if (using_utf8) -+ { -+ /* UTF-8 is a special case: scan backwards -+ until we find a 7-bit character or a -+ lead byte. */ -+ s = beg + start - 1; -+ while (s > buf -+ && (unsigned char) *s >= 0x80 -+ && (unsigned char) *s <= 0xbf) -+ --s; -+ } -+ else -+ { -+ /* Scan forwards to find the start of the -+ last complete character before the -+ match position. */ -+ size_t bytes_left = start - 1; -+ s = beg; -+ while (bytes_left > 0) -+ { -+ mr = mbrlen (s, bytes_left, &mbs); -+ if (mr == (size_t) -1 || mr == 0) -+ { -+ memset (&mbs, '\0', sizeof (mbs)); -+ s++; -+ bytes_left--; -+ continue; -+ } -+ if (mr == (size_t) -2) -+ { -+ memset (&mbs, '\0', sizeof (mbs)); -+ break; -+ } -+ s += mr; -+ bytes_left -= mr; -+ } -+ } -+ mr = mbrtowc (&pwc, s, beg + start - s, &mbs); -+ if (mr == (size_t) -2 || mr == (size_t) -1 || -+ mr == 0) -+ { -+ memset (&mbs, '\0', sizeof (mbstate_t)); -+ lword_match = 1; -+ } -+ else if (!(iswalnum (pwc) || pwc == L'_') -+ && mr == beg + start - s) -+ lword_match = 1; -+ } -+ else -+#endif /* MBS_SUPPORT */ -+ if (!WCHAR ((unsigned char) beg[start - 1])) -+ lword_match = 1; -+ } -+ -+ if (lword_match) -+ { -+ int rword_match = 0; -+ if (start + len == end - beg - 1) -+ rword_match = 1; -+ else -+ { -+#ifdef MBS_SUPPORT -+ if (mb_cur_max > 1) -+ { -+ wchar_t nwc; -+ int mr; -+ -+ mr = mbtowc (&nwc, beg + start + len, -+ end - beg - start - len - 1); -+ if (mr <= 0) -+ { -+ memset (&mbs, '\0', sizeof (mbstate_t)); -+ rword_match = 1; -+ } -+ else if (!iswalnum (nwc) && nwc != L'_') -+ rword_match = 1; -+ } -+ else -+#endif /* MBS_SUPPORT */ -+ if (!WCHAR ((unsigned char) beg[start + len])) -+ rword_match = 1; -+ } -+ -+ if (rword_match) -+ { -+ if (!exact) -+ /* Returns the whole line. */ -+ goto success_in_beg_and_end; -+ else -+ /* Returns just this word match. */ -+ goto success_in_start_and_len; -+ } -+ } - if (len > 0) - { - /* Try a shorter length anchored at the same place. */ diff --git a/abs/core/grep/13-P.patch b/abs/core/grep/13-P.patch deleted file mode 100644 index 9dca4ad..0000000 --- a/abs/core/grep/13-P.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- grep-2.5.1a/src/search.c.P 2006-02-03 14:08:00.000000000 +0000 -+++ grep-2.5.1a/src/search.c 2006-02-03 14:11:20.000000000 +0000 -@@ -1234,8 +1234,9 @@ - char eol = eolbyte; - if (!exact) - { -- end = memchr (end, eol, buflim - end); -- end++; -+ while (end < buflim) -+ if (*end++ == eol) -+ break; - while (buf < beg && beg[-1] != eol) - --beg; - } diff --git a/abs/core/grep/14-mem-exhausted.patch b/abs/core/grep/14-mem-exhausted.patch deleted file mode 100644 index d6a996d..0000000 --- a/abs/core/grep/14-mem-exhausted.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- grep-2.5.1a/src/grep.c.mem-exhausted 2006-11-22 14:49:35.000000000 +0000 -+++ grep-2.5.1a/src/grep.c 2006-11-22 14:53:12.000000000 +0000 -@@ -299,6 +299,12 @@ - int cc = 1; - char *readbuf; - size_t readsize; -+ const size_t max_save = 200 * 1024 * 1024; -+ -+ /* Limit the amount of saved data to 200Mb so we don't fail on -+ * large files. */ -+ if (save > max_save) -+ save = max_save; - - /* Offset from start of buffer to start of old stuff - that we want to save. */ diff --git a/abs/core/grep/15-empty-pattern.patch b/abs/core/grep/15-empty-pattern.patch deleted file mode 100644 index acb702a..0000000 --- a/abs/core/grep/15-empty-pattern.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- grep-2.5.1a/src/grep.c.empty-pattern 2006-11-22 19:05:43.000000000 +0000 -+++ grep-2.5.1a/src/grep.c 2006-11-22 19:22:04.000000000 +0000 -@@ -1667,9 +1667,6 @@ - out_invert ^= 1; - match_lines = match_words = 0; - } -- else -- /* Strip trailing newline. */ -- --keycc; - } - else - if (optind < argc) ---- grep-2.5.1a/src/search.c.empty-pattern 2006-11-22 19:21:11.000000000 +0000 -+++ grep-2.5.1a/src/search.c 2006-11-22 19:35:06.000000000 +0000 -@@ -204,6 +204,10 @@ - motif = sep; - } while (sep && total != 0); - -+ /* Strip trailing newline. */ -+ if (size && pattern[size - 1] == '\n') -+ size--; -+ - /* In the match_words and match_lines cases, we use a different pattern - for the DFA matcher that will quickly throw out cases that won't work. - Then if DFA succeeds we do some hairy stuff using the regex matcher -@@ -288,6 +292,10 @@ - motif = sep; - } while (sep && total != 0); - -+ /* Strip trailing newline. */ -+ if (size && pattern[size - 1] == '\n') -+ size--; -+ - /* In the match_words and match_lines cases, we use a different pattern - for the DFA matcher that will quickly throw out cases that won't work. - Then if DFA succeeds we do some hairy stuff using the regex matcher diff --git a/abs/core/grep/64-egf-speedup.patch b/abs/core/grep/64-egf-speedup.patch deleted file mode 100644 index a1fa024..0000000 --- a/abs/core/grep/64-egf-speedup.patch +++ /dev/null @@ -1,791 +0,0 @@ ---- a/src/search.c.orig -+++ b/src/search.c -@@ -18,10 +18,15 @@ - - /* Written August 1992 by Mike Haertel. */ - -+#ifndef _GNU_SOURCE -+# define _GNU_SOURCE 1 -+#endif - #ifdef HAVE_CONFIG_H - # include - #endif - -+#include -+ - #include - - #include "mbsupport.h" -@@ -43,6 +48,9 @@ - #ifdef HAVE_LIBPCRE - # include - #endif -+#ifdef HAVE_LANGINFO_CODESET -+# include -+#endif - - #define NCHAR (UCHAR_MAX + 1) - -@@ -68,6 +76,19 @@ - error (2, 0, _("memory exhausted")); - } - -+/* UTF-8 encoding allows some optimizations that we can't otherwise -+ assume in a multibyte encoding. */ -+static int using_utf8; -+ -+void -+check_utf8 (void) -+{ -+#ifdef HAVE_LANGINFO_CODESET -+ if (strcmp (nl_langinfo (CODESET), "UTF-8") == 0) -+ using_utf8 = 1; -+#endif -+} -+ - #ifndef FGREP_PROGRAM - /* DFA compiled regexp. */ - static struct dfa dfa; -@@ -134,49 +155,6 @@ - } - #endif /* !FGREP_PROGRAM */ - --#ifdef MBS_SUPPORT --/* This function allocate the array which correspond to "buf". -- Then this check multibyte string and mark on the positions which -- are not single byte character nor the first byte of a multibyte -- character. Caller must free the array. */ --static char* --check_multibyte_string(char const *buf, size_t size) --{ -- char *mb_properties = xmalloc(size); -- mbstate_t cur_state; -- wchar_t wc; -- int i; -- -- memset(&cur_state, 0, sizeof(mbstate_t)); -- memset(mb_properties, 0, sizeof(char)*size); -- -- for (i = 0; i < size ;) -- { -- size_t mbclen; -- mbclen = mbrtowc(&wc, buf + i, size - i, &cur_state); -- -- if (mbclen == (size_t) -1 || mbclen == (size_t) -2 || mbclen == 0) -- { -- /* An invalid sequence, or a truncated multibyte character. -- We treat it as a single byte character. */ -- mbclen = 1; -- } -- else if (match_icase) -- { -- if (iswupper((wint_t)wc)) -- { -- wc = towlower((wint_t)wc); -- wcrtomb(buf + i, wc, &cur_state); -- } -- } -- mb_properties[i] = mbclen; -- i += mbclen; -- } -- -- return mb_properties; --} --#endif /* MBS_SUPPORT */ -- - #if defined(GREP_PROGRAM) || defined(EGREP_PROGRAM) - #ifdef EGREP_PROGRAM - COMPILE_FCT(Ecompile) -@@ -193,6 +171,7 @@ - size_t total = size; - char const *motif = pattern; - -+ check_utf8 (); - #if 0 - if (match_icase) - syntax_bits |= RE_ICASE; -@@ -303,20 +282,9 @@ hunk6 - struct kwsmatch kwsm; - size_t i, ret_val; - #ifdef MBS_SUPPORT -- char *mb_properties = NULL; -- if (MB_CUR_MAX > 1) -- { -- if (match_icase) -- { -- char *case_buf = xmalloc(size); -- memcpy(case_buf, buf, size); -- if (start_ptr) -- start_ptr = case_buf + (start_ptr - buf); -- buf = case_buf; -- } -- if (kwset) -- mb_properties = check_multibyte_string(buf, size); -- } -+ int mb_cur_max = MB_CUR_MAX; -+ mbstate_t mbs; -+ memset (&mbs, '\0', sizeof (mbstate_t)); - #endif /* MBS_SUPPORT */ - - buflim = buf + size; -@@ -329,21 +282,63 @@ hunk6 - if (kwset) - { - /* Find a possible match using the KWset matcher. */ -- size_t offset = kwsexec (kwset, beg, buflim - beg, &kwsm); -+#ifdef MBS_SUPPORT -+ size_t bytes_left = 0; -+#endif /* MBS_SUPPORT */ -+ size_t offset; -+#ifdef MBS_SUPPORT -+ /* kwsexec doesn't work with match_icase and multibyte input. */ -+ if (match_icase && mb_cur_max > 1) -+ /* Avoid kwset */ -+ offset = 0; -+ else -+#endif /* MBS_SUPPORT */ -+ offset = kwsexec (kwset, beg, buflim - beg, &kwsm); - if (offset == (size_t) -1) -- goto failure; -+ return (size_t)-1; -+#ifdef MBS_SUPPORT -+ if (mb_cur_max > 1 && !using_utf8) -+ { -+ bytes_left = offset; -+ while (bytes_left) -+ { -+ size_t mlen = mbrlen (beg, bytes_left, &mbs); -+ if (mlen == (size_t) -1 || mlen == 0) -+ { -+ /* Incomplete character: treat as single-byte. */ -+ memset (&mbs, '\0', sizeof (mbstate_t)); -+ beg++; -+ bytes_left--; -+ continue; -+ } -+ -+ if (mlen == (size_t) -2) -+ /* Offset points inside multibyte character: -+ * no good. */ -+ break; -+ -+ beg += mlen; -+ bytes_left -= mlen; -+ } -+ } -+ else -+#endif /* MBS_SUPPORT */ - beg += offset; - /* Narrow down to the line containing the candidate, and - run it through DFA. */ - end = memchr(beg, eol, buflim - beg); - end++; - #ifdef MBS_SUPPORT -- if (MB_CUR_MAX > 1 && mb_properties[beg - buf] == 0) -+ if (mb_cur_max > 1 && bytes_left) - continue; - #endif - while (beg > buf && beg[-1] != eol) - --beg; -- if (kwsm.index < kwset_exact_matches) -+ if ( -+#ifdef MBS_SUPPORT -+ !(match_icase && mb_cur_max > 1) && -+#endif /* MBS_SUPPORT */ -+ (kwsm.index < kwset_exact_matches)) - goto success; - if (dfaexec (&dfa, beg, end - beg, &backref) == (size_t) -1) - continue; -@@ -351,13 +363,47 @@ - else - { - /* No good fixed strings; start with DFA. */ -+#ifdef MBS_SUPPORT -+ size_t bytes_left = 0; -+#endif /* MBS_SUPPORT */ - size_t offset = dfaexec (&dfa, beg, buflim - beg, &backref); - if (offset == (size_t) -1) - break; - /* Narrow down to the line we've found. */ -+#ifdef MBS_SUPPORT -+ if (mb_cur_max > 1 && !using_utf8) -+ { -+ bytes_left = offset; -+ while (bytes_left) -+ { -+ size_t mlen = mbrlen (beg, bytes_left, &mbs); -+ if (mlen == (size_t) -1 || mlen == 0) -+ { -+ /* Incomplete character: treat as single-byte. */ -+ memset (&mbs, '\0', sizeof (mbstate_t)); -+ beg++; -+ bytes_left--; -+ continue; -+ } -+ -+ if (mlen == (size_t) -2) -+ /* Offset points inside multibyte character: -+ * no good. */ -+ break; -+ -+ beg += mlen; -+ bytes_left -= mlen; -+ } -+ } -+ else -+#endif /* MBS_SUPPORT */ - beg += offset; - end = memchr (beg, eol, buflim - beg); - end++; -+#ifdef MBS_SUPPORT -+ if (mb_cur_max > 1 && bytes_left) -+ continue; -+#endif /* MBS_SUPPORT */ - while (beg > buf && beg[-1] != eol) - --beg; - } -@@ -475,24 +521,144 @@ - *match_size = len; - ret_val = beg - buf; - out: --#ifdef MBS_SUPPORT -- if (MB_CUR_MAX > 1) -- { -- if (match_icase) -- free((char*)buf); -- if (mb_properties) -- free(mb_properties); -- } --#endif /* MBS_SUPPORT */ - return ret_val; - } - #endif /* defined(GREP_PROGRAM) || defined(EGREP_PROGRAM) */ - -+#ifdef MBS_SUPPORT -+static int f_i_multibyte; /* whether we're using the new -Fi MB method */ -+static struct -+{ -+ wchar_t **patterns; -+ size_t count, maxlen; -+ unsigned char *match; -+} Fimb; -+#endif -+ - #if defined(GREP_PROGRAM) || defined(FGREP_PROGRAM) - COMPILE_FCT(Fcompile) - { -+ int mb_cur_max = MB_CUR_MAX; - char const *beg, *lim, *err; - -+ check_utf8 (); -+#ifdef MBS_SUPPORT -+ /* Support -F -i for UTF-8 input. */ -+ if (match_icase && mb_cur_max > 1) -+ { -+ mbstate_t mbs; -+ wchar_t *wcpattern = xmalloc ((size + 1) * sizeof (wchar_t)); -+ const char *patternend = pattern; -+ size_t wcsize; -+ kwset_t fimb_kwset = NULL; -+ char *starts = NULL; -+ wchar_t *wcbeg, *wclim; -+ size_t allocated = 0; -+ -+ memset (&mbs, '\0', sizeof (mbs)); -+# ifdef __GNU_LIBRARY__ -+ wcsize = mbsnrtowcs (wcpattern, &patternend, size, size, &mbs); -+ if (patternend != pattern + size) -+ wcsize = (size_t) -1; -+# else -+ { -+ char *patterncopy = xmalloc (size + 1); -+ -+ memcpy (patterncopy, pattern, size); -+ patterncopy[size] = '\0'; -+ patternend = patterncopy; -+ wcsize = mbsrtowcs (wcpattern, &patternend, size, &mbs); -+ if (patternend != patterncopy + size) -+ wcsize = (size_t) -1; -+ free (patterncopy); -+ } -+# endif -+ if (wcsize + 2 <= 2) -+ { -+fimb_fail: -+ free (wcpattern); -+ free (starts); -+ if (fimb_kwset) -+ kwsfree (fimb_kwset); -+ free (Fimb.patterns); -+ Fimb.patterns = NULL; -+ } -+ else -+ { -+ if (!(fimb_kwset = kwsalloc (NULL))) -+ error (2, 0, _("memory exhausted")); -+ -+ starts = xmalloc (mb_cur_max * 3); -+ wcbeg = wcpattern; -+ do -+ { -+ int i; -+ size_t wclen; -+ -+ if (Fimb.count >= allocated) -+ { -+ if (allocated == 0) -+ allocated = 128; -+ else -+ allocated *= 2; -+ Fimb.patterns = xrealloc (Fimb.patterns, -+ sizeof (wchar_t *) * allocated); -+ } -+ Fimb.patterns[Fimb.count++] = wcbeg; -+ for (wclim = wcbeg; -+ wclim < wcpattern + wcsize && *wclim != L'\n'; ++wclim) -+ *wclim = towlower (*wclim); -+ *wclim = L'\0'; -+ wclen = wclim - wcbeg; -+ if (wclen > Fimb.maxlen) -+ Fimb.maxlen = wclen; -+ if (wclen > 3) -+ wclen = 3; -+ if (wclen == 0) -+ { -+ if ((err = kwsincr (fimb_kwset, "", 0)) != 0) -+ error (2, 0, err); -+ } -+ else -+ for (i = 0; i < (1 << wclen); i++) -+ { -+ char *p = starts; -+ int j, k; -+ -+ for (j = 0; j < wclen; ++j) -+ { -+ wchar_t wc = wcbeg[j]; -+ if (i & (1 << j)) -+ { -+ wc = towupper (wc); -+ if (wc == wcbeg[j]) -+ continue; -+ } -+ k = wctomb (p, wc); -+ if (k <= 0) -+ goto fimb_fail; -+ p += k; -+ } -+ if ((err = kwsincr (fimb_kwset, starts, p - starts)) != 0) -+ error (2, 0, err); -+ } -+ if (wclim < wcpattern + wcsize) -+ ++wclim; -+ wcbeg = wclim; -+ } -+ while (wcbeg < wcpattern + wcsize); -+ f_i_multibyte = 1; -+ kwset = fimb_kwset; -+ free (starts); -+ Fimb.match = xmalloc (Fimb.count); -+ if ((err = kwsprep (kwset)) != 0) -+ error (2, 0, err); -+ return; -+ } -+ } -+#endif /* MBS_SUPPORT */ -+ -+ - kwsinit (); - beg = pattern; - do -@@ -511,6 +677,76 @@ - error (2, 0, err); - } - -+#ifdef MBS_SUPPORT -+static int -+Fimbexec (const char *buf, size_t size, size_t *plen, int exact) -+{ -+ size_t len, letter, i; -+ int ret = -1; -+ mbstate_t mbs; -+ wchar_t wc; -+ int patterns_left; -+ -+ assert (match_icase && f_i_multibyte == 1); -+ assert (MB_CUR_MAX > 1); -+ -+ memset (&mbs, '\0', sizeof (mbs)); -+ memset (Fimb.match, '\1', Fimb.count); -+ letter = len = 0; -+ patterns_left = 1; -+ while (patterns_left && len <= size) -+ { -+ size_t c; -+ -+ patterns_left = 0; -+ if (len < size) -+ { -+ c = mbrtowc (&wc, buf + len, size - len, &mbs); -+ if (c + 2 <= 2) -+ return ret; -+ -+ wc = towlower (wc); -+ } -+ else -+ { -+ c = 1; -+ wc = L'\0'; -+ } -+ -+ for (i = 0; i < Fimb.count; i++) -+ { -+ if (Fimb.match[i]) -+ { -+ if (Fimb.patterns[i][letter] == L'\0') -+ { -+ /* Found a match. */ -+ *plen = len; -+ if (!exact && !match_words) -+ return 0; -+ else -+ { -+ /* For -w or exact look for longest match. */ -+ ret = 0; -+ Fimb.match[i] = '\0'; -+ continue; -+ } -+ } -+ -+ if (Fimb.patterns[i][letter] == wc) -+ patterns_left = 1; -+ else -+ Fimb.match[i] = '\0'; -+ } -+ } -+ -+ len += c; -+ letter++; -+ } -+ -+ return ret; -+} -+#endif /* MBS_SUPPORT */ -+ - EXECUTE_FCT(Fexecute) - { - register char const *beg, *try, *end; -@@ -519,69 +755,256 @@ - struct kwsmatch kwsmatch; - size_t ret_val; - #ifdef MBS_SUPPORT -- char *mb_properties = NULL; -- if (MB_CUR_MAX > 1) -- { -- if (match_icase) -- { -- char *case_buf = xmalloc(size); -- memcpy(case_buf, buf, size); -- if (start_ptr) -- start_ptr = case_buf + (start_ptr - buf); -- buf = case_buf; -- } -- mb_properties = check_multibyte_string(buf, size); -- } -+ int mb_cur_max = MB_CUR_MAX; -+ mbstate_t mbs; -+ memset (&mbs, '\0', sizeof (mbstate_t)); -+ const char *last_char = NULL; - #endif /* MBS_SUPPORT */ - - for (beg = start_ptr ? start_ptr : buf; beg <= buf + size; beg++) - { - size_t offset = kwsexec (kwset, beg, buf + size - beg, &kwsmatch); - if (offset == (size_t) -1) -- goto failure; -+ return offset; - #ifdef MBS_SUPPORT -- if (MB_CUR_MAX > 1 && mb_properties[offset+beg-buf] == 0) -- continue; /* It is a part of multibyte character. */ -+ if (mb_cur_max > 1 && !using_utf8) -+ { -+ size_t bytes_left = offset; -+ while (bytes_left) -+ { -+ size_t mlen = mbrlen (beg, bytes_left, &mbs); -+ -+ last_char = beg; -+ if (mlen == (size_t) -1 || mlen == 0) -+ { -+ /* Incomplete character: treat as single-byte. */ -+ memset (&mbs, '\0', sizeof (mbstate_t)); -+ beg++; -+ bytes_left--; -+ continue; -+ } -+ -+ if (mlen == (size_t) -2) -+ /* Offset points inside multibyte character: no good. */ -+ break; -+ -+ beg += mlen; -+ bytes_left -= mlen; -+ } -+ -+ if (bytes_left) -+ continue; -+ } -+ else - #endif /* MBS_SUPPORT */ - beg += offset; -+#ifdef MBS_SUPPORT -+ /* For f_i_multibyte, the string at beg now matches first 3 chars of -+ one of the search strings (less if there are shorter search strings). -+ See if this is a real match. */ -+ if (f_i_multibyte -+ && Fimbexec (beg, buf + size - beg, &kwsmatch.size[0], start_ptr == NULL)) -+ goto next_char; -+#endif /* MBS_SUPPORT */ - len = kwsmatch.size[0]; - if (start_ptr && !match_words) - goto success_in_beg_and_len; - if (match_lines) - { - if (beg > buf && beg[-1] != eol) -- continue; -+ goto next_char; - if (beg + len < buf + size && beg[len] != eol) -- continue; -+ goto next_char; - goto success; - } - else if (match_words) -- for (try = beg; len; ) -- { -- if (try > buf && WCHAR((unsigned char) try[-1])) -- break; -- if (try + len < buf + size && WCHAR((unsigned char) try[len])) -- { -- offset = kwsexec (kwset, beg, --len, &kwsmatch); -- if (offset == (size_t) -1) -- break; -- try = beg + offset; -- len = kwsmatch.size[0]; -- } -- else if (!start_ptr) -- goto success; -- else -- goto success_in_beg_and_len; -- } /* for (try) */ -- else -- goto success; -- } /* for (beg in buf) */ -+ { -+ while (len) -+ { -+ int word_match = 0; -+ if (beg > buf) -+ { -+#ifdef MBS_SUPPORT -+ if (mb_cur_max > 1) -+ { -+ const char *s; -+ int mr; -+ wchar_t pwc; -+ -+ if (using_utf8) -+ { -+ s = beg - 1; -+ while (s > buf -+ && (unsigned char) *s >= 0x80 -+ && (unsigned char) *s <= 0xbf) -+ --s; -+ } -+ else -+ s = last_char; -+ mr = mbtowc (&pwc, s, beg - s); -+ if (mr <= 0) -+ memset (&mbs, '\0', sizeof (mbstate_t)); -+ else if ((iswalnum (pwc) || pwc == L'_') -+ && mr == (int) (beg - s)) -+ goto next_char; -+ } -+ else -+#endif /* MBS_SUPPORT */ -+ if (WCHAR ((unsigned char) beg[-1])) -+ goto next_char; -+ } -+#ifdef MBS_SUPPORT -+ if (mb_cur_max > 1) -+ { -+ wchar_t nwc; -+ int mr; - -- failure: -- ret_val = -1; -- goto out; -+ mr = mbtowc (&nwc, beg + len, buf + size - beg - len); -+ if (mr <= 0) -+ { -+ memset (&mbs, '\0', sizeof (mbstate_t)); -+ word_match = 1; -+ } -+ else if (!iswalnum (nwc) && nwc != L'_') -+ word_match = 1; -+ } -+ else -+#endif /* MBS_SUPPORT */ -+ if (beg + len >= buf + size || !WCHAR ((unsigned char) beg[len])) -+ word_match = 1; -+ if (word_match) -+ { -+ if (start_ptr == NULL) -+ /* Returns the whole line now we know there's a word match. */ -+ goto success; -+ else { -+ /* Returns just this word match. */ -+ *match_size = len; -+ return beg - buf; -+ } -+ } -+ if (len > 0) -+ { -+ /* Try a shorter length anchored at the same place. */ -+ --len; -+ offset = kwsexec (kwset, beg, len, &kwsmatch); -+ -+ if (offset == -1) -+ goto next_char; /* Try a different anchor. */ -+#ifdef MBS_SUPPORT -+ -+ if (mb_cur_max > 1 && !using_utf8) -+ { -+ size_t bytes_left = offset; -+ while (bytes_left) -+ { -+ size_t mlen = mbrlen (beg, bytes_left, &mbs); -+ -+ last_char = beg; -+ if (mlen == (size_t) -1 || mlen == 0) -+ { -+ /* Incomplete character: treat as single-byte. */ -+ memset (&mbs, '\0', sizeof (mbstate_t)); -+ beg++; -+ bytes_left--; -+ continue; -+ } -+ -+ if (mlen == (size_t) -2) -+ { -+ /* Offset points inside multibyte character: -+ * no good. */ -+ break; -+ } -+ -+ beg += mlen; -+ bytes_left -= mlen; -+ } -+ -+ if (bytes_left) -+ { -+ memset (&mbs, '\0', sizeof (mbstate_t)); -+ goto next_char; /* Try a different anchor. */ -+ } -+ } -+ else -+#endif /* MBS_SUPPORT */ -+ beg += offset; -+#ifdef MBS_SUPPORT -+ /* The string at beg now matches first 3 chars of one of -+ the search strings (less if there are shorter search -+ strings). See if this is a real match. */ -+ if (f_i_multibyte -+ && Fimbexec (beg, len - offset, &kwsmatch.size[0], -+ start_ptr == NULL)) -+ goto next_char; -+#endif /* MBS_SUPPORT */ -+ len = kwsmatch.size[0]; -+ } -+ } -+ } -+ else -+ goto success; -+next_char:; -+#ifdef MBS_SUPPORT -+ /* Advance to next character. For MB_CUR_MAX == 1 case this is handled -+ by ++beg above. */ -+ if (mb_cur_max > 1) -+ { -+ if (using_utf8) -+ { -+ unsigned char c = *beg; -+ if (c >= 0xc2) -+ { -+ if (c < 0xe0) -+ ++beg; -+ else if (c < 0xf0) -+ beg += 2; -+ else if (c < 0xf8) -+ beg += 3; -+ else if (c < 0xfc) -+ beg += 4; -+ else if (c < 0xfe) -+ beg += 5; -+ } -+ } -+ else -+ { -+ size_t l = mbrlen (beg, buf + size - beg, &mbs); -+ -+ last_char = beg; -+ if (l + 2 >= 2) -+ beg += l - 1; -+ else -+ memset (&mbs, '\0', sizeof (mbstate_t)); -+ } -+ } -+#endif /* MBS_SUPPORT */ -+ } -+ -+ return -1; - - success: -+#ifdef MBS_SUPPORT -+ if (mb_cur_max > 1 && !using_utf8) -+ { -+ end = beg + len; -+ while (end < buf + size) -+ { -+ size_t mlen = mbrlen (end, buf + size - end, &mbs); -+ if (mlen == (size_t) -1 || mlen == (size_t) -2 || mlen == 0) -+ { -+ memset (&mbs, '\0', sizeof (mbstate_t)); -+ mlen = 1; -+ } -+ if (mlen == 1 && *end == eol) -+ break; -+ -+ end += mlen; -+ } -+ } -+ else -+ #endif /* MBS_SUPPORT */ - end = memchr (beg + len, eol, (buf + size) - (beg + len)); - end++; - while (buf < beg && beg[-1] != eol) -@@ -591,15 +1016,6 @@ - *match_size = len; - ret_val = beg - buf; - out: --#ifdef MBS_SUPPORT -- if (MB_CUR_MAX > 1) -- { -- if (match_icase) -- free((char*)buf); -- if (mb_properties) -- free(mb_properties); -- } --#endif /* MBS_SUPPORT */ - return ret_val; - } - #endif /* defined(GREP_PROGRAM) || defined(FGREP_PROGRAM) */ diff --git a/abs/core/groff/man-utf8.tmac b/abs/core/groff/man-utf8.tmac deleted file mode 100644 index 17c0983..0000000 --- a/abs/core/groff/man-utf8.tmac +++ /dev/null @@ -1,9 +0,0 @@ -.\" This file is loaded after an-old.tmac. -.\" Put any local modifications to an-old.tmac here. - -.if '\*[.T]'utf8' \ -. char \- \N'45' -. char - \N'45' -. char ' \N'39' -.. - diff --git a/abs/core/gzip/gzip-fixpaths.patch b/abs/core/gzip/gzip-fixpaths.patch deleted file mode 100644 index c95dc67..0000000 --- a/abs/core/gzip/gzip-fixpaths.patch +++ /dev/null @@ -1,37 +0,0 @@ -diff -Naur gzip-1.2.4a-orig/Makefile.in gzip-1.2.4a/Makefile.in ---- gzip-1.2.4a-orig/Makefile.in 1993-08-17 10:12:40.000000000 -0700 -+++ gzip-1.2.4a/Makefile.in 2005-04-21 11:45:27.000000000 -0700 -@@ -348,27 +348,27 @@ - rm -f _match.s - - $(G)zdiff: zdiff.in -- sed -e "$(SEDCMD)" -e "s|BINDIR|$(bindir)|" $(srcdir)/zdiff.in > $@ -+ sed -e "$(SEDCMD)" -e "s|BINDIR|/bin|" $(srcdir)/zdiff.in > $@ - chmod 755 $@ - - $(G)zgrep: zgrep.in -- sed -e "$(SEDCMD)" -e "s|BINDIR|$(bindir)|" $(srcdir)/zgrep.in > $@ -+ sed -e "$(SEDCMD)" -e "s|BINDIR|/bin|" $(srcdir)/zgrep.in > $@ - chmod 755 $@ - - $(G)zmore: zmore.in -- sed -e "$(SEDCMD)" -e "s|BINDIR|$(bindir)|" $(srcdir)/zmore.in > $@ -+ sed -e "$(SEDCMD)" -e "s|BINDIR|/bin|" $(srcdir)/zmore.in > $@ - chmod 755 $@ - - $(G)znew: znew.in -- sed -e "$(SEDCMD)" -e "s|BINDIR|$(bindir)|" $(srcdir)/znew.in > $@ -+ sed -e "$(SEDCMD)" -e "s|BINDIR|/bin|" $(srcdir)/znew.in > $@ - chmod 755 $@ - - $(G)zforce: zforce.in -- sed -e "$(SEDCMD)" -e "s|BINDIR|$(bindir)|" $(srcdir)/zforce.in > $@ -+ sed -e "$(SEDCMD)" -e "s|BINDIR|/bin|" $(srcdir)/zforce.in > $@ - chmod 755 $@ - - gzexe: gzexe.in -- sed -e "$(SEDCMD)" -e "s|BINDIR|$(bindir)|" $(srcdir)/gzexe.in > $@ -+ sed -e "$(SEDCMD)" -e "s|BINDIR|/bin|" $(srcdir)/gzexe.in > $@ - chmod 755 $@ - - gzip.info: gzip.texi diff --git a/abs/core/gzip/gzip-fixutimens.patch b/abs/core/gzip/gzip-fixutimens.patch deleted file mode 100644 index a78aa79..0000000 --- a/abs/core/gzip/gzip-fixutimens.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- gzip-1.3.12.orig/gzip.c -+++ gzip-1.3.12/gzip.c -@@ -1637,7 +1642,7 @@ - } - } - -- if (futimens (ofd, ofname, timespec) != 0) -+ if (gz_futimens (ofd, ofname, timespec) != 0) - { - int e = errno; - WARN ((stderr, "%s: ", program_name)); ---- gzip-1.3.12.orig/lib/utimens.h -+++ gzip-1.3.12/lib/utimens.h -@@ -1,3 +1,3 @@ - #include --int futimens (int, char const *, struct timespec const [2]); -+int gz_futimens (int, char const *, struct timespec const [2]); - int utimens (char const *, struct timespec const [2]); ---- gzip-1.3.12.orig/lib/utimens.c -+++ gzip-1.3.12/lib/utimens.c -@@ -75,7 +75,7 @@ - Return 0 on success, -1 (setting errno) on failure. */ - - int --futimens (int fd ATTRIBUTE_UNUSED, -+gz_futimens (int fd ATTRIBUTE_UNUSED, - char const *file, struct timespec const timespec[2]) - { - /* Some Linux-based NFS clients are buggy, and mishandle time stamps -@@ -185,5 +185,5 @@ - int - utimens (char const *file, struct timespec const timespec[2]) - { -- return futimens (-1, file, timespec); -+ return gz_futimens (-1, file, timespec); - } diff --git a/abs/core/gzip/gzip-security-update.patch b/abs/core/gzip/gzip-security-update.patch deleted file mode 100644 index 2fff599..0000000 --- a/abs/core/gzip/gzip-security-update.patch +++ /dev/null @@ -1,186 +0,0 @@ -Only in gzip-1.3.5: cscope.out -diff -ru gzip-1.3.5.orig/gzip.h gzip-1.3.5/gzip.h ---- gzip-1.3.5.orig/gzip.h 2001-10-01 07:53:41.000000000 +0100 -+++ gzip-1.3.5/gzip.h 2006-08-18 22:44:38.755598000 +0100 -@@ -198,6 +198,8 @@ - extern int to_stdout; /* output to stdout (-c) */ - extern int save_orig_name; /* set if original name must be saved */ - -+#define MIN(a,b) ((a) <= (b) ? (a) : (b)) -+ - #define get_byte() (inptr < insize ? inbuf[inptr++] : fill_inbuf(0)) - #define try_byte() (inptr < insize ? inbuf[inptr++] : fill_inbuf(1)) - -diff -ru gzip-1.3.5.orig/inflate.c gzip-1.3.5/inflate.c ---- gzip-1.3.5.orig/inflate.c 2002-09-25 22:20:13.000000000 +0100 -+++ gzip-1.3.5/inflate.c 2006-07-21 09:10:43.350376000 +0100 -@@ -337,7 +337,7 @@ - { - *t = (struct huft *)NULL; - *m = 0; -- return 0; -+ return 2; - } - - -Only in gzip-1.3.5: testcases -diff -ru gzip-1.3.5.orig/unlzh.c gzip-1.3.5/unlzh.c ---- gzip-1.3.5.orig/unlzh.c 1999-10-06 06:00:00.000000000 +0100 -+++ gzip-1.3.5/unlzh.c 2006-08-18 22:56:19.446997000 +0100 -@@ -149,13 +149,17 @@ - unsigned i, k, len, ch, jutbits, avail, nextcode, mask; - - for (i = 1; i <= 16; i++) count[i] = 0; -- for (i = 0; i < (unsigned)nchar; i++) count[bitlen[i]]++; -+ for (i = 0; i < (unsigned)nchar; i++) { -+ if (bitlen[i] > 16) -+ error("Bad table (case a)\n"); -+ else count[bitlen[i]]++; -+ } - - start[1] = 0; - for (i = 1; i <= 16; i++) - start[i + 1] = start[i] + (count[i] << (16 - i)); -- if ((start[17] & 0xffff) != 0) -- error("Bad table\n"); -+ if ((start[17] & 0xffff) != 0 || tablebits > 16) /* 16 for weight below */ -+ error("Bad table (case b)\n"); - - jutbits = 16 - tablebits; - for (i = 1; i <= (unsigned)tablebits; i++) { -@@ -169,15 +173,15 @@ - - i = start[tablebits + 1] >> jutbits; - if (i != 0) { -- k = 1 << tablebits; -- while (i != k) table[i++] = 0; -+ k = MIN(1 << tablebits, DIST_BUFSIZE); -+ while (i < k) table[i++] = 0; - } - - avail = nchar; - mask = (unsigned) 1 << (15 - tablebits); - for (ch = 0; ch < (unsigned)nchar; ch++) { - if ((len = bitlen[ch]) == 0) continue; -- nextcode = start[len] + weight[len]; -+ nextcode = MIN(start[len] + weight[len], DIST_BUFSIZE); - if (len <= (unsigned)tablebits) { - for (i = start[len]; i < nextcode; i++) table[i] = ch; - } else { -@@ -218,7 +222,7 @@ - for (i = 0; i < 256; i++) pt_table[i] = c; - } else { - i = 0; -- while (i < n) { -+ while (i < MIN(n,NPT)) { - c = bitbuf >> (BITBUFSIZ - 3); - if (c == 7) { - mask = (unsigned) 1 << (BITBUFSIZ - 1 - 3); -@@ -228,7 +232,7 @@ - pt_len[i++] = c; - if (i == i_special) { - c = getbits(2); -- while (--c >= 0) pt_len[i++] = 0; -+ while (--c >= 0 && i < NPT) pt_len[i++] = 0; - } - } - while (i < nn) pt_len[i++] = 0; -@@ -248,7 +252,7 @@ - for (i = 0; i < 4096; i++) c_table[i] = c; - } else { - i = 0; -- while (i < n) { -+ while (i < MIN(n,NC)) { - c = pt_table[bitbuf >> (BITBUFSIZ - 8)]; - if (c >= NT) { - mask = (unsigned) 1 << (BITBUFSIZ - 1 - 8); -@@ -256,14 +260,14 @@ - if (bitbuf & mask) c = right[c]; - else c = left [c]; - mask >>= 1; -- } while (c >= NT); -+ } while (c >= NT && (mask || c != left[c])); - } - fillbuf((int) pt_len[c]); - if (c <= 2) { - if (c == 0) c = 1; - else if (c == 1) c = getbits(4) + 3; - else c = getbits(CBIT) + 20; -- while (--c >= 0) c_len[i++] = 0; -+ while (--c >= 0 && i < NC) c_len[i++] = 0; - } else c_len[i++] = c - 2; - } - while (i < NC) c_len[i++] = 0; -@@ -292,7 +296,7 @@ - if (bitbuf & mask) j = right[j]; - else j = left [j]; - mask >>= 1; -- } while (j >= NC); -+ } while (j >= NC && (mask || j != left[j])); - } - fillbuf((int) c_len[j]); - return j; -@@ -309,7 +313,7 @@ - if (bitbuf & mask) j = right[j]; - else j = left [j]; - mask >>= 1; -- } while (j >= NP); -+ } while (j >= NP && (mask || j != left[j])); - } - fillbuf((int) pt_len[j]); - if (j != 0) j = ((unsigned) 1 << (j - 1)) + getbits((int) (j - 1)); -@@ -356,7 +360,7 @@ - while (--j >= 0) { - buffer[r] = buffer[i]; - i = (i + 1) & (DICSIZ - 1); -- if (++r == count) return r; -+ if (++r >= count) return r; - } - for ( ; ; ) { - c = decode_c(); -@@ -366,14 +370,14 @@ - } - if (c <= UCHAR_MAX) { - buffer[r] = c; -- if (++r == count) return r; -+ if (++r >= count) return r; - } else { - j = c - (UCHAR_MAX + 1 - THRESHOLD); - i = (r - decode_p() - 1) & (DICSIZ - 1); - while (--j >= 0) { - buffer[r] = buffer[i]; - i = (i + 1) & (DICSIZ - 1); -- if (++r == count) return r; -+ if (++r >= count) return r; - } - } - } -diff -ru gzip-1.3.5.orig/unpack.c gzip-1.3.5/unpack.c ---- gzip-1.3.5.orig/unpack.c 1999-10-06 06:00:00.000000000 +0100 -+++ gzip-1.3.5/unpack.c 2006-07-21 15:49:48.615190000 +0100 -@@ -13,7 +13,6 @@ - #include "gzip.h" - #include "crypt.h" - --#define MIN(a,b) ((a) <= (b) ? (a) : (b)) - /* The arguments must not have side effects. */ - - #define MAX_BITLEN 25 -@@ -133,7 +132,7 @@ - /* Remember where the literals of this length start in literal[] : */ - lit_base[len] = base; - /* And read the literals: */ -- for (n = leaves[len]; n > 0; n--) { -+ for (n = leaves[len]; n > 0 && base < LITERALS; n--) { - literal[base++] = (uch)get_byte(); - } - } -@@ -169,7 +168,7 @@ - prefixp = &prefix_len[1< prefix_len) *--prefixp = (uch)len; - } - /* The length of all other codes is unknown: */ - while (prefixp > prefix_len) *--prefixp = 0; diff --git a/abs/core/iproute2/iproute2-2.4.7-now-ss020116.patch b/abs/core/iproute2/iproute2-2.4.7-now-ss020116.patch deleted file mode 100644 index 0e37865..0000000 --- a/abs/core/iproute2/iproute2-2.4.7-now-ss020116.patch +++ /dev/null @@ -1,9823 +0,0 @@ -diff -Naur iproute2-orig/Makefile iproute2/Makefile ---- iproute2-orig/Makefile 2002-01-15 15:30:32.000000000 -0800 -+++ iproute2/Makefile 2004-05-21 00:16:36.000000000 -0700 -@@ -4,8 +4,6 @@ - CONFDIR=/etc/iproute2 - DOCDIR=/usr/doc/iproute2 - --KERNEL_INCLUDE=/usr/src/linux/include --LIBC_INCLUDE=/usr/include - - DEFINES= -DRESOLVE_HOSTNAMES - -@@ -23,19 +21,11 @@ - #options for ipx - ADDLIB+=ipx_ntop.o ipx_pton.o - --ifeq ($(LIBC_INCLUDE)/socketbits.h,$(wildcard $(LIBC_INCLUDE)/socketbits.h)) -- ifeq ($(LIBC_INCLUDE)/net/if_packet.h,$(wildcard $(LIBC_INCLUDE)/net/if_packet.h)) -- GLIBCFIX=-I../include-glibc -include ../include-glibc/glibc-bugs.h -- endif --endif --ifeq ($(LIBC_INCLUDE)/bits/socket.h,$(wildcard $(LIBC_INCLUDE)/bits/socket.h)) -- GLIBCFIX=-I../include-glibc -I/usr/include/db3 -include ../include-glibc/glibc-bugs.h --endif - - - CC = gcc - CCOPTS = -D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall -g --CFLAGS = $(CCOPTS) $(GLIBCFIX) -I$(KERNEL_INCLUDE) -I../include $(DEFINES) -+CFLAGS = $(CCOPTS) -I../include $(DEFINES) - - LDLIBS += -L../lib -lnetlink -lutil - -@@ -43,19 +33,11 @@ - - LIBNETLINK=../lib/libnetlink.a ../lib/libutil.a - --all: check-kernel -+all: - @set -e; \ - for i in $(SUBDIRS); \ - do $(MAKE) -C $$i; done - --check-kernel: --ifeq ($(KERNEL_INCLUDE),) -- @echo "Please, set correct KERNEL_INCLUDE"; false --else -- @set -e; \ -- if [ ! -r $(KERNEL_INCLUDE)/linux/autoconf.h ]; then \ -- echo "Please, compile the kernel first"; false; fi --endif - - install: all - install -m 0755 -d $(DESTDIR)$(SBINDIR) -diff -Naur iproute2-orig/Makefile~ iproute2/Makefile~ ---- iproute2-orig/Makefile~ 1969-12-31 16:00:00.000000000 -0800 -+++ iproute2/Makefile~ 2002-01-15 15:30:32.000000000 -0800 -@@ -0,0 +1,77 @@ -+# Path to parent kernel include files directory -+DESTDIR= -+SBINDIR=/sbin -+CONFDIR=/etc/iproute2 -+DOCDIR=/usr/doc/iproute2 -+ -+KERNEL_INCLUDE=/usr/src/linux/include -+LIBC_INCLUDE=/usr/include -+ -+DEFINES= -DRESOLVE_HOSTNAMES -+ -+#options if you have a bind>=4.9.4 libresolv (or, maybe, glibc) -+LDLIBS=-lresolv -+ADDLIB= -+ -+#options if you compile with libc5, and without a bind>=4.9.4 libresolv -+#LDLIBS= -+#ADDLIB=inet_ntop.o inet_pton.o -+ -+#options for decnet -+ADDLIB+=dnet_ntop.o dnet_pton.o -+ -+#options for ipx -+ADDLIB+=ipx_ntop.o ipx_pton.o -+ -+ifeq ($(LIBC_INCLUDE)/socketbits.h,$(wildcard $(LIBC_INCLUDE)/socketbits.h)) -+ ifeq ($(LIBC_INCLUDE)/net/if_packet.h,$(wildcard $(LIBC_INCLUDE)/net/if_packet.h)) -+ GLIBCFIX=-I../include-glibc -include ../include-glibc/glibc-bugs.h -+ endif -+endif -+ifeq ($(LIBC_INCLUDE)/bits/socket.h,$(wildcard $(LIBC_INCLUDE)/bits/socket.h)) -+ GLIBCFIX=-I../include-glibc -I/usr/include/db3 -include ../include-glibc/glibc-bugs.h -+endif -+ -+ -+CC = gcc -+CCOPTS = -D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall -g -+CFLAGS = $(CCOPTS) $(GLIBCFIX) -I$(KERNEL_INCLUDE) -I../include $(DEFINES) -+ -+LDLIBS += -L../lib -lnetlink -lutil -+ -+SUBDIRS=lib ip tc misc -+ -+LIBNETLINK=../lib/libnetlink.a ../lib/libutil.a -+ -+all: check-kernel -+ @set -e; \ -+ for i in $(SUBDIRS); \ -+ do $(MAKE) -C $$i; done -+ -+check-kernel: -+ifeq ($(KERNEL_INCLUDE),) -+ @echo "Please, set correct KERNEL_INCLUDE"; false -+else -+ @set -e; \ -+ if [ ! -r $(KERNEL_INCLUDE)/linux/autoconf.h ]; then \ -+ echo "Please, compile the kernel first"; false; fi -+endif -+ -+install: all -+ install -m 0755 -d $(DESTDIR)$(SBINDIR) -+ install -m 0755 -d $(DESTDIR)$(CONFDIR) -+ install -m 0755 -d $(DESTDIR)$(DOCDIR)/examples -+ install -m 0755 -d $(DESTDIR)$(DOCDIR)/examples/diffserv -+ install -m 0644 README.iproute2+tc $(shell find examples -type f -maxdepth 1) $(DESTDIR)$(DOCDIR)/examples -+ install -m 0644 $(shell echo examples/diffserv/*) $(DESTDIR)$(DOCDIR)/examples/diffserv -+ @for i in $(SUBDIRS) doc; do $(MAKE) -C $$i install; done -+ @cd etc/iproute2; for i in *; do \ -+ if [ ! -e $(DESTDIR)$(CONFDIR)/$$i ]; then \ -+ echo install -m 0644 $$i $(DESTDIR)$(CONFDIR); \ -+ install -m 0644 $$i $(DESTDIR)$(CONFDIR); fi; done -+ -+clean: -+ for i in $(SUBDIRS) doc; \ -+ do $(MAKE) -C $$i clean; done -+ -+.EXPORT_ALL_VARIABLES: -diff -Naur iproute2-orig/debian/README.Debian iproute2/debian/README.Debian ---- iproute2-orig/debian/README.Debian 1969-12-31 16:00:00.000000000 -0800 -+++ iproute2/debian/README.Debian 2004-05-21 00:09:38.000000000 -0700 -@@ -0,0 +1,4 @@ -+This version of "iproute" includes the HTB Linux queuing discipline -+explained in http://luxik.cdi.cz/~devik/qos/htb/ -+ -+You need kernel version 2.4.21 or newer in order to use it. -diff -Naur iproute2-orig/debian/changelog iproute2/debian/changelog ---- iproute2-orig/debian/changelog 1969-12-31 16:00:00.000000000 -0800 -+++ iproute2/debian/changelog 2004-05-21 00:09:38.000000000 -0700 -@@ -0,0 +1,207 @@ -+iproute (20010824-13) unstable; urgency=low -+ -+ * debian/rules: Run dpkg-shlibdeps with all the executables, -+ to fix dependency problem (closes: Bug#224063) -+ * Really removed references to obsolete include files -+ (Bug#223165 was not fixed properly) -+ -+ -- Juan Cespedes Sun, 25 Jan 2004 23:04:20 +0100 -+ -+iproute (20010824-12) unstable; urgency=low -+ -+ * Updated README.Debian and copyright file -+ * Added two new manpages from http://lartc.org/manpages/: -+ ip(8) and tc-cbq-details(8). -+ * Removed references to obsolete include files which made -+ compilation fail (closes: Bug#223165) -+ -+ -- Juan Cespedes Sun, 14 Dec 2003 00:40:10 +0100 -+ -+iproute (20010824-11) unstable; urgency=low -+ -+ * Changed priority to "optional" -+ * Fixed "tc -s qdisc" on sparc (patch by "Nicolas S. Dade" -+ ) (closes: Bug#194128) -+ -+ -- Juan Cespedes Sun, 17 Aug 2003 00:22:47 +0200 -+ -+iproute (20010824-10) unstable; urgency=low -+ -+ * Updated manual pages from http://www.lartc.org/manpages/ -+ (closes: Bug#156353, Bug#175313, Bug#176989, Bug#189095) -+ * New Standards-Version -+ * Don't "rm -rf /etc/iproute2" on purge (closes: Bug#202862) -+ * Include "iproute2" in the description (closes: Bug#182999) -+ -+ -- Juan Cespedes Sat, 16 Aug 2003 18:29:27 +0200 -+ -+iproute (20010824-9) unstable; urgency=medium -+ -+ * Added patch for HTB v3.6 to be able to work with kernel 2.4.20 -+ (from http://luxik.cdi.cz/~devik/qos/htb/v3/htb3.6-020525.tgz) -+ (closes: Bug#147550, Bug#167149, Bug#167597, Bug#171277) -+ -+ -- Juan Cespedes Thu, 05 Dec 2002 13:44:10 +0100 -+ -+iproute (20010824-8) unstable; urgency=medium -+ -+ * Added support for HTB queuing discipline (closes: Bug#133381) -+ NOTE: you need a patched kernel in order to use it -+ -+ -- Juan Cespedes Tue, 2 Apr 2002 20:29:40 +0200 -+ -+iproute (20010824-7) unstable; urgency=medium -+ -+ * Move `ip' binary to /bin to fix FHS violation (closes: Bug#134812) -+ -+ -- Juan Cespedes Mon, 4 Mar 2002 00:20:30 +0100 -+ -+iproute (20010824-6) unstable; urgency=low -+ -+ * Added a couple of #ifdef's to be able to compile with older -+ kernel headers (needed for arm) (closes: Bug#131695) -+ -+ -- Juan Cespedes Sat, 16 Feb 2002 19:27:15 +0100 -+ -+iproute (20010824-5) unstable; urgency=low -+ -+ * Really fix Bug#121589 (dead gateway bug); apparently I -+ forgot to include the patch in 20010824-2 -+ -+ -- Juan Cespedes Tue, 29 Jan 2002 23:22:24 +0100 -+ -+iproute (20010824-4) unstable; urgency=low -+ -+ * Added support for DIFFSERV and ATM in tc -+ -+ -- Juan Cespedes Sun, 13 Jan 2002 03:01:47 +0100 -+ -+iproute (20010824-3) unstable; urgency=low -+ -+ * Updated tc* man pages (thanks to bert hubert ) -+ * Fixed spurious space in `tc -s qdisc' output (closes: Bug#128501) -+ -+ -- Juan Cespedes Thu, 10 Jan 2002 22:18:25 +0100 -+ -+iproute (20010824-2) unstable; urgency=low -+ -+ * Fixed the following important and serious bugs: -+ + iproute doesn't compile on Alpha (closes: Bug#118113, Bug#123224) -+ + iproute doesn't compile on MIPS (closes: Bug#118424) -+ + iproute doesn't compile on powerpc (closes: Bug#119601) -+ * Added man pages for tc (closes: Bug#124230), tc-cbq, tc-red, tc-tbf, -+ tc-prio and tc-sfq -+ * Removed references to old programs from iproute(7) (closes: Bug#99536) -+ * Fixed bug which presented first hop as dead in equal cost multipath -+ (closes: Bug#121589) -+ * Do not process .ps with through `psnup' (closes: Bug#119820) -+ -+ -- Juan Cespedes Tue, 8 Jan 2002 16:07:27 +0100 -+ -+iproute (20010824-1) unstable; urgency=low -+ -+ * New upstream version -+ * Make ingress qdisc work again with tc (closes: Bug#84444) -+ * Make it compile properly with new include files (closes: Bug#113112) -+ -+ -- Juan Cespedes Sun, 28 Oct 2001 16:38:00 +0100 -+ -+iproute (20001007-1) unstable; urgency=low -+ -+ * New upstream version (closes: Bug#63701) -+ * Remove /etc/iproute2 on purge (closes: Bug#72743) -+ * Fixed Lintian warnings (no-priority-field and no-section-field) -+ -+ -- Juan Cespedes Sat, 14 Oct 2000 19:27:12 +0200 -+ -+iproute (991023-2) unstable; urgency=low -+ -+ * New Standards-Version (3.1.1) (closes: Bug#47923) -+ * Modified description of package to show which kernel options are -+ necessary to use the package (closes: Bug#47922) -+ * Updated manual page to point at /usr/share/doc/iproute (closes: Bug#47924) -+ -+ -- Juan Cespedes Sun, 19 Dec 1999 04:00:21 +0100 -+ -+iproute (991023-1) unstable; urgency=low -+ -+ * New upstream version (closes: Bug#48733) -+ -+ -- Juan Cespedes Tue, 2 Nov 1999 16:29:37 +0100 -+ -+iproute (990824-1) unstable; urgency=low -+ -+ * New maintainer -+ * New upstream version -+ * New Standards-Version: 3.1.0 -+ * Minor fix in "ip rule list": mask in "from" address was not shown -+ correctly -+ * Removed obsoleted documentation from "debian/" directory -+ -+ -- Juan Cespedes Sun, 24 Oct 1999 19:02:56 +0200 -+ -+iproute (990630-1) unstable; urgency=low -+ -+ * New upstream version. -+ * FHS and standards 3.0.1.0. -+ -+ -- Roberto Lumbreras Tue, 3 Aug 1999 02:49:28 +0200 -+ -+iproute (990530-1) unstable; urgency=low -+ -+ * New upstream version. -+ * Build with 2.2.10 kernel headers. -+ * Install new scripts ip/routef ip/routel, but not ip/ifcfg ip/rtpr by -+ now, I don't know who/what needs rtpr; ifcfg uses arping, and it isn't -+ available in debian for now. -+ -+ -- Roberto Lumbreras Tue, 22 Jun 1999 02:28:53 +0200 -+ -+iproute (990329-1) unstable; urgency=low -+ -+ * New upstream version. -+ * Build with 2.2.5 kernel headers. -+ -+ -- Roberto Lumbreras Sun, 4 Apr 1999 18:50:39 +0200 -+ -+iproute (980630-1) unstable; urgency=low -+ -+ * New upstream version. -+ * Build with 2.1.112 kernel headers. -+ * Rewrote the rules file. -+ -+ -- Roberto Lumbreras Wed, 29 Jul 1998 23:37:52 +0200 -+ -+iproute (980119-1) unstable; urgency=low -+ -+ * Outdated documentation. Upstream docs are scarce. -+ * Non-Maintainer release -+ * This package has no correct copyright file! -+ * Include all the README.* docs from the upstream site. -+ * Modified to build under glibc -+ * Build with 2.1.85 kernel headers. -+ * produce a correct diff. -+ * Reworked the rules file to utilize debmake fully -+ * Newest upstream release -+ * glibc compilation -+ -+ -- Christoph Lameter Wed, 4 Feb 1998 13:37:28 -0800 -+ -+iproute (961225-2) unstable frozen; urgency=low -+ -+ * Added a man page for iproute. (Fixes #8080). -+ * Removed out-of-date patches. -+ * Added routing.txt from /usr/src/linux/Documentation/networking/routing.txt -+ * Newer version of debmake. -+ -+ -- Tom Lees Mon, 17 Apr 1997 17:00:36 +0100 -+ -+iproute (961225-1) unstable; urgency=low -+ -+ * Initial Release. -+ -+ -- Tom Lees Mon, 30 Dec 1996 11:12:23 +0000 -+ -+Local variables: -+mode: debian-changelog -+End: -diff -Naur iproute2-orig/debian/conffiles iproute2/debian/conffiles ---- iproute2-orig/debian/conffiles 1969-12-31 16:00:00.000000000 -0800 -+++ iproute2/debian/conffiles 2004-05-21 00:09:38.000000000 -0700 -@@ -0,0 +1,5 @@ -+/etc/iproute2/rt_dsfield -+/etc/iproute2/rt_protos -+/etc/iproute2/rt_realms -+/etc/iproute2/rt_scopes -+/etc/iproute2/rt_tables -diff -Naur iproute2-orig/debian/control iproute2/debian/control ---- iproute2-orig/debian/control 1969-12-31 16:00:00.000000000 -0800 -+++ iproute2/debian/control 2004-05-21 00:09:38.000000000 -0700 -@@ -0,0 +1,19 @@ -+Source: iproute -+Section: net -+Priority: optional -+Maintainer: Juan Cespedes -+Standards-Version: 3.6.0 -+Build-Depends: tetex-bin, atm-dev -+ -+Package: iproute -+Architecture: any -+Depends: ${shlibs:Depends} -+Description: Professional tools to control the networking in Linux kernels -+ This is `iproute', the professional set of tools to control the -+ networking behavior in kernels 2.2.x and later. -+ . -+ At least, the options CONFIG_NETLINK and CONFIG_RTNETLINK must -+ be compiled in the running kernel -+ . -+ This package is also known as iproute2 upstream and in some -+ documentation. -diff -Naur iproute2-orig/debian/copyright iproute2/debian/copyright ---- iproute2-orig/debian/copyright 1969-12-31 16:00:00.000000000 -0800 -+++ iproute2/debian/copyright 2004-05-21 00:09:38.000000000 -0700 -@@ -0,0 +1,42 @@ -+This is the Debian GNU/Linux's prepackaged version of the -+Linux Traffic Control engine and related utils, "iproute" -+ -+This package was put together from sources obtained from: -+ ftp://ftp.inr.ac.ru/ip-routing/iproute2-2.4.7-now-ss010824.tar.gz -+ -+Changes for Debian: -+ * added Debian GNU/Linux package maintenance system files -+ * Added HTB v3.6 from -+ -+ -+ -+Copyrights -+---------- -+Copyright (C) 1996-2001 Alexey Kuznetsov -+ -+Modifications for Debian: -+ Copyright (C) 1996 Tom Lees -+ Copyright (C) 1998 Christoph Lameter -+ Copyright (C) 1998-1999 Roberto Lumbreras -+ Copyright (C) 1999-2003 Juan Cespedes -+ -+ -+License -+------- -+ -+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. -+ -+A copy of the GNU General Public License is available as -+`/usr/share/common-licenses/GPL' in the Debian GNU/Linux distribution -+or on the World Wide Web at `http://www.gnu.org/copyleft/gpl.html'. -+You can also obtain it by writing to the Free Software Foundation, -+Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA -+ -diff -Naur iproute2-orig/debian/manpages/ip.8 iproute2/debian/manpages/ip.8 ---- iproute2-orig/debian/manpages/ip.8 1969-12-31 16:00:00.000000000 -0800 -+++ iproute2/debian/manpages/ip.8 2004-05-21 00:09:38.000000000 -0700 -@@ -0,0 +1,1809 @@ -+.TH IP 8 "17 January 2002" "iproute2" "Linux" -+.SH NAME -+ip \- show / manipulate routing, devices, policy routing and tunnels -+.SH SYNOPSIS -+ -+.ad l -+.in +8 -+.ti -8 -+.B ip -+.RI "[ " OPTIONS " ] " OBJECT " { " COMMAND " | " -+.BR help " }" -+.sp -+ -+.ti -8 -+.IR OBJECT " := { " -+.BR link " | " addr " | " route " | " rule " | " neigh " | " tunnel " | "\ -+maddr " | " mroute " | " monitor " }" -+.sp -+ -+.ti -8 -+.IR OPTIONS " := { " -+\fB\-V\fR[\fIersion\fR] | -+\fB\-s\fR[\fItatistics\fR] | -+\fB\-r\fR[\fIesolve\fR] | -+\fB\-f\fR[\fIamily\fR] { -+.BR inet " | " inet6 " | " ipx " | " dnet " | " link " } | " -+\fB\-o\fR[\fIneline\fR] } -+ -+.ti -8 -+.BI "ip link set " DEVICE -+.RB "{ " up " | " down " | " arp " { " on " | " off " } |" -+.br -+.BR promisc " { " on " | " off " } |" -+.br -+.BR allmulti " { " on " | " off " } |" -+.br -+.BR dynamic " { " on " | " off " } |" -+.br -+.BR multicast " { " on " | " off " } |" -+.br -+.B txqueuelen -+.IR PACKETS " |" -+.br -+.B name -+.IR NEWNAME " |" -+.br -+.B address -+.IR LLADDR " |" -+.B broadcast -+.IR LLADDR " |" -+.br -+.B mtu -+.IR MTU " }" -+ -+.ti -8 -+.B ip link show -+.RI "[ " DEVICE " ]" -+ -+.ti -8 -+.BR "ip addr" " { " add " | " del " } " -+.IB IFADDR " dev " STRING -+ -+.ti -8 -+.BR "ip addr" " { " show " | " flush " } [ " dev -+.IR STRING " ] [ " -+.B scope -+.IR SCOPE-ID " ] [ " -+.B to -+.IR PREFIX " ] [ " FLAG-LIST " ] [ " -+.B label -+.IR PATTERN " ]" -+ -+.ti -8 -+.IR IFADDR " := " PREFIX " | " ADDR -+.B peer -+.IR PREFIX " [ " -+.B broadcast -+.IR ADDR " ] [ " -+.B anycast -+.IR ADDR " ] [ " -+.B label -+.IR STRING " ] [ " -+.B scope -+.IR SCOPE-ID " ]" -+ -+.ti -8 -+.IR SCOPE-ID " := " -+.RB "[ " host " | " link " | " global " | " -+.IR NUMBER " ]" -+ -+.ti -8 -+.IR FLAG-LIST " := [ " FLAG-LIST " ] " FLAG -+ -+.ti -8 -+.IR FLAG " := " -+.RB "[ " permanent " | " dynamic " | " secondary " | " primary " | "\ -+tentative " | " deprecated " ]" -+ -+.ti -8 -+.BR "ip route" " { " -+.BR list " | " flush " } " -+.I SELECTOR -+ -+.ti -8 -+.B ip route get -+.IR ADDRESS " [ " -+.BI from " ADDRESS " iif " STRING" -+.RB " ] [ " oif -+.IR STRING " ] [ " -+.B tos -+.IR TOS " ]" -+ -+.ti -8 -+.BR "ip route" " { " add " | " del " | " change " | " append " | "\ -+replace " | " monitor " } " -+.I ROUTE -+ -+.ti -8 -+.IR SELECTOR " := " -+.RB "[ " root -+.IR PREFIX " ] [ " -+.B match -+.IR PREFIX " ] [ " -+.B exact -+.IR PREFIX " ] [ " -+.B table -+.IR TABLE_ID " ] [ " -+.B proto -+.IR RTPROTO " ] [ " -+.B type -+.IR TYPE " ] [ " -+.B scope -+.IR SCOPE " ]" -+ -+.ti -8 -+.IR ROUTE " := " NODE_SPEC " [ " INFO_SPEC " ]" -+ -+.ti -8 -+.IR NODE_SPEC " := [ " TYPE " ] " PREFIX " [" -+.B tos -+.IR TOS " ] [ " -+.B table -+.IR TABLE_ID " ] [ " -+.B proto -+.IR RTPROTO " ] [ " -+.B scope -+.IR SCOPE " ] [ " -+.B metric -+.IR METRIC " ]" -+ -+.ti -8 -+.IR INFO_SPEC " := " "NH OPTIONS FLAGS" " [" -+.B nexthop -+.IR NH " ] ..." -+ -+.ti -8 -+.IR NH " := [ " -+.B via -+.IR ADDRESS " ] [ " -+.B dev -+.IR STRING " ] [ " -+.B weight -+.IR NUMBER " ] " NHFLAGS -+ -+.ti -8 -+.IR OPTIONS " := " FLAGS " [ " -+.B mtu -+.IR NUMBER " ] [ " -+.B advmss -+.IR NUMBER " ] [ " -+.B rtt -+.IR NUMBER " ] [ " -+.B rttvar -+.IR NUMBER " ] [ " -+.B window -+.IR NUMBER " ] [ " -+.B cwnd -+.IR NUMBER " ] [ " -+.B ssthresh -+.IR REALM " ] [ " -+.B realms -+.IR REALM " ]" -+ -+.ti -8 -+.IR TYPE " := [ " -+.BR unicast " | " local " | " broadcast " | " multicast " | "\ -+throw " | " unreachable " | " prohibit " | " blackhole " | " nat " ]" -+ -+.ti -8 -+.IR TABLE_ID " := [ " -+.BR local "| " main " | " default " | " all " |" -+.IR NUMBER " ]" -+ -+.ti -8 -+.IR SCOPE " := [ " -+.BR host " | " link " | " global " |" -+.IR NUMBER " ]" -+ -+.ti -8 -+.IR FLAGS " := [ " -+.BR equalize " ]" -+ -+.ti -8 -+.IR NHFLAGS " := [ " -+.BR onlink " | " pervasive " ]" -+ -+.ti -8 -+.IR RTPROTO " := [ " -+.BR kernel " | " boot " | " static " |" -+.IR NUMBER " ]" -+ -+.ti -8 -+.B ip rule -+.RB " [ " list " | " add " | " del " ]" -+.I SELECTOR ACTION -+ -+.ti -8 -+.IR SELECTOR " := [ " -+.B from -+.IR PREFIX " ] [ " -+.B to -+.IR PREFIX " ] [ " -+.B tos -+.IR TOS " ] [ " -+.B fwmark -+.IR FWMARK " ] [ " -+.B dev -+.IR STRING " ] [ " -+.B pref -+.IR NUMBER " ]" -+ -+.ti -8 -+.IR ACTION " := [ " -+.B table -+.IR TABLE_ID " ] [ " -+.B nat -+.IR ADDRESS " ] [ " -+.BR prohibit " | " reject " | " unreachable " ] [ " realms -+.RI "[" SRCREALM "/]" DSTREALM " ]" -+ -+.ti -8 -+.IR TABLE_ID " := [ " -+.BR local " | " main " | " default " |" -+.IR NUMBER " ]" -+ -+.ti -8 -+.BR "ip neigh" " { " add " | " del " | " change " | " replace " } { " -+.IR ADDR " [ " -+.B lladdr -+.IR LLADDR " ] [ " -+.BR nud " { " permanent " | " noarp " | " stale " | " reachable " } ] | " proxy -+.IR ADDR " } [ " -+.B dev -+.IR DEV " ]" -+ -+.ti -8 -+.BR "ip neigh" " { " show " | " flush " } [ " to -+.IR PREFIX " ] [ " -+.B dev -+.IR DEV " ] [ " -+.B nud -+.IR STATE " ]" -+ -+.ti -8 -+.BR "ip tunnel" " { " add " | " change " | " del " | " show " }" -+.RI "[ " NAME " ]" -+.br -+.RB "[ " mode " { " ipip " | " gre " | " sit " } ]" -+.br -+.RB "[ " remote -+.IR ADDR " ] [ " -+.B local -+.IR ADDR " ]" -+.br -+.RB "[ [" i "|" o "]" seq " ] [ [" i "|" o "]" key -+.IR KEY " ] [ " -+.RB "[" i "|" o "]" csum " ] ]" -+.br -+.RB "[ " ttl -+.IR TTL " ] [ " -+.B tos -+.IR TOS " ] [ " -+.RB "[" no "]" pmtudisc " ]" -+.br -+.RB "[ " dev -+.IR PHYS_DEV " ]" -+ -+.ti -8 -+.IR ADDR " := { " IP_ADDRESS " |" -+.BR any " }" -+ -+.ti -8 -+.IR TOS " := { " NUMBER " |" -+.BR inherit " }" -+ -+.ti -8 -+.IR TTL " := { " 1 ".." 255 " | " -+.BR inherit " }" -+ -+.ti -8 -+.IR KEY " := { " DOTTED_QUAD " | " NUMBER " }" -+ -+.ti -8 -+.BR "ip maddr" " [ " add " | " del " ]" -+.IB MULTIADDR " dev " STRING -+ -+.ti -8 -+.BR "ip maddr show" " [ " dev -+.IR STRING " ]" -+ -+.ti -8 -+.BR "ip mroute show" " [" -+.IR PREFIX " ] [ " -+.B from -+.IR PREFIX " ] [ " -+.B iif -+.IR DEVICE " ]" -+ -+.ti -8 -+.BR "ip monitor" " [ " all " |" -+.IR LISTofOBJECTS " ]" -+.in -8 -+.ad b -+ -+.SH OPTIONS -+ -+.TP -+.BR "\-V" , " -Version" -+print the version of the -+.B ip -+utility and exit. -+ -+.TP -+.BR "\-s" , " \-stats", " \-statistics" -+output more information. If the option -+appears twice or more, the amount of information increases. -+As a rule, the information is statistics or some time values. -+ -+.TP -+.BR "\-f" , " \-family" -+followed by protocol family identifier: -+.BR "inet" , " inet6" -+or -+.B link -+,enforce the protocol family to use. If the option is not present, -+the protocol family is guessed from other arguments. If the rest -+of the command line does not give enough information to guess the -+family, -+.B ip -+falls back to the default one, usually -+.B inet -+or -+.BR "any" . -+.B link -+is a special family identifier meaning that no networking protocol -+is involved. -+ -+.TP -+.B \-4 -+shortcut for -+.BR "-family inet" . -+ -+.TP -+.B \-6 -+shortcut for -+.BR "\-family inet6" . -+ -+.TP -+.B \-0 -+shortcut for -+.BR "\-family link" . -+ -+.TP -+.BR "\-o" , " \-oneline" -+output each record on a single line, replacing line feeds -+with the -+.B '\' -+character. This is convenient when you want to count records -+with -+.BR wc (1) -+ or to -+.BR grep (1) -+the output. -+ -+.TP -+.BR "\-r" , " \-resolve" -+use the system's name resolver to print DNS names instead of -+host addresses. -+ -+.SH IP - COMMAND SYNTAX -+ -+.SS -+.I OBJECT -+ -+.TP -+.B link -+- network device. -+ -+.TP -+.B address -+- protocol (IP or IPv6) address on a device. -+.TP -+.B neighbour -+- ARP or NDISC cache entry. -+ -+.TP -+.B route -+- routing table entry. -+ -+.TP -+.B rule -+- rule in routing policy database. -+ -+.TP -+.B maddress -+- multicast address. -+ -+.TP -+.B mroute -+- multicast routing cache entry. -+ -+.TP -+.B tunnel -+- tunnel over IP. -+ -+.PP -+The names of all objects may be written in full or -+abbreviated form, f.e. -+.B address -+is abbreviated as -+.B addr -+or just -+.B a. -+ -+.SS -+.I COMMAND -+ -+Specifies the action to perform on the object. -+The set of possible actions depends on the object type. -+As a rule, it is possible to -+.BR "add" , " delete" -+and -+.B show -+(or -+.B list -+) objects, but some objects do not allow all of these operations -+or have some additional commands. The -+.B help -+command is available for all objects. It prints -+out a list of available commands and argument syntax conventions. -+.sp -+If no command is given, some default command is assumed. -+Usually it is -+.B list -+or, if the objects of this class cannot be listed, -+.BR "help" . -+ -+.SH ip link - network device configuration -+ -+.B link -+is a network device and the corresponding commands -+display and change the state of devices. -+ -+.SS ip link set - change device attributes -+ -+.TP -+.BI dev " NAME " (default) -+.I NAME -+specifies network device to operate on. -+ -+.TP -+.BR up " and " down -+change the state of the device to -+.B UP -+or -+.BR "DOWN" . -+ -+.TP -+.BR "arp on " or " arp off" -+change the -+.B NOARP -+flag on the device. -+ -+.TP -+.BR "multicast on " or " multicast off" -+change the -+.B MULTICAST -+flag on the device. -+ -+.TP -+.BR "dynamic on " or " dynamic off" -+change the -+.B DYNAMIC -+flag on the device. -+ -+.TP -+.BI name " NAME" -+change the name of the device. This operation is not -+recommended if the device is running or has some addresses -+already configured. -+ -+.TP -+.BI txqueuelen " NUMBER" -+.TP -+.BI txqlen " NUMBER" -+change the transmit queue length of the device. -+ -+.TP -+.BI mtu " NUMBER" -+change the -+.I MTU -+of the device. -+ -+.TP -+.BI address " LLADDRESS" -+change the station address of the interface. -+ -+.TP -+.BI broadcast " LLADDRESS" -+.TP -+.BI brd " LLADDRESS" -+.TP -+.BI peer " LLADDRESS" -+change the link layer broadcast address or the peer address when -+the interface is -+.IR "POINTOPOINT" . -+ -+.PP -+.B Warning: -+If multiple parameter changes are requested, -+.B ip -+aborts immediately after any of the changes have failed. -+This is the only case when -+.B ip -+can move the system to an unpredictable state. The solution -+is to avoid changing several parameters with one -+.B ip link set -+call. -+ -+.SS ip link show - display device attributes -+ -+.TP -+.BI dev " NAME " (default) -+.I NAME -+specifies the network device to show. -+If this argument is omitted all devices are listed. -+ -+.TP -+.B up -+only display running interfaces. -+ -+.SH ip address - protocol address management. -+ -+The -+.B address -+is a protocol (IP or IPv6) address attached -+to a network device. Each device must have at least one address -+to use the corresponding protocol. It is possible to have several -+different addresses attached to one device. These addresses are not -+discriminated, so that the term -+.B alias -+is not quite appropriate for them and we do not use it in this document. -+.sp -+The -+.B ip addr -+command displays addresses and their properties, adds new addresses -+and deletes old ones. -+ -+.SS ip address add - add new protocol address. -+ -+.TP -+.BI dev " NAME" -+the name of the device to add the address to. -+ -+.TP -+.BI local " ADDRESS " (default) -+the address of the interface. The format of the address depends -+on the protocol. It is a dotted quad for IP and a sequence of -+hexadecimal halfwords separated by colons for IPv6. The -+.I ADDRESS -+may be followed by a slash and a decimal number which encodes -+the network prefix length. -+ -+.TP -+.BI peer " ADDRESS" -+the address of the remote endpoint for pointopoint interfaces. -+Again, the -+.I ADDRESS -+may be followed by a slash and a decimal number, encoding the network -+prefix length. If a peer address is specified, the local address -+cannot have a prefix length. The network prefix is associated -+with the peer rather than with the local address. -+ -+.TP -+.BI broadcast " ADDRESS" -+the broadcast address on the interface. -+.sp -+It is possible to use the special symbols -+.B '+' -+and -+.B '-' -+instead of the broadcast address. In this case, the broadcast address -+is derived by setting/resetting the host bits of the interface prefix. -+ -+.TP -+.BI label " NAME" -+Each address may be tagged with a label string. -+In order to preserve compatibility with Linux-2.0 net aliases, -+this string must coincide with the name of the device or must be prefixed -+with the device name followed by colon. -+ -+.TP -+.BI scope " SCOPE_VALUE" -+the scope of the area where this address is valid. -+The available scopes are listed in file -+.BR "/etc/iproute2/rt_scopes" . -+Predefined scope values are: -+ -+.in +8 -+.B global -+- the address is globally valid. -+.sp -+.B site -+- (IPv6 only) the address is site local, i.e. it is -+valid inside this site. -+.sp -+.B link -+- the address is link local, i.e. it is valid only on this device. -+.sp -+.B host -+- the address is valid only inside this host. -+.in -8 -+ -+.SS ip address delete - delete protocol address -+.B Arguments: -+coincide with the arguments of -+.B ip addr add. -+The device name is a required argument. The rest are optional. -+If no arguments are given, the first address is deleted. -+ -+.SS ip address show - look at protocol addresses -+ -+.TP -+.BI dev " NAME " (default) -+name of device. -+ -+.TP -+.BI scope " SCOPE_VAL" -+only list addresses with this scope. -+ -+.TP -+.BI to " PREFIX" -+only list addresses matching this prefix. -+ -+.TP -+.BI label " PATTERN" -+only list addresses with labels matching the -+.IR "PATTERN" . -+.I PATTERN -+is a usual shell style pattern. -+ -+.TP -+.BR dynamic " and " permanent -+(IPv6 only) only list addresses installed due to stateless -+address configuration or only list permanent (not dynamic) -+addresses. -+ -+.TP -+.B tentative -+(IPv6 only) only list addresses which did not pass duplicate -+address detection. -+ -+.TP -+.B deprecated -+(IPv6 only) only list deprecated addresses. -+ -+.TP -+.BR primary " and " secondary -+only list primary (or secondary) addresses. -+ -+.SS ip address flush - flush protocol addresses -+This command flushes the protocol addresses selected by some criteria. -+ -+.PP -+This command has the same arguments as -+.B show. -+The difference is that it does not run when no arguments are given. -+ -+.PP -+.B Warning: -+This command (and other -+.B flush -+commands described below) is pretty dangerous. If you make a mistake, -+it will not forgive it, but will cruelly purge all the addresses. -+ -+.PP -+With the -+.B -statistics -+option, the command becomes verbose. It prints out the number of deleted -+addresses and the number of rounds made to flush the address list. If -+this option is given twice, -+.B ip addr flush -+also dumps all the deleted addresses in the format described in the -+previous subsection. -+ -+.SH ip neighbour - neighbour/arp tables management. -+ -+.B neighbour -+objects establish bindings between protocol addresses and -+link layer addresses for hosts sharing the same link. -+Neighbour entries are organized into tables. The IPv4 neighbour table -+is known by another name - the ARP table. -+ -+.P -+The corresponding commands display neighbour bindings -+and their properties, add new neighbour entries and delete old ones. -+ -+.SS ip neighbour add - add a new neighbour entry -+.SS ip neighbour change - change an existing entry -+.SS ip neighbour replace - add a new entry or change an existing one -+ -+These commands create new neighbour records or update existing ones. -+ -+.TP -+.BI to " ADDRESS " (default) -+the protocol address of the neighbour. It is either an IPv4 or IPv6 address. -+ -+.TP -+.BI dev " NAME" -+the interface to which this neighbour is attached. -+ -+.TP -+.BI lladdr " LLADDRESS" -+the link layer address of the neighbour. -+.I LLADDRESS -+can also be -+.BR "null" . -+ -+.TP -+.BI nud " NUD_STATE" -+the state of the neighbour entry. -+.B nud -+is an abbreviation for 'Neigh bour Unreachability Detection'. -+The state can take one of the following values: -+ -+.in +8 -+.B permanent -+- the neighbour entry is valid forever and can be only -+be removed administratively. -+.sp -+ -+.B noarp -+- the neighbour entry is valid. No attempts to validate -+this entry will be made but it can be removed when its lifetime expires. -+.sp -+ -+.B reachable -+- the neighbour entry is valid until the reachability -+timeout expires. -+.sp -+ -+.B stale -+- the neighbour entry is valid but suspicious. -+This option to -+.B ip neigh -+does not change the neighbour state if it was valid and the address -+is not changed by this command. -+.in -8 -+ -+.SS ip neighbour delete - delete a neighbour entry -+This command invalidates a neighbour entry. -+ -+.PP -+The arguments are the same as with -+.BR "ip neigh add" , -+except that -+.B lladdr -+and -+.B nud -+are ignored. -+ -+.PP -+.B Warning: -+Attempts to delete or manually change a -+.B noarp -+entry created by the kernel may result in unpredictable behaviour. -+Particularly, the kernel may try to resolve this address even -+on a -+.B NOARP -+interface or if the address is multicast or broadcast. -+ -+.SS ip neighbour show - list neighbour entries -+ -+This commands displays neighbour tables. -+ -+.TP -+.BI to " ADDRESS " (default) -+the prefix selecting the neighbours to list. -+ -+.TP -+.BI dev " NAME" -+only list the neighbours attached to this device. -+ -+.TP -+.B unused -+only list neighbours which are not currently in use. -+ -+.TP -+.BI nud " NUD_STATE" -+only list neighbour entries in this state. -+.I NUD_STATE -+takes values listed below or the special value -+.B all -+which means all states. This option may occur more than once. -+If this option is absent, -+.B ip -+lists all entries except for -+.B none -+and -+.BR "noarp" . -+ -+.SS ip neighbour flush - flush neighbour entries -+This command flushes neighbour tables, selecting -+entries to flush by some criteria. -+ -+.PP -+This command has the same arguments as -+.B show. -+The differences are that it does not run when no arguments are given, -+and that the default neighbour states to be flushed do not include -+.B permanent -+and -+.BR "noarp" . -+ -+.PP -+With the -+.B -statistics -+option, the command becomes verbose. It prints out the number of -+deleted neighbours and the number of rounds made to flush the -+neighbour table. If the option is given -+twice, -+.B ip neigh flush -+also dumps all the deleted neighbours. -+ -+.SH ip route - routing table management -+Manipulate route entries in the kernel routing tables keep -+information about paths to other networked nodes. -+.sp -+.B Route types: -+ -+.in +8 -+.B unicast -+- the route entry describes real paths to the destinations covered -+by the route prefix. -+ -+.sp -+.B unreachable -+- these destinations are unreachable. Packets are discarded and the -+ICMP message -+.I host unreachable -+is generated. -+The local senders get an -+.I EHOSTUNREACH -+error. -+ -+.sp -+.B blackhole -+- these destinations are unreachable. Packets are discarded silently. -+The local senders get an -+.I EINVAL -+error. -+ -+.sp -+.B prohibit -+- these destinations are unreachable. Packets are discarded and the -+ICMP message -+.I communication administratively prohibited -+is generated. The local senders get an -+.I EACCES -+error. -+ -+.sp -+.B local -+- the destinations are assigned to this host. The packets are looped -+back and delivered locally. -+ -+.sp -+.B broadcast -+- the destinations are broadcast addresses. The packets are sent as -+link broadcasts. -+ -+.sp -+.B throw -+- a special control route used together with policy rules. If such a -+route is selected, lookup in this table is terminated pretending that -+no route was found. Without policy routing it is equivalent to the -+absence of the route in the routing table. The packets are dropped -+and the ICMP message -+.I net unreachable -+is generated. The local senders get an -+.I ENETUNREACH -+error. -+ -+.sp -+.B nat -+- a special NAT route. Destinations covered by the prefix -+are considered to be dummy (or external) addresses which require translation -+to real (or internal) ones before forwarding. The addresses to translate to -+are selected with the attribute -+.BR "via" . -+ -+.sp -+.B anycast -+.RI "- " "not implemented" -+the destinations are -+.I anycast -+addresses assigned to this host. They are mainly equivalent -+to -+.B local -+with one difference: such addresses are invalid when used -+as the source address of any packet. -+ -+.sp -+.B multicast -+- a special type used for multicast routing. It is not present in -+normal routing tables. -+.in -8 -+ -+.P -+.B Route tables: -+Linux-2.x can pack routes into several routing -+tables identified by a number in the range from 1 to 255 or by -+name from the file -+.B /etc/iproute2/rt_tables -+. By default all normal routes are inserted into the -+.B main -+table (ID 254) and the kernel only uses this table when calculating routes. -+ -+.sp -+Actually, one other table always exists, which is invisible but -+even more important. It is the -+.B local -+table (ID 255). This table -+consists of routes for local and broadcast addresses. The kernel maintains -+this table automatically and the administrator usually need not modify it -+or even look at it. -+ -+The multiple routing tables enter the game when -+.I policy routing -+is used. -+ -+.SS ip route add - add new route -+.SS ip route change - change route -+.SS ip route replace - change or add new one -+ -+.TP -+.BI to " TYPE PREFIX " (default) -+the destination prefix of the route. If -+.I TYPE -+is omitted, -+.B ip -+assumes type -+.BR "unicast" . -+Other values of -+.I TYPE -+are listed above. -+.I PREFIX -+is an IP or IPv6 address optionally followed by a slash and the -+prefix length. If the length of the prefix is missing, -+.B ip -+assumes a full-length host route. There is also a special -+.I PREFIX -+.B default -+- which is equivalent to IP -+.B 0/0 -+or to IPv6 -+.BR "::/0" . -+ -+.TP -+.BI tos " TOS" -+.TP -+.BI dsfield " TOS" -+the Type Of Service (TOS) key. This key has no associated mask and -+the longest match is understood as: First, compare the TOS -+of the route and of the packet. If they are not equal, then the packet -+may still match a route with a zero TOS. -+.I TOS -+is either an 8 bit hexadecimal number or an identifier -+from -+.BR "/etc/iproute2/rt_dsfield" . -+ -+.TP -+.BI metric " NUMBER" -+.TP -+.BI preference " NUMBER" -+the preference value of the route. -+.I NUMBER -+is an arbitrary 32bit number. -+ -+.TP -+.BI table " TABLEID" -+the table to add this route to. -+.I TABLEID -+may be a number or a string from the file -+.BR "/etc/iproute2/rt_tables" . -+If this parameter is omitted, -+.B ip -+assumes the -+.B main -+table, with the exception of -+.BR local " , " broadcast " and " nat -+routes, which are put into the -+.B local -+table by default. -+ -+.TP -+.BI dev " NAME" -+the output device name. -+ -+.TP -+.BI via " ADDRESS" -+the address of the nexthop router. Actually, the sense of this field -+depends on the route type. For normal -+.B unicast -+routes it is either the true next hop router or, if it is a direct -+route installed in BSD compatibility mode, it can be a local address -+of the interface. For NAT routes it is the first address of the block -+of translated IP destinations. -+ -+.TP -+.BI src " ADDRESS" -+the source address to prefer when sending to the destinations -+covered by the route prefix. -+ -+.TP -+.BI realm " REALMID" -+the realm to which this route is assigned. -+.I REALMID -+may be a number or a string from the file -+.BR "/etc/iproute2/rt_realms" . -+ -+.TP -+.BI mtu " MTU" -+.TP -+.BI "mtu lock" " MTU" -+the MTU along the path to the destination. If the modifier -+.B lock -+is not used, the MTU may be updated by the kernel due to -+Path MTU Discovery. If the modifier -+.B lock -+is used, no path MTU discovery will be tried, all packets -+will be sent without the DF bit in IPv4 case or fragmented -+to MTU for IPv6. -+ -+.TP -+.BI window " NUMBER" -+the maximal window for TCP to advertise to these destinations, -+measured in bytes. It limits maximal data bursts that our TCP -+peers are allowed to send to us. -+ -+.TP -+.BI rtt " NUMBER" -+the initial RTT ('Round Trip Time') estimate. -+ -+.TP -+.BI rttvar " NUMBER " "(2.3.15+ only)" -+the initial RTT variance estimate. -+ -+.TP -+.BI ssthresh " NUMBER " "(2.3.15+ only)" -+an estimate for the initial slow start threshold. -+ -+.TP -+.BI cwnd " NUMBER " "(2.3.15+ only)" -+the clamp for congestion window. It is ignored if the -+.B lock -+flag is not used. -+ -+.TP -+.BI advmss " NUMBER " "(2.3.15+ only)" -+the MSS ('Maximal Segment Size') to advertise to these -+destinations when establishing TCP connections. If it is not given, -+Linux uses a default value calculated from the first hop device MTU. -+(If the path to these destination is asymmetric, this guess may be wrong.) -+ -+.TP -+.BI reordering " NUMBER " "(2.3.15+ only)" -+Maximal reordering on the path to this destination. -+If it is not given, Linux uses the value selected with -+.B sysctl -+variable -+.BR "net/ipv4/tcp_reordering" . -+ -+.TP -+.BI nexthop " NEXTHOP" -+the nexthop of a multipath route. -+.I NEXTHOP -+is a complex value with its own syntax similar to the top level -+argument lists: -+ -+.in +8 -+.BI via " ADDRESS" -+- is the nexthop router. -+.sp -+ -+.BI dev " NAME" -+- is the output device. -+.sp -+ -+.BI weight " NUMBER" -+- is a weight for this element of a multipath -+route reflecting its relative bandwidth or quality. -+.in -8 -+ -+.TP -+.BI scope " SCOPE_VAL" -+the scope of the destinations covered by the route prefix. -+.I SCOPE_VAL -+may be a number or a string from the file -+.BR "/etc/iproute2/rt_scopes" . -+If this parameter is omitted, -+.B ip -+assumes scope -+.B global -+for all gatewayed -+.B unicast -+routes, scope -+.B link -+for direct -+.BR unicast " and " broadcast -+routes and scope -+.BR host " for " local -+routes. -+ -+.TP -+.BI protocol " RTPROTO" -+the routing protocol identifier of this route. -+.I RTPROTO -+may be a number or a string from the file -+.BR "/etc/iproute2/rt_protos" . -+If the routing protocol ID is not given, -+.B ip assumes protocol -+.B boot -+(i.e. it assumes the route was added by someone who doesn't -+understand what they are doing). Several protocol values have -+a fixed interpretation. -+Namely: -+ -+.in +8 -+.B redirect -+- the route was installed due to an ICMP redirect. -+.sp -+ -+.B kernel -+- the route was installed by the kernel during autoconfiguration. -+.sp -+ -+.B boot -+- the route was installed during the bootup sequence. -+If a routing daemon starts, it will purge all of them. -+.sp -+ -+.B static -+- the route was installed by the administrator -+to override dynamic routing. Routing daemon will respect them -+and, probably, even advertise them to its peers. -+.sp -+ -+.B ra -+- the route was installed by Router Discovery protocol. -+.in -8 -+ -+.sp -+The rest of the values are not reserved and the administrator is free -+to assign (or not to assign) protocol tags. -+ -+.TP -+.B onlink -+pretend that the nexthop is directly attached to this link, -+even if it does not match any interface prefix. -+ -+.TP -+.B equalize -+allow packet by packet randomization on multipath routes. -+Without this modifier, the route will be frozen to one selected -+nexthop, so that load splitting will only occur on per-flow base. -+.B equalize -+only works if the kernel is patched. -+ -+.SS ip route delete - delete route -+ -+.B ip route del -+has the same arguments as -+.BR "ip route add" , -+but their semantics are a bit different. -+ -+Key values -+.RB "(" to ", " tos ", " preference " and " table ")" -+select the route to delete. If optional attributes are present, -+.B ip -+verifies that they coincide with the attributes of the route to delete. -+If no route with the given key and attributes was found, -+.B ip route del -+fails. -+ -+.SS ip route show - list routes -+the command displays the contents of the routing tables or the route(s) -+selected by some criteria. -+ -+.TP -+.BI to " SELECTOR " (default) -+only select routes from the given range of destinations. -+.I SELECTOR -+consists of an optional modifier -+.RB "(" root ", " match " or " exact ")" -+and a prefix. -+.BI root " PREFIX" -+selects routes with prefixes not shorter than -+.IR PREFIX "." -+F.e. -+.BI root " 0/0" -+selects the entire routing table. -+.BI match " PREFIX" -+selects routes with prefixes not longer than -+.IR PREFIX "." -+F.e. -+.BI match " 10.0/16" -+selects -+.IR 10.0/16 "," -+.IR 10/8 " and " 0/0 , -+but it does not select -+.IR 10.1/16 " and " 10.0.0/24 . -+And -+.BI exact " PREFIX" -+(or just -+.IR PREFIX ")" -+selects routes with this exact prefix. If neither of these options -+are present, -+.B ip -+assumes -+.BI root " 0/0" -+i.e. it lists the entire table. -+ -+.TP -+.BI tos " TOS" -+.BI dsfield " TOS" -+only select routes with the given TOS. -+ -+.TP -+.BI table " TABLEID" -+show the routes from this table(s). The default setting is to show -+.BR table main "." -+.I TABLEID -+may either be the ID of a real table or one of the special values: -+.sp -+.in +8 -+.B all -+- list all of the tables. -+.sp -+.B cache -+- dump the routing cache. -+.in -8 -+ -+.TP -+.B cloned -+.TP -+.B cached -+list cloned routes i.e. routes which were dynamically forked from -+other routes because some route attribute (f.e. MTU) was updated. -+Actually, it is equivalent to -+.BR "table cache" "." -+ -+.TP -+.BI from " SELECTOR" -+the same syntax as for -+.BR to "," -+but it binds the source address range rather than destinations. -+Note that the -+.B from -+option only works with cloned routes. -+ -+.TP -+.BI protocol " RTPROTO" -+only list routes of this protocol. -+ -+.TP -+.BI scope " SCOPE_VAL" -+only list routes with this scope. -+ -+.TP -+.BI type " TYPE" -+only list routes of this type. -+ -+.TP -+.BI dev " NAME" -+only list routes going via this device. -+ -+.TP -+.BI via " PREFIX" -+only list routes going via the nexthop routers selected by -+.IR PREFIX "." -+ -+.TP -+.BI src " PREFIX" -+only list routes with preferred source addresses selected -+by -+.IR PREFIX "." -+ -+.TP -+.BI realm " REALMID" -+.TP -+.BI realms " FROMREALM/TOREALM" -+only list routes with these realms. -+ -+.SS ip route flush - flush routing tables -+this command flushes routes selected by some criteria. -+ -+.sp -+The arguments have the same syntax and semantics as the arguments of -+.BR "ip route show" , -+but routing tables are not listed but purged. The only difference is -+the default action: -+.B show -+dumps all the IP main routing table but -+.B flush -+prints the helper page. -+ -+.sp -+With the -+.B -statistics -+option, the command becomes verbose. It prints out the number of -+deleted routes and the number of rounds made to flush the routing -+table. If the option is given -+twice, -+.B ip route flush -+also dumps all the deleted routes in the format described in the -+previous subsection. -+ -+.SS ip route get - get a single route -+this command gets a single route to a destination and prints its -+contents exactly as the kernel sees it. -+ -+.TP -+.BI to " ADDRESS " (default) -+the destination address. -+ -+.TP -+.BI from " ADDRESS" -+the source address. -+ -+.TP -+.BI tos " TOS" -+.TP -+.BI dsfield " TOS" -+the Type Of Service. -+ -+.TP -+.BI iif " NAME" -+the device from which this packet is expected to arrive. -+ -+.TP -+.BI oif " NAME" -+force the output device on which this packet will be routed. -+ -+.TP -+.B connected -+if no source address -+.RB "(option " from ")" -+was given, relookup the route with the source set to the preferred -+address received from the first lookup. -+If policy routing is used, it may be a different route. -+ -+.P -+Note that this operation is not equivalent to -+.BR "ip route show" . -+.B show -+shows existing routes. -+.B get -+resolves them and creates new clones if necessary. Essentially, -+.B get -+is equivalent to sending a packet along this path. -+If the -+.B iif -+argument is not given, the kernel creates a route -+to output packets towards the requested destination. -+This is equivalent to pinging the destination -+with a subsequent -+.BR "ip route ls cache" , -+however, no packets are actually sent. With the -+.B iif -+argument, the kernel pretends that a packet arrived from this interface -+and searches for a path to forward the packet. -+ -+.SH ip rule - routing policy database management -+ -+.BR "Rule" s -+in the routing policy database control the route selection algorithm. -+ -+.P -+Classic routing algorithms used in the Internet make routing decisions -+based only on the destination address of packets (and in theory, -+but not in practice, on the TOS field). -+ -+.P -+In some circumstances we want to route packets differently depending not only -+on destination addresses, but also on other packet fields: source address, -+IP protocol, transport protocol ports or even packet payload. -+This task is called 'policy routing'. -+ -+.P -+To solve this task, the conventional destination based routing table, ordered -+according to the longest match rule, is replaced with a 'routing policy -+database' (or RPDB), which selects routes by executing some set of rules. -+ -+.P -+Each policy routing rule consists of a -+.B selector -+and an -+.B action predicate. -+The RPDB is scanned in the order of increasing priority. The selector -+of each rule is applied to {source address, destination address, incoming -+interface, tos, fwmark} and, if the selector matches the packet, -+the action is performed. The action predicate may return with success. -+In this case, it will either give a route or failure indication -+and the RPDB lookup is terminated. Otherwise, the RPDB program -+continues on the next rule. -+ -+.P -+Semantically, natural action is to select the nexthop and the output device. -+ -+.P -+At startup time the kernel configures the default RPDB consisting of three -+rules: -+ -+.TP -+1. -+Priority: 0, Selector: match anything, Action: lookup routing -+table -+.B local -+(ID 255). -+The -+.B local -+table is a special routing table containing -+high priority control routes for local and broadcast addresses. -+.sp -+Rule 0 is special. It cannot be deleted or overridden. -+ -+.TP -+2. -+Priority: 32766, Selector: match anything, Action: lookup routing -+table -+.B main -+(ID 254). -+The -+.B main -+table is the normal routing table containing all non-policy -+routes. This rule may be deleted and/or overridden with other -+ones by the administrator. -+ -+.TP -+3. -+Priority: 32767, Selector: match anything, Action: lookup routing -+table -+.B default -+(ID 253). -+The -+.B default -+table is empty. It is reserved for some post-processing if no previous -+default rules selected the packet. -+This rule may also be deleted. -+ -+.P -+Each RPDB entry has additional -+attributes. F.e. each rule has a pointer to some routing -+table. NAT and masquerading rules have an attribute to select new IP -+address to translate/masquerade. Besides that, rules have some -+optional attributes, which routes have, namely -+.BR "realms" . -+These values do not override those contained in the routing tables. They -+are only used if the route did not select any attributes. -+ -+.sp -+The RPDB may contain rules of the following types: -+ -+.in +8 -+.B unicast -+- the rule prescribes to return the route found -+in the routing table referenced by the rule. -+ -+.B blackhole -+- the rule prescribes to silently drop the packet. -+ -+.B unreachable -+- the rule prescribes to generate a 'Network is unreachable' error. -+ -+.B prohibit -+- the rule prescribes to generate 'Communication is administratively -+prohibited' error. -+ -+.B nat -+- the rule prescribes to translate the source address -+of the IP packet into some other value. -+.in -8 -+ -+.SS ip rule add - insert a new rule -+.SS ip rule delete - delete a rule -+ -+.TP -+.BI type " TYPE " (default) -+the type of this rule. The list of valid types was given in the previous -+subsection. -+ -+.TP -+.BI from " PREFIX" -+select the source prefix to match. -+ -+.TP -+.BI to " PREFIX" -+select the destination prefix to match. -+ -+.TP -+.BI iif " NAME" -+select the incoming device to match. If the interface is loopback, -+the rule only matches packets originating from this host. This means -+that you may create separate routing tables for forwarded and local -+packets and, hence, completely segregate them. -+ -+.TP -+.BI tos " TOS" -+.TP -+.BI dsfield " TOS" -+select the TOS value to match. -+ -+.TP -+.BI fwmark " MARK" -+select the -+.B fwmark -+value to match. -+ -+.TP -+.BI priority " PREFERENCE" -+the priority of this rule. Each rule should have an explicitly -+set -+.I unique -+priority value. -+ -+.TP -+.BI table " TABLEID" -+the routing table identifier to lookup if the rule selector matches. -+ -+.TP -+.BI realms " FROM/TO" -+Realms to select if the rule matched and the routing table lookup -+succeeded. Realm -+.I TO -+is only used if the route did not select any realm. -+ -+.TP -+.BI nat " ADDRESS" -+The base of the IP address block to translate (for source addresses). -+The -+.I ADDRESS -+may be either the start of the block of NAT addresses (selected by NAT -+routes) or a local host address (or even zero). -+In the last case the router does not translate the packets, but -+masquerades them to this address. -+ -+.B Warning: -+Changes to the RPDB made with these commands do not become active -+immediately. It is assumed that after a script finishes a batch of -+updates, it flushes the routing cache with -+.BR "ip route flush cache" . -+ -+.SS ip rule show - list rules -+This command has no arguments. -+ -+.SH ip maddress - multicast addresses management -+ -+.B maddress -+objects are multicast addresses. -+ -+.SS ip maddress show - list multicast addresses -+ -+.TP -+.BI dev " NAME " (default) -+the device name. -+ -+.SS ip maddress add - add a multicast address -+.SS ip maddress delete - delete a multicast address -+these commands attach/detach a static link layer multicast address -+to listen on the interface. -+Note that it is impossible to join protocol multicast groups -+statically. This command only manages link layer addresses. -+ -+.TP -+.BI address " LLADDRESS " (default) -+the link layer multicast address. -+ -+.TP -+.BI dev " NAME" -+the device to join/leave this multicast address. -+ -+.SH ip mroute - multicast routing cache management -+.B mroute -+objects are multicast routing cache entries created by a user level -+mrouting daemon (f.e. -+.B pimd -+or -+.B mrouted -+). -+ -+Due to the limitations of the current interface to the multicast routing -+engine, it is impossible to change -+.B mroute -+objects administratively, so we may only display them. This limitation -+will be removed in the future. -+ -+.SS ip mroute show - list mroute cache entries -+ -+.TP -+.BI to " PREFIX " (default) -+the prefix selecting the destination multicast addresses to list. -+ -+.TP -+.BI iif " NAME" -+the interface on which multicast packets are received. -+ -+.TP -+.BI from " PREFIX" -+the prefix selecting the IP source addresses of the multicast route. -+ -+.SH ip tunnel - tunnel configuration -+.B tunnel -+objects are tunnels, encapsulating packets in IPv4 packets and then -+sending them over the IP infrastructure. -+ -+.SS ip tunnel add - add a new tunnel -+.SS ip tunnel change - change an existing tunnel -+.SS ip tunnel delete - destroy a tunnel -+ -+.TP -+.BI name " NAME " (default) -+select the tunnel device name. -+ -+.TP -+.BI mode " MODE" -+set the tunnel mode. Three modes are currently available: -+.BR ipip ", " sit " and " gre "." -+ -+.TP -+.BI remote " ADDRESS" -+set the remote endpoint of the tunnel. -+ -+.TP -+.BI local " ADDRESS" -+set the fixed local address for tunneled packets. -+It must be an address on another interface of this host. -+ -+.TP -+.BI ttl " N" -+set a fixed TTL -+.I N -+on tunneled packets. -+.I N -+is a number in the range 1--255. 0 is a special value -+meaning that packets inherit the TTL value. -+The default value is: -+.BR "inherit" . -+ -+.TP -+.BI tos " T" -+.TP -+.BI dsfield " T" -+set a fixed TOS -+.I T -+on tunneled packets. -+The default value is: -+.BR "inherit" . -+ -+.TP -+.BI dev " NAME" -+bind the tunnel to the device -+.I NAME -+so that tunneled packets will only be routed via this device and will -+not be able to escape to another device when the route to endpoint -+changes. -+ -+.TP -+.B nopmtudisc -+disable Path MTU Discovery on this tunnel. -+It is enabled by default. Note that a fixed ttl is incompatible -+with this option: tunnelling with a fixed ttl always makes pmtu -+discovery. -+ -+.TP -+.BI key " K" -+.TP -+.BI ikey " K" -+.TP -+.BI okey " K" -+.RB ( " only GRE tunnels " ) -+use keyed GRE with key -+.IR K ". " K -+is either a number or an IP address-like dotted quad. -+The -+.B key -+parameter sets the key to use in both directions. -+The -+.BR ikey " and " okey -+parameters set different keys for input and output. -+ -+.TP -+.BR csum ", " icsum ", " ocsum -+.RB ( " only GRE tunnels " ) -+generate/require checksums for tunneled packets. -+The -+.B ocsum -+flag calculates checksums for outgoing packets. -+The -+.B icsum -+flag requires that all input packets have the correct -+checksum. The -+.B csum -+flag is equivalent to the combination -+.BR "icsum ocsum" . -+ -+.TP -+.BR seq ", " iseq ", " oseq -+.RB ( " only GRE tunnels " ) -+serialize packets. -+The -+.B oseq -+flag enables sequencing of outgoing packets. -+The -+.B iseq -+flag requires that all input packets are serialized. -+The -+.B seq -+flag is equivalent to the combination -+.BR "iseq oseq" . -+.B It isn't work. Don't use it. -+ -+.SS ip tunnel show - list tunnels -+This command has no arguments. -+ -+.SH ip monitor and rtmon - state monitoring -+ -+The -+.B ip -+utility can monitor the state of devices, addresses -+and routes continuously. This option has a slightly different format. -+Namely, the -+.B monitor -+command is the first in the command line and then the object list follows: -+ -+.BR "ip monitor" " [ " all " |" -+.IR LISTofOBJECTS " ]" -+ -+.I OBJECT-LIST -+is the list of object types that we want to monitor. -+It may contain -+.BR link ", " address " and " route "." -+If no -+.B file -+argument is given, -+.B ip -+opens RTNETLINK, listens on it and dumps state changes in the format -+described in previous sections. -+ -+.P -+If a file name is given, it does not listen on RTNETLINK, -+but opens the file containing RTNETLINK messages saved in binary format -+and dumps them. Such a history file can be generated with the -+.B rtmon -+utility. This utility has a command line syntax similar to -+.BR "ip monitor" . -+Ideally, -+.B rtmon -+should be started before the first network configuration command -+is issued. F.e. if you insert: -+.sp -+.in +8 -+rtmon file /var/log/rtmon.log -+.in -8 -+.sp -+in a startup script, you will be able to view the full history -+later. -+ -+.P -+Certainly, it is possible to start -+.B rtmon -+at any time. -+It prepends the history with the state snapshot dumped at the moment -+of starting. -+ -+.SH HISTORY -+ -+.B ip -+was written by Alexey N. Kuznetsov and added in Linux 2.2. -+.SH SEE ALSO -+.BR tc (8) -+.br -+.RB "IP Command reference " ip-cref.ps -+.br -+.RB "IP tunnels " ip-cref.ps -+ -+.SH AUTHOR -+ -+Manpage maintained by Michail Litvak -diff -Naur iproute2-orig/debian/manpages/old/ip.8 iproute2/debian/manpages/old/ip.8 ---- iproute2-orig/debian/manpages/old/ip.8 1969-12-31 16:00:00.000000000 -0800 -+++ iproute2/debian/manpages/old/ip.8 2004-05-21 00:09:38.000000000 -0700 -@@ -0,0 +1,1809 @@ -+.TH IP 8 "17 January 2002" "iproute2" "Linux" -+.SH NAME -+ip \- show / manipulate routing, devices, policy routing and tunnels -+.SH SYNOPSIS -+ -+.ad l -+.in +8 -+.ti -8 -+.B ip -+.RI "[ " OPTIONS " ] " OBJECT " { " COMMAND " | " -+.BR help " }" -+.sp -+ -+.ti -8 -+.IR OBJECT " := { " -+.BR link " | " addr " | " route " | " rule " | " neigh " | " tunnel " | "\ -+maddr " | " mroute " | " monitor " }" -+.sp -+ -+.ti -8 -+.IR OPTIONS " := { " -+\fB\-V\fR[\fIersion\fR] | -+\fB\-s\fR[\fItatistics\fR] | -+\fB\-r\fR[\fIesolve\fR] | -+\fB\-f\fR[\fIamily\fR] { -+.BR inet " | " inet6 " | " ipx " | " dnet " | " link " } | " -+\fB\-o\fR[\fIneline\fR] } -+ -+.ti -8 -+.BI "ip link set " DEVICE -+.RB "{ " up " | " down " | " arp " { " on " | " off " } |" -+.br -+.BR promisc " { " on " | " off " } |" -+.br -+.BR allmulti " { " on " | " off " } |" -+.br -+.BR dynamic " { " on " | " off " } |" -+.br -+.BR multicast " { " on " | " off " } |" -+.br -+.B txqueuelen -+.IR PACKETS " |" -+.br -+.B name -+.IR NEWNAME " |" -+.br -+.B address -+.IR LLADDR " |" -+.B broadcast -+.IR LLADDR " |" -+.br -+.B mtu -+.IR MTU " }" -+ -+.ti -8 -+.B ip link show -+.RI "[ " DEVICE " ]" -+ -+.ti -8 -+.BR "ip addr" " { " add " | " del " } " -+.IB IFADDR " dev " STRING -+ -+.ti -8 -+.BR "ip addr" " { " show " | " flush " } [ " dev -+.IR STRING " ] [ " -+.B scope -+.IR SCOPE-ID " ] [ " -+.B to -+.IR PREFIX " ] [ " FLAG-LIST " ] [ " -+.B label -+.IR PATTERN " ]" -+ -+.ti -8 -+.IR IFADDR " := " PREFIX " | " ADDR -+.B peer -+.IR PREFIX " [ " -+.B broadcast -+.IR ADDR " ] [ " -+.B anycast -+.IR ADDR " ] [ " -+.B label -+.IR STRING " ] [ " -+.B scope -+.IR SCOPE-ID " ]" -+ -+.ti -8 -+.IR SCOPE-ID " := " -+.RB "[ " host " | " link " | " global " | " -+.IR NUMBER " ]" -+ -+.ti -8 -+.IR FLAG-LIST " := [ " FLAG-LIST " ] " FLAG -+ -+.ti -8 -+.IR FLAG " := " -+.RB "[ " permanent " | " dynamic " | " secondary " | " primary " | "\ -+tentative " | " deprecated " ]" -+ -+.ti -8 -+.BR "ip route" " { " -+.BR list " | " flush " } " -+.I SELECTOR -+ -+.ti -8 -+.B ip route get -+.IR ADDRESS " [ " -+.BI from " ADDRESS " iif " STRING" -+.RB " ] [ " oif -+.IR STRING " ] [ " -+.B tos -+.IR TOS " ]" -+ -+.ti -8 -+.BR "ip route" " { " add " | " del " | " change " | " append " | "\ -+replace " | " monitor " } " -+.I ROUTE -+ -+.ti -8 -+.IR SELECTOR " := " -+.RB "[ " root -+.IR PREFIX " ] [ " -+.B match -+.IR PREFIX " ] [ " -+.B exact -+.IR PREFIX " ] [ " -+.B table -+.IR TABLE_ID " ] [ " -+.B proto -+.IR RTPROTO " ] [ " -+.B type -+.IR TYPE " ] [ " -+.B scope -+.IR SCOPE " ]" -+ -+.ti -8 -+.IR ROUTE " := " NODE_SPEC " [ " INFO_SPEC " ]" -+ -+.ti -8 -+.IR NODE_SPEC " := [ " TYPE " ] " PREFIX " [" -+.B tos -+.IR TOS " ] [ " -+.B table -+.IR TABLE_ID " ] [ " -+.B proto -+.IR RTPROTO " ] [ " -+.B scope -+.IR SCOPE " ] [ " -+.B metric -+.IR METRIC " ]" -+ -+.ti -8 -+.IR INFO_SPEC " := " "NH OPTIONS FLAGS" " [" -+.B nexthop -+.IR NH " ] ..." -+ -+.ti -8 -+.IR NH " := [ " -+.B via -+.IR ADDRESS " ] [ " -+.B dev -+.IR STRING " ] [ " -+.B weight -+.IR NUMBER " ] " NHFLAGS -+ -+.ti -8 -+.IR OPTIONS " := " FLAGS " [ " -+.B mtu -+.IR NUMBER " ] [ " -+.B advmss -+.IR NUMBER " ] [ " -+.B rtt -+.IR NUMBER " ] [ " -+.B rttvar -+.IR NUMBER " ] [ " -+.B window -+.IR NUMBER " ] [ " -+.B cwnd -+.IR NUMBER " ] [ " -+.B ssthresh -+.IR REALM " ] [ " -+.B realms -+.IR REALM " ]" -+ -+.ti -8 -+.IR TYPE " := [ " -+.BR unicast " | " local " | " broadcast " | " multicast " | "\ -+throw " | " unreachable " | " prohibit " | " blackhole " | " nat " ]" -+ -+.ti -8 -+.IR TABLE_ID " := [ " -+.BR local "| " main " | " default " | " all " |" -+.IR NUMBER " ]" -+ -+.ti -8 -+.IR SCOPE " := [ " -+.BR host " | " link " | " global " |" -+.IR NUMBER " ]" -+ -+.ti -8 -+.IR FLAGS " := [ " -+.BR equalize " ]" -+ -+.ti -8 -+.IR NHFLAGS " := [ " -+.BR onlink " | " pervasive " ]" -+ -+.ti -8 -+.IR RTPROTO " := [ " -+.BR kernel " | " boot " | " static " |" -+.IR NUMBER " ]" -+ -+.ti -8 -+.B ip rule -+.RB " [ " list " | " add " | " del " ]" -+.I SELECTOR ACTION -+ -+.ti -8 -+.IR SELECTOR " := [ " -+.B from -+.IR PREFIX " ] [ " -+.B to -+.IR PREFIX " ] [ " -+.B tos -+.IR TOS " ] [ " -+.B fwmark -+.IR FWMARK " ] [ " -+.B dev -+.IR STRING " ] [ " -+.B pref -+.IR NUMBER " ]" -+ -+.ti -8 -+.IR ACTION " := [ " -+.B table -+.IR TABLE_ID " ] [ " -+.B nat -+.IR ADDRESS " ] [ " -+.BR prohibit " | " reject " | " unreachable " ] [ " realms -+.RI "[" SRCREALM "/]" DSTREALM " ]" -+ -+.ti -8 -+.IR TABLE_ID " := [ " -+.BR local " | " main " | " default " |" -+.IR NUMBER " ]" -+ -+.ti -8 -+.BR "ip neigh" " { " add " | " del " | " change " | " replace " } { " -+.IR ADDR " [ " -+.B lladdr -+.IR LLADDR " ] [ " -+.BR nud " { " permanent " | " noarp " | " stale " | " reachable " } ] | " proxy -+.IR ADDR " } [ " -+.B dev -+.IR DEV " ]" -+ -+.ti -8 -+.BR "ip neigh" " { " show " | " flush " } [ " to -+.IR PREFIX " ] [ " -+.B dev -+.IR DEV " ] [ " -+.B nud -+.IR STATE " ]" -+ -+.ti -8 -+.BR "ip tunnel" " { " add " | " change " | " del " | " show " }" -+.RI "[ " NAME " ]" -+.br -+.RB "[ " mode " { " ipip " | " gre " | " sit " } ]" -+.br -+.RB "[ " remote -+.IR ADDR " ] [ " -+.B local -+.IR ADDR " ]" -+.br -+.RB "[ [" i "|" o "]" seq " ] [ [" i "|" o "]" key -+.IR KEY " ] [ " -+.RB "[" i "|" o "]" csum " ] ]" -+.br -+.RB "[ " ttl -+.IR TTL " ] [ " -+.B tos -+.IR TOS " ] [ " -+.RB "[" no "]" pmtudisc " ]" -+.br -+.RB "[ " dev -+.IR PHYS_DEV " ]" -+ -+.ti -8 -+.IR ADDR " := { " IP_ADDRESS " |" -+.BR any " }" -+ -+.ti -8 -+.IR TOS " := { " NUMBER " |" -+.BR inherit " }" -+ -+.ti -8 -+.IR TTL " := { " 1 ".." 255 " | " -+.BR inherit " }" -+ -+.ti -8 -+.IR KEY " := { " DOTTED_QUAD " | " NUMBER " }" -+ -+.ti -8 -+.BR "ip maddr" " [ " add " | " del " ]" -+.IB MULTIADDR " dev " STRING -+ -+.ti -8 -+.BR "ip maddr show" " [ " dev -+.IR STRING " ]" -+ -+.ti -8 -+.BR "ip mroute show" " [" -+.IR PREFIX " ] [ " -+.B from -+.IR PREFIX " ] [ " -+.B iif -+.IR DEVICE " ]" -+ -+.ti -8 -+.BR "ip monitor" " [ " all " |" -+.IR LISTofOBJECTS " ]" -+.in -8 -+.ad b -+ -+.SH OPTIONS -+ -+.TP -+.BR "\-V" , " -Version" -+print the version of the -+.B ip -+utility and exit. -+ -+.TP -+.BR "\-s" , " \-stats", " \-statistics" -+output more information. If the option -+appears twice or more, the amount of information increases. -+As a rule, the information is statistics or some time values. -+ -+.TP -+.BR "\-f" , " \-family" -+followed by protocol family identifier: -+.BR "inet" , " inet6" -+or -+.B link -+,enforce the protocol family to use. If the option is not present, -+the protocol family is guessed from other arguments. If the rest -+of the command line does not give enough information to guess the -+family, -+.B ip -+falls back to the default one, usually -+.B inet -+or -+.BR "any" . -+.B link -+is a special family identifier meaning that no networking protocol -+is involved. -+ -+.TP -+.B \-4 -+shortcut for -+.BR "-family inet" . -+ -+.TP -+.B \-6 -+shortcut for -+.BR "\-family inet6" . -+ -+.TP -+.B \-0 -+shortcut for -+.BR "\-family link" . -+ -+.TP -+.BR "\-o" , " \-oneline" -+output each record on a single line, replacing line feeds -+with the -+.B '\' -+character. This is convenient when you want to count records -+with -+.BR wc (1) -+ or to -+.BR grep (1) -+the output. -+ -+.TP -+.BR "\-r" , " \-resolve" -+use the system's name resolver to print DNS names instead of -+host addresses. -+ -+.SH IP - COMMAND SYNTAX -+ -+.SS -+.I OBJECT -+ -+.TP -+.B link -+- network device. -+ -+.TP -+.B address -+- protocol (IP or IPv6) address on a device. -+.TP -+.B neighbour -+- ARP or NDISC cache entry. -+ -+.TP -+.B route -+- routing table entry. -+ -+.TP -+.B rule -+- rule in routing policy database. -+ -+.TP -+.B maddress -+- multicast address. -+ -+.TP -+.B mroute -+- multicast routing cache entry. -+ -+.TP -+.B tunnel -+- tunnel over IP. -+ -+.PP -+The names of all objects may be written in full or -+abbreviated form, f.e. -+.B address -+is abbreviated as -+.B addr -+or just -+.B a. -+ -+.SS -+.I COMMAND -+ -+Specifies the action to perform on the object. -+The set of possible actions depends on the object type. -+As a rule, it is possible to -+.BR "add" , " delete" -+and -+.B show -+(or -+.B list -+) objects, but some objects do not allow all of these operations -+or have some additional commands. The -+.B help -+command is available for all objects. It prints -+out a list of available commands and argument syntax conventions. -+.sp -+If no command is given, some default command is assumed. -+Usually it is -+.B list -+or, if the objects of this class cannot be listed, -+.BR "help" . -+ -+.SH ip link - network device configuration -+ -+.B link -+is a network device and the corresponding commands -+display and change the state of devices. -+ -+.SS ip link set - change device attributes -+ -+.TP -+.BI dev " NAME " (default) -+.I NAME -+specifies network device to operate on. -+ -+.TP -+.BR up " and " down -+change the state of the device to -+.B UP -+or -+.BR "DOWN" . -+ -+.TP -+.BR "arp on " or " arp off" -+change the -+.B NOARP -+flag on the device. -+ -+.TP -+.BR "multicast on " or " multicast off" -+change the -+.B MULTICAST -+flag on the device. -+ -+.TP -+.BR "dynamic on " or " dynamic off" -+change the -+.B DYNAMIC -+flag on the device. -+ -+.TP -+.BI name " NAME" -+change the name of the device. This operation is not -+recommended if the device is running or has some addresses -+already configured. -+ -+.TP -+.BI txqueuelen " NUMBER" -+.TP -+.BI txqlen " NUMBER" -+change the transmit queue length of the device. -+ -+.TP -+.BI mtu " NUMBER" -+change the -+.I MTU -+of the device. -+ -+.TP -+.BI address " LLADDRESS" -+change the station address of the interface. -+ -+.TP -+.BI broadcast " LLADDRESS" -+.TP -+.BI brd " LLADDRESS" -+.TP -+.BI peer " LLADDRESS" -+change the link layer broadcast address or the peer address when -+the interface is -+.IR "POINTOPOINT" . -+ -+.PP -+.B Warning: -+If multiple parameter changes are requested, -+.B ip -+aborts immediately after any of the changes have failed. -+This is the only case when -+.B ip -+can move the system to an unpredictable state. The solution -+is to avoid changing several parameters with one -+.B ip link set -+call. -+ -+.SS ip link show - display device attributes -+ -+.TP -+.BI dev " NAME " (default) -+.I NAME -+specifies the network device to show. -+If this argument is omitted all devices are listed. -+ -+.TP -+.B up -+only display running interfaces. -+ -+.SH ip address - protocol address management. -+ -+The -+.B address -+is a protocol (IP or IPv6) address attached -+to a network device. Each device must have at least one address -+to use the corresponding protocol. It is possible to have several -+different addresses attached to one device. These addresses are not -+discriminated, so that the term -+.B alias -+is not quite appropriate for them and we do not use it in this document. -+.sp -+The -+.B ip addr -+command displays addresses and their properties, adds new addresses -+and deletes old ones. -+ -+.SS ip address add - add new protocol address. -+ -+.TP -+.BI dev " NAME" -+the name of the device to add the address to. -+ -+.TP -+.BI local " ADDRESS " (default) -+the address of the interface. The format of the address depends -+on the protocol. It is a dotted quad for IP and a sequence of -+hexadecimal halfwords separated by colons for IPv6. The -+.I ADDRESS -+may be followed by a slash and a decimal number which encodes -+the network prefix length. -+ -+.TP -+.BI peer " ADDRESS" -+the address of the remote endpoint for pointopoint interfaces. -+Again, the -+.I ADDRESS -+may be followed by a slash and a decimal number, encoding the network -+prefix length. If a peer address is specified, the local address -+cannot have a prefix length. The network prefix is associated -+with the peer rather than with the local address. -+ -+.TP -+.BI broadcast " ADDRESS" -+the broadcast address on the interface. -+.sp -+It is possible to use the special symbols -+.B '+' -+and -+.B '-' -+instead of the broadcast address. In this case, the broadcast address -+is derived by setting/resetting the host bits of the interface prefix. -+ -+.TP -+.BI label " NAME" -+Each address may be tagged with a label string. -+In order to preserve compatibility with Linux-2.0 net aliases, -+this string must coincide with the name of the device or must be prefixed -+with the device name followed by colon. -+ -+.TP -+.BI scope " SCOPE_VALUE" -+the scope of the area where this address is valid. -+The available scopes are listed in file -+.BR "/etc/iproute2/rt_scopes" . -+Predefined scope values are: -+ -+.in +8 -+.B global -+- the address is globally valid. -+.sp -+.B site -+- (IPv6 only) the address is site local, i.e. it is -+valid inside this site. -+.sp -+.B link -+- the address is link local, i.e. it is valid only on this device. -+.sp -+.B host -+- the address is valid only inside this host. -+.in -8 -+ -+.SS ip address delete - delete protocol address -+.B Arguments: -+coincide with the arguments of -+.B ip addr add. -+The device name is a required argument. The rest are optional. -+If no arguments are given, the first address is deleted. -+ -+.SS ip address show - look at protocol addresses -+ -+.TP -+.BI dev " NAME " (default) -+name of device. -+ -+.TP -+.BI scope " SCOPE_VAL" -+only list addresses with this scope. -+ -+.TP -+.BI to " PREFIX" -+only list addresses matching this prefix. -+ -+.TP -+.BI label " PATTERN" -+only list addresses with labels matching the -+.IR "PATTERN" . -+.I PATTERN -+is a usual shell style pattern. -+ -+.TP -+.BR dynamic " and " permanent -+(IPv6 only) only list addresses installed due to stateless -+address configuration or only list permanent (not dynamic) -+addresses. -+ -+.TP -+.B tentative -+(IPv6 only) only list addresses which did not pass duplicate -+address detection. -+ -+.TP -+.B deprecated -+(IPv6 only) only list deprecated addresses. -+ -+.TP -+.BR primary " and " secondary -+only list primary (or secondary) addresses. -+ -+.SS ip address flush - flush protocol addresses -+This command flushes the protocol addresses selected by some criteria. -+ -+.PP -+This command has the same arguments as -+.B show. -+The difference is that it does not run when no arguments are given. -+ -+.PP -+.B Warning: -+This command (and other -+.B flush -+commands described below) is pretty dangerous. If you make a mistake, -+it will not forgive it, but will cruelly purge all the addresses. -+ -+.PP -+With the -+.B -statistics -+option, the command becomes verbose. It prints out the number of deleted -+addresses and the number of rounds made to flush the address list. If -+this option is given twice, -+.B ip addr flush -+also dumps all the deleted addresses in the format described in the -+previous subsection. -+ -+.SH ip neighbour - neighbour/arp tables management. -+ -+.B neighbour -+objects establish bindings between protocol addresses and -+link layer addresses for hosts sharing the same link. -+Neighbour entries are organized into tables. The IPv4 neighbour table -+is known by another name - the ARP table. -+ -+.P -+The corresponding commands display neighbour bindings -+and their properties, add new neighbour entries and delete old ones. -+ -+.SS ip neighbour add - add a new neighbour entry -+.SS ip neighbour change - change an existing entry -+.SS ip neighbour replace - add a new entry or change an existing one -+ -+These commands create new neighbour records or update existing ones. -+ -+.TP -+.BI to " ADDRESS " (default) -+the protocol address of the neighbour. It is either an IPv4 or IPv6 address. -+ -+.TP -+.BI dev " NAME" -+the interface to which this neighbour is attached. -+ -+.TP -+.BI lladdr " LLADDRESS" -+the link layer address of the neighbour. -+.I LLADDRESS -+can also be -+.BR "null" . -+ -+.TP -+.BI nud " NUD_STATE" -+the state of the neighbour entry. -+.B nud -+is an abbreviation for 'Neigh bour Unreachability Detection'. -+The state can take one of the following values: -+ -+.in +8 -+.B permanent -+- the neighbour entry is valid forever and can be only -+be removed administratively. -+.sp -+ -+.B noarp -+- the neighbour entry is valid. No attempts to validate -+this entry will be made but it can be removed when its lifetime expires. -+.sp -+ -+.B reachable -+- the neighbour entry is valid until the reachability -+timeout expires. -+.sp -+ -+.B stale -+- the neighbour entry is valid but suspicious. -+This option to -+.B ip neigh -+does not change the neighbour state if it was valid and the address -+is not changed by this command. -+.in -8 -+ -+.SS ip neighbour delete - delete a neighbour entry -+This command invalidates a neighbour entry. -+ -+.PP -+The arguments are the same as with -+.BR "ip neigh add" , -+except that -+.B lladdr -+and -+.B nud -+are ignored. -+ -+.PP -+.B Warning: -+Attempts to delete or manually change a -+.B noarp -+entry created by the kernel may result in unpredictable behaviour. -+Particularly, the kernel may try to resolve this address even -+on a -+.B NOARP -+interface or if the address is multicast or broadcast. -+ -+.SS ip neighbour show - list neighbour entries -+ -+This commands displays neighbour tables. -+ -+.TP -+.BI to " ADDRESS " (default) -+the prefix selecting the neighbours to list. -+ -+.TP -+.BI dev " NAME" -+only list the neighbours attached to this device. -+ -+.TP -+.B unused -+only list neighbours which are not currently in use. -+ -+.TP -+.BI nud " NUD_STATE" -+only list neighbour entries in this state. -+.I NUD_STATE -+takes values listed below or the special value -+.B all -+which means all states. This option may occur more than once. -+If this option is absent, -+.B ip -+lists all entries except for -+.B none -+and -+.BR "noarp" . -+ -+.SS ip neighbour flush - flush neighbour entries -+This command flushes neighbour tables, selecting -+entries to flush by some criteria. -+ -+.PP -+This command has the same arguments as -+.B show. -+The differences are that it does not run when no arguments are given, -+and that the default neighbour states to be flushed do not include -+.B permanent -+and -+.BR "noarp" . -+ -+.PP -+With the -+.B -statistics -+option, the command becomes verbose. It prints out the number of -+deleted neighbours and the number of rounds made to flush the -+neighbour table. If the option is given -+twice, -+.B ip neigh flush -+also dumps all the deleted neighbours. -+ -+.SH ip route - routing table management -+Manipulate route entries in the kernel routing tables keep -+information about paths to other networked nodes. -+.sp -+.B Route types: -+ -+.in +8 -+.B unicast -+- the route entry describes real paths to the destinations covered -+by the route prefix. -+ -+.sp -+.B unreachable -+- these destinations are unreachable. Packets are discarded and the -+ICMP message -+.I host unreachable -+is generated. -+The local senders get an -+.I EHOSTUNREACH -+error. -+ -+.sp -+.B blackhole -+- these destinations are unreachable. Packets are discarded silently. -+The local senders get an -+.I EINVAL -+error. -+ -+.sp -+.B prohibit -+- these destinations are unreachable. Packets are discarded and the -+ICMP message -+.I communication administratively prohibited -+is generated. The local senders get an -+.I EACCES -+error. -+ -+.sp -+.B local -+- the destinations are assigned to this host. The packets are looped -+back and delivered locally. -+ -+.sp -+.B broadcast -+- the destinations are broadcast addresses. The packets are sent as -+link broadcasts. -+ -+.sp -+.B throw -+- a special control route used together with policy rules. If such a -+route is selected, lookup in this table is terminated pretending that -+no route was found. Without policy routing it is equivalent to the -+absence of the route in the routing table. The packets are dropped -+and the ICMP message -+.I net unreachable -+is generated. The local senders get an -+.I ENETUNREACH -+error. -+ -+.sp -+.B nat -+- a special NAT route. Destinations covered by the prefix -+are considered to be dummy (or external) addresses which require translation -+to real (or internal) ones before forwarding. The addresses to translate to -+are selected with the attribute -+.BR "via" . -+ -+.sp -+.B anycast -+.RI "- " "not implemented" -+the destinations are -+.I anycast -+addresses assigned to this host. They are mainly equivalent -+to -+.B local -+with one difference: such addresses are invalid when used -+as the source address of any packet. -+ -+.sp -+.B multicast -+- a special type used for multicast routing. It is not present in -+normal routing tables. -+.in -8 -+ -+.P -+.B Route tables: -+Linux-2.x can pack routes into several routing -+tables identified by a number in the range from 1 to 255 or by -+name from the file -+.B /etc/iproute2/rt_tables -+. By default all normal routes are inserted into the -+.B main -+table (ID 254) and the kernel only uses this table when calculating routes. -+ -+.sp -+Actually, one other table always exists, which is invisible but -+even more important. It is the -+.B local -+table (ID 255). This table -+consists of routes for local and broadcast addresses. The kernel maintains -+this table automatically and the administrator usually need not modify it -+or even look at it. -+ -+The multiple routing tables enter the game when -+.I policy routing -+is used. -+ -+.SS ip route add - add new route -+.SS ip route change - change route -+.SS ip route replace - change or add new one -+ -+.TP -+.BI to " TYPE PREFIX " (default) -+the destination prefix of the route. If -+.I TYPE -+is omitted, -+.B ip -+assumes type -+.BR "unicast" . -+Other values of -+.I TYPE -+are listed above. -+.I PREFIX -+is an IP or IPv6 address optionally followed by a slash and the -+prefix length. If the length of the prefix is missing, -+.B ip -+assumes a full-length host route. There is also a special -+.I PREFIX -+.B default -+- which is equivalent to IP -+.B 0/0 -+or to IPv6 -+.BR "::/0" . -+ -+.TP -+.BI tos " TOS" -+.TP -+.BI dsfield " TOS" -+the Type Of Service (TOS) key. This key has no associated mask and -+the longest match is understood as: First, compare the TOS -+of the route and of the packet. If they are not equal, then the packet -+may still match a route with a zero TOS. -+.I TOS -+is either an 8 bit hexadecimal number or an identifier -+from -+.BR "/etc/iproute2/rt_dsfield" . -+ -+.TP -+.BI metric " NUMBER" -+.TP -+.BI preference " NUMBER" -+the preference value of the route. -+.I NUMBER -+is an arbitrary 32bit number. -+ -+.TP -+.BI table " TABLEID" -+the table to add this route to. -+.I TABLEID -+may be a number or a string from the file -+.BR "/etc/iproute2/rt_tables" . -+If this parameter is omitted, -+.B ip -+assumes the -+.B main -+table, with the exception of -+.BR local " , " broadcast " and " nat -+routes, which are put into the -+.B local -+table by default. -+ -+.TP -+.BI dev " NAME" -+the output device name. -+ -+.TP -+.BI via " ADDRESS" -+the address of the nexthop router. Actually, the sense of this field -+depends on the route type. For normal -+.B unicast -+routes it is either the true next hop router or, if it is a direct -+route installed in BSD compatibility mode, it can be a local address -+of the interface. For NAT routes it is the first address of the block -+of translated IP destinations. -+ -+.TP -+.BI src " ADDRESS" -+the source address to prefer when sending to the destinations -+covered by the route prefix. -+ -+.TP -+.BI realm " REALMID" -+the realm to which this route is assigned. -+.I REALMID -+may be a number or a string from the file -+.BR "/etc/iproute2/rt_realms" . -+ -+.TP -+.BI mtu " MTU" -+.TP -+.BI "mtu lock" " MTU" -+the MTU along the path to the destination. If the modifier -+.B lock -+is not used, the MTU may be updated by the kernel due to -+Path MTU Discovery. If the modifier -+.B lock -+is used, no path MTU discovery will be tried, all packets -+will be sent without the DF bit in IPv4 case or fragmented -+to MTU for IPv6. -+ -+.TP -+.BI window " NUMBER" -+the maximal window for TCP to advertise to these destinations, -+measured in bytes. It limits maximal data bursts that our TCP -+peers are allowed to send to us. -+ -+.TP -+.BI rtt " NUMBER" -+the initial RTT ('Round Trip Time') estimate. -+ -+.TP -+.BI rttvar " NUMBER " "(2.3.15+ only)" -+the initial RTT variance estimate. -+ -+.TP -+.BI ssthresh " NUMBER " "(2.3.15+ only)" -+an estimate for the initial slow start threshold. -+ -+.TP -+.BI cwnd " NUMBER " "(2.3.15+ only)" -+the clamp for congestion window. It is ignored if the -+.B lock -+flag is not used. -+ -+.TP -+.BI advmss " NUMBER " "(2.3.15+ only)" -+the MSS ('Maximal Segment Size') to advertise to these -+destinations when establishing TCP connections. If it is not given, -+Linux uses a default value calculated from the first hop device MTU. -+(If the path to these destination is asymmetric, this guess may be wrong.) -+ -+.TP -+.BI reordering " NUMBER " "(2.3.15+ only)" -+Maximal reordering on the path to this destination. -+If it is not given, Linux uses the value selected with -+.B sysctl -+variable -+.BR "net/ipv4/tcp_reordering" . -+ -+.TP -+.BI nexthop " NEXTHOP" -+the nexthop of a multipath route. -+.I NEXTHOP -+is a complex value with its own syntax similar to the top level -+argument lists: -+ -+.in +8 -+.BI via " ADDRESS" -+- is the nexthop router. -+.sp -+ -+.BI dev " NAME" -+- is the output device. -+.sp -+ -+.BI weight " NUMBER" -+- is a weight for this element of a multipath -+route reflecting its relative bandwidth or quality. -+.in -8 -+ -+.TP -+.BI scope " SCOPE_VAL" -+the scope of the destinations covered by the route prefix. -+.I SCOPE_VAL -+may be a number or a string from the file -+.BR "/etc/iproute2/rt_scopes" . -+If this parameter is omitted, -+.B ip -+assumes scope -+.B global -+for all gatewayed -+.B unicast -+routes, scope -+.B link -+for direct -+.BR unicast " and " broadcast -+routes and scope -+.BR host " for " local -+routes. -+ -+.TP -+.BI protocol " RTPROTO" -+the routing protocol identifier of this route. -+.I RTPROTO -+may be a number or a string from the file -+.BR "/etc/iproute2/rt_protos" . -+If the routing protocol ID is not given, -+.B ip assumes protocol -+.B boot -+(i.e. it assumes the route was added by someone who doesn't -+understand what they are doing). Several protocol values have -+a fixed interpretation. -+Namely: -+ -+.in +8 -+.B redirect -+- the route was installed due to an ICMP redirect. -+.sp -+ -+.B kernel -+- the route was installed by the kernel during autoconfiguration. -+.sp -+ -+.B boot -+- the route was installed during the bootup sequence. -+If a routing daemon starts, it will purge all of them. -+.sp -+ -+.B static -+- the route was installed by the administrator -+to override dynamic routing. Routing daemon will respect them -+and, probably, even advertise them to its peers. -+.sp -+ -+.B ra -+- the route was installed by Router Discovery protocol. -+.in -8 -+ -+.sp -+The rest of the values are not reserved and the administrator is free -+to assign (or not to assign) protocol tags. -+ -+.TP -+.B onlink -+pretend that the nexthop is directly attached to this link, -+even if it does not match any interface prefix. -+ -+.TP -+.B equalize -+allow packet by packet randomization on multipath routes. -+Without this modifier, the route will be frozen to one selected -+nexthop, so that load splitting will only occur on per-flow base. -+.B equalize -+only works if the kernel is patched. -+ -+.SS ip route delete - delete route -+ -+.B ip route del -+has the same arguments as -+.BR "ip route add" , -+but their semantics are a bit different. -+ -+Key values -+.RB "(" to ", " tos ", " preference " and " table ")" -+select the route to delete. If optional attributes are present, -+.B ip -+verifies that they coincide with the attributes of the route to delete. -+If no route with the given key and attributes was found, -+.B ip route del -+fails. -+ -+.SS ip route show - list routes -+the command displays the contents of the routing tables or the route(s) -+selected by some criteria. -+ -+.TP -+.BI to " SELECTOR " (default) -+only select routes from the given range of destinations. -+.I SELECTOR -+consists of an optional modifier -+.RB "(" root ", " match " or " exact ")" -+and a prefix. -+.BI root " PREFIX" -+selects routes with prefixes not shorter than -+.IR PREFIX "." -+F.e. -+.BI root " 0/0" -+selects the entire routing table. -+.BI match " PREFIX" -+selects routes with prefixes not longer than -+.IR PREFIX "." -+F.e. -+.BI match " 10.0/16" -+selects -+.IR 10.0/16 "," -+.IR 10/8 " and " 0/0 , -+but it does not select -+.IR 10.1/16 " and " 10.0.0/24 . -+And -+.BI exact " PREFIX" -+(or just -+.IR PREFIX ")" -+selects routes with this exact prefix. If neither of these options -+are present, -+.B ip -+assumes -+.BI root " 0/0" -+i.e. it lists the entire table. -+ -+.TP -+.BI tos " TOS" -+.BI dsfield " TOS" -+only select routes with the given TOS. -+ -+.TP -+.BI table " TABLEID" -+show the routes from this table(s). The default setting is to show -+.BR table main "." -+.I TABLEID -+may either be the ID of a real table or one of the special values: -+.sp -+.in +8 -+.B all -+- list all of the tables. -+.sp -+.B cache -+- dump the routing cache. -+.in -8 -+ -+.TP -+.B cloned -+.TP -+.B cached -+list cloned routes i.e. routes which were dynamically forked from -+other routes because some route attribute (f.e. MTU) was updated. -+Actually, it is equivalent to -+.BR "table cache" "." -+ -+.TP -+.BI from " SELECTOR" -+the same syntax as for -+.BR to "," -+but it binds the source address range rather than destinations. -+Note that the -+.B from -+option only works with cloned routes. -+ -+.TP -+.BI protocol " RTPROTO" -+only list routes of this protocol. -+ -+.TP -+.BI scope " SCOPE_VAL" -+only list routes with this scope. -+ -+.TP -+.BI type " TYPE" -+only list routes of this type. -+ -+.TP -+.BI dev " NAME" -+only list routes going via this device. -+ -+.TP -+.BI via " PREFIX" -+only list routes going via the nexthop routers selected by -+.IR PREFIX "." -+ -+.TP -+.BI src " PREFIX" -+only list routes with preferred source addresses selected -+by -+.IR PREFIX "." -+ -+.TP -+.BI realm " REALMID" -+.TP -+.BI realms " FROMREALM/TOREALM" -+only list routes with these realms. -+ -+.SS ip route flush - flush routing tables -+this command flushes routes selected by some criteria. -+ -+.sp -+The arguments have the same syntax and semantics as the arguments of -+.BR "ip route show" , -+but routing tables are not listed but purged. The only difference is -+the default action: -+.B show -+dumps all the IP main routing table but -+.B flush -+prints the helper page. -+ -+.sp -+With the -+.B -statistics -+option, the command becomes verbose. It prints out the number of -+deleted routes and the number of rounds made to flush the routing -+table. If the option is given -+twice, -+.B ip route flush -+also dumps all the deleted routes in the format described in the -+previous subsection. -+ -+.SS ip route get - get a single route -+this command gets a single route to a destination and prints its -+contents exactly as the kernel sees it. -+ -+.TP -+.BI to " ADDRESS " (default) -+the destination address. -+ -+.TP -+.BI from " ADDRESS" -+the source address. -+ -+.TP -+.BI tos " TOS" -+.TP -+.BI dsfield " TOS" -+the Type Of Service. -+ -+.TP -+.BI iif " NAME" -+the device from which this packet is expected to arrive. -+ -+.TP -+.BI oif " NAME" -+force the output device on which this packet will be routed. -+ -+.TP -+.B connected -+if no source address -+.RB "(option " from ")" -+was given, relookup the route with the source set to the preferred -+address received from the first lookup. -+If policy routing is used, it may be a different route. -+ -+.P -+Note that this operation is not equivalent to -+.BR "ip route show" . -+.B show -+shows existing routes. -+.B get -+resolves them and creates new clones if necessary. Essentially, -+.B get -+is equivalent to sending a packet along this path. -+If the -+.B iif -+argument is not given, the kernel creates a route -+to output packets towards the requested destination. -+This is equivalent to pinging the destination -+with a subsequent -+.BR "ip route ls cache" , -+however, no packets are actually sent. With the -+.B iif -+argument, the kernel pretends that a packet arrived from this interface -+and searches for a path to forward the packet. -+ -+.SH ip rule - routing policy database management -+ -+.BR "Rule" s -+in the routing policy database control the route selection algorithm. -+ -+.P -+Classic routing algorithms used in the Internet make routing decisions -+based only on the destination address of packets (and in theory, -+but not in practice, on the TOS field). -+ -+.P -+In some circumstances we want to route packets differently depending not only -+on destination addresses, but also on other packet fields: source address, -+IP protocol, transport protocol ports or even packet payload. -+This task is called 'policy routing'. -+ -+.P -+To solve this task, the conventional destination based routing table, ordered -+according to the longest match rule, is replaced with a 'routing policy -+database' (or RPDB), which selects routes by executing some set of rules. -+ -+.P -+Each policy routing rule consists of a -+.B selector -+and an -+.B action predicate. -+The RPDB is scanned in the order of increasing priority. The selector -+of each rule is applied to {source address, destination address, incoming -+interface, tos, fwmark} and, if the selector matches the packet, -+the action is performed. The action predicate may return with success. -+In this case, it will either give a route or failure indication -+and the RPDB lookup is terminated. Otherwise, the RPDB program -+continues on the next rule. -+ -+.P -+Semantically, natural action is to select the nexthop and the output device. -+ -+.P -+At startup time the kernel configures the default RPDB consisting of three -+rules: -+ -+.TP -+1. -+Priority: 0, Selector: match anything, Action: lookup routing -+table -+.B local -+(ID 255). -+The -+.B local -+table is a special routing table containing -+high priority control routes for local and broadcast addresses. -+.sp -+Rule 0 is special. It cannot be deleted or overridden. -+ -+.TP -+2. -+Priority: 32766, Selector: match anything, Action: lookup routing -+table -+.B main -+(ID 254). -+The -+.B main -+table is the normal routing table containing all non-policy -+routes. This rule may be deleted and/or overridden with other -+ones by the administrator. -+ -+.TP -+3. -+Priority: 32767, Selector: match anything, Action: lookup routing -+table -+.B default -+(ID 253). -+The -+.B default -+table is empty. It is reserved for some post-processing if no previous -+default rules selected the packet. -+This rule may also be deleted. -+ -+.P -+Each RPDB entry has additional -+attributes. F.e. each rule has a pointer to some routing -+table. NAT and masquerading rules have an attribute to select new IP -+address to translate/masquerade. Besides that, rules have some -+optional attributes, which routes have, namely -+.BR "realms" . -+These values do not override those contained in the routing tables. They -+are only used if the route did not select any attributes. -+ -+.sp -+The RPDB may contain rules of the following types: -+ -+.in +8 -+.B unicast -+- the rule prescribes to return the route found -+in the routing table referenced by the rule. -+ -+.B blackhole -+- the rule prescribes to silently drop the packet. -+ -+.B unreachable -+- the rule prescribes to generate a 'Network is unreachable' error. -+ -+.B prohibit -+- the rule prescribes to generate 'Communication is administratively -+prohibited' error. -+ -+.B nat -+- the rule prescribes to translate the source address -+of the IP packet into some other value. -+.in -8 -+ -+.SS ip rule add - insert a new rule -+.SS ip rule delete - delete a rule -+ -+.TP -+.BI type " TYPE " (default) -+the type of this rule. The list of valid types was given in the previous -+subsection. -+ -+.TP -+.BI from " PREFIX" -+select the source prefix to match. -+ -+.TP -+.BI to " PREFIX" -+select the destination prefix to match. -+ -+.TP -+.BI iif " NAME" -+select the incoming device to match. If the interface is loopback, -+the rule only matches packets originating from this host. This means -+that you may create separate routing tables for forwarded and local -+packets and, hence, completely segregate them. -+ -+.TP -+.BI tos " TOS" -+.TP -+.BI dsfield " TOS" -+select the TOS value to match. -+ -+.TP -+.BI fwmark " MARK" -+select the -+.B fwmark -+value to match. -+ -+.TP -+.BI priority " PREFERENCE" -+the priority of this rule. Each rule should have an explicitly -+set -+.I unique -+priority value. -+ -+.TP -+.BI table " TABLEID" -+the routing table identifier to lookup if the rule selector matches. -+ -+.TP -+.BI realms " FROM/TO" -+Realms to select if the rule matched and the routing table lookup -+succeeded. Realm -+.I TO -+is only used if the route did not select any realm. -+ -+.TP -+.BI nat " ADDRESS" -+The base of the IP address block to translate (for source addresses). -+The -+.I ADDRESS -+may be either the start of the block of NAT addresses (selected by NAT -+routes) or a local host address (or even zero). -+In the last case the router does not translate the packets, but -+masquerades them to this address. -+ -+.B Warning: -+Changes to the RPDB made with these commands do not become active -+immediately. It is assumed that after a script finishes a batch of -+updates, it flushes the routing cache with -+.BR "ip route flush cache" . -+ -+.SS ip rule show - list rules -+This command has no arguments. -+ -+.SH ip maddress - multicast addresses management -+ -+.B maddress -+objects are multicast addresses. -+ -+.SS ip maddress show - list multicast addresses -+ -+.TP -+.BI dev " NAME " (default) -+the device name. -+ -+.SS ip maddress add - add a multicast address -+.SS ip maddress delete - delete a multicast address -+these commands attach/detach a static link layer multicast address -+to listen on the interface. -+Note that it is impossible to join protocol multicast groups -+statically. This command only manages link layer addresses. -+ -+.TP -+.BI address " LLADDRESS " (default) -+the link layer multicast address. -+ -+.TP -+.BI dev " NAME" -+the device to join/leave this multicast address. -+ -+.SH ip mroute - multicast routing cache management -+.B mroute -+objects are multicast routing cache entries created by a user level -+mrouting daemon (f.e. -+.B pimd -+or -+.B mrouted -+). -+ -+Due to the limitations of the current interface to the multicast routing -+engine, it is impossible to change -+.B mroute -+objects administratively, so we may only display them. This limitation -+will be removed in the future. -+ -+.SS ip mroute show - list mroute cache entries -+ -+.TP -+.BI to " PREFIX " (default) -+the prefix selecting the destination multicast addresses to list. -+ -+.TP -+.BI iif " NAME" -+the interface on which multicast packets are received. -+ -+.TP -+.BI from " PREFIX" -+the prefix selecting the IP source addresses of the multicast route. -+ -+.SH ip tunnel - tunnel configuration -+.B tunnel -+objects are tunnels, encapsulating packets in IPv4 packets and then -+sending them over the IP infrastructure. -+ -+.SS ip tunnel add - add a new tunnel -+.SS ip tunnel change - change an existing tunnel -+.SS ip tunnel delete - destroy a tunnel -+ -+.TP -+.BI name " NAME " (default) -+select the tunnel device name. -+ -+.TP -+.BI mode " MODE" -+set the tunnel mode. Three modes are currently available: -+.BR ipip ", " sit " and " gre "." -+ -+.TP -+.BI remote " ADDRESS" -+set the remote endpoint of the tunnel. -+ -+.TP -+.BI local " ADDRESS" -+set the fixed local address for tunneled packets. -+It must be an address on another interface of this host. -+ -+.TP -+.BI ttl " N" -+set a fixed TTL -+.I N -+on tunneled packets. -+.I N -+is a number in the range 1--255. 0 is a special value -+meaning that packets inherit the TTL value. -+The default value is: -+.BR "inherit" . -+ -+.TP -+.BI tos " T" -+.TP -+.BI dsfield " T" -+set a fixed TOS -+.I T -+on tunneled packets. -+The default value is: -+.BR "inherit" . -+ -+.TP -+.BI dev " NAME" -+bind the tunnel to the device -+.I NAME -+so that tunneled packets will only be routed via this device and will -+not be able to escape to another device when the route to endpoint -+changes. -+ -+.TP -+.B nopmtudisc -+disable Path MTU Discovery on this tunnel. -+It is enabled by default. Note that a fixed ttl is incompatible -+with this option: tunnelling with a fixed ttl always makes pmtu -+discovery. -+ -+.TP -+.BI key " K" -+.TP -+.BI ikey " K" -+.TP -+.BI okey " K" -+.RB ( " only GRE tunnels " ) -+use keyed GRE with key -+.IR K ". " K -+is either a number or an IP address-like dotted quad. -+The -+.B key -+parameter sets the key to use in both directions. -+The -+.BR ikey " and " okey -+parameters set different keys for input and output. -+ -+.TP -+.BR csum ", " icsum ", " ocsum -+.RB ( " only GRE tunnels " ) -+generate/require checksums for tunneled packets. -+The -+.B ocsum -+flag calculates checksums for outgoing packets. -+The -+.B icsum -+flag requires that all input packets have the correct -+checksum. The -+.B csum -+flag is equivalent to the combination -+.BR "icsum ocsum" . -+ -+.TP -+.BR seq ", " iseq ", " oseq -+.RB ( " only GRE tunnels " ) -+serialize packets. -+The -+.B oseq -+flag enables sequencing of outgoing packets. -+The -+.B iseq -+flag requires that all input packets are serialized. -+The -+.B seq -+flag is equivalent to the combination -+.BR "iseq oseq" . -+.B It isn't work. Don't use it. -+ -+.SS ip tunnel show - list tunnels -+This command has no arguments. -+ -+.SH ip monitor and rtmon - state monitoring -+ -+The -+.B ip -+utility can monitor the state of devices, addresses -+and routes continuously. This option has a slightly different format. -+Namely, the -+.B monitor -+command is the first in the command line and then the object list follows: -+ -+.BR "ip monitor" " [ " all " |" -+.IR LISTofOBJECTS " ]" -+ -+.I OBJECT-LIST -+is the list of object types that we want to monitor. -+It may contain -+.BR link ", " address " and " route "." -+If no -+.B file -+argument is given, -+.B ip -+opens RTNETLINK, listens on it and dumps state changes in the format -+described in previous sections. -+ -+.P -+If a file name is given, it does not listen on RTNETLINK, -+but opens the file containing RTNETLINK messages saved in binary format -+and dumps them. Such a history file can be generated with the -+.B rtmon -+utility. This utility has a command line syntax similar to -+.BR "ip monitor" . -+Ideally, -+.B rtmon -+should be started before the first network configuration command -+is issued. F.e. if you insert: -+.sp -+.in +8 -+rtmon file /var/log/rtmon.log -+.in -8 -+.sp -+in a startup script, you will be able to view the full history -+later. -+ -+.P -+Certainly, it is possible to start -+.B rtmon -+at any time. -+It prepends the history with the state snapshot dumped at the moment -+of starting. -+ -+.SH HISTORY -+ -+.B ip -+was written by Alexey N. Kuznetsov and added in Linux 2.2. -+.SH SEE ALSO -+.BR tc (8) -+.br -+.RB "IP Command reference " ip-cref.ps -+.br -+.RB "IP tunnels " ip-cref.ps -+ -+.SH AUTHOR -+ -+Manpage maintained by Michail Litvak -diff -Naur iproute2-orig/debian/manpages/old/tc-cbq-details.8 iproute2/debian/manpages/old/tc-cbq-details.8 ---- iproute2-orig/debian/manpages/old/tc-cbq-details.8 1969-12-31 16:00:00.000000000 -0800 -+++ iproute2/debian/manpages/old/tc-cbq-details.8 2004-05-21 00:09:38.000000000 -0700 -@@ -0,0 +1,425 @@ -+.TH CBQ 8 "8 December 2001" "iproute2" "Linux" -+.SH NAME -+CBQ \- Class Based Queueing -+.SH SYNOPSIS -+.B tc qdisc ... dev -+dev -+.B ( parent -+classid -+.B | root) [ handle -+major: -+.B ] cbq avpkt -+bytes -+.B bandwidth -+rate -+.B [ cell -+bytes -+.B ] [ ewma -+log -+.B ] [ mpu -+bytes -+.B ] -+ -+.B tc class ... dev -+dev -+.B parent -+major:[minor] -+.B [ classid -+major:minor -+.B ] cbq allot -+bytes -+.B [ bandwidth -+rate -+.B ] [ rate -+rate -+.B ] prio -+priority -+.B [ weight -+weight -+.B ] [ minburst -+packets -+.B ] [ maxburst -+packets -+.B ] [ ewma -+log -+.B ] [ cell -+bytes -+.B ] avpkt -+bytes -+.B [ mpu -+bytes -+.B ] [ bounded isolated ] [ split -+handle -+.B & defmap -+defmap -+.B ] [ estimator -+interval timeconstant -+.B ] -+ -+.SH DESCRIPTION -+Class Based Queueing is a classful qdisc that implements a rich -+linksharing hierarchy of classes. It contains shaping elements as -+well as prioritizing capabilities. Shaping is performed using link -+idle time calculations based on the timing of dequeue events and -+underlying link bandwidth. -+ -+.SH SHAPING ALGORITHM -+Shaping is done using link idle time calculations, and actions taken if -+these calculations deviate from set limits. -+ -+When shaping a 10mbit/s connection to 1mbit/s, the link will -+be idle 90% of the time. If it isn't, it needs to be throttled so that it -+IS idle 90% of the time. -+ -+From the kernel's perspective, this is hard to measure, so CBQ instead -+derives the idle time from the number of microseconds (in fact, jiffies) -+that elapse between requests from the device driver for more data. Combined -+with the knowledge of packet sizes, this is used to approximate how full or -+empty the link is. -+ -+This is rather circumspect and doesn't always arrive at proper -+results. For example, what is the actual link speed of an interface -+that is not really able to transmit the full 100mbit/s of data, -+perhaps because of a badly implemented driver? A PCMCIA network card -+will also never achieve 100mbit/s because of the way the bus is -+designed - again, how do we calculate the idle time? -+ -+The physical link bandwidth may be ill defined in case of not-quite-real -+network devices like PPP over Ethernet or PPTP over TCP/IP. The effective -+bandwidth in that case is probably determined by the efficiency of pipes -+to userspace - which not defined. -+ -+During operations, the effective idletime is measured using an -+exponential weighted moving average (EWMA), which considers recent -+packets to be exponentially more important than past ones. The Unix -+loadaverage is calculated in the same way. -+ -+The calculated idle time is subtracted from the EWMA measured one, -+the resulting number is called 'avgidle'. A perfectly loaded link has -+an avgidle of zero: packets arrive exactly at the calculated -+interval. -+ -+An overloaded link has a negative avgidle and if it gets too negative, -+CBQ throttles and is then 'overlimit'. -+ -+Conversely, an idle link might amass a huge avgidle, which would then -+allow infinite bandwidths after a few hours of silence. To prevent -+this, avgidle is capped at -+.B maxidle. -+ -+If overlimit, in theory, the CBQ could throttle itself for exactly the -+amount of time that was calculated to pass between packets, and then -+pass one packet, and throttle again. Due to timer resolution constraints, -+this may not be feasible, see the -+.B minburst -+parameter below. -+ -+.SH CLASSIFICATION -+Within the one CBQ instance many classes may exist. Each of these classes -+contains another qdisc, by default -+.BR tc-pfifo (8). -+ -+When enqueueing a packet, CBQ starts at the root and uses various methods to -+determine which class should receive the data. If a verdict is reached, this -+process is repeated for the recipient class which might have further -+means of classifying traffic to its children, if any. -+ -+CBQ has the following methods available to classify a packet to any child -+classes. -+.TP -+(i) -+.B skb->priority class encoding. -+Can be set from userspace by an application with the -+.B SO_PRIORITY -+setsockopt. -+The -+.B skb->priority class encoding -+only applies if the skb->priority holds a major:minor handle of an existing -+class within this qdisc. -+.TP -+(ii) -+tc filters attached to the class. -+.TP -+(iii) -+The defmap of a class, as set with the -+.B split & defmap -+parameters. The defmap may contain instructions for each possible Linux packet -+priority. -+ -+.P -+Each class also has a -+.B level. -+Leaf nodes, attached to the bottom of the class hierarchy, have a level of 0. -+.SH CLASSIFICATION ALGORITHM -+ -+Classification is a loop, which terminates when a leaf class is found. At any -+point the loop may jump to the fallback algorithm. -+ -+The loop consists of the following steps: -+.TP -+(i) -+If the packet is generated locally and has a valid classid encoded within its -+.B skb->priority, -+choose it and terminate. -+ -+.TP -+(ii) -+Consult the tc filters, if any, attached to this child. If these return -+a class which is not a leaf class, restart loop from the class returned. -+If it is a leaf, choose it and terminate. -+.TP -+(iii) -+If the tc filters did not return a class, but did return a classid, -+try to find a class with that id within this qdisc. -+Check if the found class is of a lower -+.B level -+than the current class. If so, and the returned class is not a leaf node, -+restart the loop at the found class. If it is a leaf node, terminate. -+If we found an upward reference to a higher level, enter the fallback -+algorithm. -+.TP -+(iv) -+If the tc filters did not return a class, nor a valid reference to one, -+consider the minor number of the reference to be the priority. Retrieve -+a class from the defmap of this class for the priority. If this did not -+contain a class, consult the defmap of this class for the -+.B BEST_EFFORT -+class. If this is an upward reference, or no -+.B BEST_EFFORT -+class was defined, -+enter the fallback algorithm. If a valid class was found, and it is not a -+leaf node, restart the loop at this class. If it is a leaf, choose it and -+terminate. If -+neither the priority distilled from the classid, nor the -+.B BEST_EFFORT -+priority yielded a class, enter the fallback algorithm. -+.P -+The fallback algorithm resides outside of the loop and is as follows. -+.TP -+(i) -+Consult the defmap of the class at which the jump to fallback occured. If -+the defmap contains a class for the -+.B -+priority -+of the class (which is related to the TOS field), choose this class and -+terminate. -+.TP -+(ii) -+Consult the map for a class for the -+.B BEST_EFFORT -+priority. If found, choose it, and terminate. -+.TP -+(iii) -+Choose the class at which break out to the fallback algorithm occured. Terminate. -+.P -+The packet is enqueued to the class which was chosen when either algorithm -+terminated. It is therefore possible for a packet to be enqueued *not* at a -+leaf node, but in the middle of the hierarchy. -+ -+.SH LINK SHARING ALGORITHM -+When dequeuing for sending to the network device, CBQ decides which of its -+classes will be allowed to send. It does so with a Weighted Round Robin process -+in which each class with packets gets a chance to send in turn. The WRR process -+starts by asking the highest priority classes (lowest numerically - -+highest semantically) for packets, and will continue to do so until they -+have no more data to offer, in which case the process repeats for lower -+priorities. -+ -+.B CERTAINTY ENDS HERE, ANK PLEASE HELP -+ -+Each class is not allowed to send at length though - they can only dequeue a -+configurable amount of data during each round. -+ -+If a class is about to go overlimit, and it is not -+.B bounded -+it will try to borrow avgidle from siblings that are not -+.B isolated. -+This process is repeated from the bottom upwards. If a class is unable -+to borrow enough avgidle to send a packet, it is throttled and not asked -+for a packet for enough time for the avgidle to increase above zero. -+ -+.B I REALLY NEED HELP FIGURING THIS OUT. REST OF DOCUMENT IS PRETTY CERTAIN -+.B AGAIN. -+ -+.SH QDISC -+The root qdisc of a CBQ class tree has the following parameters: -+ -+.TP -+parent major:minor | root -+This mandatory parameter determines the place of the CBQ instance, either at the -+.B root -+of an interface or within an existing class. -+.TP -+handle major: -+Like all other qdiscs, the CBQ can be assigned a handle. Should consist only -+of a major number, followed by a colon. Optional. -+.TP -+avpkt bytes -+For calculations, the average packet size must be known. It is silently capped -+at a minimum of 2/3 of the interface MTU. Mandatory. -+.TP -+bandwidth rate -+To determine the idle time, CBQ must know the bandwidth of your underlying -+physical interface, or parent qdisc. This is a vital parameter, more about it -+later. Mandatory. -+.TP -+cell -+The cell size determines he granularity of packet transmission time calculations. Has a sensible default. -+.TP -+mpu -+A zero sized packet may still take time to transmit. This value is the lower -+cap for packet transmission time calculations - packets smaller than this value -+are still deemed to have this size. Defaults to zero. -+.TP -+ewma log -+When CBQ needs to measure the average idle time, it does so using an -+Exponentially Weighted Moving Average which smoothes out measurements into -+a moving average. The EWMA LOG determines how much smoothing occurs. Defaults -+to 5. Lower values imply greater sensitivity. Must be between 0 and 31. -+.P -+A CBQ qdisc does not shape out of its own accord. It only needs to know certain -+parameters about the underlying link. Actual shaping is done in classes. -+ -+.SH CLASSES -+Classes have a host of parameters to configure their operation. -+ -+.TP -+parent major:minor -+Place of this class within the hierarchy. If attached directly to a qdisc -+and not to another class, minor can be omitted. Mandatory. -+.TP -+classid major:minor -+Like qdiscs, classes can be named. The major number must be equal to the -+major number of the qdisc to which it belongs. Optional, but needed if this -+class is going to have children. -+.TP -+weight weight -+When dequeuing to the interface, classes are tried for traffic in a -+round-robin fashion. Classes with a higher configured qdisc will generally -+have more traffic to offer during each round, so it makes sense to allow -+it to dequeue more traffic. All weights under a class are normalized, so -+only the ratios matter. Defaults to the configured rate, unless the priority -+of this class is maximal, in which case it is set to 1. -+.TP -+allot bytes -+Allot specifies how many bytes a qdisc can dequeue -+during each round of the process. This parameter is weighted using the -+renormalized class weight described above. -+ -+.TP -+priority priority -+In the round-robin process, classes with the lowest priority field are tried -+for packets first. Mandatory. -+ -+.TP -+rate rate -+Maximum rate this class and all its children combined can send at. Mandatory. -+ -+.TP -+bandwidth rate -+This is different from the bandwidth specified when creating a CBQ disc. Only -+used to determine maxidle and offtime, which are only calculated when -+specifying maxburst or minburst. Mandatory if specifying maxburst or minburst. -+ -+.TP -+maxburst -+This number of packets is used to calculate maxidle so that when -+avgidle is at maxidle, this number of average packets can be burst -+before avgidle drops to 0. Set it higher to be more tolerant of -+bursts. You can't set maxidle directly, only via this parameter. -+ -+.TP -+minburst -+As mentioned before, CBQ needs to throttle in case of -+overlimit. The ideal solution is to do so for exactly the calculated -+idle time, and pass 1 packet. However, Unix kernels generally have a -+hard time scheduling events shorter than 10ms, so it is better to -+throttle for a longer period, and then pass minburst packets in one -+go, and then sleep minburst times longer. -+ -+The time to wait is called the offtime. Higher values of minburst lead -+to more accurate shaping in the long term, but to bigger bursts at -+millisecond timescales. -+ -+.TP -+minidle -+If avgidle is below 0, we are overlimits and need to wait until -+avgidle will be big enough to send one packet. To prevent a sudden -+burst from shutting down the link for a prolonged period of time, -+avgidle is reset to minidle if it gets too low. -+ -+Minidle is specified in negative microseconds, so 10 means that -+avgidle is capped at -10us. -+ -+.TP -+bounded -+Signifies that this class will not borrow bandwidth from its siblings. -+.TP -+isolated -+Means that this class will not borrow bandwidth to its siblings -+ -+.TP -+split major:minor & defmap bitmap[/bitmap] -+If consulting filters attached to a class did not give a verdict, -+CBQ can also classify based on the packet's priority. There are 16 -+priorities available, numbered from 0 to 15. -+ -+The defmap specifies which priorities this class wants to receive, -+specified as a bitmap. The Least Significant Bit corresponds to priority -+zero. The -+.B split -+parameter tells CBQ at which class the decision must be made, which should -+be a (grand)parent of the class you are adding. -+ -+As an example, 'tc class add ... classid 10:1 cbq .. split 10:0 defmap c0' -+configures class 10:0 to send packets with priorities 6 and 7 to 10:1. -+ -+The complimentary configuration would then -+be: 'tc class add ... classid 10:2 cbq ... split 10:0 defmap 3f' -+Which would send all packets 0, 1, 2, 3, 4 and 5 to 10:1. -+.TP -+estimator interval timeconstant -+CBQ can measure how much bandwidth each class is using, which tc filters -+can use to classify packets with. In order to determine the bandwidth -+it uses a very simple estimator that measures once every -+.B interval -+microseconds how much traffic has passed. This again is a EWMA, for which -+the time constant can be specified, also in microseconds. The -+.B time constant -+corresponds to the sluggishness of the measurement or, conversely, to the -+sensitivity of the average to short bursts. Higher values mean less -+sensitivity. -+ -+ -+ -+.SH SOURCES -+.TP -+o -+Sally Floyd and Van Jacobson, "Link-sharing and Resource -+Management Models for Packet Networks", -+IEEE/ACM Transactions on Networking, Vol.3, No.4, 1995 -+ -+.TP -+o -+Sally Floyd, "Notes on CBQ and Guarantee Service", 1995 -+ -+.TP -+o -+Sally Floyd, "Notes on Class-Based Queueing: Setting -+Parameters", 1996 -+ -+.TP -+o -+Sally Floyd and Michael Speer, "Experimental Results -+for Class-Based Queueing", 1998, not published. -+ -+ -+ -+.SH SEE ALSO -+.BR tc (8) -+ -+.SH AUTHOR -+Alexey N. Kuznetsov, . This manpage maintained by -+bert hubert -+ -+ -diff -Naur iproute2-orig/debian/manpages/old/tc-cbq.8 iproute2/debian/manpages/old/tc-cbq.8 ---- iproute2-orig/debian/manpages/old/tc-cbq.8 1969-12-31 16:00:00.000000000 -0800 -+++ iproute2/debian/manpages/old/tc-cbq.8 2004-05-21 00:09:38.000000000 -0700 -@@ -0,0 +1,353 @@ -+.TH CBQ 8 "16 December 2001" "iproute2" "Linux" -+.SH NAME -+CBQ \- Class Based Queueing -+.SH SYNOPSIS -+.B tc qdisc ... dev -+dev -+.B ( parent -+classid -+.B | root) [ handle -+major: -+.B ] cbq [ allot -+bytes -+.B ] avpkt -+bytes -+.B bandwidth -+rate -+.B [ cell -+bytes -+.B ] [ ewma -+log -+.B ] [ mpu -+bytes -+.B ] -+ -+.B tc class ... dev -+dev -+.B parent -+major:[minor] -+.B [ classid -+major:minor -+.B ] cbq allot -+bytes -+.B [ bandwidth -+rate -+.B ] [ rate -+rate -+.B ] prio -+priority -+.B [ weight -+weight -+.B ] [ minburst -+packets -+.B ] [ maxburst -+packets -+.B ] [ ewma -+log -+.B ] [ cell -+bytes -+.B ] avpkt -+bytes -+.B [ mpu -+bytes -+.B ] [ bounded isolated ] [ split -+handle -+.B & defmap -+defmap -+.B ] [ estimator -+interval timeconstant -+.B ] -+ -+.SH DESCRIPTION -+Class Based Queueing is a classful qdisc that implements a rich -+linksharing hierarchy of classes. It contains shaping elements as -+well as prioritizing capabilities. Shaping is performed using link -+idle time calculations based on the timing of dequeue events and -+underlying link bandwidth. -+ -+.SH SHAPING ALGORITHM -+When shaping a 10mbit/s connection to 1mbit/s, the link will -+be idle 90% of the time. If it isn't, it needs to be throttled so that it -+IS idle 90% of the time. -+ -+During operations, the effective idletime is measured using an -+exponential weighted moving average (EWMA), which considers recent -+packets to be exponentially more important than past ones. The Unix -+loadaverage is calculated in the same way. -+ -+The calculated idle time is subtracted from the EWMA measured one, -+the resulting number is called 'avgidle'. A perfectly loaded link has -+an avgidle of zero: packets arrive exactly at the calculated -+interval. -+ -+An overloaded link has a negative avgidle and if it gets too negative, -+CBQ throttles and is then 'overlimit'. -+ -+Conversely, an idle link might amass a huge avgidle, which would then -+allow infinite bandwidths after a few hours of silence. To prevent -+this, avgidle is capped at -+.B maxidle. -+ -+If overlimit, in theory, the CBQ could throttle itself for exactly the -+amount of time that was calculated to pass between packets, and then -+pass one packet, and throttle again. Due to timer resolution constraints, -+this may not be feasible, see the -+.B minburst -+parameter below. -+ -+.SH CLASSIFICATION -+Within the one CBQ instance many classes may exist. Each of these classes -+contains another qdisc, by default -+.BR tc-pfifo (8). -+ -+When enqueueing a packet, CBQ starts at the root and uses various methods to -+determine which class should receive the data. -+ -+In the absence of uncommon configuration options, the process is rather easy. -+At each node we look for an instruction, and then go to the class the -+instruction refers us to. If the class found is a barren leaf-node (without -+children), we enqueue the packet there. If it is not yet a leaf node, we do -+the whole thing over again starting from that node. -+ -+The following actions are performed, in order at each node we visit, until one -+sends us to another node, or terminates the process. -+.TP -+(i) -+Consult filters attached to the class. If sent to a leafnode, we are done. -+Otherwise, restart. -+.TP -+(ii) -+Consult the defmap for the priority assigned to this packet, which depends -+on the TOS bits. Check if the referral is leafless, otherwise restart. -+.TP -+(iii) -+Ask the defmap for instructions for the 'best effort' priority. Check the -+answer for leafness, otherwise restart. -+.TP -+(iv) -+If none of the above returned with an instruction, enqueue at this node. -+.P -+This algorithm makes sure that a packet always ends up somewhere, even while -+you are busy building your configuration. -+ -+For more details, see -+.BR tc-cbq-details(8). -+ -+.SH LINK SHARING ALGORITHM -+When dequeuing for sending to the network device, CBQ decides which of its -+classes will be allowed to send. It does so with a Weighted Round Robin process -+in which each class with packets gets a chance to send in turn. The WRR process -+starts by asking the highest priority classes (lowest numerically - -+highest semantically) for packets, and will continue to do so until they -+have no more data to offer, in which case the process repeats for lower -+priorities. -+ -+Classes by default borrow bandwidth from their siblings. A class can be -+prevented from doing so by declaring it 'bounded'. A class can also indicate -+its unwillingness to lend out bandwidth by being 'isolated'. -+ -+.SH QDISC -+The root of a CBQ qdisc class tree has the following parameters: -+ -+.TP -+parent major:minor | root -+This mandatory parameter determines the place of the CBQ instance, either at the -+.B root -+of an interface or within an existing class. -+.TP -+handle major: -+Like all other qdiscs, the CBQ can be assigned a handle. Should consist only -+of a major number, followed by a colon. Optional, but very useful if classes -+will be generated within this qdisc. -+.TP -+allot bytes -+This allotment is the 'chunkiness' of link sharing and is used for determining packet -+transmission time tables. The qdisc allot differs slightly from the class allot discussed -+below. Optional. Defaults to a reasonable value, related to avpkt. -+.TP -+avpkt bytes -+The average size of a packet is needed for calculating maxidle, and is also used -+for making sure 'allot' has a safe value. Mandatory. -+.TP -+bandwidth rate -+To determine the idle time, CBQ must know the bandwidth of your underlying -+physical interface, or parent qdisc. This is a vital parameter, more about it -+later. Mandatory. -+.TP -+cell -+The cell size determines he granularity of packet transmission time calculations. Has a sensible default. -+.TP -+mpu -+A zero sized packet may still take time to transmit. This value is the lower -+cap for packet transmission time calculations - packets smaller than this value -+are still deemed to have this size. Defaults to zero. -+.TP -+ewma log -+When CBQ needs to measure the average idle time, it does so using an -+Exponentially Weighted Moving Average which smoothes out measurements into -+a moving average. The EWMA LOG determines how much smoothing occurs. Lower -+values imply greater sensitivity. Must be between 0 and 31. Defaults -+to 5. -+.P -+A CBQ qdisc does not shape out of its own accord. It only needs to know certain -+parameters about the underlying link. Actual shaping is done in classes. -+ -+.SH CLASSES -+Classes have a host of parameters to configure their operation. -+ -+.TP -+parent major:minor -+Place of this class within the hierarchy. If attached directly to a qdisc -+and not to another class, minor can be omitted. Mandatory. -+.TP -+classid major:minor -+Like qdiscs, classes can be named. The major number must be equal to the -+major number of the qdisc to which it belongs. Optional, but needed if this -+class is going to have children. -+.TP -+weight weight -+When dequeuing to the interface, classes are tried for traffic in a -+round-robin fashion. Classes with a higher configured qdisc will generally -+have more traffic to offer during each round, so it makes sense to allow -+it to dequeue more traffic. All weights under a class are normalized, so -+only the ratios matter. Defaults to the configured rate, unless the priority -+of this class is maximal, in which case it is set to 1. -+.TP -+allot bytes -+Allot specifies how many bytes a qdisc can dequeue -+during each round of the process. This parameter is weighted using the -+renormalized class weight described above. Silently capped at a minimum of -+3/2 avpkt. Mandatory. -+ -+.TP -+prio priority -+In the round-robin process, classes with the lowest priority field are tried -+for packets first. Mandatory. -+ -+.TP -+avpkt -+See the QDISC section. -+ -+.TP -+rate rate -+Maximum rate this class and all its children combined can send at. Mandatory. -+ -+.TP -+bandwidth rate -+This is different from the bandwidth specified when creating a CBQ disc! Only -+used to determine maxidle and offtime, which are only calculated when -+specifying maxburst or minburst. Mandatory if specifying maxburst or minburst. -+ -+.TP -+maxburst -+This number of packets is used to calculate maxidle so that when -+avgidle is at maxidle, this number of average packets can be burst -+before avgidle drops to 0. Set it higher to be more tolerant of -+bursts. You can't set maxidle directly, only via this parameter. -+ -+.TP -+minburst -+As mentioned before, CBQ needs to throttle in case of -+overlimit. The ideal solution is to do so for exactly the calculated -+idle time, and pass 1 packet. However, Unix kernels generally have a -+hard time scheduling events shorter than 10ms, so it is better to -+throttle for a longer period, and then pass minburst packets in one -+go, and then sleep minburst times longer. -+ -+The time to wait is called the offtime. Higher values of minburst lead -+to more accurate shaping in the long term, but to bigger bursts at -+millisecond timescales. Optional. -+ -+.TP -+minidle -+If avgidle is below 0, we are overlimits and need to wait until -+avgidle will be big enough to send one packet. To prevent a sudden -+burst from shutting down the link for a prolonged period of time, -+avgidle is reset to minidle if it gets too low. -+ -+Minidle is specified in negative microseconds, so 10 means that -+avgidle is capped at -10us. Optional. -+ -+.TP -+bounded -+Signifies that this class will not borrow bandwidth from its siblings. -+.TP -+isolated -+Means that this class will not borrow bandwidth to its siblings -+ -+.TP -+split major:minor & defmap bitmap[/bitmap] -+If consulting filters attached to a class did not give a verdict, -+CBQ can also classify based on the packet's priority. There are 16 -+priorities available, numbered from 0 to 15. -+ -+The defmap specifies which priorities this class wants to receive, -+specified as a bitmap. The Least Significant Bit corresponds to priority -+zero. The -+.B split -+parameter tells CBQ at which class the decision must be made, which should -+be a (grand)parent of the class you are adding. -+ -+As an example, 'tc class add ... classid 10:1 cbq .. split 10:0 defmap c0' -+configures class 10:0 to send packets with priorities 6 and 7 to 10:1. -+ -+The complimentary configuration would then -+be: 'tc class add ... classid 10:2 cbq ... split 10:0 defmap 3f' -+Which would send all packets 0, 1, 2, 3, 4 and 5 to 10:1. -+.TP -+estimator interval timeconstant -+CBQ can measure how much bandwidth each class is using, which tc filters -+can use to classify packets with. In order to determine the bandwidth -+it uses a very simple estimator that measures once every -+.B interval -+microseconds how much traffic has passed. This again is a EWMA, for which -+the time constant can be specified, also in microseconds. The -+.B time constant -+corresponds to the sluggishness of the measurement or, conversely, to the -+sensitivity of the average to short bursts. Higher values mean less -+sensitivity. -+ -+.SH BUGS -+The actual bandwidth of the underlying link may not be known, for example -+in the case of PPoE or PPTP connections which in fact may send over a -+pipe, instead of over a physical device. CBQ is quite resilient to major -+errors in the configured bandwidth, probably a the cost of coarser shaping. -+ -+Default kernels rely on coarse timing information for making decisions. These -+may make shaping precise in the long term, but inaccurate on second long scales. -+ -+See -+.BR tc-cbq-details(8) -+for hints on how to improve this. -+ -+.SH SOURCES -+.TP -+o -+Sally Floyd and Van Jacobson, "Link-sharing and Resource -+Management Models for Packet Networks", -+IEEE/ACM Transactions on Networking, Vol.3, No.4, 1995 -+ -+.TP -+o -+Sally Floyd, "Notes on CBQ and Guaranteed Service", 1995 -+ -+.TP -+o -+Sally Floyd, "Notes on Class-Based Queueing: Setting -+Parameters", 1996 -+ -+.TP -+o -+Sally Floyd and Michael Speer, "Experimental Results -+for Class-Based Queueing", 1998, not published. -+ -+ -+ -+.SH SEE ALSO -+.BR tc (8) -+ -+.SH AUTHOR -+Alexey N. Kuznetsov, . This manpage maintained by -+bert hubert -+ -+ -diff -Naur iproute2-orig/debian/manpages/old/tc-htb.8 iproute2/debian/manpages/old/tc-htb.8 ---- iproute2-orig/debian/manpages/old/tc-htb.8 1969-12-31 16:00:00.000000000 -0800 -+++ iproute2/debian/manpages/old/tc-htb.8 2004-05-21 00:09:38.000000000 -0700 -@@ -0,0 +1,150 @@ -+.TH HTB 8 "10 January 2002" "iproute2" "Linux" -+.SH NAME -+HTB \- Hierarchy Token Bucket -+.SH SYNOPSIS -+.B tc qdisc ... dev -+dev -+.B ( parent -+classid -+.B | root) [ handle -+major: -+.B ] htb [ default -+minor-id -+.B ] -+ -+.B tc class ... dev -+dev -+.B parent -+major:[minor] -+.B [ classid -+major:minor -+.B ] htb rate -+rate -+.B [ ceil -+rate -+.B ] burst -+bytes -+.B [ cburst -+bytes -+.B ] [ prio -+priority -+.B ] -+ -+.SH DESCRIPTION -+HTB is meant as a more understandable and intuitive replacement for -+the CBQ qdisc in Linux. Both CBQ and HTB help you to control the use -+of the outbound bandwidth on a given link. Both allow you to use one -+physical link to simulate several slower links and to send different -+kinds of traffic on different simulated links. In both cases, you have -+to specify how to divide the physical link into simulated links and -+how to decide which simulated link to use for a given packet to be sent. -+ -+Unlike CBQ, HTB shapes traffic based on the Token Bucket Filter algorithm -+which does not depend on interface characteristics and so does not need to -+know the underlying bandwidth of the outgoing interface. -+ -+.SH SHAPING ALGORITHM -+Shaping works as documented in -+.B tc-tbf (8). -+ -+.SH CLASSIFICATION -+Within the one HRB instance many classes may exist. Each of these classes -+contains another qdisc, by default -+.BR tc-pfifo (8). -+ -+When enqueueing a packet, HTB starts at the root and uses various methods to -+determine which class should receive the data. -+ -+In the absence of uncommon configuration options, the process is rather easy. -+At each node we look for an instruction, and then go to the class the -+instruction refers us to. If the class found is a barren leaf-node (without -+children), we enqueue the packet there. If it is not yet a leaf node, we do -+the whole thing over again starting from that node. -+ -+The following actions are performed, in order at each node we visit, until one -+sends us to another node, or terminates the process. -+.TP -+(i) -+Consult filters attached to the class. If sent to a leafnode, we are done. -+Otherwise, restart. -+.TP -+(ii) -+If none of the above returned with an instruction, enqueue at this node. -+.P -+This algorithm makes sure that a packet always ends up somewhere, even while -+you are busy building your configuration. -+ -+.SH LINK SHARING ALGORITHM -+FIXME -+ -+.SH QDISC -+The root of a HTB qdisc class tree has the following parameters: -+ -+.TP -+parent major:minor | root -+This mandatory parameter determines the place of the HTB instance, either at the -+.B root -+of an interface or within an existing class. -+.TP -+handle major: -+Like all other qdiscs, the HTB can be assigned a handle. Should consist only -+of a major number, followed by a colon. Optional, but very useful if classes -+will be generated within this qdisc. -+.TP -+default minor-id -+Unclassified traffic gets sent to the class with this minor-id. -+ -+.SH CLASSES -+Classes have a host of parameters to configure their operation. -+ -+.TP -+parent major:minor -+Place of this class within the hierarchy. If attached directly to a qdisc -+and not to another class, minor can be omitted. Mandatory. -+.TP -+classid major:minor -+Like qdiscs, classes can be named. The major number must be equal to the -+major number of the qdisc to which it belongs. Optional, but needed if this -+class is going to have children. -+.TP -+prio priority -+In the round-robin process, classes with the lowest priority field are tried -+for packets first. Mandatory. -+ -+.TP -+rate rate -+Maximum rate this class and all its children are guaranteed. Mandatory. -+ -+.TP -+ceil rate -+Maximum rate at which a class can send, if its parent has bandwidth to spare. -+Defaults to the configured rate, which implies no borrowing -+ -+.TP -+burst bytes -+Amount of bytes that can be burst at -+.B ceil -+speed, in excess of the configured -+.B rate. -+Should be at least as high as the highest burst of all children. -+ -+.TP -+cburst bytes -+Amount of bytes that can be burst at 'infinite' speed, in other words, as fast -+as the interface can transmit them. For perfect evening out, should be equal to at most one average -+packet. Should be at least as high as the highest cburst of all children. -+ -+.SH NOTES -+Due to Unix timing constraints, the maximum ceil rate is not infinite and may in fact be quite low. On Intel, -+there are 100 timer events per second, the maximum rate is that rate at which 'burst' bytes are sent each timer tick. -+From this, the mininum burst size for a specified rate can be calculated. For i386, a 10mbit rate requires a 12 kilobyte -+burst as 100*12kb*8 equals 10mbit. -+ -+.SH SEE ALSO -+.BR tc (8) -+.P -+HTB website: http://luxik.cdi.cz/~devik/qos/htb/ -+.SH AUTHOR -+Martin Devera . This manpage maintained by bert hubert -+ -+ -diff -Naur iproute2-orig/debian/manpages/old/tc-pbfifo.8 iproute2/debian/manpages/old/tc-pbfifo.8 ---- iproute2-orig/debian/manpages/old/tc-pbfifo.8 1969-12-31 16:00:00.000000000 -0800 -+++ iproute2/debian/manpages/old/tc-pbfifo.8 2004-05-21 00:09:38.000000000 -0700 -@@ -0,0 +1,72 @@ -+.TH PBFIFO 8 "10 January 2002" "iproute2" "Linux" -+.SH NAME -+pfifo \- Packet limited First In, First Out queue -+.P -+bfifo \- Byte limited First In, First Out queue -+ -+.SH SYNOPSIS -+.B tc qdisc ... add pfifo -+.B [ limit -+packets -+.B ] -+.P -+.B tc qdisc ... add bfifo -+.B [ limit -+bytes -+.B ] -+ -+.SH DESCRIPTION -+The pfifo and bfifo qdiscs are unadorned First In, First Out queues. They are the -+simplest queues possible and therefore have no overhead. -+.B pfifo -+constrains the queue size as measured in packets. -+.B bfifo -+does so as measured in bytes. -+ -+Like all non-default qdiscs, they maintain statistics. This might be a reason to prefer -+pfifo or bfifo over the default. -+ -+.SH ALGORITHM -+A list of packets is maintained, when a packet is enqueued it gets inserted at the tail of -+a list. When a packet needs to be sent out to the network, it is taken from the head of the list. -+ -+If the list is too long, no further packets are allowed on. This is called 'tail drop'. -+ -+.SH PARAMETERS -+.TP -+limit -+Maximum queue size. Specified in bytes for bfifo, in packets for pfifo. For pfifo, defaults -+to the interface txqueuelen, as specified with -+.BR ifconfig (8) -+or -+.BR ip (8). -+ -+For bfifo, it defaults to the txqueuelen multiplied by the interface MTU. -+ -+.SH OUTPUT -+The output of -+.B tc -s qdisc ls -+contains the limit, either in packets or in bytes, and the number of bytes -+and packets actually sent. An unsent and dropped packet only appears between braces -+and is not counted as 'Sent'. -+ -+In this example, the queue length is 100 packets, 45894 bytes were sent over 681 packets. -+No packets were dropped, and as the pfifo queue does not slow down packets, there were also no -+overlimits: -+.P -+.nf -+# tc -s qdisc ls dev eth0 -+qdisc pfifo 8001: dev eth0 limit 100p -+ Sent 45894 bytes 681 pkts (dropped 0, overlimits 0) -+.fi -+ -+If a backlog occurs, this is displayed as well. -+.SH SEE ALSO -+.BR tc (8) -+ -+.SH AUTHORS -+Alexey N. Kuznetsov, -+ -+This manpage maintained by bert hubert -+ -+ -diff -Naur iproute2-orig/debian/manpages/old/tc-pfifo_fast.8 iproute2/debian/manpages/old/tc-pfifo_fast.8 ---- iproute2-orig/debian/manpages/old/tc-pfifo_fast.8 1969-12-31 16:00:00.000000000 -0800 -+++ iproute2/debian/manpages/old/tc-pfifo_fast.8 2004-05-21 00:09:38.000000000 -0700 -@@ -0,0 +1,59 @@ -+.TH PFIFO_FAST 8 "10 January 2002" "iproute2" "Linux" -+.SH NAME -+pfifo_fast \- three-band first in, first out queue -+ -+.SH DESCRIPTION -+pfifo_fast is the default qdisc of each interface. -+ -+Whenever an interface is created, the pfifo_fast qdisc is automatically used -+as a queue. If another qdisc is attached, it preempts the default -+pfifo_fast, which automatically returns to function when an existing qdisc -+is detached. -+ -+In this sense this qdisc is magic, and unlike other qdiscs. -+ -+.SH ALGORITHM -+The algorithm is very similar to that of the classful -+.BR tc-prio (8) -+qdisc. -+.B pfifo_fast -+is like three -+.BR tc-pfifo (8) -+queues side by side, where packets can be enqueued in any of the three bands -+based on their Type of Service bits or assigned priority. -+ -+Not all three bands are dequeued simultaneously - as long as lower bands -+have traffic, higher bands are never dequeued. This can be used to -+prioritize interactive traffic or penalize 'lowest cost' traffic. -+ -+Each band can be txqueuelen packets long, as configured with -+.BR ifconfig (8) -+or -+.BR ip (8). -+Additional packets coming in are not enqueued but are instead dropped. -+ -+See -+.BR tc-prio (8) -+for complete details on how TOS bits are translated into bands. -+.SH PARAMETERS -+.TP -+txqueuelen -+The length of the three bands depends on the interface txqueuelen, as -+specified with -+.BR ifconfig (8) -+or -+.BR ip (8). -+ -+.SH BUGS -+Does not maintain statistics and does not show up in tc qdisc ls. This is because -+it is the automatic default in the absence of a configured qdisc. -+ -+.SH SEE ALSO -+.BR tc (8) -+ -+.SH AUTHORS -+Alexey N. Kuznetsov, -+ -+This manpage maintained by bert hubert -+ -+ -diff -Naur iproute2-orig/debian/manpages/old/tc-prio.8 iproute2/debian/manpages/old/tc-prio.8 ---- iproute2-orig/debian/manpages/old/tc-prio.8 1969-12-31 16:00:00.000000000 -0800 -+++ iproute2/debian/manpages/old/tc-prio.8 2004-05-21 00:09:38.000000000 -0700 -@@ -0,0 +1,187 @@ -+.TH PRIO 8 "16 December 2001" "iproute2" "Linux" -+.SH NAME -+PRIO \- Priority qdisc -+.SH SYNOPSIS -+.B tc qdisc ... dev -+dev -+.B ( parent -+classid -+.B | root) [ handle -+major: -+.B ] prio [ bands -+bands -+.B ] [ priomap -+band,band,band... -+.B ] [ estimator -+interval timeconstant -+.B ] -+ -+.SH DESCRIPTION -+The PRIO qdisc is a simple classful queueing discipline that contains -+an arbitrary number of classes of differing priority. The classes are -+dequeued in numerical descending order of priority. PRIO is a scheduler -+and never delays packets - it is a work-conserving qdisc, though the qdiscs -+contained in the classes may not be. -+ -+Very useful for lowering latency when there is no need for slowing down -+traffic. -+ -+.SH ALGORITHM -+On creation with 'tc qdisc add', a fixed number of bands is created. Each -+band is a class, although is not possible to add classes with 'tc qdisc -+add', the number of bands to be created must instead be specified on the -+commandline attaching PRIO to its root. -+ -+When dequeueing, band 0 is tried first and only if it did not deliver a -+packet does PRIO try band 1, and so onwards. Maximum reliability packets -+should therefore go to band 0, minimum delay to band 1 and the rest to band -+2. -+ -+As the PRIO qdisc itself will have minor number 0, band 0 is actually -+major:1, band 1 is major:2, etc. For major, substitute the major number -+assigned to the qdisc on 'tc qdisc add' with the -+.B handle -+parameter. -+ -+.SH CLASSIFICATION -+Three methods are available to PRIO to determine in which band a packet will -+be enqueued. -+.TP -+From userspace -+A process with sufficient privileges can encode the destination class -+directly with SO_PRIORITY, see -+.BR tc(7). -+.TP -+with a tc filter -+A tc filter attached to the root qdisc can point traffic directly to a class -+.TP -+with the priomap -+Based on the packet priority, which in turn is derived from the Type of -+Service assigned to the packet. -+.P -+Only the priomap is specific to this qdisc. -+.SH QDISC PARAMETERS -+.TP -+bands -+Number of bands. If changed from the default of 3, -+.B priomap -+must be updated as well. -+.TP -+priomap -+The priomap maps the priority of -+a packet to a class. The priority can either be set directly from userspace, -+or be derived from the Type of Service of the packet. -+ -+Determines how packet priorities, as assigned by the kernel, map to -+bands. Mapping occurs based on the TOS octet of the packet, which looks like -+this: -+ -+.nf -+0 1 2 3 4 5 6 7 -++---+---+---+---+---+---+---+---+ -+| | | | -+|PRECEDENCE | TOS |MBZ| -+| | | | -++---+---+---+---+---+---+---+---+ -+.fi -+ -+The four TOS bits (the 'TOS field') are defined as: -+ -+.nf -+Binary Decimcal Meaning -+----------------------------------------- -+1000 8 Minimize delay (md) -+0100 4 Maximize throughput (mt) -+0010 2 Maximize reliability (mr) -+0001 1 Minimize monetary cost (mmc) -+0000 0 Normal Service -+.fi -+ -+As there is 1 bit to the right of these four bits, the actual value of the -+TOS field is double the value of the TOS bits. Tcpdump -v -v shows you the -+value of the entire TOS field, not just the four bits. It is the value you -+see in the first column of this table: -+ -+.nf -+TOS Bits Means Linux Priority Band -+------------------------------------------------------------ -+0x0 0 Normal Service 0 Best Effort 1 -+0x2 1 Minimize Monetary Cost 1 Filler 2 -+0x4 2 Maximize Reliability 0 Best Effort 1 -+0x6 3 mmc+mr 0 Best Effort 1 -+0x8 4 Maximize Throughput 2 Bulk 2 -+0xa 5 mmc+mt 2 Bulk 2 -+0xc 6 mr+mt 2 Bulk 2 -+0xe 7 mmc+mr+mt 2 Bulk 2 -+0x10 8 Minimize Delay 6 Interactive 0 -+0x12 9 mmc+md 6 Interactive 0 -+0x14 10 mr+md 6 Interactive 0 -+0x16 11 mmc+mr+md 6 Interactive 0 -+0x18 12 mt+md 4 Int. Bulk 1 -+0x1a 13 mmc+mt+md 4 Int. Bulk 1 -+0x1c 14 mr+mt+md 4 Int. Bulk 1 -+0x1e 15 mmc+mr+mt+md 4 Int. Bulk 1 -+.fi -+ -+The second column contains the value of the relevant -+four TOS bits, followed by their translated meaning. For example, 15 stands -+for a packet wanting Minimal Montetary Cost, Maximum Reliability, Maximum -+Throughput AND Minimum Delay. -+ -+The fourth column lists the way the Linux kernel interprets the TOS bits, by -+showing to which Priority they are mapped. -+ -+The last column shows the result of the default priomap. On the commandline, -+the default priomap looks like this: -+ -+ 1, 2, 2, 2, 1, 2, 0, 0 , 1, 1, 1, 1, 1, 1, 1, 1 -+ -+This means that priority 4, for example, gets mapped to band number 1. -+The priomap also allows you to list higher priorities (> 7) which do not -+correspond to TOS mappings, but which are set by other means. -+ -+This table from RFC 1349 (read it for more details) explains how -+applications might very well set their TOS bits: -+ -+.nf -+TELNET 1000 (minimize delay) -+FTP -+ Control 1000 (minimize delay) -+ Data 0100 (maximize throughput) -+ -+TFTP 1000 (minimize delay) -+ -+SMTP -+ Command phase 1000 (minimize delay) -+ DATA phase 0100 (maximize throughput) -+ -+Domain Name Service -+ UDP Query 1000 (minimize delay) -+ TCP Query 0000 -+ Zone Transfer 0100 (maximize throughput) -+ -+NNTP 0001 (minimize monetary cost) -+ -+ICMP -+ Errors 0000 -+ Requests 0000 (mostly) -+ Responses (mostly) -+.fi -+ -+ -+.SH CLASSES -+PRIO classes cannot be configured further - they are automatically created -+when the PRIO qdisc is attached. Each class however can contain yet a -+further qdisc. -+ -+.SH BUGS -+Large amounts of traffic in the lower bands can cause starvation of higher -+bands. Can be prevented by attaching a shaper (for example, -+.BR tc-tbf(8) -+to these bands to make sure they cannot dominate the link. -+ -+.SH AUTHORS -+Alexey N. Kuznetsov, , J Hadi Salim -+. This manpage maintained by bert hubert -+ -+ -diff -Naur iproute2-orig/debian/manpages/old/tc-red.8 iproute2/debian/manpages/old/tc-red.8 ---- iproute2-orig/debian/manpages/old/tc-red.8 1969-12-31 16:00:00.000000000 -0800 -+++ iproute2/debian/manpages/old/tc-red.8 2004-05-21 00:09:38.000000000 -0700 -@@ -0,0 +1,131 @@ -+.TH RED 8 "13 December 2001" "iproute2" "Linux" -+.SH NAME -+red \- Random Early Detection -+.SH SYNOPSIS -+.B tc qdisc ... red -+.B limit -+bytes -+.B min -+bytes -+.B max -+bytes -+.B avpkt -+bytes -+.B burst -+packets -+.B [ ecn ] [ bandwidth -+rate -+.B ] probability -+chance -+ -+.SH DESCRIPTION -+Random Early Detection is a classless qdisc which manages its queue size -+smartly. Regular queues simply drop packets from the tail when they are -+full, which may not be the optimal behaviour. RED also performs tail drop, -+but does so in a more gradual way. -+ -+Once the queue hits a certain average length, packets enqueued have a -+configurable chance of being marked (which may mean dropped). This chance -+increases linearly up to a point called the -+.B max -+average queue length, although the queue might get bigger. -+ -+This has a host of benefits over simple taildrop, while not being processor -+intensive. It prevents synchronous retransmits after a burst in traffic, -+which cause further retransmits, etc. -+ -+The goal is the have a small queue size, which is good for interactivity -+while not disturbing TCP/IP traffic with too many sudden drops after a burst -+of traffic. -+ -+Depending on if ECN is configured, marking either means dropping or -+purely marking a packet as overlimit. -+.SH ALGORITHM -+The average queue size is used for determining the marking -+probability. This is calculated using an Exponential Weighted Moving -+Average, which can be more or less sensitive to bursts. -+ -+When the average queue size is below -+.B min -+bytes, no packet will ever be marked. When it exceeds -+.B min, -+the probability of doing so climbs linearly up -+to -+.B probability, -+until the average queue size hits -+.B max -+bytes. Because -+.B probability -+is normally not set to 100%, the queue size might -+conceivably rise above -+.B max -+bytes, so the -+.B limit -+parameter is provided to set a hard maximum for the size of the queue. -+ -+.SH PARAMETERS -+.TP -+min -+Average queue size at which marking becomes a possibility. -+.TP -+max -+At this average queue size, the marking probability is maximal. Should be at -+least twice -+.B min -+to prevent synchronous retransmits, higher for low -+.B min. -+.TP -+probability -+Maximum probability for marking, specified as a floating point -+number from 0.0 to 1.0. Suggested values are 0.01 or 0.02 (1 or 2%, -+respectively). -+.TP -+limit -+Hard limit on the real (not average) queue size in bytes. Further packets -+are dropped. Should be set higher than max+burst. It is advised to set this -+a few times higher than -+.B max. -+.TP -+burst -+Used for determining how fast the average queue size is influenced by the -+real queue size. Larger values make the calculation more sluggish, allowing -+longer bursts of traffic before marking starts. Real life experiments -+support the following guideline: (min+min+max)/(3*avpkt). -+.TP -+avpkt -+Specified in bytes. Used with burst to determine the time constant for -+average queue size calculations. 1000 is a good value. -+.TP -+bandwidth -+This rate is used for calculating the average queue size after some -+idle time. Should be set to the bandwidth of your interface. Does not mean -+that RED will shape for you! Optional. -+.TP -+ecn -+As mentioned before, RED can either 'mark' or 'drop'. Explicit Congestion -+Notification allows RED to notify remote hosts that their rate exceeds the -+amount of bandwidth available. Non-ECN capable hosts can only be notified by -+dropping a packet. If this parameter is specified, packets which indicate -+that their hosts honor ECN will only be marked and not dropped, unless the -+queue size hits -+.B limit -+bytes. Needs a tc binary with RED support compiled in. Recommended. -+ -+.SH SEE ALSO -+.BR tc (8) -+ -+.SH SOURCES -+.TP -+o -+Floyd, S., and Jacobson, V., Random Early Detection gateways for -+Congestion Avoidance. http://www.aciri.org/floyd/papers/red/red.html -+.TP -+o -+Some changes to the algorithm by Alexey N. Kuznetsov. -+ -+.SH AUTHORS -+Alexey N. Kuznetsov, , Alexey Makarenko -+, J Hadi Salim . -+This manpage maintained by bert hubert -+ -+ -diff -Naur iproute2-orig/debian/manpages/old/tc-sfq.8 iproute2/debian/manpages/old/tc-sfq.8 ---- iproute2-orig/debian/manpages/old/tc-sfq.8 1969-12-31 16:00:00.000000000 -0800 -+++ iproute2/debian/manpages/old/tc-sfq.8 2004-05-21 00:09:38.000000000 -0700 -@@ -0,0 +1,107 @@ -+.TH TC 8 "8 December 2001" "iproute2" "Linux" -+.SH NAME -+sfq \- Stochastic Fairness Queueing -+.SH SYNOPSIS -+.B tc qdisc ... perturb -+seconds -+.B quantum -+bytes -+ -+.SH DESCRIPTION -+ -+Stochastic Fairness Queueing is a classless queueing discipline available for -+traffic control with the -+.BR tc (8) -+command. -+ -+SFQ does not shape traffic but only schedules the transmission of packets, based on 'flows'. -+The goal is to ensure fairness so that each flow is able to send data in turn, thus preventing -+any single flow from drowning out the rest. -+ -+This may in fact have some effect in mitigating a Denial of Service attempt. -+ -+SFQ is work-conserving and therefore always delivers a packet if it has one available. -+.SH ALGORITHM -+On enqueueing, each packet is assigned to a hash bucket, based on -+.TP -+(i) -+Source address -+.TP -+(ii) -+Destination address -+.TP -+(iii) -+Source port -+.P -+If these are available. SFQ knows about ipv4 and ipv6 and also UDP, TCP and ESP. -+Packets with other protocols are hashed based on the 32bits representation of their -+destination and the socket they belong to. A flow corresponds mostly to a TCP/IP -+connection. -+ -+Each of these buckets should represent a unique flow. Because multiple flows may -+get hashed to the same bucket, the hashing algorithm is perturbed at configurable -+intervals so that the unfairness lasts only for a short while. Perturbation may -+however cause some inadvertent packet reordering to occur. -+ -+When dequeuing, each hashbucket with data is queried in a round robin fashion. -+ -+The compile time maximum length of the SFQ is 128 packets, which can be spread over -+at most 128 buckets of 1024 available. In case of overflow, tail-drop is performed -+on the fullest bucket, thus maintaining fairness. -+ -+.SH PARAMETERS -+.TP -+perturb -+Interval in seconds for queue algorithm perturbation. Defaults to 0, which means that -+no perturbation occurs. Do not set too low for each perturbation may cause some packet -+reordering. Advised value: 10 -+.TP -+quantum -+Amount of bytes a flow is allowed to dequeue during a round of the round robin process. -+Defaults to the MTU of the interface which is also the advised value and the minimum value. -+ -+.SH EXAMPLE & USAGE -+ -+To attach to device ppp0: -+.P -+# tc qdisc add dev ppp0 root sfq perturb 10 -+.P -+Please note that SFQ, like all non-shaping (work-conserving) qdiscs, is only useful -+if it owns the queue. -+This is the case when the link speed equals the actually available bandwidth. This holds -+for regular phone modems, ISDN connections and direct non-switched ethernet links. -+.P -+Most often, cable modems and DSL devices do not fall into this category. The same holds -+for when connected to a switch and trying to send data to a congested segment also -+connected to the switch. -+.P -+In this case, the effective queue does not reside within Linux and is therefore not -+available for scheduling. -+.P -+Embed SFQ in a classful qdisc to make sure it owns the queue. -+ -+.SH SOURCE -+.TP -+o -+Paul E. McKenney "Stochastic Fairness Queuing", -+IEEE INFOCOMM'90 Proceedings, San Francisco, 1990. -+ -+.TP -+o -+Paul E. McKenney "Stochastic Fairness Queuing", -+"Interworking: Research and Experience", v.2, 1991, p.113-131. -+ -+.TP -+o -+See also: -+M. Shreedhar and George Varghese "Efficient Fair -+Queuing using Deficit Round Robin", Proc. SIGCOMM 95. -+ -+.SH SEE ALSO -+.BR tc (8) -+ -+.SH AUTHOR -+Alexey N. Kuznetsov, . This manpage maintained by -+bert hubert -+ -+ -diff -Naur iproute2-orig/debian/manpages/old/tc-tbf.8 iproute2/debian/manpages/old/tc-tbf.8 ---- iproute2-orig/debian/manpages/old/tc-tbf.8 1969-12-31 16:00:00.000000000 -0800 -+++ iproute2/debian/manpages/old/tc-tbf.8 2004-05-21 00:09:38.000000000 -0700 -@@ -0,0 +1,138 @@ -+.TH TC 8 "13 December 2001" "iproute2" "Linux" -+.SH NAME -+tbf \- Token Bucket Filter -+.SH SYNOPSIS -+.B tc qdisc ... tbf rate -+rate -+.B burst -+bytes/cell -+.B ( latency -+ms -+.B | limit -+bytes -+.B ) [ mpu -+bytes -+.B [ peakrate -+rate -+.B mtu -+bytes/cell -+.B ] ] -+.P -+burst is also known as buffer and maxburst. mtu is also known as minburst. -+.SH DESCRIPTION -+ -+The Token Bucket Filter is a classless queueing discipline available for -+traffic control with the -+.BR tc (8) -+command. -+ -+TBF is a pure shaper and never schedules traffic. It is non-work-conserving and may throttle -+itself, although packets are available, to ensure that the configured rate is not exceeded. -+On all platforms except for Alpha, -+it is able to shape up to 1mbit/s of normal traffic with ideal minimal burstiness, -+sending out data exactly at the configured rates. -+ -+Much higher rates are possible but at the cost of losing the minimal burstiness. In that -+case, data is on average dequeued at the configured rate but may be sent much faster at millisecond -+timescales. Because of further queues living in network adaptors, this is often not a problem. -+ -+Kernels with a higher 'HZ' can achieve higher rates with perfect burstiness. On Alpha, HZ is ten -+times higher, leading to a 10mbit/s limit to perfection. These calculations hold for packets of on -+average 1000 bytes. -+ -+.SH ALGORITHM -+As the name implies, traffic is filtered based on the expenditure of -+.B tokens. -+Tokens roughly correspond to bytes, with the additional constraint that each packet consumes -+some tokens, no matter how small it is. This reflects the fact that even a zero-sized packet occupies -+the link for some time. -+ -+On creation, the TBF is stocked with tokens which correspond to the amount of traffic that can be burst -+in one go. Tokens arrive at a steady rate, until the bucket is full. -+ -+If no tokens are available, packets are queued, up to a configured limit. The TBF now -+calculates the token deficit, and throttles until the first packet in the queue can be sent. -+ -+If it is not acceptable to burst out packets at maximum speed, a peakrate can be configured -+to limit the speed at which the bucket empties. This peakrate is implemented as a second TBF -+with a very small bucket, so that it doesn't burst. -+ -+To achieve perfection, the second bucket may contain only a single packet, which leads to -+the earlier mentioned 1mbit/s limit. -+ -+This limit is caused by the fact that the kernel can only throttle for at minimum 1 'jiffy', which depends -+on HZ as 1/HZ. For perfect shaping, only a single packet can get sent per jiffy - for HZ=100, this means 100 -+packets of on average 1000 bytes each, which roughly corresponds to 1mbit/s. -+ -+.SH PARAMETERS -+See -+.BR tc (8) -+for how to specify the units of these values. -+.TP -+limit or latency -+Limit is the number of bytes that can be queued waiting for tokens to become -+available. You can also specify this the other way around by setting the -+latency parameter, which specifies the maximum amount of time a packet can -+sit in the TBF. The latter calculation takes into account the size of the -+bucket, the rate and possibly the peakrate (if set). These two parameters -+are mutually exclusive. -+.TP -+burst -+Also known as buffer or maxburst. -+Size of the bucket, in bytes. This is the maximum amount of bytes that tokens can be available for instantaneously. -+In general, larger shaping rates require a larger buffer. For 10mbit/s on Intel, you need at least 10kbyte buffer -+if you want to reach your configured rate! -+ -+If your buffer is too small, packets may be dropped because more tokens arrive per timer tick than fit in your bucket. -+The minimum buffer size can be calculated by dividing the rate by HZ. -+ -+Token usage calculations are performed using a table which by default has a resolution of 8 packets. -+This resolution can be changed by specifying the -+.B cell -+size with the burst. For example, to specify a 6000 byte buffer with a 16 -+byte cell size, set a burst of 6000/16. You will probably never have to set -+this. Must be an integral power of 2. -+.TP -+mpu -+A zero-sized packet does not use zero bandwidth. For ethernet, no packet uses less than 64 bytes. The Minimum Packet Unit -+determines the minimal token usage (specified in bytes) for a packet. Defaults to zero. -+.TP -+rate -+The speed knob. See remarks above about limits! See -+.BR tc (8) -+for units. -+.PP -+Furthermore, if a peakrate is desired, the following parameters are available: -+ -+.TP -+peakrate -+Maximum depletion rate of the bucket. Limited to 1mbit/s on Intel, 10mbit/s on Alpha. The peakrate does -+not need to be set, it is only necessary if perfect millisecond timescale shaping is required. -+ -+.TP -+mtu/minburst -+Specifies the size of the peakrate bucket. For perfect accuracy, should be set to the MTU of the interface. -+If a peakrate is needed, but some burstiness is acceptable, this size can be raised. A 3000 byte minburst -+allows around 3mbit/s of peakrate, given 1000 byte packets. -+ -+Like the regular burstsize you can also specify a -+.B cell -+size. -+.SH EXAMPLE & USAGE -+ -+To attach a TBF with a sustained maximum rate of 0.5mbit/s, a peakrate of 1.0mbit/s, -+a 5kilobyte buffer, with a pre-bucket queue size limit calculated so the TBF causes -+at most 70ms of latency, with perfect peakrate behaviour, issue: -+.P -+# tc qdisc add dev eth0 root tbf rate 0.5mbit \\ -+ burst 5kb latency 70ms peakrate 1mbit \\ -+ minburst 1540 -+ -+.SH SEE ALSO -+.BR tc (8) -+ -+.SH AUTHOR -+Alexey N. Kuznetsov, . This manpage maintained by -+bert hubert -+ -+ -diff -Naur iproute2-orig/debian/manpages/old/tc.8 iproute2/debian/manpages/old/tc.8 ---- iproute2-orig/debian/manpages/old/tc.8 1969-12-31 16:00:00.000000000 -0800 -+++ iproute2/debian/manpages/old/tc.8 2004-05-21 00:09:38.000000000 -0700 -@@ -0,0 +1,348 @@ -+.TH TC 8 "16 December 2001" "iproute2" "Linux" -+.SH NAME -+tc \- show / manipulate traffic control settings -+.SH SYNOPSIS -+.B tc qdisc [ add | change | replace | link ] dev -+DEV -+.B -+[ parent -+qdisc-id -+.B | root ] -+.B [ handle -+qdisc-id ] qdisc -+[ qdisc specific parameters ] -+.P -+ -+.B tc class [ add | change | replace ] dev -+DEV -+.B parent -+qdisc-id -+.B [ classid -+class-id ] qdisc -+[ qdisc specific parameters ] -+.P -+ -+.B tc filter [ add | change | replace ] dev -+DEV -+.B [ parent -+qdisc-id -+.B | root ] protocol -+protocol -+.B prio -+priority filtertype -+[ filtertype specific parameters ] -+.B flowid -+flow-id -+ -+.B tc [-s | -d ] qdisc show [ dev -+DEV -+.B ] -+.P -+.B tc [-s | -d ] class show dev -+DEV -+.P -+.B tc filter show dev -+DEV -+ -+.SH DESCRIPTION -+.B Tc -+is used to configure Traffic Control in the Linux kernel. Traffic Control consists -+of the following: -+ -+.TP -+SHAPING -+When traffic is shaped, its rate of transmission is under control. Shaping may -+be more than lowering the available bandwidth - it is also used to smooth out -+bursts in traffic for better network behaviour. Shaping occurs on egress. -+ -+.TP -+SCHEDULING -+By scheduling the transmission of packets it is possible to improve interactivity -+for traffic that needs it while still guaranteeing bandwidth to bulk transfers. Reordering -+is also called prioritizing, and happens only on egress. -+ -+.TP -+POLICING -+Where shaping deals with transmission of traffic, policing pertains to traffic -+arriving. Policing thus occurs on ingress. -+ -+.TP -+DROPPING -+Traffic exceeding a set bandwidth may also be dropped forthwith, both on -+ingress and on egress. -+ -+.P -+Processing of traffic is controlled by three kinds of objects: qdiscs, -+classes and filters. -+ -+.SH QDISCS -+.B qdisc -+is short for 'queueing discipline' and it is elementary to -+understanding traffic control. Whenever the kernel needs to send a -+packet to an interface, it is -+.B enqueued -+to the qdisc configured for that interface. Immediately afterwards, the kernel -+tries to get as many packets as possible from the qdisc, for giving them -+to the network adaptor driver. -+ -+A simple QDISC is the 'pfifo' one, which does no processing at all and is a pure -+First In, First Out queue. It does however store traffic when the network interface -+can't handle it momentarily. -+ -+.SH CLASSES -+Some qdiscs can contain classes, which contain further qdiscs - traffic may -+then be enqueued in any of the inner qdiscs, which are within the -+.B classes. -+When the kernel tries to dequeue a packet from such a -+.B classful qdisc -+it can come from any of the classes. A qdisc may for example prioritize -+certain kinds of traffic by trying to dequeue from certain classes -+before others. -+ -+.SH FILTERS -+A -+.B filter -+is used by a classful qdisc to determine in which class a packet will -+be enqueued. Whenever traffic arrives at a class with subclasses, it needs -+to be classified. Various methods may be employed to do so, one of these -+are the filters. All filters attached to the class are called, until one of -+them returns with a verdict. If no verdict was made, other criteria may be -+available. This differs per qdisc. -+ -+It is important to notice that filters reside -+.B within -+qdiscs - they are not masters of what happens. -+ -+.SH CLASSLESS QDISCS -+The classless qdiscs are: -+.TP -+[p|b]fifo -+Simplest usable qdisc, pure First In, First Out behaviour. Limited in -+packets or in bytes. -+.TP -+pfifo_fast -+Standard qdisc for 'Advanced Router' enabled kernels. Consists of a three-band -+queue which honors Type of Service flags, as well as the priority that may be -+assigned to a packet. -+.TP -+red -+Random Early Detection simulates physical congestion by randomly dropping -+packets when nearing configured bandwidth allocation. Well suited to very -+large bandwidth applications. -+.TP -+sfq -+Stochastic Fairness Queueing reorders queued traffic so each 'session' -+gets to send a packet in turn. -+.TP -+tbf -+The Token Bucket Filter is suited for slowing traffic down to a precisely -+configured rate. Scales well to large bandwidths. -+.SH CONFIGURING CLASSLESS QDISCS -+In the absence of classful qdiscs, classless qdiscs can only be attached at -+the root of a device. Full syntax: -+.P -+.B tc qdisc add dev -+DEV -+.B root -+QDISC QDISC-PARAMETERS -+ -+To remove, issue -+.P -+.B tc qdisc del dev -+DEV -+.B root -+ -+The -+.B pfifo_fast -+qdisc is the automatic default in the absence of a configured qdisc. -+ -+.SH CLASSFUL QDISCS -+The classful qdiscs are: -+.TP -+CBQ -+Class Based Queueing implements a rich linksharing hierarchy of classes. -+It contains shaping elements as well as prioritizing capabilities. Shaping is -+performed using link idle time calculations based on average packet size and -+underlying link bandwidth. The latter may be ill-defined for some interfaces. -+.TP -+HTB -+The Hierarchy Token Bucket implements a rich linksharing hierarchy of -+classes with an emphasis on conforming to existing practices. HTB facilitates -+guaranteeing bandwidth to classes, while also allowing specification of upper -+limits to inter-class sharing. It contains shaping elements, based on TBF and -+can prioritize classes. -+.TP -+PRIO -+The PRIO qdisc is a non-shaping container for a configurable number of -+classes which are dequeued in order. This allows for easy prioritization -+of traffic, where lower classes are only able to send if higher ones have -+no packets available. To facilitate configuration, Type Of Service bits are -+honored by default. -+.SH THEORY OF OPERATION -+Classes form a tree, where each class has a single parent. -+A class may have multiple children. Some qdiscs allow for runtime addition -+of classes (CBQ, HTB) while others (PRIO) are created with a static number of -+children. -+ -+Qdiscs which allow dynamic addition of classes can have zero or more -+subclasses to which traffic may be enqueued. -+ -+Furthermore, each class contains a -+.B leaf qdisc -+which by default has -+.B pfifo -+behaviour though another qdisc can be attached in place. This qdisc may again -+contain classes, but each class can have only one leaf qdisc. -+ -+When a packet enters a classful qdisc it can be -+.B classified -+to one of the classes within. Three criteria are available, although not all -+qdiscs will use all three: -+.TP -+tc filters -+If tc filters are attached to a class, they are consulted first -+for relevant instructions. Filters can match on all fields of a packet header, -+as well as on the firewall mark applied by ipchains or iptables. See -+.BR tc-filters (8). -+.TP -+Type of Service -+Some qdiscs have built in rules for classifying packets based on the TOS field. -+.TP -+skb->priority -+Userspace programs can encode a class-id in the 'skb->priority' field using -+the SO_PRIORITY option. -+.P -+Each node within the tree can have its own filters but higher level filters -+may also point directly to lower classes. -+ -+If classification did not succeed, packets are enqueued to the leaf qdisc -+attached to that class. Check qdisc specific manpages for details, however. -+ -+.SH NAMING -+All qdiscs, classes and filters have IDs, which can either be specified -+or be automatically assigned. -+ -+IDs consist of a major number and a minor number, separated by a colon. -+ -+.TP -+QDISCS -+A qdisc, which potentially can have children, -+gets assigned a major number, called a 'handle', leaving the minor -+number namespace available for classes. The handle is expressed as '10:'. -+It is customary to explicitly assign a handle to qdiscs expected to have -+children. -+ -+.TP -+CLASSES -+Classes residing under a qdisc share their qdisc major number, but each have -+a separate minor number called a 'classid' that has no relation to their -+parent classes, only to their parent qdisc. The same naming custom as for -+qdiscs applies. -+ -+.TP -+FILTERS -+Filters have a three part ID, which is only needed when using a hashed -+filter hierarchy, for which see -+.BR tc-filters (8). -+.SH UNITS -+All parameters accept a floating point number, possibly followed by a unit. -+.P -+Bandwidths or rates can be specified in: -+.TP -+kbps -+Kilobytes per second -+.TP -+mbps -+Megabytes per second -+.TP -+kbit -+Kilobits per second -+.TP -+mbit -+Megabits per second -+.TP -+bps or a bare number -+Bytes per second -+.P -+Amounts of data can be specified in: -+.TP -+kb or k -+Kilobytes -+.TP -+mb or m -+Megabytes -+.TP -+mbit -+Megabits -+.TP -+kbit -+Kilobits -+.TP -+b or a bare number -+Bytes. -+.P -+Lengths of time can be specified in: -+.TP -+s, sec or secs -+Whole seconds -+.TP -+ms, msec or msecs -+Milliseconds -+.TP -+us, usec, usecs or a bare number -+Microseconds. -+ -+.SH TC COMMANDS -+The following commands are available for qdiscs, classes and filter: -+.TP -+add -+Add a qdisc, class or filter to a node. For all entities, a -+.B parent -+must be passed, either by passing its ID or by attaching directly to the root of a device. -+When creating a qdisc or a filter, it can be named with the -+.B handle -+parameter. A class is named with the -+.B classid -+parameter. -+ -+.TP -+remove -+A qdisc can be removed by specifying its handle, which may also be 'root'. All subclasses and their leaf qdiscs -+are automatically deleted, as well as any filters attached to them. -+ -+.TP -+change -+Some entities can be modified 'in place'. Shares the syntax of 'add', with the exception -+that the handle cannot be changed and neither can the parent. In other words, -+.B -+change -+cannot move a node. -+ -+.TP -+replace -+Performs a nearly atomic remove/add on an existing node id. If the node does not exist yet -+it is created. -+ -+.TP -+link -+Only available for qdiscs and performs a replace where the node -+must exist already. -+ -+ -+.SH HISTORY -+.B tc -+was written by Alexey N. Kuznetsov and added in Linux 2.2. -+.SH SEE ALSO -+.BR tc-cbq (8), -+.BR tc-htb (8), -+.BR tc-sfq (8), -+.BR tc-red (8), -+.BR tc-tbf (8), -+.BR tc-pfifo (8), -+.BR tc-bfifo (8), -+.BR tc-pfifo_fast (8), -+.BR tc-filters (8) -+ -+.SH AUTHOR -+Manpage maintained by bert hubert (ahu@ds9a.nl) -+ -diff -Naur iproute2-orig/debian/manpages/tc-cbq-details.8 iproute2/debian/manpages/tc-cbq-details.8 ---- iproute2-orig/debian/manpages/tc-cbq-details.8 1969-12-31 16:00:00.000000000 -0800 -+++ iproute2/debian/manpages/tc-cbq-details.8 2004-05-21 00:09:38.000000000 -0700 -@@ -0,0 +1,425 @@ -+.TH CBQ 8 "8 December 2001" "iproute2" "Linux" -+.SH NAME -+CBQ \- Class Based Queueing -+.SH SYNOPSIS -+.B tc qdisc ... dev -+dev -+.B ( parent -+classid -+.B | root) [ handle -+major: -+.B ] cbq avpkt -+bytes -+.B bandwidth -+rate -+.B [ cell -+bytes -+.B ] [ ewma -+log -+.B ] [ mpu -+bytes -+.B ] -+ -+.B tc class ... dev -+dev -+.B parent -+major:[minor] -+.B [ classid -+major:minor -+.B ] cbq allot -+bytes -+.B [ bandwidth -+rate -+.B ] [ rate -+rate -+.B ] prio -+priority -+.B [ weight -+weight -+.B ] [ minburst -+packets -+.B ] [ maxburst -+packets -+.B ] [ ewma -+log -+.B ] [ cell -+bytes -+.B ] avpkt -+bytes -+.B [ mpu -+bytes -+.B ] [ bounded isolated ] [ split -+handle -+.B & defmap -+defmap -+.B ] [ estimator -+interval timeconstant -+.B ] -+ -+.SH DESCRIPTION -+Class Based Queueing is a classful qdisc that implements a rich -+linksharing hierarchy of classes. It contains shaping elements as -+well as prioritizing capabilities. Shaping is performed using link -+idle time calculations based on the timing of dequeue events and -+underlying link bandwidth. -+ -+.SH SHAPING ALGORITHM -+Shaping is done using link idle time calculations, and actions taken if -+these calculations deviate from set limits. -+ -+When shaping a 10mbit/s connection to 1mbit/s, the link will -+be idle 90% of the time. If it isn't, it needs to be throttled so that it -+IS idle 90% of the time. -+ -+From the kernel's perspective, this is hard to measure, so CBQ instead -+derives the idle time from the number of microseconds (in fact, jiffies) -+that elapse between requests from the device driver for more data. Combined -+with the knowledge of packet sizes, this is used to approximate how full or -+empty the link is. -+ -+This is rather circumspect and doesn't always arrive at proper -+results. For example, what is the actual link speed of an interface -+that is not really able to transmit the full 100mbit/s of data, -+perhaps because of a badly implemented driver? A PCMCIA network card -+will also never achieve 100mbit/s because of the way the bus is -+designed - again, how do we calculate the idle time? -+ -+The physical link bandwidth may be ill defined in case of not-quite-real -+network devices like PPP over Ethernet or PPTP over TCP/IP. The effective -+bandwidth in that case is probably determined by the efficiency of pipes -+to userspace - which not defined. -+ -+During operations, the effective idletime is measured using an -+exponential weighted moving average (EWMA), which considers recent -+packets to be exponentially more important than past ones. The Unix -+loadaverage is calculated in the same way. -+ -+The calculated idle time is subtracted from the EWMA measured one, -+the resulting number is called 'avgidle'. A perfectly loaded link has -+an avgidle of zero: packets arrive exactly at the calculated -+interval. -+ -+An overloaded link has a negative avgidle and if it gets too negative, -+CBQ throttles and is then 'overlimit'. -+ -+Conversely, an idle link might amass a huge avgidle, which would then -+allow infinite bandwidths after a few hours of silence. To prevent -+this, avgidle is capped at -+.B maxidle. -+ -+If overlimit, in theory, the CBQ could throttle itself for exactly the -+amount of time that was calculated to pass between packets, and then -+pass one packet, and throttle again. Due to timer resolution constraints, -+this may not be feasible, see the -+.B minburst -+parameter below. -+ -+.SH CLASSIFICATION -+Within the one CBQ instance many classes may exist. Each of these classes -+contains another qdisc, by default -+.BR tc-pfifo (8). -+ -+When enqueueing a packet, CBQ starts at the root and uses various methods to -+determine which class should receive the data. If a verdict is reached, this -+process is repeated for the recipient class which might have further -+means of classifying traffic to its children, if any. -+ -+CBQ has the following methods available to classify a packet to any child -+classes. -+.TP -+(i) -+.B skb->priority class encoding. -+Can be set from userspace by an application with the -+.B SO_PRIORITY -+setsockopt. -+The -+.B skb->priority class encoding -+only applies if the skb->priority holds a major:minor handle of an existing -+class within this qdisc. -+.TP -+(ii) -+tc filters attached to the class. -+.TP -+(iii) -+The defmap of a class, as set with the -+.B split & defmap -+parameters. The defmap may contain instructions for each possible Linux packet -+priority. -+ -+.P -+Each class also has a -+.B level. -+Leaf nodes, attached to the bottom of the class hierarchy, have a level of 0. -+.SH CLASSIFICATION ALGORITHM -+ -+Classification is a loop, which terminates when a leaf class is found. At any -+point the loop may jump to the fallback algorithm. -+ -+The loop consists of the following steps: -+.TP -+(i) -+If the packet is generated locally and has a valid classid encoded within its -+.B skb->priority, -+choose it and terminate. -+ -+.TP -+(ii) -+Consult the tc filters, if any, attached to this child. If these return -+a class which is not a leaf class, restart loop from the class returned. -+If it is a leaf, choose it and terminate. -+.TP -+(iii) -+If the tc filters did not return a class, but did return a classid, -+try to find a class with that id within this qdisc. -+Check if the found class is of a lower -+.B level -+than the current class. If so, and the returned class is not a leaf node, -+restart the loop at the found class. If it is a leaf node, terminate. -+If we found an upward reference to a higher level, enter the fallback -+algorithm. -+.TP -+(iv) -+If the tc filters did not return a class, nor a valid reference to one, -+consider the minor number of the reference to be the priority. Retrieve -+a class from the defmap of this class for the priority. If this did not -+contain a class, consult the defmap of this class for the -+.B BEST_EFFORT -+class. If this is an upward reference, or no -+.B BEST_EFFORT -+class was defined, -+enter the fallback algorithm. If a valid class was found, and it is not a -+leaf node, restart the loop at this class. If it is a leaf, choose it and -+terminate. If -+neither the priority distilled from the classid, nor the -+.B BEST_EFFORT -+priority yielded a class, enter the fallback algorithm. -+.P -+The fallback algorithm resides outside of the loop and is as follows. -+.TP -+(i) -+Consult the defmap of the class at which the jump to fallback occured. If -+the defmap contains a class for the -+.B -+priority -+of the class (which is related to the TOS field), choose this class and -+terminate. -+.TP -+(ii) -+Consult the map for a class for the -+.B BEST_EFFORT -+priority. If found, choose it, and terminate. -+.TP -+(iii) -+Choose the class at which break out to the fallback algorithm occured. Terminate. -+.P -+The packet is enqueued to the class which was chosen when either algorithm -+terminated. It is therefore possible for a packet to be enqueued *not* at a -+leaf node, but in the middle of the hierarchy. -+ -+.SH LINK SHARING ALGORITHM -+When dequeuing for sending to the network device, CBQ decides which of its -+classes will be allowed to send. It does so with a Weighted Round Robin process -+in which each class with packets gets a chance to send in turn. The WRR process -+starts by asking the highest priority classes (lowest numerically - -+highest semantically) for packets, and will continue to do so until they -+have no more data to offer, in which case the process repeats for lower -+priorities. -+ -+.B CERTAINTY ENDS HERE, ANK PLEASE HELP -+ -+Each class is not allowed to send at length though - they can only dequeue a -+configurable amount of data during each round. -+ -+If a class is about to go overlimit, and it is not -+.B bounded -+it will try to borrow avgidle from siblings that are not -+.B isolated. -+This process is repeated from the bottom upwards. If a class is unable -+to borrow enough avgidle to send a packet, it is throttled and not asked -+for a packet for enough time for the avgidle to increase above zero. -+ -+.B I REALLY NEED HELP FIGURING THIS OUT. REST OF DOCUMENT IS PRETTY CERTAIN -+.B AGAIN. -+ -+.SH QDISC -+The root qdisc of a CBQ class tree has the following parameters: -+ -+.TP -+parent major:minor | root -+This mandatory parameter determines the place of the CBQ instance, either at the -+.B root -+of an interface or within an existing class. -+.TP -+handle major: -+Like all other qdiscs, the CBQ can be assigned a handle. Should consist only -+of a major number, followed by a colon. Optional. -+.TP -+avpkt bytes -+For calculations, the average packet size must be known. It is silently capped -+at a minimum of 2/3 of the interface MTU. Mandatory. -+.TP -+bandwidth rate -+To determine the idle time, CBQ must know the bandwidth of your underlying -+physical interface, or parent qdisc. This is a vital parameter, more about it -+later. Mandatory. -+.TP -+cell -+The cell size determines he granularity of packet transmission time calculations. Has a sensible default. -+.TP -+mpu -+A zero sized packet may still take time to transmit. This value is the lower -+cap for packet transmission time calculations - packets smaller than this value -+are still deemed to have this size. Defaults to zero. -+.TP -+ewma log -+When CBQ needs to measure the average idle time, it does so using an -+Exponentially Weighted Moving Average which smoothes out measurements into -+a moving average. The EWMA LOG determines how much smoothing occurs. Defaults -+to 5. Lower values imply greater sensitivity. Must be between 0 and 31. -+.P -+A CBQ qdisc does not shape out of its own accord. It only needs to know certain -+parameters about the underlying link. Actual shaping is done in classes. -+ -+.SH CLASSES -+Classes have a host of parameters to configure their operation. -+ -+.TP -+parent major:minor -+Place of this class within the hierarchy. If attached directly to a qdisc -+and not to another class, minor can be omitted. Mandatory. -+.TP -+classid major:minor -+Like qdiscs, classes can be named. The major number must be equal to the -+major number of the qdisc to which it belongs. Optional, but needed if this -+class is going to have children. -+.TP -+weight weight -+When dequeuing to the interface, classes are tried for traffic in a -+round-robin fashion. Classes with a higher configured qdisc will generally -+have more traffic to offer during each round, so it makes sense to allow -+it to dequeue more traffic. All weights under a class are normalized, so -+only the ratios matter. Defaults to the configured rate, unless the priority -+of this class is maximal, in which case it is set to 1. -+.TP -+allot bytes -+Allot specifies how many bytes a qdisc can dequeue -+during each round of the process. This parameter is weighted using the -+renormalized class weight described above. -+ -+.TP -+priority priority -+In the round-robin process, classes with the lowest priority field are tried -+for packets first. Mandatory. -+ -+.TP -+rate rate -+Maximum rate this class and all its children combined can send at. Mandatory. -+ -+.TP -+bandwidth rate -+This is different from the bandwidth specified when creating a CBQ disc. Only -+used to determine maxidle and offtime, which are only calculated when -+specifying maxburst or minburst. Mandatory if specifying maxburst or minburst. -+ -+.TP -+maxburst -+This number of packets is used to calculate maxidle so that when -+avgidle is at maxidle, this number of average packets can be burst -+before avgidle drops to 0. Set it higher to be more tolerant of -+bursts. You can't set maxidle directly, only via this parameter. -+ -+.TP -+minburst -+As mentioned before, CBQ needs to throttle in case of -+overlimit. The ideal solution is to do so for exactly the calculated -+idle time, and pass 1 packet. However, Unix kernels generally have a -+hard time scheduling events shorter than 10ms, so it is better to -+throttle for a longer period, and then pass minburst packets in one -+go, and then sleep minburst times longer. -+ -+The time to wait is called the offtime. Higher values of minburst lead -+to more accurate shaping in the long term, but to bigger bursts at -+millisecond timescales. -+ -+.TP -+minidle -+If avgidle is below 0, we are overlimits and need to wait until -+avgidle will be big enough to send one packet. To prevent a sudden -+burst from shutting down the link for a prolonged period of time, -+avgidle is reset to minidle if it gets too low. -+ -+Minidle is specified in negative microseconds, so 10 means that -+avgidle is capped at -10us. -+ -+.TP -+bounded -+Signifies that this class will not borrow bandwidth from its siblings. -+.TP -+isolated -+Means that this class will not borrow bandwidth to its siblings -+ -+.TP -+split major:minor & defmap bitmap[/bitmap] -+If consulting filters attached to a class did not give a verdict, -+CBQ can also classify based on the packet's priority. There are 16 -+priorities available, numbered from 0 to 15. -+ -+The defmap specifies which priorities this class wants to receive, -+specified as a bitmap. The Least Significant Bit corresponds to priority -+zero. The -+.B split -+parameter tells CBQ at which class the decision must be made, which should -+be a (grand)parent of the class you are adding. -+ -+As an example, 'tc class add ... classid 10:1 cbq .. split 10:0 defmap c0' -+configures class 10:0 to send packets with priorities 6 and 7 to 10:1. -+ -+The complimentary configuration would then -+be: 'tc class add ... classid 10:2 cbq ... split 10:0 defmap 3f' -+Which would send all packets 0, 1, 2, 3, 4 and 5 to 10:1. -+.TP -+estimator interval timeconstant -+CBQ can measure how much bandwidth each class is using, which tc filters -+can use to classify packets with. In order to determine the bandwidth -+it uses a very simple estimator that measures once every -+.B interval -+microseconds how much traffic has passed. This again is a EWMA, for which -+the time constant can be specified, also in microseconds. The -+.B time constant -+corresponds to the sluggishness of the measurement or, conversely, to the -+sensitivity of the average to short bursts. Higher values mean less -+sensitivity. -+ -+ -+ -+.SH SOURCES -+.TP -+o -+Sally Floyd and Van Jacobson, "Link-sharing and Resource -+Management Models for Packet Networks", -+IEEE/ACM Transactions on Networking, Vol.3, No.4, 1995 -+ -+.TP -+o -+Sally Floyd, "Notes on CBQ and Guarantee Service", 1995 -+ -+.TP -+o -+Sally Floyd, "Notes on Class-Based Queueing: Setting -+Parameters", 1996 -+ -+.TP -+o -+Sally Floyd and Michael Speer, "Experimental Results -+for Class-Based Queueing", 1998, not published. -+ -+ -+ -+.SH SEE ALSO -+.BR tc (8) -+ -+.SH AUTHOR -+Alexey N. Kuznetsov, . This manpage maintained by -+bert hubert -+ -+ -diff -Naur iproute2-orig/debian/manpages/tc-cbq.8 iproute2/debian/manpages/tc-cbq.8 ---- iproute2-orig/debian/manpages/tc-cbq.8 1969-12-31 16:00:00.000000000 -0800 -+++ iproute2/debian/manpages/tc-cbq.8 2004-05-21 00:09:38.000000000 -0700 -@@ -0,0 +1,353 @@ -+.TH CBQ 8 "16 December 2001" "iproute2" "Linux" -+.SH NAME -+CBQ \- Class Based Queueing -+.SH SYNOPSIS -+.B tc qdisc ... dev -+dev -+.B ( parent -+classid -+.B | root) [ handle -+major: -+.B ] cbq [ allot -+bytes -+.B ] avpkt -+bytes -+.B bandwidth -+rate -+.B [ cell -+bytes -+.B ] [ ewma -+log -+.B ] [ mpu -+bytes -+.B ] -+ -+.B tc class ... dev -+dev -+.B parent -+major:[minor] -+.B [ classid -+major:minor -+.B ] cbq allot -+bytes -+.B [ bandwidth -+rate -+.B ] [ rate -+rate -+.B ] prio -+priority -+.B [ weight -+weight -+.B ] [ minburst -+packets -+.B ] [ maxburst -+packets -+.B ] [ ewma -+log -+.B ] [ cell -+bytes -+.B ] avpkt -+bytes -+.B [ mpu -+bytes -+.B ] [ bounded isolated ] [ split -+handle -+.B & defmap -+defmap -+.B ] [ estimator -+interval timeconstant -+.B ] -+ -+.SH DESCRIPTION -+Class Based Queueing is a classful qdisc that implements a rich -+linksharing hierarchy of classes. It contains shaping elements as -+well as prioritizing capabilities. Shaping is performed using link -+idle time calculations based on the timing of dequeue events and -+underlying link bandwidth. -+ -+.SH SHAPING ALGORITHM -+When shaping a 10mbit/s connection to 1mbit/s, the link will -+be idle 90% of the time. If it isn't, it needs to be throttled so that it -+IS idle 90% of the time. -+ -+During operations, the effective idletime is measured using an -+exponential weighted moving average (EWMA), which considers recent -+packets to be exponentially more important than past ones. The Unix -+loadaverage is calculated in the same way. -+ -+The calculated idle time is subtracted from the EWMA measured one, -+the resulting number is called 'avgidle'. A perfectly loaded link has -+an avgidle of zero: packets arrive exactly at the calculated -+interval. -+ -+An overloaded link has a negative avgidle and if it gets too negative, -+CBQ throttles and is then 'overlimit'. -+ -+Conversely, an idle link might amass a huge avgidle, which would then -+allow infinite bandwidths after a few hours of silence. To prevent -+this, avgidle is capped at -+.B maxidle. -+ -+If overlimit, in theory, the CBQ could throttle itself for exactly the -+amount of time that was calculated to pass between packets, and then -+pass one packet, and throttle again. Due to timer resolution constraints, -+this may not be feasible, see the -+.B minburst -+parameter below. -+ -+.SH CLASSIFICATION -+Within the one CBQ instance many classes may exist. Each of these classes -+contains another qdisc, by default -+.BR tc-pfifo (8). -+ -+When enqueueing a packet, CBQ starts at the root and uses various methods to -+determine which class should receive the data. -+ -+In the absence of uncommon configuration options, the process is rather easy. -+At each node we look for an instruction, and then go to the class the -+instruction refers us to. If the class found is a barren leaf-node (without -+children), we enqueue the packet there. If it is not yet a leaf node, we do -+the whole thing over again starting from that node. -+ -+The following actions are performed, in order at each node we visit, until one -+sends us to another node, or terminates the process. -+.TP -+(i) -+Consult filters attached to the class. If sent to a leafnode, we are done. -+Otherwise, restart. -+.TP -+(ii) -+Consult the defmap for the priority assigned to this packet, which depends -+on the TOS bits. Check if the referral is leafless, otherwise restart. -+.TP -+(iii) -+Ask the defmap for instructions for the 'best effort' priority. Check the -+answer for leafness, otherwise restart. -+.TP -+(iv) -+If none of the above returned with an instruction, enqueue at this node. -+.P -+This algorithm makes sure that a packet always ends up somewhere, even while -+you are busy building your configuration. -+ -+For more details, see -+.BR tc-cbq-details(8). -+ -+.SH LINK SHARING ALGORITHM -+When dequeuing for sending to the network device, CBQ decides which of its -+classes will be allowed to send. It does so with a Weighted Round Robin process -+in which each class with packets gets a chance to send in turn. The WRR process -+starts by asking the highest priority classes (lowest numerically - -+highest semantically) for packets, and will continue to do so until they -+have no more data to offer, in which case the process repeats for lower -+priorities. -+ -+Classes by default borrow bandwidth from their siblings. A class can be -+prevented from doing so by declaring it 'bounded'. A class can also indicate -+its unwillingness to lend out bandwidth by being 'isolated'. -+ -+.SH QDISC -+The root of a CBQ qdisc class tree has the following parameters: -+ -+.TP -+parent major:minor | root -+This mandatory parameter determines the place of the CBQ instance, either at the -+.B root -+of an interface or within an existing class. -+.TP -+handle major: -+Like all other qdiscs, the CBQ can be assigned a handle. Should consist only -+of a major number, followed by a colon. Optional, but very useful if classes -+will be generated within this qdisc. -+.TP -+allot bytes -+This allotment is the 'chunkiness' of link sharing and is used for determining packet -+transmission time tables. The qdisc allot differs slightly from the class allot discussed -+below. Optional. Defaults to a reasonable value, related to avpkt. -+.TP -+avpkt bytes -+The average size of a packet is needed for calculating maxidle, and is also used -+for making sure 'allot' has a safe value. Mandatory. -+.TP -+bandwidth rate -+To determine the idle time, CBQ must know the bandwidth of your underlying -+physical interface, or parent qdisc. This is a vital parameter, more about it -+later. Mandatory. -+.TP -+cell -+The cell size determines he granularity of packet transmission time calculations. Has a sensible default. -+.TP -+mpu -+A zero sized packet may still take time to transmit. This value is the lower -+cap for packet transmission time calculations - packets smaller than this value -+are still deemed to have this size. Defaults to zero. -+.TP -+ewma log -+When CBQ needs to measure the average idle time, it does so using an -+Exponentially Weighted Moving Average which smoothes out measurements into -+a moving average. The EWMA LOG determines how much smoothing occurs. Lower -+values imply greater sensitivity. Must be between 0 and 31. Defaults -+to 5. -+.P -+A CBQ qdisc does not shape out of its own accord. It only needs to know certain -+parameters about the underlying link. Actual shaping is done in classes. -+ -+.SH CLASSES -+Classes have a host of parameters to configure their operation. -+ -+.TP -+parent major:minor -+Place of this class within the hierarchy. If attached directly to a qdisc -+and not to another class, minor can be omitted. Mandatory. -+.TP -+classid major:minor -+Like qdiscs, classes can be named. The major number must be equal to the -+major number of the qdisc to which it belongs. Optional, but needed if this -+class is going to have children. -+.TP -+weight weight -+When dequeuing to the interface, classes are tried for traffic in a -+round-robin fashion. Classes with a higher configured qdisc will generally -+have more traffic to offer during each round, so it makes sense to allow -+it to dequeue more traffic. All weights under a class are normalized, so -+only the ratios matter. Defaults to the configured rate, unless the priority -+of this class is maximal, in which case it is set to 1. -+.TP -+allot bytes -+Allot specifies how many bytes a qdisc can dequeue -+during each round of the process. This parameter is weighted using the -+renormalized class weight described above. Silently capped at a minimum of -+3/2 avpkt. Mandatory. -+ -+.TP -+prio priority -+In the round-robin process, classes with the lowest priority field are tried -+for packets first. Mandatory. -+ -+.TP -+avpkt -+See the QDISC section. -+ -+.TP -+rate rate -+Maximum rate this class and all its children combined can send at. Mandatory. -+ -+.TP -+bandwidth rate -+This is different from the bandwidth specified when creating a CBQ disc! Only -+used to determine maxidle and offtime, which are only calculated when -+specifying maxburst or minburst. Mandatory if specifying maxburst or minburst. -+ -+.TP -+maxburst -+This number of packets is used to calculate maxidle so that when -+avgidle is at maxidle, this number of average packets can be burst -+before avgidle drops to 0. Set it higher to be more tolerant of -+bursts. You can't set maxidle directly, only via this parameter. -+ -+.TP -+minburst -+As mentioned before, CBQ needs to throttle in case of -+overlimit. The ideal solution is to do so for exactly the calculated -+idle time, and pass 1 packet. However, Unix kernels generally have a -+hard time scheduling events shorter than 10ms, so it is better to -+throttle for a longer period, and then pass minburst packets in one -+go, and then sleep minburst times longer. -+ -+The time to wait is called the offtime. Higher values of minburst lead -+to more accurate shaping in the long term, but to bigger bursts at -+millisecond timescales. Optional. -+ -+.TP -+minidle -+If avgidle is below 0, we are overlimits and need to wait until -+avgidle will be big enough to send one packet. To prevent a sudden -+burst from shutting down the link for a prolonged period of time, -+avgidle is reset to minidle if it gets too low. -+ -+Minidle is specified in negative microseconds, so 10 means that -+avgidle is capped at -10us. Optional. -+ -+.TP -+bounded -+Signifies that this class will not borrow bandwidth from its siblings. -+.TP -+isolated -+Means that this class will not borrow bandwidth to its siblings -+ -+.TP -+split major:minor & defmap bitmap[/bitmap] -+If consulting filters attached to a class did not give a verdict, -+CBQ can also classify based on the packet's priority. There are 16 -+priorities available, numbered from 0 to 15. -+ -+The defmap specifies which priorities this class wants to receive, -+specified as a bitmap. The Least Significant Bit corresponds to priority -+zero. The -+.B split -+parameter tells CBQ at which class the decision must be made, which should -+be a (grand)parent of the class you are adding. -+ -+As an example, 'tc class add ... classid 10:1 cbq .. split 10:0 defmap c0' -+configures class 10:0 to send packets with priorities 6 and 7 to 10:1. -+ -+The complimentary configuration would then -+be: 'tc class add ... classid 10:2 cbq ... split 10:0 defmap 3f' -+Which would send all packets 0, 1, 2, 3, 4 and 5 to 10:1. -+.TP -+estimator interval timeconstant -+CBQ can measure how much bandwidth each class is using, which tc filters -+can use to classify packets with. In order to determine the bandwidth -+it uses a very simple estimator that measures once every -+.B interval -+microseconds how much traffic has passed. This again is a EWMA, for which -+the time constant can be specified, also in microseconds. The -+.B time constant -+corresponds to the sluggishness of the measurement or, conversely, to the -+sensitivity of the average to short bursts. Higher values mean less -+sensitivity. -+ -+.SH BUGS -+The actual bandwidth of the underlying link may not be known, for example -+in the case of PPoE or PPTP connections which in fact may send over a -+pipe, instead of over a physical device. CBQ is quite resilient to major -+errors in the configured bandwidth, probably a the cost of coarser shaping. -+ -+Default kernels rely on coarse timing information for making decisions. These -+may make shaping precise in the long term, but inaccurate on second long scales. -+ -+See -+.BR tc-cbq-details(8) -+for hints on how to improve this. -+ -+.SH SOURCES -+.TP -+o -+Sally Floyd and Van Jacobson, "Link-sharing and Resource -+Management Models for Packet Networks", -+IEEE/ACM Transactions on Networking, Vol.3, No.4, 1995 -+ -+.TP -+o -+Sally Floyd, "Notes on CBQ and Guaranteed Service", 1995 -+ -+.TP -+o -+Sally Floyd, "Notes on Class-Based Queueing: Setting -+Parameters", 1996 -+ -+.TP -+o -+Sally Floyd and Michael Speer, "Experimental Results -+for Class-Based Queueing", 1998, not published. -+ -+ -+ -+.SH SEE ALSO -+.BR tc (8) -+ -+.SH AUTHOR -+Alexey N. Kuznetsov, . This manpage maintained by -+bert hubert -+ -+ -diff -Naur iproute2-orig/debian/manpages/tc-htb.8 iproute2/debian/manpages/tc-htb.8 ---- iproute2-orig/debian/manpages/tc-htb.8 1969-12-31 16:00:00.000000000 -0800 -+++ iproute2/debian/manpages/tc-htb.8 2004-05-21 00:09:38.000000000 -0700 -@@ -0,0 +1,150 @@ -+.TH HTB 8 "10 January 2002" "iproute2" "Linux" -+.SH NAME -+HTB \- Hierarchy Token Bucket -+.SH SYNOPSIS -+.B tc qdisc ... dev -+dev -+.B ( parent -+classid -+.B | root) [ handle -+major: -+.B ] htb [ default -+minor-id -+.B ] -+ -+.B tc class ... dev -+dev -+.B parent -+major:[minor] -+.B [ classid -+major:minor -+.B ] htb rate -+rate -+.B [ ceil -+rate -+.B ] burst -+bytes -+.B [ cburst -+bytes -+.B ] [ prio -+priority -+.B ] -+ -+.SH DESCRIPTION -+HTB is meant as a more understandable and intuitive replacement for -+the CBQ qdisc in Linux. Both CBQ and HTB help you to control the use -+of the outbound bandwidth on a given link. Both allow you to use one -+physical link to simulate several slower links and to send different -+kinds of traffic on different simulated links. In both cases, you have -+to specify how to divide the physical link into simulated links and -+how to decide which simulated link to use for a given packet to be sent. -+ -+Unlike CBQ, HTB shapes traffic based on the Token Bucket Filter algorithm -+which does not depend on interface characteristics and so does not need to -+know the underlying bandwidth of the outgoing interface. -+ -+.SH SHAPING ALGORITHM -+Shaping works as documented in -+.B tc-tbf (8). -+ -+.SH CLASSIFICATION -+Within the one HRB instance many classes may exist. Each of these classes -+contains another qdisc, by default -+.BR tc-pfifo (8). -+ -+When enqueueing a packet, HTB starts at the root and uses various methods to -+determine which class should receive the data. -+ -+In the absence of uncommon configuration options, the process is rather easy. -+At each node we look for an instruction, and then go to the class the -+instruction refers us to. If the class found is a barren leaf-node (without -+children), we enqueue the packet there. If it is not yet a leaf node, we do -+the whole thing over again starting from that node. -+ -+The following actions are performed, in order at each node we visit, until one -+sends us to another node, or terminates the process. -+.TP -+(i) -+Consult filters attached to the class. If sent to a leafnode, we are done. -+Otherwise, restart. -+.TP -+(ii) -+If none of the above returned with an instruction, enqueue at this node. -+.P -+This algorithm makes sure that a packet always ends up somewhere, even while -+you are busy building your configuration. -+ -+.SH LINK SHARING ALGORITHM -+FIXME -+ -+.SH QDISC -+The root of a HTB qdisc class tree has the following parameters: -+ -+.TP -+parent major:minor | root -+This mandatory parameter determines the place of the HTB instance, either at the -+.B root -+of an interface or within an existing class. -+.TP -+handle major: -+Like all other qdiscs, the HTB can be assigned a handle. Should consist only -+of a major number, followed by a colon. Optional, but very useful if classes -+will be generated within this qdisc. -+.TP -+default minor-id -+Unclassified traffic gets sent to the class with this minor-id. -+ -+.SH CLASSES -+Classes have a host of parameters to configure their operation. -+ -+.TP -+parent major:minor -+Place of this class within the hierarchy. If attached directly to a qdisc -+and not to another class, minor can be omitted. Mandatory. -+.TP -+classid major:minor -+Like qdiscs, classes can be named. The major number must be equal to the -+major number of the qdisc to which it belongs. Optional, but needed if this -+class is going to have children. -+.TP -+prio priority -+In the round-robin process, classes with the lowest priority field are tried -+for packets first. Mandatory. -+ -+.TP -+rate rate -+Maximum rate this class and all its children are guaranteed. Mandatory. -+ -+.TP -+ceil rate -+Maximum rate at which a class can send, if its parent has bandwidth to spare. -+Defaults to the configured rate, which implies no borrowing -+ -+.TP -+burst bytes -+Amount of bytes that can be burst at -+.B ceil -+speed, in excess of the configured -+.B rate. -+Should be at least as high as the highest burst of all children. -+ -+.TP -+cburst bytes -+Amount of bytes that can be burst at 'infinite' speed, in other words, as fast -+as the interface can transmit them. For perfect evening out, should be equal to at most one average -+packet. Should be at least as high as the highest cburst of all children. -+ -+.SH NOTES -+Due to Unix timing constraints, the maximum ceil rate is not infinite and may in fact be quite low. On Intel, -+there are 100 timer events per second, the maximum rate is that rate at which 'burst' bytes are sent each timer tick. -+From this, the mininum burst size for a specified rate can be calculated. For i386, a 10mbit rate requires a 12 kilobyte -+burst as 100*12kb*8 equals 10mbit. -+ -+.SH SEE ALSO -+.BR tc (8) -+.P -+HTB website: http://luxik.cdi.cz/~devik/qos/htb/ -+.SH AUTHOR -+Martin Devera . This manpage maintained by bert hubert -+ -+ -diff -Naur iproute2-orig/debian/manpages/tc-pbfifo.8 iproute2/debian/manpages/tc-pbfifo.8 ---- iproute2-orig/debian/manpages/tc-pbfifo.8 1969-12-31 16:00:00.000000000 -0800 -+++ iproute2/debian/manpages/tc-pbfifo.8 2004-05-21 00:09:38.000000000 -0700 -@@ -0,0 +1,72 @@ -+.TH PBFIFO 8 "10 January 2002" "iproute2" "Linux" -+.SH NAME -+pfifo \- Packet limited First In, First Out queue -+.P -+bfifo \- Byte limited First In, First Out queue -+ -+.SH SYNOPSIS -+.B tc qdisc ... add pfifo -+.B [ limit -+packets -+.B ] -+.P -+.B tc qdisc ... add bfifo -+.B [ limit -+bytes -+.B ] -+ -+.SH DESCRIPTION -+The pfifo and bfifo qdiscs are unadorned First In, First Out queues. They are the -+simplest queues possible and therefore have no overhead. -+.B pfifo -+constrains the queue size as measured in packets. -+.B bfifo -+does so as measured in bytes. -+ -+Like all non-default qdiscs, they maintain statistics. This might be a reason to prefer -+pfifo or bfifo over the default. -+ -+.SH ALGORITHM -+A list of packets is maintained, when a packet is enqueued it gets inserted at the tail of -+a list. When a packet needs to be sent out to the network, it is taken from the head of the list. -+ -+If the list is too long, no further packets are allowed on. This is called 'tail drop'. -+ -+.SH PARAMETERS -+.TP -+limit -+Maximum queue size. Specified in bytes for bfifo, in packets for pfifo. For pfifo, defaults -+to the interface txqueuelen, as specified with -+.BR ifconfig (8) -+or -+.BR ip (8). -+ -+For bfifo, it defaults to the txqueuelen multiplied by the interface MTU. -+ -+.SH OUTPUT -+The output of -+.B tc -s qdisc ls -+contains the limit, either in packets or in bytes, and the number of bytes -+and packets actually sent. An unsent and dropped packet only appears between braces -+and is not counted as 'Sent'. -+ -+In this example, the queue length is 100 packets, 45894 bytes were sent over 681 packets. -+No packets were dropped, and as the pfifo queue does not slow down packets, there were also no -+overlimits: -+.P -+.nf -+# tc -s qdisc ls dev eth0 -+qdisc pfifo 8001: dev eth0 limit 100p -+ Sent 45894 bytes 681 pkts (dropped 0, overlimits 0) -+.fi -+ -+If a backlog occurs, this is displayed as well. -+.SH SEE ALSO -+.BR tc (8) -+ -+.SH AUTHORS -+Alexey N. Kuznetsov, -+ -+This manpage maintained by bert hubert -+ -+ -diff -Naur iproute2-orig/debian/manpages/tc-pfifo_fast.8 iproute2/debian/manpages/tc-pfifo_fast.8 ---- iproute2-orig/debian/manpages/tc-pfifo_fast.8 1969-12-31 16:00:00.000000000 -0800 -+++ iproute2/debian/manpages/tc-pfifo_fast.8 2004-05-21 00:09:38.000000000 -0700 -@@ -0,0 +1,59 @@ -+.TH PFIFO_FAST 8 "10 January 2002" "iproute2" "Linux" -+.SH NAME -+pfifo_fast \- three-band first in, first out queue -+ -+.SH DESCRIPTION -+pfifo_fast is the default qdisc of each interface. -+ -+Whenever an interface is created, the pfifo_fast qdisc is automatically used -+as a queue. If another qdisc is attached, it preempts the default -+pfifo_fast, which automatically returns to function when an existing qdisc -+is detached. -+ -+In this sense this qdisc is magic, and unlike other qdiscs. -+ -+.SH ALGORITHM -+The algorithm is very similar to that of the classful -+.BR tc-prio (8) -+qdisc. -+.B pfifo_fast -+is like three -+.BR tc-pfifo (8) -+queues side by side, where packets can be enqueued in any of the three bands -+based on their Type of Service bits or assigned priority. -+ -+Not all three bands are dequeued simultaneously - as long as lower bands -+have traffic, higher bands are never dequeued. This can be used to -+prioritize interactive traffic or penalize 'lowest cost' traffic. -+ -+Each band can be txqueuelen packets long, as configured with -+.BR ifconfig (8) -+or -+.BR ip (8). -+Additional packets coming in are not enqueued but are instead dropped. -+ -+See -+.BR tc-prio (8) -+for complete details on how TOS bits are translated into bands. -+.SH PARAMETERS -+.TP -+txqueuelen -+The length of the three bands depends on the interface txqueuelen, as -+specified with -+.BR ifconfig (8) -+or -+.BR ip (8). -+ -+.SH BUGS -+Does not maintain statistics and does not show up in tc qdisc ls. This is because -+it is the automatic default in the absence of a configured qdisc. -+ -+.SH SEE ALSO -+.BR tc (8) -+ -+.SH AUTHORS -+Alexey N. Kuznetsov, -+ -+This manpage maintained by bert hubert -+ -+ -diff -Naur iproute2-orig/debian/manpages/tc-prio.8 iproute2/debian/manpages/tc-prio.8 ---- iproute2-orig/debian/manpages/tc-prio.8 1969-12-31 16:00:00.000000000 -0800 -+++ iproute2/debian/manpages/tc-prio.8 2004-05-21 00:09:38.000000000 -0700 -@@ -0,0 +1,187 @@ -+.TH PRIO 8 "16 December 2001" "iproute2" "Linux" -+.SH NAME -+PRIO \- Priority qdisc -+.SH SYNOPSIS -+.B tc qdisc ... dev -+dev -+.B ( parent -+classid -+.B | root) [ handle -+major: -+.B ] prio [ bands -+bands -+.B ] [ priomap -+band,band,band... -+.B ] [ estimator -+interval timeconstant -+.B ] -+ -+.SH DESCRIPTION -+The PRIO qdisc is a simple classful queueing discipline that contains -+an arbitrary number of classes of differing priority. The classes are -+dequeued in numerical descending order of priority. PRIO is a scheduler -+and never delays packets - it is a work-conserving qdisc, though the qdiscs -+contained in the classes may not be. -+ -+Very useful for lowering latency when there is no need for slowing down -+traffic. -+ -+.SH ALGORITHM -+On creation with 'tc qdisc add', a fixed number of bands is created. Each -+band is a class, although is not possible to add classes with 'tc qdisc -+add', the number of bands to be created must instead be specified on the -+commandline attaching PRIO to its root. -+ -+When dequeueing, band 0 is tried first and only if it did not deliver a -+packet does PRIO try band 1, and so onwards. Maximum reliability packets -+should therefore go to band 0, minimum delay to band 1 and the rest to band -+2. -+ -+As the PRIO qdisc itself will have minor number 0, band 0 is actually -+major:1, band 1 is major:2, etc. For major, substitute the major number -+assigned to the qdisc on 'tc qdisc add' with the -+.B handle -+parameter. -+ -+.SH CLASSIFICATION -+Three methods are available to PRIO to determine in which band a packet will -+be enqueued. -+.TP -+From userspace -+A process with sufficient privileges can encode the destination class -+directly with SO_PRIORITY, see -+.BR tc(7). -+.TP -+with a tc filter -+A tc filter attached to the root qdisc can point traffic directly to a class -+.TP -+with the priomap -+Based on the packet priority, which in turn is derived from the Type of -+Service assigned to the packet. -+.P -+Only the priomap is specific to this qdisc. -+.SH QDISC PARAMETERS -+.TP -+bands -+Number of bands. If changed from the default of 3, -+.B priomap -+must be updated as well. -+.TP -+priomap -+The priomap maps the priority of -+a packet to a class. The priority can either be set directly from userspace, -+or be derived from the Type of Service of the packet. -+ -+Determines how packet priorities, as assigned by the kernel, map to -+bands. Mapping occurs based on the TOS octet of the packet, which looks like -+this: -+ -+.nf -+0 1 2 3 4 5 6 7 -++---+---+---+---+---+---+---+---+ -+| | | | -+|PRECEDENCE | TOS |MBZ| -+| | | | -++---+---+---+---+---+---+---+---+ -+.fi -+ -+The four TOS bits (the 'TOS field') are defined as: -+ -+.nf -+Binary Decimcal Meaning -+----------------------------------------- -+1000 8 Minimize delay (md) -+0100 4 Maximize throughput (mt) -+0010 2 Maximize reliability (mr) -+0001 1 Minimize monetary cost (mmc) -+0000 0 Normal Service -+.fi -+ -+As there is 1 bit to the right of these four bits, the actual value of the -+TOS field is double the value of the TOS bits. Tcpdump -v -v shows you the -+value of the entire TOS field, not just the four bits. It is the value you -+see in the first column of this table: -+ -+.nf -+TOS Bits Means Linux Priority Band -+------------------------------------------------------------ -+0x0 0 Normal Service 0 Best Effort 1 -+0x2 1 Minimize Monetary Cost 1 Filler 2 -+0x4 2 Maximize Reliability 0 Best Effort 1 -+0x6 3 mmc+mr 0 Best Effort 1 -+0x8 4 Maximize Throughput 2 Bulk 2 -+0xa 5 mmc+mt 2 Bulk 2 -+0xc 6 mr+mt 2 Bulk 2 -+0xe 7 mmc+mr+mt 2 Bulk 2 -+0x10 8 Minimize Delay 6 Interactive 0 -+0x12 9 mmc+md 6 Interactive 0 -+0x14 10 mr+md 6 Interactive 0 -+0x16 11 mmc+mr+md 6 Interactive 0 -+0x18 12 mt+md 4 Int. Bulk 1 -+0x1a 13 mmc+mt+md 4 Int. Bulk 1 -+0x1c 14 mr+mt+md 4 Int. Bulk 1 -+0x1e 15 mmc+mr+mt+md 4 Int. Bulk 1 -+.fi -+ -+The second column contains the value of the relevant -+four TOS bits, followed by their translated meaning. For example, 15 stands -+for a packet wanting Minimal Montetary Cost, Maximum Reliability, Maximum -+Throughput AND Minimum Delay. -+ -+The fourth column lists the way the Linux kernel interprets the TOS bits, by -+showing to which Priority they are mapped. -+ -+The last column shows the result of the default priomap. On the commandline, -+the default priomap looks like this: -+ -+ 1, 2, 2, 2, 1, 2, 0, 0 , 1, 1, 1, 1, 1, 1, 1, 1 -+ -+This means that priority 4, for example, gets mapped to band number 1. -+The priomap also allows you to list higher priorities (> 7) which do not -+correspond to TOS mappings, but which are set by other means. -+ -+This table from RFC 1349 (read it for more details) explains how -+applications might very well set their TOS bits: -+ -+.nf -+TELNET 1000 (minimize delay) -+FTP -+ Control 1000 (minimize delay) -+ Data 0100 (maximize throughput) -+ -+TFTP 1000 (minimize delay) -+ -+SMTP -+ Command phase 1000 (minimize delay) -+ DATA phase 0100 (maximize throughput) -+ -+Domain Name Service -+ UDP Query 1000 (minimize delay) -+ TCP Query 0000 -+ Zone Transfer 0100 (maximize throughput) -+ -+NNTP 0001 (minimize monetary cost) -+ -+ICMP -+ Errors 0000 -+ Requests 0000 (mostly) -+ Responses (mostly) -+.fi -+ -+ -+.SH CLASSES -+PRIO classes cannot be configured further - they are automatically created -+when the PRIO qdisc is attached. Each class however can contain yet a -+further qdisc. -+ -+.SH BUGS -+Large amounts of traffic in the lower bands can cause starvation of higher -+bands. Can be prevented by attaching a shaper (for example, -+.BR tc-tbf(8) -+to these bands to make sure they cannot dominate the link. -+ -+.SH AUTHORS -+Alexey N. Kuznetsov, , J Hadi Salim -+. This manpage maintained by bert hubert -+ -+ -diff -Naur iproute2-orig/debian/manpages/tc-red.8 iproute2/debian/manpages/tc-red.8 ---- iproute2-orig/debian/manpages/tc-red.8 1969-12-31 16:00:00.000000000 -0800 -+++ iproute2/debian/manpages/tc-red.8 2004-05-21 00:09:38.000000000 -0700 -@@ -0,0 +1,131 @@ -+.TH RED 8 "13 December 2001" "iproute2" "Linux" -+.SH NAME -+red \- Random Early Detection -+.SH SYNOPSIS -+.B tc qdisc ... red -+.B limit -+bytes -+.B min -+bytes -+.B max -+bytes -+.B avpkt -+bytes -+.B burst -+packets -+.B [ ecn ] [ bandwidth -+rate -+.B ] probability -+chance -+ -+.SH DESCRIPTION -+Random Early Detection is a classless qdisc which manages its queue size -+smartly. Regular queues simply drop packets from the tail when they are -+full, which may not be the optimal behaviour. RED also performs tail drop, -+but does so in a more gradual way. -+ -+Once the queue hits a certain average length, packets enqueued have a -+configurable chance of being marked (which may mean dropped). This chance -+increases linearly up to a point called the -+.B max -+average queue length, although the queue might get bigger. -+ -+This has a host of benefits over simple taildrop, while not being processor -+intensive. It prevents synchronous retransmits after a burst in traffic, -+which cause further retransmits, etc. -+ -+The goal is the have a small queue size, which is good for interactivity -+while not disturbing TCP/IP traffic with too many sudden drops after a burst -+of traffic. -+ -+Depending on if ECN is configured, marking either means dropping or -+purely marking a packet as overlimit. -+.SH ALGORITHM -+The average queue size is used for determining the marking -+probability. This is calculated using an Exponential Weighted Moving -+Average, which can be more or less sensitive to bursts. -+ -+When the average queue size is below -+.B min -+bytes, no packet will ever be marked. When it exceeds -+.B min, -+the probability of doing so climbs linearly up -+to -+.B probability, -+until the average queue size hits -+.B max -+bytes. Because -+.B probability -+is normally not set to 100%, the queue size might -+conceivably rise above -+.B max -+bytes, so the -+.B limit -+parameter is provided to set a hard maximum for the size of the queue. -+ -+.SH PARAMETERS -+.TP -+min -+Average queue size at which marking becomes a possibility. -+.TP -+max -+At this average queue size, the marking probability is maximal. Should be at -+least twice -+.B min -+to prevent synchronous retransmits, higher for low -+.B min. -+.TP -+probability -+Maximum probability for marking, specified as a floating point -+number from 0.0 to 1.0. Suggested values are 0.01 or 0.02 (1 or 2%, -+respectively). -+.TP -+limit -+Hard limit on the real (not average) queue size in bytes. Further packets -+are dropped. Should be set higher than max+burst. It is advised to set this -+a few times higher than -+.B max. -+.TP -+burst -+Used for determining how fast the average queue size is influenced by the -+real queue size. Larger values make the calculation more sluggish, allowing -+longer bursts of traffic before marking starts. Real life experiments -+support the following guideline: (min+min+max)/(3*avpkt). -+.TP -+avpkt -+Specified in bytes. Used with burst to determine the time constant for -+average queue size calculations. 1000 is a good value. -+.TP -+bandwidth -+This rate is used for calculating the average queue size after some -+idle time. Should be set to the bandwidth of your interface. Does not mean -+that RED will shape for you! Optional. -+.TP -+ecn -+As mentioned before, RED can either 'mark' or 'drop'. Explicit Congestion -+Notification allows RED to notify remote hosts that their rate exceeds the -+amount of bandwidth available. Non-ECN capable hosts can only be notified by -+dropping a packet. If this parameter is specified, packets which indicate -+that their hosts honor ECN will only be marked and not dropped, unless the -+queue size hits -+.B limit -+bytes. Needs a tc binary with RED support compiled in. Recommended. -+ -+.SH SEE ALSO -+.BR tc (8) -+ -+.SH SOURCES -+.TP -+o -+Floyd, S., and Jacobson, V., Random Early Detection gateways for -+Congestion Avoidance. http://www.aciri.org/floyd/papers/red/red.html -+.TP -+o -+Some changes to the algorithm by Alexey N. Kuznetsov. -+ -+.SH AUTHORS -+Alexey N. Kuznetsov, , Alexey Makarenko -+, J Hadi Salim . -+This manpage maintained by bert hubert -+ -+ -diff -Naur iproute2-orig/debian/manpages/tc-sfq.8 iproute2/debian/manpages/tc-sfq.8 ---- iproute2-orig/debian/manpages/tc-sfq.8 1969-12-31 16:00:00.000000000 -0800 -+++ iproute2/debian/manpages/tc-sfq.8 2004-05-21 00:09:38.000000000 -0700 -@@ -0,0 +1,107 @@ -+.TH TC 8 "8 December 2001" "iproute2" "Linux" -+.SH NAME -+sfq \- Stochastic Fairness Queueing -+.SH SYNOPSIS -+.B tc qdisc ... perturb -+seconds -+.B quantum -+bytes -+ -+.SH DESCRIPTION -+ -+Stochastic Fairness Queueing is a classless queueing discipline available for -+traffic control with the -+.BR tc (8) -+command. -+ -+SFQ does not shape traffic but only schedules the transmission of packets, based on 'flows'. -+The goal is to ensure fairness so that each flow is able to send data in turn, thus preventing -+any single flow from drowning out the rest. -+ -+This may in fact have some effect in mitigating a Denial of Service attempt. -+ -+SFQ is work-conserving and therefore always delivers a packet if it has one available. -+.SH ALGORITHM -+On enqueueing, each packet is assigned to a hash bucket, based on -+.TP -+(i) -+Source address -+.TP -+(ii) -+Destination address -+.TP -+(iii) -+Source port -+.P -+If these are available. SFQ knows about ipv4 and ipv6 and also UDP, TCP and ESP. -+Packets with other protocols are hashed based on the 32bits representation of their -+destination and the socket they belong to. A flow corresponds mostly to a TCP/IP -+connection. -+ -+Each of these buckets should represent a unique flow. Because multiple flows may -+get hashed to the same bucket, the hashing algorithm is perturbed at configurable -+intervals so that the unfairness lasts only for a short while. Perturbation may -+however cause some inadvertent packet reordering to occur. -+ -+When dequeuing, each hashbucket with data is queried in a round robin fashion. -+ -+The compile time maximum length of the SFQ is 128 packets, which can be spread over -+at most 128 buckets of 1024 available. In case of overflow, tail-drop is performed -+on the fullest bucket, thus maintaining fairness. -+ -+.SH PARAMETERS -+.TP -+perturb -+Interval in seconds for queue algorithm perturbation. Defaults to 0, which means that -+no perturbation occurs. Do not set too low for each perturbation may cause some packet -+reordering. Advised value: 10 -+.TP -+quantum -+Amount of bytes a flow is allowed to dequeue during a round of the round robin process. -+Defaults to the MTU of the interface which is also the advised value and the minimum value. -+ -+.SH EXAMPLE & USAGE -+ -+To attach to device ppp0: -+.P -+# tc qdisc add dev ppp0 root sfq perturb 10 -+.P -+Please note that SFQ, like all non-shaping (work-conserving) qdiscs, is only useful -+if it owns the queue. -+This is the case when the link speed equals the actually available bandwidth. This holds -+for regular phone modems, ISDN connections and direct non-switched ethernet links. -+.P -+Most often, cable modems and DSL devices do not fall into this category. The same holds -+for when connected to a switch and trying to send data to a congested segment also -+connected to the switch. -+.P -+In this case, the effective queue does not reside within Linux and is therefore not -+available for scheduling. -+.P -+Embed SFQ in a classful qdisc to make sure it owns the queue. -+ -+.SH SOURCE -+.TP -+o -+Paul E. McKenney "Stochastic Fairness Queuing", -+IEEE INFOCOMM'90 Proceedings, San Francisco, 1990. -+ -+.TP -+o -+Paul E. McKenney "Stochastic Fairness Queuing", -+"Interworking: Research and Experience", v.2, 1991, p.113-131. -+ -+.TP -+o -+See also: -+M. Shreedhar and George Varghese "Efficient Fair -+Queuing using Deficit Round Robin", Proc. SIGCOMM 95. -+ -+.SH SEE ALSO -+.BR tc (8) -+ -+.SH AUTHOR -+Alexey N. Kuznetsov, . This manpage maintained by -+bert hubert -+ -+ -diff -Naur iproute2-orig/debian/manpages/tc-tbf.8 iproute2/debian/manpages/tc-tbf.8 ---- iproute2-orig/debian/manpages/tc-tbf.8 1969-12-31 16:00:00.000000000 -0800 -+++ iproute2/debian/manpages/tc-tbf.8 2004-05-21 00:09:38.000000000 -0700 -@@ -0,0 +1,138 @@ -+.TH TC 8 "13 December 2001" "iproute2" "Linux" -+.SH NAME -+tbf \- Token Bucket Filter -+.SH SYNOPSIS -+.B tc qdisc ... tbf rate -+rate -+.B burst -+bytes/cell -+.B ( latency -+ms -+.B | limit -+bytes -+.B ) [ mpu -+bytes -+.B [ peakrate -+rate -+.B mtu -+bytes/cell -+.B ] ] -+.P -+burst is also known as buffer and maxburst. mtu is also known as minburst. -+.SH DESCRIPTION -+ -+The Token Bucket Filter is a classless queueing discipline available for -+traffic control with the -+.BR tc (8) -+command. -+ -+TBF is a pure shaper and never schedules traffic. It is non-work-conserving and may throttle -+itself, although packets are available, to ensure that the configured rate is not exceeded. -+On all platforms except for Alpha, -+it is able to shape up to 1mbit/s of normal traffic with ideal minimal burstiness, -+sending out data exactly at the configured rates. -+ -+Much higher rates are possible but at the cost of losing the minimal burstiness. In that -+case, data is on average dequeued at the configured rate but may be sent much faster at millisecond -+timescales. Because of further queues living in network adaptors, this is often not a problem. -+ -+Kernels with a higher 'HZ' can achieve higher rates with perfect burstiness. On Alpha, HZ is ten -+times higher, leading to a 10mbit/s limit to perfection. These calculations hold for packets of on -+average 1000 bytes. -+ -+.SH ALGORITHM -+As the name implies, traffic is filtered based on the expenditure of -+.B tokens. -+Tokens roughly correspond to bytes, with the additional constraint that each packet consumes -+some tokens, no matter how small it is. This reflects the fact that even a zero-sized packet occupies -+the link for some time. -+ -+On creation, the TBF is stocked with tokens which correspond to the amount of traffic that can be burst -+in one go. Tokens arrive at a steady rate, until the bucket is full. -+ -+If no tokens are available, packets are queued, up to a configured limit. The TBF now -+calculates the token deficit, and throttles until the first packet in the queue can be sent. -+ -+If it is not acceptable to burst out packets at maximum speed, a peakrate can be configured -+to limit the speed at which the bucket empties. This peakrate is implemented as a second TBF -+with a very small bucket, so that it doesn't burst. -+ -+To achieve perfection, the second bucket may contain only a single packet, which leads to -+the earlier mentioned 1mbit/s limit. -+ -+This limit is caused by the fact that the kernel can only throttle for at minimum 1 'jiffy', which depends -+on HZ as 1/HZ. For perfect shaping, only a single packet can get sent per jiffy - for HZ=100, this means 100 -+packets of on average 1000 bytes each, which roughly corresponds to 1mbit/s. -+ -+.SH PARAMETERS -+See -+.BR tc (8) -+for how to specify the units of these values. -+.TP -+limit or latency -+Limit is the number of bytes that can be queued waiting for tokens to become -+available. You can also specify this the other way around by setting the -+latency parameter, which specifies the maximum amount of time a packet can -+sit in the TBF. The latter calculation takes into account the size of the -+bucket, the rate and possibly the peakrate (if set). These two parameters -+are mutually exclusive. -+.TP -+burst -+Also known as buffer or maxburst. -+Size of the bucket, in bytes. This is the maximum amount of bytes that tokens can be available for instantaneously. -+In general, larger shaping rates require a larger buffer. For 10mbit/s on Intel, you need at least 10kbyte buffer -+if you want to reach your configured rate! -+ -+If your buffer is too small, packets may be dropped because more tokens arrive per timer tick than fit in your bucket. -+The minimum buffer size can be calculated by dividing the rate by HZ. -+ -+Token usage calculations are performed using a table which by default has a resolution of 8 packets. -+This resolution can be changed by specifying the -+.B cell -+size with the burst. For example, to specify a 6000 byte buffer with a 16 -+byte cell size, set a burst of 6000/16. You will probably never have to set -+this. Must be an integral power of 2. -+.TP -+mpu -+A zero-sized packet does not use zero bandwidth. For ethernet, no packet uses less than 64 bytes. The Minimum Packet Unit -+determines the minimal token usage (specified in bytes) for a packet. Defaults to zero. -+.TP -+rate -+The speed knob. See remarks above about limits! See -+.BR tc (8) -+for units. -+.PP -+Furthermore, if a peakrate is desired, the following parameters are available: -+ -+.TP -+peakrate -+Maximum depletion rate of the bucket. Limited to 1mbit/s on Intel, 10mbit/s on Alpha. The peakrate does -+not need to be set, it is only necessary if perfect millisecond timescale shaping is required. -+ -+.TP -+mtu/minburst -+Specifies the size of the peakrate bucket. For perfect accuracy, should be set to the MTU of the interface. -+If a peakrate is needed, but some burstiness is acceptable, this size can be raised. A 3000 byte minburst -+allows around 3mbit/s of peakrate, given 1000 byte packets. -+ -+Like the regular burstsize you can also specify a -+.B cell -+size. -+.SH EXAMPLE & USAGE -+ -+To attach a TBF with a sustained maximum rate of 0.5mbit/s, a peakrate of 1.0mbit/s, -+a 5kilobyte buffer, with a pre-bucket queue size limit calculated so the TBF causes -+at most 70ms of latency, with perfect peakrate behaviour, issue: -+.P -+# tc qdisc add dev eth0 root tbf rate 0.5mbit \\ -+ burst 5kb latency 70ms peakrate 1mbit \\ -+ minburst 1540 -+ -+.SH SEE ALSO -+.BR tc (8) -+ -+.SH AUTHOR -+Alexey N. Kuznetsov, . This manpage maintained by -+bert hubert -+ -+ -diff -Naur iproute2-orig/debian/manpages/tc.8 iproute2/debian/manpages/tc.8 ---- iproute2-orig/debian/manpages/tc.8 1969-12-31 16:00:00.000000000 -0800 -+++ iproute2/debian/manpages/tc.8 2004-05-21 00:09:38.000000000 -0700 -@@ -0,0 +1,348 @@ -+.TH TC 8 "16 December 2001" "iproute2" "Linux" -+.SH NAME -+tc \- show / manipulate traffic control settings -+.SH SYNOPSIS -+.B tc qdisc [ add | change | replace | link ] dev -+DEV -+.B -+[ parent -+qdisc-id -+.B | root ] -+.B [ handle -+qdisc-id ] qdisc -+[ qdisc specific parameters ] -+.P -+ -+.B tc class [ add | change | replace ] dev -+DEV -+.B parent -+qdisc-id -+.B [ classid -+class-id ] qdisc -+[ qdisc specific parameters ] -+.P -+ -+.B tc filter [ add | change | replace ] dev -+DEV -+.B [ parent -+qdisc-id -+.B | root ] protocol -+protocol -+.B prio -+priority filtertype -+[ filtertype specific parameters ] -+.B flowid -+flow-id -+ -+.B tc [-s | -d ] qdisc show [ dev -+DEV -+.B ] -+.P -+.B tc [-s | -d ] class show dev -+DEV -+.P -+.B tc filter show dev -+DEV -+ -+.SH DESCRIPTION -+.B Tc -+is used to configure Traffic Control in the Linux kernel. Traffic Control consists -+of the following: -+ -+.TP -+SHAPING -+When traffic is shaped, its rate of transmission is under control. Shaping may -+be more than lowering the available bandwidth - it is also used to smooth out -+bursts in traffic for better network behaviour. Shaping occurs on egress. -+ -+.TP -+SCHEDULING -+By scheduling the transmission of packets it is possible to improve interactivity -+for traffic that needs it while still guaranteeing bandwidth to bulk transfers. Reordering -+is also called prioritizing, and happens only on egress. -+ -+.TP -+POLICING -+Where shaping deals with transmission of traffic, policing pertains to traffic -+arriving. Policing thus occurs on ingress. -+ -+.TP -+DROPPING -+Traffic exceeding a set bandwidth may also be dropped forthwith, both on -+ingress and on egress. -+ -+.P -+Processing of traffic is controlled by three kinds of objects: qdiscs, -+classes and filters. -+ -+.SH QDISCS -+.B qdisc -+is short for 'queueing discipline' and it is elementary to -+understanding traffic control. Whenever the kernel needs to send a -+packet to an interface, it is -+.B enqueued -+to the qdisc configured for that interface. Immediately afterwards, the kernel -+tries to get as many packets as possible from the qdisc, for giving them -+to the network adaptor driver. -+ -+A simple QDISC is the 'pfifo' one, which does no processing at all and is a pure -+First In, First Out queue. It does however store traffic when the network interface -+can't handle it momentarily. -+ -+.SH CLASSES -+Some qdiscs can contain classes, which contain further qdiscs - traffic may -+then be enqueued in any of the inner qdiscs, which are within the -+.B classes. -+When the kernel tries to dequeue a packet from such a -+.B classful qdisc -+it can come from any of the classes. A qdisc may for example prioritize -+certain kinds of traffic by trying to dequeue from certain classes -+before others. -+ -+.SH FILTERS -+A -+.B filter -+is used by a classful qdisc to determine in which class a packet will -+be enqueued. Whenever traffic arrives at a class with subclasses, it needs -+to be classified. Various methods may be employed to do so, one of these -+are the filters. All filters attached to the class are called, until one of -+them returns with a verdict. If no verdict was made, other criteria may be -+available. This differs per qdisc. -+ -+It is important to notice that filters reside -+.B within -+qdiscs - they are not masters of what happens. -+ -+.SH CLASSLESS QDISCS -+The classless qdiscs are: -+.TP -+[p|b]fifo -+Simplest usable qdisc, pure First In, First Out behaviour. Limited in -+packets or in bytes. -+.TP -+pfifo_fast -+Standard qdisc for 'Advanced Router' enabled kernels. Consists of a three-band -+queue which honors Type of Service flags, as well as the priority that may be -+assigned to a packet. -+.TP -+red -+Random Early Detection simulates physical congestion by randomly dropping -+packets when nearing configured bandwidth allocation. Well suited to very -+large bandwidth applications. -+.TP -+sfq -+Stochastic Fairness Queueing reorders queued traffic so each 'session' -+gets to send a packet in turn. -+.TP -+tbf -+The Token Bucket Filter is suited for slowing traffic down to a precisely -+configured rate. Scales well to large bandwidths. -+.SH CONFIGURING CLASSLESS QDISCS -+In the absence of classful qdiscs, classless qdiscs can only be attached at -+the root of a device. Full syntax: -+.P -+.B tc qdisc add dev -+DEV -+.B root -+QDISC QDISC-PARAMETERS -+ -+To remove, issue -+.P -+.B tc qdisc del dev -+DEV -+.B root -+ -+The -+.B pfifo_fast -+qdisc is the automatic default in the absence of a configured qdisc. -+ -+.SH CLASSFUL QDISCS -+The classful qdiscs are: -+.TP -+CBQ -+Class Based Queueing implements a rich linksharing hierarchy of classes. -+It contains shaping elements as well as prioritizing capabilities. Shaping is -+performed using link idle time calculations based on average packet size and -+underlying link bandwidth. The latter may be ill-defined for some interfaces. -+.TP -+HTB -+The Hierarchy Token Bucket implements a rich linksharing hierarchy of -+classes with an emphasis on conforming to existing practices. HTB facilitates -+guaranteeing bandwidth to classes, while also allowing specification of upper -+limits to inter-class sharing. It contains shaping elements, based on TBF and -+can prioritize classes. -+.TP -+PRIO -+The PRIO qdisc is a non-shaping container for a configurable number of -+classes which are dequeued in order. This allows for easy prioritization -+of traffic, where lower classes are only able to send if higher ones have -+no packets available. To facilitate configuration, Type Of Service bits are -+honored by default. -+.SH THEORY OF OPERATION -+Classes form a tree, where each class has a single parent. -+A class may have multiple children. Some qdiscs allow for runtime addition -+of classes (CBQ, HTB) while others (PRIO) are created with a static number of -+children. -+ -+Qdiscs which allow dynamic addition of classes can have zero or more -+subclasses to which traffic may be enqueued. -+ -+Furthermore, each class contains a -+.B leaf qdisc -+which by default has -+.B pfifo -+behaviour though another qdisc can be attached in place. This qdisc may again -+contain classes, but each class can have only one leaf qdisc. -+ -+When a packet enters a classful qdisc it can be -+.B classified -+to one of the classes within. Three criteria are available, although not all -+qdiscs will use all three: -+.TP -+tc filters -+If tc filters are attached to a class, they are consulted first -+for relevant instructions. Filters can match on all fields of a packet header, -+as well as on the firewall mark applied by ipchains or iptables. See -+.BR tc-filters (8). -+.TP -+Type of Service -+Some qdiscs have built in rules for classifying packets based on the TOS field. -+.TP -+skb->priority -+Userspace programs can encode a class-id in the 'skb->priority' field using -+the SO_PRIORITY option. -+.P -+Each node within the tree can have its own filters but higher level filters -+may also point directly to lower classes. -+ -+If classification did not succeed, packets are enqueued to the leaf qdisc -+attached to that class. Check qdisc specific manpages for details, however. -+ -+.SH NAMING -+All qdiscs, classes and filters have IDs, which can either be specified -+or be automatically assigned. -+ -+IDs consist of a major number and a minor number, separated by a colon. -+ -+.TP -+QDISCS -+A qdisc, which potentially can have children, -+gets assigned a major number, called a 'handle', leaving the minor -+number namespace available for classes. The handle is expressed as '10:'. -+It is customary to explicitly assign a handle to qdiscs expected to have -+children. -+ -+.TP -+CLASSES -+Classes residing under a qdisc share their qdisc major number, but each have -+a separate minor number called a 'classid' that has no relation to their -+parent classes, only to their parent qdisc. The same naming custom as for -+qdiscs applies. -+ -+.TP -+FILTERS -+Filters have a three part ID, which is only needed when using a hashed -+filter hierarchy, for which see -+.BR tc-filters (8). -+.SH UNITS -+All parameters accept a floating point number, possibly followed by a unit. -+.P -+Bandwidths or rates can be specified in: -+.TP -+kbps -+Kilobytes per second -+.TP -+mbps -+Megabytes per second -+.TP -+kbit -+Kilobits per second -+.TP -+mbit -+Megabits per second -+.TP -+bps or a bare number -+Bytes per second -+.P -+Amounts of data can be specified in: -+.TP -+kb or k -+Kilobytes -+.TP -+mb or m -+Megabytes -+.TP -+mbit -+Megabits -+.TP -+kbit -+Kilobits -+.TP -+b or a bare number -+Bytes. -+.P -+Lengths of time can be specified in: -+.TP -+s, sec or secs -+Whole seconds -+.TP -+ms, msec or msecs -+Milliseconds -+.TP -+us, usec, usecs or a bare number -+Microseconds. -+ -+.SH TC COMMANDS -+The following commands are available for qdiscs, classes and filter: -+.TP -+add -+Add a qdisc, class or filter to a node. For all entities, a -+.B parent -+must be passed, either by passing its ID or by attaching directly to the root of a device. -+When creating a qdisc or a filter, it can be named with the -+.B handle -+parameter. A class is named with the -+.B classid -+parameter. -+ -+.TP -+remove -+A qdisc can be removed by specifying its handle, which may also be 'root'. All subclasses and their leaf qdiscs -+are automatically deleted, as well as any filters attached to them. -+ -+.TP -+change -+Some entities can be modified 'in place'. Shares the syntax of 'add', with the exception -+that the handle cannot be changed and neither can the parent. In other words, -+.B -+change -+cannot move a node. -+ -+.TP -+replace -+Performs a nearly atomic remove/add on an existing node id. If the node does not exist yet -+it is created. -+ -+.TP -+link -+Only available for qdiscs and performs a replace where the node -+must exist already. -+ -+ -+.SH HISTORY -+.B tc -+was written by Alexey N. Kuznetsov and added in Linux 2.2. -+.SH SEE ALSO -+.BR tc-cbq (8), -+.BR tc-htb (8), -+.BR tc-sfq (8), -+.BR tc-red (8), -+.BR tc-tbf (8), -+.BR tc-pfifo (8), -+.BR tc-bfifo (8), -+.BR tc-pfifo_fast (8), -+.BR tc-filters (8) -+ -+.SH AUTHOR -+Manpage maintained by bert hubert (ahu@ds9a.nl) -+ -diff -Naur iproute2-orig/debian/postinst iproute2/debian/postinst ---- iproute2-orig/debian/postinst 1969-12-31 16:00:00.000000000 -0800 -+++ iproute2/debian/postinst 2004-05-21 00:09:38.000000000 -0700 -@@ -0,0 +1,6 @@ -+#!/bin/sh -e -+ -+# FHS: -+if [ "$1" = "configure" -a -d /usr/doc -a ! -e /usr/doc/iproute ]; then -+ ln -sf ../share/doc/iproute /usr/doc/iproute -+fi -diff -Naur iproute2-orig/debian/postrm iproute2/debian/postrm ---- iproute2-orig/debian/postrm 1969-12-31 16:00:00.000000000 -0800 -+++ iproute2/debian/postrm 2004-05-21 00:09:38.000000000 -0700 -@@ -0,0 +1,6 @@ -+#!/bin/sh -+ -+if [ "$1" = "purge" ] -+then -+ rm -rf /etc/iproute2 -+fi -diff -Naur iproute2-orig/debian/prerm iproute2/debian/prerm ---- iproute2-orig/debian/prerm 1969-12-31 16:00:00.000000000 -0800 -+++ iproute2/debian/prerm 2004-05-21 00:09:38.000000000 -0700 -@@ -0,0 +1,5 @@ -+#!/bin/sh -e -+ -+if [ \( "$1" = "upgrade" -o "$1" = "remove" \) -a -L /usr/doc/iproute ]; then -+ rm -f /usr/doc/iproute -+fi -diff -Naur iproute2-orig/debian/rules iproute2/debian/rules ---- iproute2-orig/debian/rules 1969-12-31 16:00:00.000000000 -0800 -+++ iproute2/debian/rules 2004-05-21 00:09:38.000000000 -0700 -@@ -0,0 +1,85 @@ -+#!/usr/bin/make -f -+# -+# Copyright (C) 1999 Roberto Lumbreras -+# Copyright (C) 1999-2002 Juan Cespedes -+# Copying: GPL -+ -+SHELL = bash -+ -+PACKAGE = $(shell perl -e 'print <> =~ /^(.*) \(.*\)/' debian/changelog) -+PKG_VER = $(shell perl -e 'print <> =~ /\((.*)\)/' debian/changelog) -+PKG_UPVER= $(shell perl -e 'print <> =~ /\((.*)-[^-]*\)/' debian/changelog) -+ -+BINS = ip/ip -+SBINS = ip/rtmon ip/rtacct tc/tc -+SHBINS = ip/routef ip/routel # ip/ifcfg ip/rtpr -+DOCS = README* doc/Plan debian/README.Debian -+MAN8 = debian/manpages/*.8 -+MANLINKS= rtmon rtacct routef routel -+TEXDOCS = ip-cref ip-tunnels api-ip6-flowlabels -+ -+build: stamp-build -+ -+stamp-build: -+ test -f include-glibc/netinet/in.h.orig || \ -+ mv include-glibc/netinet/in.h \ -+ include-glibc/netinet/in.h.orig -+ $(MAKE) KERNEL_INCLUDE=/usr/include -+ $(MAKE) -C doc -+ touch stamp-build -+ -+binary: binary-indep binary-arch -+ -+binary-indep: -+ -+binary-arch: checkroot stamp-build -+ $(RM) -r debian/tmp -+ install -d -m0755 debian/tmp/{DEBIAN,bin,sbin,usr/{bin,share/doc/$(PACKAGE),share/man/man{7,8}}} -+ install -s -m0755 $(BINS) debian/tmp/bin/ -+ install -s -m0755 $(SBINS) debian/tmp/sbin/ -+ ln -s /bin/ip debian/tmp/sbin/ip -+ install -m0755 $(SHBINS) debian/tmp/usr/bin/ -+ cp -p $(DOCS) debian/tmp/usr/share/doc/$(PACKAGE)/ -+ cp -rp examples debian/tmp/usr/share/doc/$(PACKAGE)/ -+ find debian/tmp/usr/share/doc/$(PACKAGE)/examples -type f -exec chmod -x {} \; -+ install -m0644 debian/changelog debian/tmp/usr/share/doc/$(PACKAGE)/changelog.Debian -+ cp -p RELNOTES debian/tmp/usr/share/doc/$(PACKAGE)/changelog -+ for i in $(TEXDOCS); do \ -+ install -m0644 doc/$$i.tex debian/tmp/usr/share/doc/$(PACKAGE)/; \ -+ install -m0644 doc/$$i.dvi debian/tmp/usr/share/doc/$(PACKAGE)/; \ -+ install -m0644 doc/$$i.ps debian/tmp/usr/share/doc/$(PACKAGE)/; \ -+ done -+ install -m0644 $(MAN8) debian/tmp/usr/share/man/man8/ -+ gzip -9fr debian/tmp/usr/share || true -+ ln -s tc-pbfifo.8.gz debian/tmp/usr/share/man/man8/tc-pfifo.8.gz -+ ln -s tc-pbfifo.8.gz debian/tmp/usr/share/man/man8/tc-bfifo.8.gz -+ for i in $(MANLINKS); do \ -+ ln -s ../man7/undocumented.7.gz debian/tmp/usr/share/man/man8/$$i.8.gz; \ -+ done -+ cp -p debian/copyright debian/tmp/usr/share/doc/$(PACKAGE)/ -+ cp -rp etc debian/tmp/ -+ install -m0644 debian/conffiles debian/tmp/DEBIAN/ -+ -+ dpkg-shlibdeps $(BINS) $(SBINS) -+ dpkg-gencontrol -isp -+ chown -R root.root debian/tmp -+ chmod -R u=rwX,go=rX debian/tmp -+ dpkg --build debian/tmp .. -+ -+checkdir: -+ @test -f debian/rules -+ -+checkroot: checkdir -+ @test 0 = `id -u` || { echo "Error: not super-user"; exit 1; } -+ -+clean: checkdir debian/control -+ $(RM) stamp-build debian/files debian/substvars -+ $(MAKE) clean -+ $(MAKE) -C doc clean -+ $(RM) `find . -name "*~" -o -name core` -+ $(RM) -r debian/tmp -+ test -f include-glibc/netinet/in.h.orig && \ -+ mv include-glibc/netinet/in.h.orig \ -+ include-glibc/netinet/in.h || true -+ -+.PHONY: build binary binary-arch binary-indep checkdir checkroot clean -diff -Naur iproute2-orig/debian/tc-cbq.8 iproute2/debian/tc-cbq.8 ---- iproute2-orig/debian/tc-cbq.8 1969-12-31 16:00:00.000000000 -0800 -+++ iproute2/debian/tc-cbq.8 2004-05-21 00:09:38.000000000 -0700 -@@ -0,0 +1,353 @@ -+.TH CBQ 8 "16 December 2001" "iproute2" "Linux" -+.SH NAME -+CBQ \- Class Based Queueing -+.SH SYNOPSIS -+.B tc qdisc ... dev -+dev -+.B ( parent -+classid -+.B | root) [ handle -+major: -+.B ] cbq [ allot -+bytes -+.B ] avpkt -+bytes -+.B bandwidth -+rate -+.B [ cell -+bytes -+.B ] [ ewma -+log -+.B ] [ mpu -+bytes -+.B ] -+ -+.B tc class ... dev -+dev -+.B parent -+major:[minor] -+.B [ classid -+major:minor -+.B ] cbq allot -+bytes -+.B [ bandwidth -+rate -+.B ] [ rate -+rate -+.B ] prio -+priority -+.B [ weight -+weight -+.B ] [ minburst -+packets -+.B ] [ maxburst -+packets -+.B ] [ ewma -+log -+.B ] [ cell -+bytes -+.B ] avpkt -+bytes -+.B [ mpu -+bytes -+.B ] [ bounded isolated ] [ split -+handle -+.B & defmap -+defmap -+.B ] [ estimator -+interval timeconstant -+.B ] -+ -+.SH DESCRIPTION -+Class Based Queueing is a classful qdisc that implements a rich -+linksharing hierarchy of classes. It contains shaping elements as -+well as prioritizing capabilities. Shaping is performed using link -+idle time calculations based on the timing of dequeue events and -+underlying link bandwidth. -+ -+.SH SHAPING ALGORITHM -+When shaping a 10mbit/s connection to 1mbit/s, the link will -+be idle 90% of the time. If it isn't, it needs to be throttled so that it -+IS idle 90% of the time. -+ -+During operations, the effective idletime is measured using an -+exponential weighted moving average (EWMA), which considers recent -+packets to be exponentially more important than past ones. The Unix -+loadaverage is calculated in the same way. -+ -+The calculated idle time is subtracted from the EWMA measured one, -+the resulting number is called 'avgidle'. A perfectly loaded link has -+an avgidle of zero: packets arrive exactly at the calculated -+interval. -+ -+An overloaded link has a negative avgidle and if it gets too negative, -+CBQ throttles and is then 'overlimit'. -+ -+Conversely, an idle link might amass a huge avgidle, which would then -+allow infinite bandwidths after a few hours of silence. To prevent -+this, avgidle is capped at -+.B maxidle. -+ -+If overlimit, in theory, the CBQ could throttle itself for exactly the -+amount of time that was calculated to pass between packets, and then -+pass one packet, and throttle again. Due to timer resolution constraints, -+this may not be feasible, see the -+.B minburst -+parameter below. -+ -+.SH CLASSIFICATION -+Within the one CBQ instance many classes may exist. Each of these classes -+contains another qdisc, by default -+.BR tc-pfifo (8). -+ -+When enqueueing a packet, CBQ starts at the root and uses various methods to -+determine which class should receive the data. -+ -+In the absence of uncommon configuration options, the process is rather easy. -+At each node we look for an instruction, and then go to the class the -+instruction refers us to. If the class found is a barren leaf-node (without -+children), we enqueue the packet there. If it is not yet a leaf node, we do -+the whole thing over again starting from that node. -+ -+The following actions are performed, in order at each node we visit, until one -+sends us to another node, or terminates the process. -+.TP -+(i) -+Consult filters attached to the class. If sent to a leafnode, we are done. -+Otherwise, restart. -+.TP -+(ii) -+Consult the defmap for the priority assigned to this packet, which depends -+on the TOS bits. Check if the referral is leafless, otherwise restart. -+.TP -+(iii) -+Ask the defmap for instructions for the 'best effort' priority. Check the -+answer for leafness, otherwise restart. -+.TP -+(iv) -+If none of the above returned with an instruction, enqueue at this node. -+.P -+This algorithm makes sure that a packet always ends up somewhere, even while -+you are busy building your configuration. -+ -+For more details, see -+.BR tc-cbq-details(8). -+ -+.SH LINK SHARING ALGORITHM -+When dequeuing for sending to the network device, CBQ decides which of its -+classes will be allowed to send. It does so with a Weighted Round Robin process -+in which each class with packets gets a chance to send in turn. The WRR process -+starts by asking the highest priority classes (lowest numerically - -+highest semantically) for packets, and will continue to do so until they -+have no more data to offer, in which case the process repeats for lower -+priorities. -+ -+Classes by default borrow bandwidth from their siblings. A class can be -+prevented from doing so by declaring it 'bounded'. A class can also indicate -+its unwillingness to lend out bandwidth by being 'isolated'. -+ -+.SH QDISC -+The root of a CBQ qdisc class tree has the following parameters: -+ -+.TP -+parent major:minor | root -+This mandatory parameter determines the place of the CBQ instance, either at the -+.B root -+of an interface or within an existing class. -+.TP -+handle major: -+Like all other qdiscs, the CBQ can be assigned a handle. Should consist only -+of a major number, followed by a colon. Optional, but very useful if classes -+will be generated within this qdisc. -+.TP -+allot bytes -+This allotment is the 'chunkiness' of link sharing and is used for determining packet -+transmission time tables. The qdisc allot differs slightly from the class allot discussed -+below. Optional. Defaults to a reasonable value, related to avpkt. -+.TP -+avpkt bytes -+The average size of a packet is needed for calculating maxidle, and is also used -+for making sure 'allot' has a safe value. Mandatory. -+.TP -+bandwidth rate -+To determine the idle time, CBQ must know the bandwidth of your underlying -+physical interface, or parent qdisc. This is a vital parameter, more about it -+later. Mandatory. -+.TP -+cell -+The cell size determines he granularity of packet transmission time calculations. Has a sensible default. -+.TP -+mpu -+A zero sized packet may still take time to transmit. This value is the lower -+cap for packet transmission time calculations - packets smaller than this value -+are still deemed to have this size. Defaults to zero. -+.TP -+ewma log -+When CBQ needs to measure the average idle time, it does so using an -+Exponentially Weighted Moving Average which smoothes out measurements into -+a moving average. The EWMA LOG determines how much smoothing occurs. Lower -+values imply greater sensitivity. Must be between 0 and 31. Defaults -+to 5. -+.P -+A CBQ qdisc does not shape out of its own accord. It only needs to know certain -+parameters about the underlying link. Actual shaping is done in classes. -+ -+.SH CLASSES -+Classes have a host of parameters to configure their operation. -+ -+.TP -+parent major:minor -+Place of this class within the hierarchy. If attached directly to a qdisc -+and not to another class, minor can be omitted. Mandatory. -+.TP -+classid major:minor -+Like qdiscs, classes can be named. The major number must be equal to the -+major number of the qdisc to which it belongs. Optional, but needed if this -+class is going to have children. -+.TP -+weight weight -+When dequeuing to the interface, classes are tried for traffic in a -+round-robin fashion. Classes with a higher configured qdisc will generally -+have more traffic to offer during each round, so it makes sense to allow -+it to dequeue more traffic. All weights under a class are normalized, so -+only the ratios matter. Defaults to the configured rate, unless the priority -+of this class is maximal, in which case it is set to 1. -+.TP -+allot bytes -+Allot specifies how many bytes a qdisc can dequeue -+during each round of the process. This parameter is weighted using the -+renormalized class weight described above. Silently capped at a minimum of -+3/2 avpkt. Mandatory. -+ -+.TP -+prio priority -+In the round-robin process, classes with the lowest priority field are tried -+for packets first. Mandatory. -+ -+.TP -+avpkt -+See the QDISC section. -+ -+.TP -+rate rate -+Maximum rate this class and all its children combined can send at. Mandatory. -+ -+.TP -+bandwidth rate -+This is different from the bandwidth specified when creating a CBQ disc! Only -+used to determine maxidle and offtime, which are only calculated when -+specifying maxburst or minburst. Mandatory if specifying maxburst or minburst. -+ -+.TP -+maxburst -+This number of packets is used to calculate maxidle so that when -+avgidle is at maxidle, this number of average packets can be burst -+before avgidle drops to 0. Set it higher to be more tolerant of -+bursts. You can't set maxidle directly, only via this parameter. -+ -+.TP -+minburst -+As mentioned before, CBQ needs to throttle in case of -+overlimit. The ideal solution is to do so for exactly the calculated -+idle time, and pass 1 packet. However, Unix kernels generally have a -+hard time scheduling events shorter than 10ms, so it is better to -+throttle for a longer period, and then pass minburst packets in one -+go, and then sleep minburst times longer. -+ -+The time to wait is called the offtime. Higher values of minburst lead -+to more accurate shaping in the long term, but to bigger bursts at -+millisecond timescales. Optional. -+ -+.TP -+minidle -+If avgidle is below 0, we are overlimits and need to wait until -+avgidle will be big enough to send one packet. To prevent a sudden -+burst from shutting down the link for a prolonged period of time, -+avgidle is reset to minidle if it gets too low. -+ -+Minidle is specified in negative microseconds, so 10 means that -+avgidle is capped at -10us. Optional. -+ -+.TP -+bounded -+Signifies that this class will not borrow bandwidth from its siblings. -+.TP -+isolated -+Means that this class will not borrow bandwidth to its siblings -+ -+.TP -+split major:minor & defmap bitmap[/bitmap] -+If consulting filters attached to a class did not give a verdict, -+CBQ can also classify based on the packet's priority. There are 16 -+priorities available, numbered from 0 to 15. -+ -+The defmap specifies which priorities this class wants to receive, -+specified as a bitmap. The Least Significant Bit corresponds to priority -+zero. The -+.B split -+parameter tells CBQ at which class the decision must be made, which should -+be a (grand)parent of the class you are adding. -+ -+As an example, 'tc class add ... classid 10:1 cbq .. split 10:0 defmap c0' -+configures class 10:0 to send packets with priorities 6 and 7 to 10:1. -+ -+The complimentary configuration would then -+be: 'tc class add ... classid 10:2 cbq ... split 10:0 defmap 3f' -+Which would send all packets 0, 1, 2, 3, 4 and 5 to 10:1. -+.TP -+estimator interval timeconstant -+CBQ can measure how much bandwidth each class is using, which tc filters -+can use to classify packets with. In order to determine the bandwidth -+it uses a very simple estimator that measures once every -+.B interval -+microseconds how much traffic has passed. This again is a EWMA, for which -+the time constant can be specified, also in microseconds. The -+.B time constant -+corresponds to the sluggishness of the measurement or, conversely, to the -+sensitivity of the average to short bursts. Higher values mean less -+sensitivity. -+ -+.SH BUGS -+The actual bandwidth of the underlying link may not be known, for example -+in the case of PPoE or PPTP connections which in fact may send over a -+pipe, instead of over a physical device. CBQ is quite resilient to major -+errors in the configured bandwidth, probably a the cost of coarser shaping. -+ -+Default kernels rely on coarse timing information for making decisions. These -+may make shaping precise in the long term, but inaccurate on second long scales. -+ -+See -+.BR tc-cbq-details(8) -+for hints on how to improve this. -+ -+.SH SOURCES -+.TP -+o -+Sally Floyd and Van Jacobson, "Link-sharing and Resource -+Management Models for Packet Networks", -+IEEE/ACM Transactions on Networking, Vol.3, No.4, 1995 -+ -+.TP -+o -+Sally Floyd, "Notes on CBQ and Guaranteed Service", 1995 -+ -+.TP -+o -+Sally Floyd, "Notes on Class-Based Queueing: Setting -+Parameters", 1996 -+ -+.TP -+o -+Sally Floyd and Michael Speer, "Experimental Results -+for Class-Based Queueing", 1998, not published. -+ -+ -+ -+.SH SEE ALSO -+.BR tc (8) -+ -+.SH AUTHOR -+Alexey N. Kuznetsov, . This manpage maintained by -+bert hubert -+ -+ -diff -Naur iproute2-orig/debian/tc-htb.8 iproute2/debian/tc-htb.8 ---- iproute2-orig/debian/tc-htb.8 1969-12-31 16:00:00.000000000 -0800 -+++ iproute2/debian/tc-htb.8 2004-05-21 00:09:38.000000000 -0700 -@@ -0,0 +1,153 @@ -+.TH HTB 8 "10 January 2002" "iproute2" "Linux" -+.SH NAME -+HTB \- Hierarchy Token Bucket -+.SH SYNOPSIS -+.B tc qdisc ... dev -+dev -+.B ( parent -+classid -+.B | root) [ handle -+major: -+.B ] htb [ default -+minor-id -+.B ] -+ -+.B tc class ... dev -+dev -+.B parent -+major:[minor] -+.B [ classid -+major:minor -+.B ] htb rate -+rate -+.B [ ceil -+rate -+.B ] burst -+bytes -+.B [ cburst -+bytes -+.B ] [ prio -+priority -+.B ] -+ -+.SH DESCRIPTION -+HTB is meant as a more understandable and intuitive replacement for -+the CBQ qdisc in Linux. Both CBQ and HTB help you to control the use -+of the outbound bandwidth on a given link. Both allow you to use one -+physical link to simulate several slower links and to send different -+kinds of traffic on different simulated links. In both cases, you have -+to specify how to divide the physical link into simulated links and -+how to decide which simulated link to use for a given packet to be sent. -+ -+Unlike CBQ, HTB shapes traffic based on the Token Bucket Filter algorithm -+which does not depend on interface characteristics and so does not need to -+know the underlying bandwidth of the outgoing interface. -+ -+.SH SHAPING ALGORITHM -+Shaping works as documented in -+.B tc-tbf (8). -+ -+.SH CLASSIFICATION -+Within the one HRB instance many classes may exist. Each of these classes -+contains another qdisc, by default -+.BR tc-pfifo (8). -+ -+When enqueueing a packet, HTB starts at the root and uses various methods to -+determine which class should receive the data. -+ -+In the absence of uncommon configuration options, the process is rather easy. -+At each node we look for an instruction, and then go to the class the -+instruction refers us to. If the class found is a barren leaf-node (without -+children), we enqueue the packet there. If it is not yet a leaf node, we do -+the whole thing over again starting from that node. -+ -+The following actions are performed, in order at each node we visit, until one -+sends us to another node, or terminates the process. -+.TP -+(i) -+Consult filters attached to the class. If sent to a leafnode, we are done. -+Otherwise, restart. -+.TP -+(ii) -+If none of the above returned with an instruction, enqueue at this node. -+.P -+This algorithm makes sure that a packet always ends up somewhere, even while -+you are busy building your configuration. -+ -+.SH LINK SHARING ALGORITHM -+FIXME -+ -+.SH QDISC -+The root of a CBQ qdisc class tree has the following parameters: -+ -+.TP -+parent major:minor | root -+This mandatory parameter determines the place of the CBQ instance, either at the -+.B root -+of an interface or within an existing class. -+.TP -+handle major: -+Like all other qdiscs, the CBQ can be assigned a handle. Should consist only -+of a major number, followed by a colon. Optional, but very useful if classes -+will be generated within this qdisc. -+.TP -+default minor-id -+Unclassified traffic gets sent to the class with this minor-id. -+ -+.SH CLASSES -+Classes have a host of parameters to configure their operation. -+ -+.TP -+parent major:minor -+Place of this class within the hierarchy. If attached directly to a qdisc -+and not to another class, minor can be omitted. Mandatory. -+.TP -+classid major:minor -+Like qdiscs, classes can be named. The major number must be equal to the -+major number of the qdisc to which it belongs. Optional, but needed if this -+class is going to have children. -+.TP -+prio priority -+In the round-robin process, classes with the lowest priority field are tried -+for packets first. Mandatory. -+ -+.TP -+rate rate -+Maximum rate this class and all its children are guaranteed. Mandatory. -+ -+.TP -+ceil rate -+Maximum rate at which a class can send, if its parent has bandwidth to spare. -+Defaults to the configured rate, which implies no borrowing -+ -+.TP -+burst bytes -+Amount of bytes that can be burst at -+.B ceil -+speed, in excess of the configured -+.B rate. -+Should be at least as high as the highest burst of all children. -+ -+.TP -+cburst bytes -+Amount of bytes that can be burst at 'infinite' speed, in other words, as fast -+as the interface can transmit them. For perfect evening out, should be equal to at most one average -+packet. Should be at least as high as the highest cburst of all children. -+ -+.SH NOTES -+Due to Unix timing constraints, the maximum ceil rate is not infinite and may in fact be quite low. On Intel, -+there are 100 timer events per second, the maximum rate is that rate at which 'burst' bytes are sent each timer tick. -+From this, the mininum burst size for a specified rate can be calculated. For i386, a 10mbit rate requires a 12 kilobyte -+burst as 100*12kb*8 equals 10mbit. -+ -+.SH BUGS -+Not in the stock kernel yet. -+ -+.SH SEE ALSO -+.BR tc (8) -+.P -+HTB website: http://luxik.cdi.cz/~devik/qos/htb/ -+.SH AUTHOR -+Martin Devera . This manpage maintained by bert hubert -+ -+ -diff -Naur iproute2-orig/debian/tc-pbfifo.8 iproute2/debian/tc-pbfifo.8 ---- iproute2-orig/debian/tc-pbfifo.8 1969-12-31 16:00:00.000000000 -0800 -+++ iproute2/debian/tc-pbfifo.8 2004-05-21 00:09:38.000000000 -0700 -@@ -0,0 +1,72 @@ -+.TH PBFIFO 8 "10 January 2002" "iproute2" "Linux" -+.SH NAME -+pfifo \- Packet limited First In, First Out queue -+.P -+bfifo \- Byte limited First In, First Out queue -+ -+.SH SYNOPSIS -+.B tc qdisc ... add pfifo -+.B [ limit -+packets -+.B ] -+.P -+.B tc qdisc ... add bfifo -+.B [ limit -+bytes -+.B ] -+ -+.SH DESCRIPTION -+The pfifo and bfifo qdiscs are unadorned First In, First Out queues. They are the -+simplest queues possible and therefore have no overhead. -+.B pfifo -+constrains the queue size as measured in packets. -+.B bfifo -+does so as measured in bytes. -+ -+Like all non-default qdiscs, they maintain statistics. This might be a reason to prefer -+pfifo or bfifo over the default. -+ -+.SH ALGORITHM -+A list of packets is maintained, when a packet is enqueued it gets inserted at the tail of -+a list. When a packet needs to be sent out to the network, it is taken from the head of the list. -+ -+If the list is too long, no further packets are allowed on. This is called 'tail drop'. -+ -+.SH PARAMETERS -+.TP -+limit -+Maximum queue size. Specified in bytes for bfifo, in packets for pfifo. For pfifo, defaults -+to the interface txqueuelen, as specified with -+.BR ifconfig (8) -+or -+.BR ip (8). -+ -+For bfifo, it defaults to the txqueuelen multiplied by the interface MTU. -+ -+.SH OUTPUT -+The output of -+.B tc -s qdisc ls -+contains the limit, either in packets or in bytes, and the number of bytes -+and packets actually sent. An unsent and dropped packet only appears between braces -+and is not counted as 'Sent'. -+ -+In this example, the queue length is 100 packets, 45894 bytes were sent over 681 packets. -+No packets were dropped, and as the pfifo queue does not slow down packets, there were also no -+overlimits: -+.P -+.nf -+# tc -s qdisc ls dev eth0 -+qdisc pfifo 8001: dev eth0 limit 100p -+ Sent 45894 bytes 681 pkts (dropped 0, overlimits 0) -+.fi -+ -+If a backlog occurs, this is displayed as well. -+.SH SEE ALSO -+.BR tc (8) -+ -+.SH AUTHORS -+Alexey N. Kuznetsov, -+ -+This manpage maintained by bert hubert -+ -+ -diff -Naur iproute2-orig/debian/tc-pfifo_fast.8 iproute2/debian/tc-pfifo_fast.8 ---- iproute2-orig/debian/tc-pfifo_fast.8 1969-12-31 16:00:00.000000000 -0800 -+++ iproute2/debian/tc-pfifo_fast.8 2004-05-21 00:09:38.000000000 -0700 -@@ -0,0 +1,59 @@ -+.TH PFIFO_FAST 8 "10 January 2002" "iproute2" "Linux" -+.SH NAME -+pfifo_fast \- three-band first in, first out queue -+ -+.SH DESCRIPTION -+pfifo_fast is the default qdisc of each interface. -+ -+Whenever an interface is created, the pfifo_fast qdisc is automatically used -+as a queue. If another qdisc is attached, it preempts the default -+pfifo_fast, which automatically returns to function when an existing qdisc -+is detached. -+ -+In this sense this qdisc is magic, and unlike other qdiscs. -+ -+.SH ALGORITHM -+The algorithm is very similar to that of the classful -+.BR tc-prio (8) -+qdisc. -+.B pfifo_fast -+is like three -+.BR tc-pfifo (8) -+queues side by side, where packets can be enqueued in any of the three bands -+based on their Type of Service bits or assigned priority. -+ -+Not all three bands are dequeued simultaneously - as long as lower bands -+have traffic, higher bands are never dequeued. This can be used to -+prioritize interactive traffic or penalize 'lowest cost' traffic. -+ -+Each band can be txqueuelen packets long, as configured with -+.BR ifconfig (8) -+or -+.BR ip (8). -+Additional packets coming in are not enqueued but are instead dropped. -+ -+See -+.BR tc-prio (8) -+for complete details on how TOS bits are translated into bands. -+.SH PARAMETERS -+.TP -+txqueuelen -+The length of the three bands depends on the interface txqueuelen, as -+specified with -+.BR ifconfig (8) -+or -+.BR ip (8). -+ -+.SH BUGS -+Does not maintain statistics and does not show up in tc qdisc ls. This is because -+it is the automatic default in the absence of a configured qdisc. -+ -+.SH SEE ALSO -+.BR tc (8) -+ -+.SH AUTHORS -+Alexey N. Kuznetsov, -+ -+This manpage maintained by bert hubert -+ -+ -diff -Naur iproute2-orig/debian/tc-prio.8 iproute2/debian/tc-prio.8 ---- iproute2-orig/debian/tc-prio.8 1969-12-31 16:00:00.000000000 -0800 -+++ iproute2/debian/tc-prio.8 2004-05-21 00:09:38.000000000 -0700 -@@ -0,0 +1,187 @@ -+.TH PRIO 8 "16 December 2001" "iproute2" "Linux" -+.SH NAME -+PRIO \- Priority qdisc -+.SH SYNOPSIS -+.B tc qdisc ... dev -+dev -+.B ( parent -+classid -+.B | root) [ handle -+major: -+.B ] prio [ bands -+bands -+.B ] [ priomap -+band,band,band... -+.B ] [ estimator -+interval timeconstant -+.B ] -+ -+.SH DESCRIPTION -+The PRIO qdisc is a simple classful queueing discipline that contains -+an arbitrary number of classes of differing priority. The classes are -+dequeued in numerical descending order of priority. PRIO is a scheduler -+and never delays packets - it is a work-conserving qdisc, though the qdiscs -+contained in the classes may not be. -+ -+Very useful for lowering latency when there is no need for slowing down -+traffic. -+ -+.SH ALGORITHM -+On creation with 'tc qdisc add', a fixed number of bands is created. Each -+band is a class, although is not possible to add classes with 'tc qdisc -+add', the number of bands to be created must instead be specified on the -+commandline attaching PRIO to its root. -+ -+When dequeueing, band 0 is tried first and only if it did not deliver a -+packet does PRIO try band 1, and so onwards. Maximum reliability packets -+should therefore go to band 0, minimum delay to band 1 and the rest to band -+2. -+ -+As the PRIO qdisc itself will have minor number 0, band 0 is actually -+major:1, band 1 is major:2, etc. For major, substitute the major number -+assigned to the qdisc on 'tc qdisc add' with the -+.B handle -+parameter. -+ -+.SH CLASSIFICATION -+Three methods are available to PRIO to determine in which band a packet will -+be enqueued. -+.TP -+From userspace -+A process with sufficient privileges can encode the destination class -+directly with SO_PRIORITY, see -+.BR tc(7). -+.TP -+with a tc filter -+A tc filter attached to the root qdisc can point traffic directly to a class -+.TP -+with the priomap -+Based on the packet priority, which in turn is derived from the Type of -+Service assigned to the packet. -+.P -+Only the priomap is specific to this qdisc. -+.SH QDISC PARAMETERS -+.TP -+bands -+Number of bands. If changed from the default of 3, -+.B priomap -+must be updated as well. -+.TP -+priomap -+The priomap maps the priority of -+a packet to a class. The priority can either be set directly from userspace, -+or be derived from the Type of Service of the packet. -+ -+Determines how packet priorities, as assigned by the kernel, map to -+bands. Mapping occurs based on the TOS octet of the packet, which looks like -+this: -+ -+.nf -+0 1 2 3 4 5 6 7 -++---+---+---+---+---+---+---+---+ -+| | | | -+|PRECEDENCE | TOS |MBZ| -+| | | | -++---+---+---+---+---+---+---+---+ -+.fi -+ -+The four TOS bits (the 'TOS field') are defined as: -+ -+.nf -+Binary Decimcal Meaning -+----------------------------------------- -+1000 8 Minimize delay (md) -+0100 4 Maximize throughput (mt) -+0010 2 Maximize reliability (mr) -+0001 1 Minimize monetary cost (mmc) -+0000 0 Normal Service -+.fi -+ -+As there is 1 bit to the right of these four bits, the actual value of the -+TOS field is double the value of the TOS bits. Tcpdump -v -v shows you the -+value of the entire TOS field, not just the four bits. It is the value you -+see in the first column of this table: -+ -+.nf -+TOS Bits Means Linux Priority Band -+------------------------------------------------------------ -+0x0 0 Normal Service 0 Best Effort 1 -+0x2 1 Minimize Monetary Cost 1 Filler 2 -+0x4 2 Maximize Reliability 0 Best Effort 1 -+0x6 3 mmc+mr 0 Best Effort 1 -+0x8 4 Maximize Throughput 2 Bulk 2 -+0xa 5 mmc+mt 2 Bulk 2 -+0xc 6 mr+mt 2 Bulk 2 -+0xe 7 mmc+mr+mt 2 Bulk 2 -+0x10 8 Minimize Delay 6 Interactive 0 -+0x12 9 mmc+md 6 Interactive 0 -+0x14 10 mr+md 6 Interactive 0 -+0x16 11 mmc+mr+md 6 Interactive 0 -+0x18 12 mt+md 4 Int. Bulk 1 -+0x1a 13 mmc+mt+md 4 Int. Bulk 1 -+0x1c 14 mr+mt+md 4 Int. Bulk 1 -+0x1e 15 mmc+mr+mt+md 4 Int. Bulk 1 -+.fi -+ -+The second column contains the value of the relevant -+four TOS bits, followed by their translated meaning. For example, 15 stands -+for a packet wanting Minimal Montetary Cost, Maximum Reliability, Maximum -+Throughput AND Minimum Delay. -+ -+The fourth column lists the way the Linux kernel interprets the TOS bits, by -+showing to which Priority they are mapped. -+ -+The last column shows the result of the default priomap. On the commandline, -+the default priomap looks like this: -+ -+ 1, 2, 2, 2, 1, 2, 0, 0 , 1, 1, 1, 1, 1, 1, 1, 1 -+ -+This means that priority 4, for example, gets mapped to band number 1. -+The priomap also allows you to list higher priorities (> 7) which do not -+correspond to TOS mappings, but which are set by other means. -+ -+This table from RFC 1349 (read it for more details) explains how -+applications might very well set their TOS bits: -+ -+.nf -+TELNET 1000 (minimize delay) -+FTP -+ Control 1000 (minimize delay) -+ Data 0100 (maximize throughput) -+ -+TFTP 1000 (minimize delay) -+ -+SMTP -+ Command phase 1000 (minimize delay) -+ DATA phase 0100 (maximize throughput) -+ -+Domain Name Service -+ UDP Query 1000 (minimize delay) -+ TCP Query 0000 -+ Zone Transfer 0100 (maximize throughput) -+ -+NNTP 0001 (minimize monetary cost) -+ -+ICMP -+ Errors 0000 -+ Requests 0000 (mostly) -+ Responses (mostly) -+.fi -+ -+ -+.SH CLASSES -+PRIO classes cannot be configured further - they are automatically created -+when the PRIO qdisc is attached. Each class however can contain yet a -+further qdisc. -+ -+.SH BUGS -+Large amounts of traffic in the lower bands can cause starvation of higher -+bands. Can be prevented by attaching a shaper (for example, -+.BR tc-tbf(8) -+to these bands to make sure they cannot dominate the link. -+ -+.SH AUTHORS -+Alexey N. Kuznetsov, , J Hadi Salim -+. This manpage maintained by bert hubert -+ -+ -diff -Naur iproute2-orig/debian/tc-red.8 iproute2/debian/tc-red.8 ---- iproute2-orig/debian/tc-red.8 1969-12-31 16:00:00.000000000 -0800 -+++ iproute2/debian/tc-red.8 2004-05-21 00:09:38.000000000 -0700 -@@ -0,0 +1,131 @@ -+.TH RED 8 "13 December 2001" "iproute2" "Linux" -+.SH NAME -+red \- Random Early Detection -+.SH SYNOPSIS -+.B tc qdisc ... red -+.B limit -+bytes -+.B min -+bytes -+.B max -+bytes -+.B avpkt -+bytes -+.B burst -+packets -+.B [ ecn ] [ bandwidth -+rate -+.B ] probability -+chance -+ -+.SH DESCRIPTION -+Random Early Detection is a classless qdisc which manages its queue size -+smartly. Regular queues simply drop packets from the tail when they are -+full, which may not be the optimal behaviour. RED also performs tail drop, -+but does so in a more gradual way. -+ -+Once the queue hits a certain average length, packets enqueued have a -+configurable chance of being marked (which may mean dropped). This chance -+increases linearly up to a point called the -+.B max -+average queue length, although the queue might get bigger. -+ -+This has a host of benefits over simple taildrop, while not being processor -+intensive. It prevents synchronous retransmits after a burst in traffic, -+which cause further retransmits, etc. -+ -+The goal is the have a small queue size, which is good for interactivity -+while not disturbing TCP/IP traffic with too many sudden drops after a burst -+of traffic. -+ -+Depending on 08 ECN is configured, marking either means dropping or -+purely marking a packet as overlimit. -+.SH ALGORITHM -+The average queue size is used for determining the marking -+probability. This is calculated using an Exponential Weighted Moving -+Average, which can be more or less sensitive to bursts. -+ -+When the average queue size is below -+.B min -+bytes, no packet will ever be marked. When it exceeds -+.B min, -+the probability of doing so climbs linearly up -+to -+.B probability, -+until the average queue size hits -+.B max -+bytes. Because -+.B probability -+is normally not set to 100%, the queue size might -+conceivably rise above -+.B max -+bytes, so the -+.B limit -+parameter is provided to set a hard maximum for the size of the queue. -+ -+.SH PARAMETERS -+.TP -+min -+Average queue size at which marking becomes a possibility. -+.TP -+max -+At this average queue size, the marking probability is maximal. Should be at -+least twice -+.B min -+to prevent synchronous retransmits, higher for low -+.B min. -+.TP -+probability -+Maximum probability for marking, specified as a floating point -+number from 0.0 to 1.0. Suggested values are 0.01 or 0.02 (1 or 2%, -+respectively). -+.TP -+limit -+Hard limit on the real (not average) queue size in bytes. Further packets -+are dropped. Should be set higher than max+burst. It is advised to set this -+a few times higher than -+.B max. -+.TP -+burst -+Used for determining how fast the average queue size is influenced by the -+real queue size. Larger values make the calculation more sluggish, allowing -+longer bursts of traffic before marking starts. Real life experiments -+support the following guideline: (min+min+max)/(3*avpkt). -+.TP -+avpkt -+Specified in bytes. Used with burst to determine the time constant for -+average queue size calculations. 1000 is a good value. -+.TP -+bandwidth -+This rate is used for calculating the average queue size after some -+idle time. Should be set to the bandwidth of your interface. Does not mean -+that RED will shape for you! Optional. -+.TP -+ecn -+As mentioned before, RED can either 'mark' or 'drop'. Explicit Congestion -+Notification allows RED to notify remote hosts that their rate exceeds the -+amount of bandwidth available. Non-ECN capable hosts can only be notified by -+dropping a packet. If this parameter is specified, packets which indicate -+that their hosts honor ECN will only be marked and not dropped, unless the -+queue size hits -+.B limit -+bytes. Needs a tc binary with RED support compiled in. Recommended. -+ -+.SH SEE ALSO -+.BR tc (8) -+ -+.SH SOURCES -+.TP -+o -+Floyd, S., and Jacobson, V., Random Early Detection gateways for -+Congestion Avoidance. http://www.aciri.org/floyd/papers/red/red.html -+.TP -+o -+Some changes to the algorithm by Alexey N. Kuznetsov. -+ -+.SH AUTHORS -+Alexey N. Kuznetsov, , Alexey Makarenko -+, J Hadi Salim . -+This manpage maintained by bert hubert -+ -+ -diff -Naur iproute2-orig/debian/tc-sfq.8 iproute2/debian/tc-sfq.8 ---- iproute2-orig/debian/tc-sfq.8 1969-12-31 16:00:00.000000000 -0800 -+++ iproute2/debian/tc-sfq.8 2004-05-21 00:09:38.000000000 -0700 -@@ -0,0 +1,107 @@ -+.TH TC 8 "8 December 2001" "iproute2" "Linux" -+.SH NAME -+sfq \- Stochastic Fairness Queueing -+.SH SYNOPSIS -+.B tc qdisc ... perturb -+seconds -+.B quantum -+bytes -+ -+.SH DESCRIPTION -+ -+Stochastic Fairness Queueing is a classless queueing discipline available for -+traffic control with the -+.BR tc (8) -+command. -+ -+SFQ does not shape traffic but only schedules the transmission of packets, based on 'flows'. -+The goal is to ensure fairness so that each flow is able to send data in turn, thus preventing -+any single flow from drowning out the rest. -+ -+This may in fact have some effect in mitigating a Denial of Service attempt. -+ -+SFQ is work-conserving and therefore always delivers a packet if it has one available. -+.SH ALGORITHM -+On enqueueing, each packet is assigned to a hash bucket, based on -+.TP -+(i) -+Source address -+.TP -+(ii) -+Destination address -+.TP -+(iii) -+Source port -+.P -+If these are available. SFQ knows about ipv4 and ipv6 and also UDP, TCP and ESP. -+Packets with other protocols are hashed based on the 32bits representation of their -+destination and the socket they belong to. A flow corresponds mostly to a TCP/IP -+connection. -+ -+Each of these buckets should represent a unique flow. Because multiple flows may -+get hashed to the same bucket, the hashing algorithm is perturbed at configurable -+intervals so that the unfairness lasts only for a short while. Perturbation may -+however cause some inadvertent packet reordering to occur. -+ -+When dequeuing, each hashbucket with data is queried in a round robin fashion. -+ -+The compile time maximum length of the SFQ is 128 packets, which can be spread over -+at most 128 buckets of 1024 available. In case of overflow, tail-drop is performed -+on the fullest bucket, thus maintaining fairness. -+ -+.SH PARAMETERS -+.TP -+perturb -+Interval in seconds for queue algorithm perturbation. Defaults to 0, which means that -+no perturbation occurs. Do not set too low for each perturbation may cause some packet -+reordering. Advised value: 10 -+.TP -+quantum -+Amount of bytes a flow is allowed to dequeue during a round of the round robin process. -+Defaults to the MTU of the interface which is also the advised value and the minimum value. -+ -+.SH EXAMPLE & USAGE -+ -+To attach to device ppp0: -+.P -+# tc qdisc add dev ppp0 root sfq perturb 10 -+.P -+Please note that SFQ, like all non-shaping (work-conserving) qdiscs, is only useful -+if it owns the queue. -+This is the case when the link speed equals the actually available bandwidth. This holds -+for regular phone modems, ISDN connections and direct non-switched ethernet links. -+.P -+Most often, cable modems and DSL devices do not fall into this category. The same holds -+for when connected to a switch and trying to send data to a congested segment also -+connected to the switch. -+.P -+In this case, the effective queue does not reside within Linux and is therefore not -+available for scheduling. -+.P -+Embed SFQ in a classful qdisc to make sure it owns the queue. -+ -+.SH SOURCE -+.TP -+o -+Paul E. McKenney "Stochastic Fairness Queuing", -+IEEE INFOCOMM'90 Proceedings, San Francisco, 1990. -+ -+.TP -+o -+Paul E. McKenney "Stochastic Fairness Queuing", -+"Interworking: Research and Experience", v.2, 1991, p.113-131. -+ -+.TP -+o -+See also: -+M. Shreedhar and George Varghese "Efficient Fair -+Queuing using Deficit Round Robin", Proc. SIGCOMM 95. -+ -+.SH SEE ALSO -+.BR tc (8) -+ -+.SH AUTHOR -+Alexey N. Kuznetsov, . This manpage maintained by -+bert hubert -+ -+ -diff -Naur iproute2-orig/debian/tc-tbf.8 iproute2/debian/tc-tbf.8 ---- iproute2-orig/debian/tc-tbf.8 1969-12-31 16:00:00.000000000 -0800 -+++ iproute2/debian/tc-tbf.8 2004-05-21 00:09:38.000000000 -0700 -@@ -0,0 +1,138 @@ -+.TH TC 8 "13 December 2001" "iproute2" "Linux" -+.SH NAME -+tbf \- Token Bucket Filter -+.SH SYNOPSIS -+.B tc qdisc ... tbf rate -+rate -+.B burst -+bytes/cell -+.B ( latency -+ms -+.B | limit -+bytes -+.B ) [ mpu -+bytes -+.B [ peakrate -+rate -+.B mtu -+bytes/cell -+.B ] ] -+.P -+burst is also known as buffer and maxburst. mtu is also known as minburst. -+.SH DESCRIPTION -+ -+The Token Bucket Filter is a classless queueing discipline available for -+traffic control with the -+.BR tc (8) -+command. -+ -+TBF is a pure shaper and never schedules traffic. It is non-work-conserving and may throttle -+itself, although packets are available, to ensure that the configured rate is not exceeded. -+On all platforms except for Alpha, -+it is able to shape up to 1mbit/s of normal traffic with ideal minimal burstiness, -+sending out data exactly at the configured rates. -+ -+Much higher rates are possible but at the cost of losing the minimal burstiness. In that -+case, data is on average dequeued at the configured rate but may be sent much faster at millisecond -+timescales. Because of further queues living in network adaptors, this is often not a problem. -+ -+Kernels with a higher 'HZ' can achieve higher rates with perfect burstiness. On Alpha, HZ is ten -+times higher, leading to a 10mbit/s limit to perfection. These calculations hold for packets of on -+average 1000 bytes. -+ -+.SH ALGORITHM -+As the name implies, traffic is filtered based on the expenditure of -+.B tokens. -+Tokens roughly correspond to bytes, with the additional constraint that each packet consumes -+some tokens, no matter how small it is. This reflects the fact that even a zero-sized packet occupies -+the link for some time. -+ -+On creation, the TBF is stocked with tokens which correspond to the amount of traffic that can be burst -+in one go. Tokens arrive at a steady rate, until the bucket is full. -+ -+If no tokens are available, packets are queued, up to a configured limit. The TBF now -+calculates the token deficit, and throttles until the first packet in the queue can be sent. -+ -+If it is not acceptable to burst out packets at maximum speed, a peakrate can be configured -+to limit the speed at which the bucket empties. This peakrate is implemented as a second TBF -+with a very small bucket, so that it doesn't burst. -+ -+To achieve perfection, the second bucket may contain only a single packet, which leads to -+the earlier mentioned 1mbit/s limit. -+ -+This limit is caused by the fact that the kernel can only throttle for at minimum 1 'jiffy', which depends -+on HZ as 1/HZ. For perfect shaping, only a single packet can get sent per jiffy - for HZ=100, this means 100 -+packets of on average 1000 bytes each, which roughly corresponds to 1mbit/s. -+ -+.SH PARAMETERS -+See -+.BR tc (8) -+for how to specify the units of these values. -+.TP -+limit or latency -+Limit is the number of bytes that can be queued waiting for tokens to become -+available. You can also specify this the other way around by setting the -+latency parameter, which specifies the maximum amount of time a packet can -+sit in the TBF. The latter calculation takes into account the size of the -+bucket, the rate and possibly the peakrate (if set). These two parameters -+are mutually exclusive. -+.TP -+burst -+Also known as buffer or maxburst. -+Size of the bucket, in bytes. This is the maximum amount of bytes that tokens can be available for instantaneously. -+In general, larger shaping rates require a larger buffer. For 10mbit/s on Intel, you need at least 10kbyte buffer -+if you want to reach your configured rate! -+ -+If your buffer is too small, packets may be dropped because more tokens arrive per timer tick than fit in your bucket. -+The minimum buffer size can be calculated by dividing the rate by HZ. -+ -+Token usage calculations are performed using a table which by default has a resolution of 8 packets. -+This resolution can be changed by specifying the -+.B cell -+size with the burst. For example, to specify a 6000 byte buffer with a 16 -+byte cell size, set a burst of 6000/16. You will probably never have to set -+this. Must be an integral power of 2. -+.TP -+mpu -+A zero-sized packet does not use zero bandwidth. For ethernet, no packet uses less than 64 bytes. The Minimum Packet Unit -+determines the minimal token usage (specified in bytes) for a packet. Defaults to zero. -+.TP -+rate -+The speed knob. See remarks above about limits! See -+.BR tc (8) -+for units. -+.PP -+Furthermore, if a peakrate is desired, the following parameters are available: -+ -+.TP -+peakrate -+Maximum depletion rate of the bucket. Limited to 1mbit/s on Intel, 10mbit/s on Alpha. The peakrate does -+not need to be set, it is only necessary if perfect millisecond timescale shaping is required. -+ -+.TP -+mtu/minburst -+Specifies the size of the peakrate bucket. For perfect accuracy, should be set to the MTU of the interface. -+If a peakrate is needed, but some burstiness is acceptable, this size can be raised. A 3000 byte minburst -+allows around 3mbit/s of peakrate, given 1000 byte packets. -+ -+Like the regular burstsize you can also specify a -+.B cell -+size. -+.SH EXAMPLE & USAGE -+ -+To attach a TBF with a sustained maximum rate of 0.5mbit/s, a peakrate of 1.0mbit/s, -+a 5kilobyte buffer, with a pre-bucket queue size limit calculated so the TBF causes -+at most 70ms of latency, with perfect peakrate behaviour, issue: -+.P -+# tc qdisc add dev eth0 root tbf rate 0.5mbit \\ -+ burst 5kb latency 70ms peakrate 1mbit \\ -+ minburst 1540 -+ -+.SH SEE ALSO -+.BR tc (8) -+ -+.SH AUTHOR -+Alexey N. Kuznetsov, . This manpage maintained by -+bert hubert -+ -+ -diff -Naur iproute2-orig/debian/tc.8 iproute2/debian/tc.8 ---- iproute2-orig/debian/tc.8 1969-12-31 16:00:00.000000000 -0800 -+++ iproute2/debian/tc.8 2004-05-21 00:09:38.000000000 -0700 -@@ -0,0 +1,348 @@ -+.TH TC 8 "16 December 2001" "iproute2" "Linux" -+.SH NAME -+tc \- show / manipulate traffic control settings -+.SH SYNOPSIS -+.B tc qdisc [ add | change | replace | link ] dev -+DEV -+.B -+[ parent -+qdisc-id -+.B | root ] -+.B [ handle -+qdisc-id ] qdisc -+[ qdisc specific parameters ] -+.P -+ -+.B tc class [ add | change | replace ] dev -+DEV -+.B parent -+qdisc-id -+.B [ classid -+class-id ] qdisc -+[ qdisc specific parameters ] -+.P -+ -+.B tc filter [ add | change | replace ] dev -+DEV -+.B [ parent -+qdisc-id -+.B | root ] protocol -+protocol -+.B prio -+priority filtertype -+[ filtertype specific parameters ] -+.B flowid -+flow-id -+ -+.B tc [-s | -d ] qdisc show [ dev -+DEV -+.B ] -+.P -+.B tc [-s | -d ] class show dev -+DEV -+.P -+.B tc filter show dev -+DEV -+ -+.SH DESCRIPTION -+.B Tc -+is used to configure Traffic Control in the Linux kernel. Traffic Control consists -+of the following: -+ -+.TP -+SHAPING -+When traffic is shaped, its rate of transmission is under control. Shaping may -+be more than lowering the available bandwidth - it is also used to smooth out -+bursts in traffic for better network behaviour. Shaping occurs on egress. -+ -+.TP -+SCHEDULING -+By scheduling the transmission of packets it is possible to improve interactivity -+for traffic that needs it while still guaranteeing bandwidth to bulk transfers. Reordering -+is also called prioritizing, and happens only on egress. -+ -+.TP -+POLICING -+Where shaping deals with transmission of traffic, policing pertains to traffic -+arriving. Policing thus occurs on ingress. -+ -+.TP -+DROPPING -+Traffic exceeding a set bandwidth may also be dropped forthwith, both on -+ingress and on egress. -+ -+.P -+Processing of traffic is controlled by three kinds of objects: qdiscs, -+classes and filters. -+ -+.SH QDISCS -+.B qdisc -+is short for 'queueing discipline' and it is elementary to -+understanding traffic control. Whenever the kernel needs to send a -+packet to an interface, it is -+.B enqueued -+to the qdisc configured for that interface. Immediately afterwards, the kernel -+tries to get as many packets as possible from the qdisc, for giving them -+to the network adaptor driver. -+ -+A simple QDISC is the 'pfifo' one, which does no processing at all and is a pure -+First In, First Out queue. It does however store traffic when the network interface -+can't handle it momentarily. -+ -+.SH CLASSES -+Some qdiscs can contain classes, which contain further qdiscs - traffic may -+then be enqueued in any of the inner qdiscs, which are within the -+.B classes. -+When the kernel tries to dequeue a packet from such a -+.B classful qdisc -+it can come from any of the classes. A qdisc may for example prioritize -+certain kinds of traffic by trying to dequeue from certain classes -+before others. -+ -+.SH FILTERS -+A -+.B filter -+is used by a classful qdisc to determine in which class a packet will -+be enqueued. Whenever traffic arrives at a class with subclasses, it needs -+to be classified. Various methods may be employed to do so, one of these -+are the filters. All filters attached to the class are called, until one of -+them returns with a verdict. If no verdict was made, other criteria may be -+available. This differs per qdisc. -+ -+It is important to notice that filters reside -+.B within -+qdiscs - they are not masters of what happens. -+ -+.SH CLASSLESS QDISCS -+The classless qdiscs are: -+.TP -+[p|b]fifo -+Simplest usable qdisc, pure First In, First Out behaviour. Limited in -+packets or in bytes. -+.TP -+pfifo_fast -+Standard qdisc for 'Advanced Router' enabled kernels. Consists of a three-band -+queue which honors Type of Service flags, as well as the priority that may be -+assigned to a packet. -+.TP -+red -+Random Early Detection simulates physical congestion by randomly dropping -+packets when nearing configured bandwidth allocation. Well suited to very -+large bandwidth applications. -+.TP -+sfq -+Stochastic Fairness Queueing reorders queued traffic so each 'session' -+gets to send a packet in turn. -+.TP -+tbf -+The Token Bucket Filter is suited for slowing traffic down to a precisely -+configured rate. Scales well to large bandwidths. -+.SH CONFIGURING CLASSLESS QDISCS -+In the absence of classful qdiscs, classless qdiscs can only be attached at -+the root of a device. Full syntax: -+.P -+.B tc qdisc add dev -+DEV -+.B root -+QDISC QDISC-PARAMETERS -+ -+To remove, issue -+.P -+.B tc qdisc del dev -+DEV -+.B root -+ -+The -+.B pfifo_fast -+qdisc is the automatic default in the absence of a configured qdisc. -+ -+.SH CLASSFUL QDISCS -+The classful qdiscs are: -+.TP -+CBQ -+Class Based Queueing implements a rich linksharing hierarchy of classes. -+It contains shaping elements as well as prioritizing capabilities. Shaping is -+performed using link idle time calculations based on average packet size and -+underlying link bandwidth. The latter may be ill-defined for some interfaces. -+.TP -+HTB -+The Hierarchy Token Bucket implements a rich linksharing hierarchy of -+classes with an emphasis on conforming to existing practices. HTB facilitates -+guaranteeing bandwidth to classes, while also allowing specification of upper -+limits to inter-class sharing. It contains shaping elements, based on TBF and -+can prioritize classes. -+.TP -+PRIO -+The PRIO qdisc is a non-shaping container for a configurable number of -+classes which are dequeued in order. This allows for easy prioritization -+of traffic, where lower classes are only able to send if higher ones have -+no packets available. To facilitate configuration, Type Of Service bits are -+honored by default. -+.SH THEORY OF OPERATION -+Classes form a tree, where each class has a single parent. -+A class may have multiple children. Some qdiscs allow for runtime addition -+of classes (CBQ, HTB) while others (PRIO) are created with a static number of -+children. -+ -+Qdiscs which allow dynamic addition of classes can have zero or more -+subclasses to which traffic may be enqueued. -+ -+Furthermore, each class contains a -+.B leaf qdisc -+which by default has -+.B pfifo -+behaviour though another qdisc can be attached in place. This qdisc may again -+contain classes, but each class can have only one leaf qdisc. -+ -+When a packet enters a classful qdisc it can be -+.B classified -+to one of the classes within. Three criteria are available, although not all -+qdiscs will use all three: -+.TP -+tc filters -+If tc filters are attached to a class, they are consulted first -+for relevant instructions. Filters can match on all fields of a packet header, -+as well as on the firewall mark applied by ipchains or iptables. See -+.BR tc-filters (8). -+.TP -+Type of Service -+Some qdiscs have built in rules for classifying packets based on the TOS field. -+.TP -+skb->priority -+Userspace programs can encode a class-id in the 'skb->priority' field using -+the SO_PRIORITY option. -+.P -+Each node within the tree can have its own filters but higher level filters -+may also point directly to lower classes. -+ -+If classification did not succeed, packets are enqueued to the leaf qdisc -+attached to that class. Check qdisc specific manpages for details, however. -+ -+.SH NAMING -+All qdiscs, classes and filters have IDs, which can either be specified -+or be automatically assigned. -+ -+IDs consist of a major number and a minor number, separated by a colon. -+ -+.TP -+QDISCS -+A qdisc, which potentially can have children, -+gets assigned a major number, called a 'handle', leaving the minor -+number namespace available for classes. The handle is expressed as '10:'. -+It is customary to explicitly assign a handle to qdiscs expected to have -+children. -+ -+.TP -+CLASSES -+Classes residing under a qdisc share their qdisc major number, but each have -+a separate minor number called a 'classid' that has no relation to their -+parent classes, only to their parent qdisc. The same naming custom as for -+qdiscs applies. -+ -+.TP -+FILTERS -+Filters have a three part ID, which is only needed when using a hashed -+filter hierarchy, for which see -+.BR tc-filters (8). -+.SH UNITS -+All parameters accept a floating point number, possibly followed by a unit. -+.P -+Bandwidths or rates can be specified in: -+.TP -+kbps -+Kilobytes per second -+.TP -+mbps -+Megabytes per second -+.TP -+kbit -+Kilobits per second -+.TP -+mbit -+Megabits per second -+.TP -+bps or a bare number -+Bits per second -+.P -+Amounts of data can be specified in: -+.TP -+kb or k -+Kilobytes -+.TP -+mb or m -+Megabytes -+.TP -+mbit -+Megabits -+.TP -+kbit -+Kilobits -+.TP -+b or a bare number -+Bytes. -+.P -+Lengths of time can be specified in: -+.TP -+s, sec or secs -+Whole seconds -+.TP -+ms, msec or msecs -+Milliseconds -+.TP -+us, usec, usecs or a bare number -+Microseconds. -+ -+.SH TC COMMANDS -+The following commands are available for qdiscs, classes and filter: -+.TP -+add -+Add a qdisc, class or filter to a node. For all entities, a -+.B parent -+must be passed, either by passing its ID or by attaching directly to the root of a device. -+When creating a qdisc or a filter, it can be named with the -+.B handle -+parameter. A class is named with the -+.B classid -+parameter. -+ -+.TP -+remove -+A qdisc can be removed by specifying its handle, which may also be 'root'. All subclasses and their leaf qdiscs -+are automatically deleted, as well as any filters attached to them. -+ -+.TP -+change -+Some entities can be modified 'in place'. Shares the syntax of 'add', with the exception -+that the handle cannot be changed and neither can the parent. In other words, -+.B -+change -+cannot move a node. -+ -+.TP -+replace -+Performs a nearly atomic remove/add on an existing node id. If the node does not exist yet -+it is created. -+ -+.TP -+link -+Only available for qdiscs and performs a replace where the node -+must exist already. -+ -+ -+.SH HISTORY -+.B tc -+was written by Alexey N. Kuznetsov and added in Linux 2.2. -+.SH SEE ALSO -+.BR tc-cbq (8), -+.BR tc-htb (8), -+.BR tc-sfq (8), -+.BR tc-red (8), -+.BR tc-tbf (8), -+.BR tc-pfifo (8), -+.BR tc-bfifo (8), -+.BR tc-pfifo_fast (8), -+.BR tc-filters (8) -+ -+.SH AUTHOR -+Manpage maintained by bert hubert (ahu@ds9a.nl) -+ -diff -Naur iproute2-orig/include/rt_names.h iproute2/include/rt_names.h ---- iproute2-orig/include/rt_names.h 2000-04-16 10:42:50.000000000 -0700 -+++ iproute2/include/rt_names.h 2004-05-21 00:16:36.000000000 -0700 -@@ -1,6 +1,8 @@ - #ifndef RT_NAMES_H_ - #define RT_NAMES_H_ 1 - -+#include -+ - const char* rtnl_rtprot_n2a(int id, char *buf, int len); - const char* rtnl_rtscope_n2a(int id, char *buf, int len); - const char* rtnl_rttable_n2a(int id, char *buf, int len); -diff -Naur iproute2-orig/lib/rt_names.c iproute2/lib/rt_names.c ---- iproute2-orig/lib/rt_names.c 2000-04-16 10:42:52.000000000 -0700 -+++ iproute2/lib/rt_names.c 2004-05-21 00:16:36.000000000 -0700 -@@ -16,6 +16,7 @@ - #include - #include - #include -+#include - - static void rtnl_tab_initialize(char *file, char **tab, int size) - { -diff -Naur iproute2-orig/misc/arpd.c iproute2/misc/arpd.c ---- iproute2-orig/misc/arpd.c 2002-01-09 20:02:26.000000000 -0800 -+++ iproute2/misc/arpd.c 2004-05-21 00:16:36.000000000 -0700 -@@ -16,7 +16,7 @@ - #include - #include - #include --#include -+#include - #include - #include - #include -@@ -28,6 +28,7 @@ - #include - #include - #include -+#include - #include - #include - #include diff --git a/abs/core/iproute2/libdir.patch b/abs/core/iproute2/libdir.patch deleted file mode 100644 index 4e5671a..0000000 --- a/abs/core/iproute2/libdir.patch +++ /dev/null @@ -1,129 +0,0 @@ -Submitted By: Joe Ciccone -Date: 2008-09-31 -Upstream Status: Unknown -Origin: Joe Ciccone -Description: This patch gives the ability to change the libdir. - ---- iproute2-2.6.26.orig/Config 1969-12-31 19:00:00.000000000 -0500 -+++ iproute2-2.6.26/Config 2008-09-13 15:07:31.000000000 -0400 -@@ -0,0 +1 @@ -+# Generated config based on /usr/src/clfs-tarballs/conglomeration/iproute2-2.6.26/include -diff -Naur iproute2-2.6.26.orig/include/iptables.h iproute2-2.6.26/include/iptables.h ---- iproute2-2.6.26.orig/include/iptables.h 2008-07-25 16:46:07.000000000 -0400 -+++ iproute2-2.6.26/include/iptables.h 2008-09-13 15:43:33.000000000 -0400 -@@ -4,8 +4,12 @@ - #include "iptables_common.h" - #include "libiptc/libiptc.h" - -+#ifndef LIBDIR -+#define LIBDIR "/usr/lib" -+#endif -+ - #ifndef IPT_LIB_DIR --#define IPT_LIB_DIR "/usr/local/lib/iptables" -+#define IPT_LIB_DIR LIBDIR "/iptables" - #endif - - #ifndef IPPROTO_SCTP -diff -Naur iproute2-2.6.26.orig/ip/iplink.c iproute2-2.6.26/ip/iplink.c ---- iproute2-2.6.26.orig/ip/iplink.c 2008-07-25 16:46:07.000000000 -0400 -+++ iproute2-2.6.26/ip/iplink.c 2008-09-13 15:14:41.000000000 -0400 -@@ -34,7 +34,11 @@ - - #define IPLINK_IOCTL_COMPAT 1 - #ifndef DESTDIR --#define DESTDIR "/usr/" -+#define DESTDIR "/usr" -+#endif -+ -+#ifndef LIBDIR -+#define LIBDIR "/usr/lib" - #endif - - static void usage(void) __attribute__((noreturn)); -@@ -81,7 +85,7 @@ - if (strcmp(l->id, id) == 0) - return l; - -- snprintf(buf, sizeof(buf), DESTDIR "/lib/ip/link_%s.so", id); -+ snprintf(buf, sizeof(buf), DESTDIR LIBDIR "/ip/link_%s.so", id); - dlh = dlopen(buf, RTLD_LAZY); - if (dlh == NULL) { - /* look in current binary, only open once */ -diff -Naur iproute2-2.6.26.orig/Makefile iproute2-2.6.26/Makefile ---- iproute2-2.6.26.orig/Makefile 2008-07-25 16:46:07.000000000 -0400 -+++ iproute2-2.6.26/Makefile 2008-09-13 15:15:24.000000000 -0400 -@@ -1,13 +1,15 @@ --DESTDIR=/usr/ -+DESTDIR=/usr - SBINDIR=/sbin - CONFDIR=/etc/iproute2 - DOCDIR=/share/doc/iproute2 - MANDIR=/share/man - -+LIBDIR=/usr/lib -+ - # Path to db_185.h include - DBM_INCLUDE:=/usr/include - --DEFINES= -DRESOLVE_HOSTNAMES -DDESTDIR=\"$(DESTDIR)\" -+DEFINES= -DRESOLVE_HOSTNAMES -DDESTDIR=\"$(DESTDIR)\" -DLIBDIR=\"$(LIBDIR)\" - - #options if you have a bind>=4.9.4 libresolv (or, maybe, glibc) - LDLIBS=-lresolv -diff -Naur iproute2-2.6.26.orig/netem/Makefile iproute2-2.6.26/netem/Makefile ---- iproute2-2.6.26.orig/netem/Makefile 2008-07-25 16:46:07.000000000 -0400 -+++ iproute2-2.6.26/netem/Makefile 2008-09-13 14:27:07.000000000 -0400 -@@ -20,9 +20,9 @@ - $(HOSTCC) $(CCOPTS) -I../include -o $@ $@.c -lm - - install: all -- mkdir -p $(DESTDIR)/lib/tc -+ mkdir -p $(DESTDIR)$(LIBDIR)/tc - for i in $(DISTDATA); \ -- do install -m 755 $$i $(DESTDIR)/lib/tc; \ -+ do install -m 755 $$i $(DESTDIR)$(LIBDIR)/tc; \ - done - - clean: -diff -Naur iproute2-2.6.26.orig/tc/Makefile iproute2-2.6.26/tc/Makefile ---- iproute2-2.6.26.orig/tc/Makefile 2008-07-25 16:46:07.000000000 -0400 -+++ iproute2-2.6.26/tc/Makefile 2008-09-13 14:30:37.000000000 -0400 -@@ -72,10 +72,10 @@ - $(AR) rcs $@ $(TCLIB) - - install: all -- mkdir -p $(DESTDIR)/lib/tc -+ mkdir -p $(DESTDIR)$(LIBDIR)/tc - install -m 0755 tc $(DESTDIR)$(SBINDIR) - for i in $(TCSO); \ -- do install -m 755 $$i $(DESTDIR)/lib/tc; \ -+ do install -m 755 $$i $(DESTDIR)$(LIBDIR)/tc; \ - done - - clean: -diff -Naur iproute2-2.6.26.orig/tc/tc_util.c iproute2-2.6.26/tc/tc_util.c ---- iproute2-2.6.26.orig/tc/tc_util.c 2008-07-25 16:46:07.000000000 -0400 -+++ iproute2-2.6.26/tc/tc_util.c 2008-09-13 15:15:16.000000000 -0400 -@@ -25,7 +25,11 @@ - #include "tc_util.h" - - #ifndef DESTDIR --#define DESTDIR "/usr/" -+#define DESTDIR "/usr" -+#endif -+ -+#ifndef LIBDIR -+#define LIBDIR "/usr/lib" - #endif - - const char *get_tc_lib(void) -@@ -34,7 +38,7 @@ - - lib_dir = getenv("TC_LIB_DIR"); - if (!lib_dir) -- lib_dir = DESTDIR "/lib/tc"; -+ lib_dir = DESTDIR LIBDIR "/tc"; - - return lib_dir; - diff --git a/abs/core/iproute2/tc.patch b/abs/core/iproute2/tc.patch deleted file mode 100644 index e6d6276..0000000 --- a/abs/core/iproute2/tc.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- tc/Makefile.old 2010-06-14 08:29:49.257421437 +0200 -+++ tc/Makefile 2010-06-14 08:30:07.157419977 +0200 -@@ -99,18 +99,11 @@ - $(AR) rcs $@ $(TCLIB) - - install: all -- echo mkdir -p $(MODDESTDIR) -- echo install -m 0755 tc $(DESTDIR)$(SBINDIR) -- for i in $(TCSO); \ -- do echo install -m 755 $$i $(MODDESTDIR); \ -- done -- if [ ! -f $(MODDESTDIR)/m_ipt.so ]; then \ -- if [ -f $(MODDESTDIR)/m_xt.so ]; \ -- then ln -s m_xt.so $(MODDESTDIR)/m_ipt.so ; \ -- elif [ -f $(MODDESTDIR)/m_xt_old.so ]; \ -- then ln -s m_xt_old.so $(MODDESTDIR)/m_ipt.so ; \ -- fi; \ -- fi -+ mkdir -p $(DESTDIR)$(LIBDIR)/tc -+ install -m 0755 tc $(DESTDIR)$(SBINDIR) -+ for i in $(TCSO); \ -+ do install -m 755 $$i $(DESTDIR)$(LIBDIR)/tc; \ -+ done - - clean: - rm -f $(TCOBJ) $(TCLIB) libtc.a tc *.so emp_ematch.yacc.h; \ diff --git a/abs/core/iptables/PKGBUILD.orig b/abs/core/iptables/PKGBUILD.orig deleted file mode 100644 index b0182d8..0000000 --- a/abs/core/iptables/PKGBUILD.orig +++ /dev/null @@ -1,36 +0,0 @@ -# $Id: PKGBUILD 356 2008-04-18 22:56:27Z aaron $ -# Maintainer: Thomas Baechler -pkgname=iptables -pkgver=1.4.1 -pkgrel=1 -pkgdesc="A Linux kernel packet control tool" -arch=('i686' 'x86_64') -license=('GPL') -url="http://www.netfilter.org/" -depends=('glibc') -source=(http://www.iptables.org/projects/iptables/files/iptables-$pkgver.tar.bz2 \ - iptables ip6tables empty.rules simple_firewall.rules iptables.conf.d) -md5sums=('e628f033b95741266a315d54fe73db9c' - '89401d6f0cf1de46a455b7be6720a58b' - '6e0e88c2ed0c3715d1409ee3258a0046' - '14186bbafe21bb0638c0cb8e0903c829' - 'e53a83bb4d8ac8b7eadd7bd58294751d' - 'c7cf6e4455c228e50d20ce3edd75ee59') - -build() { - cd $startdir/src/$pkgname-$pkgver - sed -i 's|/usr/local|/usr|' Makefile - sed -i 's|MANDIR:=$(PREFIX)/man|MANDIR:=$(PREFIX)/share/man|' Makefile - # this seems to cause more problems than help - # sed -i "s:/usr/src/linux:/usr/src/linux\*:" Makefile - make KERNEL_DIR=/usr/src/linux-$(uname -r) || return 1 - make KERNEL_DIR=/usr/src/linux-$(uname -r) experimental || return 1 - make PREFIX=$startdir/pkg/usr KERNEL_DIR=/usr/src/linux-$(uname -r) install || return 1 - make PREFIX=$startdir/pkg/usr KERNEL_DIR=/usr/src/linux-$(uname -r) install-devel || return 1 - make PREFIX=$startdir/pkg/usr KERNEL_DIR=/usr/src/linux-$(uname -r) install-experimental || return 1 - install -D -m755 ../iptables $startdir/pkg/etc/rc.d/iptables - install -D -m755 ../ip6tables $startdir/pkg/etc/rc.d/ip6tables - install -D -m644 ../empty.rules $startdir/pkg/etc/iptables/empty.rules - install -D -m644 ../simple_firewall.rules $startdir/pkg/etc/iptables/simple_firewall.rules - install -D -m644 ../iptables.conf.d $startdir/pkg/etc/conf.d/iptables -} diff --git a/abs/core/libcap/libcap-1.10-debian.patch b/abs/core/libcap/libcap-1.10-debian.patch deleted file mode 100644 index 26d57ec..0000000 --- a/abs/core/libcap/libcap-1.10-debian.patch +++ /dev/null @@ -1,766 +0,0 @@ ---- libcap-1.10.orig/doc/old/cap_set_fd.3 -+++ libcap-1.10/doc/old/cap_set_fd.3 -@@ -0,0 +1 @@ -+.so man3/cap_get_file.3 ---- libcap-1.10.orig/doc/old/cap_set_file.3 -+++ libcap-1.10/doc/old/cap_set_file.3 -@@ -0,0 +1 @@ -+.so man3/cap_get_file.3 ---- libcap-1.10.orig/doc/capset.2 -+++ libcap-1.10/doc/capset.2 -@@ -1 +1 @@ --.so man2/capget.2 -+#.so man2/capget.2 ---- libcap-1.10.orig/doc/Makefile -+++ libcap-1.10/doc/Makefile -@@ -7,7 +7,7 @@ - topdir=$(shell pwd)/.. - include $(topdir)/Make.Rules - --MAN2S = capget.2 capset.2 -+#MAN2S = capget.2 - MAN3S = cap_init.3 cap_free.3 cap_dup.3 \ - cap_clear.3 cap_get_flag.3 cap_set_flag.3 \ - cap_get_proc.3 cap_set_proc.3 \ ---- libcap-1.10.orig/Make.Rules -+++ libcap-1.10/Make.Rules -@@ -8,7 +8,7 @@ - - # common 'packaging' directoty - --FAKEROOT= -+FAKEROOT=$(DESTDIR) - - # Autoconf-style prefixes are activated when $(prefix) is defined. - # Otherwise binaries and libraraies are installed in /{lib,sbin}/, -@@ -18,13 +18,13 @@ - exec_prefix=$(prefix) - lib_prefix=$(exec_prefix) - inc_prefix=$(lib_prefix) --man_prefix=$(prefix) -+man_prefix=$(prefix)/share - else - prefix=/usr - exec_prefix= - lib_prefix=$(exec_prefix) - inc_prefix=$(prefix) --man_prefix=$(prefix) -+man_prefix=$(prefix)/share - endif - - # Target directories -@@ -42,7 +42,7 @@ - # Compilation specifics - - CC=gcc --COPTFLAGS=-O2 -+COPTFLAGS=-O2 - DEBUG=-g #-DDEBUG - WARNINGS=-ansi -D_POSIX_SOURCE -Wall -Wwrite-strings \ - -Wpointer-arith -Wcast-qual -Wcast-align \ ---- libcap-1.10.orig/Makefile -+++ libcap-1.10/Makefile -@@ -3,17 +3,20 @@ - # - # Makefile for libcap - -+ifndef topdir - topdir=$(shell pwd) --include Make.Rules -+endif -+include $(topdir)/Make.Rules -+DESTDIR= - - # - # flags - # - - all install clean: %: %-here -- make -C libcap $(MAKE_DEFS) $@ -- make -C progs $(MAKE_DEFS) $@ -- make -C doc $(MAKE_DEFS) $@ -+ make -C $(topdir)/libcap $(MAKE_DEFS) $@ -+ make -C $(topdir)/progs $(MAKE_DEFS) $@ -+ make -C $(topdir)/doc $(MAKE_DEFS) $@ - - all-here: - ---- libcap-1.10.orig/libcap/include/sys/capability.h -+++ libcap-1.10/libcap/include/sys/capability.h -@@ -21,7 +21,288 @@ - */ - - #include --#include -+/* -+ * This is -+ * -+ * Andrew G. Morgan -+ * Alexander Kjeldaas -+ * with help from Aleph1, Roland Buresund and Andrew Main. -+ * -+ * See here for the libcap library ("POSIX draft" compliance): -+ * -+ * ftp://linux.kernel.org/pub/linux/libs/security/linux-privs/kernel-2.2/ -+ */ -+ -+#ifndef _LINUX_CAPABILITY_H -+#define _LINUX_CAPABILITY_H -+ -+#include -+/*#include */ -+ -+/* User-level do most of the mapping between kernel and user -+ capabilities based on the version tag given by the kernel. The -+ kernel might be somewhat backwards compatible, but don't bet on -+ it. */ -+ -+/* XXX - Note, cap_t, is defined by POSIX to be an "opaque" pointer to -+ a set of three capability sets. The transposition of 3*the -+ following structure to such a composite is better handled in a user -+ library since the draft standard requires the use of malloc/free -+ etc.. */ -+ -+#define _LINUX_CAPABILITY_VERSION 0x19980330 -+ -+typedef struct __user_cap_header_struct { -+ __u32 version; -+ int pid; -+} *cap_user_header_t; -+ -+typedef struct __user_cap_data_struct { -+ __u32 effective; -+ __u32 permitted; -+ __u32 inheritable; -+} *cap_user_data_t; -+ -+#ifdef __KERNEL__ -+ -+/* #define STRICT_CAP_T_TYPECHECKS */ -+ -+#ifdef STRICT_CAP_T_TYPECHECKS -+ -+typedef struct kernel_cap_struct { -+ __u32 cap; -+} kernel_cap_t; -+ -+#else -+ -+typedef __u32 kernel_cap_t; -+ -+#endif -+ -+#define _USER_CAP_HEADER_SIZE (2*sizeof(__u32)) -+#define _KERNEL_CAP_T_SIZE (sizeof(kernel_cap_t)) -+ -+#endif -+ -+ -+/** -+ ** POSIX-draft defined capabilities. -+ **/ -+ -+/* In a system with the [_POSIX_CHOWN_RESTRICTED] option defined, this -+ overrides the restriction of changing file ownership and group -+ ownership. */ -+ -+#define CAP_CHOWN 0 -+ -+/* Override all DAC access, including ACL execute access if -+ [_POSIX_ACL] is defined. Excluding DAC access covered by -+ CAP_LINUX_IMMUTABLE. */ -+ -+#define CAP_DAC_OVERRIDE 1 -+ -+/* Overrides all DAC restrictions regarding read and search on files -+ and directories, including ACL restrictions if [_POSIX_ACL] is -+ defined. Excluding DAC access covered by CAP_LINUX_IMMUTABLE. */ -+ -+#define CAP_DAC_READ_SEARCH 2 -+ -+/* Overrides all restrictions about allowed operations on files, where -+ file owner ID must be equal to the user ID, except where CAP_FSETID -+ is applicable. It doesn't override MAC and DAC restrictions. */ -+ -+#define CAP_FOWNER 3 -+ -+/* Overrides the following restrictions that the effective user ID -+ shall match the file owner ID when setting the S_ISUID and S_ISGID -+ bits on that file; that the effective group ID (or one of the -+ supplementary group IDs) shall match the file owner ID when setting -+ the S_ISGID bit on that file; that the S_ISUID and S_ISGID bits are -+ cleared on successful return from chown(2) (not implemented). */ -+ -+#define CAP_FSETID 4 -+ -+/* Used to decide between falling back on the old suser() or fsuser(). */ -+ -+#define CAP_FS_MASK 0x1f -+ -+/* Overrides the restriction that the real or effective user ID of a -+ process sending a signal must match the real or effective user ID -+ of the process receiving the signal. */ -+ -+#define CAP_KILL 5 -+ -+/* Allows setgid(2) manipulation */ -+/* Allows setgroups(2) */ -+/* Allows forged gids on socket credentials passing. */ -+ -+#define CAP_SETGID 6 -+ -+/* Allows set*uid(2) manipulation (including fsuid). */ -+/* Allows forged pids on socket credentials passing. */ -+ -+#define CAP_SETUID 7 -+ -+ -+/** -+ ** Linux-specific capabilities -+ **/ -+ -+/* Transfer any capability in your permitted set to any pid, -+ remove any capability in your permitted set from any pid */ -+ -+#define CAP_SETPCAP 8 -+ -+/* Allow modification of S_IMMUTABLE and S_APPEND file attributes */ -+ -+#define CAP_LINUX_IMMUTABLE 9 -+ -+/* Allows binding to TCP/UDP sockets below 1024 */ -+/* Allows binding to ATM VCIs below 32 */ -+ -+#define CAP_NET_BIND_SERVICE 10 -+ -+/* Allow broadcasting, listen to multicast */ -+ -+#define CAP_NET_BROADCAST 11 -+ -+/* Allow interface configuration */ -+/* Allow administration of IP firewall, masquerading and accounting */ -+/* Allow setting debug option on sockets */ -+/* Allow modification of routing tables */ -+/* Allow setting arbitrary process / process group ownership on -+ sockets */ -+/* Allow binding to any address for transparent proxying */ -+/* Allow setting TOS (type of service) */ -+/* Allow setting promiscuous mode */ -+/* Allow clearing driver statistics */ -+/* Allow multicasting */ -+/* Allow read/write of device-specific registers */ -+/* Allow activation of ATM control sockets */ -+ -+#define CAP_NET_ADMIN 12 -+ -+/* Allow use of RAW sockets */ -+/* Allow use of PACKET sockets */ -+ -+#define CAP_NET_RAW 13 -+ -+/* Allow locking of shared memory segments */ -+/* Allow mlock and mlockall (which doesn't really have anything to do -+ with IPC) */ -+ -+#define CAP_IPC_LOCK 14 -+ -+/* Override IPC ownership checks */ -+ -+#define CAP_IPC_OWNER 15 -+ -+/* Insert and remove kernel modules - modify kernel without limit */ -+/* Modify cap_bset */ -+#define CAP_SYS_MODULE 16 -+ -+/* Allow ioperm/iopl access */ -+/* Allow sending USB messages to any device via /proc/bus/usb */ -+ -+#define CAP_SYS_RAWIO 17 -+ -+/* Allow use of chroot() */ -+ -+#define CAP_SYS_CHROOT 18 -+ -+/* Allow ptrace() of any process */ -+ -+#define CAP_SYS_PTRACE 19 -+ -+/* Allow configuration of process accounting */ -+ -+#define CAP_SYS_PACCT 20 -+ -+/* Allow configuration of the secure attention key */ -+/* Allow administration of the random device */ -+/* Allow examination and configuration of disk quotas */ -+/* Allow configuring the kernel's syslog (printk behaviour) */ -+/* Allow setting the domainname */ -+/* Allow setting the hostname */ -+/* Allow calling bdflush() */ -+/* Allow mount() and umount(), setting up new smb connection */ -+/* Allow some autofs root ioctls */ -+/* Allow nfsservctl */ -+/* Allow VM86_REQUEST_IRQ */ -+/* Allow to read/write pci config on alpha */ -+/* Allow irix_prctl on mips (setstacksize) */ -+/* Allow flushing all cache on m68k (sys_cacheflush) */ -+/* Allow removing semaphores */ -+/* Used instead of CAP_CHOWN to "chown" IPC message queues, semaphores -+ and shared memory */ -+/* Allow locking/unlocking of shared memory segment */ -+/* Allow turning swap on/off */ -+/* Allow forged pids on socket credentials passing */ -+/* Allow setting readahead and flushing buffers on block devices */ -+/* Allow setting geometry in floppy driver */ -+/* Allow turning DMA on/off in xd driver */ -+/* Allow administration of md devices (mostly the above, but some -+ extra ioctls) */ -+/* Allow tuning the ide driver */ -+/* Allow access to the nvram device */ -+/* Allow administration of apm_bios, serial and bttv (TV) device */ -+/* Allow manufacturer commands in isdn CAPI support driver */ -+/* Allow reading non-standardized portions of pci configuration space */ -+/* Allow DDI debug ioctl on sbpcd driver */ -+/* Allow setting up serial ports */ -+/* Allow sending raw qic-117 commands */ -+/* Allow enabling/disabling tagged queuing on SCSI controllers and sending -+ arbitrary SCSI commands */ -+/* Allow setting encryption key on loopback filesystem */ -+ -+#define CAP_SYS_ADMIN 21 -+ -+/* Allow use of reboot() */ -+ -+#define CAP_SYS_BOOT 22 -+ -+/* Allow raising priority and setting priority on other (different -+ UID) processes */ -+/* Allow use of FIFO and round-robin (realtime) scheduling on own -+ processes and setting the scheduling algorithm used by another -+ process. */ -+ -+#define CAP_SYS_NICE 23 -+ -+/* Override resource limits. Set resource limits. */ -+/* Override quota limits. */ -+/* Override reserved space on ext2 filesystem */ -+/* NOTE: ext2 honors fsuid when checking for resource overrides, so -+ you can override using fsuid too */ -+/* Override size restrictions on IPC message queues */ -+/* Allow more than 64hz interrupts from the real-time clock */ -+/* Override max number of consoles on console allocation */ -+/* Override max number of keymaps */ -+ -+#define CAP_SYS_RESOURCE 24 -+ -+/* Allow manipulation of system clock */ -+/* Allow irix_stime on mips */ -+/* Allow setting the real-time clock */ -+ -+#define CAP_SYS_TIME 25 -+ -+/* Allow configuration of tty devices */ -+/* Allow vhangup() of tty */ -+ -+#define CAP_SYS_TTY_CONFIG 26 -+ -+/* Allow the privileged aspects of mknod() */ -+ -+#define CAP_MKNOD 27 -+ -+/* Allow taking of leases on files */ -+ -+#define CAP_LEASE 28 -+ -+#endif /* !_LINUX_CAPABILITY_H */ -+ -+ - - /* - * POSIX capability types ---- libcap-1.10.orig/libcap/Makefile -+++ libcap-1.10/libcap/Makefile -@@ -24,12 +24,15 @@ - # - # defines - # -+ifndef $(topdir) - topdir=$(shell pwd)/.. --include ../Make.Rules -+endif -+include $(topdir)/Make.Rules -+ - # - # Library version - # --LIBNAME=libcap.so -+LIBNAME=libcap - # - - FILES=cap_alloc cap_proc cap_extint cap_flag cap_text cap_sys -@@ -39,10 +42,11 @@ - - INCLS=libcap.h cap_names.h $(INCS) - OBJS=$(addsuffix .o, $(FILES)) --MAJLIBNAME=$(LIBNAME).$(VERSION) -+LOBJS=$(addsuffix .lo, $(FILES)) -+MAJLIBNAME=$(LIBNAME).so.$(VERSION) - MINLIBNAME=$(MAJLIBNAME).$(MINOR) - --all: $(MINLIBNAME) -+all: $(MINLIBNAME) $(LIBNAME).a - - _makenames: _makenames.c cap_names.sed - $(CC) $(CFLAGS) $(LDFLAGS) $< -o $@ -@@ -50,31 +54,38 @@ - cap_names.h: _makenames - ./_makenames > cap_names.h - --cap_names.sed: Makefile /usr/include/linux/capability.h -- @echo "=> making cap_names.c from " -- @sed -ne '/^#define[ \t]CAP[_A-Z]\+[ \t]\+[0-9]\+/{s/^#define \([^ \t]*\)[ \t]*\([^ \t]*\)/ \{ \2, \"\1\" \},/;y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/;p;}' < /usr/include/linux/capability.h | fgrep -v 0x > cap_names.sed --# @sed -ne '/^#define[ \t]CAP[_A-Z]\+[ \t]\+[0-9]\+/{s/^#define CAP_\([^ \t]*\)[ \t]*\([^ \t]*\)/ \{ \2, \"\1\" \},/;y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/;p;}' < /usr/include/linux/capability.h | fgrep -v 0x > cap_names.sed -+cap_names.sed: Makefile include/sys/capability.h -+ @echo "=> making cap_names.c from " -+ @sed -ne '/^#define[ \t]CAP[_A-Z]\+[ \t]\+[0-9]\+/{s/^#define \([^ \t]*\)[ \t]*\([^ \t]*\)/ \{ \2, \"\1\" \},/;y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/;p;}' < include/sys/capability.h | fgrep -v 0x > cap_names.sed # @sed -ne '/^#define[ \t]CAP[_A-Z]\+[ \t]\+[0-9]\+/{s/^#define CAP_\([^ \t]*\)[ \t]*\([^ \t]*\)/ \{ \2, \"\1\" \},/;y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/;p;}' < /usr/include/linux/capability.h | fgrep -v 0x > cap_names.sed -+ -+$(LIBNAME).a: $(OBJS) -+ ar cruv $(LIBNAME).a $(OBJS) - --$(MINLIBNAME): $(OBJS) -- $(LD) -soname $(MAJLIBNAME) -x -shared -o $@ $(OBJS) -+$(MINLIBNAME): $(LOBJS) -+ $(CC) -shared -fPIC -Wl,-soname,$(MAJLIBNAME) -o $@ $(LOBJS) - ln -sf $(MINLIBNAME) $(MAJLIBNAME) -- ln -sf $(MAJLIBNAME) $(LIBNAME) -+ ln -sf $(MAJLIBNAME) $(LIBNAME).so - - %.o: %.c $(INCLS) - $(CC) $(CFLAGS) -c $< -o $@ - -+%.lo: %.c $(INCLS) -+ $(CC) $(CFLAGS) -fPIC -c $< -o $@ -+ -+ - install: all - mkdir -p -m 0755 $(INCDIR)/sys - install -m 0644 include/sys/capability.h $(INCDIR)/sys - mkdir -p -m 0755 $(LIBDIR) -+ install -m 0644 $(LIBNAME).a $(LIBDIR) - install -m 0644 $(MINLIBNAME) $(LIBDIR)/$(MINLIBNAME) - ln -sf $(MINLIBNAME) $(LIBDIR)/$(MAJLIBNAME) -- ln -sf $(MAJLIBNAME) $(LIBDIR)/$(LIBNAME) -+ ln -sf $(MAJLIBNAME) $(LIBDIR)/$(LIBNAME).so - -/sbin/ldconfig - - clean: - $(LOCALCLEAN) -- rm -f $(OBJS) $(LIBNAME)* -+ rm -f $(OBJS) $(LOBJS) $(LIBNAME).a $(LIBNAME).so* - rm -f cap_names.h cap_names.sed _makenames - cd include/sys && $(LOCALCLEAN) - ---- libcap-1.10.orig/libcap/_makenames.c -+++ libcap-1.10/libcap/_makenames.c -@@ -9,7 +9,7 @@ - - #include - #include --#include -+#include - - /* - * #include 'sed' generated array ---- libcap-1.10.orig/libcap/cap_sys.c -+++ libcap-1.10/libcap/cap_sys.c -@@ -10,7 +10,8 @@ - #include "libcap.h" - #define __LIBRARY__ - #include -- -+/* glic >= 2.1 knows capset/capget. no need to define it here */ -+/* - _syscall2(int, capget, - cap_user_header_t, header, - cap_user_data_t, data) -@@ -18,7 +19,7 @@ - _syscall2(int, capset, - cap_user_header_t, header, - const cap_user_data_t, data) -- -+*/ - /* - * $Log: libcap-1.10-debian.patch,v $ - * Revision 1.1 2006/10/29 23:14:00 jgc - * upgpkg: libcap 1.10-2 - * Remove amd64 patches that messed things up - * Apply debian patch to make it build again - * Remove empty man2 directory the right way - * - * Revision 1.1.1.1 1999/04/17 22:16:31 morgan ---- libcap-1.10.orig/capfaq-0.2.txt -+++ libcap-1.10/capfaq-0.2.txt -@@ -0,0 +1,264 @@ -+This is the Linux kernel capabilities FAQ -+ -+Its history, to the extent that I am able to reconstruct it is that -+v2.0 was posted to the Linux kernel list on 1999/04/02 by Boris -+Tobotras. Thanks to Denis Ducamp for forwarding me a copy. -+ -+Cheers -+ -+Andrew -+ -+Linux Capabilities FAQ 0.2 -+========================== -+ -+1) What is a capability? -+ -+The name "capabilities" as used in the Linux kernel can be confusing. -+First there are Capabilities as defined in computer science. A -+capability is a token used by a process to prove that it is allowed to -+do an operation on an object. The capability identifies the object -+and the operations allowed on that object. A file descriptor is a -+capability. You create the file descriptor with the "open" call and -+request read or write permissions. Later, when doing a read or write -+operation, the kernel uses the file descriptor as an index into a -+data structure that indicates what operations are allowed. This is an -+efficient way to check permissions. The necessary data structures are -+created once during the "open" call. Later read and write calls only -+have to do a table lookup. Operations on capabilities include copying -+capabilities, transferring capabilities between processes, modifying a -+capability, and revoking a capability. Modifying a capability can be -+something like taking a read-write filedescriptor and making it -+read-only. A capability often has a notion of an "owner" which is -+able to invalidate all copies and derived versions of a capability. -+Entire OSes are based on this "capability" model, with varying degrees -+of purity. There are other ways of implementing capabilities than the -+file descriptor model - traditionally special hardware has been used, -+but modern systems also use the memory management unit of the CPU. -+ -+Then there is something quite different called "POSIX capabilities" -+which is what Linux uses. These capabilities are a partitioning of -+the all powerful root privilege into a set of distinct privileges (but -+look at securelevel emulation to find out that this isn't necessary -+the whole truth). Users familiar with VMS or "Trusted" versions of -+other UNIX variants will know this under the name "privileges". The -+name "capabilities" comes from the now defunct POSIX draft 1003.1e -+which used this name. -+ -+2) So what is a "POSIX capability"? -+ -+A process has three sets of bitmaps called the inheritable(I), -+permitted(P), and effective(E) capabilities. Each capability is -+implemented as a bit in each of these bitmaps which is either set or -+unset. When a process tries to do a privileged operation, the -+operating system will check the appropriate bit in the effective set -+of the process (instead of checking whether the effective uid of the -+process i 0 as is normally done). For example, when a process tries -+to set the clock, the Linux kernel will check that the process has the -+CAP_SYS_TIME bit (which is currently bit 25) set in its effective set. -+ -+The permitted set of the process indicates the capabilities the -+process can use. The process can have capabilities set in the -+permitted set that are not in the effective set. This indicates that -+the process has temporarily disabled this capability. A process is -+allowed to set a bit in its effective set only if it is available in -+the permitted set. The distinction between effective and permitted -+exists so that processes can "bracket" operations that need privilege. -+ -+The inheritable capabilities are the capabilities of the current -+process that should be inherited by a program executed by the current -+process. The permitted set of a process is masked against the -+inheritable set during exec(). Nothing special happens during fork() -+or clone(). Child processes and threads are given an exact copy of -+the capabilities of the parent process. -+ -+3) What about other entities in the system? Users, Groups, Files? -+ -+Files have capabilities. Conceptually they have the same three -+bitmaps that processes have, but to avoid confusion we call them by -+other names. Only executable files have capabilities, libraries don't -+have capabilities (yet). The three sets are called the allowed set, -+the forced set, and the effective set. -+ -+The allowed set indicates what capabilities the executable is allowed -+to receive from an execing process. This means that during exec(), -+the capabilities of the old process are first masked against a set -+which indicates what the process gives away (the inheritable set of -+the process), and then they are masked against a set which indicates -+what capabilities the new process image is allowed to receive (the -+allowed set of the executable). -+ -+The forced set is a set of capabilities created out of thin air and -+given to the process after execing the executable. The forced set is -+similar in nature to the setuid feature. In fact, the setuid bit from -+the filesystem is "read" as a full forced set by the kernel. -+ -+The effective set indicates which bits in the permitted set of the new -+process should be transferred to the effective set of the new process. -+The effective set is best thought of as a "capability aware" set. It -+should consist of only 1s if the executable is capability-dumb, or -+only 0s if the executable is capability-smart. Since the effective -+set consists of only 0s or only 1s, the filesystem can implement this -+set using a single bit. -+ -+NOTE: Filesystem support for capabilities is not part of Linux 2.2. -+ -+Users and Groups don't have associated capabilities from the kernel's -+point of view, but it is entirely reasonable to associate users or -+groups with capabilities. By letting the "login" program set some -+capabilities it is possible to make role users such as a backup user -+that will have the CAP_DAC_READ_SEARCH capability and be able to do -+backups. This could also be implemented as a PAM module, but nobody -+has implemented one yet. -+ -+4) What capabilities exist? -+ -+The capabilities available in Linux are listed and documented in the -+file /usr/src/linux/include/linux/capability.h. -+ -+5) Are Linux capabilities hierarchical? -+ -+No, you cannot make a "subcapability" out of a Linux capability as in -+capability-based OSes. -+ -+6) How can I use capabilities to make sure Mr. Evil Luser (eluser) -+can't exploit my "suid" programs? -+ -+This is the general outline of how this works given filesystem -+capability support exists. First, you have a PAM module that sets the -+inheritable capabilities of the login-shell of eluser. Then for all -+"suid" programs on the system, you decide what capabilities they need -+and set the _allowed_ set of the executable to that set of -+capabilities. The capability rules -+ -+ new permitted = forced | (allowed & inheritable) -+ -+means that you should be careful about setting forced capabilities on -+executables. In a few cases, this can be useful though. For example -+the login program needs to set the inheritable set of the new user and -+therefore needs an almost full permitted set. So if you want eluser -+to be able to run login and log in as a different user, you will have -+to set some forced bits on that executable. -+ -+7) What about passing capabilities between processes? -+ -+Currently this is done by the system call "setcap" which can set the -+capabilities of another process. This requires the CAP_SETPCAP -+capability which you really only want to grant a _few_ processes. -+CAP_SETPCAP was originally intended as a workaround to be able to -+implement filesystem support for capabilities using a daemon outside -+the kernel. -+ -+There has been discussions about implementing socket-level capability -+passing. This means that you can pass a capability over a socket. No -+support for this exists in the official kernel yet. -+ -+8) I see securelevel has been removed from 2.2 and are superceeded by -+capabilities. How do I emulate securelevel using capabilities? -+ -+The setcap system call can remove a capability from _all_ processes on -+the system in one atomic operation. The setcap utility from the -+libcap distribution will do this for you. The utility requires the -+CAP_SETPCAP privilege to do this. The CAP_SETPCAP capability is not -+enabled by default. -+ -+libcap is available from -+ftp://ftp.kernel.org/pub/linux/libs/security/linux-privs/kernel-2.2/ -+ -+9) I noticed that the capability.h file lacks some capabilities that -+are needed to fully emulate 2.0 securelevel. Is there a patch for -+this? -+ -+Actually yes - funny you should ask :-). The problem with 2.0 -+securelevel is that they for example stop root from accessing block -+devices. At the same time they restrict the use of iopl. These two -+changes are fundamentally different. Blocking access to block devices -+means restricting something that usually isn't restricted. -+Restricting access to the use of iopl on the other hand means -+restricting (blocking) access to something that is already blocked. -+Emulating the parts of 2.0 securelevel that restricts things that are -+normally not restricted means that the capabilites in the kernel has -+to have a set of capabilities that are usually _on_ for a normal -+process (note that this breaks the explanation that capabilities are a -+partitioning of the root privileges). There is an experimental patch at -+ -+ftp://ftp.guardian.no/pub/free/linux/capabilities/patch-cap-exp-1 -+ -+which implements a set of capabilities with the "CAP_USER" prefix: -+ -+cap_user_sock - allowed to use socket() -+cap_user_dev - allowed to open char/block devices -+cap_user_fifo - allowed to use pipes -+ -+These should be enough to emulate 2.0 securelevel (tell me if we need -+something more). -+ -+10) Seems I need a CAP_SETPCAP capability that I don't have to make use -+of capabilities. How do I enable this capability? -+ -+Change the definition of CAP_INIT_EFF_SET and CAP_INIT_INH_SET to the -+following in include/linux/capability.h: -+ -+#define CAP_INIT_EFF_SET { ~0 } -+#define CAP_INIT_INH_SET { ~0 } -+ -+This will start init with a full capability set and not with -+CAP_SETPCAP removed. -+ -+11) How do I start a process with a limited set of capabilities? -+ -+Get the libcap library and use the execcap utility. The following -+example starts the update daemon with only the CAP_SYS_ADMIN -+capability. -+ -+execcap 'cap_sys_admin=eip' update -+ -+12) How do I start a process with a limited set of capabilities under -+another uid? -+ -+Use the sucap utility which changes uid from root without loosing any -+capabilities. Normally all capabilities are cleared when changing uid -+from root. The sucap utility requires the CAP_SETPCAP capability. -+The following example starts updated under uid updated and gid updated -+with CAP_SYS_ADMIN raised in the Effective set. -+ -+sucap updated updated execcap 'cap_sys_admin=eip' update -+ -+[ Sucap is currently available from -+ftp://ftp.guardian.no/pub/free/linux/capabilities/sucap.c. Put it in -+the progs directory of libcap to compile.] -+ -+13) What are the "capability rules" -+ -+The capability rules are the rules used to set the capabilities of the -+new process image after an exec. They work like this: -+ -+ pI' = pI -+ (***) pP' = fP | (fI & pI) -+ pE' = pP' & fE [NB. fE is 0 or ~0] -+ -+ I=Inheritable, P=Permitted, E=Effective // p=process, f=file -+ ' indicates post-exec(). -+ -+Now to make sense of the equations think of fP as the Forced set of -+the executable, and fI as the Allowed set of the executable. Notice -+how the Inheritable set isn't touched at all during exec(). -+ -+14) What are the laws for setting capability bits in the Inheritable, -+Permitted, and Effective sets? -+ -+Bits can be transferred from Permitted to either Effective or -+Inheritable set. -+ -+Bits can be removed from all sets. -+ -+15) Where is the standard on which the Linux capabilities are based? -+ -+There used to be a POSIX draft called POSIX.6 and later POSIX 1003.1e. -+However after the committee had spent over 10 years, POSIX decided -+that enough is enough and dropped the draft. There will therefore not -+be a POSIX standard covering security anytime soon. This may lead to -+that the POSIX draft is available for free, however. -+ -+-- -+ Best regards, -- Boris. -+ diff --git a/abs/core/libcap/libcap-1.10-fixcflags.patch b/abs/core/libcap/libcap-1.10-fixcflags.patch deleted file mode 100644 index 3566d95..0000000 --- a/abs/core/libcap/libcap-1.10-fixcflags.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff -Naur libcap-1.10.orig/Make.Rules libcap-1.10/Make.Rules ---- libcap-1.10.orig/Make.Rules 2005-05-30 16:10:07.000000000 +0000 -+++ libcap-1.10/Make.Rules 2005-05-30 16:11:18.000000000 +0000 -@@ -42,8 +42,8 @@ - # Compilation specifics - - CC=gcc --COPTFLAGS=-O2 --DEBUG=-g #-DDEBUG -+COPTFLAGS=-O2 -fPIC -+DEBUG= - WARNINGS=-ansi -D_POSIX_SOURCE -Wall -Wwrite-strings \ - -Wpointer-arith -Wcast-qual -Wcast-align \ - -Wtraditional -Wstrict-prototypes -Wmissing-prototypes \ -@@ -54,7 +54,7 @@ - IPATH=-I$(topdir)/libcap/include - INCS=$(topdir)/libcap/include/sys/capability.h - LIBS=-L$(topdir)/libcap -lcap --CFLAGS=-Dlinux $(WARNINGS) $(DEBUG) $(COPTFLAG) $(IPATH) -+CFLAGS+=-Dlinux $(WARNINGS) $(DEBUG) $(COPTFLAG) $(IPATH) - - # Global cleanup stuff \ No newline at end of file diff --git a/abs/core/libcap/libcap-1.10-shared.patch b/abs/core/libcap/libcap-1.10-shared.patch deleted file mode 100644 index 54e5496..0000000 --- a/abs/core/libcap/libcap-1.10-shared.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- libcap-1.11/libcap/Makefile.shared 1999-04-17 18:16:31.000000000 -0400 -+++ libcap-1.11/libcap/Makefile 2002-07-19 06:24:23.000000000 -0400 -@@ -56,12 +56,12 @@ cap_names.sed: Makefile /usr/include/lin - # @sed -ne '/^#define[ \t]CAP[_A-Z]\+[ \t]\+[0-9]\+/{s/^#define CAP_\([^ \t]*\)[ \t]*\([^ \t]*\)/ \{ \2, \"\1\" \},/;y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/;p;}' < /usr/include/linux/capability.h | fgrep -v 0x > cap_names.sed - - $(MINLIBNAME): $(OBJS) -- $(LD) -soname $(MAJLIBNAME) -x -shared -o $@ $(OBJS) -+ $(CC) -Wl,-soname,$(MAJLIBNAME) -Wl,-x -shared -o $@ $(OBJS) - ln -sf $(MINLIBNAME) $(MAJLIBNAME) - ln -sf $(MAJLIBNAME) $(LIBNAME) - - %.o: %.c $(INCLS) -- $(CC) $(CFLAGS) -c $< -o $@ -+ $(CC) $(CFLAGS) -fpic -c $< -o $@ - - install: all - mkdir -p -m 0755 $(INCDIR)/sys diff --git a/abs/core/libpcap/libpcap-shared.patch b/abs/core/libpcap/libpcap-shared.patch deleted file mode 100644 index a200836..0000000 --- a/abs/core/libpcap/libpcap-shared.patch +++ /dev/null @@ -1,51 +0,0 @@ -diff -u -r libpcap-0.6.2/Makefile.in libpcap-shared/Makefile.in ---- libpcap-0.6.2/Makefile.in Thu Jan 18 05:06:24 2001 -+++ libpcap-shared/Makefile.in Fri Jul 20 16:26:05 2001 -@@ -22,6 +22,10 @@ - # - # Various configurable paths (remember to edit Makefile.in, not Makefile) - # -+MAJOR = @MAJOR@ -+MINOR = @MINOR@ -+SUBMINOR = @SUBMINOR@ -+VERSION = @VERSION@ - - # Top level hierarchy - prefix = @prefix@ -@@ -47,7 +51,7 @@ - DEFS = @DEFS@ - - # Standard CFLAGS --CFLAGS = $(CCOPT) $(INCLS) $(DEFS) -+CFLAGS = $(CCOPT) $(INCLS) $(DEFS) -fPIC -DPIC - - INSTALL = @INSTALL@ - INSTALL_PROGRAM = @INSTALL_PROGRAM@ -@@ -91,9 +95,14 @@ - TAGFILES = \ - $(SRC) $(HDR) $(TAGHDR) - --CLEANFILES = $(OBJ) libpcap.a $(GENSRC) $(GENHDR) lex.yy.c - --all: libpcap.a -+ -+CLEANFILES = $(OBJ) libpcap.a $(GENSRC) $(GENHDR) lex.yy.c libpcap.so.$(VERSION) -+ -+all: libpcap.a libpcap.so.$(VERSION) -+ -+libpcap.so.$(VERSION): -+ gcc -shared -Wl,-soname -Wl,libpcap.so.$(VERSION) -o libpcap.so.$(VERSION) $(OBJ) -lc - - libpcap.a: $(OBJ) - @rm -f $@ -@@ -139,6 +148,10 @@ - [ -d $(DESTDIR)$(libdir) ] || \ - (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir)) - $(INSTALL_DATA) libpcap.a $(DESTDIR)$(libdir)/libpcap.a -+ $(INSTALL_DATA) libpcap.so.$(VERSION) $(DESTDIR)$(libdir)/libpcap.so.$(VERSION) -+ ln -s libpcap.so.$(VERSION) $(DESTDIR)$(libdir)/libpcap.so -+ ln -s libpcap.so.$(VERSION) $(DESTDIR)$(libdir)/libpcap.so.$(MAJOR) -+ ln -s libpcap.so.$(VERSION) $(DESTDIR)$(libdir)/libpcap.so.$(MAJOR).$(MINOR) - $(RANLIB) $(DESTDIR)$(libdir)/libpcap.a - [ -d $(DESTDIR)$(includedir) ] || \ - (mkdir -p $(DESTDIR)$(includedir); chmod 755 $(DESTDIR)$(includedir)) diff --git a/abs/core/libpng/ChangeLog b/abs/core/libpng/ChangeLog deleted file mode 100644 index 98aa66d..0000000 --- a/abs/core/libpng/ChangeLog +++ /dev/null @@ -1,55 +0,0 @@ - -2008-10-06 Douglas Soares de Andrade - - * Updated for i686: 1.2.32 - -2008-08-23 Douglas Soares de Andrade - - * Updated for i686: 1.2.31 - * Thanks to Hussam Al-Tayeb - -2008-08-17 Douglas Soares de Andrade - - * Had to return to 1.2.29 because xul depends on - png with apng patch - -2008-08-17 Douglas Soares de Andrade - - * Updated for i686: 1.2.30 - * Fixes some security issues - * Remove the apng patch as there was no compatible version - for this version - -2008-07-04 Douglas Soares de Andrade - - * Updated for i686 - 1.2.29-1 - * Updated the apng patch for 1.2.29 - -2008-05-06 Travis Willard - - * 1.2.28-1 - Upstream update - Uses same APNG patchset as 1.2.27 - -2008-05-01 Jan de Groot - - * 1.2.27-1 - Upstream update (security update!) - Fix APNG patchset to apply to 1.2.27 - Fix build with newer libtool versions - -2008-03-12 Travis Willard - - * 1.2.25-1 - Upstream update - -2008-02-18 Travis Willard - - * 1.2.24-3 - Corrected ChangeLog - -2008-02-18 Travis Willard - - * 1.2.24-2 - Added ChangeLog - Added APNG patchset from diff --git a/abs/core/libpng/libpng-1.2.29-apng.patch b/abs/core/libpng/libpng-1.2.29-apng.patch deleted file mode 100644 index cc27ca3..0000000 --- a/abs/core/libpng/libpng-1.2.29-apng.patch +++ /dev/null @@ -1,1671 +0,0 @@ -Submitted By: Jens Ornot -Resubmitted by: Jens Ornot - Fix APNG patchset to apply to 1.2.27 -Date: 2008-05-24 -Initial Package Version: 1.2.10 -Upstream Status: Unknown -Origin: Andrew Smith -Description: APNG is an extension of the [PNG][pngspec] format, adding support for animated images. - It is intended to be a replacement for simple animated images - that have traditionally used the [GIF][gifspec] format, - while adding support for 24-bit images and 8-bit transparency. - APNG is a simpler alternative to MNG, - providing a spec suitable for the most common usage of animated images on the Internet. - - APNG is backwards-compatible with PNG; - any PNG decoder should be able to ignore the APNG-specific chunks and display a single image. - -diff -ruN libpng-1.2.27/png.c libpng-1.2.27.apng/png.c ---- libpng-1.2.27/png.c 2008-04-30 10:23:12.000000000 +0000 -+++ libpng-1.2.27.apng/png.c 2008-05-01 09:49:58.000000000 +0000 -@@ -51,6 +51,9 @@ - PNG_tIME; - PNG_tRNS; - PNG_zTXt; -+PNG_acTL; -+PNG_fcTL; -+PNG_fdAT; - - #ifdef PNG_READ_SUPPORTED - /* arrays to facilitate easy interlacing - use pass (0 - 6) as index */ -diff -ruN libpng-1.2.27/png.h libpng-1.2.27.apng/png.h ---- libpng-1.2.27/png.h 2008-04-30 10:23:11.000000000 +0000 -+++ libpng-1.2.27.apng/png.h 2008-05-01 09:49:58.000000000 +0000 -@@ -958,6 +958,19 @@ - png_fixed_point int_y_blue; - #endif - -+#if defined(PNG_APNG_SUPPORTED) -+ png_uint_32 num_frames; /* including default image */ -+ png_uint_32 num_plays; -+ png_uint_32 next_frame_width; -+ png_uint_32 next_frame_height; -+ png_uint_32 next_frame_x_offset; -+ png_uint_32 next_frame_y_offset; -+ png_uint_16 next_frame_delay_num; -+ png_uint_16 next_frame_delay_den; -+ png_byte next_frame_dispose_op; -+ png_byte next_frame_blend_op; -+#endif -+ - } png_info; - - typedef png_info FAR * png_infop; -@@ -1059,6 +1072,8 @@ - #define PNG_INFO_sPLT 0x2000 /* ESR, 1.0.6 */ - #define PNG_INFO_sCAL 0x4000 /* ESR, 1.0.6 */ - #define PNG_INFO_IDAT 0x8000L /* ESR, 1.0.6 */ -+#define PNG_INFO_acTL 0x10000L -+#define PNG_INFO_fcTL 0x20000L - - /* This is used for the transformation routines, as some of them - * change these values for the row. It also should enable using -@@ -1099,6 +1114,10 @@ - typedef void (PNGAPI *png_progressive_end_ptr) PNGARG((png_structp, png_infop)); - typedef void (PNGAPI *png_progressive_row_ptr) PNGARG((png_structp, png_bytep, - png_uint_32, int)); -+#if defined(PNG_APNG_SUPPORTED) -+typedef void (PNGAPI *png_progressive_frame_ptr) PNGARG((png_structp, -+ png_uint_32)); -+#endif - #endif - - #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ -@@ -1430,6 +1449,39 @@ - png_uint_32 user_height_max; - #endif - -+#if defined(PNG_APNG_SUPPORTED) -+ png_uint_32 apng_flags; -+ png_uint_32 next_seq_num; /* next fcTL/fdAT chunk sequence number */ -+ png_uint_32 first_frame_width; -+ png_uint_32 first_frame_height; -+ -+#if defined(PNG_READ_APNG_SUPPORTED) -+ png_uint_32 num_frames_read; /* incremented after all image data of */ -+ /* a frame is read */ -+#ifdef PNG_PROGRESSIVE_READ_SUPPORTED -+ png_progressive_frame_ptr frame_info_fn; /* frame info read callback */ -+ png_progressive_frame_ptr frame_end_fn; /* frame data read callback */ -+#endif -+#endif -+ -+#if defined(PNG_WRITE_APNG_SUPPORTED) -+ png_uint_32 num_frames_to_write; -+ png_uint_32 num_frames_written; -+#endif -+#endif -+ -+/* For png_struct.apng_flags: */ -+#define PNG_FIRST_FRAME_HIDDEN 0x0001 -+ -+/* dispose_op flags from inside fcTL */ -+#define PNG_DISPOSE_OP_NONE 0x00 -+#define PNG_DISPOSE_OP_BACKGROUND 0x01 -+#define PNG_DISPOSE_OP_PREVIOUS 0x02 -+ -+/* blend_op flags from inside fcTL */ -+#define PNG_BLEND_OP_SOURCE 0x00 -+#define PNG_BLEND_OP_OVER 0x01 -+ - /* New member added in libpng-1.0.25 and 1.2.17 */ - #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) - /* storage for unknown chunk that the library doesn't recognize. */ -@@ -1759,6 +1811,18 @@ - extern PNG_EXPORT(void,png_write_image) PNGARG((png_structp png_ptr, - png_bytepp image)); - -+#if defined(PNG_WRITE_APNG_SUPPORTED) -+extern PNG_EXPORT (void,png_write_frame_head) PNGARG((png_structp png_ptr, -+ png_infop png_info, png_bytepp row_pointers, -+ png_uint_32 width, png_uint_32 height, -+ png_uint_32 x_offset, png_uint_32 y_offset, -+ png_uint_16 delay_num, png_uint_16 delay_den, png_byte dispose_op, -+ png_byte blend_op)); -+ -+extern PNG_EXPORT (void,png_write_frame_tail) PNGARG((png_structp png_ptr, -+ png_infop png_info)); -+#endif -+ - /* writes the end of the PNG file. */ - extern PNG_EXPORT(void,png_write_end) PNGARG((png_structp png_ptr, - png_infop info_ptr)); -@@ -2007,6 +2071,11 @@ - png_voidp progressive_ptr, - png_progressive_info_ptr info_fn, png_progressive_row_ptr row_fn, - png_progressive_end_ptr end_fn)); -+#if defined(PNG_READ_APNG_SUPPORTED) -+extern PNG_EXPORT(void,png_set_progressive_frame_fn) PNGARG((png_structp png_ptr, -+ png_progressive_frame_ptr frame_info_fn, -+ png_progressive_frame_ptr frame_end_fn)); -+#endif - - /* returns the user pointer associated with the push read functions */ - extern PNG_EXPORT(png_voidp,png_get_progressive_ptr) -@@ -2444,6 +2513,59 @@ - #endif - #endif /* PNG_sCAL_SUPPORTED || PNG_WRITE_sCAL_SUPPORTED */ - -+#if defined(PNG_APNG_SUPPORTED) -+extern PNG_EXPORT(png_uint_32,png_get_acTL) PNGARG((png_structp png_ptr, -+ png_infop info_ptr, png_uint_32 *num_frames, png_uint_32 *num_plays)); -+extern PNG_EXPORT(png_uint_32,png_set_acTL) PNGARG((png_structp png_ptr, -+ png_infop info_ptr, png_uint_32 num_frames, png_uint_32 num_plays)); -+extern PNG_EXPORT(png_uint_32,png_get_num_frames) PNGARG((png_structp png_ptr, -+ png_infop info_ptr)); -+extern PNG_EXPORT(png_uint_32,png_get_num_plays) -+ PNGARG((png_structp png_ptr, png_infop info_ptr)); -+ -+extern PNG_EXPORT(png_uint_32,png_get_next_frame_fcTL) -+ PNGARG((png_structp png_ptr, png_infop info_ptr, png_uint_32 *width, -+ png_uint_32 *height, png_uint_32 *x_offset, png_uint_32 *y_offset, -+ png_uint_16 *delay_num, png_uint_16 *delay_den, png_byte *dispose_op, -+ png_byte *blend_op)); -+extern PNG_EXPORT(png_uint_32,png_set_next_frame_fcTL) -+ PNGARG((png_structp png_ptr, png_infop info_ptr, png_uint_32 width, -+ png_uint_32 height, png_uint_32 x_offset, png_uint_32 y_offset, -+ png_uint_16 delay_num, png_uint_16 delay_den, png_byte dispose_op, -+ png_byte blend_op)); -+extern PNG_EXPORT(void,png_ensure_fcTL_is_valid) -+ PNGARG((png_structp png_ptr, -+ png_uint_32 width, png_uint_32 height, -+ png_uint_32 x_offset, png_uint_32 y_offset, -+ png_uint_16 delay_num, png_uint_16 delay_den, -+ png_byte dispose_op, png_byte blend_op)); -+extern PNG_EXPORT(png_uint_32,png_get_next_frame_width) -+ PNGARG((png_structp png_ptr, png_infop info_ptr)); -+extern PNG_EXPORT(png_uint_32,png_get_next_frame_height) -+ PNGARG((png_structp png_ptr, png_infop info_ptr)); -+extern PNG_EXPORT(png_uint_32,png_get_next_frame_x_offset) -+ PNGARG((png_structp png_ptr, png_infop info_ptr)); -+extern PNG_EXPORT(png_uint_32,png_get_next_frame_y_offset) -+ PNGARG((png_structp png_ptr, png_infop info_ptr)); -+extern PNG_EXPORT(png_uint_16,png_get_next_frame_delay_num) -+ PNGARG((png_structp png_ptr, png_infop info_ptr)); -+extern PNG_EXPORT(png_uint_16,png_get_next_frame_delay_den) -+ PNGARG((png_structp png_ptr, png_infop info_ptr)); -+extern PNG_EXPORT(png_byte,png_get_next_frame_dispose_op) -+ PNGARG((png_structp png_ptr, png_infop info_ptr)); -+extern PNG_EXPORT(png_byte,png_get_next_frame_blend_op) -+ PNGARG((png_structp png_ptr, png_infop info_ptr)); -+extern PNG_EXPORT(png_byte,png_get_first_frame_is_hidden) -+ PNGARG((png_structp png_ptr, png_infop info_ptr)); -+extern PNG_EXPORT(png_uint_32,png_set_first_frame_is_hidden) -+ PNGARG((png_structp png_ptr, png_infop info_ptr, png_byte is_hidden)); -+#endif /* PNG_APNG_SUPPORTED */ -+ -+#if defined(PNG_READ_APNG_SUPPORTED) -+extern PNG_EXPORT(void,png_read_frame_head) PNGARG((png_structp png_ptr, -+ png_infop info_ptr)); -+#endif -+ - #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) - /* provide a list of chunks and how they are to be handled, if the built-in - handling or default unknown chunk handling is not desired. Any chunks not -@@ -2750,6 +2872,8 @@ - #define PNG_BACKGROUND_IS_GRAY 0x800 - #define PNG_HAVE_PNG_SIGNATURE 0x1000 - #define PNG_HAVE_CHUNK_AFTER_IDAT 0x2000 /* Have another chunk after IDAT */ -+#define PNG_HAVE_acTL 0x4000 -+#define PNG_HAVE_fcTL 0x8000L - - /* flags for the transformations the PNG library does on the image data */ - #define PNG_BGR 0x0001 -@@ -2890,6 +3014,9 @@ - #define PNG_tIME png_byte png_tIME[5] = {116, 73, 77, 69, '\0'} - #define PNG_tRNS png_byte png_tRNS[5] = {116, 82, 78, 83, '\0'} - #define PNG_zTXt png_byte png_zTXt[5] = {122, 84, 88, 116, '\0'} -+#define PNG_acTL png_byte png_acTL[5] = { 97, 99, 84, 76, '\0'} -+#define PNG_fcTL png_byte png_fcTL[5] = {102, 99, 84, 76, '\0'} -+#define PNG_fdAT png_byte png_fdAT[5] = {102, 100, 65, 84, '\0'} - - #ifdef PNG_USE_GLOBAL_ARRAYS - PNG_EXPORT_VAR (png_byte FARDATA) png_IHDR[5]; -@@ -2913,6 +3040,9 @@ - PNG_EXPORT_VAR (png_byte FARDATA) png_tIME[5]; - PNG_EXPORT_VAR (png_byte FARDATA) png_tRNS[5]; - PNG_EXPORT_VAR (png_byte FARDATA) png_zTXt[5]; -+PNG_EXPORT_VAR (png_byte FARDATA) png_acTL[5]; -+PNG_EXPORT_VAR (png_byte FARDATA) png_fcTL[5]; -+PNG_EXPORT_VAR (png_byte FARDATA) png_fdAT[5]; - #endif /* PNG_USE_GLOBAL_ARRAYS */ - - #if defined(PNG_1_0_X) || defined (PNG_1_2_X) -@@ -3187,6 +3317,17 @@ - #endif - #endif - -+#if defined(PNG_WRITE_APNG_SUPPORTED) -+PNG_EXTERN void png_write_acTL PNGARG((png_structp png_ptr, -+ png_uint_32 num_frames, png_uint_32 num_plays)); -+ -+PNG_EXTERN void png_write_fcTL PNGARG((png_structp png_ptr, -+ png_uint_32 width, png_uint_32 height, -+ png_uint_32 x_offset, png_uint_32 y_offset, -+ png_uint_16 delay_num, png_uint_16 delay_den, -+ png_byte dispose_op, png_byte blend_op)); -+#endif -+ - /* Called when finished processing a row of data */ - PNG_EXTERN void png_write_finish_row PNGARG((png_structp png_ptr)); - -@@ -3238,6 +3379,20 @@ - PNG_EXTERN void png_read_transform_info PNGARG((png_structp png_ptr, - png_infop info_ptr)); - -+#if defined(PNG_READ_APNG_SUPPORTED) -+/* private, reset some things to become ready for reading next frame */ -+PNG_EXTERN void png_read_reset PNGARG((png_structp png_ptr)); -+PNG_EXTERN void png_read_reinit PNGARG((png_structp png_ptr, -+ png_infop info_ptr)); -+PNG_EXTERN void png_progressive_read_reset PNGARG((png_structp png_ptr)); -+#endif -+#if defined(PNG_WRITE_APNG_SUPPORTED) -+/* private, reset some things to become ready for writing next frame */ -+PNG_EXTERN void png_write_reset PNGARG((png_structp png_ptr)); -+PNG_EXTERN void png_write_reinit PNGARG((png_structp png_ptr, -+ png_infop info_ptr, png_uint_32 width, png_uint_32 height)); -+#endif -+ - /* these are the functions that do the transformations */ - #if defined(PNG_READ_FILLER_SUPPORTED) - PNG_EXTERN void png_do_read_filler PNGARG((png_row_infop row_info, -@@ -3453,6 +3608,18 @@ - png_uint_32 length)); - #endif - -+#if defined(PNG_READ_APNG_SUPPORTED) -+PNG_EXTERN void png_handle_acTL PNGARG((png_structp png_ptr, png_infop info_ptr, -+ png_uint_32 length)); -+PNG_EXTERN void png_handle_fcTL PNGARG((png_structp png_ptr, png_infop info_ptr, -+ png_uint_32 length)); -+PNG_EXTERN void png_have_info PNGARG((png_structp png_ptr, png_infop info_ptr)); -+PNG_EXTERN void png_handle_fdAT PNGARG((png_structp png_ptr, png_infop info_ptr, -+ png_uint_32 length)); -+PNG_EXTERN void png_ensure_sequence_number PNGARG((png_structp png_ptr, -+ png_uint_32 length)); -+#endif -+ - PNG_EXTERN void png_handle_unknown PNGARG((png_structp png_ptr, - png_infop info_ptr, png_uint_32 length)); - -diff -ruN libpng-1.2.27/pngconf.h libpng-1.2.27.apng/pngconf.h ---- libpng-1.2.27/pngconf.h 2008-04-30 10:23:11.000000000 +0000 -+++ libpng-1.2.27.apng/pngconf.h 2008-05-01 09:49:58.000000000 +0000 -@@ -925,6 +925,10 @@ - # define PNG_READ_zTXt_SUPPORTED - # define PNG_zTXt_SUPPORTED - #endif -+#ifndef PNG_NO_READ_APNG -+# define PNG_READ_APNG_SUPPORTED -+# define PNG_APNG_SUPPORTED -+#endif - #ifndef PNG_NO_READ_UNKNOWN_CHUNKS - # define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED - # ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED -@@ -1067,6 +1071,12 @@ - # define PNG_zTXt_SUPPORTED - # endif - #endif -+#ifndef PNG_NO_WRITE_APNG -+# define PNG_WRITE_APNG_SUPPORTED -+# ifndef PNG_APNG_SUPPORTED -+# define PNG_APNG_SUPPORTED -+# endif -+#endif - #ifndef PNG_NO_WRITE_UNKNOWN_CHUNKS - # define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED - # ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED -diff -ruN libpng-1.2.27/pngget.c libpng-1.2.27.apng/pngget.c ---- libpng-1.2.27/pngget.c 2008-04-30 10:23:12.000000000 +0000 -+++ libpng-1.2.27.apng/pngget.c 2008-05-01 09:49:58.000000000 +0000 -@@ -797,6 +797,167 @@ - } - #endif - -+#if defined(PNG_APNG_SUPPORTED) -+png_uint_32 PNGAPI -+png_get_acTL(png_structp png_ptr, png_infop info_ptr, -+ png_uint_32 *num_frames, png_uint_32 *num_plays) -+{ -+ png_debug1(1, "in %s retrieval function\n", "acTL"); -+ -+ if (png_ptr != NULL && info_ptr != NULL && -+ (info_ptr->valid & PNG_INFO_acTL) && -+ num_frames != NULL && num_plays != NULL) -+ { -+ *num_frames = info_ptr->num_frames; -+ *num_plays = info_ptr->num_plays; -+ return (1); -+ } -+ -+ return (0); -+} -+ -+png_uint_32 PNGAPI -+png_get_num_frames(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_debug(1, "in png_get_num_frames()\n"); -+ -+ if (png_ptr != NULL && info_ptr != NULL) -+ return (info_ptr->num_frames); -+ return (0); -+} -+ -+png_uint_32 PNGAPI -+png_get_num_plays(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_debug(1, "in png_get_num_plays()\n"); -+ -+ if (png_ptr != NULL && info_ptr != NULL) -+ return (info_ptr->num_plays); -+ return (0); -+} -+ -+png_uint_32 PNGAPI -+png_get_next_frame_fcTL(png_structp png_ptr, png_infop info_ptr, -+ png_uint_32 *width, png_uint_32 *height, -+ png_uint_32 *x_offset, png_uint_32 *y_offset, -+ png_uint_16 *delay_num, png_uint_16 *delay_den, -+ png_byte *dispose_op, png_byte *blend_op) -+{ -+ png_debug1(1, "in %s retrieval function\n", "fcTL"); -+ -+ if (png_ptr != NULL && info_ptr != NULL && -+ (info_ptr->valid & PNG_INFO_fcTL) && -+ width != NULL && height != NULL && -+ x_offset != NULL && x_offset != NULL && -+ delay_num != NULL && delay_den != NULL && -+ dispose_op != NULL && blend_op != NULL) -+ { -+ *width = info_ptr->next_frame_width; -+ *height = info_ptr->next_frame_height; -+ *x_offset = info_ptr->next_frame_x_offset; -+ *y_offset = info_ptr->next_frame_y_offset; -+ *delay_num = info_ptr->next_frame_delay_num; -+ *delay_den = info_ptr->next_frame_delay_den; -+ *dispose_op = info_ptr->next_frame_dispose_op; -+ *blend_op = info_ptr->next_frame_blend_op; -+ return (1); -+ } -+ -+ return (0); -+} -+ -+png_uint_32 PNGAPI -+png_get_next_frame_width(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_debug(1, "in png_get_next_frame_width()\n"); -+ -+ if (png_ptr != NULL && info_ptr != NULL) -+ return (info_ptr->next_frame_width); -+ return (0); -+} -+ -+png_uint_32 PNGAPI -+png_get_next_frame_height(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_debug(1, "in png_get_next_frame_height()\n"); -+ -+ if (png_ptr != NULL && info_ptr != NULL) -+ return (info_ptr->next_frame_height); -+ return (0); -+} -+ -+png_uint_32 PNGAPI -+png_get_next_frame_x_offset(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_debug(1, "in png_get_next_frame_x_offset()\n"); -+ -+ if (png_ptr != NULL && info_ptr != NULL) -+ return (info_ptr->next_frame_x_offset); -+ return (0); -+} -+ -+png_uint_32 PNGAPI -+png_get_next_frame_y_offset(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_debug(1, "in png_get_next_frame_y_offset()\n"); -+ -+ if (png_ptr != NULL && info_ptr != NULL) -+ return (info_ptr->next_frame_y_offset); -+ return (0); -+} -+ -+png_uint_16 PNGAPI -+png_get_next_frame_delay_num(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_debug(1, "in png_get_next_frame_delay_num()\n"); -+ -+ if (png_ptr != NULL && info_ptr != NULL) -+ return (info_ptr->next_frame_delay_num); -+ return (0); -+} -+ -+png_uint_16 PNGAPI -+png_get_next_frame_delay_den(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_debug(1, "in png_get_next_frame_delay_den()\n"); -+ -+ if (png_ptr != NULL && info_ptr != NULL) -+ return (info_ptr->next_frame_delay_den); -+ return (0); -+} -+ -+png_byte PNGAPI -+png_get_next_frame_dispose_op(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_debug(1, "in png_get_next_frame_dispose_op()\n"); -+ -+ if (png_ptr != NULL && info_ptr != NULL) -+ return (info_ptr->next_frame_dispose_op); -+ return (0); -+} -+ -+png_byte PNGAPI -+png_get_next_frame_blend_op(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_debug(1, "in png_get_next_frame_blend_op()\n"); -+ -+ if (png_ptr != NULL && info_ptr != NULL) -+ return (info_ptr->next_frame_blend_op); -+ return (0); -+} -+ -+png_byte PNGAPI -+png_get_first_frame_is_hidden(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_debug(1, "in png_first_frame_is_hidden()\n"); -+ -+ if (png_ptr != NULL) -+ return (png_byte)(png_ptr->apng_flags & PNG_FIRST_FRAME_HIDDEN); -+ -+ return 0; -+} -+#endif /* PNG_APNG_SUPPORTED */ -+ - #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) - png_uint_32 PNGAPI - png_get_unknown_chunks(png_structp png_ptr, png_infop info_ptr, -diff -ruN libpng-1.2.27/pngpread.c libpng-1.2.27.apng/pngpread.c ---- libpng-1.2.27/pngpread.c 2008-04-30 10:23:12.000000000 +0000 -+++ libpng-1.2.27.apng/pngpread.c 2008-05-01 09:49:58.000000000 +0000 -@@ -192,6 +192,11 @@ - #if defined(PNG_READ_zTXt_SUPPORTED) - PNG_CONST PNG_zTXt; - #endif -+#if defined(PNG_READ_APNG_SUPPORTED) -+ PNG_CONST PNG_acTL; -+ PNG_CONST PNG_fcTL; -+ PNG_CONST PNG_fdAT; -+#endif - #endif /* PNG_USE_LOCAL_ARRAYS */ - /* First we make sure we have enough data for the 4 byte chunk name - * and the 4 byte chunk length before proceeding with decoding the -@@ -215,7 +220,104 @@ - png_crc_read(png_ptr, png_ptr->chunk_name, 4); - png_ptr->mode |= PNG_HAVE_CHUNK_HEADER; - } -- -+ -+#if defined(PNG_READ_APNG_SUPPORTED) -+ if (png_ptr->num_frames_read > 0 && -+ png_ptr->num_frames_read < info_ptr->num_frames) -+ { -+ if (!png_memcmp(png_ptr->chunk_name, png_IDAT, 4)) -+ { -+ /* discard trailing IDATs for the first frame */ -+ if (png_ptr->mode & PNG_HAVE_fcTL || png_ptr->num_frames_read > 1) -+ png_error(png_ptr, "out of place IDAT"); -+ -+ if (png_ptr->push_length + 4 > png_ptr->buffer_size) -+ { -+ png_push_save_buffer(png_ptr); -+ return; -+ } -+ png_push_crc_skip(png_ptr, png_ptr->push_length); -+ png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER; -+ return; -+ } -+ else if (!png_memcmp(png_ptr->chunk_name, png_fdAT, 4)) -+ { -+ if (png_ptr->buffer_size < 4) -+ { -+ png_push_save_buffer(png_ptr); -+ return; -+ } -+ png_ensure_sequence_number(png_ptr, 4); -+ -+ if (!(png_ptr->mode & PNG_HAVE_fcTL)) -+ { -+ /* discard trailing fdATs for frames other than the first */ -+ if (png_ptr->num_frames_read < 2) -+ png_error(png_ptr, "out of place fdAT"); -+ -+ if (png_ptr->push_length + 4 > png_ptr->buffer_size) -+ { -+ png_push_save_buffer(png_ptr); -+ return; -+ } -+ png_push_crc_skip(png_ptr, png_ptr->push_length); -+ png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER; -+ return; -+ } -+ else -+ { -+ /* frame data follows */ -+ png_ptr->idat_size = png_ptr->push_length - 4; -+ png_ptr->mode |= PNG_HAVE_IDAT; -+ png_ptr->process_mode = PNG_READ_IDAT_MODE; -+ -+ return; -+ } -+ } -+ else if(!png_memcmp(png_ptr->chunk_name, png_fcTL, 4)) -+ { -+ if (png_ptr->push_length + 4 > png_ptr->buffer_size) -+ { -+ png_push_save_buffer(png_ptr); -+ return; -+ } -+ -+ png_read_reset(png_ptr); -+ png_ptr->mode &= ~PNG_HAVE_fcTL; -+ -+ png_handle_fcTL(png_ptr, info_ptr, png_ptr->push_length); -+ -+ if (!(png_ptr->mode & PNG_HAVE_fcTL)) -+ png_error(png_ptr, "missing required fcTL chunk"); -+ -+ png_read_reinit(png_ptr, info_ptr); -+ png_progressive_read_reset(png_ptr); -+ -+ if (png_ptr->frame_info_fn != NULL) -+ (*(png_ptr->frame_info_fn))(png_ptr, png_ptr->num_frames_read); -+ -+ png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER; -+ -+ return; -+ } -+ else -+ { -+ if (png_ptr->push_length + 4 > png_ptr->buffer_size) -+ { -+ png_push_save_buffer(png_ptr); -+ return; -+ } -+ png_warning(png_ptr, "Skipped (ignored) a chunk " -+ "between APNG chunks"); -+ png_push_crc_skip(png_ptr, png_ptr->push_length); -+ png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER; -+ return; -+ } -+ -+ return; -+ } -+#endif /* PNG_READ_APNG_SUPPORTED */ -+ - if (!png_memcmp(png_ptr->chunk_name, png_IDAT, 4)) - if(png_ptr->mode & PNG_AFTER_IDAT) - png_ptr->mode |= PNG_HAVE_CHUNK_AFTER_IDAT; -@@ -297,6 +399,9 @@ - png_error(png_ptr, "Too many IDAT's found"); - } - -+#if defined(PNG_READ_APNG_SUPPORTED) -+ png_have_info(png_ptr, info_ptr); -+#endif - png_ptr->idat_size = png_ptr->push_length; - png_ptr->mode |= PNG_HAVE_IDAT; - png_ptr->process_mode = PNG_READ_IDAT_MODE; -@@ -492,6 +597,35 @@ - png_push_handle_iTXt(png_ptr, info_ptr, png_ptr->push_length); - } - #endif -+#if defined(PNG_READ_APNG_SUPPORTED) -+ else if (!png_memcmp(png_ptr->chunk_name, png_acTL, 4)) -+ { -+ if (png_ptr->push_length + 4 > png_ptr->buffer_size) -+ { -+ png_push_save_buffer(png_ptr); -+ return; -+ } -+ png_handle_acTL(png_ptr, info_ptr, png_ptr->push_length); -+ } -+ else if (!png_memcmp(png_ptr->chunk_name, png_fcTL, 4)) -+ { -+ if (png_ptr->push_length + 4 > png_ptr->buffer_size) -+ { -+ png_push_save_buffer(png_ptr); -+ return; -+ } -+ png_handle_fcTL(png_ptr, info_ptr, png_ptr->push_length); -+ } -+ else if (!png_memcmp(png_ptr->chunk_name, png_fdAT, 4)) -+ { -+ if (png_ptr->push_length + 4 > png_ptr->buffer_size) -+ { -+ png_push_save_buffer(png_ptr); -+ return; -+ } -+ png_handle_fdAT(png_ptr, info_ptr, png_ptr->push_length); -+ } -+#endif /* PNG_READ_APNG_SUPPORTED */ - else - { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) -@@ -662,13 +796,17 @@ - png_push_read_IDAT(png_structp png_ptr) - { - #ifdef PNG_USE_LOCAL_ARRAYS -- PNG_CONST PNG_IDAT; -+ PNG_IDAT; -+#if defined(PNG_READ_APNG_SUPPORTED) -+ PNG_fdAT; -+ PNG_IEND; -+#endif - #endif - if (!(png_ptr->mode & PNG_HAVE_CHUNK_HEADER)) - { - png_byte chunk_length[4]; - -- if (png_ptr->buffer_size < 8) -+ if (png_ptr->buffer_size < 12) - { - png_push_save_buffer(png_ptr); - return; -@@ -680,15 +818,59 @@ - png_crc_read(png_ptr, png_ptr->chunk_name, 4); - png_ptr->mode |= PNG_HAVE_CHUNK_HEADER; - -- if (png_memcmp(png_ptr->chunk_name, png_IDAT, 4)) -+#if defined(PNG_READ_APNG_SUPPORTED) -+ if (png_memcmp(png_ptr->chunk_name, (png_bytep)png_fdAT, 4) -+ && png_ptr->num_frames_read > 0) -+ { -+ if (png_ptr->flags & PNG_FLAG_ZLIB_FINISHED) -+ { -+ png_ptr->process_mode = PNG_READ_CHUNK_MODE; -+ if (png_ptr->frame_end_fn != NULL) -+ (*(png_ptr->frame_end_fn))(png_ptr, png_ptr->num_frames_read); -+ png_ptr->num_frames_read++; -+ return; -+ } -+ else -+ { -+ if (!png_memcmp(png_ptr->chunk_name, png_IEND, 4)) -+ png_error(png_ptr, "Not enough image data"); -+ if (png_ptr->push_length + 4 > png_ptr->buffer_size) -+ { -+ png_push_save_buffer(png_ptr); -+ return; -+ } -+ png_warning(png_ptr, "Skipping (ignoring) a chunk between " -+ "APNG chunks"); -+ png_crc_finish(png_ptr, png_ptr->push_length); -+ png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER; -+ return; -+ } -+ } -+ else -+#endif -+ if ( png_memcmp(png_ptr->chunk_name, png_IDAT, 4) -+ && (png_ptr->num_frames_read == 0) ) - { - png_ptr->process_mode = PNG_READ_CHUNK_MODE; - if (!(png_ptr->flags & PNG_FLAG_ZLIB_FINISHED)) - png_error(png_ptr, "Not enough compressed data"); -+#if defined(PNG_READ_APNG_SUPPORTED) -+ if (png_ptr->frame_end_fn != NULL) -+ (*(png_ptr->frame_end_fn))(png_ptr, png_ptr->num_frames_read); -+ png_ptr->num_frames_read++; -+#endif - return; - } - - png_ptr->idat_size = png_ptr->push_length; -+ -+#if defined(PNG_READ_APNG_SUPPORTED) -+ if(png_ptr->num_frames_read > 0) -+ { -+ png_ensure_sequence_number(png_ptr, 4); -+ png_ptr->idat_size -= 4; -+ } -+#endif - } - if (png_ptr->idat_size && png_ptr->save_buffer_size) - { -@@ -1589,6 +1771,17 @@ - png_set_read_fn(png_ptr, progressive_ptr, png_push_fill_buffer); - } - -+#if defined(PNG_READ_APNG_SUPPORTED) -+void PNGAPI -+png_set_progressive_frame_fn(png_structp png_ptr, -+ png_progressive_frame_ptr frame_info_fn, -+ png_progressive_frame_ptr frame_end_fn) -+{ -+ png_ptr->frame_info_fn = frame_info_fn; -+ png_ptr->frame_end_fn = frame_end_fn; -+} -+#endif -+ - png_voidp PNGAPI - png_get_progressive_ptr(png_structp png_ptr) - { -diff -ruN libpng-1.2.27/pngread.c libpng-1.2.27.apng/pngread.c ---- libpng-1.2.27/pngread.c 2008-04-30 10:23:12.000000000 +0000 -+++ libpng-1.2.27.apng/pngread.c 2008-05-01 09:49:58.000000000 +0000 -@@ -405,6 +405,11 @@ - #if defined(PNG_READ_zTXt_SUPPORTED) - PNG_CONST PNG_zTXt; - #endif -+#if defined(PNG_READ_APNG_SUPPORTED) -+ PNG_CONST PNG_acTL; -+ PNG_CONST PNG_fcTL; -+ PNG_CONST PNG_fdAT; -+#endif - #endif /* PNG_USE_LOCAL_ARRAYS */ - png_byte chunk_length[4]; - png_uint_32 length; -@@ -458,6 +463,9 @@ - !(png_ptr->mode & PNG_HAVE_PLTE)) - png_error(png_ptr, "Missing PLTE before IDAT"); - -+#if defined(PNG_READ_APNG_SUPPORTED) -+ png_have_info(png_ptr, info_ptr); -+#endif - png_ptr->idat_size = length; - png_ptr->mode |= PNG_HAVE_IDAT; - break; -@@ -530,12 +538,97 @@ - else if (!png_memcmp(png_ptr->chunk_name, png_iTXt, 4)) - png_handle_iTXt(png_ptr, info_ptr, length); - #endif -+#if defined(PNG_READ_APNG_SUPPORTED) -+ else if (!png_memcmp(png_ptr->chunk_name, png_acTL, 4)) -+ png_handle_acTL(png_ptr, info_ptr, length); -+ else if (!png_memcmp(png_ptr->chunk_name, png_fcTL, 4)) -+ png_handle_fcTL(png_ptr, info_ptr, length); -+ else if (!png_memcmp(png_ptr->chunk_name, png_fdAT, 4)) -+ png_handle_fdAT(png_ptr, info_ptr, length); -+#endif - else - png_handle_unknown(png_ptr, info_ptr, length); - } - } - #endif /* PNG_NO_SEQUENTIAL_READ_SUPPORTED */ - -+#if defined(PNG_READ_APNG_SUPPORTED) -+void PNGAPI -+png_read_frame_head(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_byte have_chunk_after_DAT; /* after IDAT or after fdAT */ -+ -+ png_debug(0, "Reading frame head\n"); -+ -+ if (!(png_ptr->mode & PNG_HAVE_acTL)) -+ png_error(png_ptr, "attempt to png_read_frame_head() but " -+ "no acTL present"); -+ -+ /* do nothing for the main IDAT */ -+ if (png_ptr->num_frames_read == 0) -+ return; -+ -+ png_crc_finish(png_ptr, 0); /* CRC from last IDAT or fdAT chunk */ -+ -+ png_read_reset(png_ptr); -+ png_ptr->mode &= ~PNG_HAVE_fcTL; -+ -+ have_chunk_after_DAT = 0; -+ for (;;) -+ { -+#ifdef PNG_USE_LOCAL_ARRAYS -+ PNG_IDAT; -+ PNG_fdAT; -+ PNG_fcTL; -+#endif -+ png_byte chunk_length[4]; -+ png_uint_32 length; -+ -+ png_read_data(png_ptr, chunk_length, 4); -+ length = png_get_uint_31(png_ptr, chunk_length); -+ -+ png_reset_crc(png_ptr); -+ png_crc_read(png_ptr, png_ptr->chunk_name, 4); -+ -+ if (!png_memcmp(png_ptr->chunk_name, png_IDAT, 4)) -+ { -+ /* discard trailing IDATs for the first frame */ -+ if (have_chunk_after_DAT || png_ptr->num_frames_read > 1) -+ png_error(png_ptr, "png_read_frame_head(): out of place IDAT"); -+ png_crc_finish(png_ptr, length); -+ } -+ else if (!png_memcmp(png_ptr->chunk_name, png_fcTL, 4)) -+ { -+ png_handle_fcTL(png_ptr, info_ptr, length); -+ have_chunk_after_DAT = 1; -+ } -+ else if (!png_memcmp(png_ptr->chunk_name, png_fdAT, 4)) -+ { -+ png_ensure_sequence_number(png_ptr, length); -+ -+ /* discard trailing fdATs for frames other than the first */ -+ if (!have_chunk_after_DAT && png_ptr->num_frames_read > 1) -+ png_crc_finish(png_ptr, length - 4); -+ else if(png_ptr->mode & PNG_HAVE_fcTL) -+ { -+ png_ptr->idat_size = length - 4; -+ png_ptr->mode |= PNG_HAVE_IDAT; -+ -+ break; -+ } -+ else -+ png_error(png_ptr, "png_read_frame_head(): out of place fdAT"); -+ } -+ else -+ { -+ png_warning(png_ptr, "Skipped (ignored) a chunk " -+ "between APNG chunks"); -+ png_crc_finish(png_ptr, length); -+ } -+ } -+} -+#endif /* PNG_READ_APNG_SUPPORTED */ -+ - /* optional call to update the users info_ptr structure */ - void PNGAPI - png_read_update_info(png_structp png_ptr, png_infop info_ptr) -@@ -572,6 +665,10 @@ - { - #ifdef PNG_USE_LOCAL_ARRAYS - PNG_CONST PNG_IDAT; -+#if defined(PNG_READ_APNG_SUPPORTED) -+ PNG_CONST PNG_fdAT; -+ PNG_CONST PNG_IEND; -+#endif - PNG_CONST int png_pass_dsp_mask[7] = {0xff, 0x0f, 0xff, 0x33, 0xff, 0x55, - 0xff}; - PNG_CONST int png_pass_mask[7] = {0x80, 0x08, 0x88, 0x22, 0xaa, 0x55, 0xff}; -@@ -701,19 +798,46 @@ - { - if (!(png_ptr->zstream.avail_in)) - { -- while (!png_ptr->idat_size) -+ png_uint_32 bytes_to_skip = 0; -+ -+ while (!png_ptr->idat_size || bytes_to_skip != 0) - { - png_byte chunk_length[4]; - -- png_crc_finish(png_ptr, 0); -- -+ png_crc_finish(png_ptr, bytes_to_skip); -+ bytes_to_skip = 0; -+ - png_read_data(png_ptr, chunk_length, 4); - png_ptr->idat_size = png_get_uint_31(png_ptr,chunk_length); -- -+ - png_reset_crc(png_ptr); - png_crc_read(png_ptr, png_ptr->chunk_name, 4); -- if (png_memcmp(png_ptr->chunk_name, png_IDAT, 4)) -- png_error(png_ptr, "Not enough image data"); -+ -+#if defined(PNG_READ_APNG_SUPPORTED) -+ if (png_ptr->num_frames_read == 0) -+ { -+#endif -+ if (png_memcmp(png_ptr->chunk_name, png_IDAT, 4)) -+ png_error(png_ptr, "Not enough image data"); -+#if defined(PNG_READ_APNG_SUPPORTED) -+ } -+ else -+ { -+ if (!png_memcmp(png_ptr->chunk_name, png_IEND, 4)) -+ png_error(png_ptr, "Not enough image data"); -+ if (png_memcmp(png_ptr->chunk_name, png_fdAT, 4)) -+ { -+ png_warning(png_ptr, "Skipped (ignored) a chunk " -+ "between APNG chunks"); -+ bytes_to_skip = png_ptr->idat_size; -+ continue; -+ } -+ -+ png_ensure_sequence_number(png_ptr, png_ptr->idat_size); -+ -+ png_ptr->idat_size -= 4; -+ } -+#endif - } - png_ptr->zstream.avail_in = (uInt)png_ptr->zbuf_size; - png_ptr->zstream.next_in = png_ptr->zbuf; -@@ -731,6 +855,9 @@ - png_error(png_ptr, "Extra compressed data"); - png_ptr->mode |= PNG_AFTER_IDAT; - png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED; -+#if defined(PNG_READ_APNG_SUPPORTED) -+ png_ptr->num_frames_read++; -+#endif - break; - } - if (ret != Z_OK) -@@ -985,6 +1112,11 @@ - #if defined(PNG_READ_zTXt_SUPPORTED) - PNG_CONST PNG_zTXt; - #endif -+#if defined(PNG_READ_APNG_SUPPORTED) -+ PNG_CONST PNG_acTL; -+ PNG_CONST PNG_fcTL; -+ PNG_CONST PNG_fdAT; -+#endif - #endif /* PNG_USE_LOCAL_ARRAYS */ - - png_read_data(png_ptr, chunk_length, 4); -@@ -1091,6 +1223,14 @@ - else if (!png_memcmp(png_ptr->chunk_name, png_iTXt, 4)) - png_handle_iTXt(png_ptr, info_ptr, length); - #endif -+#if defined(PNG_READ_APNG_SUPPORTED) -+ else if (!png_memcmp(png_ptr->chunk_name, png_acTL, 4)) -+ png_handle_acTL(png_ptr, info_ptr, length); -+ else if (!png_memcmp(png_ptr->chunk_name, png_fcTL, 4)) -+ png_handle_fcTL(png_ptr, info_ptr, length); -+ else if (!png_memcmp(png_ptr->chunk_name, png_fdAT, 4)) -+ png_handle_fdAT(png_ptr, info_ptr, length); -+#endif - else - png_handle_unknown(png_ptr, info_ptr, length); - } while (!(png_ptr->mode & PNG_HAVE_IEND)); -diff -ruN libpng-1.2.27/pngrtran.c libpng-1.2.27.apng/pngrtran.c ---- libpng-1.2.27/pngrtran.c 2008-04-30 10:23:13.000000000 +0000 -+++ libpng-1.2.27.apng/pngrtran.c 2008-05-01 09:49:58.000000000 +0000 -@@ -1286,7 +1286,7 @@ - * or png_read_update_info() after setting transforms that expand - * pixels. This check added to libpng-1.2.19 */ - #if (PNG_WARN_UNINITIALIZED_ROW==1) -- png_error(png_ptr, "Uninitialized row"); -+ png_warning(png_ptr, "Uninitialized row"); - #else - png_warning(png_ptr, "Uninitialized row"); - #endif -diff -ruN libpng-1.2.27/pngrutil.c libpng-1.2.27.apng/pngrutil.c ---- libpng-1.2.27/pngrutil.c 2008-04-30 10:23:13.000000000 +0000 -+++ libpng-1.2.27.apng/pngrutil.c 2008-05-01 09:49:58.000000000 +0000 -@@ -374,6 +374,11 @@ - filter_type = buf[11]; - interlace_type = buf[12]; - -+#if defined(PNG_READ_APNG_SUPPORTED) -+ png_ptr->first_frame_width = width; -+ png_ptr->first_frame_height = height; -+#endif -+ - /* set internal variables */ - png_ptr->width = width; - png_ptr->height = height; -@@ -2169,6 +2174,168 @@ - } - #endif - -+#if defined(PNG_READ_APNG_SUPPORTED) -+void /* PRIVATE */ -+png_handle_acTL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -+{ -+ png_byte data[8]; -+ png_uint_32 num_frames; -+ png_uint_32 num_plays; -+ png_uint_32 didSet; -+ -+ png_debug(1, "in png_handle_acTL\n"); -+ -+ if (!(png_ptr->mode & PNG_HAVE_IHDR)) -+ { -+ png_error(png_ptr, "Missing IHDR before acTL"); -+ } -+ else if (png_ptr->mode & PNG_HAVE_IDAT) -+ { -+ png_warning(png_ptr, "Invalid acTL after IDAT skipped"); -+ png_crc_finish(png_ptr, length); -+ return; -+ } -+ else if (png_ptr->mode & PNG_HAVE_acTL) -+ { -+ png_warning(png_ptr, "Duplicate acTL skipped"); -+ png_crc_finish(png_ptr, length); -+ return; -+ } -+ else if (length != 8) -+ { -+ png_warning(png_ptr, "acTL with invalid length skipped"); -+ png_crc_finish(png_ptr, length); -+ return; -+ } -+ -+ png_crc_read(png_ptr, data, 8); -+ png_crc_finish(png_ptr, 0); -+ -+ num_frames = png_get_uint_31(png_ptr, data); -+ num_plays = png_get_uint_31(png_ptr, data + 4); -+ -+ /* the set function will do error checking on num_frames */ -+ didSet = png_set_acTL(png_ptr, info_ptr, num_frames, num_plays); -+ if(didSet) -+ png_ptr->mode |= PNG_HAVE_acTL; -+} -+ -+void /* PRIVATE */ -+png_handle_fcTL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -+{ -+ png_byte data[22]; -+ png_uint_32 width; -+ png_uint_32 height; -+ png_uint_32 x_offset; -+ png_uint_32 y_offset; -+ png_uint_16 delay_num; -+ png_uint_16 delay_den; -+ png_byte dispose_op; -+ png_byte blend_op; -+ -+ png_debug(1, "in png_handle_fcTL\n"); -+ -+ if (!(png_ptr->mode & PNG_HAVE_IHDR)) -+ { -+ png_error(png_ptr, "Missing IHDR before fcTL"); -+ } -+ else if (png_ptr->mode & PNG_HAVE_IDAT) -+ { -+ /* for any frames other then the first this message may be misleading, -+ * but correct. PNG_HAVE_IDAT is unset before the frame head is read -+ * i can't think of a better message */ -+ png_warning(png_ptr, "Invalid fcTL after IDAT skipped"); -+ png_crc_finish(png_ptr, length); -+ return; -+ } -+ else if (png_ptr->mode & PNG_HAVE_fcTL) -+ { -+ png_warning(png_ptr, "Duplicate fcTL within one frame skipped"); -+ png_crc_finish(png_ptr, length); -+ return; -+ } -+ else if (length != 26) -+ { -+ png_warning(png_ptr, "fcTL with invalid length skipped"); -+ png_crc_finish(png_ptr, length); -+ return; -+ } -+ -+ png_ensure_sequence_number(png_ptr, length); -+ -+ png_crc_read(png_ptr, data, 22); -+ png_crc_finish(png_ptr, 0); -+ -+ width = png_get_uint_31(png_ptr, data); -+ height = png_get_uint_31(png_ptr, data + 4); -+ x_offset = png_get_uint_31(png_ptr, data + 8); -+ y_offset = png_get_uint_31(png_ptr, data + 12); -+ delay_num = png_get_uint_16(data + 16); -+ delay_den = png_get_uint_16(data + 18); -+ dispose_op = data[20]; -+ blend_op = data[21]; -+ -+ if (png_ptr->num_frames_read == 0 && (x_offset != 0 || y_offset != 0)) -+ png_error(png_ptr, "fcTL for the first frame must have zero offset"); -+ if (png_ptr->num_frames_read == 0 && -+ (width != info_ptr->width || height != info_ptr->height)) -+ png_error(png_ptr, "size in first frame's fcTL must match " -+ "the size in IHDR"); -+ -+ /* the set function will do more error checking */ -+ png_set_next_frame_fcTL(png_ptr, info_ptr, width, height, -+ x_offset, y_offset, delay_num, delay_den, -+ dispose_op, blend_op); -+ -+ png_read_reinit(png_ptr, info_ptr); -+ -+ png_ptr->mode |= PNG_HAVE_fcTL; -+} -+ -+void /* PRIVATE */ -+png_have_info(png_structp png_ptr, png_infop info_ptr) -+{ -+ if((info_ptr->valid & PNG_INFO_acTL) && !(info_ptr->valid & PNG_INFO_fcTL)) -+ { -+ png_ptr->apng_flags |= PNG_FIRST_FRAME_HIDDEN; -+ info_ptr->num_frames++; -+ } -+} -+ -+void /* PRIVATE */ -+png_handle_fdAT(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -+{ -+ png_ensure_sequence_number(png_ptr, length); -+ -+ /* This function is only called from png_read_end(), png_read_info(), -+ * and png_push_read_chunk() which means that: -+ * - the user doesn't want to read this frame -+ * - or this is an out-of-place fdAT -+ * in either case it is safe to ignore the chunk with a warning */ -+ png_warning(png_ptr, "ignoring fdAT chunk"); -+ png_crc_finish(png_ptr, length - 4); -+} -+ -+void /* PRIVATE */ -+png_ensure_sequence_number(png_structp png_ptr, png_uint_32 length) -+{ -+ png_byte data[4]; -+ png_uint_32 sequence_number; -+ -+ if (length < 4) -+ png_error(png_ptr, "invalid fcTL or fdAT chunk found"); -+ -+ png_crc_read(png_ptr, data, 4); -+ sequence_number = png_get_uint_31(png_ptr, data); -+ -+ if (sequence_number != png_ptr->next_seq_num) -+ png_error(png_ptr, "fcTL or fdAT chunk with out-of-order sequence " -+ "number found"); -+ -+ png_ptr->next_seq_num++; -+} -+#endif /* PNG_READ_APNG_SUPPORTED */ -+ - /* This function is called when we haven't found a handler for a - chunk. If there isn't a problem with the chunk itself (ie bad - chunk name, CRC, or a critical chunk), the chunk is silently ignored -@@ -3180,4 +3347,82 @@ - - png_ptr->flags |= PNG_FLAG_ROW_INIT; - } -+ -+#if defined(PNG_READ_APNG_SUPPORTED) -+/* This function is to be called after the main IDAT set has been read and -+ * before a new IDAT is read. It resets some parts of png_ptr -+ * to make them usable by the read functions again */ -+void /* PRIVATE */ -+png_read_reset(png_structp png_ptr) -+{ -+ png_ptr->mode &= ~PNG_HAVE_IDAT; -+ png_ptr->mode &= ~PNG_AFTER_IDAT; -+ png_ptr->row_number = 0; -+ png_ptr->pass = 0; -+ png_ptr->flags &= ~PNG_FLAG_ROW_INIT; -+} -+ -+void /* PRIVATE */ -+png_read_reinit(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_ptr->width = info_ptr->next_frame_width; -+ png_ptr->height = info_ptr->next_frame_height; -+ png_ptr->rowbytes = PNG_ROWBYTES(png_ptr->pixel_depth,png_ptr->width); -+} -+ -+/* same as png_read_reset() but for the progressive reader */ -+void /* PRIVATE */ -+png_progressive_read_reset(png_structp png_ptr) -+{ -+#ifdef PNG_USE_LOCAL_ARRAYS -+ /* start of interlace block */ -+ const int FARDATA png_pass_start[] = {0, 4, 0, 2, 0, 1, 0}; -+ -+ /* offset to next interlace block */ -+ const int FARDATA png_pass_inc[] = {8, 8, 4, 4, 2, 2, 1}; -+ -+ /* start of interlace block in the y direction */ -+ const int FARDATA png_pass_ystart[] = {0, 0, 4, 0, 2, 0, 1}; -+ -+ /* offset to next interlace block in the y direction */ -+ const int FARDATA png_pass_yinc[] = {8, 8, 8, 4, 4, 2, 2}; -+#endif -+ png_uint_32 row_bytes; -+ -+ if (png_ptr->interlaced) -+ { -+ if (!(png_ptr->transformations & PNG_INTERLACE)) -+ png_ptr->num_rows = (png_ptr->height + png_pass_yinc[0] - 1 - -+ png_pass_ystart[0]) / png_pass_yinc[0]; -+ else -+ png_ptr->num_rows = png_ptr->height; -+ -+ png_ptr->iwidth = (png_ptr->width + -+ png_pass_inc[png_ptr->pass] - 1 - -+ png_pass_start[png_ptr->pass]) / -+ png_pass_inc[png_ptr->pass]; -+ -+ row_bytes = PNG_ROWBYTES(png_ptr->pixel_depth,png_ptr->iwidth) + 1; -+ -+ png_ptr->irowbytes = (png_size_t)row_bytes; -+ if((png_uint_32)png_ptr->irowbytes != row_bytes) -+ png_error(png_ptr, "png_progressive_read_reset(): Rowbytes " -+ "overflow"); -+ } -+ else -+ { -+ png_ptr->num_rows = png_ptr->height; -+ png_ptr->iwidth = png_ptr->width; -+ png_ptr->irowbytes = png_ptr->rowbytes + 1; -+ } -+ -+ png_ptr->flags &= ~PNG_FLAG_ZLIB_FINISHED; -+ if (inflateReset(&(png_ptr->zstream)) != Z_OK) -+ png_error(png_ptr, "inflateReset failed"); -+ png_ptr->zstream.avail_in = 0; -+ png_ptr->zstream.next_in = 0; -+ png_ptr->zstream.next_out = png_ptr->row_buf; -+ png_ptr->zstream.avail_out = (uInt)png_ptr->irowbytes; -+} -+#endif /* PNG_READ_APNG_SUPPORTED */ - #endif /* PNG_READ_SUPPORTED */ -diff -ruN libpng-1.2.27/pngset.c libpng-1.2.27.apng/pngset.c ---- libpng-1.2.27/pngset.c 2008-04-30 10:23:13.000000000 +0000 -+++ libpng-1.2.27.apng/pngset.c 2008-05-01 09:49:58.000000000 +0000 -@@ -364,6 +364,11 @@ - info_ptr->rowbytes = (png_size_t)0; - else - info_ptr->rowbytes = PNG_ROWBYTES(info_ptr->pixel_depth,width); -+ -+#if defined(PNG_APNG_SUPPORTED) -+ /* for non-animated png. this may be overritten from an acTL chunk later */ -+ info_ptr->num_frames = 1; -+#endif - } - - #if defined(PNG_oFFs_SUPPORTED) -@@ -1025,6 +1030,141 @@ - } - #endif /* PNG_sPLT_SUPPORTED */ - -+#if defined(PNG_APNG_SUPPORTED) -+png_uint_32 PNGAPI -+png_set_acTL(png_structp png_ptr, png_infop info_ptr, -+ png_uint_32 num_frames, png_uint_32 num_plays) -+{ -+ png_debug1(1, "in %s storage function\n", "acTL"); -+ -+ if (png_ptr == NULL || info_ptr == NULL) -+ { -+ png_warning(png_ptr, -+ "Call to png_set_acTL() with NULL png_ptr " -+ "or info_ptr ignored"); -+ return (0); -+ } -+ if (num_frames == 0) -+ { -+ png_warning(png_ptr, -+ "Ignoring attempt to set acTL with num_frames zero"); -+ return (0); -+ } -+ if (num_frames > PNG_UINT_31_MAX) -+ { -+ png_warning(png_ptr, -+ "Ignoring attempt to set acTL with num_frames > 2^31-1"); -+ return (0); -+ } -+ if (num_plays > PNG_UINT_31_MAX) -+ { -+ png_warning(png_ptr, -+ "Ignoring attempt to set acTL with num_plays " -+ "> 2^31-1"); -+ return (0); -+ } -+ -+ info_ptr->num_frames = num_frames; -+ info_ptr->num_plays = num_plays; -+ -+ info_ptr->valid |= PNG_INFO_acTL; -+ -+ return (1); -+} -+ -+/* delay_num and delay_den can hold any 16-bit values including zero */ -+png_uint_32 PNGAPI -+png_set_next_frame_fcTL(png_structp png_ptr, png_infop info_ptr, -+ png_uint_32 width, png_uint_32 height, -+ png_uint_32 x_offset, png_uint_32 y_offset, -+ png_uint_16 delay_num, png_uint_16 delay_den, -+ png_byte dispose_op, png_byte blend_op) -+{ -+ png_debug1(1, "in %s storage function\n", "fcTL"); -+ -+ if (png_ptr == NULL || info_ptr == NULL) -+ { -+ png_warning(png_ptr, -+ "Call to png_set_fcTL() with NULL png_ptr or info_ptr " -+ "ignored"); -+ return (0); -+ } -+ -+ png_ensure_fcTL_is_valid(png_ptr, width, height, x_offset, y_offset, -+ delay_num, delay_den, dispose_op, blend_op); -+ -+ info_ptr->next_frame_width = width; -+ info_ptr->next_frame_height = height; -+ info_ptr->next_frame_x_offset = x_offset; -+ info_ptr->next_frame_y_offset = y_offset; -+ info_ptr->next_frame_delay_num = delay_num; -+ info_ptr->next_frame_delay_den = delay_den; -+ info_ptr->next_frame_dispose_op = dispose_op; -+ info_ptr->next_frame_blend_op = blend_op; -+ -+ info_ptr->valid |= PNG_INFO_fcTL; -+ -+ return (1); -+} -+ -+void /* PRIVATE */ -+png_ensure_fcTL_is_valid(png_structp png_ptr, -+ png_uint_32 width, png_uint_32 height, -+ png_uint_32 x_offset, png_uint_32 y_offset, -+ png_uint_16 delay_num, png_uint_16 delay_den, -+ png_byte dispose_op, png_byte blend_op) -+{ -+ if (width + x_offset > png_ptr->first_frame_width || -+ height + y_offset > png_ptr->first_frame_height) -+ png_error(png_ptr, "dimensions of a frame are greater than" -+ "the ones in IHDR"); -+ if (width > PNG_UINT_31_MAX) -+ png_error(png_ptr, "invalid width in fcTL (> 2^31-1)"); -+ if (height > PNG_UINT_31_MAX) -+ png_error(png_ptr, "invalid height in fcTL (> 2^31-1)"); -+ if (x_offset > PNG_UINT_31_MAX) -+ png_error(png_ptr, "invalid x_offset in fcTL (> 2^31-1)"); -+ if (y_offset > PNG_UINT_31_MAX) -+ png_error(png_ptr, "invalid y_offset in fcTL (> 2^31-1)"); -+ -+ if (dispose_op != PNG_DISPOSE_OP_NONE && -+ dispose_op != PNG_DISPOSE_OP_BACKGROUND && -+ dispose_op != PNG_DISPOSE_OP_PREVIOUS) -+ png_error(png_ptr, "invalid dispose_op in fcTL"); -+ -+ if (blend_op != PNG_BLEND_OP_SOURCE && -+ blend_op != PNG_BLEND_OP_OVER) -+ png_error(png_ptr, "invalid blend_op in fcTL"); -+ -+ if (blend_op == PNG_BLEND_OP_OVER) { -+ if (png_ptr->color_type == PNG_COLOR_TYPE_GRAY) -+ png_error(png_ptr, "PNG_BLEND_OP_OVER is not valid for " -+ "color type 'greyscale without alpha'"); -+ else if ((png_ptr->color_type & PNG_COLOR_MASK_COLOR) && -+ !(png_ptr->color_type & PNG_COLOR_MASK_ALPHA)) -+ png_error(png_ptr, "PNG_BLEND_OP_OVER is not valid for " -+ "color type 'truecolor without alpha'"); -+ } -+} -+ -+png_uint_32 PNGAPI -+png_set_first_frame_is_hidden(png_structp png_ptr, png_infop info_ptr, -+ png_byte is_hidden) -+{ -+ png_debug(1, "in png_first_frame_is_hidden()\n"); -+ -+ if (png_ptr == NULL) -+ return 0; -+ -+ if(is_hidden) -+ png_ptr->apng_flags |= PNG_FIRST_FRAME_HIDDEN; -+ else -+ png_ptr->apng_flags &= ~PNG_FIRST_FRAME_HIDDEN; -+ -+ return 1; -+} -+#endif /* PNG_APNG_SUPPORTED */ -+ - #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) - void PNGAPI - png_set_unknown_chunks(png_structp png_ptr, -diff -ruN libpng-1.2.27/pngtrans.c libpng-1.2.27.apng/pngtrans.c ---- libpng-1.2.27/pngtrans.c 2008-04-30 10:23:14.000000000 +0000 -+++ libpng-1.2.27.apng/pngtrans.c 2008-05-01 09:49:58.000000000 +0000 -@@ -652,11 +652,10 @@ - png_voidp PNGAPI - png_get_user_transform_ptr(png_structp png_ptr) - { --#if defined(PNG_USER_TRANSFORM_PTR_SUPPORTED) - if (png_ptr == NULL) return (NULL); -+#if defined(PNG_USER_TRANSFORM_PTR_SUPPORTED) - return ((png_voidp)png_ptr->user_transform_ptr); --#else -- return (NULL); - #endif -+ return (NULL); - } - #endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */ -diff -ruN libpng-1.2.27/pngwrite.c libpng-1.2.27.apng/pngwrite.c ---- libpng-1.2.27/pngwrite.c 2008-04-30 10:23:14.000000000 +0000 -+++ libpng-1.2.27.apng/pngwrite.c 2008-05-01 09:49:58.000000000 +0000 -@@ -263,6 +263,10 @@ - } - } - #endif -+#if defined(PNG_WRITE_APNG_SUPPORTED) -+ if (info_ptr->valid & PNG_INFO_acTL) -+ png_write_acTL(png_ptr, info_ptr->num_frames, info_ptr->num_plays); -+#endif - #if defined(PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED) - if (info_ptr->unknown_chunks_num) - { -@@ -301,6 +305,10 @@ - return; - if (!(png_ptr->mode & PNG_HAVE_IDAT)) - png_error(png_ptr, "No IDATs written into file"); -+#if defined(PNG_WRITE_APNG_SUPPORTED) -+ if (png_ptr->num_frames_written != png_ptr->num_frames_to_write) -+ png_error(png_ptr, "Not enough frames written"); -+#endif - - /* see if user wants us to write information chunks */ - if (info_ptr != NULL) -@@ -1529,4 +1537,39 @@ - params = params; - } - #endif -+ -+#if defined(PNG_WRITE_APNG_SUPPORTED) -+void PNGAPI -+png_write_frame_head(png_structp png_ptr, png_infop info_ptr, -+ png_bytepp row_pointers, png_uint_32 width, png_uint_32 height, -+ png_uint_32 x_offset, png_uint_32 y_offset, -+ png_uint_16 delay_num, png_uint_16 delay_den, png_byte dispose_op, -+ png_byte blend_op) -+{ -+ png_debug(1, "in png_write_frame_head\n"); -+ -+ /* there is a chance this has been set after png_write_info was called, -+ * so it would be set but not written. is there a way to be sure? */ -+ if (!(info_ptr->valid & PNG_INFO_acTL)) -+ png_error(png_ptr, "png_write_frame_head(): acTL not set"); -+ -+ png_write_reset(png_ptr); -+ -+ png_write_reinit(png_ptr, info_ptr, width, height); -+ -+ if ( !(png_ptr->num_frames_written == 0 && -+ (png_ptr->apng_flags & PNG_FIRST_FRAME_HIDDEN) ) ) -+ png_write_fcTL(png_ptr, width, height, x_offset, y_offset, -+ delay_num, delay_den, dispose_op, blend_op); -+} -+ -+void PNGAPI -+png_write_frame_tail(png_structp png_ptr, png_infop png_info) -+{ -+ png_debug(1, "in png_write_frame_tail\n"); -+ -+ png_ptr->num_frames_written++; -+} -+#endif /* PNG_WRITE_APNG_SUPPORTED */ -+ - #endif /* PNG_WRITE_SUPPORTED */ -diff -ruN libpng-1.2.27/pngwutil.c libpng-1.2.27.apng/pngwutil.c ---- libpng-1.2.27/pngwutil.c 2008-04-30 10:23:14.000000000 +0000 -+++ libpng-1.2.27.apng/pngwutil.c 2008-05-01 09:49:58.000000000 +0000 -@@ -498,6 +498,11 @@ - /* write the chunk */ - png_write_chunk(png_ptr, png_IHDR, buf, (png_size_t)13); - -+#if defined(PNG_WRITE_APNG_SUPPORTED) -+ png_ptr->first_frame_width = width; -+ png_ptr->first_frame_height = height; -+#endif -+ - /* initialize zlib with PNG info */ - png_ptr->zstream.zalloc = png_zalloc; - png_ptr->zstream.zfree = png_zfree; -@@ -619,6 +624,9 @@ - { - #ifdef PNG_USE_LOCAL_ARRAYS - PNG_IDAT; -+#if defined(PNG_WRITE_APNG_SUPPORTED) -+ PNG_fdAT; -+#endif - #endif - png_debug(1, "in png_write_IDAT\n"); - -@@ -661,7 +669,28 @@ - "Invalid zlib compression method or flags in IDAT"); - } - -- png_write_chunk(png_ptr, png_IDAT, data, length); -+#if defined(PNG_WRITE_APNG_SUPPORTED) -+ if(png_ptr->num_frames_written == 0) -+#endif -+ png_write_chunk(png_ptr, (png_bytep)png_IDAT, data, length); -+#if defined(PNG_WRITE_APNG_SUPPORTED) -+ else -+ { -+ png_byte buf[4]; -+ -+ png_write_chunk_start(png_ptr, (png_bytep)png_fdAT, 4 + length); -+ -+ png_save_uint_32(buf, png_ptr->next_seq_num); -+ png_write_chunk_data(png_ptr, buf, 4); -+ -+ png_write_chunk_data(png_ptr, data, length); -+ -+ png_write_chunk_end(png_ptr); -+ -+ png_ptr->next_seq_num++; -+ } -+#endif -+ - png_ptr->mode |= PNG_HAVE_IDAT; - } - -@@ -673,7 +702,7 @@ - PNG_IEND; - #endif - png_debug(1, "in png_write_IEND\n"); -- png_write_chunk(png_ptr, png_IEND, png_bytep_NULL, -+ png_write_chunk(png_ptr, (png_bytep)png_IEND, png_bytep_NULL, - (png_size_t)0); - png_ptr->mode |= PNG_HAVE_IEND; - } -@@ -1732,6 +1761,70 @@ - } - #endif - -+#if defined(PNG_WRITE_APNG_SUPPORTED) -+void /* PRIVATE */ -+png_write_acTL(png_structp png_ptr, -+ png_uint_32 num_frames, png_uint_32 num_plays) -+{ -+#ifdef PNG_USE_LOCAL_ARRAYS -+ PNG_acTL; -+#endif -+ png_byte data[16]; -+ -+ png_debug(1, "in png_write_acTL\n"); -+ -+ png_ptr->num_frames_to_write = num_frames; -+ -+ if (png_ptr->apng_flags & PNG_FIRST_FRAME_HIDDEN) -+ num_frames--; -+ -+ png_save_uint_32(data, num_frames); -+ png_save_uint_32(data + 4, num_plays); -+ -+ png_write_chunk(png_ptr, (png_bytep)png_acTL, data, (png_size_t)8); -+} -+ -+void /* PRIVATE */ -+png_write_fcTL(png_structp png_ptr, png_uint_32 width, png_uint_32 height, -+ png_uint_32 x_offset, png_uint_32 y_offset, -+ png_uint_16 delay_num, png_uint_16 delay_den, png_byte dispose_op, -+ png_byte blend_op) -+{ -+#ifdef PNG_USE_LOCAL_ARRAYS -+ PNG_fcTL; -+#endif -+ png_byte data[26]; -+ -+ png_debug(1, "in png_write_fcTL\n"); -+ -+ if (png_ptr->num_frames_written == 0 && (x_offset != 0 || y_offset != 0)) -+ png_error(png_ptr, "x and/or y offset for the first frame aren't 0\n"); -+ if (png_ptr->num_frames_written == 0 && -+ (width != png_ptr->first_frame_width || -+ height != png_ptr->first_frame_height)) -+ png_error(png_ptr, "width and/or height in the first frame's fcTL " -+ "don't match the ones in IHDR\n"); -+ -+ /* more error checking */ -+ png_ensure_fcTL_is_valid(png_ptr, width, height, x_offset, y_offset, -+ delay_num, delay_den, dispose_op, blend_op); -+ -+ png_save_uint_32(data, png_ptr->next_seq_num); -+ png_save_uint_32(data + 4, width); -+ png_save_uint_32(data + 8, height); -+ png_save_uint_32(data + 12, x_offset); -+ png_save_uint_32(data + 16, y_offset); -+ png_save_uint_16(data + 20, delay_num); -+ png_save_uint_16(data + 22, delay_den); -+ data[24] = dispose_op; -+ data[25] = blend_op; -+ -+ png_write_chunk(png_ptr, (png_bytep)png_fcTL, data, (png_size_t)26); -+ -+ png_ptr->next_seq_num++; -+} -+#endif /* PNG_WRITE_APNG_SUPPORTED */ -+ - /* initializes the row writing capability of libpng */ - void /* PRIVATE */ - png_write_start_row(png_structp png_ptr) -@@ -2799,4 +2892,39 @@ - } - #endif - } -+ -+#if defined(PNG_WRITE_APNG_SUPPORTED) -+void /* PRIVATE */ -+png_write_reset(png_structp png_ptr) -+{ -+ png_ptr->row_number = 0; -+ png_ptr->pass = 0; -+ png_ptr->mode &= ~PNG_HAVE_IDAT; -+} -+ -+void /* PRIVATE */ -+png_write_reinit(png_structp png_ptr, png_infop info_ptr, -+ png_uint_32 width, png_uint_32 height) -+{ -+ if (png_ptr->num_frames_written == 0 && -+ (width != png_ptr->first_frame_width || -+ height != png_ptr->first_frame_height)) -+ png_error(png_ptr, "width and/or height in the first frame's fcTL " -+ "don't match the ones in IHDR\n"); -+ if (width > png_ptr->first_frame_width || -+ height > png_ptr->first_frame_height) -+ png_error(png_ptr, "width and/or height for a frame greater than" -+ "the ones in IHDR"); -+ -+ png_set_IHDR(png_ptr, info_ptr, width, height, -+ info_ptr->bit_depth, info_ptr->color_type, -+ info_ptr->interlace_type, info_ptr->compression_type, -+ info_ptr->filter_type); -+ -+ png_ptr->width = width; -+ png_ptr->height = height; -+ png_ptr->rowbytes = PNG_ROWBYTES(png_ptr->pixel_depth, width); -+ png_ptr->usr_width = png_ptr->width; -+} -+#endif - #endif /* PNG_WRITE_SUPPORTED */ diff --git a/abs/core/libpng/libpng-1.2.31-apng.patch b/abs/core/libpng/libpng-1.2.31-apng.patch deleted file mode 100644 index 92bd20a..0000000 --- a/abs/core/libpng/libpng-1.2.31-apng.patch +++ /dev/null @@ -1,1644 +0,0 @@ -Index: pngread.c -=================================================================== ---- pngread.c (rvision 149) -+++ pngread.c (copie de travail) -@@ -407,6 +407,11 @@ - #if defined(PNG_READ_zTXt_SUPPORTED) - PNG_CONST PNG_zTXt; - #endif -+#if defined(PNG_READ_APNG_SUPPORTED) -+ PNG_CONST PNG_acTL; -+ PNG_CONST PNG_fcTL; -+ PNG_CONST PNG_fdAT; -+#endif - #endif /* PNG_USE_LOCAL_ARRAYS */ - png_uint_32 length = png_read_chunk_header(png_ptr); - PNG_CONST png_bytep chunk_name = png_ptr->chunk_name; -@@ -451,6 +456,9 @@ - !(png_ptr->mode & PNG_HAVE_PLTE)) - png_error(png_ptr, "Missing PLTE before IDAT"); - -+#if defined(PNG_READ_APNG_SUPPORTED) -+ png_have_info(png_ptr, info_ptr); -+#endif - png_ptr->idat_size = length; - png_ptr->mode |= PNG_HAVE_IDAT; - break; -@@ -523,12 +531,97 @@ - else if (!png_memcmp(chunk_name, png_iTXt, 4)) - png_handle_iTXt(png_ptr, info_ptr, length); - #endif -+#if defined(PNG_READ_APNG_SUPPORTED) -+ else if (!png_memcmp(png_ptr->chunk_name, png_acTL, 4)) -+ png_handle_acTL(png_ptr, info_ptr, length); -+ else if (!png_memcmp(png_ptr->chunk_name, png_fcTL, 4)) -+ png_handle_fcTL(png_ptr, info_ptr, length); -+ else if (!png_memcmp(png_ptr->chunk_name, png_fdAT, 4)) -+ png_handle_fdAT(png_ptr, info_ptr, length); -+#endif - else - png_handle_unknown(png_ptr, info_ptr, length); - } - } - #endif /* PNG_NO_SEQUENTIAL_READ_SUPPORTED */ - -+#if defined(PNG_READ_APNG_SUPPORTED) -+void PNGAPI -+png_read_frame_head(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_byte have_chunk_after_DAT; /* after IDAT or after fdAT */ -+ -+ png_debug(0, "Reading frame head\n"); -+ -+ if (!(png_ptr->mode & PNG_HAVE_acTL)) -+ png_error(png_ptr, "attempt to png_read_frame_head() but " -+ "no acTL present"); -+ -+ /* do nothing for the main IDAT */ -+ if (png_ptr->num_frames_read == 0) -+ return; -+ -+ png_crc_finish(png_ptr, 0); /* CRC from last IDAT or fdAT chunk */ -+ -+ png_read_reset(png_ptr); -+ png_ptr->mode &= ~PNG_HAVE_fcTL; -+ -+ have_chunk_after_DAT = 0; -+ for (;;) -+ { -+#ifdef PNG_USE_LOCAL_ARRAYS -+ PNG_IDAT; -+ PNG_fdAT; -+ PNG_fcTL; -+#endif -+ png_byte chunk_length[4]; -+ png_uint_32 length; -+ -+ png_read_data(png_ptr, chunk_length, 4); -+ length = png_get_uint_31(png_ptr, chunk_length); -+ -+ png_reset_crc(png_ptr); -+ png_crc_read(png_ptr, png_ptr->chunk_name, 4); -+ -+ if (!png_memcmp(png_ptr->chunk_name, png_IDAT, 4)) -+ { -+ /* discard trailing IDATs for the first frame */ -+ if (have_chunk_after_DAT || png_ptr->num_frames_read > 1) -+ png_error(png_ptr, "png_read_frame_head(): out of place IDAT"); -+ png_crc_finish(png_ptr, length); -+ } -+ else if (!png_memcmp(png_ptr->chunk_name, png_fcTL, 4)) -+ { -+ png_handle_fcTL(png_ptr, info_ptr, length); -+ have_chunk_after_DAT = 1; -+ } -+ else if (!png_memcmp(png_ptr->chunk_name, png_fdAT, 4)) -+ { -+ png_ensure_sequence_number(png_ptr, length); -+ -+ /* discard trailing fdATs for frames other than the first */ -+ if (!have_chunk_after_DAT && png_ptr->num_frames_read > 1) -+ png_crc_finish(png_ptr, length - 4); -+ else if(png_ptr->mode & PNG_HAVE_fcTL) -+ { -+ png_ptr->idat_size = length - 4; -+ png_ptr->mode |= PNG_HAVE_IDAT; -+ -+ break; -+ } -+ else -+ png_error(png_ptr, "png_read_frame_head(): out of place fdAT"); -+ } -+ else -+ { -+ png_warning(png_ptr, "Skipped (ignored) a chunk " -+ "between APNG chunks"); -+ png_crc_finish(png_ptr, length); -+ } -+ } -+} -+#endif /* PNG_READ_APNG_SUPPORTED */ -+ - /* optional call to update the users info_ptr structure */ - void PNGAPI - png_read_update_info(png_structp png_ptr, png_infop info_ptr) -@@ -565,6 +658,10 @@ - { - #ifdef PNG_USE_LOCAL_ARRAYS - PNG_CONST PNG_IDAT; -+#if defined(PNG_READ_APNG_SUPPORTED) -+ PNG_CONST PNG_fdAT; -+ PNG_CONST PNG_IEND; -+#endif - PNG_CONST int png_pass_dsp_mask[7] = {0xff, 0x0f, 0xff, 0x33, 0xff, 0x55, - 0xff}; - PNG_CONST int png_pass_mask[7] = {0x80, 0x08, 0x88, 0x22, 0xaa, 0x55, 0xff}; -@@ -694,13 +791,40 @@ - { - if (!(png_ptr->zstream.avail_in)) - { -- while (!png_ptr->idat_size) -+ png_uint_32 bytes_to_skip = 0; -+ -+ while (!png_ptr->idat_size || bytes_to_skip != 0) - { -- png_crc_finish(png_ptr, 0); -+ png_crc_finish(png_ptr, bytes_to_skip); -+ bytes_to_skip = 0; - - png_ptr->idat_size = png_read_chunk_header(png_ptr); -+ -+#if defined(PNG_READ_APNG_SUPPORTED) -+ if (png_ptr->num_frames_read == 0) -+ { -+#endif - if (png_memcmp(png_ptr->chunk_name, png_IDAT, 4)) - png_error(png_ptr, "Not enough image data"); -+#if defined(PNG_READ_APNG_SUPPORTED) -+ } -+ else -+ { -+ if (!png_memcmp(png_ptr->chunk_name, png_IEND, 4)) -+ png_error(png_ptr, "Not enough image data"); -+ if (png_memcmp(png_ptr->chunk_name, png_fdAT, 4)) -+ { -+ png_warning(png_ptr, "Skipped (ignored) a chunk " -+ "between APNG chunks"); -+ bytes_to_skip = png_ptr->idat_size; -+ continue; -+ } -+ -+ png_ensure_sequence_number(png_ptr, png_ptr->idat_size); -+ -+ png_ptr->idat_size -= 4; -+ } -+#endif - } - png_ptr->zstream.avail_in = (uInt)png_ptr->zbuf_size; - png_ptr->zstream.next_in = png_ptr->zbuf; -@@ -718,6 +842,9 @@ - png_error(png_ptr, "Extra compressed data"); - png_ptr->mode |= PNG_AFTER_IDAT; - png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED; -+#if defined(PNG_READ_APNG_SUPPORTED) -+ png_ptr->num_frames_read++; -+#endif - break; - } - if (ret != Z_OK) -@@ -969,6 +1096,11 @@ - #if defined(PNG_READ_zTXt_SUPPORTED) - PNG_CONST PNG_zTXt; - #endif -+#if defined(PNG_READ_APNG_SUPPORTED) -+ PNG_CONST PNG_acTL; -+ PNG_CONST PNG_fcTL; -+ PNG_CONST PNG_fdAT; -+#endif - #endif /* PNG_USE_LOCAL_ARRAYS */ - png_uint_32 length = png_read_chunk_header(png_ptr); - PNG_CONST png_bytep chunk_name = png_ptr->chunk_name; -@@ -1069,6 +1201,14 @@ - else if (!png_memcmp(chunk_name, png_iTXt, 4)) - png_handle_iTXt(png_ptr, info_ptr, length); - #endif -+#if defined(PNG_READ_APNG_SUPPORTED) -+ else if (!png_memcmp(png_ptr->chunk_name, png_acTL, 4)) -+ png_handle_acTL(png_ptr, info_ptr, length); -+ else if (!png_memcmp(png_ptr->chunk_name, png_fcTL, 4)) -+ png_handle_fcTL(png_ptr, info_ptr, length); -+ else if (!png_memcmp(png_ptr->chunk_name, png_fdAT, 4)) -+ png_handle_fdAT(png_ptr, info_ptr, length); -+#endif - else - png_handle_unknown(png_ptr, info_ptr, length); - } while (!(png_ptr->mode & PNG_HAVE_IEND)); -Index: pngget.c -=================================================================== ---- pngget.c (rvision 149) -+++ pngget.c (copie de travail) -@@ -797,6 +797,167 @@ - } - #endif - -+#if defined(PNG_APNG_SUPPORTED) -+png_uint_32 PNGAPI -+png_get_acTL(png_structp png_ptr, png_infop info_ptr, -+ png_uint_32 *num_frames, png_uint_32 *num_plays) -+{ -+ png_debug1(1, "in %s retrieval function\n", "acTL"); -+ -+ if (png_ptr != NULL && info_ptr != NULL && -+ (info_ptr->valid & PNG_INFO_acTL) && -+ num_frames != NULL && num_plays != NULL) -+ { -+ *num_frames = info_ptr->num_frames; -+ *num_plays = info_ptr->num_plays; -+ return (1); -+ } -+ -+ return (0); -+} -+ -+png_uint_32 PNGAPI -+png_get_num_frames(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_debug(1, "in png_get_num_frames()\n"); -+ -+ if (png_ptr != NULL && info_ptr != NULL) -+ return (info_ptr->num_frames); -+ return (0); -+} -+ -+png_uint_32 PNGAPI -+png_get_num_plays(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_debug(1, "in png_get_num_plays()\n"); -+ -+ if (png_ptr != NULL && info_ptr != NULL) -+ return (info_ptr->num_plays); -+ return (0); -+} -+ -+png_uint_32 PNGAPI -+png_get_next_frame_fcTL(png_structp png_ptr, png_infop info_ptr, -+ png_uint_32 *width, png_uint_32 *height, -+ png_uint_32 *x_offset, png_uint_32 *y_offset, -+ png_uint_16 *delay_num, png_uint_16 *delay_den, -+ png_byte *dispose_op, png_byte *blend_op) -+{ -+ png_debug1(1, "in %s retrieval function\n", "fcTL"); -+ -+ if (png_ptr != NULL && info_ptr != NULL && -+ (info_ptr->valid & PNG_INFO_fcTL) && -+ width != NULL && height != NULL && -+ x_offset != NULL && x_offset != NULL && -+ delay_num != NULL && delay_den != NULL && -+ dispose_op != NULL && blend_op != NULL) -+ { -+ *width = info_ptr->next_frame_width; -+ *height = info_ptr->next_frame_height; -+ *x_offset = info_ptr->next_frame_x_offset; -+ *y_offset = info_ptr->next_frame_y_offset; -+ *delay_num = info_ptr->next_frame_delay_num; -+ *delay_den = info_ptr->next_frame_delay_den; -+ *dispose_op = info_ptr->next_frame_dispose_op; -+ *blend_op = info_ptr->next_frame_blend_op; -+ return (1); -+ } -+ -+ return (0); -+} -+ -+png_uint_32 PNGAPI -+png_get_next_frame_width(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_debug(1, "in png_get_next_frame_width()\n"); -+ -+ if (png_ptr != NULL && info_ptr != NULL) -+ return (info_ptr->next_frame_width); -+ return (0); -+} -+ -+png_uint_32 PNGAPI -+png_get_next_frame_height(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_debug(1, "in png_get_next_frame_height()\n"); -+ -+ if (png_ptr != NULL && info_ptr != NULL) -+ return (info_ptr->next_frame_height); -+ return (0); -+} -+ -+png_uint_32 PNGAPI -+png_get_next_frame_x_offset(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_debug(1, "in png_get_next_frame_x_offset()\n"); -+ -+ if (png_ptr != NULL && info_ptr != NULL) -+ return (info_ptr->next_frame_x_offset); -+ return (0); -+} -+ -+png_uint_32 PNGAPI -+png_get_next_frame_y_offset(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_debug(1, "in png_get_next_frame_y_offset()\n"); -+ -+ if (png_ptr != NULL && info_ptr != NULL) -+ return (info_ptr->next_frame_y_offset); -+ return (0); -+} -+ -+png_uint_16 PNGAPI -+png_get_next_frame_delay_num(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_debug(1, "in png_get_next_frame_delay_num()\n"); -+ -+ if (png_ptr != NULL && info_ptr != NULL) -+ return (info_ptr->next_frame_delay_num); -+ return (0); -+} -+ -+png_uint_16 PNGAPI -+png_get_next_frame_delay_den(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_debug(1, "in png_get_next_frame_delay_den()\n"); -+ -+ if (png_ptr != NULL && info_ptr != NULL) -+ return (info_ptr->next_frame_delay_den); -+ return (0); -+} -+ -+png_byte PNGAPI -+png_get_next_frame_dispose_op(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_debug(1, "in png_get_next_frame_dispose_op()\n"); -+ -+ if (png_ptr != NULL && info_ptr != NULL) -+ return (info_ptr->next_frame_dispose_op); -+ return (0); -+} -+ -+png_byte PNGAPI -+png_get_next_frame_blend_op(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_debug(1, "in png_get_next_frame_blend_op()\n"); -+ -+ if (png_ptr != NULL && info_ptr != NULL) -+ return (info_ptr->next_frame_blend_op); -+ return (0); -+} -+ -+png_byte PNGAPI -+png_get_first_frame_is_hidden(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_debug(1, "in png_first_frame_is_hidden()\n"); -+ -+ if (png_ptr != NULL) -+ return (png_byte)(png_ptr->apng_flags & PNG_FIRST_FRAME_HIDDEN); -+ -+ return 0; -+} -+#endif /* PNG_APNG_SUPPORTED */ -+ - #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) - png_uint_32 PNGAPI - png_get_unknown_chunks(png_structp png_ptr, png_infop info_ptr, -Index: png.c -=================================================================== ---- png.c (rvision 149) -+++ png.c (copie de travail) -@@ -51,6 +51,9 @@ - PNG_tIME; - PNG_tRNS; - PNG_zTXt; -+PNG_acTL; -+PNG_fcTL; -+PNG_fdAT; - - #ifdef PNG_READ_SUPPORTED - /* arrays to facilitate easy interlacing - use pass (0 - 6) as index */ -Index: png.h -=================================================================== ---- png.h (rvision 149) -+++ png.h (copie de travail) -@@ -949,6 +949,19 @@ - png_fixed_point int_y_blue; - #endif - -+#if defined(PNG_APNG_SUPPORTED) -+ png_uint_32 num_frames; /* including default image */ -+ png_uint_32 num_plays; -+ png_uint_32 next_frame_width; -+ png_uint_32 next_frame_height; -+ png_uint_32 next_frame_x_offset; -+ png_uint_32 next_frame_y_offset; -+ png_uint_16 next_frame_delay_num; -+ png_uint_16 next_frame_delay_den; -+ png_byte next_frame_dispose_op; -+ png_byte next_frame_blend_op; -+#endif -+ - } png_info; - - typedef png_info FAR * png_infop; -@@ -1050,6 +1063,8 @@ - #define PNG_INFO_sPLT 0x2000 /* ESR, 1.0.6 */ - #define PNG_INFO_sCAL 0x4000 /* ESR, 1.0.6 */ - #define PNG_INFO_IDAT 0x8000L /* ESR, 1.0.6 */ -+#define PNG_INFO_acTL 0x10000L -+#define PNG_INFO_fcTL 0x20000L - - /* This is used for the transformation routines, as some of them - * change these values for the row. It also should enable using -@@ -1090,7 +1105,11 @@ - typedef void (PNGAPI *png_progressive_end_ptr) PNGARG((png_structp, png_infop)); - typedef void (PNGAPI *png_progressive_row_ptr) PNGARG((png_structp, png_bytep, - png_uint_32, int)); -+#if defined(PNG_APNG_SUPPORTED) -+typedef void (PNGAPI *png_progressive_frame_ptr) PNGARG((png_structp, -+ png_uint_32)); - #endif -+#endif - - #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) || \ -@@ -1421,6 +1440,39 @@ - png_uint_32 user_height_max; - #endif - -+#if defined(PNG_APNG_SUPPORTED) -+ png_uint_32 apng_flags; -+ png_uint_32 next_seq_num; /* next fcTL/fdAT chunk sequence number */ -+ png_uint_32 first_frame_width; -+ png_uint_32 first_frame_height; -+ -+#if defined(PNG_READ_APNG_SUPPORTED) -+ png_uint_32 num_frames_read; /* incremented after all image data of */ -+ /* a frame is read */ -+#ifdef PNG_PROGRESSIVE_READ_SUPPORTED -+ png_progressive_frame_ptr frame_info_fn; /* frame info read callback */ -+ png_progressive_frame_ptr frame_end_fn; /* frame data read callback */ -+#endif -+#endif -+ -+#if defined(PNG_WRITE_APNG_SUPPORTED) -+ png_uint_32 num_frames_to_write; -+ png_uint_32 num_frames_written; -+#endif -+#endif -+ -+/* For png_struct.apng_flags: */ -+#define PNG_FIRST_FRAME_HIDDEN 0x0001 -+ -+/* dispose_op flags from inside fcTL */ -+#define PNG_DISPOSE_OP_NONE 0x00 -+#define PNG_DISPOSE_OP_BACKGROUND 0x01 -+#define PNG_DISPOSE_OP_PREVIOUS 0x02 -+ -+/* blend_op flags from inside fcTL */ -+#define PNG_BLEND_OP_SOURCE 0x00 -+#define PNG_BLEND_OP_OVER 0x01 -+ - /* New member added in libpng-1.0.25 and 1.2.17 */ - #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) - /* storage for unknown chunk that the library doesn't recognize. */ -@@ -1747,6 +1799,18 @@ - extern PNG_EXPORT(void,png_write_image) PNGARG((png_structp png_ptr, - png_bytepp image)); - -+#if defined(PNG_WRITE_APNG_SUPPORTED) -+extern PNG_EXPORT (void,png_write_frame_head) PNGARG((png_structp png_ptr, -+ png_infop png_info, png_bytepp row_pointers, -+ png_uint_32 width, png_uint_32 height, -+ png_uint_32 x_offset, png_uint_32 y_offset, -+ png_uint_16 delay_num, png_uint_16 delay_den, png_byte dispose_op, -+ png_byte blend_op)); -+ -+extern PNG_EXPORT (void,png_write_frame_tail) PNGARG((png_structp png_ptr, -+ png_infop png_info)); -+#endif -+ - /* writes the end of the PNG file. */ - extern PNG_EXPORT(void,png_write_end) PNGARG((png_structp png_ptr, - png_infop info_ptr)); -@@ -1995,6 +2059,11 @@ - png_voidp progressive_ptr, - png_progressive_info_ptr info_fn, png_progressive_row_ptr row_fn, - png_progressive_end_ptr end_fn)); -+#if defined(PNG_READ_APNG_SUPPORTED) -+extern PNG_EXPORT(void,png_set_progressive_frame_fn) PNGARG((png_structp png_ptr, -+ png_progressive_frame_ptr frame_info_fn, -+ png_progressive_frame_ptr frame_end_fn)); -+#endif - - /* returns the user pointer associated with the push read functions */ - extern PNG_EXPORT(png_voidp,png_get_progressive_ptr) -@@ -2432,6 +2501,59 @@ - #endif - #endif /* PNG_sCAL_SUPPORTED || PNG_WRITE_sCAL_SUPPORTED */ - -+#if defined(PNG_APNG_SUPPORTED) -+extern PNG_EXPORT(png_uint_32,png_get_acTL) PNGARG((png_structp png_ptr, -+ png_infop info_ptr, png_uint_32 *num_frames, png_uint_32 *num_plays)); -+extern PNG_EXPORT(png_uint_32,png_set_acTL) PNGARG((png_structp png_ptr, -+ png_infop info_ptr, png_uint_32 num_frames, png_uint_32 num_plays)); -+extern PNG_EXPORT(png_uint_32,png_get_num_frames) PNGARG((png_structp png_ptr, -+ png_infop info_ptr)); -+extern PNG_EXPORT(png_uint_32,png_get_num_plays) -+ PNGARG((png_structp png_ptr, png_infop info_ptr)); -+ -+extern PNG_EXPORT(png_uint_32,png_get_next_frame_fcTL) -+ PNGARG((png_structp png_ptr, png_infop info_ptr, png_uint_32 *width, -+ png_uint_32 *height, png_uint_32 *x_offset, png_uint_32 *y_offset, -+ png_uint_16 *delay_num, png_uint_16 *delay_den, png_byte *dispose_op, -+ png_byte *blend_op)); -+extern PNG_EXPORT(png_uint_32,png_set_next_frame_fcTL) -+ PNGARG((png_structp png_ptr, png_infop info_ptr, png_uint_32 width, -+ png_uint_32 height, png_uint_32 x_offset, png_uint_32 y_offset, -+ png_uint_16 delay_num, png_uint_16 delay_den, png_byte dispose_op, -+ png_byte blend_op)); -+extern PNG_EXPORT(void,png_ensure_fcTL_is_valid) -+ PNGARG((png_structp png_ptr, -+ png_uint_32 width, png_uint_32 height, -+ png_uint_32 x_offset, png_uint_32 y_offset, -+ png_uint_16 delay_num, png_uint_16 delay_den, -+ png_byte dispose_op, png_byte blend_op)); -+extern PNG_EXPORT(png_uint_32,png_get_next_frame_width) -+ PNGARG((png_structp png_ptr, png_infop info_ptr)); -+extern PNG_EXPORT(png_uint_32,png_get_next_frame_height) -+ PNGARG((png_structp png_ptr, png_infop info_ptr)); -+extern PNG_EXPORT(png_uint_32,png_get_next_frame_x_offset) -+ PNGARG((png_structp png_ptr, png_infop info_ptr)); -+extern PNG_EXPORT(png_uint_32,png_get_next_frame_y_offset) -+ PNGARG((png_structp png_ptr, png_infop info_ptr)); -+extern PNG_EXPORT(png_uint_16,png_get_next_frame_delay_num) -+ PNGARG((png_structp png_ptr, png_infop info_ptr)); -+extern PNG_EXPORT(png_uint_16,png_get_next_frame_delay_den) -+ PNGARG((png_structp png_ptr, png_infop info_ptr)); -+extern PNG_EXPORT(png_byte,png_get_next_frame_dispose_op) -+ PNGARG((png_structp png_ptr, png_infop info_ptr)); -+extern PNG_EXPORT(png_byte,png_get_next_frame_blend_op) -+ PNGARG((png_structp png_ptr, png_infop info_ptr)); -+extern PNG_EXPORT(png_byte,png_get_first_frame_is_hidden) -+ PNGARG((png_structp png_ptr, png_infop info_ptr)); -+extern PNG_EXPORT(png_uint_32,png_set_first_frame_is_hidden) -+ PNGARG((png_structp png_ptr, png_infop info_ptr, png_byte is_hidden)); -+#endif /* PNG_APNG_SUPPORTED */ -+ -+#if defined(PNG_READ_APNG_SUPPORTED) -+extern PNG_EXPORT(void,png_read_frame_head) PNGARG((png_structp png_ptr, -+ png_infop info_ptr)); -+#endif -+ - #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) - /* provide a list of chunks and how they are to be handled, if the built-in - handling or default unknown chunk handling is not desired. Any chunks not -@@ -2738,6 +2860,8 @@ - #define PNG_BACKGROUND_IS_GRAY 0x800 - #define PNG_HAVE_PNG_SIGNATURE 0x1000 - #define PNG_HAVE_CHUNK_AFTER_IDAT 0x2000 /* Have another chunk after IDAT */ -+#define PNG_HAVE_acTL 0x4000 -+#define PNG_HAVE_fcTL 0x8000L - - /* flags for the transformations the PNG library does on the image data */ - #define PNG_BGR 0x0001 -@@ -2878,6 +3002,9 @@ - #define PNG_tIME png_byte png_tIME[5] = {116, 73, 77, 69, '\0'} - #define PNG_tRNS png_byte png_tRNS[5] = {116, 82, 78, 83, '\0'} - #define PNG_zTXt png_byte png_zTXt[5] = {122, 84, 88, 116, '\0'} -+#define PNG_acTL png_byte png_acTL[5] = { 97, 99, 84, 76, '\0'} -+#define PNG_fcTL png_byte png_fcTL[5] = {102, 99, 84, 76, '\0'} -+#define PNG_fdAT png_byte png_fdAT[5] = {102, 100, 65, 84, '\0'} - - #ifdef PNG_USE_GLOBAL_ARRAYS - PNG_EXPORT_VAR (png_byte FARDATA) png_IHDR[5]; -@@ -2901,6 +3028,9 @@ - PNG_EXPORT_VAR (png_byte FARDATA) png_tIME[5]; - PNG_EXPORT_VAR (png_byte FARDATA) png_tRNS[5]; - PNG_EXPORT_VAR (png_byte FARDATA) png_zTXt[5]; -+PNG_EXPORT_VAR (png_byte FARDATA) png_acTL[5]; -+PNG_EXPORT_VAR (png_byte FARDATA) png_fcTL[5]; -+PNG_EXPORT_VAR (png_byte FARDATA) png_fdAT[5]; - #endif /* PNG_USE_GLOBAL_ARRAYS */ - - #if defined(PNG_1_0_X) || defined (PNG_1_2_X) -@@ -3175,6 +3305,17 @@ - #endif - #endif - -+#if defined(PNG_WRITE_APNG_SUPPORTED) -+PNG_EXTERN void png_write_acTL PNGARG((png_structp png_ptr, -+ png_uint_32 num_frames, png_uint_32 num_plays)); -+ -+PNG_EXTERN void png_write_fcTL PNGARG((png_structp png_ptr, -+ png_uint_32 width, png_uint_32 height, -+ png_uint_32 x_offset, png_uint_32 y_offset, -+ png_uint_16 delay_num, png_uint_16 delay_den, -+ png_byte dispose_op, png_byte blend_op)); -+#endif -+ - /* Called when finished processing a row of data */ - PNG_EXTERN void png_write_finish_row PNGARG((png_structp png_ptr)); - -@@ -3226,6 +3367,20 @@ - PNG_EXTERN void png_read_transform_info PNGARG((png_structp png_ptr, - png_infop info_ptr)); - -+#if defined(PNG_READ_APNG_SUPPORTED) -+/* private, reset some things to become ready for reading next frame */ -+PNG_EXTERN void png_read_reset PNGARG((png_structp png_ptr)); -+PNG_EXTERN void png_read_reinit PNGARG((png_structp png_ptr, -+ png_infop info_ptr)); -+PNG_EXTERN void png_progressive_read_reset PNGARG((png_structp png_ptr)); -+#endif -+#if defined(PNG_WRITE_APNG_SUPPORTED) -+/* private, reset some things to become ready for writing next frame */ -+PNG_EXTERN void png_write_reset PNGARG((png_structp png_ptr)); -+PNG_EXTERN void png_write_reinit PNGARG((png_structp png_ptr, -+ png_infop info_ptr, png_uint_32 width, png_uint_32 height)); -+#endif -+ - /* these are the functions that do the transformations */ - #if defined(PNG_READ_FILLER_SUPPORTED) - PNG_EXTERN void png_do_read_filler PNGARG((png_row_infop row_info, -@@ -3441,6 +3596,18 @@ - png_uint_32 length)); - #endif - -+#if defined(PNG_READ_APNG_SUPPORTED) -+PNG_EXTERN void png_handle_acTL PNGARG((png_structp png_ptr, png_infop info_ptr, -+ png_uint_32 length)); -+PNG_EXTERN void png_handle_fcTL PNGARG((png_structp png_ptr, png_infop info_ptr, -+ png_uint_32 length)); -+PNG_EXTERN void png_have_info PNGARG((png_structp png_ptr, png_infop info_ptr)); -+PNG_EXTERN void png_handle_fdAT PNGARG((png_structp png_ptr, png_infop info_ptr, -+ png_uint_32 length)); -+PNG_EXTERN void png_ensure_sequence_number PNGARG((png_structp png_ptr, -+ png_uint_32 length)); -+#endif -+ - PNG_EXTERN void png_handle_unknown PNGARG((png_structp png_ptr, - png_infop info_ptr, png_uint_32 length)); - -Index: pngwrite.c -=================================================================== ---- pngwrite.c (rvision 149) -+++ pngwrite.c (copie de travail) -@@ -261,6 +261,10 @@ - } - } - #endif -+#if defined(PNG_WRITE_APNG_SUPPORTED) -+ if (info_ptr->valid & PNG_INFO_acTL) -+ png_write_acTL(png_ptr, info_ptr->num_frames, info_ptr->num_plays); -+#endif - #if defined(PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED) - if (info_ptr->unknown_chunks_num) - { -@@ -299,6 +303,10 @@ - return; - if (!(png_ptr->mode & PNG_HAVE_IDAT)) - png_error(png_ptr, "No IDATs written into file"); -+#if defined(PNG_WRITE_APNG_SUPPORTED) -+ if (png_ptr->num_frames_written != png_ptr->num_frames_to_write) -+ png_error(png_ptr, "Not enough frames written"); -+#endif - - /* see if user wants us to write information chunks */ - if (info_ptr != NULL) -@@ -1527,4 +1535,39 @@ - params = params; - } - #endif -+ -+#if defined(PNG_WRITE_APNG_SUPPORTED) -+void PNGAPI -+png_write_frame_head(png_structp png_ptr, png_infop info_ptr, -+ png_bytepp row_pointers, png_uint_32 width, png_uint_32 height, -+ png_uint_32 x_offset, png_uint_32 y_offset, -+ png_uint_16 delay_num, png_uint_16 delay_den, png_byte dispose_op, -+ png_byte blend_op) -+{ -+ png_debug(1, "in png_write_frame_head\n"); -+ -+ /* there is a chance this has been set after png_write_info was called, -+ * so it would be set but not written. is there a way to be sure? */ -+ if (!(info_ptr->valid & PNG_INFO_acTL)) -+ png_error(png_ptr, "png_write_frame_head(): acTL not set"); -+ -+ png_write_reset(png_ptr); -+ -+ png_write_reinit(png_ptr, info_ptr, width, height); -+ -+ if ( !(png_ptr->num_frames_written == 0 && -+ (png_ptr->apng_flags & PNG_FIRST_FRAME_HIDDEN) ) ) -+ png_write_fcTL(png_ptr, width, height, x_offset, y_offset, -+ delay_num, delay_den, dispose_op, blend_op); -+} -+ -+void PNGAPI -+png_write_frame_tail(png_structp png_ptr, png_infop png_info) -+{ -+ png_debug(1, "in png_write_frame_tail\n"); -+ -+ png_ptr->num_frames_written++; -+} -+#endif /* PNG_WRITE_APNG_SUPPORTED */ -+ - #endif /* PNG_WRITE_SUPPORTED */ -Index: pngconf.h -=================================================================== ---- pngconf.h (rvision 149) -+++ pngconf.h (copie de travail) -@@ -925,6 +925,10 @@ - # define PNG_READ_zTXt_SUPPORTED - # define PNG_zTXt_SUPPORTED - #endif -+#ifndef PNG_NO_READ_APNG -+# define PNG_READ_APNG_SUPPORTED -+# define PNG_APNG_SUPPORTED -+#endif - #ifndef PNG_NO_READ_UNKNOWN_CHUNKS - # define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED - # ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED -@@ -1067,6 +1071,12 @@ - # define PNG_zTXt_SUPPORTED - # endif - #endif -+#ifndef PNG_NO_WRITE_APNG -+# define PNG_WRITE_APNG_SUPPORTED -+# ifndef PNG_APNG_SUPPORTED -+# define PNG_APNG_SUPPORTED -+# endif -+#endif - #ifndef PNG_NO_WRITE_UNKNOWN_CHUNKS - # define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED - # ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED -Index: pngpread.c -=================================================================== ---- pngpread.c (rvision 149) -+++ pngpread.c (copie de travail) -@@ -192,6 +192,11 @@ - #if defined(PNG_READ_zTXt_SUPPORTED) - PNG_CONST PNG_zTXt; - #endif -+#if defined(PNG_READ_APNG_SUPPORTED) -+ PNG_CONST PNG_acTL; -+ PNG_CONST PNG_fcTL; -+ PNG_CONST PNG_fdAT; -+#endif - #endif /* PNG_USE_LOCAL_ARRAYS */ - /* First we make sure we have enough data for the 4 byte chunk name - * and the 4 byte chunk length before proceeding with decoding the -@@ -215,7 +220,104 @@ - png_crc_read(png_ptr, png_ptr->chunk_name, 4); - png_ptr->mode |= PNG_HAVE_CHUNK_HEADER; - } -- -+ -+#if defined(PNG_READ_APNG_SUPPORTED) -+ if (png_ptr->num_frames_read > 0 && -+ png_ptr->num_frames_read < info_ptr->num_frames) -+ { -+ if (!png_memcmp(png_ptr->chunk_name, png_IDAT, 4)) -+ { -+ /* discard trailing IDATs for the first frame */ -+ if (png_ptr->mode & PNG_HAVE_fcTL || png_ptr->num_frames_read > 1) -+ png_error(png_ptr, "out of place IDAT"); -+ -+ if (png_ptr->push_length + 4 > png_ptr->buffer_size) -+ { -+ png_push_save_buffer(png_ptr); -+ return; -+ } -+ png_push_crc_skip(png_ptr, png_ptr->push_length); -+ png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER; -+ return; -+ } -+ else if (!png_memcmp(png_ptr->chunk_name, png_fdAT, 4)) -+ { -+ if (png_ptr->buffer_size < 4) -+ { -+ png_push_save_buffer(png_ptr); -+ return; -+ } -+ png_ensure_sequence_number(png_ptr, 4); -+ -+ if (!(png_ptr->mode & PNG_HAVE_fcTL)) -+ { -+ /* discard trailing fdATs for frames other than the first */ -+ if (png_ptr->num_frames_read < 2) -+ png_error(png_ptr, "out of place fdAT"); -+ -+ if (png_ptr->push_length + 4 > png_ptr->buffer_size) -+ { -+ png_push_save_buffer(png_ptr); -+ return; -+ } -+ png_push_crc_skip(png_ptr, png_ptr->push_length); -+ png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER; -+ return; -+ } -+ else -+ { -+ /* frame data follows */ -+ png_ptr->idat_size = png_ptr->push_length - 4; -+ png_ptr->mode |= PNG_HAVE_IDAT; -+ png_ptr->process_mode = PNG_READ_IDAT_MODE; -+ -+ return; -+ } -+ } -+ else if(!png_memcmp(png_ptr->chunk_name, png_fcTL, 4)) -+ { -+ if (png_ptr->push_length + 4 > png_ptr->buffer_size) -+ { -+ png_push_save_buffer(png_ptr); -+ return; -+ } -+ -+ png_read_reset(png_ptr); -+ png_ptr->mode &= ~PNG_HAVE_fcTL; -+ -+ png_handle_fcTL(png_ptr, info_ptr, png_ptr->push_length); -+ -+ if (!(png_ptr->mode & PNG_HAVE_fcTL)) -+ png_error(png_ptr, "missing required fcTL chunk"); -+ -+ png_read_reinit(png_ptr, info_ptr); -+ png_progressive_read_reset(png_ptr); -+ -+ if (png_ptr->frame_info_fn != NULL) -+ (*(png_ptr->frame_info_fn))(png_ptr, png_ptr->num_frames_read); -+ -+ png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER; -+ -+ return; -+ } -+ else -+ { -+ if (png_ptr->push_length + 4 > png_ptr->buffer_size) -+ { -+ png_push_save_buffer(png_ptr); -+ return; -+ } -+ png_warning(png_ptr, "Skipped (ignored) a chunk " -+ "between APNG chunks"); -+ png_push_crc_skip(png_ptr, png_ptr->push_length); -+ png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER; -+ return; -+ } -+ -+ return; -+ } -+#endif /* PNG_READ_APNG_SUPPORTED */ -+ - if (!png_memcmp(png_ptr->chunk_name, png_IDAT, 4)) - if(png_ptr->mode & PNG_AFTER_IDAT) - png_ptr->mode |= PNG_HAVE_CHUNK_AFTER_IDAT; -@@ -295,6 +397,9 @@ - png_error(png_ptr, "Too many IDAT's found"); - } - -+#if defined(PNG_READ_APNG_SUPPORTED) -+ png_have_info(png_ptr, info_ptr); -+#endif - png_ptr->idat_size = png_ptr->push_length; - png_ptr->mode |= PNG_HAVE_IDAT; - png_ptr->process_mode = PNG_READ_IDAT_MODE; -@@ -490,6 +595,35 @@ - png_push_handle_iTXt(png_ptr, info_ptr, png_ptr->push_length); - } - #endif -+#if defined(PNG_READ_APNG_SUPPORTED) -+ else if (!png_memcmp(png_ptr->chunk_name, png_acTL, 4)) -+ { -+ if (png_ptr->push_length + 4 > png_ptr->buffer_size) -+ { -+ png_push_save_buffer(png_ptr); -+ return; -+ } -+ png_handle_acTL(png_ptr, info_ptr, png_ptr->push_length); -+ } -+ else if (!png_memcmp(png_ptr->chunk_name, png_fcTL, 4)) -+ { -+ if (png_ptr->push_length + 4 > png_ptr->buffer_size) -+ { -+ png_push_save_buffer(png_ptr); -+ return; -+ } -+ png_handle_fcTL(png_ptr, info_ptr, png_ptr->push_length); -+ } -+ else if (!png_memcmp(png_ptr->chunk_name, png_fdAT, 4)) -+ { -+ if (png_ptr->push_length + 4 > png_ptr->buffer_size) -+ { -+ png_push_save_buffer(png_ptr); -+ return; -+ } -+ png_handle_fdAT(png_ptr, info_ptr, png_ptr->push_length); -+ } -+#endif /* PNG_READ_APNG_SUPPORTED */ - else - { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) -@@ -660,13 +794,17 @@ - png_push_read_IDAT(png_structp png_ptr) - { - #ifdef PNG_USE_LOCAL_ARRAYS -- PNG_CONST PNG_IDAT; -+ PNG_IDAT; -+#if defined(PNG_READ_APNG_SUPPORTED) -+ PNG_fdAT; -+ PNG_IEND; - #endif -+#endif - if (!(png_ptr->mode & PNG_HAVE_CHUNK_HEADER)) - { - png_byte chunk_length[4]; - -- if (png_ptr->buffer_size < 8) -+ if (png_ptr->buffer_size < 12) - { - png_push_save_buffer(png_ptr); - return; -@@ -678,15 +816,59 @@ - png_crc_read(png_ptr, png_ptr->chunk_name, 4); - png_ptr->mode |= PNG_HAVE_CHUNK_HEADER; - -- if (png_memcmp(png_ptr->chunk_name, png_IDAT, 4)) -+#if defined(PNG_READ_APNG_SUPPORTED) -+ if (png_memcmp(png_ptr->chunk_name, (png_bytep)png_fdAT, 4) -+ && png_ptr->num_frames_read > 0) - { -+ if (png_ptr->flags & PNG_FLAG_ZLIB_FINISHED) -+ { -+ png_ptr->process_mode = PNG_READ_CHUNK_MODE; -+ if (png_ptr->frame_end_fn != NULL) -+ (*(png_ptr->frame_end_fn))(png_ptr, png_ptr->num_frames_read); -+ png_ptr->num_frames_read++; -+ return; -+ } -+ else -+ { -+ if (!png_memcmp(png_ptr->chunk_name, png_IEND, 4)) -+ png_error(png_ptr, "Not enough image data"); -+ if (png_ptr->push_length + 4 > png_ptr->buffer_size) -+ { -+ png_push_save_buffer(png_ptr); -+ return; -+ } -+ png_warning(png_ptr, "Skipping (ignoring) a chunk between " -+ "APNG chunks"); -+ png_crc_finish(png_ptr, png_ptr->push_length); -+ png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER; -+ return; -+ } -+ } -+ else -+#endif -+ if ( png_memcmp(png_ptr->chunk_name, png_IDAT, 4) -+ && (png_ptr->num_frames_read == 0) ) -+ { - png_ptr->process_mode = PNG_READ_CHUNK_MODE; - if (!(png_ptr->flags & PNG_FLAG_ZLIB_FINISHED)) - png_error(png_ptr, "Not enough compressed data"); -+#if defined(PNG_READ_APNG_SUPPORTED) -+ if (png_ptr->frame_end_fn != NULL) -+ (*(png_ptr->frame_end_fn))(png_ptr, png_ptr->num_frames_read); -+ png_ptr->num_frames_read++; -+#endif - return; - } - - png_ptr->idat_size = png_ptr->push_length; -+ -+#if defined(PNG_READ_APNG_SUPPORTED) -+ if(png_ptr->num_frames_read > 0) -+ { -+ png_ensure_sequence_number(png_ptr, 4); -+ png_ptr->idat_size -= 4; -+ } -+#endif - } - if (png_ptr->idat_size && png_ptr->save_buffer_size) - { -@@ -1582,6 +1764,17 @@ - png_set_read_fn(png_ptr, progressive_ptr, png_push_fill_buffer); - } - -+#if defined(PNG_READ_APNG_SUPPORTED) -+void PNGAPI -+png_set_progressive_frame_fn(png_structp png_ptr, -+ png_progressive_frame_ptr frame_info_fn, -+ png_progressive_frame_ptr frame_end_fn) -+{ -+ png_ptr->frame_info_fn = frame_info_fn; -+ png_ptr->frame_end_fn = frame_end_fn; -+} -+#endif -+ - png_voidp PNGAPI - png_get_progressive_ptr(png_structp png_ptr) - { -Index: pngset.c -=================================================================== ---- pngset.c (rvision 149) -+++ pngset.c (copie de travail) -@@ -363,6 +363,11 @@ - info_ptr->rowbytes = (png_size_t)0; - else - info_ptr->rowbytes = PNG_ROWBYTES(info_ptr->pixel_depth, width); -+ -+#if defined(PNG_APNG_SUPPORTED) -+ /* for non-animated png. this may be overritten from an acTL chunk later */ -+ info_ptr->num_frames = 1; -+#endif - } - - #if defined(PNG_oFFs_SUPPORTED) -@@ -1043,6 +1048,141 @@ - } - #endif /* PNG_sPLT_SUPPORTED */ - -+#if defined(PNG_APNG_SUPPORTED) -+png_uint_32 PNGAPI -+png_set_acTL(png_structp png_ptr, png_infop info_ptr, -+ png_uint_32 num_frames, png_uint_32 num_plays) -+{ -+ png_debug1(1, "in %s storage function\n", "acTL"); -+ -+ if (png_ptr == NULL || info_ptr == NULL) -+ { -+ png_warning(png_ptr, -+ "Call to png_set_acTL() with NULL png_ptr " -+ "or info_ptr ignored"); -+ return (0); -+ } -+ if (num_frames == 0) -+ { -+ png_warning(png_ptr, -+ "Ignoring attempt to set acTL with num_frames zero"); -+ return (0); -+ } -+ if (num_frames > PNG_UINT_31_MAX) -+ { -+ png_warning(png_ptr, -+ "Ignoring attempt to set acTL with num_frames > 2^31-1"); -+ return (0); -+ } -+ if (num_plays > PNG_UINT_31_MAX) -+ { -+ png_warning(png_ptr, -+ "Ignoring attempt to set acTL with num_plays " -+ "> 2^31-1"); -+ return (0); -+ } -+ -+ info_ptr->num_frames = num_frames; -+ info_ptr->num_plays = num_plays; -+ -+ info_ptr->valid |= PNG_INFO_acTL; -+ -+ return (1); -+} -+ -+/* delay_num and delay_den can hold any 16-bit values including zero */ -+png_uint_32 PNGAPI -+png_set_next_frame_fcTL(png_structp png_ptr, png_infop info_ptr, -+ png_uint_32 width, png_uint_32 height, -+ png_uint_32 x_offset, png_uint_32 y_offset, -+ png_uint_16 delay_num, png_uint_16 delay_den, -+ png_byte dispose_op, png_byte blend_op) -+{ -+ png_debug1(1, "in %s storage function\n", "fcTL"); -+ -+ if (png_ptr == NULL || info_ptr == NULL) -+ { -+ png_warning(png_ptr, -+ "Call to png_set_fcTL() with NULL png_ptr or info_ptr " -+ "ignored"); -+ return (0); -+ } -+ -+ png_ensure_fcTL_is_valid(png_ptr, width, height, x_offset, y_offset, -+ delay_num, delay_den, dispose_op, blend_op); -+ -+ info_ptr->next_frame_width = width; -+ info_ptr->next_frame_height = height; -+ info_ptr->next_frame_x_offset = x_offset; -+ info_ptr->next_frame_y_offset = y_offset; -+ info_ptr->next_frame_delay_num = delay_num; -+ info_ptr->next_frame_delay_den = delay_den; -+ info_ptr->next_frame_dispose_op = dispose_op; -+ info_ptr->next_frame_blend_op = blend_op; -+ -+ info_ptr->valid |= PNG_INFO_fcTL; -+ -+ return (1); -+} -+ -+void /* PRIVATE */ -+png_ensure_fcTL_is_valid(png_structp png_ptr, -+ png_uint_32 width, png_uint_32 height, -+ png_uint_32 x_offset, png_uint_32 y_offset, -+ png_uint_16 delay_num, png_uint_16 delay_den, -+ png_byte dispose_op, png_byte blend_op) -+{ -+ if (width + x_offset > png_ptr->first_frame_width || -+ height + y_offset > png_ptr->first_frame_height) -+ png_error(png_ptr, "dimensions of a frame are greater than" -+ "the ones in IHDR"); -+ if (width > PNG_UINT_31_MAX) -+ png_error(png_ptr, "invalid width in fcTL (> 2^31-1)"); -+ if (height > PNG_UINT_31_MAX) -+ png_error(png_ptr, "invalid height in fcTL (> 2^31-1)"); -+ if (x_offset > PNG_UINT_31_MAX) -+ png_error(png_ptr, "invalid x_offset in fcTL (> 2^31-1)"); -+ if (y_offset > PNG_UINT_31_MAX) -+ png_error(png_ptr, "invalid y_offset in fcTL (> 2^31-1)"); -+ -+ if (dispose_op != PNG_DISPOSE_OP_NONE && -+ dispose_op != PNG_DISPOSE_OP_BACKGROUND && -+ dispose_op != PNG_DISPOSE_OP_PREVIOUS) -+ png_error(png_ptr, "invalid dispose_op in fcTL"); -+ -+ if (blend_op != PNG_BLEND_OP_SOURCE && -+ blend_op != PNG_BLEND_OP_OVER) -+ png_error(png_ptr, "invalid blend_op in fcTL"); -+ -+ if (blend_op == PNG_BLEND_OP_OVER) { -+ if (png_ptr->color_type == PNG_COLOR_TYPE_GRAY) -+ png_error(png_ptr, "PNG_BLEND_OP_OVER is not valid for " -+ "color type 'greyscale without alpha'"); -+ else if ((png_ptr->color_type & PNG_COLOR_MASK_COLOR) && -+ !(png_ptr->color_type & PNG_COLOR_MASK_ALPHA)) -+ png_error(png_ptr, "PNG_BLEND_OP_OVER is not valid for " -+ "color type 'truecolor without alpha'"); -+ } -+} -+ -+png_uint_32 PNGAPI -+png_set_first_frame_is_hidden(png_structp png_ptr, png_infop info_ptr, -+ png_byte is_hidden) -+{ -+ png_debug(1, "in png_first_frame_is_hidden()\n"); -+ -+ if (png_ptr == NULL) -+ return 0; -+ -+ if(is_hidden) -+ png_ptr->apng_flags |= PNG_FIRST_FRAME_HIDDEN; -+ else -+ png_ptr->apng_flags &= ~PNG_FIRST_FRAME_HIDDEN; -+ -+ return 1; -+} -+#endif /* PNG_APNG_SUPPORTED */ -+ - #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) - void PNGAPI - png_set_unknown_chunks(png_structp png_ptr, -Index: pngrutil.c -=================================================================== ---- pngrutil.c (rvision 149) -+++ pngrutil.c (copie de travail) -@@ -414,6 +414,11 @@ - filter_type = buf[11]; - interlace_type = buf[12]; - -+#if defined(PNG_READ_APNG_SUPPORTED) -+ png_ptr->first_frame_width = width; -+ png_ptr->first_frame_height = height; -+#endif -+ - /* set internal variables */ - png_ptr->width = width; - png_ptr->height = height; -@@ -2220,6 +2225,168 @@ - } - #endif - -+#if defined(PNG_READ_APNG_SUPPORTED) -+void /* PRIVATE */ -+png_handle_acTL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -+{ -+ png_byte data[8]; -+ png_uint_32 num_frames; -+ png_uint_32 num_plays; -+ png_uint_32 didSet; -+ -+ png_debug(1, "in png_handle_acTL\n"); -+ -+ if (!(png_ptr->mode & PNG_HAVE_IHDR)) -+ { -+ png_error(png_ptr, "Missing IHDR before acTL"); -+ } -+ else if (png_ptr->mode & PNG_HAVE_IDAT) -+ { -+ png_warning(png_ptr, "Invalid acTL after IDAT skipped"); -+ png_crc_finish(png_ptr, length); -+ return; -+ } -+ else if (png_ptr->mode & PNG_HAVE_acTL) -+ { -+ png_warning(png_ptr, "Duplicate acTL skipped"); -+ png_crc_finish(png_ptr, length); -+ return; -+ } -+ else if (length != 8) -+ { -+ png_warning(png_ptr, "acTL with invalid length skipped"); -+ png_crc_finish(png_ptr, length); -+ return; -+ } -+ -+ png_crc_read(png_ptr, data, 8); -+ png_crc_finish(png_ptr, 0); -+ -+ num_frames = png_get_uint_31(png_ptr, data); -+ num_plays = png_get_uint_31(png_ptr, data + 4); -+ -+ /* the set function will do error checking on num_frames */ -+ didSet = png_set_acTL(png_ptr, info_ptr, num_frames, num_plays); -+ if(didSet) -+ png_ptr->mode |= PNG_HAVE_acTL; -+} -+ -+void /* PRIVATE */ -+png_handle_fcTL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -+{ -+ png_byte data[22]; -+ png_uint_32 width; -+ png_uint_32 height; -+ png_uint_32 x_offset; -+ png_uint_32 y_offset; -+ png_uint_16 delay_num; -+ png_uint_16 delay_den; -+ png_byte dispose_op; -+ png_byte blend_op; -+ -+ png_debug(1, "in png_handle_fcTL\n"); -+ -+ if (!(png_ptr->mode & PNG_HAVE_IHDR)) -+ { -+ png_error(png_ptr, "Missing IHDR before fcTL"); -+ } -+ else if (png_ptr->mode & PNG_HAVE_IDAT) -+ { -+ /* for any frames other then the first this message may be misleading, -+ * but correct. PNG_HAVE_IDAT is unset before the frame head is read -+ * i can't think of a better message */ -+ png_warning(png_ptr, "Invalid fcTL after IDAT skipped"); -+ png_crc_finish(png_ptr, length); -+ return; -+ } -+ else if (png_ptr->mode & PNG_HAVE_fcTL) -+ { -+ png_warning(png_ptr, "Duplicate fcTL within one frame skipped"); -+ png_crc_finish(png_ptr, length); -+ return; -+ } -+ else if (length != 26) -+ { -+ png_warning(png_ptr, "fcTL with invalid length skipped"); -+ png_crc_finish(png_ptr, length); -+ return; -+ } -+ -+ png_ensure_sequence_number(png_ptr, length); -+ -+ png_crc_read(png_ptr, data, 22); -+ png_crc_finish(png_ptr, 0); -+ -+ width = png_get_uint_31(png_ptr, data); -+ height = png_get_uint_31(png_ptr, data + 4); -+ x_offset = png_get_uint_31(png_ptr, data + 8); -+ y_offset = png_get_uint_31(png_ptr, data + 12); -+ delay_num = png_get_uint_16(data + 16); -+ delay_den = png_get_uint_16(data + 18); -+ dispose_op = data[20]; -+ blend_op = data[21]; -+ -+ if (png_ptr->num_frames_read == 0 && (x_offset != 0 || y_offset != 0)) -+ png_error(png_ptr, "fcTL for the first frame must have zero offset"); -+ if (png_ptr->num_frames_read == 0 && -+ (width != info_ptr->width || height != info_ptr->height)) -+ png_error(png_ptr, "size in first frame's fcTL must match " -+ "the size in IHDR"); -+ -+ /* the set function will do more error checking */ -+ png_set_next_frame_fcTL(png_ptr, info_ptr, width, height, -+ x_offset, y_offset, delay_num, delay_den, -+ dispose_op, blend_op); -+ -+ png_read_reinit(png_ptr, info_ptr); -+ -+ png_ptr->mode |= PNG_HAVE_fcTL; -+} -+ -+void /* PRIVATE */ -+png_have_info(png_structp png_ptr, png_infop info_ptr) -+{ -+ if((info_ptr->valid & PNG_INFO_acTL) && !(info_ptr->valid & PNG_INFO_fcTL)) -+ { -+ png_ptr->apng_flags |= PNG_FIRST_FRAME_HIDDEN; -+ info_ptr->num_frames++; -+ } -+} -+ -+void /* PRIVATE */ -+png_handle_fdAT(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -+{ -+ png_ensure_sequence_number(png_ptr, length); -+ -+ /* This function is only called from png_read_end(), png_read_info(), -+ * and png_push_read_chunk() which means that: -+ * - the user doesn't want to read this frame -+ * - or this is an out-of-place fdAT -+ * in either case it is safe to ignore the chunk with a warning */ -+ png_warning(png_ptr, "ignoring fdAT chunk"); -+ png_crc_finish(png_ptr, length - 4); -+} -+ -+void /* PRIVATE */ -+png_ensure_sequence_number(png_structp png_ptr, png_uint_32 length) -+{ -+ png_byte data[4]; -+ png_uint_32 sequence_number; -+ -+ if (length < 4) -+ png_error(png_ptr, "invalid fcTL or fdAT chunk found"); -+ -+ png_crc_read(png_ptr, data, 4); -+ sequence_number = png_get_uint_31(png_ptr, data); -+ -+ if (sequence_number != png_ptr->next_seq_num) -+ png_error(png_ptr, "fcTL or fdAT chunk with out-of-order sequence " -+ "number found"); -+ -+ png_ptr->next_seq_num++; -+} -+#endif /* PNG_READ_APNG_SUPPORTED */ -+ - /* This function is called when we haven't found a handler for a - chunk. If there isn't a problem with the chunk itself (ie bad - chunk name, CRC, or a critical chunk), the chunk is silently ignored -@@ -3195,8 +3362,10 @@ - if (row_bytes + 64 > png_ptr->old_big_row_buf_size) - { - png_free(png_ptr, png_ptr->big_row_buf); -- png_ptr->big_row_buf = (png_bytep)png_malloc(png_ptr, row_bytes+64); -- png_ptr->row_buf = png_ptr->big_row_buf+32; -+ if (png_ptr->big_row_buf == NULL) -+ png_ptr->big_row_buf = (png_bytep)png_malloc(png_ptr, row_bytes+64); -+ if (png_ptr->row_buf == NULL) -+ png_ptr->row_buf = png_ptr->big_row_buf+32; - png_ptr->old_big_row_buf_size = row_bytes+64; - } - -@@ -3226,4 +3395,82 @@ - - png_ptr->flags |= PNG_FLAG_ROW_INIT; - } -+ -+#if defined(PNG_READ_APNG_SUPPORTED) -+/* This function is to be called after the main IDAT set has been read and -+ * before a new IDAT is read. It resets some parts of png_ptr -+ * to make them usable by the read functions again */ -+void /* PRIVATE */ -+png_read_reset(png_structp png_ptr) -+{ -+ png_ptr->mode &= ~PNG_HAVE_IDAT; -+ png_ptr->mode &= ~PNG_AFTER_IDAT; -+ png_ptr->row_number = 0; -+ png_ptr->pass = 0; -+ png_ptr->flags &= ~PNG_FLAG_ROW_INIT; -+} -+ -+void /* PRIVATE */ -+png_read_reinit(png_structp png_ptr, png_infop info_ptr) -+{ -+ png_ptr->width = info_ptr->next_frame_width; -+ png_ptr->height = info_ptr->next_frame_height; -+ png_ptr->rowbytes = PNG_ROWBYTES(png_ptr->pixel_depth,png_ptr->width); -+} -+ -+/* same as png_read_reset() but for the progressive reader */ -+void /* PRIVATE */ -+png_progressive_read_reset(png_structp png_ptr) -+{ -+#ifdef PNG_USE_LOCAL_ARRAYS -+ /* start of interlace block */ -+ const int FARDATA png_pass_start[] = {0, 4, 0, 2, 0, 1, 0}; -+ -+ /* offset to next interlace block */ -+ const int FARDATA png_pass_inc[] = {8, 8, 4, 4, 2, 2, 1}; -+ -+ /* start of interlace block in the y direction */ -+ const int FARDATA png_pass_ystart[] = {0, 0, 4, 0, 2, 0, 1}; -+ -+ /* offset to next interlace block in the y direction */ -+ const int FARDATA png_pass_yinc[] = {8, 8, 8, 4, 4, 2, 2}; -+#endif -+ png_uint_32 row_bytes; -+ -+ if (png_ptr->interlaced) -+ { -+ if (!(png_ptr->transformations & PNG_INTERLACE)) -+ png_ptr->num_rows = (png_ptr->height + png_pass_yinc[0] - 1 - -+ png_pass_ystart[0]) / png_pass_yinc[0]; -+ else -+ png_ptr->num_rows = png_ptr->height; -+ -+ png_ptr->iwidth = (png_ptr->width + -+ png_pass_inc[png_ptr->pass] - 1 - -+ png_pass_start[png_ptr->pass]) / -+ png_pass_inc[png_ptr->pass]; -+ -+ row_bytes = PNG_ROWBYTES(png_ptr->pixel_depth,png_ptr->iwidth) + 1; -+ -+ png_ptr->irowbytes = (png_size_t)row_bytes; -+ if((png_uint_32)png_ptr->irowbytes != row_bytes) -+ png_error(png_ptr, "png_progressive_read_reset(): Rowbytes " -+ "overflow"); -+ } -+ else -+ { -+ png_ptr->num_rows = png_ptr->height; -+ png_ptr->iwidth = png_ptr->width; -+ png_ptr->irowbytes = png_ptr->rowbytes + 1; -+ } -+ -+ png_ptr->flags &= ~PNG_FLAG_ZLIB_FINISHED; -+ if (inflateReset(&(png_ptr->zstream)) != Z_OK) -+ png_error(png_ptr, "inflateReset failed"); -+ png_ptr->zstream.avail_in = 0; -+ png_ptr->zstream.next_in = 0; -+ png_ptr->zstream.next_out = png_ptr->row_buf; -+ png_ptr->zstream.avail_out = (uInt)png_ptr->irowbytes; -+} -+#endif /* PNG_READ_APNG_SUPPORTED */ - #endif /* PNG_READ_SUPPORTED */ -Index: pngwutil.c -=================================================================== ---- pngwutil.c (rvision 149) -+++ pngwutil.c (copie de travail) -@@ -506,6 +506,11 @@ - /* write the chunk */ - png_write_chunk(png_ptr, (png_bytep)png_IHDR, buf, (png_size_t)13); - -+#if defined(PNG_WRITE_APNG_SUPPORTED) -+ png_ptr->first_frame_width = width; -+ png_ptr->first_frame_height = height; -+#endif -+ - /* initialize zlib with PNG info */ - png_ptr->zstream.zalloc = png_zalloc; - png_ptr->zstream.zfree = png_zfree; -@@ -628,6 +633,9 @@ - { - #ifdef PNG_USE_LOCAL_ARRAYS - PNG_IDAT; -+#if defined(PNG_WRITE_APNG_SUPPORTED) -+ PNG_fdAT; -+#endif - #endif - png_debug(1, "in png_write_IDAT\n"); - -@@ -670,7 +678,28 @@ - "Invalid zlib compression method or flags in IDAT"); - } - -- png_write_chunk(png_ptr, (png_bytep)png_IDAT, data, length); -+#if defined(PNG_WRITE_APNG_SUPPORTED) -+ if(png_ptr->num_frames_written == 0) -+#endif -+ png_write_chunk(png_ptr, (png_bytep)png_IDAT, data, length); -+#if defined(PNG_WRITE_APNG_SUPPORTED) -+ else -+ { -+ png_byte buf[4]; -+ -+ png_write_chunk_start(png_ptr, (png_bytep)png_fdAT, 4 + length); -+ -+ png_save_uint_32(buf, png_ptr->next_seq_num); -+ png_write_chunk_data(png_ptr, buf, 4); -+ -+ png_write_chunk_data(png_ptr, data, length); -+ -+ png_write_chunk_end(png_ptr); -+ -+ png_ptr->next_seq_num++; -+ } -+#endif -+ - png_ptr->mode |= PNG_HAVE_IDAT; - } - -@@ -1755,6 +1784,70 @@ - } - #endif - -+#if defined(PNG_WRITE_APNG_SUPPORTED) -+void /* PRIVATE */ -+png_write_acTL(png_structp png_ptr, -+ png_uint_32 num_frames, png_uint_32 num_plays) -+{ -+#ifdef PNG_USE_LOCAL_ARRAYS -+ PNG_acTL; -+#endif -+ png_byte data[16]; -+ -+ png_debug(1, "in png_write_acTL\n"); -+ -+ png_ptr->num_frames_to_write = num_frames; -+ -+ if (png_ptr->apng_flags & PNG_FIRST_FRAME_HIDDEN) -+ num_frames--; -+ -+ png_save_uint_32(data, num_frames); -+ png_save_uint_32(data + 4, num_plays); -+ -+ png_write_chunk(png_ptr, (png_bytep)png_acTL, data, (png_size_t)8); -+} -+ -+void /* PRIVATE */ -+png_write_fcTL(png_structp png_ptr, png_uint_32 width, png_uint_32 height, -+ png_uint_32 x_offset, png_uint_32 y_offset, -+ png_uint_16 delay_num, png_uint_16 delay_den, png_byte dispose_op, -+ png_byte blend_op) -+{ -+#ifdef PNG_USE_LOCAL_ARRAYS -+ PNG_fcTL; -+#endif -+ png_byte data[26]; -+ -+ png_debug(1, "in png_write_fcTL\n"); -+ -+ if (png_ptr->num_frames_written == 0 && (x_offset != 0 || y_offset != 0)) -+ png_error(png_ptr, "x and/or y offset for the first frame aren't 0\n"); -+ if (png_ptr->num_frames_written == 0 && -+ (width != png_ptr->first_frame_width || -+ height != png_ptr->first_frame_height)) -+ png_error(png_ptr, "width and/or height in the first frame's fcTL " -+ "don't match the ones in IHDR\n"); -+ -+ /* more error checking */ -+ png_ensure_fcTL_is_valid(png_ptr, width, height, x_offset, y_offset, -+ delay_num, delay_den, dispose_op, blend_op); -+ -+ png_save_uint_32(data, png_ptr->next_seq_num); -+ png_save_uint_32(data + 4, width); -+ png_save_uint_32(data + 8, height); -+ png_save_uint_32(data + 12, x_offset); -+ png_save_uint_32(data + 16, y_offset); -+ png_save_uint_16(data + 20, delay_num); -+ png_save_uint_16(data + 22, delay_den); -+ data[24] = dispose_op; -+ data[25] = blend_op; -+ -+ png_write_chunk(png_ptr, (png_bytep)png_fcTL, data, (png_size_t)26); -+ -+ png_ptr->next_seq_num++; -+} -+#endif /* PNG_WRITE_APNG_SUPPORTED */ -+ - /* initializes the row writing capability of libpng */ - void /* PRIVATE */ - png_write_start_row(png_structp png_ptr) -@@ -2824,4 +2917,39 @@ - } - #endif - } -+ -+#if defined(PNG_WRITE_APNG_SUPPORTED) -+void /* PRIVATE */ -+png_write_reset(png_structp png_ptr) -+{ -+ png_ptr->row_number = 0; -+ png_ptr->pass = 0; -+ png_ptr->mode &= ~PNG_HAVE_IDAT; -+} -+ -+void /* PRIVATE */ -+png_write_reinit(png_structp png_ptr, png_infop info_ptr, -+ png_uint_32 width, png_uint_32 height) -+{ -+ if (png_ptr->num_frames_written == 0 && -+ (width != png_ptr->first_frame_width || -+ height != png_ptr->first_frame_height)) -+ png_error(png_ptr, "width and/or height in the first frame's fcTL " -+ "don't match the ones in IHDR\n"); -+ if (width > png_ptr->first_frame_width || -+ height > png_ptr->first_frame_height) -+ png_error(png_ptr, "width and/or height for a frame greater than" -+ "the ones in IHDR"); -+ -+ png_set_IHDR(png_ptr, info_ptr, width, height, -+ info_ptr->bit_depth, info_ptr->color_type, -+ info_ptr->interlace_type, info_ptr->compression_type, -+ info_ptr->filter_type); -+ -+ png_ptr->width = width; -+ png_ptr->height = height; -+ png_ptr->rowbytes = PNG_ROWBYTES(png_ptr->pixel_depth, width); -+ png_ptr->usr_width = png_ptr->width; -+} -+#endif - #endif /* PNG_WRITE_SUPPORTED */ -Index: pngrtran.c -=================================================================== ---- pngrtran.c (rvision 149) -+++ pngrtran.c (copie de travail) -@@ -1293,7 +1293,7 @@ - * or png_read_update_info() after setting transforms that expand - * pixels. This check added to libpng-1.2.19 */ - #if (PNG_WARN_UNINITIALIZED_ROW==1) -- png_error(png_ptr, "Uninitialized row"); -+ png_warning(png_ptr, "Uninitialized row"); - #else - png_warning(png_ptr, "Uninitialized row"); - #endif diff --git a/abs/core/libtool/libtool-2.2.10-3-i686.pkg.tar.gz b/abs/core/libtool/libtool-2.2.10-3-i686.pkg.tar.gz deleted file mode 120000 index 76cb8a4..0000000 --- a/abs/core/libtool/libtool-2.2.10-3-i686.pkg.tar.gz +++ /dev/null @@ -1 +0,0 @@ -/data/pkg_repo/packages/libtool-2.2.10-3-i686.pkg.tar.gz \ No newline at end of file diff --git a/abs/core/libx86/lrmi.patch b/abs/core/libx86/lrmi.patch deleted file mode 100644 index 10530f9..0000000 --- a/abs/core/libx86/lrmi.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- old/lrmi.c 2006-10-30 21:10:16.000000000 +0100 -+++ new/lrmi.c 2008-08-27 11:32:40.000000000 +0200 -@@ -64,6 +64,13 @@ - #define DEFAULT_STACK_SIZE 0x1000 - #define RETURN_TO_32_INT 255 - -+#ifndef IF_MASK -+#define IF_MASK X86_EFLAGS_VIF -+#define IOPL_MASK X86_EFLAGS_IOPL -+#define VIF_MASK X86_EFLAGS_VIF -+#define TF_MASK X86_EFLAGS_TF -+#endif -+ - #if defined(__linux__) - #define CONTEXT_REGS context.vm.regs - #define REG(x) x diff --git a/abs/core/linux-atm/linux-atm-2.5.0-glibc28.patch b/abs/core/linux-atm/linux-atm-2.5.0-glibc28.patch deleted file mode 100644 index 692f316..0000000 --- a/abs/core/linux-atm/linux-atm-2.5.0-glibc28.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -up linux-atm-2.5.0/src/led/main.c.path_max linux-atm-2.5.0/src/led/main.c ---- linux-atm-2.5.0/src/led/main.c.path_max 2008-05-19 02:47:40.000000000 +0900 -+++ linux-atm-2.5.0/src/led/main.c 2008-05-19 02:47:52.000000000 +0900 -@@ -41,6 +41,7 @@ - #include - #include - #include -+#include - - #include - #include diff --git a/abs/core/mdadm/raid-partitions_hook b/abs/core/mdadm/raid-partitions_hook deleted file mode 100644 index bed1cb2..0000000 --- a/abs/core/mdadm/raid-partitions_hook +++ /dev/null @@ -1,21 +0,0 @@ -# vim: set ft=sh: -run_hook () -{ - #TODO scan for these somehow... - /sbin/modprobe -aq linear multipath raid0 raid1 raid456 raid10>/dev/null 2>&1 - # md= can be specified multiple times. The simplistic commandline - # parsing does not handle this, so we will let mdassemble parse it - for i in $(replace $(echo $md) ',' ' '); do - case $i in d[0-9]) - for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do - /sbin/mdadm --create -a mdp /dev/md_d$i >/dev/null 2>&1 - done - mdadm --assemble --auto=mdp /dev/md_$(replace $(echo $md) ',' ' ') - export USE_RAID_ARRAY=1 - ;; - esac - done - if ! [ "$USE_RAID_ARRAY" = "1" ] ; then - /bin/mdassemble ${CMDLINE} - fi -} diff --git a/abs/core/mdadm/raid-partitions_install b/abs/core/mdadm/raid-partitions_install deleted file mode 100644 index 8fe5184..0000000 --- a/abs/core/mdadm/raid-partitions_install +++ /dev/null @@ -1,32 +0,0 @@ -# vim: set ft=sh: - -install () -{ - MODULES=" $(checked_modules "drivers/md/*" | grep -v "dm-") " - BINARIES="mdadm" - FILES="" - SCRIPT="raid-partitions" - add_file "/usr/lib/klibc/bin/mdassemble" "/bin/mdassemble" -} - -help () -{ -cat<,dev0,dev1,...,devn - - Parameters: - - = the number of the md device: - 0 means md0, 1 means md1, ... - - : e.g. /dev/hda1,/dev/hdc1,/dev/sda1,/dev/sdb1 -HELPEOF -} diff --git a/abs/core/php/db-configure.patch b/abs/core/php/db-configure.patch deleted file mode 100644 index fdc82b9..0000000 --- a/abs/core/php/db-configure.patch +++ /dev/null @@ -1,51 +0,0 @@ ---- configure.orig 2008-07-03 10:27:06.000000000 +0000 -+++ configure 2008-07-03 10:30:56.000000000 +0000 -@@ -28399,43 +28399,15 @@ - - unset THIS_INCLUDE THIS_LIBS THIS_LFLAGS THIS_PREFIX THIS_RESULT - -- dbdp="/usr/local/BerkeleyDB.4." -- for i in $PHP_DB4 ${dbdp}6 ${dbdp}5 ${dbdp}4 ${dbdp}3 ${dbdp}2 ${dbdp}1 ${dbdp}0 /usr/local /usr; do -- if test -f "$i/db4/db.h"; then -- THIS_PREFIX=$i -- THIS_INCLUDE=$i/db4/db.h -- break -- elif test -f "$i/include/db4.6/db.h"; then -- THIS_PREFIX=$i -- THIS_INCLUDE=$i/include/db4.6/db.h -- break -- elif test -f "$i/include/db4.5/db.h"; then -- THIS_PREFIX=$i -- THIS_INCLUDE=$i/include/db4.5/db.h -- break -- elif test -f "$i/include/db4/db.h"; then -- THIS_PREFIX=$i -- THIS_INCLUDE=$i/include/db4/db.h -- break -- elif test -f "$i/include/db/db4.h"; then -- THIS_PREFIX=$i -- THIS_INCLUDE=$i/include/db/db4.h -- break -- elif test -f "$i/include/db4.h"; then -- THIS_PREFIX=$i -- THIS_INCLUDE=$i/include/db4.h -- break -- elif test -f "$i/include/db.h"; then -- THIS_PREFIX=$i -- THIS_INCLUDE=$i/include/db.h -- break -- fi -- done -+ if test -f "/usr/include/db.h"; then -+ THIS_PREFIX=/usr -+ THIS_INCLUDE=/usr/include/db.h -+ fi - - if test -z "$THIS_INCLUDE"; then - { echo "configure: error: DBA: Could not find necessary header file(s)." 1>&2; exit 1; } - fi -- for LIB in db-4.6 db-4.5 db-4.4 db-4.3 db-4.2 db-4.1 db-4.0 db-4 db4 db; do -+ for LIB in db; do - if test -f $THIS_PREFIX/$PHP_LIBDIR/lib$LIB.a || test -f $THIS_PREFIX/$PHP_LIBDIR/lib$LIB.$SHLIB_SUFFIX_NAME; then - lib_found=""; - diff --git a/abs/core/pm-utils/pm-utils.install b/abs/core/pm-utils/pm-utils.install deleted file mode 100644 index 5e8232d..0000000 --- a/abs/core/pm-utils/pm-utils.install +++ /dev/null @@ -1,15 +0,0 @@ -# arg 1: the new package version -post_install() { - cat << _EOF - -Powersave has been deprecated as suspend/resume framework and has been replaced -by pm-utils. Pm-utils provides everything you need for suspend/resume, but does -not load your cpufreq modules like powersaved does. You have to load these -modules by hand if you want to use them. - -_EOF -} - -op=$1 -shift -$op $* diff --git a/abs/core/pm-utils/service.patch b/abs/core/pm-utils/service.patch deleted file mode 100644 index 422b3f5..0000000 --- a/abs/core/pm-utils/service.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- pm/functions.in~ 2008-04-10 17:39:48.000000000 +0000 -+++ pm/functions.in 2008-04-10 17:39:58.000000000 +0000 -@@ -138,10 +138,10 @@ - if ! command_exists service; then - service() - { -- if [ -x "/etc/init.d/$1" ]; then -+ if [ -x "/etc/rc.d/$1" ]; then - svc="$1" - shift -- "/etc/init.d/$svc" "$@" -+ "/etc/rc.d/$svc" "$@" - else - log "$1" $": unrecognized service" 1>&2 - return 1 diff --git a/abs/core/projectm/projectm.install b/abs/core/projectm/projectm.install deleted file mode 100644 index a1e44dc..0000000 --- a/abs/core/projectm/projectm.install +++ /dev/null @@ -1,13 +0,0 @@ -post_install() { - echo ">> projectm has been split so that you additionally need to install:" - echo ">> xmms-projectm for xmms" - echo ">> libvisual-project for libvisual (like for amarok)" -} - -post_upgrade() { - post_install -} - -op=$1 -shift -$op $* diff --git a/abs/core/shadow/shadow-4.0.18.2-useradd-fix-1.patch b/abs/core/shadow/shadow-4.0.18.2-useradd-fix-1.patch deleted file mode 100644 index d35580d..0000000 --- a/abs/core/shadow/shadow-4.0.18.2-useradd-fix-1.patch +++ /dev/null @@ -1,26 +0,0 @@ -# DIY Linux Patch -Date: 2007-11-08 -Author: Greg Schafer -Origin: Modelled on the same upstream fix for usermod. -Maker: Greg Schafer -Upstream Status: Submitted, applied. -Description: Fix -g problems in useradd. - -diff -Naur shadow-4.0.18.2.orig/src/useradd.c shadow-4.0.18.2/src/useradd.c ---- shadow-4.0.18.2.orig/src/useradd.c 2007-10-07 14:36:51.000000000 +0000 -+++ shadow-4.0.18.2/src/useradd.c 2007-11-08 06:33:32.433004367 +0000 -@@ -204,12 +204,8 @@ - char *errptr; - - gid = strtol (grname, &errptr, 10); -- if (*errptr || errno == ERANGE || gid < 0) { -- fprintf (stderr, -- _("%s: invalid numeric argument '%s'\n"), Prog, -- grname); -- exit (E_BAD_ARG); -- } -+ if (*grname != '\0' && *errptr == '\0' && errno != ERANGE && gid >= 0) -+ return getgrgid (gid); - return getgrnam (grname); - } - diff --git a/abs/core/shadow/shadow-UID_GID.patch b/abs/core/shadow/shadow-UID_GID.patch deleted file mode 100644 index 759b73e..0000000 --- a/abs/core/shadow/shadow-UID_GID.patch +++ /dev/null @@ -1,34 +0,0 @@ ---- shadow-4.0.18.1.orig/src/useradd.c 2006-08-25 11:57:00.202525241 +0200 -+++ shadow-4.0.18.1/src/useradd.c 2006-08-25 11:57:26.106735752 +0200 -@@ -206,11 +206,8 @@ - char *errptr; - - gid = strtol (grname, &errptr, 10); -- if (*errptr || errno == ERANGE || gid < 0) { -- fprintf (stderr, -- _("%s: invalid numeric argument '%s'\n"), Prog, grname); -- exit (E_BAD_ARG); -- } -+ if (*grname != '\0' && *errptr == '\0' && errno != ERANGE && gid >= 0) -+ return getgrgid (gid); - return getgrnam (grname); - } - -Index: shadow-4.0.18.1/src/usermod.c -=================================================================== ---- shadow-4.0.18.1.orig/src/usermod.c 2006-08-25 11:57:18.938677504 +0200 -+++ shadow-4.0.18.1/src/usermod.c 2006-08-25 11:57:26.114735817 +0200 -@@ -167,11 +167,8 @@ - char *errptr; - - val = strtol (grname, &errptr, 10); -- if (*errptr || errno == ERANGE || val < 0) { -- fprintf (stderr, _("%s: invalid numeric argument '%s'\n"), Prog, -- grname); -- exit (E_BAD_ARG); -- } -+ if (*grname != '\0' && *errptr == '\0' && errno != ERANGE && val >= 0) -+ return getgrgid (val); - return getgrnam (grname); - } - \ No newline at end of file diff --git a/abs/core/shadow/useradd b/abs/core/shadow/useradd deleted file mode 100644 index a7bf8a4..0000000 --- a/abs/core/shadow/useradd +++ /dev/null @@ -1,6 +0,0 @@ -#%PAM-1.0 -auth sufficient pam_rootok.so -auth required pam_unix.so -account required pam_unix.so -session required pam_unix.so -password required pam_permit.so diff --git a/abs/core/shadow/useradd-default.patch b/abs/core/shadow/useradd-default.patch deleted file mode 100644 index 9b5a08e..0000000 --- a/abs/core/shadow/useradd-default.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- shadow-4.0.18.1/etc/useradd 2003-05-07 15:04:53.000000000 +0100 -+++ shadow-4.0.18.1/etc/useradd.default 2007-11-27 22:06:56.000000000 +0000 -@@ -1,8 +1,8 @@ - # useradd defaults file --GROUP=1000 --HOME=/home/users -+# Modified for Arch Linux -+GROUP=100 -+HOME=/home - INACTIVE=-1 - EXPIRE= - SHELL=/bin/bash - SKEL=/etc/skel --CREATE_MAIL_SPOOL=yes diff --git a/abs/core/sqlite3/build_fts_as_part_of_libsqlite.patch b/abs/core/sqlite3/build_fts_as_part_of_libsqlite.patch deleted file mode 100644 index 54b04f0..0000000 --- a/abs/core/sqlite3/build_fts_as_part_of_libsqlite.patch +++ /dev/null @@ -1,139 +0,0 @@ -Index: Makefile.in -=================================================================== -RCS file: /sqlite/sqlite/Makefile.in,v -retrieving revision 1.186 -diff -u -3 -p -r1.186 Makefile.in ---- Makefile.in 23 Nov 2007 15:12:44 -0000 1.186 -+++ Makefile.in 23 Nov 2007 19:27:56 -0000 -@@ -114,6 +114,23 @@ LTINSTALL = $(LIBTOOL) --mode=install $( - # nawk compatible awk. - NAWK = @AWK@ - -+# Need these defined unconditionally, as non-fts builds with -+# fts object files without using -DSQLITE_ENABLE_FTS[123] -+# will not work without it. -+# -+TCC += -DSQLITE_CORE -+TCC += -DSQLITE_ENABLE_BROKEN_FTS1 -+TCC += -DSQLITE_ENABLE_BROKEN_FTS2 -+ -+# uncomment to build fts1 as part of library -+# TCC += -DSQLITE_ENABLE_FTS1=1 -+ -+# uncomment to build fts2 as part of library -+# TCC += -DSQLITE_ENABLE_FTS2=1 -+ -+# uncomment to build fts3 as part of library -+# TCC += -DSQLITE_ENABLE_FTS3=1 -+ - # You should not have to change anything below this line - ############################################################################### - TCC += -DSQLITE_OMIT_LOAD_EXTENSION=1 -@@ -132,6 +149,17 @@ LIBOBJ = alter.lo analyze.lo attach.lo a - vdbe.lo vdbeapi.lo vdbeaux.lo vdbeblob.lo vdbefifo.lo vdbemem.lo \ - where.lo utf.lo legacy.lo vtab.lo - -+# Object files for FTS -+# -+LIBOBJ += \ -+ fts1.lo fts1_hash.lo fts1_porter.lo fts1_tokenizer1.lo -+ -+LIBOBJ += \ -+ fts2.lo fts2_hash.lo fts2_porter.lo fts2_tokenizer.lo fts2_tokenizer1.lo -+ -+LIBOBJ += \ -+ fts3.lo fts3_hash.lo fts3_porter.lo fts3_tokenizer.lo fts3_tokenizer1.lo -+ - # All of the source code files. - # - SRC = \ -@@ -209,6 +237,23 @@ SRC += \ - $(TOP)/ext/fts1/fts1_tokenizer.h \ - $(TOP)/ext/fts1/fts1_tokenizer1.c - -+SRC += \ -+ $(TOP)/ext/fts2/fts2.c \ -+ $(TOP)/ext/fts2/fts2.h \ -+ $(TOP)/ext/fts2/fts2_hash.c \ -+ $(TOP)/ext/fts2/fts2_hash.h \ -+ $(TOP)/ext/fts2/fts2_porter.c \ -+ $(TOP)/ext/fts2/fts2_tokenizer.h \ -+ $(TOP)/ext/fts2/fts2_tokenizer1.c -+ -+SRC += \ -+ $(TOP)/ext/fts3/fts3.c \ -+ $(TOP)/ext/fts3/fts3.h \ -+ $(TOP)/ext/fts3/fts3_hash.c \ -+ $(TOP)/ext/fts3/fts3_hash.h \ -+ $(TOP)/ext/fts3/fts3_porter.c \ -+ $(TOP)/ext/fts3/fts3_tokenizer.h \ -+ $(TOP)/ext/fts3/fts3_tokenizer1.c - - # Source code to the test files. - # -@@ -285,6 +330,16 @@ HDR += \ - $(TOP)/ext/fts1/fts1_hash.h \ - $(TOP)/ext/fts1/fts1_tokenizer.h - -+HDR += \ -+ $(TOP)/ext/fts2/fts2.h \ -+ $(TOP)/ext/fts2/fts2_hash.h \ -+ $(TOP)/ext/fts2/fts2_tokenizer.h -+ -+HDR += \ -+ $(TOP)/ext/fts3/fts3.h \ -+ $(TOP)/ext/fts3/fts3_hash.h \ -+ $(TOP)/ext/fts3/fts3_tokenizer.h -+ - # Header files used by the VDBE submodule - # - VDBEHDR = \ -@@ -616,3 +671,48 @@ sqlite3.def: $(REAL_LIBOBJ) - sqlite3.dll: $(REAL_LIBOBJ) sqlite3.def - $(TCC) -shared -o sqlite3.dll sqlite3.def \ - -Wl,"--strip-all" $(REAL_LIBOBJ) -+ -+# -+# FTS -+# -+fts1.lo: $(TOP)/ext/fts1/fts1.c $(HDR) -+ $(LTCOMPILE) -c $(TOP)/ext/fts1/fts1.c -+ -+fts1_hash.lo: $(TOP)/ext/fts1/fts1_hash.c $(HDR) -+ $(LTCOMPILE) -c $(TOP)/ext/fts1/fts1_hash.c -+ -+fts1_porter.lo: $(TOP)/ext/fts1/fts1_porter.c $(HDR) -+ $(LTCOMPILE) -c $(TOP)/ext/fts1/fts1_porter.c -+ -+fts1_tokenizer1.lo: $(TOP)/ext/fts1/fts1_tokenizer1.c $(HDR) -+ $(LTCOMPILE) -c $(TOP)/ext/fts1/fts1_tokenizer1.c -+ -+fts2.lo: $(TOP)/ext/fts2/fts2.c $(HDR) -+ $(LTCOMPILE) -c $(TOP)/ext/fts2/fts2.c -+ -+fts2_hash.lo: $(TOP)/ext/fts2/fts2_hash.c $(HDR) -+ $(LTCOMPILE) -c $(TOP)/ext/fts2/fts2_hash.c -+ -+fts2_porter.lo: $(TOP)/ext/fts2/fts2_porter.c $(HDR) -+ $(LTCOMPILE) -c $(TOP)/ext/fts2/fts2_porter.c -+ -+fts2_tokenizer.lo: $(TOP)/ext/fts2/fts2_tokenizer.c $(HDR) -+ $(LTCOMPILE) -c $(TOP)/ext/fts2/fts2_tokenizer.c -+ -+fts2_tokenizer1.lo: $(TOP)/ext/fts2/fts2_tokenizer1.c $(HDR) -+ $(LTCOMPILE) -c $(TOP)/ext/fts2/fts2_tokenizer1.c -+ -+fts3.lo: $(TOP)/ext/fts3/fts3.c $(HDR) -+ $(LTCOMPILE) -c $(TOP)/ext/fts3/fts3.c -+ -+fts3_hash.lo: $(TOP)/ext/fts3/fts3_hash.c $(HDR) -+ $(LTCOMPILE) -c $(TOP)/ext/fts3/fts3_hash.c -+ -+fts3_porter.lo: $(TOP)/ext/fts3/fts3_porter.c $(HDR) -+ $(LTCOMPILE) -c $(TOP)/ext/fts3/fts3_porter.c -+ -+fts3_tokenizer.lo: $(TOP)/ext/fts3/fts3_tokenizer.c $(HDR) -+ $(LTCOMPILE) -c $(TOP)/ext/fts3/fts3_tokenizer.c -+ -+fts3_tokenizer1.lo: $(TOP)/ext/fts3/fts3_tokenizer1.c $(HDR) -+ $(LTCOMPILE) -c $(TOP)/ext/fts3/fts3_tokenizer1.c diff --git a/abs/core/sqlite3/sqlite-3.5.8-pkgconfig-version.patch b/abs/core/sqlite3/sqlite-3.5.8-pkgconfig-version.patch deleted file mode 100644 index cb5b5ef..0000000 --- a/abs/core/sqlite3/sqlite-3.5.8-pkgconfig-version.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up sqlite-3.5.8/sqlite3.pc.in.release sqlite-3.5.8/sqlite3.pc.in ---- sqlite-3.5.8/sqlite3.pc.in.release 2008-04-23 09:11:38.000000000 +0300 -+++ sqlite-3.5.8/sqlite3.pc.in 2008-04-23 09:11:48.000000000 +0300 -@@ -7,7 +7,7 @@ includedir=@includedir@ - - Name: SQLite - Description: SQL database engine --Version: @VERSION@ -+Version: @RELEASE@ - Libs: -L${libdir} -lsqlite3 - Libs.private: @LIBS@ - Cflags: -I${includedir} diff --git a/abs/core/squashfs-tools/mksquashfs-fix-race.patch b/abs/core/squashfs-tools/mksquashfs-fix-race.patch deleted file mode 100644 index e483c93..0000000 --- a/abs/core/squashfs-tools/mksquashfs-fix-race.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- squashfs-tools/mksquashfs.c 2009-04-05 18:22:48.000000000 -0300 -+++ squashfs-tools/mksquashfs.c 2010-02-10 17:04:29.303757175 -0300 -@@ -1733,9 +1733,7 @@ - entry->buffer->block = bytes; - bytes += compressed_size; - fragments_outstanding --; -- pthread_mutex_unlock(&fragment_mutex); - queue_put(to_writer, entry->buffer); -- pthread_mutex_lock(&fragment_mutex); - TRACE("fragment_locked writing fragment %d, compressed size %d" - "\n", entry->fragment, compressed_size); - free(entry); -@@ -2426,8 +2424,8 @@ - write_buffer->block = bytes; - bytes += compressed_size; - fragments_outstanding --; -- pthread_mutex_unlock(&fragment_mutex); - queue_put(to_writer, write_buffer); -+ pthread_mutex_unlock(&fragment_mutex); - TRACE("Writing fragment %lld, uncompressed size %d, " - "compressed size %d\n", file_buffer->block, - file_buffer->size, compressed_size); - diff --git a/abs/core/sysvinit/halt-init.patch b/abs/core/sysvinit/halt-init.patch deleted file mode 100644 index 88eb0ce..0000000 --- a/abs/core/sysvinit/halt-init.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- src/halt.c.orig 2008-08-30 17:25:02.000000000 +0000 -+++ src/halt.c 2008-08-30 18:10:29.000000000 +0000 -@@ -186,6 +186,14 @@ - if (!strcmp(progname, "reboot")) do_reboot = 1; - if (!strcmp(progname, "poweroff")) do_poweroff = 1; - -+ if (!strcmp(progname, "reboot.init")) do_reboot = 1; -+ if (!strcmp(progname, "poweroff.init")) do_poweroff = 1; -+ -+ //fprintf(stderr, "%d: do_reboot \n ", do_reboot); -+ //fprintf(stderr, "%d: do_poweroff \n ", do_poweroff); -+ //fprintf(stderr, "%s: \n", progname); -+ //do_nothing = 1; -+ - /* - * Get flags - */ diff --git a/abs/core/udev/arch-udev-rules.patch b/abs/core/udev/arch-udev-rules.patch deleted file mode 100644 index ce00c85..0000000 --- a/abs/core/udev/arch-udev-rules.patch +++ /dev/null @@ -1,50 +0,0 @@ -diff -Nur rules.d/50-udev-default.rules rules.d.arch/50-udev-default.rules ---- rules.d/50-udev-default.rules 2009-03-07 22:22:48.200242883 +0100 -+++ rules.d.arch/50-udev-default.rules 2009-03-07 22:23:26.134434516 +0100 -@@ -59,15 +59,15 @@ - KERNEL=="fd[0-9]", ACTION=="add", ATTRS{cmos}=="?*", RUN+="create_floppy_devices -c -t $attr{cmos} -m %M -M 0640 -G floppy $root/%k" - - # cdrom --SUBSYSTEM=="block", KERNEL=="sr[0-9]*", SYMLINK+="scd%n", GROUP="cdrom" --SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="4|5", GROUP="cdrom" --KERNEL=="pktcdvd[0-9]*", GROUP="cdrom" --KERNEL=="pktcdvd", GROUP="cdrom" -+SUBSYSTEM=="block", KERNEL=="sr[0-9]*", SYMLINK+="scd%n", GROUP="optical", MODE="0660" -+SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="4|5", GROUP="optical", MODE="0660" -+KERNEL=="pktcdvd[0-9]*", GROUP="optical", MODE="0660" -+KERNEL=="pktcdvd", GROUP="optical", MODE="0660" - - # tape --KERNEL=="ht[0-9]*|nht[0-9]*", GROUP="tape" --KERNEL=="pt[0-9]*|npt[0-9]*|pht[0-9]*", GROUP="tape" --SUBSYSTEM=="scsi_generic|scsi_tape", SUBSYSTEMS=="scsi", ATTRS{type}=="1|8", GROUP="tape" -+KERNEL=="ht[0-9]*|nht[0-9]*", GROUP="storage", MODE="0660" -+KERNEL=="pt[0-9]*|npt[0-9]*|pht[0-9]*", GROUP="storage", MODE="0660" -+SUBSYSTEM=="scsi_generic|scsi_tape", SUBSYSTEMS=="scsi", ATTRS{type}=="1|8", GROUP="storage", MODE="0660" - - # block-related - KERNEL=="sch[0-9]*", GROUP="disk" -diff -Nur rules.d/80-drivers.rules rules.d.arch/80-drivers.rules ---- rules.d/80-drivers.rules 2010-06-03 11:55:08.978720002 +0200 -+++ rules.d.arch/80-drivers.rules 2010-06-03 11:58:41.207865142 +0200 -@@ -2,12 +2,13 @@ - - ACTION=="remove", GOTO="drivers_end" - --DRIVER!="?*", ENV{MODALIAS}=="?*", RUN+="/sbin/modprobe -bv $env{MODALIAS}" --SUBSYSTEM=="tifm", ENV{TIFM_CARD_TYPE}=="SD", RUN+="/sbin/modprobe -bv tifm_sd" --SUBSYSTEM=="tifm", ENV{TIFM_CARD_TYPE}=="MS", RUN+="/sbin/modprobe -bv tifm_ms" --SUBSYSTEM=="memstick", RUN+="/sbin/modprobe -bv --all ms_block mspro_block" --SUBSYSTEM=="i2o", RUN+="/sbin/modprobe -bv i2o_block" --SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", TEST!="[module/sg]", RUN+="/sbin/modprobe -bv sg" --SUBSYSTEM=="module", KERNEL=="parport_pc", RUN+="/sbin/modprobe -bv ppdev" -+DRIVER!="?*", ENV{MODALIAS}=="?*", RUN+="/lib/udev/load-modules.sh $env{MODALIAS}" -+SUBSYSTEM=="tifm", ENV{TIFM_CARD_TYPE}=="SD", RUN+="/lib/udev/load-modules.sh tifm_sd" -+SUBSYSTEM=="tifm", ENV{TIFM_CARD_TYPE}=="MS", RUN+="/lib/udev/load-modules.sh tifm_ms" -+SUBSYSTEM=="memstick", RUN+="/lib/udev/load-modules.sh ms_block" -+SUBSYSTEM=="memstick", RUN+="/lib/udev/load-modules.sh mspro_block" -+SUBSYSTEM=="i2o", RUN+="/lib/udev/load-modules.sh i2o_block" -+SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", TEST!="[module/sg]", RUN+="/lib/udev/load-modules.sh sg" -+SUBSYSTEM=="module", KERNEL=="parport_pc", RUN+="/lib/udev/load-modules.sh ppdev" - - LABEL="drivers_end" diff --git a/abs/core/udev/logitech-rules.patch b/abs/core/udev/logitech-rules.patch deleted file mode 100644 index fd0aea4..0000000 --- a/abs/core/udev/logitech-rules.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- - 2010-07-04 14:50:15.979139552 +0200 -+++ extras/hid2hci/70-hid2hci.rules 2010-07-03 21:03:40.685341704 +0200 -@@ -11,9 +11,9 @@ - RUN+="hid2hci --method=dell --devpath=%p", ENV{HID2HCI_SWITCH}="1" - - # Logitech devices (hidraw) --KERNEL=="hiddev*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c70[345bce]|c71[34bc]", \ -+KERNEL=="hiddev*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c70[345e]|c71[34]", \ - RUN+="hid2hci --method=logitech-hid --devpath=%p" --KERNEL=="hidraw*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c70a", \ -+KERNEL=="hidraw*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c70[abc]|c71[bc]", \ - RUN+="hid2hci --method=logitech-hid --devpath=%p" - - ENV{DEVTYPE}!="usb_device", GOTO="hid2hci_end" diff --git a/abs/core/udev/root-link.sh b/abs/core/udev/root-link.sh deleted file mode 100755 index 05273fe..0000000 --- a/abs/core/udev/root-link.sh +++ /dev/null @@ -1,7 +0,0 @@ -#! /bin/sh -# Creates root symlink in /dev -# for Arch Linux by Roman Kyrylych - -if ! [ -L /dev/root ]; then -ln -s $(cat /proc/cmdline | sed "s: :\n:g" | grep root= | sed "s:root=::") /dev/root -fi \ No newline at end of file diff --git a/abs/extra/community/lua/lua-5.1.3-official-patch3.diff b/abs/extra/community/lua/lua-5.1.3-official-patch3.diff deleted file mode 100644 index 8126ff5..0000000 --- a/abs/extra/community/lua/lua-5.1.3-official-patch3.diff +++ /dev/null @@ -1,21 +0,0 @@ ---- src/lapi.c (old) -+++ src/lapi.c (new) -@@ -93,15 +93,14 @@ - - - LUA_API int lua_checkstack (lua_State *L, int size) { -- int res; -+ int res = 1; - lua_lock(L); -- if ((L->top - L->base + size) > LUAI_MAXCSTACK) -+ if (size > LUAI_MAXCSTACK || (L->top - L->base + size) > LUAI_MAXCSTACK) - res = 0; /* stack overflow */ -- else { -+ else if (size > 0) { - luaD_checkstack(L, size); - if (L->ci->top < L->top + size) - L->ci->top = L->top + size; -- res = 1; - } - lua_unlock(L); - return res; diff --git a/abs/extra/community/lua/lua-5.1.3-official-patch4.diff b/abs/extra/community/lua/lua-5.1.3-official-patch4.diff deleted file mode 100644 index 1d03f37..0000000 --- a/abs/extra/community/lua/lua-5.1.3-official-patch4.diff +++ /dev/null @@ -1,18 +0,0 @@ ---- src/lbaselib.c (old) -+++ src/lbaselib.c (new) -@@ -344,10 +344,12 @@ - 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) return 0; /* empty range */ -- luaL_checkstack(L, n, "table too big to unpack"); -- for (; i<=e; i++) /* push arg[i...e] */ -+ 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; - } diff --git a/abs/extra/miro/ChangeLog b/abs/extra/miro/ChangeLog deleted file mode 100644 index 223b1de..0000000 --- a/abs/extra/miro/ChangeLog +++ /dev/null @@ -1,34 +0,0 @@ -2008-01-30 Eric Belanger - * miro-1.1-2 - * rebuilt against xulrunner 1.8.1.11 - -2008-01-16 Varun Acharya - - * upgpkg miro-1.1 - -2008-01-03 Varun Acharya - - * Adopted and moved to extra, miro-1.0-2 - -2007-11-26 Alessio 'mOLOk' Bolognino - - * miro-1.0-2 - * changed url - * added sqlite3 as dep (fix FS#8636) - -2007-11-13 Alessio 'mOLOk' Bolognino - - * miro-1.0-1 - * version bump - -2007-09-09 Alessio 'mOLOk' Bolognino - - * miro-0.9.9-1 - * version bump - -2007-08-08 Alessio 'mOLOk' Bolognino - - * miro-0.9.8.1-1 - * initial commit - - diff --git a/abs/extra/miro/Changelog b/abs/extra/miro/Changelog deleted file mode 100644 index 40505f2..0000000 --- a/abs/extra/miro/Changelog +++ /dev/null @@ -1,2 +0,0 @@ -Miro 2.0.4-3 4/30/09 -Upgrade miro.install to add remove miro from is.xml. diff --git a/abs/extra/miro/Miro-xulrunner.patch b/abs/extra/miro/Miro-xulrunner.patch deleted file mode 100644 index b8f4db3..0000000 --- a/abs/extra/miro/Miro-xulrunner.patch +++ /dev/null @@ -1,64 +0,0 @@ -diff -up Miro-1.2.3/platform/gtk-x11/platform/mozsetup.py.old Miro-1.2.3/platform/gtk-x11/platform/mozsetup.py ---- Miro-1.2.3/platform/gtk-x11/platform/mozsetup.py.old 2008-04-22 17:17:01.000000000 +0200 -+++ Miro-1.2.3/platform/gtk-x11/platform/mozsetup.py 2008-04-28 12:51:46.000000000 +0200 -@@ -106,8 +106,8 @@ def setupMozillaEnvironment(): - set_profile_path = gtkmozembed.gtk_moz_embed_set_profile_path - - set_profile_path(config.get(prefs.SUPPORT_DIRECTORY), 'mozilla') -- if hasattr(gtkmozembed, 'set_comp_path'): -- set_comp_path = gtkmozembed.set_comp_path -+ if hasattr(gtkmozembed, 'set_path'): -+ set_comp_path = gtkmozembed.set_path - elif hasattr(gtkmozembed, 'set_path'): - set_comp_path = gtkmozembed.set_path - else: -diff -up Miro-1.2.3/platform/gtk-x11/setup.py.old Miro-1.2.3/platform/gtk-x11/setup.py ---- Miro-1.2.3/platform/gtk-x11/setup.py.old 2008-04-22 17:17:01.000000000 +0200 -+++ Miro-1.2.3/platform/gtk-x11/setup.py 2008-04-28 13:14:27.000000000 +0200 -@@ -209,6 +209,7 @@ def parsePkgConfig(command, components, - options_dict = { - 'include_dirs' : [], - 'library_dirs' : [], -+ 'runtime_dirs' : [], - 'libraries' : [], - 'extra_compile_args' : [] - } -@@ -224,6 +225,11 @@ def parsePkgConfig(command, components, - options_dict['libraries'].append(rest) - else: - options_dict['extra_compile_args'].append(comp) -+ -+ commandLine = "%s --variable=libdir %s" % (command, components) -+ output = getCommandOutput(commandLine).strip() -+ options_dict['runtime_dirs'].append(output) -+ - return options_dict - - #### The fasttypes extension #### -@@ -279,6 +285,8 @@ mozilla_browser_options = parsePkgConfig - "gtk+-2.0 glib-2.0 pygtk-2.0 --define-variable=includetype=unstable %s %s" % (gtkmozembed, xpcom)) - mozilla_lib_path = parsePkgConfig('pkg-config', - '%s' % gtkmozembed)['library_dirs'] -+runtime_lib_path = parsePkgConfig('pkg-config', -+ '%s' % gtkmozembed)['runtime_dirs'] - # Find the base mozilla directory, and add the subdirs we need. - def allInDir(directory, subdirs): - for subdir in subdirs: -@@ -334,7 +342,7 @@ mozilla_browser_ext = Extension("miro.pl - os.path.join(platform_html_frontend_dir,'DragAndDrop.cc'), - os.path.join(platform_html_frontend_dir,'XPCOMUtil.cc'), - ], -- runtime_library_dirs=mozilla_lib_path, -+ runtime_library_dirs=runtime_lib_path, - **mozilla_browser_options) - #### Xlib Extension #### - xlib_ext = \ -@@ -434,7 +442,7 @@ class install_data (distutils.command.in - BUILD_MACHINE="%s@%s" % (getlogin(), - os.uname()[1]), - BUILD_TIME=str(time.time()), -- MOZILLA_LIB_PATH=mozilla_lib_path[0]) -+ MOZILLA_LIB_PATH=runtime_lib_path[0]) - self.outfiles.append(dest) - - locale_dir = os.path.join (resource_dir, "locale") diff --git a/abs/extra/miro/boost_1.36.0_fix.patch b/abs/extra/miro/boost_1.36.0_fix.patch deleted file mode 100644 index b3b5a48..0000000 --- a/abs/extra/miro/boost_1.36.0_fix.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- Miro-1.2.7/portable/libtorrent/src/torrent_info.cpp.old 2008-09-21 13:47:00.122974031 +0200 -+++ Miro-1.2.7/portable/libtorrent/src/torrent_info.cpp 2008-09-21 13:48:54.812965713 +0200 -@@ -352,7 +352,7 @@ - fs::path tmp = m_name; - if (tmp.is_complete()) throw std::runtime_error("torrent contains " - "a file with an absolute path: '" + m_name + "'"); -- if (tmp.has_branch_path()) throw std::runtime_error( -+ if (!tmp.branch_path().empty()) throw std::runtime_error( - "torrent contains name with directories: '" + m_name + "'"); - - // extract file list -@@ -556,7 +556,7 @@ - { - // TORRENT_ASSERT(file.begin() != file.end()); - -- if (!file.has_branch_path()) -+ if (file.branch_path().empty()) - { - // you have already added at least one file with a - // path to the file (branch_path), which means that - ---- Miro-1.2.7/portable/libtorrent/include/libtorrent/disk_io_thread.hpp.old 2008-09-21 13:57:05.433330334 +0200 -+++ Miro-1.2.7/portable/libtorrent/include/libtorrent/disk_io_thread.hpp 2008-09-21 13:57:29.060304305 +0200 -@@ -41,6 +41,7 @@ - #include - #include - #include -+#include - #include "libtorrent/config.hpp" - - namespace libtorrent - diff --git a/abs/extra/miro/miro-xine.patch b/abs/extra/miro/miro-xine.patch deleted file mode 100644 index 5abf5f1..0000000 --- a/abs/extra/miro/miro-xine.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- usr/bin/miro.old 2009-02-22 21:49:26.332356738 +0100 -+++ usr/bin/miro 2009-02-22 21:50:39.169010435 +0100 -@@ -21,7 +21,7 @@ - exit; - fi - -- LD_LIBRARY_PATH=/usr/lib/xulrunner-1.9 $GDB -ex 'set breakpoint pending on' -ex 'break gdk_x_error' -ex 'run' --args $PYTHON ./miro.real --sync "$@" -+ LD_LIBRARY_PATH=/usr/lib/xulrunner-1.9 $GDB -ex 'set breakpoint pending on' -ex 'break gdk_x_error' -ex 'run' --args $PYTHON ./miro.real --set xine-driver=opengl --sync "$@" - else -- LD_LIBRARY_PATH=/usr/lib/xulrunner-1.9 miro.real "$@" -+ LD_LIBRARY_PATH=/usr/lib/xulrunner-1.9 miro.real --set xine-driver=opengl "$@" - fi diff --git a/abs/extra/miro/miro.exec.patch b/abs/extra/miro/miro.exec.patch deleted file mode 100644 index 4b012af..0000000 --- a/abs/extra/miro/miro.exec.patch +++ /dev/null @@ -1,9 +0,0 @@ ---- usr/bin/miro.old 2009-04-14 19:40:09.578785938 +0200 -+++ usr/bin/miro 2009-04-14 19:40:34.445435006 +0200 -@@ -23,5 +23,5 @@ - - LD_LIBRARY_PATH=/usr/lib/xulrunner-1.9 $GDB -ex 'set breakpoint pending on' -ex 'run' --args $PYTHON ./miro.real --sync "$@" - else -- LD_LIBRARY_PATH=/usr/lib/xulrunner-1.9 miro.real "$@" -+ MOZILLA_FIVE_HOME="/usr/lib/xulrunner-1.9/" LD_LIBRARY_PATH=/usr/lib/xulrunner-1.9 miro.real "$@" - fi diff --git a/abs/extra/miro/miro_python26.patch b/abs/extra/miro/miro_python26.patch deleted file mode 100644 index f404a4e..0000000 --- a/abs/extra/miro/miro_python26.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- miro.real 2008-10-24 19:49:17.000000000 +0200 -+++ miro.real.new 2008-11-12 08:51:17.649458321 +0100 -@@ -6,8 +6,12 @@ - if xlibhelper.XInitThreads() == 0: - print "WARNING: XInitThreads() failed!" - --import os.path -+import miro.feedparser -+import miro.storedatabase - import sys -+sys.modules['feedparser'] = miro.feedparser -+sys.modules['storedatabase'] = miro.storedatabase -+import os.path - import optparse - - import pygtk diff --git a/abs/extra/miro/missing-headers.patch b/abs/extra/miro/missing-headers.patch deleted file mode 100644 index 7dc42b8..0000000 --- a/abs/extra/miro/missing-headers.patch +++ /dev/null @@ -1,33 +0,0 @@ -diff -ur a/portable/libtorrent/include/libtorrent/peer_id.hpp b/portable/libtorrent/include/libtorrent/peer_id.hpp ---- a/portable/libtorrent/include/libtorrent/peer_id.hpp 2008-04-22 10:17:04.000000000 -0500 -+++ b/portable/libtorrent/include/libtorrent/peer_id.hpp 2008-05-07 01:51:09.000000000 -0500 -@@ -38,6 +38,7 @@ - #include - #include - #include -+#include - - #include "libtorrent/config.hpp" - #include "libtorrent/assert.hpp" -diff -ur a/portable/libtorrent/src/entry.cpp b/portable/libtorrent/src/entry.cpp ---- a/portable/libtorrent/src/entry.cpp 2008-04-22 10:17:04.000000000 -0500 -+++ b/portable/libtorrent/src/entry.cpp 2008-05-07 02:16:14.000000000 -0500 -@@ -33,6 +33,7 @@ - #include "libtorrent/pch.hpp" - - #include -+#include - #include - #include "libtorrent/entry.hpp" - #include "libtorrent/config.hpp" -diff -ur a/portable/libtorrent/src/file.cpp b/portable/libtorrent/src/file.cpp ---- a/portable/libtorrent/src/file.cpp 2008-04-22 10:17:04.000000000 -0500 -+++ b/portable/libtorrent/src/file.cpp 2008-05-07 01:53:04.000000000 -0500 -@@ -68,6 +68,7 @@ - #include - #include "libtorrent/file.hpp" - #include -+#include - - #ifndef O_BINARY - #define O_BINARY 0 diff --git a/abs/extra/monitorix-linhes.tar.gz b/abs/extra/monitorix-linhes.tar.gz deleted file mode 100644 index 02ea6e2..0000000 Binary files a/abs/extra/monitorix-linhes.tar.gz and /dev/null differ diff --git a/abs/extra/xine-lib/xine-header.patch b/abs/extra/xine-lib/xine-header.patch deleted file mode 100644 index a37bfb9..0000000 --- a/abs/extra/xine-lib/xine-header.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- src/xine-engine/buffer.h 2008-07-16 23:01:56.000000000 +0200 -+++ src/xine-engine/buffer.h 2008-08-24 21:14:39.000000000 +0200 -@@ -676,7 +676,7 @@ - /* convert xine_waveformatex struct from little endian */ - void _x_waveformatex_le2me( xine_waveformatex *wavex ) XINE_PROTECTED; - --static inline _x_is_fourcc(void *ptr, void *tag) { -+static __inline _x_is_fourcc(void *ptr, void *tag) { - return memcmp(ptr, tag, 4) == 0; - } - diff --git a/abs/extra/xine-lib/xine-imagemagick.patch b/abs/extra/xine-lib/xine-imagemagick.patch deleted file mode 100644 index 9faa4ab..0000000 --- a/abs/extra/xine-lib/xine-imagemagick.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- xine-lib-1.1.15.orig/src/libxinevdec/image.c -+++ xine-lib-1.1.15/src/libxinevdec/image.c -@@ -110,7 +110,7 @@ - width = MagickGetImageWidth(wand) & ~1; /* must be even for init_yuv_planes */ - height = MagickGetImageHeight(wand); - img_buf = malloc(width * height * 3); -- MagickGetImagePixels(wand, 0, 0, width, height, "RGB", CharPixel, img_buf); -+ MagickGetAuthenticPixels(wand, 0, 0, width, height, "RGB", CharPixel, img_buf); - DestroyMagickWand(wand); - - _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_WIDTH, width); -- cgit v0.12