summaryrefslogtreecommitdiff
path: root/system
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2018-06-14 02:22:19 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2018-06-14 02:22:56 -0500
commitb1eb50599e4db7eb4501af75cbbfa22007081ea5 (patch)
treec94a34c882cc17adedd781e8c5f34349b2a62416 /system
parentb9e85bbdcf38547ef2ca4e5c2a6e6293bbcd2752 (diff)
downloadpackages-b1eb50599e4db7eb4501af75cbbfa22007081ea5.tar.gz
packages-b1eb50599e4db7eb4501af75cbbfa22007081ea5.tar.bz2
packages-b1eb50599e4db7eb4501af75cbbfa22007081ea5.tar.xz
packages-b1eb50599e4db7eb4501af75cbbfa22007081ea5.zip
The New Plan
all pkgs needed to bootstrap -> system others -> user
Diffstat (limited to 'system')
-rw-r--r--system/acl/APKBUILD58
-rw-r--r--system/adelie-base/APKBUILD3
-rw-r--r--system/apk-tools/0001-solver-allow-names-with-only-one-provider-to-be-auto.patch57
-rw-r--r--system/apk-tools/APKBUILD89
-rw-r--r--system/apk-tools/openssl-compat.patch11
-rw-r--r--system/automake/APKBUILD38
-rw-r--r--system/bison/APKBUILD41
-rw-r--r--system/bzip2/APKBUILD74
-rw-r--r--system/bzip2/CVE-2016-3189.patch12
-rw-r--r--system/bzip2/bzip2-1.0.2-progress.patch175
-rw-r--r--system/bzip2/bzip2-1.0.3-no-test.patch9
-rw-r--r--system/bzip2/bzip2-1.0.4-POSIX-shell.patch21
-rw-r--r--system/bzip2/bzip2-1.0.4-makefile-CFLAGS.patch25
-rw-r--r--system/bzip2/bzip2-1.0.4-man-links.patch12
-rw-r--r--system/bzip2/bzip2-1.0.6-saneso.patch13
-rw-r--r--system/cloog/APKBUILD52
-rw-r--r--system/cups-filters/APKBUILD67
-rw-r--r--system/cups/APKBUILD135
-rw-r--r--system/cups/cups-no-export-ssllibs.patch12
-rw-r--r--system/cups/cups.logrotate8
-rw-r--r--system/cups/cups.pre-install8
-rw-r--r--system/cups/cupsd.initd44
-rw-r--r--system/cups/default-config-no-gssapi.patch26
-rw-r--r--system/db/APKBUILD73
-rw-r--r--system/emacs/APKBUILD140
-rw-r--r--system/emacs/gamedir.patch11
-rw-r--r--system/fakeroot/APKBUILD62
-rw-r--r--system/fakeroot/busybox-getopt.patch14
-rw-r--r--system/fakeroot/fakeroot-hide-dlsym-errors.patch20
-rw-r--r--system/fakeroot/fakeroot-no-ldlibrarypath.patch80
-rw-r--r--system/fakeroot/fakeroot-no64.patch17
-rw-r--r--system/fakeroot/fakeroot-stdint.patch34
-rw-r--r--system/fakeroot/fakeroot-uclibc.patch20
-rw-r--r--system/fakeroot/xstatjunk.patch11
-rw-r--r--system/file/APKBUILD40
-rw-r--r--system/findutils/APKBUILD47
-rw-r--r--system/findutils/localename-test-fix.patch34
-rw-r--r--system/flex/APKBUILD44
-rw-r--r--system/fortify-headers/APKBUILD24
-rw-r--r--system/freetype/0001-Enable-table-validation-modules.patch34
-rw-r--r--system/freetype/0002-Enable-subpixel-rendering.patch25
-rw-r--r--system/freetype/0003-Enable-infinality-subpixel-hinting.patch27
-rw-r--r--system/freetype/0004-Enable-long-PCF-family-names.patch25
-rw-r--r--system/freetype/40-memcpy-fix.patch14
-rw-r--r--system/freetype/APKBUILD57
-rw-r--r--system/freetype/freetype-profile.sh12
-rw-r--r--system/gamin/APKBUILD58
-rw-r--r--system/gamin/fix-deprecated-const.patch56
-rw-r--r--system/gamin/fix-pthread-mutex.patch11
-rw-r--r--system/gmp/APKBUILD61
-rw-r--r--system/gmp/gmp-4.1.4-noexecstack.patch20
-rw-r--r--system/grep/APKBUILD52
-rw-r--r--system/grep/fix-tests.patch23
-rw-r--r--system/groff/APKBUILD39
-rw-r--r--system/gzip/APKBUILD52
-rw-r--r--system/isl/APKBUILD52
-rw-r--r--system/kbd/APKBUILD181
-rw-r--r--system/kbd/bkeymaps.patch14
-rw-r--r--system/kbd/error.h20
-rw-r--r--system/kbd/fix-tests.patch41
-rw-r--r--system/kbd/loadkeys.confd23
-rw-r--r--system/kbd/loadkeys.initd72
-rw-r--r--system/lddtree/APKBUILD28
-rw-r--r--system/less/APKBUILD40
-rw-r--r--system/libc-dev/APKBUILD59
-rw-r--r--system/libc-dev/sys-cdefs.h26
-rw-r--r--system/libc-dev/sys-queue.h846
-rw-r--r--system/libc-dev/sys-tree.h761
-rw-r--r--system/libcap-ng/APKBUILD48
-rw-r--r--system/libcap-ng/fix-includes.patch11
-rw-r--r--system/libcap/APKBUILD31
-rw-r--r--system/libevent/APKBUILD65
-rw-r--r--system/libevent/dont-test-fallback.patch16
-rw-r--r--system/libevent/fix-test-on-32bit.patch11
-rw-r--r--system/libevent/libressl.patch97
-rw-r--r--system/libevent/py3_dumpevents.patch30
-rw-r--r--system/libevent/py3_rpcgen.patch423
-rw-r--r--system/libpipeline/APKBUILD36
-rw-r--r--system/linux-headers/0001-libc-compat.h-fix-some-issues-arising-from-in6.h.patch89
-rw-r--r--system/linux-headers/0002-libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch59
-rw-r--r--system/linux-headers/0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch32
-rw-r--r--system/linux-headers/APKBUILD62
-rw-r--r--system/lvm2/APKBUILD133
-rw-r--r--system/lvm2/dmeventd.initd26
-rw-r--r--system/lvm2/fix-stdio-usage.patch49
-rw-r--r--system/lvm2/library_dir-default-config.patch10
-rw-r--r--system/lvm2/lvm.confd5
-rw-r--r--system/lvm2/lvm.initd38
-rw-r--r--system/lvm2/mallinfo.patch11
-rw-r--r--system/lvm2/mlockall-default-config.patch24
-rw-r--r--system/lzip/APKBUILD35
-rw-r--r--system/m4/APKBUILD41
-rw-r--r--system/m4/disable-mbrtowc-test.patch10
-rw-r--r--system/m4/localename-test-fix.patch34
-rw-r--r--system/make/APKBUILD44
-rw-r--r--system/make/fix-atexit-exit.patch17
-rw-r--r--system/man-db/APKBUILD50
-rw-r--r--system/man-db/man-db-2.7.5-iconv.patch75
-rw-r--r--system/man-db/man-db.trigger3
-rw-r--r--system/mawk/APKBUILD37
-rw-r--r--system/mesa/APKBUILD252
-rw-r--r--system/mesa/disk_cache-stack-overflow.patch42
-rw-r--r--system/mesa/drmdeps.patch41
-rw-r--r--system/mesa/glx_ro_text_segm.patch28
-rw-r--r--system/mesa/musl-fix-includes.patch14
-rw-r--r--system/mesa/musl-fixes.patch22
-rw-r--r--system/mesa/python3-compat.patch106
-rw-r--r--system/mpc1/APKBUILD46
-rw-r--r--system/mpfr3/APKBUILD45
-rw-r--r--system/ncurses/APKBUILD106
-rw-r--r--system/net-tools/APKBUILD98
-rw-r--r--system/net-tools/git.patch26170
-rw-r--r--system/net-tools/musl-fixes.patch94
-rw-r--r--system/patch/APKBUILD52
-rw-r--r--system/patch/CVE-2018-6951.patch29
-rw-r--r--system/pax-utils/APKBUILD42
-rw-r--r--system/pax-utils/fix-eitype.patch28
-rw-r--r--system/pkgconf/APKBUILD54
-rw-r--r--system/popt/APKBUILD42
-rw-r--r--system/postgresql/APKBUILD259
-rw-r--r--system/postgresql/conf-unix_socket_directories.patch14
-rw-r--r--system/postgresql/disable-broken-tests.patch119
-rw-r--r--system/postgresql/initdb.patch14
-rw-r--r--system/postgresql/perl-rpath.patch22
-rw-r--r--system/postgresql/pg-restore.confd16
-rw-r--r--system/postgresql/pg-restore.initd36
-rw-r--r--system/postgresql/pltcl_create_tables.sql13
-rw-r--r--system/postgresql/postgresql.confd59
-rw-r--r--system/postgresql/postgresql.initd220
-rw-r--r--system/postgresql/postgresql.pre-upgrade32
-rw-r--r--system/psmisc/APKBUILD63
-rw-r--r--system/psmisc/dont-underlink-peekfd.patch10
-rw-r--r--system/psmisc/fix-peekfd-on-ppc.patch19
-rw-r--r--system/psmisc/musl_ptregs.patch20
-rw-r--r--system/readline/APKBUILD71
-rw-r--r--system/readline/fix-ncurses-underlinking.patch11
-rw-r--r--system/shadow/APKBUILD110
-rw-r--r--system/shadow/dots-in-usernames.patch11
-rw-r--r--system/shadow/login.pamd6
-rw-r--r--system/shadow/pam-useradd.patch9
-rw-r--r--system/shadow/useradd-usergroups.patch8
-rw-r--r--system/sharutils/APKBUILD41
-rw-r--r--system/sysklogd/APKBUILD60
-rw-r--r--system/sysklogd/LICENSE16
-rw-r--r--system/sysklogd/fix-includes.patch122
-rw-r--r--system/sysklogd/ksym-fclose-fix.patch12
-rw-r--r--system/sysklogd/sysklogd-1.4.2-caen-owl-klogd-drop-root.patch162
-rw-r--r--system/sysklogd/sysklogd-1.4.2-caen-owl-syslogd-bind.patch103
-rw-r--r--system/sysklogd/sysklogd-1.4.2-caen-owl-syslogd-drop-root.patch118
-rw-r--r--system/sysklogd/sysklogd-1.5-build.patch20
-rw-r--r--system/sysklogd/sysklogd.confd6
-rwxr-xr-xsystem/sysklogd/sysklogd.daily91
-rw-r--r--system/sysklogd/sysklogd.initd76
-rw-r--r--system/sysklogd/sysklogd.logrotate6
-rw-r--r--system/sysklogd/syslog.conf48
-rw-r--r--system/unzip/10-unzip-handle-pkware-verify.patch21
-rw-r--r--system/unzip/20-unzip-uidgid-fix.patch29
-rw-r--r--system/unzip/APKBUILD43
-rw-r--r--system/unzip/unzip-6.0-heap-overflow-infloop.patch104
-rw-r--r--system/util-linux/APKBUILD169
-rw-r--r--system/util-linux/ttydefaults.h39
-rw-r--r--system/xz/APKBUILD49
-rw-r--r--system/zlib/APKBUILD40
163 files changed, 33149 insertions, 2721 deletions
diff --git a/system/acl/APKBUILD b/system/acl/APKBUILD
new file mode 100644
index 000000000..9aa00802f
--- /dev/null
+++ b/system/acl/APKBUILD
@@ -0,0 +1,58 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=acl
+pkgver=2.2.52
+pkgrel=4
+pkgdesc="Access control list utilities"
+url="https://savannah.nongnu.org/projects/acl"
+arch="all"
+license="LGPL-2.1-or-later AND GPL-2.0-or-later"
+depends=""
+makedepends_build="gzip"
+makedepends_host="attr-dev"
+makedepends="$makedepends_build $makedepends_host"
+subpackages="$pkgname-dev $pkgname-doc libacl"
+# depends on order of nftw, and requires test machine to have ACLs enabled on FS
+options="!check"
+source="http://download.savannah.nongnu.org/releases/acl/acl-$pkgver.src.tar.gz"
+
+prepare() {
+ cd "$builddir"
+ default_prepare
+ update_config_sub
+ sed -i \
+ -e '/^as_dummy=/s:=":="$PATH$PATH_SEPARATOR:' \
+ configure # hack PATH with AC_PATH_PROG
+ sed -i \
+ -e "/^PKG_DOC_DIR/s:@pkg_name@:$pkgname:" \
+ -e '/HAVE_ZIPPED_MANPAGES/s:=.*:=false:' \
+ include/builddefs.in
+}
+
+build() {
+ cd "$builddir"
+ unset PLATFORM
+ export OPTIMIZER="${CFLAGS}"
+ export DEBUG=-DNDEBUG
+ CONFIG_SHELL=/bin/sh ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --libdir=/lib \
+ --libexecdir=/usr/lib \
+ --disable-gettext
+ make
+}
+
+package() {
+ cd "$builddir"
+ make DIST_ROOT="$pkgdir" install install-lib install-dev
+ chown -R root:root "$pkgdir"/*
+}
+
+libacl() {
+ pkgdesc="Dynamic library for access control list support"
+ mkdir -p "$subpkgdir"/lib
+ mv "$pkgdir"/lib/libacl.so.* "$subpkgdir"/lib/
+}
+
+sha512sums="59973199d371cd0b2368e95bc829a1b47f04e808a174fefba4c6854e766158bd19a71d9dbcc8d6fdc1573a1f971cdda39c453f7fa243bce02c1ab97c6e7c72e7 acl-2.2.52.src.tar.gz"
diff --git a/system/adelie-base/APKBUILD b/system/adelie-base/APKBUILD
index a93781ccf..da2ae58a4 100644
--- a/system/adelie-base/APKBUILD
+++ b/system/adelie-base/APKBUILD
@@ -37,6 +37,9 @@ build() {
print($1 pw ":0:::::")
}' "$srcdir"/passwd > "$builddir"/tree/etc/shadow
chmod 640 "$builddir"/tree/etc/shadow
+ rm "$builddir"/tree/dev/.dirkeep
+ rm "$builddir"/tree/proc/.dirkeep
+ rm "$builddir"/tree/sys/.dirkeep
}
package() {
diff --git a/system/apk-tools/0001-solver-allow-names-with-only-one-provider-to-be-auto.patch b/system/apk-tools/0001-solver-allow-names-with-only-one-provider-to-be-auto.patch
new file mode 100644
index 000000000..107676e93
--- /dev/null
+++ b/system/apk-tools/0001-solver-allow-names-with-only-one-provider-to-be-auto.patch
@@ -0,0 +1,57 @@
+From 0dcbd933c8d3d305395a99b7b1690a187ce5ec8c Mon Sep 17 00:00:00 2001
+From: William Pitcock <nenolod@dereferenced.org>
+Date: Wed, 21 Feb 2018 15:35:53 +0000
+Subject: [PATCH] solver: allow names with only one provider to be autoselected
+ regardless of priority
+
+---
+ src/solver.c | 5 +++--
+ test/provides.repo | 9 ++++++++-
+ 2 files changed, 11 insertions(+), 3 deletions(-)
+
+diff --git a/src/solver.c b/src/solver.c
+index 91e5958..d27a7a3 100644
+--- a/src/solver.c
++++ b/src/solver.c
+@@ -671,11 +671,12 @@ static void select_package(struct apk_solver_state *ss, struct apk_name *name)
+ (!p->pkg->ss.iif_triggered ||
+ !p->pkg->ss.tag_ok))
+ continue;
+- /* Virtual packages without provider_priority cannot be autoselected */
++ /* Virtual packages without provider_priority cannot be autoselected,
++ * unless there is only one provider */
+ if (p->version == &apk_null_blob &&
+ p->pkg->name->auto_select_virtual == 0 &&
+ p->pkg->name->ss.requirers == 0 &&
+- p->pkg->provider_priority == 0)
++ (p->pkg->provider_priority == 0 && name->providers->num > 1))
+ continue;
+ if (compare_providers(ss, p, &chosen) > 0)
+ chosen = *p;
+diff --git a/test/provides.repo b/test/provides.repo
+index 58bd416..358151e 100644
+--- a/test/provides.repo
++++ b/test/provides.repo
+@@ -82,7 +82,7 @@ P:conflicted-provider-b
+ V:0.1
+ S:1
+ I:1
+-p:conflicted-provider
++p:conflicted-provider conflicted-provider-2
+
+ C:Q1EyN5AdpAOBJWKMR89ppC66ccccj=
+ P:conflicted-dep
+@@ -104,3 +104,10 @@ V:0.1
+ S:1
+ I:1
+ p:self-provide
++
++C:Q1EyN5AdpAOBJWKMR89ppC66eeeej=
++P:conflicted-dep-2
++V:0.1
++S:1
++I:1
++D:conflicted-provider-2
+--
+2.16.1
+
diff --git a/system/apk-tools/APKBUILD b/system/apk-tools/APKBUILD
new file mode 100644
index 000000000..225d4c2f9
--- /dev/null
+++ b/system/apk-tools/APKBUILD
@@ -0,0 +1,89 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=apk-tools
+pkgver=2.9.1
+pkgrel=1
+pkgdesc="Alpine Package Keeper - package manager for alpine"
+subpackages="$pkgname-static"
+depends=
+makedepends_build=""
+makedepends_host="zlib-dev libressl libressl-dev linux-headers"
+makedepends="$makedepends_build $makedepends_host"
+if [ "$CBUILD" = "$CHOST" ]; then
+ subpackages="$subpackages lua5.2-apk:luaapk"
+ makedepends="$makedepends lua5.2-dev"
+fi
+source="http://dev.alpinelinux.org/archive/$pkgname/$pkgname-$pkgver.tar.xz
+ 0001-solver-allow-names-with-only-one-provider-to-be-auto.patch
+ openssl-compat.patch
+ "
+
+url="https://git.alpinelinux.org/cgit/apk-tools/"
+arch="all"
+license=GPL2
+
+builddir="$srcdir/$pkgname-$pkgver"
+prepare() {
+ default_prepare || return 1
+ cd "$builddir"
+ sed -i -e 's:-Werror::' Make.rules
+ echo "FULL_VERSION=$pkgver-r$pkgrel" > config.mk || return 1
+ if [ "$CBUILD" = "$CHOST" ]; then
+ echo "LUAAPK=YesPlease" >> config.mk
+ else
+ echo "LUAAPK=" >> config.mk
+ fi
+ echo "export LUAAPK" >> config.mk
+}
+
+build() {
+ cd "$builddir"
+ make || return 1
+ make static || return 1
+}
+
+check() {
+ cd "$builddir"
+ make check
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+ install -d "$pkgdir"/var/lib/apk \
+ "$pkgdir"/var/cache/misc \
+ "$pkgdir"/etc/apk/keys \
+ "$pkgdir"/etc/apk/protected_paths.d \
+ || return 1
+ # the shipped README is empty
+ rm -r "$pkgdir"/usr/share/
+}
+
+static() {
+ pkgdesc="Alpine Package Keeper - static binary"
+ install -Dm755 "$srcdir"/$pkgname-$pkgver/src/apk.static \
+ "$subpkgdir"/sbin/apk.static
+
+ # lets sign the static binary so it can be vefified from distros
+ # that does not have apk-tools
+ local abuild_conf=${ABUILD_CONF:-"/etc/abuild.conf"}
+ local abuild_home=${ABUILD_USERDIR:-"$HOME/.abuild"}
+ local abuild_userconf=${ABUILD_USERCONF:-"$abuild_home/abuild.conf"}
+ [ -f "$abuild_userconf" ] && . "$abuild_userconf"
+ local privkey="$PACKAGER_PRIVKEY"
+ local pubkey=${PACKAGER_PUBKEY:-"${privkey}.pub"}
+ local keyname=${pubkey##*/}
+ ${CROSS_COMPILE}strip "$subpkgdir"/sbin/apk.static
+ openssl dgst -sha1 -sign "$privkey" \
+ -out "$subpkgdir"/sbin/apk.static.SIGN.RSA.$keyname \
+ "$subpkgdir"/sbin/apk.static || return 1
+}
+
+luaapk() {
+ pkgdesc="Lua module for apk-tools"
+ mkdir -p "$subpkgdir"/usr/
+ mv "$pkgdir"/usr/lib "$subpkgdir"/usr/lib/
+}
+
+sha512sums="4ffb8d1716bbb94421b1cc4277beb47d369c429f4c3bf597d08949abb7586d30c4504edf2f775bea3b93614a280c12391b956ca8f914fb0ec27799a4a005a145 apk-tools-2.9.1.tar.xz
+5ca2d2f2646032ed8f9f86357e986b054045a80ddb944be6a540566ff7092f38591ec8dfc7ac06b9daededa95e86c0e892ead55f9e8907eb318aed76644f7f97 0001-solver-allow-names-with-only-one-provider-to-be-auto.patch
+5640b746cd3c6d966d5f778ffe2307902503b1fc966bedb35b50dedee34ec3d5fe2c7f200dfd3893d6640150ff6dd4efd2df9aa110b4a7fd162b84904dacb493 openssl-compat.patch"
diff --git a/system/apk-tools/openssl-compat.patch b/system/apk-tools/openssl-compat.patch
new file mode 100644
index 000000000..cdafefd05
--- /dev/null
+++ b/system/apk-tools/openssl-compat.patch
@@ -0,0 +1,11 @@
+--- apk-tools-2.8.1/libfetch/common.c.old 2017-10-27 08:12:05.000000000 -0500
++++ apk-tools-2.8.1/libfetch/common.c 2017-11-11 22:37:18.661697875 -0600
+@@ -504,7 +504,7 @@
+
+ SSL_load_error_strings();
+
+- conn->ssl_meth = TLS_client_method();
++ conn->ssl_meth = SSLv23_client_method();
+ conn->ssl_ctx = SSL_CTX_new(conn->ssl_meth);
+ SSL_CTX_set_mode(conn->ssl_ctx, SSL_MODE_AUTO_RETRY);
+
diff --git a/system/automake/APKBUILD b/system/automake/APKBUILD
new file mode 100644
index 000000000..aa96c60b0
--- /dev/null
+++ b/system/automake/APKBUILD
@@ -0,0 +1,38 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=automake
+pkgver=1.15.1
+pkgrel=1
+pkgdesc="A GNU tool for automatically creating Makefiles"
+url="https://www.gnu.org/software/automake"
+arch="noarch"
+license="GPL-2.0-or-later MIT Public-Domain"
+depends="perl"
+makedepends="autoconf"
+checkdepends="bash gzip coreutils diffutils"
+subpackages="$pkgname-doc"
+source="ftp://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.gz"
+builddir="$srcdir/$pkgname-$pkgver"
+
+# many tests have bashisms
+options="!check"
+
+build() {
+ cd "$builddir"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr
+ make
+}
+
+check() {
+ cd "$builddir"
+ make check
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR=$pkgdir install
+}
+
+sha512sums="f0d4717ebe2c76cec5d487de090f6e1c0f784b0d382fd964ffa846287e2a364a52531a26ab98b7033ac04ed302a247b3b114299def54819a03439bfc962ff61b automake-1.15.1.tar.gz"
diff --git a/system/bison/APKBUILD b/system/bison/APKBUILD
new file mode 100644
index 000000000..382b04743
--- /dev/null
+++ b/system/bison/APKBUILD
@@ -0,0 +1,41 @@
+# Contributor: Łukasz Jendrysik <scadu@yandex.com>
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=bison
+pkgver=3.0.4
+pkgrel=1
+pkgdesc="The GNU general-purpose parser generator"
+arch="all"
+license="GPL-3.0-or-later"
+url="https://www.gnu.org/software/bison/bison.html"
+makedepends="perl"
+depends="m4"
+checkdepends="bison flex"
+[ -n "$BOOTSTRAP" ] && options="!check"
+source="ftp://ftp.gnu.org/gnu/bison/${pkgname}-${pkgver}.tar.xz"
+subpackages="$pkgname-doc"
+
+build() {
+ cd "$builddir"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --datadir=/usr/share \
+ --infodir=/usr/share/info \
+ --mandir=/usr/share/man
+ make
+}
+
+check() {
+ cd "$builddir"
+ make check
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+ rm -rf "$pkgdir"/usr/lib/charset.alias
+ rmdir -p "$pkgdir"/usr/lib 2>/dev/null || true
+}
+
+sha512sums="bbdc23e7772e49da1c7c47e66d4e4efbfbfe9b21dbc59bf3ad9a6e573eecac6c9f52c7f11a64be9897e8deb99ef7ba015164aa8232aa391b901dd7db03632412 bison-3.0.4.tar.xz"
diff --git a/system/bzip2/APKBUILD b/system/bzip2/APKBUILD
new file mode 100644
index 000000000..aa73e70ab
--- /dev/null
+++ b/system/bzip2/APKBUILD
@@ -0,0 +1,74 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=bzip2
+pkgver=1.0.6
+pkgrel=6
+pkgdesc="A high-quality data compression program"
+url="http://sources.redhat.com/bzip2"
+arch="all"
+license="BSD"
+depends=""
+subpackages="$pkgname-dev $pkgname-doc libbz2"
+source="http://www.bzip.org/$pkgver/$pkgname-$pkgver.tar.gz
+ bzip2-1.0.4-makefile-CFLAGS.patch
+ bzip2-1.0.6-saneso.patch
+ bzip2-1.0.4-man-links.patch
+ bzip2-1.0.2-progress.patch
+ bzip2-1.0.3-no-test.patch
+ bzip2-1.0.4-POSIX-shell.patch
+ CVE-2016-3189.patch
+ "
+
+# secfixes:
+# 1.0.6-r5:
+# - CVE-2016-3189
+
+builddir="$srcdir"/$pkgname-$pkgver
+prepare() {
+ default_prepare
+
+ # Fix man path
+ # Generate relative symlinks
+ sed -i \
+ -e 's:\$(PREFIX)/man:\$(PREFIX)/share/man:g' \
+ -e 's:ln -s -f $(PREFIX)/bin/:ln -s :' \
+ Makefile
+
+ # fixup broken version stuff
+ sed -i \
+ -e "s:1\.0\.4:$pkgver:" \
+ bzip2.1 bzip2.txt Makefile-libbz2_so manual.*
+}
+
+build () {
+ cd "$builddir"
+ make -f Makefile-libbz2_so all
+ make all
+}
+
+check() {
+ cd "$builddir"
+ make check
+}
+
+package() {
+ cd "$builddir"
+ make PREFIX="$pkgdir"/usr install
+ install -D libbz2.so.$pkgver "$pkgdir"/usr/lib/libbz2.so.$pkgver
+ ln -s libbz2.so.$pkgver "$pkgdir"/usr/lib/libbz2.so
+ ln -s libbz2.so.$pkgver "$pkgdir"/usr/lib/libbz2.so.${pkgver%%.*}
+}
+
+libbz2() {
+ pkgdesc="Shared library for bz2"
+ mkdir -p "$subpkgdir"/usr/lib
+ mv "$pkgdir"/usr/lib/*.so.* "$subpkgdir"/usr/lib/
+}
+
+sha512sums="00ace5438cfa0c577e5f578d8a808613187eff5217c35164ffe044fbafdfec9e98f4192c02a7d67e01e5a5ccced630583ad1003c37697219b0f147343a3fdd12 bzip2-1.0.6.tar.gz
+58cc37430555520b6e35db2740e699cf37eacdd82989c21a222a593e36288710a0defb003662d4238235c12b3764bfc89cd646e6be9d0a08d54bd2c9baa6ad15 bzip2-1.0.4-makefile-CFLAGS.patch
+8a7528b5b931bb72f637c6940bc811d54fb816fd5bb453af56d9b4a87091004eb5e191ba799d972794b24c56cf8134344a618b58946d3f1d985c508f88190845 bzip2-1.0.6-saneso.patch
+2d9a306bc0f552a58916ebc702d32350a225103c487e070d2082121a54e07f1813d3228f43293cc80a4bee62053fd597294c99a1751b1685cd678f4e5c6a2fe7 bzip2-1.0.4-man-links.patch
+b6810c73428f17245e0d7c2decd00c88986cd8ad1cfe4982defe34bdab808d53870ed92cb513b2d00c15301747ceb6ca958fb0e0458d0663b7d8f7c524f7ba4e bzip2-1.0.2-progress.patch
+aefcafaaadc7f19b20fe023e0bd161127b9f32e0cd364621f6e5c03e95fb976e7e69e354ec46673a554392519532a3bfe56d982a5cde608c10e0b18c3847a030 bzip2-1.0.3-no-test.patch
+64ab461bf739c29615383750e7f260abb2d49df7eb23916940d512bd61fd9a37aaade4d8f6f94280c95fc781b8f92587ad4f3dda51e87dec7a92a7a6f8d8ae86 bzip2-1.0.4-POSIX-shell.patch
+cef6f448b661a775cc433f9636730e89c1285d07075536217657056be56e0a11e96f41f7c14f6ec59e235464b9ddd649a71fb8de1c60eda2fd5c2cdfbb6a8fdc CVE-2016-3189.patch"
diff --git a/system/bzip2/CVE-2016-3189.patch b/system/bzip2/CVE-2016-3189.patch
new file mode 100644
index 000000000..6622670c9
--- /dev/null
+++ b/system/bzip2/CVE-2016-3189.patch
@@ -0,0 +1,12 @@
+diff --git a/bzip2recover.c b/bzip2recover.c
+index f9de049..d159c92 100644
+--- a/bzip2recover.c
++++ b/bzip2recover.c
+@@ -457,6 +457,7 @@ Int32 main ( Int32 argc, Char** argv )
+ bsPutUChar ( bsWr, 0x50 ); bsPutUChar ( bsWr, 0x90 );
+ bsPutUInt32 ( bsWr, blockCRC );
+ bsClose ( bsWr );
++ outFile = NULL;
+ }
+ if (wrBlock >= rbCtr) break;
+ wrBlock++;
diff --git a/system/bzip2/bzip2-1.0.2-progress.patch b/system/bzip2/bzip2-1.0.2-progress.patch
new file mode 100644
index 000000000..2f389cfac
--- /dev/null
+++ b/system/bzip2/bzip2-1.0.2-progress.patch
@@ -0,0 +1,175 @@
+Ripped from Mandrake.
+
+http://bugs.gentoo.org/show_bug.cgi?id=82192
+
+--- bzip2-1.0.2.org/bzip2.1
++++ bzip2-1.0.2/bzip2.1
+@@ -235,6 +235,10 @@
+ Suppress non-essential warning messages. Messages pertaining to
+ I/O errors and other critical events will not be suppressed.
+ .TP
++.B \-p --show-progress
++Show percentage of input-file done and while compressing show the percentage
++of the original file the new file is.
++.TP
+ .B \-v --verbose
+ Verbose mode -- show the compression ratio for each file processed.
+ Further \-v's increase the verbosity level, spewing out lots of
+--- bzip2-1.0.2.org/bzip2.c
++++ bzip2-1.0.2/bzip2.c
+@@ -145,6 +145,7 @@
+ #include <signal.h>
+ #include <math.h>
+ #include <errno.h>
++#include <time.h>
+ #include <ctype.h>
+ #include "bzlib.h"
+
+@@ -301,6 +302,7 @@
+ Char progNameReally[FILE_NAME_LEN];
+ FILE *outputHandleJustInCase;
+ Int32 workFactor;
++Char showProgress;
+
+ static void panic ( Char* ) NORETURN;
+ static void ioError ( void ) NORETURN;
+@@ -425,6 +427,12 @@
+ UInt32 nbytes_in_lo32, nbytes_in_hi32;
+ UInt32 nbytes_out_lo32, nbytes_out_hi32;
+ Int32 bzerr, bzerr_dummy, ret;
++ double fileSize = 0; /* initialized to make the compiler stop crying */
++ /* double because big files might otherwhise give
++ * overflows. not long long since not all compilers
++ * support that one
++ */
++ time_t startTime, currentTime;
+
+ SET_BINARY_MODE(stream);
+ SET_BINARY_MODE(zStream);
+@@ -432,12 +440,21 @@
+ if (ferror(stream)) goto errhandler_io;
+ if (ferror(zStream)) goto errhandler_io;
+
++ if ((srcMode == SM_F2F || srcMode == SM_F2O) && showProgress == True) {
++ (void)fseek(stream, 0, SEEK_END);
++ fileSize = (double)ftell(stream);
++ rewind(stream);
++ if (verbosity >= 1)
++ fprintf(stderr, "Input-file size: %ld\n", (long)fileSize);
++ }
++
+ bzf = BZ2_bzWriteOpen ( &bzerr, zStream,
+ blockSize100k, verbosity, workFactor );
+ if (bzerr != BZ_OK) goto errhandler;
+
+ if (verbosity >= 2) fprintf ( stderr, "\n" );
+
++ time(&startTime);
+ while (True) {
+
+ if (myfeof(stream)) break;
+@@ -446,13 +463,32 @@
+ if (nIbuf > 0) BZ2_bzWrite ( &bzerr, bzf, (void*)ibuf, nIbuf );
+ if (bzerr != BZ_OK) goto errhandler;
+
++ if ((srcMode == SM_F2F || srcMode == SM_F2O) && showProgress == True)
++ {
++ time(&currentTime);
++
++ if ((currentTime - startTime) > 1) { /* show progress every 2 seconds */
++ double curInPos = (double)ftell(stream);
++ double curOutPos = (double)ftell(zStream);
++
++ startTime = currentTime;
++
++ fprintf(stderr, "%.2f%% done", (curInPos * 100.0) / fileSize);
++ if (srcMode == SM_F2F)
++ {
++ fprintf(stderr, ", new size: %.2f%%", (curOutPos * 100.0) / curInPos);
++ }
++
++ fprintf(stderr, " \r");
++ }
++ }
+ }
+
+ BZ2_bzWriteClose64 ( &bzerr, bzf, 0,
+ &nbytes_in_lo32, &nbytes_in_hi32,
+ &nbytes_out_lo32, &nbytes_out_hi32 );
+ if (bzerr != BZ_OK) goto errhandler;
+-
++
+ if (ferror(zStream)) goto errhandler_io;
+ ret = fflush ( zStream );
+ if (ret == EOF) goto errhandler_io;
+@@ -526,6 +562,8 @@
+ UChar unused[BZ_MAX_UNUSED];
+ Int32 nUnused;
+ UChar* unusedTmp;
++ double fileSize = 0; /* initialized to make the compiler stop crying */
++ time_t startTime, currentTime;
+
+ nUnused = 0;
+ streamNo = 0;
+@@ -533,9 +571,19 @@
+ SET_BINARY_MODE(stream);
+ SET_BINARY_MODE(zStream);
+
++ if ((srcMode == SM_F2F || srcMode == SM_F2O) && showProgress == True) {
++ long dummy = ftell(zStream);
++ (void)fseek(zStream, 0, SEEK_END);
++ fileSize = (double)ftell(zStream);
++ (void)fseek(zStream, dummy, SEEK_SET);
++ if (verbosity >= 1)
++ fprintf(stderr, "Input-file size: %ld\n", (long)fileSize);
++ }
++
+ if (ferror(stream)) goto errhandler_io;
+ if (ferror(zStream)) goto errhandler_io;
+
++ time(&startTime);
+ while (True) {
+
+ bzf = BZ2_bzReadOpen (
+@@ -551,6 +599,17 @@
+ if ((bzerr == BZ_OK || bzerr == BZ_STREAM_END) && nread > 0)
+ fwrite ( obuf, sizeof(UChar), nread, stream );
+ if (ferror(stream)) goto errhandler_io;
++
++ if ((srcMode == SM_F2F || srcMode == SM_F2O) && showProgress == True) {
++ time(&currentTime);
++ if ((currentTime - startTime) >= 2)
++ {
++ double curInPos = (double)ftell(zStream);
++ startTime = currentTime;
++
++ fprintf(stderr, "%.2f%% done\r", (curInPos * 100.0) / fileSize);
++ }
++ }
+ }
+ if (bzerr != BZ_STREAM_END) goto errhandler;
+
+@@ -1872,6 +1931,7 @@
+ deleteOutputOnInterrupt = False;
+ exitValue = 0;
+ i = j = 0; /* avoid bogus warning from egcs-1.1.X */
++ showProgress = False;
+
+ /*-- Set up signal handlers for mem access errors --*/
+ signal (SIGSEGV, mySIGSEGVorSIGBUScatcher);
+@@ -1949,6 +2009,7 @@
+ case 'k': keepInputFiles = True; break;
+ case 's': smallMode = True; break;
+ case 'q': noisy = False; break;
++ case 'p': showProgress = True; break;
+ case '1': blockSize100k = 1; break;
+ case '2': blockSize100k = 2; break;
+ case '3': blockSize100k = 3; break;
+@@ -1985,6 +2046,7 @@
+ if (ISFLAG("--keep")) keepInputFiles = True; else
+ if (ISFLAG("--small")) smallMode = True; else
+ if (ISFLAG("--quiet")) noisy = False; else
++ if (ISFLAG("--show-progress")) showProgress = True; else
+ if (ISFLAG("--version")) license(); else
+ if (ISFLAG("--license")) license(); else
+ if (ISFLAG("--exponential")) workFactor = 1; else
diff --git a/system/bzip2/bzip2-1.0.3-no-test.patch b/system/bzip2/bzip2-1.0.3-no-test.patch
new file mode 100644
index 000000000..fc876d504
--- /dev/null
+++ b/system/bzip2/bzip2-1.0.3-no-test.patch
@@ -0,0 +1,9 @@
+--- ./Makefile
++++ ./Makefile
+@@ -23,5 +23,5 @@
+ bzlib.o
+
+-all: libbz2.a bzip2 bzip2recover test
++all: libbz2.a bzip2 bzip2recover
+
+ bzip2: libbz2.a bzip2.o
diff --git a/system/bzip2/bzip2-1.0.4-POSIX-shell.patch b/system/bzip2/bzip2-1.0.4-POSIX-shell.patch
new file mode 100644
index 000000000..a5916eaff
--- /dev/null
+++ b/system/bzip2/bzip2-1.0.4-POSIX-shell.patch
@@ -0,0 +1,21 @@
+bzgrep uses !/bin/sh but then uses the bashism ${var//} so replace those
+with calls to sed so POSIX shells work
+
+http://bugs.gentoo.org/193365
+
+--- ./bzgrep
++++ ./bzgrep
+@@ -63,10 +63,9 @@
+ bzip2 -cdfq "$i" | $grep $opt "$pat"
+ r=$?
+ else
+- j=${i//\\/\\\\}
+- j=${j//|/\\|}
+- j=${j//&/\\&}
+- j=`printf "%s" "$j" | tr '\n' ' '`
++ # the backslashes here are doubled up as we have to escape each one for the
++ # shell and then escape each one for the sed expression
++ j=`printf "%s" "${i}" | sed -e 's:\\\\:\\\\\\\\:g' -e 's:[|]:\\\\|:g' -e 's:[&]:\\\\&:g' | tr '\n' ' '`
+ bzip2 -cdfq "$i" | $grep $opt "$pat" | sed "s|^|${j}:|"
+ r=$?
+ fi
diff --git a/system/bzip2/bzip2-1.0.4-makefile-CFLAGS.patch b/system/bzip2/bzip2-1.0.4-makefile-CFLAGS.patch
new file mode 100644
index 000000000..cf146188c
--- /dev/null
+++ b/system/bzip2/bzip2-1.0.4-makefile-CFLAGS.patch
@@ -0,0 +1,25 @@
+--- ./Makefile
++++ ./Makefile
+@@ -18,10 +18,9 @@
+ CC=gcc
+ AR=ar
+ RANLIB=ranlib
+-LDFLAGS=
+
+ BIGFILES=-D_FILE_OFFSET_BITS=64
+-CFLAGS=-Wall -Winline -O2 -g $(BIGFILES)
++CFLAGS+=-Wall -Winline $(BIGFILES) $(CPPFLAGS)
+
+ # Where you want it installed when you do 'make install'
+ PREFIX=/usr/local
+--- ./Makefile-libbz2_so
++++ ./Makefile-libbz2_so
+@@ -24,7 +24,7 @@
+ SHELL=/bin/sh
+ CC=gcc
+ BIGFILES=-D_FILE_OFFSET_BITS=64
+-CFLAGS=-fpic -fPIC -Wall -Winline -O2 -g $(BIGFILES)
++CFLAGS+=-fpic -fPIC -Wall -Winline $(BIGFILES) $(CPPFLAGS)
+
+ OBJS= blocksort.o \
+ huffman.o \
diff --git a/system/bzip2/bzip2-1.0.4-man-links.patch b/system/bzip2/bzip2-1.0.4-man-links.patch
new file mode 100644
index 000000000..2427d6a7f
--- /dev/null
+++ b/system/bzip2/bzip2-1.0.4-man-links.patch
@@ -0,0 +1,12 @@
+http://bugs.gentoo.org/172986
+
+--- bzip2-1.0.4/Makefile
++++ bzip2-1.0.4/Makefile
+@@ -85,4 +85,7 @@
+ cp -f bzip2.1 $(PREFIX)/share/man/man1
+ chmod a+r $(PREFIX)/share/man/man1/bzip2.1
++ ln -s bzip2.1 $(PREFIX)/share/man/man1/bunzip2.1
++ ln -s bzip2.1 $(PREFIX)/share/man/man1/bzcat.1
++ ln -s bzip2.1 $(PREFIX)/share/man/man1/bzip2recover.1
+ cp -f bzlib.h $(PREFIX)/include
+ chmod a+r $(PREFIX)/include/bzlib.h
diff --git a/system/bzip2/bzip2-1.0.6-saneso.patch b/system/bzip2/bzip2-1.0.6-saneso.patch
new file mode 100644
index 000000000..1968a63bf
--- /dev/null
+++ b/system/bzip2/bzip2-1.0.6-saneso.patch
@@ -0,0 +1,13 @@
+--- ./Makefile-libbz2_so
++++ ./Makefile-libbz2_so
+@@ -35,8 +35,8 @@
+ bzlib.o
+
+ all: $(OBJS)
+- $(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.6 $(OBJS)
+- $(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.6
++ $(CC) $(LDFLAGS) -shared -Wl,-soname -Wl,libbz2.so.1 -o libbz2.so.1.0.6 $(OBJS)
++ $(CC) $(LDFLAGS) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.6
+ rm -f libbz2.so.1.0
+ ln -s libbz2.so.1.0.6 libbz2.so.1.0
+
diff --git a/system/cloog/APKBUILD b/system/cloog/APKBUILD
new file mode 100644
index 000000000..d39df3ba4
--- /dev/null
+++ b/system/cloog/APKBUILD
@@ -0,0 +1,52 @@
+# Contributor: Natanael Copa <ncopa@alpinelinux.org>
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=cloog
+pkgver=0.18.4
+pkgrel=1
+pkgdesc="The Chunky Loop Generator"
+url="http://www.cloog.org/"
+arch="all"
+license="GPL-2.0-or-later"
+depends=""
+depends_dev="gmp-dev isl-dev"
+makedepends_host="$depends_dev"
+makedepends="$makedepends_host"
+install=""
+subpackages="$pkgname-dev"
+source="http://www.bastoul.net/cloog/pages/download/$pkgname-$pkgver.tar.gz"
+
+_builddir="$srcdir"/$pkgname-$pkgver
+prepare() {
+ local i
+ cd "$_builddir"
+ for i in $source; do
+ case $i in
+ *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+ esac
+ done
+}
+
+build() {
+ cd "$_builddir"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ --localstatedir=/var \
+ --with-sysroot=${CBUILDROOT} \
+ --with-isl=system \
+ || return 1
+ make || return 1
+}
+
+package() {
+ cd "$_builddir"
+ make DESTDIR="$pkgdir" INSTALL="install -D" install || return 1
+}
+
+md5sums="e531f725244856c92c9bba009ff44faf cloog-0.18.4.tar.gz"
+sha256sums="325adf3710ce2229b7eeb9e84d3b539556d093ae860027185e7af8a8b00a750e cloog-0.18.4.tar.gz"
+sha512sums="d35d67b08ffe13c1a010b65bfe4dd02b0ae013d5b489e330dc950bd3514defca8f734bd37781856dcedf0491ff6122c34eecb4b0fe32a22d7e6bdadea98c8c23 cloog-0.18.4.tar.gz"
diff --git a/system/cups-filters/APKBUILD b/system/cups-filters/APKBUILD
deleted file mode 100644
index 66c662d11..000000000
--- a/system/cups-filters/APKBUILD
+++ /dev/null
@@ -1,67 +0,0 @@
-# Maintainer: Max Rees <maxcrees@me.com>
-pkgname=cups-filters
-pkgver=1.20.3
-pkgrel=0
-pkgdesc="OpenPrinting CUPS filters and backends"
-url="http://www.linuxfoundation.org/collaborate/workgroups/openprinting/pdf_as_standard_print_job_format"
-arch="all"
-license="GPL-2.0 and GPL-2.0-or-later and GPL-3.0 and MIT"
-depends="poppler-utils bc ttf-freefont"
-makedepends="cups-dev libjpeg-turbo-dev poppler-dev zlib-dev libpng-dev
- tiff-dev lcms2-dev freetype-dev fontconfig-dev qpdf-dev dbus-dev linux-headers
- coreutils gnutls-dev python3"
-checkdepends="ttf-dejavu"
-subpackages="$pkgname-dev $pkgname-doc $pkgname-libs"
-source="http://www.openprinting.org/download/cups-filters/cups-filters-$pkgver.tar.xz"
-builddir="$srcdir/cups-filters-$pkgver"
-
-build() {
- cd "$builddir"
- ./configure \
- --build=$CBUILD \
- --host=$CHOST \
- --prefix=/usr \
- --sysconfdir=/etc \
- --mandir=/usr/share/man \
- --infodir=/usr/share/info \
- --localstatedir=/var \
- --disable-static \
- --with-pdftops=pdftops \
- --with-shell=/bin/sh \
- --without-rcdir \
- --without-rclevels \
- --disable-avahi \
- --disable-ghostscript \
- --disable-mutool \
- --with-test-font-path='/usr/share/fonts/ttf-dejavu/DejaVuSans.ttf'
- # workaround parallel build issue by building libcupsfilters.la first
- make libcupsfilters.la && make libfontembed.la && make
-}
-
-check() {
- cd "$builddir"
- make check
-}
-
-package() {
- cd "$builddir"
- make -j1 DESTDIR="$pkgdir" install
- # the pdf.utf-8 symlink isn't quite good enough
- cd "$pkgdir"/usr/share/cups/charsets && \
- ln -s pdf.utf-8.simple pdf.UTF-8
-}
-
-dev() {
- default_dev
- # cupsfilters.drv needs pcl.h
- install -Dm644 "$builddir"/filter/pcl.h \
- "$pkgdir"/usr/share/cups/ppdc/pcl.h
-}
-
-libs() {
- pkgdesc="OpenPrinting CUPS filters and backends - cupsfilters and fontembed libraries"
- install -d "$subpkgdir"/usr/lib
- mv "$pkgdir"/usr/lib/lib*.so.* "$subpkgdir"/usr/lib/
-}
-
-sha512sums="402a53bf1ea12b14e6f8aa46f8f5e91b2caf9da3a8f14759568b5a45b9309f379fec542c843da5560cbcec2c4860babfee7e9c2f0c62f5fa6254025e9d867b31 cups-filters-1.20.3.tar.xz"
diff --git a/system/cups/APKBUILD b/system/cups/APKBUILD
deleted file mode 100644
index 39178391c..000000000
--- a/system/cups/APKBUILD
+++ /dev/null
@@ -1,135 +0,0 @@
-# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
-pkgname=cups
-pkgver=2.2.7
-pkgrel=0
-pkgdesc="The CUPS Printing System"
-url="http://www.cups.org/"
-arch="all"
-license="GPL LGPL2+"
-# cupsUTF8ToCharset(CUPS_EUC_JP) of utfdemo.txt: FAIL (UTF-8 to EUC-JP on line 1)
-options="!check"
-subpackages="$pkgname-dev $pkgname-doc $pkgname-libs ipptool $pkgname-client
- $pkgname-lang $pkgname-openrc"
-depends_dev="openssl-dev zlib-dev"
-makedepends="$depends_dev libpaper-dev dbus-dev libjpeg-turbo-dev linux-headers
- gnutls-dev linux-pam-dev"
-depends="cups-client poppler-utils openssl dbus"
-install="cups.pre-install"
-pkggroups="lp lpadmin"
-pkgusers="lp"
-source="https://github.com/apple/cups/releases/download/v$pkgver/cups-$pkgver-source.tar.gz
- $pkgname.logrotate
- cupsd.initd
- cups-no-export-ssllibs.patch
- default-config-no-gssapi.patch
- "
-builddir="$srcdir/$pkgname-$pkgver"
-
-build() {
- cd "$builddir"
-
- ./configure \
- --build=$CBUILD \
- --host=$CHOST \
- --prefix=/usr \
- --libdir=/usr/lib \
- --sysconfdir=/etc \
- --localstatedir=/var \
- --with-logdir=/var/log/cups \
- --with-docdir=/usr/share/cups \
- --with-rundir=/run/cups \
- --with-cupsd-file-perm=0755 \
- --with-cups-user=lp \
- --with-cups-group=lp \
- --with-system-groups=lpadmin \
- --with-domainsocket=/run/cups/cups.sock \
- --without-rcdir \
- --without-php \
- --enable-pam \
- --enable-raw-printing \
- --enable-dbus \
- --with-dbusdir=/etc/dbus-1 \
- --enable-libpaper \
- --enable-ssl=yes \
- --enable-gnutls \
- --disable-launchd \
- --with-optim="$CFLAGS"
- make
-}
-
-check() {
- cd "$builddir"
- make check
-}
-
-package() {
- cd "$builddir"
-
- make BUILDROOT="$pkgdir" install
-
- cd "$pkgdir"
-
- # These no longer works since CUPS >= 1.6 (http://www.cups.org/str.php?L4120).
- rm -rf usr/share/cups/banners/* \
- usr/share/cups/data/testprint
-
- install -D -m 644 "$srcdir"/cups.logrotate etc/logrotate.d/cups
- install -D -m 755 "$srcdir"/cupsd.initd etc/init.d/cupsd
-
- if [ -e usr/share/applications/cups.desktop ] ; then
- sed -i 's|^Exec=htmlview http://localhost:631/|Exec=xdg-open http://localhost:631/|g' \
- usr/share/applications/cups.desktop
- fi
- find usr/share/cups/model -name "*.ppd" | xargs gzip -n9f
-}
-
-libs() {
- pkgdesc="CUPS libraries"
- depends=""
- replaces="libcups"
-
- cd "$pkgdir"
- _mv usr/lib/*.so*
- install -d "$pkgdir"/etc/cups
-}
-
-ipptool() {
- pkgdesc="Perform internet printing protocol requests"
- depends=""
-
- cd "$pkgdir"
- _mv usr/bin/ipptool \
- usr/share/cups/ipptool
-}
-
-client() {
- pkgdesc="CUPS command-line client programs"
- depends=""
-
- cd "$pkgdir"
- _mv usr/bin \
- usr/sbin/accept \
- usr/sbin/cupsaccept \
- usr/sbin/cupsaddsmb \
- usr/sbin/cupsctl \
- usr/sbin/cupsdisable \
- usr/sbin/cupsenable \
- usr/sbin/lpadmin \
- usr/sbin/lpc \
- usr/sbin/lpinfo \
- usr/sbin/lpmove \
- usr/sbin/reject
-}
-
-_mv() {
- local i; for i in "$@"; do
- mkdir -p "$subpkgdir"/${i%/*}
- mv "$pkgdir"/$i "$subpkgdir"/${i%/*}/
- done
-}
-
-sha512sums="780a6a484f38967ff678456ec7b532aa8445a9562663e4e4f6f7a24aac6ec9e8eae36459ee3c025dff053d59ad1d9ecfb823e8a832bae9d384db3d1a10d8860e cups-2.2.7-source.tar.gz
-cf64211da59e79285f99d437c02fdd7db462855fb2920ec9563ba47bd8a9e5cbd10555094940ceedeb41ac805c4f0ddb9147481470112a11a76220d0298aef79 cups.logrotate
-2c2683f755a220166b3a1653fdd1a6daa9718c8f0bbdff2e2d5e61d1133306260d63a83d3ff41619b5cf84c4913fae5822b79553e2822858f38fa3613f4c7082 cupsd.initd
-7a8cd9ac33b0dd4627c72df4275db8ccd7cf8e201bce3833719b42f532f526bb347b842e3ea1ef0d61855b5c6e1088b5d20b68942f2c2c0acf504d8d9728efd3 cups-no-export-ssllibs.patch
-98bb97f4af69ea286fc3d398b8e57c32440e6b2d49fb7f79b418a4fe7f13441f3a610f65d3433d10d971ade808233c0b29b4d66160623ccaae919179384be918 default-config-no-gssapi.patch"
diff --git a/system/cups/cups-no-export-ssllibs.patch b/system/cups/cups-no-export-ssllibs.patch
deleted file mode 100644
index e227bd182..000000000
--- a/system/cups/cups-no-export-ssllibs.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -up cups-1.5b1/config-scripts/cups-ssl.m4.no-export-ssllibs cups-1.5b1/config-scripts/cups-ssl.m4
---- cups-1.6.2/config-scripts/cups-ssl.m4.no-export-ssllibs 2011-05-11 02:52:08.000000000 +0200
-+++ cups-1.6.2/config-scripts/cups-ssl.m4 2011-05-23 17:47:27.000000000 +0200
-@@ -180,7 +180,7 @@
- AC_SUBST(SSLFLAGS)
- AC_SUBST(SSLLIBS)
-
--EXPORT_SSLLIBS="$SSLLIBS"
-+EXPORT_SSLLIBS=""
- AC_SUBST(EXPORT_SSLLIBS)
-
- dnl
diff --git a/system/cups/cups.logrotate b/system/cups/cups.logrotate
deleted file mode 100644
index a50b058a3..000000000
--- a/system/cups/cups.logrotate
+++ /dev/null
@@ -1,8 +0,0 @@
-/var/log/cups/*log {
- missingok
- notifempty
- delaycompress
- postrotate
- /etc/init.d/cupsd --quiet --ifstarted reload
- endscript
-}
diff --git a/system/cups/cups.pre-install b/system/cups/cups.pre-install
deleted file mode 100644
index cdb75cac5..000000000
--- a/system/cups/cups.pre-install
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-addgroup -S lpadmin 2>/dev/null
-addgroup -S lp 2>/dev/null
-adduser -S -G lp -g lp lp 2>/dev/null
-addgroup lp lp 2>/dev/null
-
-exit 0
diff --git a/system/cups/cupsd.initd b/system/cups/cupsd.initd
deleted file mode 100644
index ff0998784..000000000
--- a/system/cups/cupsd.initd
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/sbin/openrc-run
-
-name="CUPS"
-
-extra_commands="checkconfig"
-extra_started_commands="reload"
-
-description_checkconfig="Test the configuration file"
-description_reload="Reload"
-
-: ${cfgfile:="/etc/cups/cupsd.conf"}
-
-command="/usr/sbin/cupsd"
-command_args="-f -c $cfgfile"
-command_background="yes"
-
-pidfile="/run/cups/$RC_SVCNAME.pid"
-
-depend() {
- use net
- before nfs
- need dbus
- after logger
-}
-
-checkconfig() {
- $command $command_args -t >/dev/null 2>&1 \
- || $command $command_args -t
-}
-
-start_pre() {
- checkconfig || return 1
-
- checkpath -q -d -m 0775 -o root:lp /var/cache/cups
- checkpath -q -d -m 0775 -o root:lp /var/cache/cups/rss
- checkpath -q -d -m 0755 -o root:lp /run/cups
- checkpath -q -d -m 0511 -o lp:lpadmin /run/cups/certs
-}
-
-reload() {
- ebegin "Reloading $name"
- start-stop-daemon --signal HUP --pidfile "$pidfile"
- eend $?
-}
diff --git a/system/cups/default-config-no-gssapi.patch b/system/cups/default-config-no-gssapi.patch
deleted file mode 100644
index b12c55ddf..000000000
--- a/system/cups/default-config-no-gssapi.patch
+++ /dev/null
@@ -1,26 +0,0 @@
---- a/conf/cupsd.conf.in
-+++ b/conf/cupsd.conf.in
-@@ -145,12 +145,12 @@
-
- # Job-related operations must be done by the owner or an administrator...
- <Limit Create-Job Print-Job Print-URI Validate-Job>
-- AuthType Negotiate
-+ AuthType Default
- Order deny,allow
- </Limit>
-
- <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job Cancel-My-Jobs Close-Job CUPS-Move-Job CUPS-Get-Document>
-- AuthType Negotiate
-+ AuthType Default
- Require user @OWNER @SYSTEM
- Order deny,allow
- </Limit>
-@@ -171,7 +171,7 @@
-
- # Only the owner or an administrator can cancel or authenticate a job...
- <Limit Cancel-Job CUPS-Authenticate-Job>
-- AuthType Negotiate
-+ AuthType Default
- Require user @OWNER @CUPS_DEFAULT_PRINTOPERATOR_AUTH@
- Order deny,allow
- </Limit>
diff --git a/system/db/APKBUILD b/system/db/APKBUILD
new file mode 100644
index 000000000..e450562b3
--- /dev/null
+++ b/system/db/APKBUILD
@@ -0,0 +1,73 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=db
+pkgver=5.3.28
+_ver=${pkgver}
+pkgrel=0
+pkgdesc="The Berkeley DB embedded database system"
+url="https://www.oracle.com/technology/software/products/berkeley-db/index.html"
+arch="all"
+license="custom"
+options="!check" # "check target not available"
+depends=
+makedepends=
+subpackages="$pkgname-dev $pkgname-doc $pkgname-utils $pkgname-c++:cxx"
+# Patches were found here:
+# http://www.oracle.com/technology/products/berkeley-db/db/update/4.7.25/patch.4.7.25.html
+source="http://download.oracle.com/berkeley-db/db-$pkgver.tar.gz
+ "
+
+_builddir="$srcdir/db-$_ver"
+prepare() {
+ cd "$_builddir"
+ update_config_sub || return 1
+}
+
+build () {
+ cd "$_builddir"
+ for i in ../patch.*; do
+ [ -r "$i" ] || continue
+ msg "Applying $i..."
+ patch -p0 < $i || return 1
+ done
+
+ cd build_unix
+ ../dist/configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --mandir=/usr/share/man \
+ --enable-compat185 \
+ --enable-shared \
+ --enable-cxx \
+ --disable-static \
+ || return 1
+ make LIBSO_LIBS=-lpthread || return 1
+}
+
+package() {
+ cd "$srcdir"/db-$_ver/build_unix
+ make DESTDIR="$pkgdir" install || return 1
+
+ mkdir -p "$pkgdir"/usr/share/doc
+ mv "$pkgdir"/usr/docs "$pkgdir"/usr/share/doc/$pkgname
+
+ install -D -m644 "$srcdir"/db-$_ver/LICENSE \
+ "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
+}
+
+utils() {
+ pkgdesc="Utils for The Berkeley DB embedded database system"
+ replaces="db"
+ mkdir -p "$subpkgdir"/usr/
+ mv "$pkgdir"/usr/bin "$subpkgdir"/usr/
+}
+
+cxx() {
+ pkgdesc="C++ binding for libdb"
+ mkdir -p "$subpkgdir"/usr/lib
+ mv "$pkgdir"/usr/lib/libdb_cxx*.so "$subpkgdir"/usr/lib/
+}
+
+md5sums="b99454564d5b4479750567031d66fe24 db-5.3.28.tar.gz"
+sha256sums="e0a992d740709892e81f9d93f06daf305cf73fb81b545afe72478043172c3628 db-5.3.28.tar.gz"
+sha512sums="e91bbe550fc147a8be7e69ade86fdb7066453814971b2b0223f7d17712bd029a8eff5b2b6b238042ff6ec1ffa6879d44cb95c5645a922fee305c26c3eeaee090 db-5.3.28.tar.gz"
diff --git a/system/emacs/APKBUILD b/system/emacs/APKBUILD
deleted file mode 100644
index 0092c9070..000000000
--- a/system/emacs/APKBUILD
+++ /dev/null
@@ -1,140 +0,0 @@
-# Contributor: Timo Teräs <timo.teras@iki.fi>
-# Maintainer: Horst Burkhardt <horst@adelielinux.org>
-pkgname=emacs
-pkgver=26.1
-pkgrel=0
-pkgdesc="The extensible, customizable, self-documenting real-time display editor"
-arch="all"
-depends="emacs-nox"
-options="!check !dbg"
-url="https://www.gnu.org/software/emacs/emacs.html"
-license="GPL-3.0"
-makedepends="autoconf automake linux-headers paxmark
- librsvg-dev giflib-dev libxpm-dev gtk+2.0-dev gconf-dev alsa-lib-dev
- glib-dev fontconfig-dev libpng-dev
- libxml2-dev pango-dev tiff-dev libjpeg-turbo-dev ncurses-dev
- ncurses-libs gnutls-dev libxaw-dev"
-subpackages="$pkgname-doc $pkgname-nox $pkgname-x11 $pkgname-gtk2"
-source="ftp://ftp.gnu.org/gnu/emacs/emacs-$pkgver.tar.xz
- gamedir.patch"
-
-prepare() {
- cd "$builddir/$1"
- default_prepare || return 1
- ./autogen.sh || return 1
-}
-
-builddir="$srcdir/emacs-$pkgver"
-_build_variant() {
- cd "$builddir/$1"
- shift
- CFLAGS=-fno-pie \
- LDFLAGS=-no-pie \
- ./configure \
- --build=$CBUILD \
- --host=$CHOST \
- --prefix=/usr \
- --sysconfdir=/etc \
- --libexecdir=/usr/lib \
- --localstatedir=/var \
- --without-makeinfo \
- --with-gameuser=:games \
- "${@}"
- make
-}
-
-_build_x11() {
- _build_variant x11 \
- --with-x-toolkit=athena \
- --without-toolkit-scroll-bars \
- --without-dbus \
- --with-xft \
- --with-jpeg=yes \
- --with-tiff=yes
-}
-
-_build_gtk2() {
- _build_variant gtk2 \
- --with-x-toolkit=gtk2 \
- --with-xft \
- --with-jpeg=yes \
- --with-tiff=no
-}
-
-_build_nox() {
- _build_variant nox \
- --without-sound \
- --without-x \
- --without-file-notification
-}
-
-build() {
- cd "$builddir"
- mkdir -p nox
- mv * nox || true
- cp -a nox gtk2
- cp -a nox x11
- _build_x11
- _build_nox
- _build_gtk2
-}
-
-package() {
- mkdir -p "$pkgdir"
-}
-
-doc() {
- mkdir -p "$subpkgdir"
- cd "$builddir/gtk2"
- make DESTDIR="$subpkgdir" install
- # remove conflict with ctags package
- mv "$subpkgdir"/usr/share/man/man1/ctags.1.gz "$subpkgdir"/usr/share/man/man1/ctags.emacs.1.gz
- # only keep info and man directories, all other is in the specific package
- rm -rf "$subpkgdir"/usr/bin \
- "$subpkgdir"/usr/lib \
- "$subpkgdir"/usr/share/appdata \
- "$subpkgdir"/usr/share/applications \
- "$subpkgdir"/usr/share/emacs \
- "$subpkgdir"/usr/share/icons \
- "$subpkgdir"/var
-}
-
-_subpackage() {
- cd "$builddir/$1"
- make DESTDIR="$subpkgdir" install
-
- # remove conflict with ctags package
- mv "$subpkgdir"/usr/bin/ctags "$subpkgdir"/usr/bin/ctags.emacs
- rm -rf "$subpkgdir"/usr/share/info \
- "$subpkgdir"/usr/share/man
-
- # fix user/root permissions on usr/share files
- find "$subpkgdir"/usr/share/emacs/ -exec chown root:root {} \;
- find "$subpkgdir"/usr/lib -perm -g+s,g+x ! -type d -exec chmod g-s {} \;
- # fix perms on /var/games
- chmod 775 "$subpkgdir"/var/games
- chmod 775 "$subpkgdir"/var/games/emacs
- chmod 664 "$subpkgdir"/var/games/emacs/*
- chown -R root:games "$subpkgdir"/var/games
-}
-
-nox() {
- pkgdesc="$pkgdesc - without X11"
- depends="!emacs-x11 !emacs-gtk2"
- _subpackage nox
-}
-
-x11() {
- pkgdesc="$pkgdesc - with X11"
- depends="!emacs-nox !emacs-gtk2 hicolor-icon-theme desktop-file-utils"
- _subpackage x11
-}
-
-gtk2() {
- pkgdesc="$pkgdesc - with GTK2"
- depends="!emacs-nox !emacs-x11 hicolor-icon-theme desktop-file-utils"
- _subpackage gtk2
-}
-
-sha512sums="537c2cfdd281151b360002419dde6280c313e07a937ed96405c67f754b3401ec5541091a3c0aa6690929bc33dd79e8e0d8844e7a6b014b7798c63cb15de210c2 emacs-26.1.tar.xz
-8898f309aeaf274366849bd5c56c8e2a1be94dfee2f01b20f1700bf26203f49b9600237e5090fc3d8eaad3ea246f803ffd493d0c04cb3512084a4e3bf58f8f5e gamedir.patch"
diff --git a/system/emacs/gamedir.patch b/system/emacs/gamedir.patch
deleted file mode 100644
index c1bcbadd6..000000000
--- a/system/emacs/gamedir.patch
+++ /dev/null
@@ -1,11 +0,0 @@
-diff -urw emacs-25.1/lib-src/Makefile.in emacs-25.1-gamedir/lib-src/Makefile.in
---- emacs-25.1/lib-src/Makefile.in 2016-06-29 09:49:18.000000000 +0000
-+++ emacs-25.1-gamedir/lib-src/Makefile.in 2016-10-24 15:37:46.718699816 +0000
-@@ -414,7 +414,6 @@
-
- update-game-score${EXEEXT}: ${srcdir}/update-game-score.c $(NTLIB) $(config_h)
- $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} \
-- -DHAVE_SHARED_GAME_DIR="\"$(gamedir)\"" \
- $< $(NTLIB) $(LOADLIBES) -o $@
-
- emacsclient.res: ../nt/emacsclient.rc $(NTINC)/../icons/emacs.ico
diff --git a/system/fakeroot/APKBUILD b/system/fakeroot/APKBUILD
new file mode 100644
index 000000000..ab7e64af7
--- /dev/null
+++ b/system/fakeroot/APKBUILD
@@ -0,0 +1,62 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=fakeroot
+pkgver=1.22
+pkgrel=0
+pkgdesc="Gives a fake root environment, useful for building packages as a non-privileged user"
+arch="all"
+license='GPL'
+url="http://fakeroot.alioth.debian.org/"
+depends=
+options="!checkroot"
+checkdepends="bash"
+makedepends_build="libtool autoconf automake po4a"
+makedepends_host="libcap-dev acl-dev linux-headers"
+makedepends="$makedepends_build $makedepends_host"
+subpackages="$pkgname-doc"
+source="http://ftp.debian.org/debian/pool/main/f/$pkgname/${pkgname}_${pkgver}.orig.tar.bz2
+ busybox-getopt.patch
+ fakeroot-hide-dlsym-errors.patch
+ fakeroot-no64.patch
+ fakeroot-stdint.patch
+ fakeroot-no-ldlibrarypath.patch
+ xstatjunk.patch
+ "
+
+check() {
+ cd $startdir/src/$pkgname-$pkgver
+ /bin/bash -c 'make check'
+}
+
+build() {
+ cd $startdir/src/$pkgname-$pkgver
+
+ if [ "$CLIBC" = "musl" ]; then
+ # musl does not have _STAT_VER, it's really not used for
+ # anything, so define it as zero (just like uclibc does)
+ export CFLAGS="-D_STAT_VER=0 $CFLAGS"
+ fi
+
+ CONFIG_SHELL=/bin/sh ./bootstrap
+ CONFIG_SHELL=/bin/sh ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --disable-static
+
+ make
+ cd doc
+ po4a -k 0 --rm-backups --variable "srcdir=../doc/" po4a/po4a.cfg
+}
+
+package() {
+ cd "$startdir/src/$pkgname-$pkgver"
+ make DESTDIR="$pkgdir" install
+}
+
+sha512sums="193478d9ff88ca2ae69fe47b73b6c61aeb2ba3f2a9e7ed5d455022705857c6f34cdcbe2d3f614c4c4c9509368dc78b9a7b7aa56fb3b50bb3309448140abd796a fakeroot_1.22.orig.tar.bz2
+9024263f4452bcb46c9670f8b8106e67c2d9b4cf45215def7ff4e78d2c908e4f98d494dd6f514fb3325165b0f61571fa031632b4642163cf9b1b3386d0867c5f busybox-getopt.patch
+666f41d6adc5e65eba419e08d5bbc4f561e40b0fc7bfa82090eb87962a7f3193bf319754e04aca289e865c66df2ecced1dbb45c9aa9f093657f22193dda25354 fakeroot-hide-dlsym-errors.patch
+7a832e6bed3838c7c488e0e12ba84b8d256e84bbb06d6020247452a991de505fa5c6bd7bcb84dce8753eb242e0fcab863b5461301cd56695f2b003fe8d6ff209 fakeroot-no64.patch
+ed7a58b0d201139545420f9e5429f503c00e00f36dea84473e77ea99b23bb8d421da1a8a8ce98ff90e72e378dff4cb9ea3c1a863a969899a5f50dfac3b9c5fac fakeroot-stdint.patch
+acfc1e5efce132279adddf9e11c28d65602059d5cd723ad98b67cb9183e1de68445f3bba7ac54ee60265b85f25141fcc9b2156f551aa5c624a92631320f5b743 fakeroot-no-ldlibrarypath.patch
+5efd33fd778bd94a529ed7e439fb8fea25ff865dda3f6f9e431264e942b37f3b5d7a0ad14107b55c5fa81b86efd5a82aedb3803cfab08ec57f27f5b229d2fe88 xstatjunk.patch"
diff --git a/system/fakeroot/busybox-getopt.patch b/system/fakeroot/busybox-getopt.patch
new file mode 100644
index 000000000..e8172e8f1
--- /dev/null
+++ b/system/fakeroot/busybox-getopt.patch
@@ -0,0 +1,14 @@
+--- ./scripts/fakeroot.in.orig
++++ ./scripts/fakeroot.in
+@@ -43,9 +43,9 @@
+
+ libfound=no
+
+-GETOPTEST=`getopt --version`
++GETOPTEST=`getopt --version 2>&1 | head -n2`
+ case $GETOPTEST in
+-getopt*) # GNU getopt
++getopt*|*BusyBox*) # GNU getopt
+ FAKE_TEMP=`getopt -l lib: -l faked: -l unknown-is-real -l fd-base: -l version -l help -- +l:f:i:s:ub:vh "$@"`
+ ;;
+ *) # POSIX getopt ?
diff --git a/system/fakeroot/fakeroot-hide-dlsym-errors.patch b/system/fakeroot/fakeroot-hide-dlsym-errors.patch
new file mode 100644
index 000000000..aeeb347da
--- /dev/null
+++ b/system/fakeroot/fakeroot-hide-dlsym-errors.patch
@@ -0,0 +1,20 @@
+it's normal that the acl_* symbols are not found if the application
+is not linked against -lacl. these errors harmless, but mighty
+annoying.
+
+--- fakeroot-1.20/libfakeroot.c.orig 2014-03-07 11:20:26.120532847 +0200
++++ fakeroot-1.20/libfakeroot.c 2014-03-07 11:21:26.486872482 +0200
+@@ -258,10 +258,12 @@
+ /* clear dlerror() just in case dlsym() legitimately returns NULL */
+ msg = dlerror();
+ *(next_wrap[i].doit)=dlsym(get_libc(), next_wrap[i].name);
+- if ( (msg = dlerror()) != NULL){
++#ifdef LIBFAKEROOT_DEBUGGING
++ if ( fakeroot_debug && (msg = dlerror()) != NULL) {
+ fprintf (stderr, "dlsym(%s): %s\n", next_wrap[i].name, msg);
+ /* abort ();*/
+ }
++#endif
+ }
+ }
+
diff --git a/system/fakeroot/fakeroot-no-ldlibrarypath.patch b/system/fakeroot/fakeroot-no-ldlibrarypath.patch
new file mode 100644
index 000000000..e7b9a037d
--- /dev/null
+++ b/system/fakeroot/fakeroot-no-ldlibrarypath.patch
@@ -0,0 +1,80 @@
+diff -ru fakeroot-1.20.2.orig/scripts/fakeroot.in fakeroot-1.20.2/scripts/fakeroot.in
+--- fakeroot-1.20.2.orig/scripts/fakeroot.in 2015-11-12 10:51:23.241681379 +0200
++++ fakeroot-1.20.2/scripts/fakeroot.in 2015-11-12 10:56:53.331985288 +0200
+@@ -34,8 +34,7 @@
+ FAKEROOT_BINDIR=@bindir@
+
+ USEABSLIBPATH=@LDPRELOADABS@
+-LIB=lib@fakeroot_transformed@@DLSUFFIX@
+-PATHS=@libdir@:${FAKEROOT_PREFIX}/lib64/libfakeroot:${FAKEROOT_PREFIX}/lib32/libfakeroot
++LIB=@libdir@/lib@fakeroot_transformed@@DLSUFFIX@
+ FAKED=${FAKEROOT_BINDIR}/@faked_transformed@
+
+ FAKED_MODE="unknown-is-root"
+@@ -68,7 +67,6 @@
+ -l|--lib)
+ shift
+ LIB=`eval echo "$1"`
+- PATHS=
+ ;;
+ -f|--faked)
+ shift
+@@ -111,23 +109,11 @@
+
+ # make sure the preload is available
+ ABSLIB=""
+-if [ -n "$PATHS" ]
+-then
+- for dir in `echo $PATHS | sed 's/:/ /g'`
+- do
+- if test -r "$dir/$LIB"
+- then
+- libfound=yes
+- ABSLIB="$dir/$LIB"
+- fi
+- done
+-else
+ if test -r "$LIB"
+ then
+ libfound=yes
+ ABSLIB="$LIB"
+ fi
+-fi
+
+ if test $libfound = no
+ then
+@@ -148,7 +134,7 @@
+ if [ "$WAITINTRAP" -eq 0 ]; then
+ trap "kill -s @signal@ $PID" EXIT INT
+ else
+- @MACOSX_FALSE@trap 'FAKEROOTKEY=$FAKEROOTKEY @LDLIBPATHVAR@="$PATHS" @LDPRELOADVAR@="$LIB" /bin/ls -l / >/dev/null 2>&1; while kill -s @signal@ $PID 2>/dev/null; do sleep 0.1; done' EXIT INT
++ @MACOSX_FALSE@trap 'FAKEROOTKEY=$FAKEROOTKEY @LDPRELOADVAR@="$LIB" /bin/ls -l / >/dev/null 2>&1; while kill -s @signal@ $PID 2>/dev/null; do sleep 0.1; done' EXIT INT
+ @MACOSX_TRUE@trap 'FAKEROOTKEY=$FAKEROOTKEY @LDPRELOADVAR@="$LIB" /bin/ls -l / >/dev/null 2>&1; while kill -s @signal@ $PID 2>/dev/null; do sleep 0.1; done' EXIT INT
+ fi
+
+@@ -159,10 +145,6 @@
+ if test $USEABSLIBPATH -ne 0 ; then
+ LIB=$ABSLIB
+ fi
+-# Keep other library paths
+-if test -n "$@LDLIBPATHVAR@"; then
+- PATHS="$PATHS:$@LDLIBPATHVAR@"
+-fi
+ # ...and preloaded libs
+ if test -n "$@LDPRELOADVAR@"; then
+ LIB="$LIB:$@LDPRELOADVAR@"
+@@ -171,11 +153,11 @@
+ export FAKEROOT_FD_BASE
+
+ if test -z "$*"; then
+- @MACOSX_FALSE@FAKEROOTKEY=$FAKEROOTKEY @LDLIBPATHVAR@="$PATHS" @LDEXTRAVAR@ @LDPRELOADVAR@="$LIB" ${SHELL:-/bin/sh}
++ @MACOSX_FALSE@FAKEROOTKEY=$FAKEROOTKEY @LDEXTRAVAR@ @LDPRELOADVAR@="$LIB" ${SHELL:-/bin/sh}
+ @MACOSX_TRUE@FAKEROOTKEY=$FAKEROOTKEY @LDEXTRAVAR@ @LDPRELOADVAR@="$LIB" ${SHELL:-/bin/sh}
+ RESULT=$?
+ else
+- @MACOSX_FALSE@FAKEROOTKEY=$FAKEROOTKEY @LDLIBPATHVAR@="$PATHS" @LDEXTRAVAR@ @LDPRELOADVAR@="$LIB" "$@"
++ @MACOSX_FALSE@FAKEROOTKEY=$FAKEROOTKEY @LDEXTRAVAR@ @LDPRELOADVAR@="$LIB" "$@"
+ @MACOSX_TRUE@FAKEROOTKEY=$FAKEROOTKEY @LDEXTRAVAR@ @LDPRELOADVAR@="$LIB" "$@"
+ RESULT=$?
+ fi
+
diff --git a/system/fakeroot/fakeroot-no64.patch b/system/fakeroot/fakeroot-no64.patch
new file mode 100644
index 000000000..ff95f96a9
--- /dev/null
+++ b/system/fakeroot/fakeroot-no64.patch
@@ -0,0 +1,17 @@
+--- a/libfakeroot.c
++++ b/libfakeroot.c
+@@ -81,12 +81,14 @@
+ #define SEND_STAT64(a,b,c) send_stat64(a,b,c)
+ #define SEND_GET_STAT(a,b) send_get_stat(a,b)
+ #define SEND_GET_STAT64(a,b) send_get_stat64(a,b)
++#define SEND_GET_XATTR(a,b,c) send_get_xattr(a,b,c)
+ #define SEND_GET_XATTR64(a,b,c) send_get_xattr64(a,b,c)
+ #else
+ #define SEND_STAT(a,b,c) send_stat(a,b)
+ #define SEND_STAT64(a,b,c) send_stat64(a,b)
+ #define SEND_GET_STAT(a,b) send_get_stat(a)
+ #define SEND_GET_STAT64(a,b) send_get_stat64(a)
++#define SEND_GET_XATTR(a,b,c) send_get_xattr(a,b)
+ #define SEND_GET_XATTR64(a,b,c) send_get_xattr64(a,b)
+ #endif
+
diff --git a/system/fakeroot/fakeroot-stdint.patch b/system/fakeroot/fakeroot-stdint.patch
new file mode 100644
index 000000000..bb4f67f0d
--- /dev/null
+++ b/system/fakeroot/fakeroot-stdint.patch
@@ -0,0 +1,34 @@
+--- fakeroot-1.18.2.orig/faked.c
++++ fakeroot-1.18.2/faked.c
+@@ -514,11 +514,11 @@
+
+ #ifdef FAKEROOT_DB_PATH
+ if (find_path(i->buf.dev, i->buf.ino, roots, path))
+- fprintf(f,"mode=%llo,uid=%llu,gid=%llu,nlink=%llu,rdev=%llu %s\n",
++ fprintf(f,"mode=%"PRIo64",uid=%"PRIu64",gid=%"PRIu64",nlink=%"PRIu64",rdev=%"PRIu64" %s\n",
+ (uint64_t) i->buf.mode,(uint64_t) i->buf.uid,(uint64_t) i->buf.gid,
+ (uint64_t) i->buf.nlink,(uint64_t) i->buf.rdev,path);
+ #else
+- fprintf(f,"dev=%llx,ino=%llu,mode=%llo,uid=%llu,gid=%llu,nlink=%llu,rdev=%llu\n",
++ fprintf(f,"dev=%"PRIx64",ino=%"PRIu64",mode=%"PRIo64",uid=%"PRIu64",gid=%"PRIu64",nlink=%"PRIu64",rdev=%"PRIu64"\n",
+ (uint64_t) i->buf.dev,(uint64_t) i->buf.ino,(uint64_t) i->buf.mode,
+ (uint64_t) i->buf.uid,(uint64_t) i->buf.gid,(uint64_t) i->buf.nlink,
+ (uint64_t) i->buf.rdev);
+@@ -544,7 +544,7 @@
+
+ while(1){
+ #ifdef FAKEROOT_DB_PATH
+- r=scanf("mode=%llo,uid=%llu,gid=%llu,nlink=%llu,rdev=%llu "DB_PATH_SCAN"\n",
++ r=scanf("mode=%"PRIo64",uid=%"PRIu64",gid=%"PRIu64",nlink=%"PRIu64",rdev=%"PRIu64" "DB_PATH_SCAN"\n",
+ &stmode, &stuid, &stgid, &stnlink, &strdev, &path);
+ if (r != 6)
+ break;
+@@ -559,7 +559,7 @@
+ stdev = path_st.st_dev;
+ stino = path_st.st_ino;
+ #else
+- r=scanf("dev=%llx,ino=%llu,mode=%llo,uid=%llu,gid=%llu,nlink=%llu,rdev=%llu\n",
++ r=scanf("dev=%"PRIx64",ino=%"PRIu64",mode=%"PRIo64",uid=%"PRIu64",gid=%"PRIu64",nlink=%"PRIu64",rdev=%"PRIu64"\n",
+ &stdev, &stino, &stmode, &stuid, &stgid, &stnlink, &strdev);
+ if (r != 7)
+ break;
diff --git a/system/fakeroot/fakeroot-uclibc.patch b/system/fakeroot/fakeroot-uclibc.patch
new file mode 100644
index 000000000..63708092d
--- /dev/null
+++ b/system/fakeroot/fakeroot-uclibc.patch
@@ -0,0 +1,20 @@
+--- fakeroot-1.18.2.orig/libfakeroot.c
++++ fakeroot-1.18.2/libfakeroot.c
+@@ -1551,7 +1551,7 @@
+ #endif /* LIBFAKEROOT_DEBUGGING */
+ r=next_fts_read(ftsp);
+ if(r && r->fts_statp) { /* Should we bother checking fts_info here? */
+-# if defined(STAT64_SUPPORT) && !defined(__APPLE__)
++# if defined(STAT64_SUPPORT) && !defined(__APPLE__) && !defined(__UCLIBC__)
+ SEND_GET_STAT64(r->fts_statp, _STAT_VER);
+ # else
+ SEND_GET_STAT(r->fts_statp, _STAT_VER);
+@@ -1574,7 +1574,7 @@
+ first=next_fts_children(ftsp, options);
+ for(r = first; r; r = r->fts_link) {
+ if(r && r->fts_statp) { /* Should we bother checking fts_info here? */
+-# if defined(STAT64_SUPPORT) && !defined(__APPLE__)
++# if defined(STAT64_SUPPORT) && !defined(__APPLE__) && !defined(__UCLIBC__)
+ SEND_GET_STAT64(r->fts_statp, _STAT_VER);
+ # else
+ SEND_GET_STAT(r->fts_statp, _STAT_VER);
diff --git a/system/fakeroot/xstatjunk.patch b/system/fakeroot/xstatjunk.patch
new file mode 100644
index 000000000..12f2759b4
--- /dev/null
+++ b/system/fakeroot/xstatjunk.patch
@@ -0,0 +1,11 @@
+--- fakeroot-1.18.4.orig/configure.ac 2012-06-02 18:23:41.000000000 +0000
++++ fakeroot-1.18.4configure.ac 2015-09-24 23:15:56.917470073 +0000
+@@ -301,7 +301,7 @@
+ FUNC=`echo $SEARCH|sed -e 's/.*%//'`
+ PRE=`echo $SEARCH|sed -e 's/%.*//'`
+ FOUND=
+- for WRAPPED in __${PRE}x${FUNC} _${PRE}x${FUNC} __${PRE}${FUNC}13 ${PRE}${FUNC}; do
++ for WRAPPED in ${PRE}${FUNC}; do
+ AC_CHECK_FUNCS($WRAPPED,FOUND=$WRAPPED)
+ dnl
+ dnl to unconditionally define only the _* functions, comment out the 2 lines above,
diff --git a/system/file/APKBUILD b/system/file/APKBUILD
new file mode 100644
index 000000000..58477ab71
--- /dev/null
+++ b/system/file/APKBUILD
@@ -0,0 +1,40 @@
+# Contributor: Valery Kartel <valery.kartel@gmail.com>
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=file
+pkgver=5.32
+pkgrel=0
+pkgdesc="File type identification utility"
+url="http://www.darwinsys.com/file/"
+arch="all"
+license="BSD"
+subpackages="$pkgname-dev $pkgname-doc libmagic"
+source="ftp://ftp.astron.com/pub/$pkgname/$pkgname-$pkgver.tar.gz"
+builddir="$srcdir/$pkgname-$pkgver"
+
+build() {
+ cd "$builddir"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --datadir=/usr/share
+ make
+}
+
+check() {
+ cd "$builddir"
+ make check
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+}
+
+libmagic() {
+ pkgdesc="File type identification library"
+ mkdir -p "$subpkgdir"/usr
+ mv "$pkgdir"/usr/lib "$pkgdir"/usr/share "$subpkgdir"/usr
+}
+
+sha512sums="315343229fa196335389544ee8010e9e80995ef4721938492dedcfb0465dfc45e1feb96f26dfe53cab484fb5d9bac54d2d72917fbfd28a1d998c6ad8c8f9792f file-5.32.tar.gz"
diff --git a/system/findutils/APKBUILD b/system/findutils/APKBUILD
new file mode 100644
index 000000000..a80b1d6cc
--- /dev/null
+++ b/system/findutils/APKBUILD
@@ -0,0 +1,47 @@
+# Contributor: Valery Kartel <valery.kartel@gmail.com>
+# Contributor: Michael Mason <ms13sp@gmail.com>
+# Maintainer: Michael Mason <ms13sp@gmail.com>
+pkgname=findutils
+pkgver=4.6.0
+pkgrel=1
+pkgdesc="GNU utilities for finding files"
+url="https://www.gnu.org/software/findutils/"
+arch="all"
+license="GPL-3.0+"
+depends=""
+makedepends=""
+checkdepends="coreutils diffutils dejagnu"
+install=
+subpackages="$pkgname-doc"
+source="http://ftp.gnu.org/pub/gnu/$pkgname/$pkgname-$pkgver.tar.gz
+ localename-test-fix.patch
+ "
+options="!checkroot"
+
+build() {
+ cd "$builddir"
+
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info
+ make
+}
+
+check() {
+ cd "$builddir"
+ make check
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+ rm -rf "$pkgdir"/usr/lib
+}
+
+sha512sums="41fcd4197c1efbd77f7420e5754e2cf9332dfef19f90c65a8fa1844bb4bc5d529c8393ee0ff979a054e9ac65ff71d7fe3921ea079f9960843412fc9a71f8afd4 findutils-4.6.0.tar.gz
+39fc0bc7602dd5300cf0b5488a7d14b6d00e05fedd6067ff45a229e65ff020d0003c0bb8e43807d9874afeb39c1dae6d612182caeb7de76156e1bc6ceb50adfc localename-test-fix.patch"
diff --git a/system/findutils/localename-test-fix.patch b/system/findutils/localename-test-fix.patch
new file mode 100644
index 000000000..666261f03
--- /dev/null
+++ b/system/findutils/localename-test-fix.patch
@@ -0,0 +1,34 @@
+--- findutils-4.6.0/tests/localename.c.old 2016-12-31 13:54:43.000000000 +0000
++++ findutils-4.6.0/tests/localename.c 2017-07-30 16:40:47.098541270 +0000
+@@ -40,7 +40,7 @@
+ # if defined __APPLE__ && defined __MACH__
+ # include <xlocale.h>
+ # endif
+-# if __GLIBC__ >= 2 && !defined __UCLIBC__
++# if defined __linux__
+ # include <langinfo.h>
+ # endif
+ # if !defined IN_LIBINTL
+@@ -2692,16 +2692,19 @@
+ locale_t thread_locale = uselocale (NULL);
+ if (thread_locale != LC_GLOBAL_LOCALE)
+ {
+-# if __GLIBC__ >= 2 && !defined __UCLIBC__
++# if defined(_NL_LOCALE_NAME)
++ const char *name = nl_langinfo(_NL_LOCALE_NAME(category));
++# if __GLIBC__ >= 2 && !defined __UCLIBC__
+ /* Work around an incorrect definition of the _NL_LOCALE_NAME macro in
+ glibc < 2.12.
+ See <http://sourceware.org/bugzilla/show_bug.cgi?id=10968>. */
+- const char *name =
+- nl_langinfo (_NL_ITEM ((category), _NL_ITEM_INDEX (-1)));
++ if (name[0] == '\0')
++ name = nl_langinfo (_NL_ITEM ((category), _NL_ITEM_INDEX (-1)));
+ if (name[0] == '\0')
+ /* Fallback code for glibc < 2.4, which did not implement
+ nl_langinfo (_NL_LOCALE_NAME (category)). */
+ name = thread_locale->__names[category];
++# endif
+ return name;
+ # elif defined __FreeBSD__ || (defined __APPLE__ && defined __MACH__)
+ /* FreeBSD, Mac OS X */
diff --git a/system/flex/APKBUILD b/system/flex/APKBUILD
new file mode 100644
index 000000000..fe03b8dfa
--- /dev/null
+++ b/system/flex/APKBUILD
@@ -0,0 +1,44 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+# Contributor: Arch3y <arch3y@riseup.net>
+pkgname=flex
+pkgver=2.6.4
+pkgrel=1
+pkgdesc="A tool for generating text-scanning programs"
+url="https://github.com/westes/flex"
+arch="all"
+license="BSD and LGPL-2.0-or-later"
+depends="m4"
+depends_dev="flex"
+makedepends="$depends_dev m4 bison help2man"
+subpackages="$pkgname-doc $pkgname-libs $pkgname-dev"
+source="https://github.com/westes/$pkgname/releases/download/v$pkgver/$pkgname-$pkgver.tar.gz"
+
+builddir="$srcdir"/$pkgname-$pkgver
+
+build() {
+ cd "$builddir"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ --disable-static \
+ --enable-shared \
+ ac_cv_func_malloc_0_nonnull=yes \
+ ac_cv_func_realloc_0_nonnull=yes
+ make
+}
+
+check() {
+ cd "$builddir"
+ make check
+}
+
+package() {
+ cd "$builddir"
+ make install DESTDIR="$pkgdir"
+ ln -s flex "$pkgdir"/usr/bin/lex
+}
+
+sha512sums="e9785f3d620a204b7d20222888917dc065c2036cae28667065bf7862dfa1b25235095a12fd04efdbd09bfd17d3452e6b9ef953a8c1137862ff671c97132a082e flex-2.6.4.tar.gz"
diff --git a/system/fortify-headers/APKBUILD b/system/fortify-headers/APKBUILD
new file mode 100644
index 000000000..9f56935a3
--- /dev/null
+++ b/system/fortify-headers/APKBUILD
@@ -0,0 +1,24 @@
+# Contributor: Timo Teräs <timo.teras@iki.fi>
+# Maintainer: Timo Teräs <timo.teras@iki.fi>
+pkgname=fortify-headers
+pkgver=0.9
+pkgrel=0
+pkgdesc="standalone fortify source implementation"
+url="http://git.2f30.org/fortify-headers/"
+arch="noarch"
+options="!check" # No test suite.
+license="BSD-0"
+source="http://dl.2f30.org/releases/$pkgname-$pkgver.tar.gz"
+
+builddir="$srcdir"/$pkgname-$pkgver
+
+build() {
+ cd "$builddir"
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" PREFIX=/usr install
+}
+
+sha512sums="bbf0c653d89b69ac05214b96e6bae9e3e2a60962b674c07292a7aa7a198f21b81697190c4d2d847555f0ce854bbd3b12fd18976a039ee564b720110c0af52ef7 fortify-headers-0.9.tar.gz"
diff --git a/system/freetype/0001-Enable-table-validation-modules.patch b/system/freetype/0001-Enable-table-validation-modules.patch
deleted file mode 100644
index 3e9451fa8..000000000
--- a/system/freetype/0001-Enable-table-validation-modules.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From c3680bf8d38cf759c1e33dcc2d2d51e0a4fea2f9 Mon Sep 17 00:00:00 2001
-From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
-Date: Tue, 23 Jun 2015 08:40:29 +0200
-Subject: [PATCH 1/3] Enable table validation modules
-
----
- modules.cfg | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/modules.cfg b/modules.cfg
-index f30049c38cc45159..7b8e50fe1b34584a 100644
---- a/modules.cfg
-+++ b/modules.cfg
-@@ -120,7 +120,7 @@ AUX_MODULES += cache
- # TrueType GX/AAT table validation. Needs ftgxval.c below.
- #
- # No FT_CONFIG_OPTION_PIC support.
--# AUX_MODULES += gxvalid
-+AUX_MODULES += gxvalid
-
- # Support for streams compressed with gzip (files with suffix .gz).
- #
-@@ -143,7 +143,7 @@ AUX_MODULES += bzip2
- # OpenType table validation. Needs ftotval.c below.
- #
- # No FT_CONFIG_OPTION_PIC support.
--# AUX_MODULES += otvalid
-+AUX_MODULES += otvalid
-
- # Auxiliary PostScript driver component to share common code.
- #
---
-2.9.3
-
diff --git a/system/freetype/0002-Enable-subpixel-rendering.patch b/system/freetype/0002-Enable-subpixel-rendering.patch
deleted file mode 100644
index dfb57966e..000000000
--- a/system/freetype/0002-Enable-subpixel-rendering.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 96f09f08417887b2618c177bccfb6da2906568d9 Mon Sep 17 00:00:00 2001
-From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
-Date: Tue, 23 Jun 2015 08:43:07 +0200
-Subject: [PATCH 2/3] Enable subpixel rendering
-
----
- include/freetype/config/ftoption.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/include/freetype/config/ftoption.h b/include/freetype/config/ftoption.h
-index 90c123ef93e9ea04..67a361dd41e0b026 100644
---- a/include/freetype/config/ftoption.h
-+++ b/include/freetype/config/ftoption.h
-@@ -122,7 +122,7 @@ FT_BEGIN_HEADER
- /* This is done to allow FreeType clients to run unmodified, forcing */
- /* them to display normal gray-level anti-aliased glyphs. */
- /* */
--/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
-+#define FT_CONFIG_OPTION_SUBPIXEL_RENDERING
-
-
- /*************************************************************************/
---
-2.9.3
-
diff --git a/system/freetype/0003-Enable-infinality-subpixel-hinting.patch b/system/freetype/0003-Enable-infinality-subpixel-hinting.patch
deleted file mode 100644
index bbfa2a2cd..000000000
--- a/system/freetype/0003-Enable-infinality-subpixel-hinting.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From 220e96a9a8d7aff6ad0f0f1aa12c79cdb563331c Mon Sep 17 00:00:00 2001
-From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
-Date: Mon, 29 Aug 2016 08:43:10 +0200
-Subject: [PATCH 3/3] Enable infinality subpixel hinting
-
----
- include/freetype/config/ftoption.h | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/include/freetype/config/ftoption.h b/include/freetype/config/ftoption.h
-index 67a361dd41e0b026..c4812862518b66a6 100644
---- a/include/freetype/config/ftoption.h
-+++ b/include/freetype/config/ftoption.h
-@@ -675,8 +675,8 @@ FT_BEGIN_HEADER
- /* [1] http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx */
- /* */
- /* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING 1 */
--#define TT_CONFIG_OPTION_SUBPIXEL_HINTING 2
--/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING ( 1 | 2 ) */
-+/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING 2 */
-+#define TT_CONFIG_OPTION_SUBPIXEL_HINTING ( 1 | 2 )
-
-
- /*************************************************************************/
---
-2.9.3
-
diff --git a/system/freetype/0004-Enable-long-PCF-family-names.patch b/system/freetype/0004-Enable-long-PCF-family-names.patch
deleted file mode 100644
index 675423a7c..000000000
--- a/system/freetype/0004-Enable-long-PCF-family-names.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 62da6a0f7f5cb77859a793863c386c452411e2a6 Mon Sep 17 00:00:00 2001
-From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
-Date: Sun, 14 May 2017 18:09:31 +0200
-Subject: [PATCH 4/4] Enable long PCF family names
-
----
- include/freetype/config/ftoption.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/include/freetype/config/ftoption.h b/include/freetype/config/ftoption.h
-index ebb44acdbbef9a47..0b39b417162707e4 100644
---- a/include/freetype/config/ftoption.h
-+++ b/include/freetype/config/ftoption.h
-@@ -865,7 +865,7 @@ FT_BEGIN_HEADER
- /* If this option is activated, it can be controlled with the */
- /* `no-long-family-names' property of the pcf driver module. */
- /* */
--/* #define PCF_CONFIG_OPTION_LONG_FAMILY_NAMES */
-+#define PCF_CONFIG_OPTION_LONG_FAMILY_NAMES
-
-
- /*************************************************************************/
---
-2.13.0
-
diff --git a/system/freetype/40-memcpy-fix.patch b/system/freetype/40-memcpy-fix.patch
deleted file mode 100644
index 89e61cd0b..000000000
--- a/system/freetype/40-memcpy-fix.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- ./src/psaux/psobjs.c~ 2006-04-26 16:38:17.000000000 +0200
-+++ ./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/system/freetype/APKBUILD b/system/freetype/APKBUILD
deleted file mode 100644
index 37ab71932..000000000
--- a/system/freetype/APKBUILD
+++ /dev/null
@@ -1,57 +0,0 @@
-# Contributor: Carlo Landmeter <clandmeter@gmail.com>
-# Maintainer: A. Wilcox <awilfox@adelielinux.org>
-pkgname=freetype
-pkgver=2.9.1
-pkgrel=0
-pkgdesc="TrueType font rendering library"
-url="https://www.freetype.org/"
-arch="all"
-license="GPL"
-options="!check"
-depends=""
-depends_dev=""
-makedepends="$depends_dev zlib-dev libpng-dev bzip2-dev"
-subpackages="$pkgname-dev"
-source="http://download.savannah.gnu.org/releases/freetype/freetype-$pkgver.tar.bz2
- 40-memcpy-fix.patch
- 0001-Enable-table-validation-modules.patch
- 0003-Enable-infinality-subpixel-hinting.patch
- 0004-Enable-long-PCF-family-names.patch
-
- freetype-profile.sh
- "
-
-# secfixes:
-# 2.9.1-r0:
-# - CVE-2018-6942
-# 2.7.1-r1:
-# - CVE-2017-8105
-# - CVE-2017-8287
-
-build() {
- cd "$builddir"
- ./configure \
- --build=$CBUILD \
- --host=$CHOST \
- --prefix=/usr \
- --sysconfdir=/etc \
- --disable-static \
- --with-bzip2 \
- --with-png
- make
-}
-
-package() {
- cd "$builddir"
- make DESTDIR="$pkgdir" install
-
- install -Dm644 "$srcdir"/freetype-profile.sh \
- "$pkgdir"/etc/profile.d/freetype.sh
-}
-
-sha512sums="856766e1f3f4c7dc8afb2b5ee991138c8b642c6a6e5e007cd2bc04ae58bde827f082557cf41bf541d97e8485f7fd064d10390d1ee597f19d1daed6c152e27708 freetype-2.9.1.tar.bz2
-9981be8a3ea6f2cf856860b87a4e895e4610c9d5ea4beb611815e757e6080e060f6853ace02dd8ea55e5888cdf4bae5ad5eadd2d8a123754bb3c0bfe7ef41dea 40-memcpy-fix.patch
-41a84be2631b53072a76b78c582575aa48b650ee7b00017d018381002bc25df10cf33da4954c95ef50db39f1fa566678e3b4ae9bfee1dfd705423fb53e53e494 0001-Enable-table-validation-modules.patch
-7b52a3d67750d59b2c98e83dab4e0a0ab263142c2ca7bd5f8be5f8fe9cd1dc1f4debad44111c7886665329d8d2a3163756455618a6615df8f85d82bb0372d4dd 0003-Enable-infinality-subpixel-hinting.patch
-64c20fbcbf48372ea35fe2e0dae8fec4be8c601c899a4a71913060c6ea4082a2f41d69701da511e09fee126bf198d560986469e2356bd088d2dd5961f437df63 0004-Enable-long-PCF-family-names.patch
-7100cde5b2ca16bfbe968fce3e2eba5ba49e6ed53792d5db889c8d89e572d7d80da1338ccc9eeb9b243664ca2337467e9f73c1074bee0b34c417f6c7832ed390 freetype-profile.sh"
diff --git a/system/freetype/freetype-profile.sh b/system/freetype/freetype-profile.sh
deleted file mode 100644
index a4cc6423b..000000000
--- a/system/freetype/freetype-profile.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-# Subpixel hinting mode can be chosen by setting the right TrueType interpreter
-# version. The available settings are:
-#
-# truetype:interpreter-version=35 # Classic mode (default in 2.6)
-# truetype:interpreter-version=38 # Infinality mode
-# truetype:interpreter-version=40 # Minimal mode (default in 2.7)
-#
-# There are more properties that can be set, separated by whitespace. Please
-# refer to the FreeType documentation for details.
-
-# Uncomment and configure below
-export FREETYPE_PROPERTIES="truetype:interpreter-version=38"
diff --git a/system/gamin/APKBUILD b/system/gamin/APKBUILD
deleted file mode 100644
index 360161d27..000000000
--- a/system/gamin/APKBUILD
+++ /dev/null
@@ -1,58 +0,0 @@
-# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
-pkgname=gamin
-pkgver=0.1.10
-pkgrel=11
-pkgdesc="Gamin is a file and directory monitoring system defined to be a subset of the FAM (File Alteration Monitor) system."
-url="http://www.gnome.org/~veillard/gamin"
-arch="all"
-license="GPL"
-subpackages="$pkgname-dev"
-depends=
-makedepends="glib-dev"
-source="http://www.gnome.org/~veillard/$pkgname/sources/$pkgname-$pkgver.tar.gz
- fix-deprecated-const.patch
- fix-pthread-mutex.patch"
-
-_builddir="$srcdir"/$pkgname-$pkgver
-prepare() {
- cd "$_builddir"
- update_config_sub
- default_prepare
-}
-
-build() {
- cd "$_builddir"
- ./configure \
- --build=$CBUILD \
- --host=$CHOST \
- --prefix=/usr \
- --disable-static \
- --with-threads \
- --without-python \
- --disable-debug-api \
- --disable-debug \
- --libexecdir=/usr/lib/gamin
- make
-}
-
-check() {
- cd "$builddir"
- make check
-}
-
-package() {
- cd "$_builddir"
- # some kinde of race in the make install which is not solved with -j
- export MKDIRPROG="mkdir -p"
- make DESTDIR="$pkgdir" install
-}
-
-md5sums="b4ec549e57da470c04edd5ec2876a028 gamin-0.1.10.tar.gz
-f679aeb48fe9dd376c8828cc9b6941ab fix-deprecated-const.patch
-f05a8d9fe30b6ce2871795c06d74edc4 fix-pthread-mutex.patch"
-sha256sums="28085f0ae8be10eab582ff186af4fb0be92cc6c62b5cc19cd09b295c7c2899a1 gamin-0.1.10.tar.gz
-33af6c9a94b459506fc48892c169d89cb4ad7c68e160f0c4bc74475f19ce5a2f fix-deprecated-const.patch
-bfd5ee42e385367718a4dac8ab318f9a5881ab8b669e4020f87aacaef16a2f8e fix-pthread-mutex.patch"
-sha512sums="21bfe6fcf8fb3117cd5a08c8ce3b8d0d1dd23e478e60a95b76c20d02cc29b050dde086578d81037990484ff891c3e104d2cbbf3d294b4a79346b14a0cae075bb gamin-0.1.10.tar.gz
-c4c10bee70c7231db395cbfe5bdf513ade6be599a11a9d35888ddfaca42d619fe2b5e87c2b2bab469ea98ba718bc01711252313ba5f53c392379b669f5b2902b fix-deprecated-const.patch
-70628fc39521ea8bc4a40b009d0881f6ee540334a31b2f0cb67dde0f75808c69feb78088ad24c3c4a0dec9fa59e87960fd81d1a2e56963ce9268d0a5e14f88e8 fix-pthread-mutex.patch"
diff --git a/system/gamin/fix-deprecated-const.patch b/system/gamin/fix-deprecated-const.patch
deleted file mode 100644
index 3d5f6133f..000000000
--- a/system/gamin/fix-deprecated-const.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-Description: Don't use deprecated G_CONST_RETURN. Fixes building with newer glib versions.
-Author: Matthias Klose <doko@ubuntu.com>
-Bug-Ubuntu: https://launchpad.net/bugs/829504
-
-Index: gamin/server/gam_node.c
-===================================================================
---- gamin.orig/server/gam_node.c 2011-10-18 16:09:04.873780685 +0200
-+++ gamin/server/gam_node.c 2011-10-18 16:09:01.965780543 +0200
-@@ -122,7 +122,7 @@
- * it has finished with the string. If it must keep it longer, it
- * should makes its own copy. The returned string must not be freed.
- */
--G_CONST_RETURN char *
-+const char *
- gam_node_get_path(GamNode * node)
- {
- g_assert(node);
-Index: gamin/server/gam_node.h
-===================================================================
---- gamin.orig/server/gam_node.h 2011-10-18 16:09:04.729780677 +0200
-+++ gamin/server/gam_node.h 2011-10-18 16:09:01.961780544 +0200
-@@ -58,7 +58,7 @@
- void gam_node_set_is_dir (GamNode *node,
- gboolean is_dir);
-
--G_CONST_RETURN char *gam_node_get_path (GamNode *node);
-+const char *gam_node_get_path (GamNode *node);
-
- GList *gam_node_get_subscriptions (GamNode *node);
-
-Index: gamin/server/gam_subscription.c
-===================================================================
---- gamin.orig/server/gam_subscription.c 2011-10-18 16:09:04.817780682 +0200
-+++ gamin/server/gam_subscription.c 2011-10-18 16:09:01.965780543 +0200
-@@ -141,7 +141,7 @@
- * @param sub the GamSubscription
- * @returns The path being monitored. It should not be freed.
- */
--G_CONST_RETURN char *
-+const char *
- gam_subscription_get_path(GamSubscription * sub)
- {
- if (sub == NULL)
-Index: gamin/server/gam_subscription.h
-===================================================================
---- gamin.orig/server/gam_subscription.h 2011-10-18 16:09:04.929780687 +0200
-+++ gamin/server/gam_subscription.h 2011-10-18 16:09:01.965780543 +0200
-@@ -21,7 +21,7 @@
-
- int gam_subscription_get_reqno (GamSubscription *sub);
-
--G_CONST_RETURN char *gam_subscription_get_path (GamSubscription *sub);
-+const char *gam_subscription_get_path (GamSubscription *sub);
-
- GamListener *gam_subscription_get_listener (GamSubscription *sub);
-
diff --git a/system/gamin/fix-pthread-mutex.patch b/system/gamin/fix-pthread-mutex.patch
deleted file mode 100644
index c8c5b0005..000000000
--- a/system/gamin/fix-pthread-mutex.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- gamin-0.1.10.orig/libgamin/gam_data.c
-+++ gamin-0.1.10/libgamin/gam_data.c
-@@ -470,7 +470,7 @@
- }
- if (is_threaded > 0) {
- pthread_mutexattr_init(&attr);
--#if defined(linux) || defined(PTHREAD_MUTEX_RECURSIVE_NP)
-+#if defined(linux) && defined(PTHREAD_MUTEX_RECURSIVE_NP)
- pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
- #else
- pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
diff --git a/system/gmp/APKBUILD b/system/gmp/APKBUILD
new file mode 100644
index 000000000..225e7b6a0
--- /dev/null
+++ b/system/gmp/APKBUILD
@@ -0,0 +1,61 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=gmp
+pkgver=6.1.2
+pkgrel=1
+pkgdesc="A free library for arbitrary precision arithmetic"
+url="https://gmplib.org/"
+arch="all"
+license="LGPL-3.0"
+makedepends="m4 texinfo libtool"
+depends=
+subpackages="$pkgname-doc $pkgname-dev libgmpxx"
+source="https://gmplib.org/download/gmp/gmp-$pkgver.tar.xz
+ "
+replaces="gmp5"
+
+prepare() {
+ cd "$builddir"
+ default_prepare
+ # force update to libtool with fixed cross-build support
+ libtoolize -f
+}
+
+build() {
+ cd "$builddir"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --with-sysroot=$CBUILDROOT \
+ --prefix=/usr \
+ --infodir=/usr/share/info \
+ --mandir=/usr/share/man \
+ --localstatedir=/var/state/gmp \
+ --enable-cxx \
+ --with-pic
+ make
+}
+
+package() {
+ cd "$builddir"
+ make -j1 DESTDIR="${pkgdir}" install
+}
+
+check() {
+ cd "$builddir"
+ [ "$CBUILD" = "$CHOST" ] && make check
+}
+
+libgmpxx() {
+ pkgdesc="C++ support for gmp"
+ mkdir -p "$subpkgdir"/usr/lib/
+ mv "$pkgdir"/usr/lib/libgmpxx.so.* "$subpkgdir"/usr/lib/
+}
+
+doc() {
+ default_doc
+ replaces="gmp5-doc"
+}
+
+md5sums="f58fa8001d60c4c77595fbbb62b63c1d gmp-6.1.2.tar.xz"
+sha256sums="87b565e89a9a684fe4ebeeddb8399dce2599f9c9049854ca8c0dfbdea0e21912 gmp-6.1.2.tar.xz"
+sha512sums="9f098281c0593b76ee174b722936952671fab1dae353ce3ed436a31fe2bc9d542eca752353f6645b7077c1f395ab4fdd355c58e08e2a801368f1375690eee2c6 gmp-6.1.2.tar.xz"
diff --git a/system/gmp/gmp-4.1.4-noexecstack.patch b/system/gmp/gmp-4.1.4-noexecstack.patch
new file mode 100644
index 000000000..093bec1a5
--- /dev/null
+++ b/system/gmp/gmp-4.1.4-noexecstack.patch
@@ -0,0 +1,20 @@
+fixed executable stack
+
+http://bugs.gentoo.org/115038
+
+--- gmp-4.1.4/configure
++++ gmp-4.1.4/configure
+@@ -21689,6 +21689,13 @@
+ fi
+ echo "')" >> $gmp_configm4
+ echo "define(\`__CONFIG_M4_INCLUDED__')" >> $gmp_configm4
++# Gentoo hack
++case $host_os in
++ *linux*)
++ echo '.section .note.GNU-stack,"",%progbits' >> $gmp_configm4
++ echo '.previous' >> $gmp_configm4
++ ;;
++esac
+
+ # Create Makefiles
+ # FIXME: Upcoming version of autoconf/automake may not like broken lines.
diff --git a/system/grep/APKBUILD b/system/grep/APKBUILD
new file mode 100644
index 000000000..fc9ed5baf
--- /dev/null
+++ b/system/grep/APKBUILD
@@ -0,0 +1,52 @@
+# Contributor: Michael Mason <ms13sp@gmail.com>
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=grep
+pkgver=3.1
+pkgrel=2
+pkgdesc="Searches input files for lines containing a match to a specified pattern"
+url="https://www.gnu.org/software/grep/grep.html"
+arch="all"
+license="GPL-3.0+"
+makedepends="pcre-dev autoconf automake"
+checkdepends="coreutils bash diffutils"
+subpackages="$pkgname-doc"
+source="http://mirrors.kernel.org/gnu/$pkgname/$pkgname-$pkgver.tar.xz
+ fix-tests.patch"
+builddir="$srcdir/$pkgname-$pkgver"
+# for whatever reason, all the builders locked up in the testsuite. investigate later.
+options="!check"
+
+prepare() {
+ default_prepare
+ sed -i '/test-localename$(EXEEXT)/d' \
+ "$builddir"/gnulib-tests/Makefile.in
+}
+
+build() {
+ cd "$builddir"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --bindir=/bin \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ --disable-nls
+ make
+}
+
+check() {
+ make -C "$builddir" check
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+
+ rm -rf "$pkgdir"/usr/lib/charset.alias
+ rmdir -p "$pkgdir"/usr/lib 2>/dev/null || true
+}
+
+sha512sums="05494381c7dd8aad7e2ee4c17450de8d7b969a99dcfe17747db60df3475bf02d5323d091e896e8343e4f3251c29dc7f0b7a9f93c575c9d58ee2a57014c2c9d26 grep-3.1.tar.xz
+9ba6b01c0c74933299afb469dadd2ea0c7e24befa34c691671a576063e32a1f0c735541e5e2bb0073d8afd814790909f7f895827aa8a2fbacdfcae380a7bcb11 fix-tests.patch"
diff --git a/system/grep/fix-tests.patch b/system/grep/fix-tests.patch
new file mode 100644
index 000000000..cb2945714
--- /dev/null
+++ b/system/grep/fix-tests.patch
@@ -0,0 +1,23 @@
+diff -upr grep-3.1.orig/tests/pcre-jitstack grep-3.1/tests/pcre-jitstack
+--- grep-3.1.orig/tests/pcre-jitstack 2017-11-29 01:48:08.772121987 +0100
++++ grep-3.1/tests/pcre-jitstack 2017-11-29 01:49:37.763570125 +0100
+@@ -25,7 +25,7 @@ foo=$( (echo foo | gzip | gzip -d) 2>/de
+
+ fail=0
+
+-b64_decode >pcrejit.txt.gz <<'EOF' || framework_failure_
++cat <<EOF
+ H4sIAAAAAAACA+2bUU4DMQxE/7mMz5T7XwKE+IBKVLue58yk0B9EtX6xJxN7t4VaH69a6+tHrW+/
+ r4e3n75KARWShSOFTtiumE3FPVyo79ATIJ0Ry0No/yXe99UIUqTGKKUzYHFJHJoaCONQDCnDSCDS
+ IPAvGCVeXNsZ7lpbWFfdaZtgPos5LeK2C1TBKzD09V3HFlCOsbFT/hNbz4HzJaRjnjdam9FXw/o6
+@@ -36,7 +36,9 @@ uSHRnTkzIdZMmZ5kYX/iJFtTwu9cFvr3aDWcUx4p
+ dkcKkYUglER2Q4L4gnmOiNGzSBATwGQgwihs5/QffIhyfg4hJvM2r4Rp6L+1ibCCd4jYZ6jCiBlc
+ 2+y4fl4yTGIwcWXNAUEeXmu8iCMV96DNTnmRNICDk2N5qaXGbsF91OX/0hlcYTjrMfy02p9Xv70D
+ mv3RZCFOAAA=
+-EOF
++EOF > pcrejit.tmp.txt
++
++b64_decode < pcrejit.tmp.txt > pcrejit.txt.gz || framework_failure_
+
+ gzip -d pcrejit.txt || framework_failure_
+
diff --git a/system/groff/APKBUILD b/system/groff/APKBUILD
new file mode 100644
index 000000000..0c7201b94
--- /dev/null
+++ b/system/groff/APKBUILD
@@ -0,0 +1,39 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=groff
+pkgver=1.22.3
+pkgrel=2
+pkgdesc="GNU troff text-formatting system"
+url="https://www.gnu.org/software/groff/groff.html"
+arch="all"
+license="GPL"
+depends=
+makedepends="perl texinfo"
+subpackages="$pkgname-doc"
+source="ftp://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.gz"
+
+build () {
+ cd "$builddir"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --without-x
+ # work around parallel build issue
+ make arch/misc && make
+}
+
+check() {
+ cd "$builddir"
+ make check
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+ rm -rf "$pkgdir"/usr/lib/charset.alias
+ rmdir -p "$pkgdir"/usr/lib 2>/dev/null || true
+}
+
+md5sums="cc825fa64bc7306a885f2fb2268d3ec5 groff-1.22.3.tar.gz"
+sha256sums="3a48a9d6c97750bfbd535feeb5be0111db6406ddb7bb79fc680809cda6d828a5 groff-1.22.3.tar.gz"
+sha512sums="c526ab203d13a9c9d110bcd3149fe50d1cd0d309437e9e2731a7ce90d890507ebc0a2331899ecf4dba2938daa756b6094cf76fd347a0ded59797c70ccfd0c95c groff-1.22.3.tar.gz"
diff --git a/system/gzip/APKBUILD b/system/gzip/APKBUILD
new file mode 100644
index 000000000..0c61d9b28
--- /dev/null
+++ b/system/gzip/APKBUILD
@@ -0,0 +1,52 @@
+# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=gzip
+pkgver=1.9
+pkgrel=0
+pkgdesc="A popular data compression program"
+subpackages="$pkgname-doc"
+url="https://www.gnu.org/software/gzip/"
+arch="all"
+license="GPL-2.0"
+depends=
+makedepends=
+checkdepends="perl coreutils diffutils less"
+install=
+source="http://ftp.gnu.org/gnu/gzip/gzip-$pkgver.tar.gz"
+
+build() {
+ cd "$builddir"
+
+ # avoid text relocation
+ export DEFS="NO_ASM"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info
+ make
+}
+
+check() {
+ cd "$builddir"
+ make check
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR=$pkgdir install
+
+ rm -rf "$pkgdir"/usr/lib/charset.alias
+ rmdir -p "$pkgdir"/usr/lib 2>/dev/null || true
+
+ mkdir -p "$pkgdir"/bin
+ mv "$pkgdir"/usr/bin/gzip "$pkgdir"/usr/bin/gunzip "$pkgdir"/bin/
+ ln -s /bin/gzip "$pkgdir"/usr/bin/gzip
+ ln -s /bin/gunzip "$pkgdir"/usr/bin/gunzip
+
+ # http://bugs.alpinelinux.org/issues/4011
+ ln -sf /bin/gunzip "$pkgdir"/usr/bin/uncompress
+}
+
+sha512sums="686cb920701e2e19178143a0714edf46da5456bcdc5f5f99c2c186eb195078bc1039e4552f6e0eb4b870cc9beb1042ca3b8922d0b81e378c27bbbc55ba8f4a2f gzip-1.9.tar.gz"
diff --git a/system/isl/APKBUILD b/system/isl/APKBUILD
new file mode 100644
index 000000000..9e6957b85
--- /dev/null
+++ b/system/isl/APKBUILD
@@ -0,0 +1,52 @@
+# Contributor: Timo Teräs <timo.teras@iki.fi>
+# Maintainer: Timo Teräs <timo.teras@iki.fi>
+pkgname=isl
+pkgver=0.18
+pkgrel=0
+pkgdesc="An Integer Set Library for the Polyhedral Model"
+url="http://isl.gforge.inria.fr/"
+arch="all"
+license="MIT"
+depends=""
+depends_dev="gmp-dev"
+makedepends_host="$depends_dev"
+makedepends="$makedepends_host"
+replaces="cloog"
+install=""
+subpackages="$pkgname-dev"
+source="http://isl.gforge.inria.fr/isl-$pkgver.tar.bz2"
+
+builddir="$srcdir"/$pkgname-$pkgver
+
+build() {
+ cd "$builddir"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ --localstatedir=/var \
+ --with-sysroot=${CBUILDROOT}
+ make
+}
+
+check() {
+ cd "$builddir"
+ make check
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" INSTALL="install -D" install
+}
+
+dev() {
+ default_dev
+ replaces="cloog-dev"
+ mkdir -p "$subpkgdir"/usr/share/gdb/python/auto-load/usr/lib
+ mv "$pkgdir"/usr/lib/*-gdb.py \
+ "$subpkgdir"/usr/share/gdb/python/auto-load/usr/lib/
+}
+
+sha512sums="85d0b40f4dbf14cb99d17aa07048cdcab2dc3eb527d2fbb1e84c41b2de5f351025370e57448b63b2b8a8cf8a0843a089c3263f9baee1542d5c2e1cb37ed39d94 isl-0.18.tar.bz2"
diff --git a/system/kbd/APKBUILD b/system/kbd/APKBUILD
new file mode 100644
index 000000000..45a122e25
--- /dev/null
+++ b/system/kbd/APKBUILD
@@ -0,0 +1,181 @@
+# Contributor: Natanael Copa <ncopa@alpinelinux.org>
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=kbd
+pkgver=2.0.4
+pkgrel=3
+pkgdesc="Tools for configuring the console (keyboard, virtual terminals, etc.)"
+url="http://ftp.altlinux.org/pub/people/legion/kbd"
+arch="all"
+license="GPL-2.0-or-later"
+depends="kbd-misc"
+makedepends="linux-headers linux-pam-dev check-dev ckbcomp xkeyboard-config"
+install=""
+subpackages="$pkgname-bkeymaps::noarch $pkgname-legacy::noarch
+ $pkgname-misc::noarch $pkgname-doc $pkgname-openrc $pkgname-vlock"
+source="https://www.kernel.org/pub/linux/utils/kbd/kbd-$pkgver.tar.gz
+ loadkeys.initd
+ loadkeys.confd
+
+ error.h
+ fix-tests.patch
+ "
+builddir="$srcdir"/kbd-$pkgver
+
+_datadir=/usr/share
+_xmapdir="$_datadir"/keymaps/xkb
+_bmapdir="$_datadir"/bkeymaps
+_badmaps="pk-ara"
+
+prepare() {
+ default_prepare
+
+ cd "$builddir"
+ cp "$srcdir"/error.h .
+}
+
+build() {
+ cd "$builddir"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --disable-nls \
+ --prefix=/usr \
+ --datadir="$_datadir" \
+ --htmldir=/usr/share/html/$pkgname
+ make
+}
+
+check() {
+ cd "$builddir"
+ make check
+}
+
+_listxmaps() {
+ local invariant line; invariant=false
+ grep -v '^$' /usr/share/X11/xkb/rules/base.lst | while read line; do
+ case "$line" in
+ '! variant') invariant=true ;;
+ '!'*) invariant=false ;;
+ *) if $invariant; then
+ echo "$line" | cut -d: -f1
+ fi ;;
+ esac
+ done
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+
+ install -Dm755 "$srcdir"/loadkeys.initd \
+ "$pkgdir"/etc/init.d/loadkeys
+ install -Dm644 "$srcdir"/loadkeys.confd \
+ "$pkgdir"/etc/conf.d/loadkeys
+
+ # Move and fixup legacy keymaps
+ mkdir legacy
+ mv "$pkgdir"/usr/share/keymaps/* legacy
+ mv legacy "$pkgdir"/usr/share/keymaps
+
+ cd "$pkgdir"/usr/share/keymaps/legacy/i386
+ # Make ISO-8815-9 maps the default, instead of 7-bit ones
+ ln -s pt-latin9.map.gz qwerty/pt.map.gz
+ mv azerty/fr.map.gz azerty/fr-old.map.gz
+ ln -s fr-latin9.map.gz azerty/fr.map.gz
+
+ # Add some legacy aliases
+ ln -s fr-latin9.map.gz azerty/fr-latin0.map.gz
+ ln -s sv-latin1.map.gz qwerty/se-latin1.map.gz
+ ln -s sr-cy.map.gz qwerty/sr-latin.map.gz
+
+ # Rename conflicting keymaps
+ mv dvorak/no.map.gz dvorak/no-dvorak.map.gz
+ mv fgGIod/trf.map.gz fgGIod/trf-fgGIod.map.gz
+ mv olpc/es.map.gz olpc/es-olpc.map.gz
+ mv olpc/pt.map.gz olpc/pt-olpc.map.gz
+ mv qwerty/cz.map.gz qwerty/cz-qwerty.map.gz
+
+ # Remove useless layouts
+ rm -f i386/qwerty/ro_win.map.gz
+
+ cd "$builddir"
+
+ # Compile keymaps from X.org layouts
+ mkdir -p "$pkgdir$_xmapdir"
+ local layout variant
+ _listxmaps | while read -r variant layout; do
+ if ! test -f "$pkgdir$_xmapdir"/"$layout".map.gz; then
+ echo "Generating keymap $layout..."
+ ckbcomp "$layout" | gzip > "$pkgdir$_xmapdir"/"$layout".map.gz || exit 1
+ fi
+ echo "Generating keymap $layout-$variant..."
+ ckbcomp "$layout" "$variant" | gzip > "$pkgdir$_xmapdir"/"$layout"-"$variant".map.gz || exit 1
+ done
+
+ # Do some fix-ups on X.org keymaps
+ mv "$pkgdir$_xmapdir"/fi.map.gz "$pkgdir$_xmapdir"/fi-kotoistus.map.gz
+
+ # Install html documentation
+ mkdir -p "$pkgdir$_datadir"/html/$pkgname
+ mv docs/doc/*.html "$pkgdir$_datadir"/html/$pkgname
+
+ # Replace busybox setfont utility.
+ mkdir -p "$pkgdir"/usr/sbin
+ mv "$pkgdir"/usr/bin/setfont "$pkgdir"/usr/sbin
+
+ # Link open to openvt
+ ln -s openvt "$pkgdir"/usr/bin/open
+}
+
+vlock() {
+ pkgdesc="$pkgname vlock implemantation"
+ depends=
+
+ # This is the only binary needing linux-pam so moving this to a
+ # subpackage reduces the amount of depencies of the kbd package.
+
+ mkdir -p "$subpkgdir"/usr/bin
+ mv "$pkgdir"/usr/bin/vlock "$subpkgdir"/usr/bin
+}
+
+bkeymaps() {
+ pkgdesc="X.org-derived binary keymaps"
+ depends=
+ replaces="bkeymaps"
+ provides="bkeymaps"
+
+ mkdir -p "$subpkgdir$_bmapdir"
+ local map variant layout; for map in "$pkgdir$_xmapdir"/*.map.gz; do
+ variant="$(basename "$map" | cut -d. -f1)"
+ case "$variant" in $_badmaps) continue ;; esac
+
+ layout="${variant%%-*}"
+ mkdir -p "$subpkgdir$_bmapdir"/$layout
+ echo "Generating binary keymap $variant..."
+ "$pkgdir"/usr/bin/loadkeys -ub "$map" | gzip > "$subpkgdir$_bmapdir"/$layout/$variant.bmap.gz
+ done
+}
+
+legacy() {
+ pkgdesc="kbd legacy keymaps"
+ depends=
+
+ mkdir -p "$subpkgdir$_datadir"/keymaps
+ mv "$pkgdir$_datadir"/keymaps/legacy "$subpkgdir$_datadir"/keymaps
+}
+
+misc() {
+ pkgdesc="kbd keymaps and console data"
+ depends=
+
+ mkdir -p "$subpkgdir$_datadir"
+ local dir; for dir in consolefonts consoletrans keymaps unimaps; do
+ mv "$pkgdir$_datadir"/$dir "$subpkgdir$_datadir"
+ done
+}
+
+sha512sums="e37bc661c75a8363e9a5ba903310fa7f7ded4f381c2c77aa7edc0b1aca5a63224933fd113cddcf180e7fb85f55407e0d1f47be1cdf69dcf2787e83ac996bbf03 kbd-2.0.4.tar.gz
+64b5ab4c362350521da8f507d22c0b77784da99bbe1b32f0c001cd826f63c607e3f9cd6af01f06a61af8bd709760bbf2bb3cfe2010c33925f2987a1af6ef4998 loadkeys.initd
+12028796552a5ffed1d5cb19d37fc6a73fb4f2e2bf34d837a81171c7ebee98d6c3f557715bf79706d79ce053b9b2450cd8cf1c4ea045428fb7d8a5915ae3ed78 loadkeys.confd
+c66f6b0d8c8b8d285c740bdbe7130dee272ac01cd5e73b35a58cedf1a77fe8d9e062631b804fb58014d8eb9861c8f28aed07bc022ef31662bcc61b5c85a21752 error.h
+bb67e5bb933a48f4a04402e07d7d67169a97485e6b469f8ccd4436466eb17ec2ddcf0ef74d22b3aae9e813feaee5bef0822ec50c384e0276a8c91f9325502a5f fix-tests.patch"
diff --git a/system/kbd/bkeymaps.patch b/system/kbd/bkeymaps.patch
new file mode 100644
index 000000000..cea626167
--- /dev/null
+++ b/system/kbd/bkeymaps.patch
@@ -0,0 +1,14 @@
+diff --git a/src/loadkeys.c b/src/loadkeys.c
+index 8b8e7a1..b3f7fea 100644
+--- a/src/loadkeys.c
++++ b/src/loadkeys.c
+@@ -174,7 +174,8 @@ main(int argc, char *argv[])
+ }
+
+ /* get console */
+- fd = getfd(console);
++ if (!(options & OPT_B))
++ fd = getfd(console);
+
+ if (!(options & OPT_M) && !(options & OPT_B)) {
+ /* check whether the keyboard is in Unicode mode */
diff --git a/system/kbd/error.h b/system/kbd/error.h
new file mode 100644
index 000000000..5eb8ed511
--- /dev/null
+++ b/system/kbd/error.h
@@ -0,0 +1,20 @@
+#ifndef ERROR_H
+#define ERROR_H
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <err.h>
+
+static inline void error(int status, int errnum, const char *fmt, ...)
+{
+ va_list ap;
+ void (*errfunc[2])(int, const char *, va_list) = { &verr, &verrx };
+ void (*warnfunc[2])(const char *, va_list) = { &vwarn, &vwarnx };
+ fflush(stdout);
+ va_start(ap, fmt);
+ if (status != 0)
+ errfunc[errnum==0](status, fmt, ap); /* does not return */
+ warnfunc[errnum==0](fmt, ap);
+ va_end(ap);
+}
+#endif
diff --git a/system/kbd/fix-tests.patch b/system/kbd/fix-tests.patch
new file mode 100644
index 000000000..0ca82420c
--- /dev/null
+++ b/system/kbd/fix-tests.patch
@@ -0,0 +1,41 @@
+busybox readlink doesn't accept -e, and in these cases -f has the same effect.
+--- a/tests/alt-is-meta.in
++++ b/tests/alt-is-meta.in
+@@ -1,6 +1,6 @@
+ #!/bin/sh -efu
+
+-cwd="$(readlink -ev "${0%/*}")"
++cwd="$(readlink -fv "${0%/*}")"
+
+ cd "$cwd"
+
+--- a/tests/dumpkeys-bkeymap.in
++++ b/tests/dumpkeys-bkeymap.in
+@@ -1,6 +1,6 @@
+ #!/bin/sh -efu
+
+-cwd="$(readlink -ev "${0%/*}")"
++cwd="$(readlink -fv "${0%/*}")"
+
+ cd "$cwd"
+
+--- a/tests/dumpkeys-fulltable.in
++++ b/tests/dumpkeys-fulltable.in
+@@ -1,6 +1,6 @@
+ #!/bin/sh -efu
+
+-cwd="$(readlink -ev "${0%/*}")"
++cwd="$(readlink -fv "${0%/*}")"
+
+ cd "$cwd"
+
+--- a/tests/dumpkeys-mktable.in
++++ b/tests/dumpkeys-mktable.in
+@@ -1,6 +1,6 @@
+ #!/bin/sh -efu
+
+-cwd="$(readlink -ev "${0%/*}")"
++cwd="$(readlink -fv "${0%/*}")"
+
+ cd "$cwd"
+
diff --git a/system/kbd/loadkeys.confd b/system/kbd/loadkeys.confd
new file mode 100644
index 000000000..1ba568af9
--- /dev/null
+++ b/system/kbd/loadkeys.confd
@@ -0,0 +1,23 @@
+# Use keymap to specify the default console keymap. There is a complete tree
+# of keymaps in /usr/share/keymaps to choose from.
+keymap="us"
+
+# Should we first load the 'windowkeys' console keymap? Most x86 users will
+# say "yes" here. Note that non-x86 users should leave it as "no".
+# Loading this keymap will enable VT switching (like ALT+Left/Right)
+# using the special windows keys on the linux console.
+windowkeys="NO"
+
+# The maps to load for extended keyboards. Most users will leave this as is.
+extended_keymaps=""
+#extended_keymaps="backspace keypad euro2"
+
+# Tell dumpkeys(1) to interpret character action codes to be
+# from the specified character set.
+# This only matters if you set unicode="yes" in /etc/rc.conf.
+# For a list of valid sets, run `dumpkeys --help`
+dumpkeys_charset=""
+
+# Some fonts map AltGr-E to the currency symbol instead of the Euro.
+# To fix this, set to "yes"
+fix_euro="NO"
diff --git a/system/kbd/loadkeys.initd b/system/kbd/loadkeys.initd
new file mode 100644
index 000000000..6686bf0e5
--- /dev/null
+++ b/system/kbd/loadkeys.initd
@@ -0,0 +1,72 @@
+#!/sbin/openrc-run
+# Copyright (c) 2007-2015 The OpenRC Authors.
+# See the Authors file at the top-level directory of this distribution and
+# https://github.com/OpenRC/openrc/blob/master/AUTHORS
+#
+# This file is part of OpenRC. It is subject to the license terms in
+# the LICENSE file found in the top-level directory of this
+# distribution and at https://github.com/OpenRC/openrc/blob/master/LICENSE
+# This file may not be copied, modified, propagated, or distributed
+# except according to the terms contained in the LICENSE file.
+
+description="Applies a keymap for the consoles."
+
+depend()
+{
+ provide keymaps
+ need localmount termencoding
+ after bootmisc
+ keyword -docker -lxc -openvz -prefix -systemd-nspawn -uml -vserver -xenu
+}
+
+start()
+{
+ ttyn=${rc_tty_number:-${RC_TTY_NUMBER:-12}}
+ : ${unicode:=$UNICODE}
+ : ${keymap:=$KEYMAP}
+ : ${extended_keymaps:=$EXTENDED_KEYMAPS}
+ : ${windowkeys:=$SET_WINDOWSKEYS}
+ : ${fix_euro:=$FIX_EURO}
+ : ${dumpkeys_charset:=${DUMPKEYS_CHARSET}}
+
+ if [ -z "$keymap" ]; then
+ eerror "You need to setup keymap in /etc/conf.d/${0##*/} first"
+ return 1
+ fi
+
+ local ttydev=/dev/tty n=
+ [ -d /dev/vc ] && ttydev=/dev/vc/
+
+ # Force linux keycodes for PPC.
+ if [ -f /proc/sys/dev/mac_hid/keyboard_sends_linux_keycodes ]; then
+ echo 1 > /proc/sys/dev/mac_hid/keyboard_sends_linux_keycodes
+ fi
+
+ local wkeys= kmode="-a" msg="ASCII"
+ if yesno $unicode; then
+ kmode="-u"
+ msg="UTF-8"
+ fi
+ yesno $windowkeys && wkeys="windowkeys"
+
+ # Set terminal encoding to either ASCII or UNICODE.
+ # See utf-8(7) for more information.
+ ebegin "Setting keyboard mode [$msg]"
+ n=1
+ while [ $n -le $ttyn ]; do
+ kbd_mode $kmode -C $ttydev$n
+ : $(( n += 1 ))
+ done
+ eend 0
+
+ ebegin "Loading key mappings [$keymap]"
+ loadkeys -q $wkeys $keymap $extended_keymaps
+ eend $? "Error loading key mappings" || return $?
+
+ if yesno $fix_euro; then
+ ebegin "Fixing font for euro symbol"
+ # Fix some fonts displaying the Euro, #173528.
+ echo "altgr keycode 18 = U+20AC" | loadkeys -q -
+ eend $?
+ fi
+}
diff --git a/system/lddtree/APKBUILD b/system/lddtree/APKBUILD
new file mode 100644
index 000000000..e99fa794a
--- /dev/null
+++ b/system/lddtree/APKBUILD
@@ -0,0 +1,28 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=lddtree
+pkgver=1.26
+pkgrel=1
+pkgdesc="List dynamic dependencies as a tree"
+url="https://github.com/ncopa/lddtree"
+arch="noarch"
+license="GPL-2.0"
+depends="scanelf"
+depends_dev=""
+replaces="pax-utils"
+makedepends="$depends_dev"
+install=""
+subpackages=""
+options="!check"
+source="lddtree-$pkgver.tar.gz::https://github.com/ncopa/lddtree/archive/v$pkgver.tar.gz
+ "
+
+build() {
+ return 0
+}
+
+package() {
+ cd "$builddir"
+ install -Dm755 lddtree.sh "$pkgdir"/usr/bin/lddtree
+}
+
+sha512sums="9c244cf47627e6cfb396f4187e7c35b438bcb8e3978e43a91ad5a5d034233eaaffd1319e98b6a26b8bbcb570ede3eeb809a14720b50771587a96dde5f6516340 lddtree-1.26.tar.gz"
diff --git a/system/less/APKBUILD b/system/less/APKBUILD
new file mode 100644
index 000000000..45290a6dc
--- /dev/null
+++ b/system/less/APKBUILD
@@ -0,0 +1,40 @@
+# Contributor: Cameron Banta <cbanta@gmail.com>
+# Maintainer: Cameron Banta <cbanta@gmail.com>
+pkgname=less
+pkgver=530
+pkgrel=0
+pkgdesc="File pager"
+url="http://www.greenwoodsoftware.com/less/"
+arch="all"
+license="GPL"
+options="!check"
+makedepends="ncurses-dev"
+subpackages="$pkgname-doc"
+source="http://www.greenwoodsoftware.com/$pkgname/$pkgname-$pkgver.tar.gz"
+builddir="$srcdir/$pkgname-$pkgver"
+
+prepare() {
+ default_prepare
+
+ cd "$builddir"
+ chmod +x configure
+}
+
+build() {
+ cd "$builddir"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info
+ make
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+}
+
+sha512sums="8d83a18b5648c4fe85921a563aa2c40bcf495aeb611098c83cd167b1e2f706649846cdf457c8506ae2683ab362ad970a0b261747349673020894bccdb9acbc10 less-530.tar.gz"
diff --git a/system/libc-dev/APKBUILD b/system/libc-dev/APKBUILD
new file mode 100644
index 000000000..76dc1b08f
--- /dev/null
+++ b/system/libc-dev/APKBUILD
@@ -0,0 +1,59 @@
+# Contributor: Natanael Copa <ncopa@alpinelinux.org>
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=libc-dev
+pkgver=0.7.1
+pkgrel=0
+pkgdesc="Meta package to pull in correct libc"
+url="http://alpinelinux.org"
+arch="noarch"
+license="BSD"
+makedepends_build=" "
+makedepends_host=" "
+makedepends="$makedepends_build $makedepends_host"
+depends="$CLIBC-dev"
+subpackages="libc-utils:utils bsd-compat-headers:bsdcompat"
+source="sys-cdefs.h
+ sys-queue.h
+ sys-tree.h
+ "
+
+prepare() {
+ mkdir -p "$builddir"
+ cd "$builddir"
+}
+
+build() {
+ return 0
+}
+
+check() {
+ return 0
+}
+
+package() {
+ mkdir -p "$pkgdir"
+}
+
+utils() {
+ depends="$CLIBC-utils"
+
+ mkdir -p "$subpkgdir"
+}
+
+bsdcompat() {
+ pkgdesc="BSD compatibility headers (cdefs, queue, tree)"
+ depends=""
+
+ mkdir -p "$subpkgdir"
+ case "$CLIBC" in
+ musl)
+ install -D "$srcdir"/sys-cdefs.h "$subpkgdir"/usr/include/sys/cdefs.h
+ install -D "$srcdir"/sys-queue.h "$subpkgdir"/usr/include/sys/queue.h
+ install -D "$srcdir"/sys-tree.h "$subpkgdir"/usr/include/sys/tree.h
+ ;;
+ esac
+}
+
+sha512sums="8c3fddd73b696a38e633953715c79c47703739be27ee085fc6c960a57b6746ca05bf6406f7e6126cc1a13204254fd5830afb566624e1f298f4d6b58216013c28 sys-cdefs.h
+2f0d5e6e4dc3350285cf17009265dddcbe12431c111868eea39bc8cb038ab7c1f2acacbb21735c4e9d4a1fd106a8fc0f8611ea33987d4faba37dde5ce6da0750 sys-queue.h
+07cb70f2f0ddb31e23dd913c6f561fc9885667c5803fdf3a559676c99d08834b4104589bacb5d17b4a0b379c68c81a1cf3173832b3da33a7b936fa7b93706844 sys-tree.h"
diff --git a/system/libc-dev/sys-cdefs.h b/system/libc-dev/sys-cdefs.h
new file mode 100644
index 000000000..209a623c0
--- /dev/null
+++ b/system/libc-dev/sys-cdefs.h
@@ -0,0 +1,26 @@
+#warning usage of non-standard #include <sys/cdefs.h> is deprecated
+
+#undef __P
+#undef __PMT
+
+#define __P(args) args
+#define __PMT(args) args
+
+#define __CONCAT(x,y) x ## y
+#define __STRING(x) #x
+
+#ifdef __cplusplus
+# define __BEGIN_DECLS extern "C" {
+# define __END_DECLS }
+#else
+# define __BEGIN_DECLS
+# define __END_DECLS
+#endif
+
+#if defined(__GNUC__) && !defined(__cplusplus)
+# define __THROW __attribute__ ((__nothrow__))
+# define __NTH(fct) __attribute__ ((__nothrow__)) fct
+#else
+# define __THROW
+# define __NTH(fct) fct
+#endif
diff --git a/system/libc-dev/sys-queue.h b/system/libc-dev/sys-queue.h
new file mode 100644
index 000000000..a38499a26
--- /dev/null
+++ b/system/libc-dev/sys-queue.h
@@ -0,0 +1,846 @@
+/* $NetBSD: queue.h,v 1.70 2015/11/02 15:21:23 christos Exp $ */
+
+/*
+ * Copyright (c) 1991, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)queue.h 8.5 (Berkeley) 8/20/94
+ */
+
+#ifndef _SYS_QUEUE_H_
+#define _SYS_QUEUE_H_
+
+/*
+ * This file defines five types of data structures: singly-linked lists,
+ * lists, simple queues, tail queues, and circular queues.
+ *
+ * A singly-linked list is headed by a single forward pointer. The
+ * elements are singly linked for minimum space and pointer manipulation
+ * overhead at the expense of O(n) removal for arbitrary elements. New
+ * elements can be added to the list after an existing element or at the
+ * head of the list. Elements being removed from the head of the list
+ * should use the explicit macro for this purpose for optimum
+ * efficiency. A singly-linked list may only be traversed in the forward
+ * direction. Singly-linked lists are ideal for applications with large
+ * datasets and few or no removals or for implementing a LIFO queue.
+ *
+ * A list is headed by a single forward pointer (or an array of forward
+ * pointers for a hash table header). The elements are doubly linked
+ * so that an arbitrary element can be removed without a need to
+ * traverse the list. New elements can be added to the list before
+ * or after an existing element or at the head of the list. A list
+ * may only be traversed in the forward direction.
+ *
+ * A simple queue is headed by a pair of pointers, one the head of the
+ * list and the other to the tail of the list. The elements are singly
+ * linked to save space, so elements can only be removed from the
+ * head of the list. New elements can be added to the list after
+ * an existing element, at the head of the list, or at the end of the
+ * list. A simple queue may only be traversed in the forward direction.
+ *
+ * A tail queue is headed by a pair of pointers, one to the head of the
+ * list and the other to the tail of the list. The elements are doubly
+ * linked so that an arbitrary element can be removed without a need to
+ * traverse the list. New elements can be added to the list before or
+ * after an existing element, at the head of the list, or at the end of
+ * the list. A tail queue may be traversed in either direction.
+ *
+ * A circle queue is headed by a pair of pointers, one to the head of the
+ * list and the other to the tail of the list. The elements are doubly
+ * linked so that an arbitrary element can be removed without a need to
+ * traverse the list. New elements can be added to the list before or after
+ * an existing element, at the head of the list, or at the end of the list.
+ * A circle queue may be traversed in either direction, but has a more
+ * complex end of list detection.
+ *
+ * For details on the use of these macros, see the queue(3) manual page.
+ */
+
+/*
+ * Include the definition of NULL only on NetBSD because sys/null.h
+ * is not available elsewhere. This conditional makes the header
+ * portable and it can simply be dropped verbatim into any system.
+ * The caveat is that on other systems some other header
+ * must provide NULL before the macros can be used.
+ */
+#ifdef __NetBSD__
+#include <sys/null.h>
+#endif
+
+#if defined(QUEUEDEBUG)
+# if defined(_KERNEL)
+# define QUEUEDEBUG_ABORT(...) panic(__VA_ARGS__)
+# else
+# include <err.h>
+# define QUEUEDEBUG_ABORT(...) err(1, __VA_ARGS__)
+# endif
+#endif
+
+/*
+ * Singly-linked List definitions.
+ */
+#define SLIST_HEAD(name, type) \
+struct name { \
+ struct type *slh_first; /* first element */ \
+}
+
+#define SLIST_HEAD_INITIALIZER(head) \
+ { NULL }
+
+#define SLIST_ENTRY(type) \
+struct { \
+ struct type *sle_next; /* next element */ \
+}
+
+/*
+ * Singly-linked List access methods.
+ */
+#define SLIST_FIRST(head) ((head)->slh_first)
+#define SLIST_END(head) NULL
+#define SLIST_EMPTY(head) ((head)->slh_first == NULL)
+#define SLIST_NEXT(elm, field) ((elm)->field.sle_next)
+
+#define SLIST_FOREACH(var, head, field) \
+ for((var) = (head)->slh_first; \
+ (var) != SLIST_END(head); \
+ (var) = (var)->field.sle_next)
+
+#define SLIST_FOREACH_SAFE(var, head, field, tvar) \
+ for ((var) = SLIST_FIRST((head)); \
+ (var) != SLIST_END(head) && \
+ ((tvar) = SLIST_NEXT((var), field), 1); \
+ (var) = (tvar))
+
+/*
+ * Singly-linked List functions.
+ */
+#define SLIST_INIT(head) do { \
+ (head)->slh_first = SLIST_END(head); \
+} while (/*CONSTCOND*/0)
+
+#define SLIST_INSERT_AFTER(slistelm, elm, field) do { \
+ (elm)->field.sle_next = (slistelm)->field.sle_next; \
+ (slistelm)->field.sle_next = (elm); \
+} while (/*CONSTCOND*/0)
+
+#define SLIST_INSERT_HEAD(head, elm, field) do { \
+ (elm)->field.sle_next = (head)->slh_first; \
+ (head)->slh_first = (elm); \
+} while (/*CONSTCOND*/0)
+
+#define SLIST_REMOVE_AFTER(slistelm, field) do { \
+ (slistelm)->field.sle_next = \
+ SLIST_NEXT(SLIST_NEXT((slistelm), field), field); \
+} while (/*CONSTCOND*/0)
+
+#define SLIST_REMOVE_HEAD(head, field) do { \
+ (head)->slh_first = (head)->slh_first->field.sle_next; \
+} while (/*CONSTCOND*/0)
+
+#define SLIST_REMOVE(head, elm, type, field) do { \
+ if ((head)->slh_first == (elm)) { \
+ SLIST_REMOVE_HEAD((head), field); \
+ } \
+ else { \
+ struct type *curelm = (head)->slh_first; \
+ while(curelm->field.sle_next != (elm)) \
+ curelm = curelm->field.sle_next; \
+ curelm->field.sle_next = \
+ curelm->field.sle_next->field.sle_next; \
+ } \
+} while (/*CONSTCOND*/0)
+
+
+/*
+ * List definitions.
+ */
+#define LIST_HEAD(name, type) \
+struct name { \
+ struct type *lh_first; /* first element */ \
+}
+
+#define LIST_HEAD_INITIALIZER(head) \
+ { NULL }
+
+#define LIST_ENTRY(type) \
+struct { \
+ struct type *le_next; /* next element */ \
+ struct type **le_prev; /* address of previous next element */ \
+}
+
+/*
+ * List access methods.
+ */
+#define LIST_FIRST(head) ((head)->lh_first)
+#define LIST_END(head) NULL
+#define LIST_EMPTY(head) ((head)->lh_first == LIST_END(head))
+#define LIST_NEXT(elm, field) ((elm)->field.le_next)
+
+#define LIST_FOREACH(var, head, field) \
+ for ((var) = ((head)->lh_first); \
+ (var) != LIST_END(head); \
+ (var) = ((var)->field.le_next))
+
+#define LIST_FOREACH_SAFE(var, head, field, tvar) \
+ for ((var) = LIST_FIRST((head)); \
+ (var) != LIST_END(head) && \
+ ((tvar) = LIST_NEXT((var), field), 1); \
+ (var) = (tvar))
+
+#define LIST_MOVE(head1, head2) do { \
+ LIST_INIT((head2)); \
+ if (!LIST_EMPTY((head1))) { \
+ (head2)->lh_first = (head1)->lh_first; \
+ LIST_INIT((head1)); \
+ } \
+} while (/*CONSTCOND*/0)
+
+/*
+ * List functions.
+ */
+#if defined(QUEUEDEBUG)
+#define QUEUEDEBUG_LIST_INSERT_HEAD(head, elm, field) \
+ if ((head)->lh_first && \
+ (head)->lh_first->field.le_prev != &(head)->lh_first) \
+ QUEUEDEBUG_ABORT("LIST_INSERT_HEAD %p %s:%d", (head), \
+ __FILE__, __LINE__);
+#define QUEUEDEBUG_LIST_OP(elm, field) \
+ if ((elm)->field.le_next && \
+ (elm)->field.le_next->field.le_prev != \
+ &(elm)->field.le_next) \
+ QUEUEDEBUG_ABORT("LIST_* forw %p %s:%d", (elm), \
+ __FILE__, __LINE__); \
+ if (*(elm)->field.le_prev != (elm)) \
+ QUEUEDEBUG_ABORT("LIST_* back %p %s:%d", (elm), \
+ __FILE__, __LINE__);
+#define QUEUEDEBUG_LIST_POSTREMOVE(elm, field) \
+ (elm)->field.le_next = (void *)1L; \
+ (elm)->field.le_prev = (void *)1L;
+#else
+#define QUEUEDEBUG_LIST_INSERT_HEAD(head, elm, field)
+#define QUEUEDEBUG_LIST_OP(elm, field)
+#define QUEUEDEBUG_LIST_POSTREMOVE(elm, field)
+#endif
+
+#define LIST_INIT(head) do { \
+ (head)->lh_first = LIST_END(head); \
+} while (/*CONSTCOND*/0)
+
+#define LIST_INSERT_AFTER(listelm, elm, field) do { \
+ QUEUEDEBUG_LIST_OP((listelm), field) \
+ if (((elm)->field.le_next = (listelm)->field.le_next) != \
+ LIST_END(head)) \
+ (listelm)->field.le_next->field.le_prev = \
+ &(elm)->field.le_next; \
+ (listelm)->field.le_next = (elm); \
+ (elm)->field.le_prev = &(listelm)->field.le_next; \
+} while (/*CONSTCOND*/0)
+
+#define LIST_INSERT_BEFORE(listelm, elm, field) do { \
+ QUEUEDEBUG_LIST_OP((listelm), field) \
+ (elm)->field.le_prev = (listelm)->field.le_prev; \
+ (elm)->field.le_next = (listelm); \
+ *(listelm)->field.le_prev = (elm); \
+ (listelm)->field.le_prev = &(elm)->field.le_next; \
+} while (/*CONSTCOND*/0)
+
+#define LIST_INSERT_HEAD(head, elm, field) do { \
+ QUEUEDEBUG_LIST_INSERT_HEAD((head), (elm), field) \
+ if (((elm)->field.le_next = (head)->lh_first) != LIST_END(head))\
+ (head)->lh_first->field.le_prev = &(elm)->field.le_next;\
+ (head)->lh_first = (elm); \
+ (elm)->field.le_prev = &(head)->lh_first; \
+} while (/*CONSTCOND*/0)
+
+#define LIST_REMOVE(elm, field) do { \
+ QUEUEDEBUG_LIST_OP((elm), field) \
+ if ((elm)->field.le_next != NULL) \
+ (elm)->field.le_next->field.le_prev = \
+ (elm)->field.le_prev; \
+ *(elm)->field.le_prev = (elm)->field.le_next; \
+ QUEUEDEBUG_LIST_POSTREMOVE((elm), field) \
+} while (/*CONSTCOND*/0)
+
+#define LIST_REPLACE(elm, elm2, field) do { \
+ if (((elm2)->field.le_next = (elm)->field.le_next) != NULL) \
+ (elm2)->field.le_next->field.le_prev = \
+ &(elm2)->field.le_next; \
+ (elm2)->field.le_prev = (elm)->field.le_prev; \
+ *(elm2)->field.le_prev = (elm2); \
+ QUEUEDEBUG_LIST_POSTREMOVE((elm), field) \
+} while (/*CONSTCOND*/0)
+
+/*
+ * Simple queue definitions.
+ */
+#define SIMPLEQ_HEAD(name, type) \
+struct name { \
+ struct type *sqh_first; /* first element */ \
+ struct type **sqh_last; /* addr of last next element */ \
+}
+
+#define SIMPLEQ_HEAD_INITIALIZER(head) \
+ { NULL, &(head).sqh_first }
+
+#define SIMPLEQ_ENTRY(type) \
+struct { \
+ struct type *sqe_next; /* next element */ \
+}
+
+/*
+ * Simple queue access methods.
+ */
+#define SIMPLEQ_FIRST(head) ((head)->sqh_first)
+#define SIMPLEQ_END(head) NULL
+#define SIMPLEQ_EMPTY(head) ((head)->sqh_first == SIMPLEQ_END(head))
+#define SIMPLEQ_NEXT(elm, field) ((elm)->field.sqe_next)
+
+#define SIMPLEQ_FOREACH(var, head, field) \
+ for ((var) = ((head)->sqh_first); \
+ (var) != SIMPLEQ_END(head); \
+ (var) = ((var)->field.sqe_next))
+
+#define SIMPLEQ_FOREACH_SAFE(var, head, field, next) \
+ for ((var) = ((head)->sqh_first); \
+ (var) != SIMPLEQ_END(head) && \
+ ((next = ((var)->field.sqe_next)), 1); \
+ (var) = (next))
+
+/*
+ * Simple queue functions.
+ */
+#define SIMPLEQ_INIT(head) do { \
+ (head)->sqh_first = NULL; \
+ (head)->sqh_last = &(head)->sqh_first; \
+} while (/*CONSTCOND*/0)
+
+#define SIMPLEQ_INSERT_HEAD(head, elm, field) do { \
+ if (((elm)->field.sqe_next = (head)->sqh_first) == NULL) \
+ (head)->sqh_last = &(elm)->field.sqe_next; \
+ (head)->sqh_first = (elm); \
+} while (/*CONSTCOND*/0)
+
+#define SIMPLEQ_INSERT_TAIL(head, elm, field) do { \
+ (elm)->field.sqe_next = NULL; \
+ *(head)->sqh_last = (elm); \
+ (head)->sqh_last = &(elm)->field.sqe_next; \
+} while (/*CONSTCOND*/0)
+
+#define SIMPLEQ_INSERT_AFTER(head, listelm, elm, field) do { \
+ if (((elm)->field.sqe_next = (listelm)->field.sqe_next) == NULL)\
+ (head)->sqh_last = &(elm)->field.sqe_next; \
+ (listelm)->field.sqe_next = (elm); \
+} while (/*CONSTCOND*/0)
+
+#define SIMPLEQ_REMOVE_HEAD(head, field) do { \
+ if (((head)->sqh_first = (head)->sqh_first->field.sqe_next) == NULL) \
+ (head)->sqh_last = &(head)->sqh_first; \
+} while (/*CONSTCOND*/0)
+
+#define SIMPLEQ_REMOVE_AFTER(head, elm, field) do { \
+ if (((elm)->field.sqe_next = (elm)->field.sqe_next->field.sqe_next) \
+ == NULL) \
+ (head)->sqh_last = &(elm)->field.sqe_next; \
+} while (/*CONSTCOND*/0)
+
+#define SIMPLEQ_REMOVE(head, elm, type, field) do { \
+ if ((head)->sqh_first == (elm)) { \
+ SIMPLEQ_REMOVE_HEAD((head), field); \
+ } else { \
+ struct type *curelm = (head)->sqh_first; \
+ while (curelm->field.sqe_next != (elm)) \
+ curelm = curelm->field.sqe_next; \
+ if ((curelm->field.sqe_next = \
+ curelm->field.sqe_next->field.sqe_next) == NULL) \
+ (head)->sqh_last = &(curelm)->field.sqe_next; \
+ } \
+} while (/*CONSTCOND*/0)
+
+#define SIMPLEQ_CONCAT(head1, head2) do { \
+ if (!SIMPLEQ_EMPTY((head2))) { \
+ *(head1)->sqh_last = (head2)->sqh_first; \
+ (head1)->sqh_last = (head2)->sqh_last; \
+ SIMPLEQ_INIT((head2)); \
+ } \
+} while (/*CONSTCOND*/0)
+
+#define SIMPLEQ_LAST(head, type, field) \
+ (SIMPLEQ_EMPTY((head)) ? \
+ NULL : \
+ ((struct type *)(void *) \
+ ((char *)((head)->sqh_last) - offsetof(struct type, field))))
+
+/*
+ * Tail queue definitions.
+ */
+#define _TAILQ_HEAD(name, type, qual) \
+struct name { \
+ qual type *tqh_first; /* first element */ \
+ qual type *qual *tqh_last; /* addr of last next element */ \
+}
+#define TAILQ_HEAD(name, type) _TAILQ_HEAD(name, struct type,)
+
+#define TAILQ_HEAD_INITIALIZER(head) \
+ { TAILQ_END(head), &(head).tqh_first }
+
+#define _TAILQ_ENTRY(type, qual) \
+struct { \
+ qual type *tqe_next; /* next element */ \
+ qual type *qual *tqe_prev; /* address of previous next element */\
+}
+#define TAILQ_ENTRY(type) _TAILQ_ENTRY(struct type,)
+
+/*
+ * Tail queue access methods.
+ */
+#define TAILQ_FIRST(head) ((head)->tqh_first)
+#define TAILQ_END(head) (NULL)
+#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
+#define TAILQ_LAST(head, headname) \
+ (*(((struct headname *)(void *)((head)->tqh_last))->tqh_last))
+#define TAILQ_PREV(elm, headname, field) \
+ (*(((struct headname *)(void *)((elm)->field.tqe_prev))->tqh_last))
+#define TAILQ_EMPTY(head) (TAILQ_FIRST(head) == TAILQ_END(head))
+
+
+#define TAILQ_FOREACH(var, head, field) \
+ for ((var) = ((head)->tqh_first); \
+ (var) != TAILQ_END(head); \
+ (var) = ((var)->field.tqe_next))
+
+#define TAILQ_FOREACH_SAFE(var, head, field, next) \
+ for ((var) = ((head)->tqh_first); \
+ (var) != TAILQ_END(head) && \
+ ((next) = TAILQ_NEXT(var, field), 1); (var) = (next))
+
+#define TAILQ_FOREACH_REVERSE(var, head, headname, field) \
+ for ((var) = TAILQ_LAST((head), headname); \
+ (var) != TAILQ_END(head); \
+ (var) = TAILQ_PREV((var), headname, field))
+
+#define TAILQ_FOREACH_REVERSE_SAFE(var, head, headname, field, prev) \
+ for ((var) = TAILQ_LAST((head), headname); \
+ (var) != TAILQ_END(head) && \
+ ((prev) = TAILQ_PREV((var), headname, field), 1); (var) = (prev))
+
+/*
+ * Tail queue functions.
+ */
+#if defined(QUEUEDEBUG)
+#define QUEUEDEBUG_TAILQ_INSERT_HEAD(head, elm, field) \
+ if ((head)->tqh_first && \
+ (head)->tqh_first->field.tqe_prev != &(head)->tqh_first) \
+ QUEUEDEBUG_ABORT("TAILQ_INSERT_HEAD %p %s:%d", (head), \
+ __FILE__, __LINE__);
+#define QUEUEDEBUG_TAILQ_INSERT_TAIL(head, elm, field) \
+ if (*(head)->tqh_last != NULL) \
+ QUEUEDEBUG_ABORT("TAILQ_INSERT_TAIL %p %s:%d", (head), \
+ __FILE__, __LINE__);
+#define QUEUEDEBUG_TAILQ_OP(elm, field) \
+ if ((elm)->field.tqe_next && \
+ (elm)->field.tqe_next->field.tqe_prev != \
+ &(elm)->field.tqe_next) \
+ QUEUEDEBUG_ABORT("TAILQ_* forw %p %s:%d", (elm), \
+ __FILE__, __LINE__); \
+ if (*(elm)->field.tqe_prev != (elm)) \
+ QUEUEDEBUG_ABORT("TAILQ_* back %p %s:%d", (elm), \
+ __FILE__, __LINE__);
+#define QUEUEDEBUG_TAILQ_PREREMOVE(head, elm, field) \
+ if ((elm)->field.tqe_next == NULL && \
+ (head)->tqh_last != &(elm)->field.tqe_next) \
+ QUEUEDEBUG_ABORT("TAILQ_PREREMOVE head %p elm %p %s:%d",\
+ (head), (elm), __FILE__, __LINE__);
+#define QUEUEDEBUG_TAILQ_POSTREMOVE(elm, field) \
+ (elm)->field.tqe_next = (void *)1L; \
+ (elm)->field.tqe_prev = (void *)1L;
+#else
+#define QUEUEDEBUG_TAILQ_INSERT_HEAD(head, elm, field)
+#define QUEUEDEBUG_TAILQ_INSERT_TAIL(head, elm, field)
+#define QUEUEDEBUG_TAILQ_OP(elm, field)
+#define QUEUEDEBUG_TAILQ_PREREMOVE(head, elm, field)
+#define QUEUEDEBUG_TAILQ_POSTREMOVE(elm, field)
+#endif
+
+#define TAILQ_INIT(head) do { \
+ (head)->tqh_first = TAILQ_END(head); \
+ (head)->tqh_last = &(head)->tqh_first; \
+} while (/*CONSTCOND*/0)
+
+#define TAILQ_INSERT_HEAD(head, elm, field) do { \
+ QUEUEDEBUG_TAILQ_INSERT_HEAD((head), (elm), field) \
+ if (((elm)->field.tqe_next = (head)->tqh_first) != TAILQ_END(head))\
+ (head)->tqh_first->field.tqe_prev = \
+ &(elm)->field.tqe_next; \
+ else \
+ (head)->tqh_last = &(elm)->field.tqe_next; \
+ (head)->tqh_first = (elm); \
+ (elm)->field.tqe_prev = &(head)->tqh_first; \
+} while (/*CONSTCOND*/0)
+
+#define TAILQ_INSERT_TAIL(head, elm, field) do { \
+ QUEUEDEBUG_TAILQ_INSERT_TAIL((head), (elm), field) \
+ (elm)->field.tqe_next = TAILQ_END(head); \
+ (elm)->field.tqe_prev = (head)->tqh_last; \
+ *(head)->tqh_last = (elm); \
+ (head)->tqh_last = &(elm)->field.tqe_next; \
+} while (/*CONSTCOND*/0)
+
+#define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \
+ QUEUEDEBUG_TAILQ_OP((listelm), field) \
+ if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != \
+ TAILQ_END(head)) \
+ (elm)->field.tqe_next->field.tqe_prev = \
+ &(elm)->field.tqe_next; \
+ else \
+ (head)->tqh_last = &(elm)->field.tqe_next; \
+ (listelm)->field.tqe_next = (elm); \
+ (elm)->field.tqe_prev = &(listelm)->field.tqe_next; \
+} while (/*CONSTCOND*/0)
+
+#define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \
+ QUEUEDEBUG_TAILQ_OP((listelm), field) \
+ (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
+ (elm)->field.tqe_next = (listelm); \
+ *(listelm)->field.tqe_prev = (elm); \
+ (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \
+} while (/*CONSTCOND*/0)
+
+#define TAILQ_REMOVE(head, elm, field) do { \
+ QUEUEDEBUG_TAILQ_PREREMOVE((head), (elm), field) \
+ QUEUEDEBUG_TAILQ_OP((elm), field) \
+ if (((elm)->field.tqe_next) != TAILQ_END(head)) \
+ (elm)->field.tqe_next->field.tqe_prev = \
+ (elm)->field.tqe_prev; \
+ else \
+ (head)->tqh_last = (elm)->field.tqe_prev; \
+ *(elm)->field.tqe_prev = (elm)->field.tqe_next; \
+ QUEUEDEBUG_TAILQ_POSTREMOVE((elm), field); \
+} while (/*CONSTCOND*/0)
+
+#define TAILQ_REPLACE(head, elm, elm2, field) do { \
+ if (((elm2)->field.tqe_next = (elm)->field.tqe_next) != \
+ TAILQ_END(head)) \
+ (elm2)->field.tqe_next->field.tqe_prev = \
+ &(elm2)->field.tqe_next; \
+ else \
+ (head)->tqh_last = &(elm2)->field.tqe_next; \
+ (elm2)->field.tqe_prev = (elm)->field.tqe_prev; \
+ *(elm2)->field.tqe_prev = (elm2); \
+ QUEUEDEBUG_TAILQ_POSTREMOVE((elm), field); \
+} while (/*CONSTCOND*/0)
+
+#define TAILQ_CONCAT(head1, head2, field) do { \
+ if (!TAILQ_EMPTY(head2)) { \
+ *(head1)->tqh_last = (head2)->tqh_first; \
+ (head2)->tqh_first->field.tqe_prev = (head1)->tqh_last; \
+ (head1)->tqh_last = (head2)->tqh_last; \
+ TAILQ_INIT((head2)); \
+ } \
+} while (/*CONSTCOND*/0)
+
+/*
+ * Singly-linked Tail queue declarations.
+ */
+#define STAILQ_HEAD(name, type) \
+struct name { \
+ struct type *stqh_first; /* first element */ \
+ struct type **stqh_last; /* addr of last next element */ \
+}
+
+#define STAILQ_HEAD_INITIALIZER(head) \
+ { NULL, &(head).stqh_first }
+
+#define STAILQ_ENTRY(type) \
+struct { \
+ struct type *stqe_next; /* next element */ \
+}
+
+/*
+ * Singly-linked Tail queue access methods.
+ */
+#define STAILQ_FIRST(head) ((head)->stqh_first)
+#define STAILQ_END(head) NULL
+#define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next)
+#define STAILQ_EMPTY(head) (STAILQ_FIRST(head) == STAILQ_END(head))
+
+/*
+ * Singly-linked Tail queue functions.
+ */
+#define STAILQ_INIT(head) do { \
+ (head)->stqh_first = NULL; \
+ (head)->stqh_last = &(head)->stqh_first; \
+} while (/*CONSTCOND*/0)
+
+#define STAILQ_INSERT_HEAD(head, elm, field) do { \
+ if (((elm)->field.stqe_next = (head)->stqh_first) == NULL) \
+ (head)->stqh_last = &(elm)->field.stqe_next; \
+ (head)->stqh_first = (elm); \
+} while (/*CONSTCOND*/0)
+
+#define STAILQ_INSERT_TAIL(head, elm, field) do { \
+ (elm)->field.stqe_next = NULL; \
+ *(head)->stqh_last = (elm); \
+ (head)->stqh_last = &(elm)->field.stqe_next; \
+} while (/*CONSTCOND*/0)
+
+#define STAILQ_INSERT_AFTER(head, listelm, elm, field) do { \
+ if (((elm)->field.stqe_next = (listelm)->field.stqe_next) == NULL)\
+ (head)->stqh_last = &(elm)->field.stqe_next; \
+ (listelm)->field.stqe_next = (elm); \
+} while (/*CONSTCOND*/0)
+
+#define STAILQ_REMOVE_HEAD(head, field) do { \
+ if (((head)->stqh_first = (head)->stqh_first->field.stqe_next) == NULL) \
+ (head)->stqh_last = &(head)->stqh_first; \
+} while (/*CONSTCOND*/0)
+
+#define STAILQ_REMOVE(head, elm, type, field) do { \
+ if ((head)->stqh_first == (elm)) { \
+ STAILQ_REMOVE_HEAD((head), field); \
+ } else { \
+ struct type *curelm = (head)->stqh_first; \
+ while (curelm->field.stqe_next != (elm)) \
+ curelm = curelm->field.stqe_next; \
+ if ((curelm->field.stqe_next = \
+ curelm->field.stqe_next->field.stqe_next) == NULL) \
+ (head)->stqh_last = &(curelm)->field.stqe_next; \
+ } \
+} while (/*CONSTCOND*/0)
+
+#define STAILQ_FOREACH(var, head, field) \
+ for ((var) = ((head)->stqh_first); \
+ (var); \
+ (var) = ((var)->field.stqe_next))
+
+#define STAILQ_FOREACH_SAFE(var, head, field, tvar) \
+ for ((var) = STAILQ_FIRST((head)); \
+ (var) && ((tvar) = STAILQ_NEXT((var), field), 1); \
+ (var) = (tvar))
+
+#define STAILQ_CONCAT(head1, head2) do { \
+ if (!STAILQ_EMPTY((head2))) { \
+ *(head1)->stqh_last = (head2)->stqh_first; \
+ (head1)->stqh_last = (head2)->stqh_last; \
+ STAILQ_INIT((head2)); \
+ } \
+} while (/*CONSTCOND*/0)
+
+#define STAILQ_LAST(head, type, field) \
+ (STAILQ_EMPTY((head)) ? \
+ NULL : \
+ ((struct type *)(void *) \
+ ((char *)((head)->stqh_last) - offsetof(struct type, field))))
+
+
+#ifndef _KERNEL
+/*
+ * Circular queue definitions. Do not use. We still keep the macros
+ * for compatibility but because of pointer aliasing issues their use
+ * is discouraged!
+ */
+
+/*
+ * __launder_type(): We use this ugly hack to work around the the compiler
+ * noticing that two types may not alias each other and elide tests in code.
+ * We hit this in the CIRCLEQ macros when comparing 'struct name *' and
+ * 'struct type *' (see CIRCLEQ_HEAD()). Modern compilers (such as GCC
+ * 4.8) declare these comparisons as always false, causing the code to
+ * not run as designed.
+ *
+ * This hack is only to be used for comparisons and thus can be fully const.
+ * Do not use for assignment.
+ *
+ * If we ever choose to change the ABI of the CIRCLEQ macros, we could fix
+ * this by changing the head/tail sentinal values, but see the note above
+ * this one.
+ */
+static __inline const void * __launder_type(const void *);
+static __inline const void *
+__launder_type(const void *__x)
+{
+ __asm __volatile("" : "+r" (__x));
+ return __x;
+}
+
+#if defined(QUEUEDEBUG)
+#define QUEUEDEBUG_CIRCLEQ_HEAD(head, field) \
+ if ((head)->cqh_first != CIRCLEQ_ENDC(head) && \
+ (head)->cqh_first->field.cqe_prev != CIRCLEQ_ENDC(head)) \
+ QUEUEDEBUG_ABORT("CIRCLEQ head forw %p %s:%d", (head), \
+ __FILE__, __LINE__); \
+ if ((head)->cqh_last != CIRCLEQ_ENDC(head) && \
+ (head)->cqh_last->field.cqe_next != CIRCLEQ_ENDC(head)) \
+ QUEUEDEBUG_ABORT("CIRCLEQ head back %p %s:%d", (head), \
+ __FILE__, __LINE__);
+#define QUEUEDEBUG_CIRCLEQ_ELM(head, elm, field) \
+ if ((elm)->field.cqe_next == CIRCLEQ_ENDC(head)) { \
+ if ((head)->cqh_last != (elm)) \
+ QUEUEDEBUG_ABORT("CIRCLEQ elm last %p %s:%d", \
+ (elm), __FILE__, __LINE__); \
+ } else { \
+ if ((elm)->field.cqe_next->field.cqe_prev != (elm)) \
+ QUEUEDEBUG_ABORT("CIRCLEQ elm forw %p %s:%d", \
+ (elm), __FILE__, __LINE__); \
+ } \
+ if ((elm)->field.cqe_prev == CIRCLEQ_ENDC(head)) { \
+ if ((head)->cqh_first != (elm)) \
+ QUEUEDEBUG_ABORT("CIRCLEQ elm first %p %s:%d", \
+ (elm), __FILE__, __LINE__); \
+ } else { \
+ if ((elm)->field.cqe_prev->field.cqe_next != (elm)) \
+ QUEUEDEBUG_ABORT("CIRCLEQ elm prev %p %s:%d", \
+ (elm), __FILE__, __LINE__); \
+ }
+#define QUEUEDEBUG_CIRCLEQ_POSTREMOVE(elm, field) \
+ (elm)->field.cqe_next = (void *)1L; \
+ (elm)->field.cqe_prev = (void *)1L;
+#else
+#define QUEUEDEBUG_CIRCLEQ_HEAD(head, field)
+#define QUEUEDEBUG_CIRCLEQ_ELM(head, elm, field)
+#define QUEUEDEBUG_CIRCLEQ_POSTREMOVE(elm, field)
+#endif
+
+#define CIRCLEQ_HEAD(name, type) \
+struct name { \
+ struct type *cqh_first; /* first element */ \
+ struct type *cqh_last; /* last element */ \
+}
+
+#define CIRCLEQ_HEAD_INITIALIZER(head) \
+ { CIRCLEQ_END(&head), CIRCLEQ_END(&head) }
+
+#define CIRCLEQ_ENTRY(type) \
+struct { \
+ struct type *cqe_next; /* next element */ \
+ struct type *cqe_prev; /* previous element */ \
+}
+
+/*
+ * Circular queue functions.
+ */
+#define CIRCLEQ_INIT(head) do { \
+ (head)->cqh_first = CIRCLEQ_END(head); \
+ (head)->cqh_last = CIRCLEQ_END(head); \
+} while (/*CONSTCOND*/0)
+
+#define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \
+ QUEUEDEBUG_CIRCLEQ_HEAD((head), field) \
+ QUEUEDEBUG_CIRCLEQ_ELM((head), (listelm), field) \
+ (elm)->field.cqe_next = (listelm)->field.cqe_next; \
+ (elm)->field.cqe_prev = (listelm); \
+ if ((listelm)->field.cqe_next == CIRCLEQ_ENDC(head)) \
+ (head)->cqh_last = (elm); \
+ else \
+ (listelm)->field.cqe_next->field.cqe_prev = (elm); \
+ (listelm)->field.cqe_next = (elm); \
+} while (/*CONSTCOND*/0)
+
+#define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \
+ QUEUEDEBUG_CIRCLEQ_HEAD((head), field) \
+ QUEUEDEBUG_CIRCLEQ_ELM((head), (listelm), field) \
+ (elm)->field.cqe_next = (listelm); \
+ (elm)->field.cqe_prev = (listelm)->field.cqe_prev; \
+ if ((listelm)->field.cqe_prev == CIRCLEQ_ENDC(head)) \
+ (head)->cqh_first = (elm); \
+ else \
+ (listelm)->field.cqe_prev->field.cqe_next = (elm); \
+ (listelm)->field.cqe_prev = (elm); \
+} while (/*CONSTCOND*/0)
+
+#define CIRCLEQ_INSERT_HEAD(head, elm, field) do { \
+ QUEUEDEBUG_CIRCLEQ_HEAD((head), field) \
+ (elm)->field.cqe_next = (head)->cqh_first; \
+ (elm)->field.cqe_prev = CIRCLEQ_END(head); \
+ if ((head)->cqh_last == CIRCLEQ_ENDC(head)) \
+ (head)->cqh_last = (elm); \
+ else \
+ (head)->cqh_first->field.cqe_prev = (elm); \
+ (head)->cqh_first = (elm); \
+} while (/*CONSTCOND*/0)
+
+#define CIRCLEQ_INSERT_TAIL(head, elm, field) do { \
+ QUEUEDEBUG_CIRCLEQ_HEAD((head), field) \
+ (elm)->field.cqe_next = CIRCLEQ_END(head); \
+ (elm)->field.cqe_prev = (head)->cqh_last; \
+ if ((head)->cqh_first == CIRCLEQ_ENDC(head)) \
+ (head)->cqh_first = (elm); \
+ else \
+ (head)->cqh_last->field.cqe_next = (elm); \
+ (head)->cqh_last = (elm); \
+} while (/*CONSTCOND*/0)
+
+#define CIRCLEQ_REMOVE(head, elm, field) do { \
+ QUEUEDEBUG_CIRCLEQ_HEAD((head), field) \
+ QUEUEDEBUG_CIRCLEQ_ELM((head), (elm), field) \
+ if ((elm)->field.cqe_next == CIRCLEQ_ENDC(head)) \
+ (head)->cqh_last = (elm)->field.cqe_prev; \
+ else \
+ (elm)->field.cqe_next->field.cqe_prev = \
+ (elm)->field.cqe_prev; \
+ if ((elm)->field.cqe_prev == CIRCLEQ_ENDC(head)) \
+ (head)->cqh_first = (elm)->field.cqe_next; \
+ else \
+ (elm)->field.cqe_prev->field.cqe_next = \
+ (elm)->field.cqe_next; \
+ QUEUEDEBUG_CIRCLEQ_POSTREMOVE((elm), field) \
+} while (/*CONSTCOND*/0)
+
+#define CIRCLEQ_FOREACH(var, head, field) \
+ for ((var) = ((head)->cqh_first); \
+ (var) != CIRCLEQ_ENDC(head); \
+ (var) = ((var)->field.cqe_next))
+
+#define CIRCLEQ_FOREACH_REVERSE(var, head, field) \
+ for ((var) = ((head)->cqh_last); \
+ (var) != CIRCLEQ_ENDC(head); \
+ (var) = ((var)->field.cqe_prev))
+
+/*
+ * Circular queue access methods.
+ */
+#define CIRCLEQ_FIRST(head) ((head)->cqh_first)
+#define CIRCLEQ_LAST(head) ((head)->cqh_last)
+/* For comparisons */
+#define CIRCLEQ_ENDC(head) (__launder_type(head))
+/* For assignments */
+#define CIRCLEQ_END(head) ((void *)(head))
+#define CIRCLEQ_NEXT(elm, field) ((elm)->field.cqe_next)
+#define CIRCLEQ_PREV(elm, field) ((elm)->field.cqe_prev)
+#define CIRCLEQ_EMPTY(head) \
+ (CIRCLEQ_FIRST(head) == CIRCLEQ_ENDC(head))
+
+#define CIRCLEQ_LOOP_NEXT(head, elm, field) \
+ (((elm)->field.cqe_next == CIRCLEQ_ENDC(head)) \
+ ? ((head)->cqh_first) \
+ : (elm->field.cqe_next))
+#define CIRCLEQ_LOOP_PREV(head, elm, field) \
+ (((elm)->field.cqe_prev == CIRCLEQ_ENDC(head)) \
+ ? ((head)->cqh_last) \
+ : (elm->field.cqe_prev))
+#endif /* !_KERNEL */
+
+#endif /* !_SYS_QUEUE_H_ */
diff --git a/system/libc-dev/sys-tree.h b/system/libc-dev/sys-tree.h
new file mode 100644
index 000000000..eaea56aae
--- /dev/null
+++ b/system/libc-dev/sys-tree.h
@@ -0,0 +1,761 @@
+/* $NetBSD: tree.h,v 1.20 2013/09/14 13:20:45 joerg Exp $ */
+/* $OpenBSD: tree.h,v 1.13 2011/07/09 00:19:45 pirofti Exp $ */
+/*
+ * Copyright 2002 Niels Provos <provos@citi.umich.edu>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _SYS_TREE_H_
+#define _SYS_TREE_H_
+
+/*
+ * This file defines data structures for different types of trees:
+ * splay trees and red-black trees.
+ *
+ * A splay tree is a self-organizing data structure. Every operation
+ * on the tree causes a splay to happen. The splay moves the requested
+ * node to the root of the tree and partly rebalances it.
+ *
+ * This has the benefit that request locality causes faster lookups as
+ * the requested nodes move to the top of the tree. On the other hand,
+ * every lookup causes memory writes.
+ *
+ * The Balance Theorem bounds the total access time for m operations
+ * and n inserts on an initially empty tree as O((m + n)lg n). The
+ * amortized cost for a sequence of m accesses to a splay tree is O(lg n);
+ *
+ * A red-black tree is a binary search tree with the node color as an
+ * extra attribute. It fulfills a set of conditions:
+ * - every search path from the root to a leaf consists of the
+ * same number of black nodes,
+ * - each red node (except for the root) has a black parent,
+ * - each leaf node is black.
+ *
+ * Every operation on a red-black tree is bounded as O(lg n).
+ * The maximum height of a red-black tree is 2lg (n+1).
+ */
+
+#define SPLAY_HEAD(name, type) \
+struct name { \
+ struct type *sph_root; /* root of the tree */ \
+}
+
+#define SPLAY_INITIALIZER(root) \
+ { NULL }
+
+#define SPLAY_INIT(root) do { \
+ (root)->sph_root = NULL; \
+} while (/*CONSTCOND*/ 0)
+
+#define SPLAY_ENTRY(type) \
+struct { \
+ struct type *spe_left; /* left element */ \
+ struct type *spe_right; /* right element */ \
+}
+
+#define SPLAY_LEFT(elm, field) (elm)->field.spe_left
+#define SPLAY_RIGHT(elm, field) (elm)->field.spe_right
+#define SPLAY_ROOT(head) (head)->sph_root
+#define SPLAY_EMPTY(head) (SPLAY_ROOT(head) == NULL)
+
+/* SPLAY_ROTATE_{LEFT,RIGHT} expect that tmp hold SPLAY_{RIGHT,LEFT} */
+#define SPLAY_ROTATE_RIGHT(head, tmp, field) do { \
+ SPLAY_LEFT((head)->sph_root, field) = SPLAY_RIGHT(tmp, field); \
+ SPLAY_RIGHT(tmp, field) = (head)->sph_root; \
+ (head)->sph_root = tmp; \
+} while (/*CONSTCOND*/ 0)
+
+#define SPLAY_ROTATE_LEFT(head, tmp, field) do { \
+ SPLAY_RIGHT((head)->sph_root, field) = SPLAY_LEFT(tmp, field); \
+ SPLAY_LEFT(tmp, field) = (head)->sph_root; \
+ (head)->sph_root = tmp; \
+} while (/*CONSTCOND*/ 0)
+
+#define SPLAY_LINKLEFT(head, tmp, field) do { \
+ SPLAY_LEFT(tmp, field) = (head)->sph_root; \
+ tmp = (head)->sph_root; \
+ (head)->sph_root = SPLAY_LEFT((head)->sph_root, field); \
+} while (/*CONSTCOND*/ 0)
+
+#define SPLAY_LINKRIGHT(head, tmp, field) do { \
+ SPLAY_RIGHT(tmp, field) = (head)->sph_root; \
+ tmp = (head)->sph_root; \
+ (head)->sph_root = SPLAY_RIGHT((head)->sph_root, field); \
+} while (/*CONSTCOND*/ 0)
+
+#define SPLAY_ASSEMBLE(head, node, left, right, field) do { \
+ SPLAY_RIGHT(left, field) = SPLAY_LEFT((head)->sph_root, field); \
+ SPLAY_LEFT(right, field) = SPLAY_RIGHT((head)->sph_root, field);\
+ SPLAY_LEFT((head)->sph_root, field) = SPLAY_RIGHT(node, field); \
+ SPLAY_RIGHT((head)->sph_root, field) = SPLAY_LEFT(node, field); \
+} while (/*CONSTCOND*/ 0)
+
+/* Generates prototypes and inline functions */
+
+#define SPLAY_PROTOTYPE(name, type, field, cmp) \
+void name##_SPLAY(struct name *, struct type *); \
+void name##_SPLAY_MINMAX(struct name *, int); \
+struct type *name##_SPLAY_INSERT(struct name *, struct type *); \
+struct type *name##_SPLAY_REMOVE(struct name *, struct type *); \
+ \
+/* Finds the node with the same key as elm */ \
+static __inline struct type * \
+name##_SPLAY_FIND(struct name *head, struct type *elm) \
+{ \
+ if (SPLAY_EMPTY(head)) \
+ return(NULL); \
+ name##_SPLAY(head, elm); \
+ if ((cmp)(elm, (head)->sph_root) == 0) \
+ return (head->sph_root); \
+ return (NULL); \
+} \
+ \
+static __inline __unused struct type * \
+name##_SPLAY_NEXT(struct name *head, struct type *elm) \
+{ \
+ name##_SPLAY(head, elm); \
+ if (SPLAY_RIGHT(elm, field) != NULL) { \
+ elm = SPLAY_RIGHT(elm, field); \
+ while (SPLAY_LEFT(elm, field) != NULL) { \
+ elm = SPLAY_LEFT(elm, field); \
+ } \
+ } else \
+ elm = NULL; \
+ return (elm); \
+} \
+ \
+static __unused __inline struct type * \
+name##_SPLAY_MIN_MAX(struct name *head, int val) \
+{ \
+ name##_SPLAY_MINMAX(head, val); \
+ return (SPLAY_ROOT(head)); \
+}
+
+/* Main splay operation.
+ * Moves node close to the key of elm to top
+ */
+#define SPLAY_GENERATE(name, type, field, cmp) \
+struct type * \
+name##_SPLAY_INSERT(struct name *head, struct type *elm) \
+{ \
+ if (SPLAY_EMPTY(head)) { \
+ SPLAY_LEFT(elm, field) = SPLAY_RIGHT(elm, field) = NULL; \
+ } else { \
+ int __comp; \
+ name##_SPLAY(head, elm); \
+ __comp = (cmp)(elm, (head)->sph_root); \
+ if(__comp < 0) { \
+ SPLAY_LEFT(elm, field) = SPLAY_LEFT((head)->sph_root, field);\
+ SPLAY_RIGHT(elm, field) = (head)->sph_root; \
+ SPLAY_LEFT((head)->sph_root, field) = NULL; \
+ } else if (__comp > 0) { \
+ SPLAY_RIGHT(elm, field) = SPLAY_RIGHT((head)->sph_root, field);\
+ SPLAY_LEFT(elm, field) = (head)->sph_root; \
+ SPLAY_RIGHT((head)->sph_root, field) = NULL; \
+ } else \
+ return ((head)->sph_root); \
+ } \
+ (head)->sph_root = (elm); \
+ return (NULL); \
+} \
+ \
+struct type * \
+name##_SPLAY_REMOVE(struct name *head, struct type *elm) \
+{ \
+ struct type *__tmp; \
+ if (SPLAY_EMPTY(head)) \
+ return (NULL); \
+ name##_SPLAY(head, elm); \
+ if ((cmp)(elm, (head)->sph_root) == 0) { \
+ if (SPLAY_LEFT((head)->sph_root, field) == NULL) { \
+ (head)->sph_root = SPLAY_RIGHT((head)->sph_root, field);\
+ } else { \
+ __tmp = SPLAY_RIGHT((head)->sph_root, field); \
+ (head)->sph_root = SPLAY_LEFT((head)->sph_root, field);\
+ name##_SPLAY(head, elm); \
+ SPLAY_RIGHT((head)->sph_root, field) = __tmp; \
+ } \
+ return (elm); \
+ } \
+ return (NULL); \
+} \
+ \
+void \
+name##_SPLAY(struct name *head, struct type *elm) \
+{ \
+ struct type __node, *__left, *__right, *__tmp; \
+ int __comp; \
+\
+ SPLAY_LEFT(&__node, field) = SPLAY_RIGHT(&__node, field) = NULL;\
+ __left = __right = &__node; \
+\
+ while ((__comp = (cmp)(elm, (head)->sph_root)) != 0) { \
+ if (__comp < 0) { \
+ __tmp = SPLAY_LEFT((head)->sph_root, field); \
+ if (__tmp == NULL) \
+ break; \
+ if ((cmp)(elm, __tmp) < 0){ \
+ SPLAY_ROTATE_RIGHT(head, __tmp, field); \
+ if (SPLAY_LEFT((head)->sph_root, field) == NULL)\
+ break; \
+ } \
+ SPLAY_LINKLEFT(head, __right, field); \
+ } else if (__comp > 0) { \
+ __tmp = SPLAY_RIGHT((head)->sph_root, field); \
+ if (__tmp == NULL) \
+ break; \
+ if ((cmp)(elm, __tmp) > 0){ \
+ SPLAY_ROTATE_LEFT(head, __tmp, field); \
+ if (SPLAY_RIGHT((head)->sph_root, field) == NULL)\
+ break; \
+ } \
+ SPLAY_LINKRIGHT(head, __left, field); \
+ } \
+ } \
+ SPLAY_ASSEMBLE(head, &__node, __left, __right, field); \
+} \
+ \
+/* Splay with either the minimum or the maximum element \
+ * Used to find minimum or maximum element in tree. \
+ */ \
+void name##_SPLAY_MINMAX(struct name *head, int __comp) \
+{ \
+ struct type __node, *__left, *__right, *__tmp; \
+\
+ SPLAY_LEFT(&__node, field) = SPLAY_RIGHT(&__node, field) = NULL;\
+ __left = __right = &__node; \
+\
+ while (1) { \
+ if (__comp < 0) { \
+ __tmp = SPLAY_LEFT((head)->sph_root, field); \
+ if (__tmp == NULL) \
+ break; \
+ if (__comp < 0){ \
+ SPLAY_ROTATE_RIGHT(head, __tmp, field); \
+ if (SPLAY_LEFT((head)->sph_root, field) == NULL)\
+ break; \
+ } \
+ SPLAY_LINKLEFT(head, __right, field); \
+ } else if (__comp > 0) { \
+ __tmp = SPLAY_RIGHT((head)->sph_root, field); \
+ if (__tmp == NULL) \
+ break; \
+ if (__comp > 0) { \
+ SPLAY_ROTATE_LEFT(head, __tmp, field); \
+ if (SPLAY_RIGHT((head)->sph_root, field) == NULL)\
+ break; \
+ } \
+ SPLAY_LINKRIGHT(head, __left, field); \
+ } \
+ } \
+ SPLAY_ASSEMBLE(head, &__node, __left, __right, field); \
+}
+
+#define SPLAY_NEGINF -1
+#define SPLAY_INF 1
+
+#define SPLAY_INSERT(name, x, y) name##_SPLAY_INSERT(x, y)
+#define SPLAY_REMOVE(name, x, y) name##_SPLAY_REMOVE(x, y)
+#define SPLAY_FIND(name, x, y) name##_SPLAY_FIND(x, y)
+#define SPLAY_NEXT(name, x, y) name##_SPLAY_NEXT(x, y)
+#define SPLAY_MIN(name, x) (SPLAY_EMPTY(x) ? NULL \
+ : name##_SPLAY_MIN_MAX(x, SPLAY_NEGINF))
+#define SPLAY_MAX(name, x) (SPLAY_EMPTY(x) ? NULL \
+ : name##_SPLAY_MIN_MAX(x, SPLAY_INF))
+
+#define SPLAY_FOREACH(x, name, head) \
+ for ((x) = SPLAY_MIN(name, head); \
+ (x) != NULL; \
+ (x) = SPLAY_NEXT(name, head, x))
+
+/* Macros that define a red-black tree */
+#define RB_HEAD(name, type) \
+struct name { \
+ struct type *rbh_root; /* root of the tree */ \
+}
+
+#define RB_INITIALIZER(root) \
+ { NULL }
+
+#define RB_INIT(root) do { \
+ (root)->rbh_root = NULL; \
+} while (/*CONSTCOND*/ 0)
+
+#define RB_BLACK 0
+#define RB_RED 1
+#define RB_ENTRY(type) \
+struct { \
+ struct type *rbe_left; /* left element */ \
+ struct type *rbe_right; /* right element */ \
+ struct type *rbe_parent; /* parent element */ \
+ int rbe_color; /* node color */ \
+}
+
+#define RB_LEFT(elm, field) (elm)->field.rbe_left
+#define RB_RIGHT(elm, field) (elm)->field.rbe_right
+#define RB_PARENT(elm, field) (elm)->field.rbe_parent
+#define RB_COLOR(elm, field) (elm)->field.rbe_color
+#define RB_ROOT(head) (head)->rbh_root
+#define RB_EMPTY(head) (RB_ROOT(head) == NULL)
+
+#define RB_SET(elm, parent, field) do { \
+ RB_PARENT(elm, field) = parent; \
+ RB_LEFT(elm, field) = RB_RIGHT(elm, field) = NULL; \
+ RB_COLOR(elm, field) = RB_RED; \
+} while (/*CONSTCOND*/ 0)
+
+#define RB_SET_BLACKRED(black, red, field) do { \
+ RB_COLOR(black, field) = RB_BLACK; \
+ RB_COLOR(red, field) = RB_RED; \
+} while (/*CONSTCOND*/ 0)
+
+#ifndef RB_AUGMENT
+#define RB_AUGMENT(x) do {} while (/*CONSTCOND*/ 0)
+#endif
+
+#define RB_ROTATE_LEFT(head, elm, tmp, field) do { \
+ (tmp) = RB_RIGHT(elm, field); \
+ if ((RB_RIGHT(elm, field) = RB_LEFT(tmp, field)) != NULL) { \
+ RB_PARENT(RB_LEFT(tmp, field), field) = (elm); \
+ } \
+ RB_AUGMENT(elm); \
+ if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field)) != NULL) { \
+ if ((elm) == RB_LEFT(RB_PARENT(elm, field), field)) \
+ RB_LEFT(RB_PARENT(elm, field), field) = (tmp); \
+ else \
+ RB_RIGHT(RB_PARENT(elm, field), field) = (tmp); \
+ } else \
+ (head)->rbh_root = (tmp); \
+ RB_LEFT(tmp, field) = (elm); \
+ RB_PARENT(elm, field) = (tmp); \
+ RB_AUGMENT(tmp); \
+ if ((RB_PARENT(tmp, field))) \
+ RB_AUGMENT(RB_PARENT(tmp, field)); \
+} while (/*CONSTCOND*/ 0)
+
+#define RB_ROTATE_RIGHT(head, elm, tmp, field) do { \
+ (tmp) = RB_LEFT(elm, field); \
+ if ((RB_LEFT(elm, field) = RB_RIGHT(tmp, field)) != NULL) { \
+ RB_PARENT(RB_RIGHT(tmp, field), field) = (elm); \
+ } \
+ RB_AUGMENT(elm); \
+ if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field)) != NULL) { \
+ if ((elm) == RB_LEFT(RB_PARENT(elm, field), field)) \
+ RB_LEFT(RB_PARENT(elm, field), field) = (tmp); \
+ else \
+ RB_RIGHT(RB_PARENT(elm, field), field) = (tmp); \
+ } else \
+ (head)->rbh_root = (tmp); \
+ RB_RIGHT(tmp, field) = (elm); \
+ RB_PARENT(elm, field) = (tmp); \
+ RB_AUGMENT(tmp); \
+ if ((RB_PARENT(tmp, field))) \
+ RB_AUGMENT(RB_PARENT(tmp, field)); \
+} while (/*CONSTCOND*/ 0)
+
+/* Generates prototypes and inline functions */
+#define RB_PROTOTYPE(name, type, field, cmp) \
+ RB_PROTOTYPE_INTERNAL(name, type, field, cmp,)
+#define RB_PROTOTYPE_STATIC(name, type, field, cmp) \
+ RB_PROTOTYPE_INTERNAL(name, type, field, cmp, __unused static)
+#define RB_PROTOTYPE_INTERNAL(name, type, field, cmp, attr) \
+attr void name##_RB_INSERT_COLOR(struct name *, struct type *); \
+attr void name##_RB_REMOVE_COLOR(struct name *, struct type *, struct type *);\
+attr struct type *name##_RB_REMOVE(struct name *, struct type *); \
+attr struct type *name##_RB_INSERT(struct name *, struct type *); \
+attr struct type *name##_RB_FIND(struct name *, struct type *); \
+attr struct type *name##_RB_NFIND(struct name *, struct type *); \
+attr struct type *name##_RB_NEXT(struct type *); \
+attr struct type *name##_RB_PREV(struct type *); \
+attr struct type *name##_RB_MINMAX(struct name *, int); \
+ \
+
+/* Main rb operation.
+ * Moves node close to the key of elm to top
+ */
+#define RB_GENERATE(name, type, field, cmp) \
+ RB_GENERATE_INTERNAL(name, type, field, cmp,)
+#define RB_GENERATE_STATIC(name, type, field, cmp) \
+ RB_GENERATE_INTERNAL(name, type, field, cmp, __unused static)
+#define RB_GENERATE_INTERNAL(name, type, field, cmp, attr) \
+attr void \
+name##_RB_INSERT_COLOR(struct name *head, struct type *elm) \
+{ \
+ struct type *parent, *gparent, *tmp; \
+ while ((parent = RB_PARENT(elm, field)) != NULL && \
+ RB_COLOR(parent, field) == RB_RED) { \
+ gparent = RB_PARENT(parent, field); \
+ if (parent == RB_LEFT(gparent, field)) { \
+ tmp = RB_RIGHT(gparent, field); \
+ if (tmp && RB_COLOR(tmp, field) == RB_RED) { \
+ RB_COLOR(tmp, field) = RB_BLACK; \
+ RB_SET_BLACKRED(parent, gparent, field);\
+ elm = gparent; \
+ continue; \
+ } \
+ if (RB_RIGHT(parent, field) == elm) { \
+ RB_ROTATE_LEFT(head, parent, tmp, field);\
+ tmp = parent; \
+ parent = elm; \
+ elm = tmp; \
+ } \
+ RB_SET_BLACKRED(parent, gparent, field); \
+ RB_ROTATE_RIGHT(head, gparent, tmp, field); \
+ } else { \
+ tmp = RB_LEFT(gparent, field); \
+ if (tmp && RB_COLOR(tmp, field) == RB_RED) { \
+ RB_COLOR(tmp, field) = RB_BLACK; \
+ RB_SET_BLACKRED(parent, gparent, field);\
+ elm = gparent; \
+ continue; \
+ } \
+ if (RB_LEFT(parent, field) == elm) { \
+ RB_ROTATE_RIGHT(head, parent, tmp, field);\
+ tmp = parent; \
+ parent = elm; \
+ elm = tmp; \
+ } \
+ RB_SET_BLACKRED(parent, gparent, field); \
+ RB_ROTATE_LEFT(head, gparent, tmp, field); \
+ } \
+ } \
+ RB_COLOR(head->rbh_root, field) = RB_BLACK; \
+} \
+ \
+attr void \
+name##_RB_REMOVE_COLOR(struct name *head, struct type *parent, struct type *elm) \
+{ \
+ struct type *tmp; \
+ while ((elm == NULL || RB_COLOR(elm, field) == RB_BLACK) && \
+ elm != RB_ROOT(head)) { \
+ if (RB_LEFT(parent, field) == elm) { \
+ tmp = RB_RIGHT(parent, field); \
+ if (RB_COLOR(tmp, field) == RB_RED) { \
+ RB_SET_BLACKRED(tmp, parent, field); \
+ RB_ROTATE_LEFT(head, parent, tmp, field);\
+ tmp = RB_RIGHT(parent, field); \
+ } \
+ if ((RB_LEFT(tmp, field) == NULL || \
+ RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) &&\
+ (RB_RIGHT(tmp, field) == NULL || \
+ RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK)) {\
+ RB_COLOR(tmp, field) = RB_RED; \
+ elm = parent; \
+ parent = RB_PARENT(elm, field); \
+ } else { \
+ if (RB_RIGHT(tmp, field) == NULL || \
+ RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK) {\
+ struct type *oleft; \
+ if ((oleft = RB_LEFT(tmp, field)) \
+ != NULL) \
+ RB_COLOR(oleft, field) = RB_BLACK;\
+ RB_COLOR(tmp, field) = RB_RED; \
+ RB_ROTATE_RIGHT(head, tmp, oleft, field);\
+ tmp = RB_RIGHT(parent, field); \
+ } \
+ RB_COLOR(tmp, field) = RB_COLOR(parent, field);\
+ RB_COLOR(parent, field) = RB_BLACK; \
+ if (RB_RIGHT(tmp, field)) \
+ RB_COLOR(RB_RIGHT(tmp, field), field) = RB_BLACK;\
+ RB_ROTATE_LEFT(head, parent, tmp, field);\
+ elm = RB_ROOT(head); \
+ break; \
+ } \
+ } else { \
+ tmp = RB_LEFT(parent, field); \
+ if (RB_COLOR(tmp, field) == RB_RED) { \
+ RB_SET_BLACKRED(tmp, parent, field); \
+ RB_ROTATE_RIGHT(head, parent, tmp, field);\
+ tmp = RB_LEFT(parent, field); \
+ } \
+ if ((RB_LEFT(tmp, field) == NULL || \
+ RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) &&\
+ (RB_RIGHT(tmp, field) == NULL || \
+ RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK)) {\
+ RB_COLOR(tmp, field) = RB_RED; \
+ elm = parent; \
+ parent = RB_PARENT(elm, field); \
+ } else { \
+ if (RB_LEFT(tmp, field) == NULL || \
+ RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) {\
+ struct type *oright; \
+ if ((oright = RB_RIGHT(tmp, field)) \
+ != NULL) \
+ RB_COLOR(oright, field) = RB_BLACK;\
+ RB_COLOR(tmp, field) = RB_RED; \
+ RB_ROTATE_LEFT(head, tmp, oright, field);\
+ tmp = RB_LEFT(parent, field); \
+ } \
+ RB_COLOR(tmp, field) = RB_COLOR(parent, field);\
+ RB_COLOR(parent, field) = RB_BLACK; \
+ if (RB_LEFT(tmp, field)) \
+ RB_COLOR(RB_LEFT(tmp, field), field) = RB_BLACK;\
+ RB_ROTATE_RIGHT(head, parent, tmp, field);\
+ elm = RB_ROOT(head); \
+ break; \
+ } \
+ } \
+ } \
+ if (elm) \
+ RB_COLOR(elm, field) = RB_BLACK; \
+} \
+ \
+attr struct type * \
+name##_RB_REMOVE(struct name *head, struct type *elm) \
+{ \
+ struct type *child, *parent, *old = elm; \
+ int color; \
+ if (RB_LEFT(elm, field) == NULL) \
+ child = RB_RIGHT(elm, field); \
+ else if (RB_RIGHT(elm, field) == NULL) \
+ child = RB_LEFT(elm, field); \
+ else { \
+ struct type *left; \
+ elm = RB_RIGHT(elm, field); \
+ while ((left = RB_LEFT(elm, field)) != NULL) \
+ elm = left; \
+ child = RB_RIGHT(elm, field); \
+ parent = RB_PARENT(elm, field); \
+ color = RB_COLOR(elm, field); \
+ if (child) \
+ RB_PARENT(child, field) = parent; \
+ if (parent) { \
+ if (RB_LEFT(parent, field) == elm) \
+ RB_LEFT(parent, field) = child; \
+ else \
+ RB_RIGHT(parent, field) = child; \
+ RB_AUGMENT(parent); \
+ } else \
+ RB_ROOT(head) = child; \
+ if (RB_PARENT(elm, field) == old) \
+ parent = elm; \
+ (elm)->field = (old)->field; \
+ if (RB_PARENT(old, field)) { \
+ if (RB_LEFT(RB_PARENT(old, field), field) == old)\
+ RB_LEFT(RB_PARENT(old, field), field) = elm;\
+ else \
+ RB_RIGHT(RB_PARENT(old, field), field) = elm;\
+ RB_AUGMENT(RB_PARENT(old, field)); \
+ } else \
+ RB_ROOT(head) = elm; \
+ RB_PARENT(RB_LEFT(old, field), field) = elm; \
+ if (RB_RIGHT(old, field)) \
+ RB_PARENT(RB_RIGHT(old, field), field) = elm; \
+ if (parent) { \
+ left = parent; \
+ do { \
+ RB_AUGMENT(left); \
+ } while ((left = RB_PARENT(left, field)) != NULL); \
+ } \
+ goto color; \
+ } \
+ parent = RB_PARENT(elm, field); \
+ color = RB_COLOR(elm, field); \
+ if (child) \
+ RB_PARENT(child, field) = parent; \
+ if (parent) { \
+ if (RB_LEFT(parent, field) == elm) \
+ RB_LEFT(parent, field) = child; \
+ else \
+ RB_RIGHT(parent, field) = child; \
+ RB_AUGMENT(parent); \
+ } else \
+ RB_ROOT(head) = child; \
+color: \
+ if (color == RB_BLACK) \
+ name##_RB_REMOVE_COLOR(head, parent, child); \
+ return (old); \
+} \
+ \
+/* Inserts a node into the RB tree */ \
+attr struct type * \
+name##_RB_INSERT(struct name *head, struct type *elm) \
+{ \
+ struct type *tmp; \
+ struct type *parent = NULL; \
+ int comp = 0; \
+ tmp = RB_ROOT(head); \
+ while (tmp) { \
+ parent = tmp; \
+ comp = (cmp)(elm, parent); \
+ if (comp < 0) \
+ tmp = RB_LEFT(tmp, field); \
+ else if (comp > 0) \
+ tmp = RB_RIGHT(tmp, field); \
+ else \
+ return (tmp); \
+ } \
+ RB_SET(elm, parent, field); \
+ if (parent != NULL) { \
+ if (comp < 0) \
+ RB_LEFT(parent, field) = elm; \
+ else \
+ RB_RIGHT(parent, field) = elm; \
+ RB_AUGMENT(parent); \
+ } else \
+ RB_ROOT(head) = elm; \
+ name##_RB_INSERT_COLOR(head, elm); \
+ return (NULL); \
+} \
+ \
+/* Finds the node with the same key as elm */ \
+attr struct type * \
+name##_RB_FIND(struct name *head, struct type *elm) \
+{ \
+ struct type *tmp = RB_ROOT(head); \
+ int comp; \
+ while (tmp) { \
+ comp = cmp(elm, tmp); \
+ if (comp < 0) \
+ tmp = RB_LEFT(tmp, field); \
+ else if (comp > 0) \
+ tmp = RB_RIGHT(tmp, field); \
+ else \
+ return (tmp); \
+ } \
+ return (NULL); \
+} \
+ \
+/* Finds the first node greater than or equal to the search key */ \
+attr struct type * \
+name##_RB_NFIND(struct name *head, struct type *elm) \
+{ \
+ struct type *tmp = RB_ROOT(head); \
+ struct type *res = NULL; \
+ int comp; \
+ while (tmp) { \
+ comp = cmp(elm, tmp); \
+ if (comp < 0) { \
+ res = tmp; \
+ tmp = RB_LEFT(tmp, field); \
+ } \
+ else if (comp > 0) \
+ tmp = RB_RIGHT(tmp, field); \
+ else \
+ return (tmp); \
+ } \
+ return (res); \
+} \
+ \
+/* ARGSUSED */ \
+attr struct type * \
+name##_RB_NEXT(struct type *elm) \
+{ \
+ if (RB_RIGHT(elm, field)) { \
+ elm = RB_RIGHT(elm, field); \
+ while (RB_LEFT(elm, field)) \
+ elm = RB_LEFT(elm, field); \
+ } else { \
+ if (RB_PARENT(elm, field) && \
+ (elm == RB_LEFT(RB_PARENT(elm, field), field))) \
+ elm = RB_PARENT(elm, field); \
+ else { \
+ while (RB_PARENT(elm, field) && \
+ (elm == RB_RIGHT(RB_PARENT(elm, field), field)))\
+ elm = RB_PARENT(elm, field); \
+ elm = RB_PARENT(elm, field); \
+ } \
+ } \
+ return (elm); \
+} \
+ \
+/* ARGSUSED */ \
+attr struct type * \
+name##_RB_PREV(struct type *elm) \
+{ \
+ if (RB_LEFT(elm, field)) { \
+ elm = RB_LEFT(elm, field); \
+ while (RB_RIGHT(elm, field)) \
+ elm = RB_RIGHT(elm, field); \
+ } else { \
+ if (RB_PARENT(elm, field) && \
+ (elm == RB_RIGHT(RB_PARENT(elm, field), field))) \
+ elm = RB_PARENT(elm, field); \
+ else { \
+ while (RB_PARENT(elm, field) && \
+ (elm == RB_LEFT(RB_PARENT(elm, field), field)))\
+ elm = RB_PARENT(elm, field); \
+ elm = RB_PARENT(elm, field); \
+ } \
+ } \
+ return (elm); \
+} \
+ \
+attr struct type * \
+name##_RB_MINMAX(struct name *head, int val) \
+{ \
+ struct type *tmp = RB_ROOT(head); \
+ struct type *parent = NULL; \
+ while (tmp) { \
+ parent = tmp; \
+ if (val < 0) \
+ tmp = RB_LEFT(tmp, field); \
+ else \
+ tmp = RB_RIGHT(tmp, field); \
+ } \
+ return (parent); \
+}
+
+#define RB_NEGINF -1
+#define RB_INF 1
+
+#define RB_INSERT(name, x, y) name##_RB_INSERT(x, y)
+#define RB_REMOVE(name, x, y) name##_RB_REMOVE(x, y)
+#define RB_FIND(name, x, y) name##_RB_FIND(x, y)
+#define RB_NFIND(name, x, y) name##_RB_NFIND(x, y)
+#define RB_NEXT(name, x, y) name##_RB_NEXT(y)
+#define RB_PREV(name, x, y) name##_RB_PREV(y)
+#define RB_MIN(name, x) name##_RB_MINMAX(x, RB_NEGINF)
+#define RB_MAX(name, x) name##_RB_MINMAX(x, RB_INF)
+
+#define RB_FOREACH(x, name, head) \
+ for ((x) = RB_MIN(name, head); \
+ (x) != NULL; \
+ (x) = name##_RB_NEXT(x))
+
+#define RB_FOREACH_FROM(x, name, y) \
+ for ((x) = (y); \
+ ((x) != NULL) && ((y) = name##_RB_NEXT(x), (x) != NULL); \
+ (x) = (y))
+
+#define RB_FOREACH_SAFE(x, name, head, y) \
+ for ((x) = RB_MIN(name, head); \
+ ((x) != NULL) && ((y) = name##_RB_NEXT(x), (x) != NULL); \
+ (x) = (y))
+
+#define RB_FOREACH_REVERSE(x, name, head) \
+ for ((x) = RB_MAX(name, head); \
+ (x) != NULL; \
+ (x) = name##_RB_PREV(x))
+
+#define RB_FOREACH_REVERSE_FROM(x, name, y) \
+ for ((x) = (y); \
+ ((x) != NULL) && ((y) = name##_RB_PREV(x), (x) != NULL); \
+ (x) = (y))
+
+#define RB_FOREACH_REVERSE_SAFE(x, name, head, y) \
+ for ((x) = RB_MAX(name, head); \
+ ((x) != NULL) && ((y) = name##_RB_PREV(x), (x) != NULL); \
+ (x) = (y))
+
+#endif /* _SYS_TREE_H_ */
diff --git a/system/libcap-ng/APKBUILD b/system/libcap-ng/APKBUILD
new file mode 100644
index 000000000..a1503aeda
--- /dev/null
+++ b/system/libcap-ng/APKBUILD
@@ -0,0 +1,48 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=libcap-ng
+pkgver=0.7.8
+pkgrel=1
+pkgdesc="posix capabilities library"
+url="http://people.redhat.com/sgrubb/libcap-ng/index.html"
+arch="all"
+license="GPL"
+depends_dev="linux-headers"
+makedepends="python3 $depends_dev"
+makedepends_host="$depends_dev"
+subpackages="$pkgname-dev $pkgname-doc $pkgname-utils"
+source="http://people.redhat.com/sgrubb/libcap-ng/libcap-ng-$pkgver.tar.gz
+ fix-includes.patch
+ "
+builddir="$srcdir/$pkgname-$pkgver"
+
+build() {
+ cd "$builddir"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info
+ make
+}
+
+check() {
+ cd "$builddir"
+ make check
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+}
+
+utils() {
+ pkgdesc="posix capabilities utils"
+
+ mkdir -p "$subpkgdir"/usr/bin
+ mv "$pkgdir"/usr/bin/* "$subpkgdir"/usr/bin/
+}
+
+sha512sums="c32a4c5780c183b13611615abe9061221fd8987188b08828d1617cdaee338ad8de67b3430aa83bde60128efc76449a688546bfbf697f0847b6a835cb1a868756 libcap-ng-0.7.8.tar.gz
+8de98ce0fae63812cf7fd17e788343798b0cab63ba029f046ac9b89b2305da17432bafdd3dfa36046fc2cc0a453e0c889f6744c632f4617e0e5fc08e2823e324 fix-includes.patch"
diff --git a/system/libcap-ng/fix-includes.patch b/system/libcap-ng/fix-includes.patch
new file mode 100644
index 000000000..8fbd984b8
--- /dev/null
+++ b/system/libcap-ng/fix-includes.patch
@@ -0,0 +1,11 @@
+diff -ru libcap-ng-0.7.4.orig/src/cap-ng.c libcap-ng-0.7.4/src/cap-ng.c
+--- libcap-ng-0.7.4.orig/src/cap-ng.c 2014-04-24 15:41:43.000000000 -0300
++++ libcap-ng-0.7.4/src/cap-ng.c 2015-04-15 08:45:10.783335463 -0300
+@@ -34,6 +34,7 @@
+ #include <stdarg.h>
+ #include <errno.h>
+ #include <fcntl.h>
++#include <endian.h>
+ #include <byteswap.h>
+ #ifdef HAVE_SYSCALL_H
+ #include <sys/syscall.h>
diff --git a/system/libcap/APKBUILD b/system/libcap/APKBUILD
new file mode 100644
index 000000000..aa989e478
--- /dev/null
+++ b/system/libcap/APKBUILD
@@ -0,0 +1,31 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=libcap
+pkgver=2.25
+pkgrel=1
+pkgdesc="POSIX 1003.1e capabilities"
+arch="all"
+license="GPL"
+url="http://www.friedhoff.org/posixfilecaps.html"
+options="!check"
+depends=
+depends_dev="linux-headers"
+makedepends_build="linux-headers perl"
+makedepends_host="$depends_dev attr-dev"
+makedepends="$makedepends_build $makedepends_host"
+source="https://kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-$pkgver.tar.xz"
+subpackages="$pkgname-doc $pkgname-dev"
+
+_builddir="$srcdir"/$pkgname-$pkgver
+build ()
+{
+ cd "$_builddir"
+ make BUILD_CC=gcc CC="${CC:-gcc}" lib=lib prefix=/usr DESTDIR="$pkgdir"
+}
+
+package() {
+ cd "$_builddir"
+ make lib=/lib prefix=/usr RAISE_SETFCAP=no DESTDIR="$pkgdir" install
+}
+md5sums="6666b839e5d46c2ad33fc8aa2ceb5f77 libcap-2.25.tar.xz"
+sha256sums="693c8ac51e983ee678205571ef272439d83afe62dd8e424ea14ad9790bc35162 libcap-2.25.tar.xz"
+sha512sums="c3ab491885292adc171cde542b96f1295e84132febb50112a46575c3bde3a3eb6fcf733f7a756b4b656e013c0abb5ed6571db24799f8c0b23d8f759f992864f9 libcap-2.25.tar.xz"
diff --git a/system/libevent/APKBUILD b/system/libevent/APKBUILD
deleted file mode 100644
index d49dfa5e1..000000000
--- a/system/libevent/APKBUILD
+++ /dev/null
@@ -1,65 +0,0 @@
-# Contributor: Sergei Lukin <sergej.lukin@gmail.com>
-# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
-pkgname=libevent
-pkgver=2.1.8
-pkgrel=3
-pkgdesc="An event notification library"
-url="http://libevent.org/"
-arch="all"
-license="BSD"
-depends=""
-depends_dev="python3"
-makedepends="$depends_dev openssl-dev"
-subpackages="$pkgname-dev"
-source="https://github.com/$pkgname/$pkgname/releases/download/release-${pkgver}-stable/$pkgname-${pkgver}-stable.tar.gz
- dont-test-fallback.patch
- fix-test-on-32bit.patch
- py3_dumpevents.patch
- py3_rpcgen.patch
- "
-
-# secfixes:
-# 2.1.8-r0:
-# - CVE-2016-10195
-# - CVE-2016-10196
-# - CVE-2016-10197
-
-builddir="$srcdir"/$pkgname-$pkgver-stable
-
-prepare() {
- cd "$builddir"
- default_prepare
-}
-
-build() {
- cd "$builddir"
- ./configure \
- --build=$CBUILD \
- --host=$CHOST \
- --prefix=/usr \
- --sysconfdir=/etc \
- --disable-static
- make
-}
-
-check() {
- cd "$builddir"
- make check
-}
-
-package() {
- cd "$builddir"
- make -j1 DESTDIR=$pkgdir install
-}
-
-dev() {
- replaces="libevent"
- default_dev
- mv "$pkgdir"/usr/bin "$subpkgdir"/usr/
-}
-
-sha512sums="a2fd3dd111e73634e4aeb1b29d06e420b15c024d7b47778883b5f8a4ff320b5057a8164c6d50b53bd196c79d572ce2639fe6265e03a93304b09c22b41e4c2a17 libevent-2.1.8-stable.tar.gz
-d059a592252f83a918f0b6237e2dbee1d05822c83372bcd0f658a25428cce109fd088c5dec8320fef4c1aa7a713ada53aae9b7c04d7ca9b039ed4a483ba84146 dont-test-fallback.patch
-7898a00eeab4af7ff3b7c1ee3b90e0d718beba435dfadf015f62084524b2b0f4049c8dd9e16926c61017c01faabf7a51c2f19be7f9532e01278d691acb98465d fix-test-on-32bit.patch
-1f51788db3797870392997d0314fb744ee54d3b1a326d1b67f522fc7af65d50210cb137e8213d35a788bbf3c97aac18cd9860de8af3cb8c82f25e3ae07d662ae py3_dumpevents.patch
-00d0b09425835638a5e29d96d70c855a5c57efb188157b80a3885a2dcbe88709b49ae57aeb6b8b590458a934116cf59934e6e32fbf684b2b3b8333c0dcac837e py3_rpcgen.patch"
diff --git a/system/libevent/dont-test-fallback.patch b/system/libevent/dont-test-fallback.patch
deleted file mode 100644
index 42a40094a..000000000
--- a/system/libevent/dont-test-fallback.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-The libevent fallback monotonic clock is broken, but it should never be used
-anyway on musl, so disable testing it.
-
-(the brokenness involves gettimeofday, you don't want to know)
-
---- libevent-2.1.8-stable/test/regress_util.c.old 2017-01-15 03:04:34.000000000 -0600
-+++ libevent-2.1.8-stable/test/regress_util.c 2017-09-14 16:25:58.887687965 -0500
-@@ -1482,7 +1482,7 @@
- { "monotonic_res_fallback", test_evutil_monotonic_res, TT_OFF_BY_DEFAULT, &basic_setup, (void*)"fallback" },
- { "monotonic_prc", test_evutil_monotonic_prc, 0, &basic_setup, (void*)"" },
- { "monotonic_prc_precise", test_evutil_monotonic_prc, 0, &basic_setup, (void*)"precise" },
-- { "monotonic_prc_fallback", test_evutil_monotonic_prc, 0, &basic_setup, (void*)"fallback" },
-+ /* { "monotonic_prc_fallback", test_evutil_monotonic_prc, 0, &basic_setup, (void*)"fallback" }, */
- { "date_rfc1123", test_evutil_date_rfc1123, 0, NULL, NULL },
- END_OF_TESTCASES,
- };
diff --git a/system/libevent/fix-test-on-32bit.patch b/system/libevent/fix-test-on-32bit.patch
deleted file mode 100644
index ec120a78c..000000000
--- a/system/libevent/fix-test-on-32bit.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- libevent-2.1.8-stable/test/regress_util.c.old 2018-03-04 21:14:24.344542520 -0600
-+++ libevent-2.1.8-stable/test/regress_util.c 2018-03-04 21:24:23.788814572 -0600
-@@ -1411,7 +1411,7 @@
- { 1255132800, "Sat, 10 Oct 2009 00:00:00 GMT"},
- { 1289433600, "Thu, 11 Nov 2010 00:00:00 GMT"},
- { 1323648000, "Mon, 12 Dec 2011 00:00:00 GMT"},
--#ifndef _WIN32
-+#if !defined(_WIN32) && (!defined(__SIZEOF_LONG__) || __SIZEOF_LONG__ > 4)
- /** In win32 case we have max "23:59:59 January 18, 2038, UTC" for time32 */
- { 4294967296, "Sun, 07 Feb 2106 06:28:16 GMT"} /* 2^32 */,
- /** In win32 case we have max "23:59:59, December 31, 3000, UTC" for time64 */
diff --git a/system/libevent/libressl.patch b/system/libevent/libressl.patch
deleted file mode 100644
index 21a750c2c..000000000
--- a/system/libevent/libressl.patch
+++ /dev/null
@@ -1,97 +0,0 @@
-diff -ru a/openssl-compat.h b/openssl-compat.h
---- a/openssl-compat.h
-+++ b/openssl-compat.h
-@@ -1,7 +1,7 @@
- #ifndef OPENSSL_COMPAT_H
- #define OPENSSL_COMPAT_H
-
--#if OPENSSL_VERSION_NUMBER < 0x10100000L
-+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
-
- static inline BIO_METHOD *BIO_meth_new(int type, const char *name)
- {
-@@ -30,6 +30,6 @@
-
- #define TLS_method SSLv23_method
-
--#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */
-+#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) */
-
- #endif /* OPENSSL_COMPAT_H */
-diff -ru a/sample/https-client.c b/sample/https-client.c
---- a/sample/https-client.c
-+++ b/sample/https-client.c
-@@ -312,7 +312,7 @@
- }
- uri[sizeof(uri) - 1] = '\0';
-
--#if OPENSSL_VERSION_NUMBER < 0x10100000L
-+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
- // Initialize OpenSSL
- SSL_library_init();
- ERR_load_crypto_strings();
-@@ -480,7 +480,7 @@
- SSL_CTX_free(ssl_ctx);
- if (type == HTTP && ssl)
- SSL_free(ssl);
--#if OPENSSL_VERSION_NUMBER < 0x10100000L
-+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
- EVP_cleanup();
- ERR_free_strings();
-
-@@ -492,7 +492,7 @@
- CRYPTO_cleanup_all_ex_data();
-
- sk_SSL_COMP_free(SSL_COMP_get_compression_methods());
--#endif /*OPENSSL_VERSION_NUMBER < 0x10100000L */
-+#endif /*OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) */
-
- #ifdef _WIN32
- WSACleanup();
-diff -ru a/sample/le-proxy.c b/sample/le-proxy.c
---- a/sample/le-proxy.c
-+++ b/sample/le-proxy.c
-@@ -259,7 +259,7 @@
-
- if (use_ssl) {
- int r;
--#if OPENSSL_VERSION_NUMBER < 0x10100000L
-+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
- SSL_library_init();
- ERR_load_crypto_strings();
- SSL_load_error_strings();
-diff -ru a/sample/openssl_hostname_validation.c b/sample/openssl_hostname_validation.c
---- a/sample/openssl_hostname_validation.c
-+++ b/sample/openssl_hostname_validation.c
-@@ -48,7 +48,7 @@
-
- #define HOSTNAME_MAX_SIZE 255
-
--#if OPENSSL_VERSION_NUMBER < 0x10100000L
-+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
- #define ASN1_STRING_get0_data ASN1_STRING_data
- #endif
-
-diff -ru a/test/regress_ssl.c b/test/regress_ssl.c
---- a/test/regress_ssl.c
-+++ b/test/regress_ssl.c
-@@ -186,7 +186,7 @@
- void
- init_ssl(void)
- {
--#if OPENSSL_VERSION_NUMBER < 0x10100000L
-+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
- SSL_library_init();
- ERR_load_crypto_strings();
- SSL_load_error_strings();
-@@ -194,6 +194,10 @@
- if (SSLeay() != OPENSSL_VERSION_NUMBER) {
- TT_DECLARE("WARN", ("Version mismatch for openssl: compiled with %lx but running with %lx", (unsigned long)OPENSSL_VERSION_NUMBER, (unsigned long) SSLeay()));
- }
-+ if (SSLeay() != LIBRESSL_VERSION_NUMBER) {
-+ TT_DECLARE("WARN", ("Version mismatch for libressl: compiled with %lx but running with %lx", (unsigned long)LIBRESSL_VERSION_NUMBER, (unsigned long) SSLeay()));
-+ }
-+
- #endif
- }
-
diff --git a/system/libevent/py3_dumpevents.patch b/system/libevent/py3_dumpevents.patch
deleted file mode 100644
index 3c012ef89..000000000
--- a/system/libevent/py3_dumpevents.patch
+++ /dev/null
@@ -1,30 +0,0 @@
---- libevent-2.1.8-stable/test/check-dumpevents.py 2016-10-04 14:55:31.000000000 -0500
-+++ libevent-2.1.8-py3-rpcgen/test/check-dumpevents.py 2017-09-14 15:51:16.000000000 -0500
-@@ -15,12 +15,12 @@
- got_inserted_pos = text.index("Inserted events:\n")
- got_active_pos = text.index("Active events:\n")
- except ValueError:
-- print >>sys.stderr, "Missing expected dividing line in dumpevents output"
-+ sys.stderr.write("Missing expected dividing line in dumpevents output\n")
- sys.exit(1)
-
- if not (expect_inserted_pos < expect_active_pos <
- got_inserted_pos < got_active_pos):
-- print >>sys.stderr, "Sections out of order in dumpevents output"
-+ sys.stderr.write("Sections out of order in dumpevents output\n")
- sys.exit(1)
-
- now,T= text[1].split()
-@@ -45,10 +45,10 @@
- if "Internal" not in s)
-
- if cleaned_inserted != want_inserted:
-- print >>sys.stderr, "Inserted event lists were not as expected!"
-+ sys.stderr.write("Inserted event lists were not as expected!\n")
- sys.exit(1)
-
- if set(got_active) != set(want_active):
-- print >>sys.stderr, "Active event lists were not as expected!"
-+ sys.stderr.write("Active event lists were not as expected!\n")
- sys.exit(1)
-
diff --git a/system/libevent/py3_rpcgen.patch b/system/libevent/py3_rpcgen.patch
deleted file mode 100644
index 2ebe974a6..000000000
--- a/system/libevent/py3_rpcgen.patch
+++ /dev/null
@@ -1,423 +0,0 @@
---- libevent-2.1.8-stable/event_rpcgen.py 2016-12-06 03:44:11.000000000 -0600
-+++ libevent-2.1.8-py3-rpcgen/event_rpcgen.py 2017-09-14 15:17:51.000000000 -0500
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python2
-+#!/usr/bin/env python3
- #
- # Copyright (c) 2005-2007 Niels Provos <provos@citi.umich.edu>
- # Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
-@@ -36,10 +36,10 @@
-
- def declare(s):
- if not QUIETLY:
-- print s
-+ print(s)
-
- def TranslateList(mylist, mydict):
-- return map(lambda x: x % mydict, mylist)
-+ return [x % mydict for x in mylist]
-
- # Exception class for parse errors
- class RpcGenError(Exception):
-@@ -57,7 +57,7 @@
- declare(' Created struct: %s' % name)
-
- def AddEntry(self, entry):
-- if self._tags.has_key(entry.Tag()):
-+ if entry.Tag() in self._tags:
- raise RpcGenError(
- 'Entry "%s" duplicates tag number %d from "%s" '
- 'around line %d' % (entry.Name(), entry.Tag(),
-@@ -78,7 +78,8 @@
- def PrintIndented(self, file, ident, code):
- """Takes an array, add indentation to each entry and prints it."""
- for entry in code:
-- print >>file, '%s%s' % (ident, entry)
-+ file.write('{}{}\n'.format(ident, entry))
-+ #file.write('%s%s' % (ident, entry))
-
- class StructCCode(Struct):
- """ Knows how to generate C code for a struct """
-@@ -88,20 +89,19 @@
-
- def PrintTags(self, file):
- """Prints the tag definitions for a structure."""
-- print >>file, '/* Tag definition for %s */' % self._name
-- print >>file, 'enum %s_ {' % self._name.lower()
-+ file.write('/* Tag definition for %s */\n' % self._name)
-+ file.write('enum %s_ {\n' % self._name.lower())
- for entry in self._entries:
-- print >>file, ' %s=%d,' % (self.EntryTagName(entry),
-- entry.Tag())
-- print >>file, ' %s_MAX_TAGS' % (self._name.upper())
-- print >>file, '};\n'
-+ file.write(' %s=%d,\n' % (self.EntryTagName(entry), entry.Tag()))
-+ file.write(' %s_MAX_TAGS\n' % (self._name.upper()))
-+ file.write('};\n\n')
-
- def PrintForwardDeclaration(self, file):
-- print >>file, 'struct %s;' % self._name
-+ file.write('struct %s;\n' % self._name)
-
- def PrintDeclaration(self, file):
-- print >>file, '/* Structure declaration for %s */' % self._name
-- print >>file, 'struct %s_access_ {' % self._name
-+ file.write('/* Structure declaration for %s */\n' % self._name)
-+ file.write('struct %s_access_ {\n' % self._name)
- for entry in self._entries:
- dcl = entry.AssignDeclaration('(*%s_assign)' % entry.Name())
- dcl.extend(
-@@ -110,20 +110,19 @@
- dcl.extend(
- entry.AddDeclaration('(*%s_add)' % entry.Name()))
- self.PrintIndented(file, ' ', dcl)
-- print >>file, '};\n'
-+ file.write('};\n\n')
-
-- print >>file, 'struct %s {' % self._name
-- print >>file, ' struct %s_access_ *base;\n' % self._name
-+ file.write('struct %s {\n' % self._name)
-+ file.write(' struct %s_access_ *base;\n\n' % self._name)
- for entry in self._entries:
- dcl = entry.Declaration()
- self.PrintIndented(file, ' ', dcl)
-- print >>file, ''
-+ file.write('\n')
- for entry in self._entries:
-- print >>file, ' ev_uint8_t %s_set;' % entry.Name()
-- print >>file, '};\n'
-+ file.write(' ev_uint8_t %s_set;\n' % entry.Name())
-+ file.write('};\n\n')
-
-- print >>file, \
--"""struct %(name)s *%(name)s_new(void);
-+ file.write("""struct %(name)s *%(name)s_new(void);
- struct %(name)s *%(name)s_new_with_arg(void *);
- void %(name)s_free(struct %(name)s *);
- void %(name)s_clear(struct %(name)s *);
-@@ -133,7 +132,7 @@
- void evtag_marshal_%(name)s(struct evbuffer *, ev_uint32_t,
- const struct %(name)s *);
- int evtag_unmarshal_%(name)s(struct evbuffer *, ev_uint32_t,
-- struct %(name)s *);""" % { 'name' : self._name }
-+ struct %(name)s *);\n""" % { 'name' : self._name })
-
-
- # Write a setting function of every variable
-@@ -146,22 +145,21 @@
- self.PrintIndented(file, '', entry.AddDeclaration(
- entry.AddFuncName()))
-
-- print >>file, '/* --- %s done --- */\n' % self._name
-+ file.write('/* --- %s done --- */\n\n' % self._name)
-
- def PrintCode(self, file):
-- print >>file, ('/*\n'
-+ file.write(('/*\n'
- ' * Implementation of %s\n'
-- ' */\n') % self._name
-+ ' */\n\n') % self._name)
-
-- print >>file, \
-- 'static struct %(name)s_access_ %(name)s_base__ = {' % \
-- { 'name' : self._name }
-+ file.write('static struct %(name)s_access_ %(name)s_base__ = {\n' % \
-+ { 'name' : self._name })
- for entry in self._entries:
- self.PrintIndented(file, ' ', entry.CodeBase())
-- print >>file, '};\n'
-+ file.write('};\n\n')
-
- # Creation
-- print >>file, (
-+ file.write((
- 'struct %(name)s *\n'
- '%(name)s_new(void)\n'
- '{\n'
-@@ -176,77 +174,77 @@
- ' event_warn("%%s: malloc", __func__);\n'
- ' return (NULL);\n'
- ' }\n'
-- ' tmp->base = &%(name)s_base__;\n') % { 'name' : self._name }
-+ ' tmp->base = &%(name)s_base__;\n\n') % { 'name' : self._name })
-
- for entry in self._entries:
- self.PrintIndented(file, ' ', entry.CodeInitialize('tmp'))
-- print >>file, ' tmp->%s_set = 0;\n' % entry.Name()
-+ file.write(' tmp->%s_set = 0;\n\n' % entry.Name())
-
-- print >>file, (
-+ file.write((
- ' return (tmp);\n'
-- '}\n')
-+ '}\n\n'))
-
- # Adding
- for entry in self._entries:
- if entry.Array():
- self.PrintIndented(file, '', entry.CodeAdd())
-- print >>file, ''
-+ file.write('\n')
-
- # Assigning
- for entry in self._entries:
- self.PrintIndented(file, '', entry.CodeAssign())
-- print >>file, ''
-+ file.write('\n')
-
- # Getting
- for entry in self._entries:
- self.PrintIndented(file, '', entry.CodeGet())
-- print >>file, ''
-+ file.write('\n')
-
- # Clearing
-- print >>file, ( 'void\n'
-+ file.write(( 'void\n'
- '%(name)s_clear(struct %(name)s *tmp)\n'
- '{'
-- ) % { 'name' : self._name }
-+ '\n') % { 'name' : self._name })
- for entry in self._entries:
- self.PrintIndented(file, ' ', entry.CodeClear('tmp'))
-
-- print >>file, '}\n'
-+ file.write('}\n\n')
-
- # Freeing
-- print >>file, ( 'void\n'
-+ file.write(( 'void\n'
- '%(name)s_free(struct %(name)s *tmp)\n'
- '{'
-- ) % { 'name' : self._name }
-+ '\n') % { 'name' : self._name })
-
- for entry in self._entries:
- self.PrintIndented(file, ' ', entry.CodeFree('tmp'))
-
-- print >>file, (' free(tmp);\n'
-- '}\n')
-+ file.write((' free(tmp);\n'
-+ '}\n\n'))
-
- # Marshaling
-- print >>file, ('void\n'
-+ file.write(('void\n'
- '%(name)s_marshal(struct evbuffer *evbuf, '
- 'const struct %(name)s *tmp)'
-- '{') % { 'name' : self._name }
-+ '{\n') % { 'name' : self._name })
- for entry in self._entries:
- indent = ' '
- # Optional entries do not have to be set
- if entry.Optional():
- indent += ' '
-- print >>file, ' if (tmp->%s_set) {' % entry.Name()
-+ file.write(' if (tmp->%s_set) {\n' % entry.Name())
- self.PrintIndented(
- file, indent,
- entry.CodeMarshal('evbuf', self.EntryTagName(entry),
- entry.GetVarName('tmp'),
- entry.GetVarLen('tmp')))
- if entry.Optional():
-- print >>file, ' }'
-+ file.write(' }\n')
-
-- print >>file, '}\n'
-+ file.write('}\n\n')
-
- # Unmarshaling
-- print >>file, ('int\n'
-+ file.write(('int\n'
- '%(name)s_unmarshal(struct %(name)s *tmp, '
- ' struct evbuffer *evbuf)\n'
- '{\n'
-@@ -255,14 +253,14 @@
- ' if (evtag_peek(evbuf, &tag) == -1)\n'
- ' return (-1);\n'
- ' switch (tag) {\n'
-- ) % { 'name' : self._name }
-+ '\n') % { 'name' : self._name })
- for entry in self._entries:
-- print >>file, ' case %s:\n' % self.EntryTagName(entry)
-+ file.write(' case %s:\n' % self.EntryTagName(entry))
- if not entry.Array():
-- print >>file, (
-+ file.write((
- ' if (tmp->%s_set)\n'
- ' return (-1);'
-- ) % (entry.Name())
-+ '\n') % (entry.Name()))
-
- self.PrintIndented(
- file, ' ',
-@@ -271,26 +269,26 @@
- entry.GetVarName('tmp'),
- entry.GetVarLen('tmp')))
-
-- print >>file, ( ' tmp->%s_set = 1;\n' % entry.Name() +
-- ' break;\n' )
-- print >>file, ( ' default:\n'
-+ file.write(( ' tmp->%s_set = 1;\n' % entry.Name() +
-+ ' break;\n' ))
-+ file.write(( ' default:\n'
- ' return -1;\n'
- ' }\n'
-- ' }\n' )
-+ ' }\n\n' ))
- # Check if it was decoded completely
-- print >>file, ( ' if (%(name)s_complete(tmp) == -1)\n'
-+ file.write(( ' if (%(name)s_complete(tmp) == -1)\n'
- ' return (-1);'
-- ) % { 'name' : self._name }
-+ '\n') % { 'name' : self._name })
-
- # Successfully decoded
-- print >>file, ( ' return (0);\n'
-- '}\n')
-+ file.write(( ' return (0);\n'
-+ '}\n\n'))
-
- # Checking if a structure has all the required data
-- print >>file, (
-+ file.write((
- 'int\n'
- '%(name)s_complete(struct %(name)s *msg)\n'
-- '{' ) % { 'name' : self._name }
-+ '{\n' ) % { 'name' : self._name })
- for entry in self._entries:
- if not entry.Optional():
- code = [
-@@ -303,12 +301,12 @@
- self.PrintIndented(
- file, ' ',
- entry.CodeComplete('msg', entry.GetVarName('msg')))
-- print >>file, (
-+ file.write((
- ' return (0);\n'
-- '}\n' )
-+ '}\n\n' ))
-
- # Complete message unmarshaling
-- print >>file, (
-+ file.write((
- 'int\n'
- 'evtag_unmarshal_%(name)s(struct evbuffer *evbuf, '
- 'ev_uint32_t need_tag, struct %(name)s *msg)\n'
-@@ -330,10 +328,10 @@
- ' error:\n'
- ' evbuffer_free(tmp);\n'
- ' return (res);\n'
-- '}\n' ) % { 'name' : self._name }
-+ '}\n\n' ) % { 'name' : self._name })
-
- # Complete message marshaling
-- print >>file, (
-+ file.write((
- 'void\n'
- 'evtag_marshal_%(name)s(struct evbuffer *evbuf, ev_uint32_t tag, '
- 'const struct %(name)s *msg)\n'
-@@ -343,7 +341,7 @@
- ' %(name)s_marshal(buf_, msg);\n'
- ' evtag_marshal_buffer(evbuf, tag, buf_);\n '
- ' evbuffer_free(buf_);\n'
-- '}\n' ) % { 'name' : self._name }
-+ '}\n\n' ) % { 'name' : self._name })
-
- class Entry:
- def __init__(self, type, name, tag):
-@@ -420,7 +418,7 @@
- "optaddarg" :
- self._optaddarg and ", const %s value" % self._ctype or ""
- }
-- for (k, v) in extradict.items():
-+ for (k, v) in list(extradict.items()):
- mapping[k] = v
-
- return mapping
-@@ -1127,7 +1125,7 @@
-
- codearrayassign = self._entry.CodeArrayAssign(
- 'msg->%(name)s_data[off]' % self.GetTranslation(), 'value')
-- code += map(lambda x: ' ' + x, codearrayassign)
-+ code += [' ' + x for x in codearrayassign]
-
- code += TranslateList([
- ' }',
-@@ -1168,7 +1166,7 @@
-
- code = TranslateList(code, self.GetTranslation())
-
-- code += map(lambda x: ' ' + x, codearrayadd)
-+ code += [' ' + x for x in codearrayadd]
-
- code += TranslateList([
- ' msg->%(name)s_set = 1;',
-@@ -1196,7 +1194,7 @@
-
- code = TranslateList(code, translate)
-
-- code += map(lambda x: ' ' + x, tmp)
-+ code += [' ' + x for x in tmp]
-
- code += [
- ' }',
-@@ -1261,7 +1259,7 @@
- code = TranslateList(code, translate)
-
- if codearrayfree:
-- code += map(lambda x: ' ' + x, codearrayfree)
-+ code += [' ' + x for x in codearrayfree]
- code += [
- ' }' ]
-
-@@ -1687,23 +1685,23 @@
-
- declare('... creating "%s"' % header_file)
- header_fp = open(header_file, 'w')
-- print >>header_fp, factory.HeaderPreamble(filename)
-+ header_fp.write(factory.HeaderPreamble(filename))
-
- # Create forward declarations: allows other structs to reference
- # each other
- for entry in entities:
- entry.PrintForwardDeclaration(header_fp)
-- print >>header_fp, ''
-+ header_fp.write('\n')
-
- for entry in entities:
- entry.PrintTags(header_fp)
- entry.PrintDeclaration(header_fp)
-- print >>header_fp, factory.HeaderPostamble(filename)
-+ header_fp.write(factory.HeaderPostamble(filename))
- header_fp.close()
-
- declare('... creating "%s"' % impl_file)
- impl_fp = open(impl_file, 'w')
-- print >>impl_fp, factory.BodyPreamble(filename, header_file)
-+ impl_fp.write(factory.BodyPreamble(filename, header_file))
- for entry in entities:
- entry.PrintCode(impl_fp)
- impl_fp.close()
-@@ -1713,16 +1711,16 @@
- CommandLine(sys.argv).run()
- sys.exit(0)
-
-- except RpcGenError, e:
-- print >>sys.stderr, e
-+ except RpcGenError as e:
-+ sys.stderr.write(e)
- sys.exit(1)
-
-- except EnvironmentError, e:
-+ except EnvironmentError as e:
- if e.filename and e.strerror:
-- print >>sys.stderr, "%s: %s" % (e.filename, e.strerror)
-+ sys.stderr.write("%s: %s" % (e.filename, e.strerror))
- sys.exit(1)
- elif e.strerror:
-- print >> sys.stderr, e.strerror
-+ sys.stderr.write(e.strerror)
- sys.exit(1)
- else:
- raise
diff --git a/system/libpipeline/APKBUILD b/system/libpipeline/APKBUILD
new file mode 100644
index 000000000..d5a5fda67
--- /dev/null
+++ b/system/libpipeline/APKBUILD
@@ -0,0 +1,36 @@
+# Contributor: A. Wilcox <awilfox@adelielinux.org>
+# Maintainer: A. Wilcox <awilfox@adelielinux.org>
+pkgname=libpipeline
+pkgver=1.4.1
+pkgrel=0
+pkgdesc="C pipeline manipulation library"
+url="http://libpipeline.nongnu.org/"
+arch="all"
+license="GPL-3+"
+checkdepends="check-dev"
+subpackages="$pkgname-dev $pkgname-doc"
+source="http://download.savannah.nongnu.org/releases/libpipeline/libpipeline-$pkgver.tar.gz"
+
+build() {
+ cd "$builddir"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --localstatedir=/var
+ make
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+}
+
+check() {
+ cd "$builddir"
+ make check
+}
+
+sha512sums="835d65aa3f9436398b5421544ca7857fe9caed52cd2e70320ea04d6315825e648df930e1c225d4aaf0f2edda2a438f6c00f15c556fb9fd30311560fb8d966797 libpipeline-1.4.1.tar.gz"
diff --git a/system/linux-headers/0001-libc-compat.h-fix-some-issues-arising-from-in6.h.patch b/system/linux-headers/0001-libc-compat.h-fix-some-issues-arising-from-in6.h.patch
new file mode 100644
index 000000000..6ad479863
--- /dev/null
+++ b/system/linux-headers/0001-libc-compat.h-fix-some-issues-arising-from-in6.h.patch
@@ -0,0 +1,89 @@
+From 2872f5d8bcef84e62b15b37ba4ffeccfb6402dad Mon Sep 17 00:00:00 2001
+From: rofl0r <retnyg@gmx.net>
+Date: Wed, 22 Jan 2014 00:48:28 +0100
+Subject: [PATCH 1/3] libc-compat.h: fix some issues arising from in6.h
+
+namely redefinition of some structs provided by netinet/in.h.
+---
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Submitted
+
+ include/uapi/linux/libc-compat.h | 25 ++++++++-----------------
+ 1 file changed, 8 insertions(+), 17 deletions(-)
+
+Index: linux-4.4/include/uapi/linux/libc-compat.h
+===================================================================
+--- linux-4.4.orig/include/uapi/linux/libc-compat.h
++++ linux-4.4/include/uapi/linux/libc-compat.h
+@@ -48,13 +48,12 @@
+ #ifndef _UAPI_LIBC_COMPAT_H
+ #define _UAPI_LIBC_COMPAT_H
+
+-/* We have included glibc headers... */
+-#if defined(__GLIBC__)
++#ifndef __KERNEL__ /* we're used from userspace */
+
+-/* Coordinate with glibc netinet/in.h header. */
++/* Coordinate with libc netinet/in.h header. */
+ #if defined(_NETINET_IN_H)
+
+-/* GLIBC headers included first so don't define anything
++/* LIBC headers included first so don't define anything
+ * that would already be defined. */
+ #define __UAPI_DEF_IN_ADDR 0
+ #define __UAPI_DEF_IN_IPPROTO 0
+@@ -64,15 +63,7 @@
+ #define __UAPI_DEF_IN_CLASS 0
+
+ #define __UAPI_DEF_IN6_ADDR 0
+-/* The exception is the in6_addr macros which must be defined
+- * if the glibc code didn't define them. This guard matches
+- * the guard in glibc/inet/netinet/in.h which defines the
+- * additional in6_addr macros e.g. s6_addr16, and s6_addr32. */
+-#if defined(__USE_MISC) || defined (__USE_GNU)
+ #define __UAPI_DEF_IN6_ADDR_ALT 0
+-#else
+-#define __UAPI_DEF_IN6_ADDR_ALT 1
+-#endif
+ #define __UAPI_DEF_SOCKADDR_IN6 0
+ #define __UAPI_DEF_IPV6_MREQ 0
+ #define __UAPI_DEF_IPPROTO_V6 0
+@@ -80,10 +71,10 @@
+ #define __UAPI_DEF_IN6_PKTINFO 0
+ #define __UAPI_DEF_IP6_MTUINFO 0
+
+-#else
++#else /* defined(_NETINET_IN_H) */
+
+ /* Linux headers included first, and we must define everything
+- * we need. The expectation is that glibc will check the
++ * we need. The expectation is that libc will check the
+ * __UAPI_DEF_* defines and adjust appropriately. */
+ #define __UAPI_DEF_IN_ADDR 1
+ #define __UAPI_DEF_IN_IPPROTO 1
+@@ -93,7 +84,7 @@
+ #define __UAPI_DEF_IN_CLASS 1
+
+ #define __UAPI_DEF_IN6_ADDR 1
+-/* We unconditionally define the in6_addr macros and glibc must
++/* We unconditionally define the in6_addr macros and libc must
+ * coordinate. */
+ #define __UAPI_DEF_IN6_ADDR_ALT 1
+ #define __UAPI_DEF_SOCKADDR_IN6 1
+@@ -115,7 +106,7 @@
+ /* If we did not see any headers from any supported C libraries,
+ * or we are being included in the kernel, then define everything
+ * that we need. */
+-#else /* !defined(__GLIBC__) */
++#else /* __KERNEL__ */
+
+ /* Definitions for in.h */
+ #define __UAPI_DEF_IN_ADDR 1
+@@ -138,6 +129,6 @@
+ /* Definitions for xattr.h */
+ #define __UAPI_DEF_XATTR 1
+
+-#endif /* __GLIBC__ */
++#endif /* __KERNEL__ */
+
+ #endif /* _UAPI_LIBC_COMPAT_H */
diff --git a/system/linux-headers/0002-libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch b/system/linux-headers/0002-libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch
new file mode 100644
index 000000000..c61709374
--- /dev/null
+++ b/system/linux-headers/0002-libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch
@@ -0,0 +1,59 @@
+From 75ba4a547282f91d653872a4bba5f5eae234ea6c Mon Sep 17 00:00:00 2001
+From: rofl0r <retnyg@gmx.net>
+Date: Wed, 22 Jan 2014 00:57:48 +0100
+Subject: [PATCH 2/3] libc-compat.h: prevent redefinition of struct ethhdr
+
+---
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Submitted
+
+ include/uapi/linux/if_ether.h | 4 +++-
+ include/uapi/linux/libc-compat.h | 6 ++++++
+ 2 files changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/include/uapi/linux/if_ether.h b/include/uapi/linux/if_ether.h
+index aa63ed0..e94da57 100644
+--- a/include/uapi/linux/if_ether.h
++++ b/include/uapi/linux/if_ether.h
+@@ -22,6 +22,7 @@
+ #define _UAPI_LINUX_IF_ETHER_H
+
+ #include <linux/types.h>
++#include <linux/libc-compat.h>
+
+ /*
+ * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble
+@@ -134,11 +135,12 @@
+ * This is an Ethernet frame header.
+ */
+
++#if __UAPI_DEF_ETHHDR
+ struct ethhdr {
+ unsigned char h_dest[ETH_ALEN]; /* destination eth addr */
+ unsigned char h_source[ETH_ALEN]; /* source ether addr */
+ __be16 h_proto; /* packet type ID field */
+ } __attribute__((packed));
+-
++#endif
+
+ #endif /* _UAPI_LINUX_IF_ETHER_H */
+diff --git a/include/uapi/linux/libc-compat.h b/include/uapi/linux/libc-compat.h
+index afe15c2..7d0c78a 100644
+--- a/include/uapi/linux/libc-compat.h
++++ b/include/uapi/linux/libc-compat.h
+@@ -50,6 +50,12 @@
+
+ #ifndef __KERNEL__ /* we're used from userspace */
+
++#ifdef _NETINET_IF_ETHER_H /* musl */
++#define __UAPI_DEF_ETHHDR 0
++#else /* glibc uses __NETINET_IF_ETHER_H, and includes the kernel header. */
++#define __UAPI_DEF_ETHHDR 1
++#endif
++
+ /* Coordinate with libc netinet/in.h header. */
+ #if defined(_NETINET_IN_H)
+
+--
+2.6.4
+
diff --git a/system/linux-headers/0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch b/system/linux-headers/0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch
new file mode 100644
index 000000000..6d9e8d864
--- /dev/null
+++ b/system/linux-headers/0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch
@@ -0,0 +1,32 @@
+From 8e69b663d6ddef132041a1186f081fdd74d4a31d Mon Sep 17 00:00:00 2001
+From: rofl0r <retnyg@gmx.net>
+Date: Mon, 20 Jan 2014 21:31:34 +0100
+Subject: [PATCH 3/3] remove inclusion of sysinfo.h in kernel.h
+
+the declaration of struct sysinfo clashes with userspace.
+it's not quite clear why that header was included from kernel.h,
+as none of its functionality is needed.
+---
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Submitted
+
+ include/uapi/linux/kernel.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/include/uapi/linux/kernel.h b/include/uapi/linux/kernel.h
+index 321e399..e8ff821 100644
+--- a/include/uapi/linux/kernel.h
++++ b/include/uapi/linux/kernel.h
+@@ -1,7 +1,9 @@
+ #ifndef _UAPI_LINUX_KERNEL_H
+ #define _UAPI_LINUX_KERNEL_H
+
++#ifdef __GLIBC__
+ #include <linux/sysinfo.h>
++#endif
+
+ /*
+ * 'kernel.h' contains some often-used function prototypes etc
+--
+2.6.4
+
diff --git a/system/linux-headers/APKBUILD b/system/linux-headers/APKBUILD
new file mode 100644
index 000000000..67afac211
--- /dev/null
+++ b/system/linux-headers/APKBUILD
@@ -0,0 +1,62 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=linux-headers
+pkgver=4.4.6
+_kernver=${pkgver%.*}
+pkgrel=2
+pkgdesc="Linux system headers"
+url="http://kernel.org"
+arch="all"
+license="GPL-2.0-only"
+makedepends="perl"
+options="!check !dbg !strip !tracedeps"
+source="https://kernel.org/pub/linux/kernel/v4.x/linux-$_kernver.tar.xz
+ https://kernel.org/pub/linux/kernel/v4.x/patch-$pkgver.xz
+ 0001-libc-compat.h-fix-some-issues-arising-from-in6.h.patch
+ 0002-libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch
+ 0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch
+ "
+
+prepare() {
+ cd "$srcdir"/linux-$_kernver
+ if [ "$_kernver" != "$pkgver" ]; then
+ unxz -c < "$srcdir"/patch-$pkgver.xz | patch -p1 || return 1
+ fi
+ for i in $source; do
+ case $i in
+ *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+ esac
+ done
+}
+
+build() {
+ return 0
+}
+
+package() {
+ local _carch=$CARCH
+
+ case "$_carch" in
+ aarch64*) _carch="arm64" ;;
+ arm*) _carch="arm" ;;
+ mips*) _carch="mips" ;;
+ s390*) _carch="s390" ;;
+ ppc*) _carch="powerpc" ;;
+# not sure about this -- ppc64*) _carch="powerpc64" ;;
+ esac
+
+ cd "$srcdir"/linux-$_kernver
+ mkdir -p "$pkgdir/usr"
+ make headers_install ARCH="${_carch}" INSTALL_HDR_PATH="$pkgdir/usr" || return 1
+
+ find "$pkgdir/usr" \( -name .install -o -name ..install.cmd \) -exec \
+ rm -f {} \;
+
+ # provided by libdrm
+ rm -rf "$pkgdir"/usr/include/drm
+}
+
+sha512sums="13c8459933a8b80608e226a1398e3d1848352ace84bcfb7e6a4a33cb230bbe1ab719d4b58e067283df91ce5311be6d2d595fc8c19e2ae6ecc652499415614b3e linux-4.4.tar.xz
+73da057476eb31d818eed4b66c883f5ceec65f18ec8ea60d64e48334c7681af4ed4cf7eb8684481f705446a59fd124de9449d22e28805bc9617b6608ecec491d patch-4.4.6.xz
+6ceaaa285bcc7699b72f07f04c018d8edc2e1a2860004c677da6ff8ca042fcecd37f7f264d8ec9783e4e2f60a91bd45ddc432f7ec063da1e3f4e9dfb75b5ba65 0001-libc-compat.h-fix-some-issues-arising-from-in6.h.patch
+fbce0bf59dd8ed3da8d90db725e98ace410f1e1a71b1c2e0ef16c53327e3850019b4e52afb1b16115a8616492a1e758fab02158ea686113b1b6cd94c7b08f310 0002-libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch
+e5431719b3910162c17c7a46e296c4424f5b82f4ad4bc45ba933da7e7ebcf896bb98782f7764e584c573c49d9e6b00fe63f3a36ae4b3b137add6b9a21ddf14a0 0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch"
diff --git a/system/lvm2/APKBUILD b/system/lvm2/APKBUILD
new file mode 100644
index 000000000..862c9fa35
--- /dev/null
+++ b/system/lvm2/APKBUILD
@@ -0,0 +1,133 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=lvm2
+pkgver=2.02.175
+pkgrel=1
+pkgdesc="Logical Volume Manager 2 utilities"
+url="http://sourceware.org/lvm2/"
+arch="all"
+options="!check" # Test tries to use real /dev/mapper/control.
+license="GPL-2.0-only, LGPL-2.1-only"
+# lvm2 will dlopen libs so we need to add explicit depend
+depends="lvm2-libs=$pkgver-r$pkgrel"
+depends_dev="linux-headers"
+makedepends_build="coreutils"
+makedepends_host="$depends_dev util-linux-dev"
+makedepends="$makedepends_build $makedepends_host"
+source="https://mirrors.kernel.org/sourceware/$pkgname/releases/LVM2.$pkgver.tgz
+ fix-stdio-usage.patch
+ mallinfo.patch
+ library_dir-default-config.patch
+ mlockall-default-config.patch
+ lvm.initd
+ lvm.confd
+ dmeventd.initd
+ "
+subpackages="
+ $pkgname-dev
+ $pkgname-doc
+ $pkgname-dmeventd
+ $pkgname-openrc
+ device-mapper:dm
+ device-mapper-libs:dm_libs
+ device-mapper-event-libs:dm_event_libs
+ $pkgname-libs
+ $pkgname-extra
+ "
+
+builddir="$srcdir/LVM2.$pkgver"
+
+build () {
+ cd "$builddir"
+
+ # during cross-compilation malloc test goes wrong
+ export ac_cv_func_malloc_0_nonnull=yes
+ export ac_cv_func_realloc_0_nonnull=yes
+
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --libdir=/lib \
+ --sbindir=/sbin \
+ --localstatedir=/var \
+ --disable-nls \
+ --disable-readline \
+ --enable-pkgconfig \
+ --enable-applib \
+ --with-thin=internal \
+ --enable-dmeventd \
+ --enable-cmdlib \
+ --with-thin-check=/sbin/thin_check \
+ --with-thin-dump=/sbin/thin_dump \
+ --with-thin-repair=/sbin/thin_repair \
+ --with-dmeventd-path=/sbin/dmeventd \
+ CLDFLAGS="$LDFLAGS" \
+ || return 1
+
+ make || return 1
+}
+
+package() {
+ cd "$builddir"
+ make -j1 DESTDIR="$pkgdir" install || return 1
+ install -d "$pkgdir"/etc/lvm/archive "$pkgdir"/etc/lvm/backup
+ install -Dm755 "$srcdir"/lvm.initd "$pkgdir"/etc/init.d/lvm
+ install -Dm644 "$srcdir"/lvm.confd "$pkgdir"/etc/conf.d/lvm
+ ln -s libdevmapper.so.1.02 "$pkgdir"/lib/libdevmapper.so || return 1
+}
+
+dmeventd() {
+ pkgdesc="Device-mapper event daemon"
+ mkdir -p "$subpkgdir"/sbin
+ mv "$pkgdir"/sbin/dmeventd "$subpkgdir"/sbin/
+ install -Dm755 "$srcdir"/dmeventd.initd "$subpkgdir"/etc/init.d/dmeventd
+}
+
+dm() {
+ pkgdesc="Device mapper userspace library and tools from LVM2"
+ mkdir -p "$subpkgdir"/sbin "$subpkgdir"/lib
+ mv "$pkgdir"/sbin/dm* "$subpkgdir"/sbin/
+}
+
+libs() {
+ pkgdesc="LVM2 shared libraries"
+ depends=
+ mkdir -p "$subpkgdir"/lib
+ mv "$pkgdir"/lib/liblvm2*.so.* "$subpkgdir"/lib/ || return 1
+ mv "$pkgdir"/lib/libdevmapper-event-lvm2*.so.* "$subpkgdir"/lib/ || return 1
+ mv "$pkgdir"/lib/device-mapper "$subpkgdir"/lib/ || return 1
+}
+
+dm_libs() {
+ pkgdesc="Device-mapper shared library"
+ depends=
+ mkdir -p "$subpkgdir"/lib
+ mv "$pkgdir"/lib/libdevmapper.so.* "$subpkgdir"/lib/
+}
+
+dm_event_libs() {
+ pkgdesc="Device-mapper event daemon shared library"
+ depends=
+ mkdir -p "$subpkgdir"/lib
+ mv "$pkgdir"/lib/libdevmapper-event.so.* "$subpkgdir"/lib/
+}
+
+extra() {
+ pkgdesc="LVM2 extra utilities"
+ depends="bash coreutils"
+ local util
+ for util in sbin/lvmdump sbin/lvmconf sbin/fsadm sbin/blkdeactivate; do
+ mkdir -p "$subpkgdir/${util%/*}"
+ mv $pkgdir/$util $subpkgdir/$util
+ done
+}
+
+sha512sums="73837edcad6c4165211be6a3528da62a189f1c97bcdd73a69746df9459d3716c0c44580a654b55e2bcafea48797ce4ecee0f1df22e32e599ddebf942807b2638 LVM2.2.02.175.tgz
+6ea4efad03f8632f2883f33f9d9f8ca295f7d8d2aa1bfbfa7738e7d711727a511758848dde5776b222bd74e6fb60bed8b56a3cd2f74ca448b8d86f50470a42b9 fix-stdio-usage.patch
+9272ec8c5184ef5dc776ead8f74132e072b7563b5119a3a38b712f00d92a1e3878c9b3a54eb2b01dcba038110c686b39d4c17ecd0eb258537e9217d7ed03c408 mallinfo.patch
+33004594a5cce7af1e493a2a66ce8ad2f864dde3b2ec0960d0fda9df9b7bcf65d9455f9eccf7860f48726c48f14111b843b0a0c9bd395ef2952b41aaab8092b2 library_dir-default-config.patch
+d190c40a137b006d7b63298069c93ff08d2804b990e85d44739cd7c48beec9a569903b98f0d940895fc7365723ba886acd7ef0e08f1f65a1a391d1c448ce080e mlockall-default-config.patch
+a853078660fd2fd943538924f56e81dc5793294e26b8f61d93e6188893f15f4a438d33792b341c1865d61e03f4a371b7c7ee0db5f4130ef7cb7aeaeb9290086a lvm.initd
+07caf8fa942290f3c953cc2463aaf55bac01d0bcb9351daf3880fa4d0eefb67fe00761c46a7a4da91cd2f8e492a12fed35853a15dc939cd80d19d3303bc3951d lvm.confd
+ca06220065525e93347efb7a5746a367cf55cb03574e50eed29bd7c4eae036bdd199b52c42d81811b6e742649e73ab8e66525f663bed66f9d1d82d0efde50332 dmeventd.initd"
diff --git a/system/lvm2/dmeventd.initd b/system/lvm2/dmeventd.initd
new file mode 100644
index 000000000..c46f8bab8
--- /dev/null
+++ b/system/lvm2/dmeventd.initd
@@ -0,0 +1,26 @@
+#!/sbin/openrc-run
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/dmeventd.initd-2.02.67-r1,v 1.3 2014/02/08 21:17:46 robbat2 Exp $
+
+PIDFILE=/run/dmeventd.pid
+BIN=/sbin/dmeventd
+
+depend() {
+ # As of .67-r1, we call ALL lvm start/stop scripts with --sysinit, that
+ # means dmeventd is NOT notified, as it cannot be safely running
+ after lvm device-mapper
+}
+
+start() {
+ ebegin "Starting dmeventd"
+ start-stop-daemon --start --exec $BIN --pidfile $PIDFILE
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping dmeventd"
+ start-stop-daemon --stop --exec $BIN --pidfile $PIDFILE
+ eend $?
+}
+
diff --git a/system/lvm2/fix-stdio-usage.patch b/system/lvm2/fix-stdio-usage.patch
new file mode 100644
index 000000000..39ba2e1b4
--- /dev/null
+++ b/system/lvm2/fix-stdio-usage.patch
@@ -0,0 +1,49 @@
+--- ./tools/lvmcmdline.c
++++ ./tools/lvmcmdline.c
+@@ -1252,7 +1252,7 @@
+ int err = is_valid_fd(STDERR_FILENO);
+
+ if (!is_valid_fd(STDIN_FILENO) &&
+- !(stdin = fopen(_PATH_DEVNULL, "r"))) {
++ !freopen(_PATH_DEVNULL, "r", stdin)) {
+ if (err)
+ perror("stdin stream open");
+ else
+@@ -1262,7 +1262,7 @@
+ }
+
+ if (!is_valid_fd(STDOUT_FILENO) &&
+- !(stdout = fopen(_PATH_DEVNULL, "w"))) {
++ !freopen(_PATH_DEVNULL, "w", stdout)) {
+ if (err)
+ perror("stdout stream open");
+ /* else no stdout */
+@@ -1270,7 +1270,7 @@
+ }
+
+ if (!is_valid_fd(STDERR_FILENO) &&
+- !(stderr = fopen(_PATH_DEVNULL, "w"))) {
++ !freopen(_PATH_DEVNULL, "w", stderr)) {
+ printf("stderr stream open: %s\n",
+ strerror(errno));
+ return 0;
+--- ./lib/commands/toolcontext.c.orig
++++ ./lib/commands/toolcontext.c
+@@ -1860,7 +1860,7 @@
+ /* FIXME Make this configurable? */
+ reset_lvm_errno(1);
+
+-#ifndef VALGRIND_POOL
++#if !defined(VALGRIND_POOL) && defined(__GLIBC__)
+ /* Set in/out stream buffering before glibc */
+ if (set_buffering) {
+ /* Allocate 2 buffers */
+@@ -2241,7 +2241,7 @@
+ if (cmd->libmem)
+ dm_pool_destroy(cmd->libmem);
+
+-#ifndef VALGRIND_POOL
++#if !defined(VALGRIND_POOL) && defined(__GLIBC__)
+ if (cmd->linebuffer) {
+ /* Reset stream buffering to defaults */
+ if (is_valid_fd(STDIN_FILENO) &&
diff --git a/system/lvm2/library_dir-default-config.patch b/system/lvm2/library_dir-default-config.patch
new file mode 100644
index 000000000..6e3b95832
--- /dev/null
+++ b/system/lvm2/library_dir-default-config.patch
@@ -0,0 +1,10 @@
+--- ./conf/example.conf.in.orig
++++ ./conf/example.conf.in
+@@ -694,6 +694,7 @@
+ # Configuration option global/library_dir.
+ # Search this directory first for shared libraries.
+ # This configuration option does not have a default value defined.
++ library_dir="/lib/device-mapper"
+
+ # Configuration option global/locking_library.
+ # The external locking library to use for locking_type 2.
diff --git a/system/lvm2/lvm.confd b/system/lvm2/lvm.confd
new file mode 100644
index 000000000..9d150f6ef
--- /dev/null
+++ b/system/lvm2/lvm.confd
@@ -0,0 +1,5 @@
+# LVM should normally only be started after mdadm-raid is available
+# this is because LVM physical volumes are very often MD devices.
+
+rc_after="mdadm-raid"
+
diff --git a/system/lvm2/lvm.initd b/system/lvm2/lvm.initd
new file mode 100644
index 000000000..db6adbeed
--- /dev/null
+++ b/system/lvm2/lvm.initd
@@ -0,0 +1,38 @@
+#!/sbin/openrc-run
+
+depend() {
+ before checkfs fsck swap
+ after hwdrivers modules device-mapper
+}
+
+dm_in_proc() {
+ local rc=0 i=
+ for i in devices misc; do
+ grep -qs 'device-mapper' /proc/$i
+ rc=$(($rc + $?))
+ done
+ return $rc
+}
+
+start() {
+ local rc=0 msg=
+ ebegin "Setting up the Logical Volume Manager"
+ if [ -e /proc/modules ] && ! dm_in_proc; then
+ modprobe dm-mod 2>/dev/null
+ fi
+ if [ -d /proc/lvm ] || dm_in_proc; then
+ vgscan --mknodes --ignorelockingfailure >/dev/null 2>&1
+ vgchange --sysinit --activate y >/dev/null 2>&1
+ rc=$?
+ else
+ rc=1
+ fi
+ eend $rc
+}
+
+stop() {
+ ebegin "Shutting down the Logical Volume Manager"
+ vgchange --ignorelockingfailure -a n >/dev/null 2>&1
+ eend $?
+}
+
diff --git a/system/lvm2/mallinfo.patch b/system/lvm2/mallinfo.patch
new file mode 100644
index 000000000..471a6b255
--- /dev/null
+++ b/system/lvm2/mallinfo.patch
@@ -0,0 +1,11 @@
+--- ./lib/mm/memlock.c.orig 2015-03-09 11:18:41.560028850 -0100
++++ ./lib/mm/memlock.c 2015-03-09 11:19:54.504373309 -0100
+@@ -137,7 +137,7 @@
+
+ static void _allocate_memory(void)
+ {
+-#ifndef VALGRIND_POOL
++#if !defined(VALGRIND_POOL) && defined(__GLIBC__)
+ void *stack_mem;
+ struct rlimit limit;
+ int i, area = 0, missing = _size_malloc_tmp, max_areas = 32, hblks;
diff --git a/system/lvm2/mlockall-default-config.patch b/system/lvm2/mlockall-default-config.patch
new file mode 100644
index 000000000..1daadeff3
--- /dev/null
+++ b/system/lvm2/mlockall-default-config.patch
@@ -0,0 +1,24 @@
+--- ./conf/example.conf.in.orig
++++ ./conf/example.conf.in
+@@ -1352,7 +1352,7 @@
+ # Use the old behavior of mlockall to pin all memory.
+ # Prior to version 2.02.62, LVM used mlockall() to pin the whole
+ # process's memory while activating devices.
+- use_mlockall = 0
++ use_mlockall = 1
+
+ # Configuration option activation/monitoring.
+ # Monitor LVs that are activated.
+diff --git a/lib/config/defaults.h b/lib/config/defaults.h
+index 8ab1fde..57b2443 100644
+--- a/lib/config/defaults.h
++++ b/lib/config/defaults.h
+@@ -53,7 +53,7 @@
+ #define DEFAULT_WAIT_FOR_LOCKS 1
+ #define DEFAULT_LVMLOCKD_LOCK_RETRIES 3
+ #define DEFAULT_PRIORITISE_WRITE_LOCKS 1
+-#define DEFAULT_USE_MLOCKALL 0
++#define DEFAULT_USE_MLOCKALL 1
+ #define DEFAULT_METADATA_READ_ONLY 0
+ #define DEFAULT_LVDISPLAY_SHOWS_FULL_DEVICE_PATH 0
+
diff --git a/system/lzip/APKBUILD b/system/lzip/APKBUILD
new file mode 100644
index 000000000..020baee7e
--- /dev/null
+++ b/system/lzip/APKBUILD
@@ -0,0 +1,35 @@
+# Contributor: ScrumpyJack <scrumpyjack@st.ilet.to>
+# Maintainer: ScrumpyJack <scrumpyjack@st.ilet.to>
+pkgname=lzip
+pkgver=1.20
+pkgrel=0
+pkgdesc="Lzip is a lossless data compressor"
+url="http://www.nongnu.org/lzip/lzip.html"
+arch="all"
+license="GPL-2.0-or-later"
+subpackages="$pkgname-doc"
+source="http://download.savannah.gnu.org/releases/$pkgname/$pkgname-$pkgver.tar.gz"
+builddir="$srcdir/$pkgname-$pkgver"
+
+build() {
+ cd "$builddir"
+ ./configure \
+ --prefix=/usr \
+ CXX="${CXX-g++}" \
+ CPPFLAGS="${CPPFLAGS}" \
+ CXXFLAGS="${CXXFLAGS}" \
+ LDFLAGS="${LDFLAGS}"
+ make
+}
+
+check() {
+ cd "$builddir"
+ make check
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR=$pkgdir install
+}
+
+sha512sums="0349b4c6c0b41e601b7ee381c3254d741397beb3ef9354c08162f346f131f4f48f6613ee0a610cdc6d827530df634f884ecfeee35215b10045a40fee76f8e938 lzip-1.20.tar.gz"
diff --git a/system/m4/APKBUILD b/system/m4/APKBUILD
new file mode 100644
index 000000000..af6db8b8d
--- /dev/null
+++ b/system/m4/APKBUILD
@@ -0,0 +1,41 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=m4
+pkgver=1.4.18
+pkgrel=1
+pkgdesc="GNU macro processor"
+url="https://www.gnu.org/software/m4"
+depends=
+makedepends=texinfo
+checkdepends=diffutils
+arch="all"
+license="GPL-3.0+"
+subpackages="m4-doc"
+source="ftp://ftp.gnu.org/gnu/m4/$pkgname-$pkgver.tar.gz
+ disable-mbrtowc-test.patch
+ localename-test-fix.patch
+ "
+
+build() {
+ cd "$builddir"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr
+ make
+}
+
+check() {
+ cd "$builddir"
+ make check
+}
+
+package() {
+ cd "$builddir"
+ make install DESTDIR="$pkgdir"
+ rm -rf "$pkgdir"/usr/lib/charset.alias
+ rmdir -p "$pkgdir"/usr/lib 2>/dev/null || true
+}
+
+sha512sums="29254dd4267a093e8d9da3a26df8b02564044cdb4506be539ec1aff4e5d406477bcf32f5e813c840f3aec77293bfe2cdde18f6a21724a7e0bfff646ec88b74ae m4-1.4.18.tar.gz
+78bf099c96fcec8c9cebd4e34f0d7c942e99da2ec238baa9464f8443580edb0565e9026c433ee54fb564304ec8e7e90766e19474472e57b48e567fd7b356777e disable-mbrtowc-test.patch
+fac0cb58e698996284a222c4da340f92689d6db98f1fbab6e61e1c5f2d90122660296f8e5c60c94169413e3e2ee632c6264f12b98e5d3a1e1aae145a2d4aac45 localename-test-fix.patch"
diff --git a/system/m4/disable-mbrtowc-test.patch b/system/m4/disable-mbrtowc-test.patch
new file mode 100644
index 000000000..cc2be2478
--- /dev/null
+++ b/system/m4/disable-mbrtowc-test.patch
@@ -0,0 +1,10 @@
+--- m4-1.4.18/tests/test-mbrtowc5.sh.old 2016-12-31 13:54:43.000000000 +0000
++++ m4-1.4.18/tests/test-mbrtowc5.sh 2017-07-30 17:29:50.879924130 +0000
+@@ -1,6 +1,2 @@
+ #!/bin/sh
+-# Test whether the POSIX locale has encoding errors.
+-LC_ALL=C \
+-./test-mbrtowc${EXEEXT} 5 || exit
+-LC_ALL=POSIX \
+-./test-mbrtowc${EXEEXT} 5
++exit 77
diff --git a/system/m4/localename-test-fix.patch b/system/m4/localename-test-fix.patch
new file mode 100644
index 000000000..04584aba6
--- /dev/null
+++ b/system/m4/localename-test-fix.patch
@@ -0,0 +1,34 @@
+--- m4-1.4.18/tests/localename.c.old 2016-12-31 13:54:43.000000000 +0000
++++ m4-1.4.18/tests/localename.c 2017-07-30 16:40:47.098541270 +0000
+@@ -40,7 +40,7 @@
+ # if defined __APPLE__ && defined __MACH__
+ # include <xlocale.h>
+ # endif
+-# if __GLIBC__ >= 2 && !defined __UCLIBC__
++# if defined __linux__
+ # include <langinfo.h>
+ # endif
+ # if !defined IN_LIBINTL
+@@ -2692,16 +2692,19 @@
+ locale_t thread_locale = uselocale (NULL);
+ if (thread_locale != LC_GLOBAL_LOCALE)
+ {
+-# if __GLIBC__ >= 2 && !defined __UCLIBC__
++# if defined(_NL_LOCALE_NAME)
++ const char *name = nl_langinfo(_NL_LOCALE_NAME(category));
++# if __GLIBC__ >= 2 && !defined __UCLIBC__
+ /* Work around an incorrect definition of the _NL_LOCALE_NAME macro in
+ glibc < 2.12.
+ See <http://sourceware.org/bugzilla/show_bug.cgi?id=10968>. */
+- const char *name =
+- nl_langinfo (_NL_ITEM ((category), _NL_ITEM_INDEX (-1)));
++ if (name[0] == '\0')
++ name = nl_langinfo (_NL_ITEM ((category), _NL_ITEM_INDEX (-1)));
+ if (name[0] == '\0')
+ /* Fallback code for glibc < 2.4, which did not implement
+ nl_langinfo (_NL_LOCALE_NAME (category)). */
+ name = thread_locale->__names[category];
++# endif
+ return name;
+ # elif defined __FreeBSD__ || (defined __APPLE__ && defined __MACH__)
+ /* FreeBSD, Mac OS X */
diff --git a/system/make/APKBUILD b/system/make/APKBUILD
new file mode 100644
index 000000000..6843986ca
--- /dev/null
+++ b/system/make/APKBUILD
@@ -0,0 +1,44 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=make
+pkgver=4.2.1
+pkgrel=1
+pkgdesc="GNU make utility to maintain groups of programs"
+url="https://www.gnu.org/software/make"
+arch="all"
+license="GPL-3.0-or-later"
+depends=""
+subpackages="$pkgname-doc"
+source="ftp://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.bz2
+ fix-atexit-exit.patch
+ "
+
+prepare() {
+ cd "$builddir"
+ update_config_sub
+ default_prepare
+}
+
+build() {
+ cd "$builddir"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ --disable-nls
+ make
+}
+
+check() {
+ cd "$builddir"
+ [ "$CBUILD" != "$CHOST" ] || (ulimit -n 64 && PERL5LIB=. make check) || return 1
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+}
+
+sha512sums="9cf00869a2f938492554f71d8cb288b5b009b3bd0489ef164f2c8f6532fc37db5c7e20af1dea288536e7c9710ee0bc6e1ddcdfc4928a8540e6e43661741825b8 make-4.2.1.tar.bz2
+a1639d9caf84a24a9f161a30d8b5dcd079b13faf2a5e3d514ff39fa11b13e796c7ff34c46ac2b56656d52129b4d3627c6102b129a4ab011f065076d872ef3992 fix-atexit-exit.patch"
diff --git a/system/make/fix-atexit-exit.patch b/system/make/fix-atexit-exit.patch
new file mode 100644
index 000000000..a71d26fb5
--- /dev/null
+++ b/system/make/fix-atexit-exit.patch
@@ -0,0 +1,17 @@
+Author: Timo Teräs <timo.teras@iki.fi>
+
+POSIX says the behaviour is undefined if atexit callback calls
+exit(). On glibc it works, but on musl it does not. Call instead
+_exit() which is guaranteed to work.
+
+--- ./output.c.orig
++++ ./output.c
+@@ -495,7 +495,7 @@
+ perror_with_name (_("write error: stdout"), "");
+ else
+ O (error, NILF, _("write error: stdout"));
+- exit (MAKE_TROUBLE);
++ _exit (MAKE_TROUBLE);
+ }
+ }
+
diff --git a/system/man-db/APKBUILD b/system/man-db/APKBUILD
new file mode 100644
index 000000000..a645b2b7e
--- /dev/null
+++ b/system/man-db/APKBUILD
@@ -0,0 +1,50 @@
+# Contributor: A. Wilcox <awilfox@adelielinux.org>
+# Maintainer: A. Wilcox <awilfox@adelielinux.org>
+pkgname=man-db
+pkgver=2.7.6.1
+pkgrel=2
+pkgdesc="The man command and related utilities for examining on-line help files"
+url="http://www.nongnu.org/man-db/"
+arch="all"
+license="GPL-2+"
+depends="groff less"
+makedepends_host="db-dev gettext-dev libpipeline-dev zlib-dev"
+subpackages="$pkgname-doc"
+[ "$CBUILD" != "$CHOST" ] || subpackages="$subpackages $pkgname-lang"
+options="!check" # requires //IGNORE in iconv
+source="http://download.savannah.nongnu.org/releases/man-db/man-db-$pkgver.tar.xz
+ man-db.trigger
+ man-db-2.7.5-iconv.patch"
+triggers="man-db.trigger=/usr/share/man"
+
+build() {
+ cd "$builddir"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --localstatedir=/var \
+ --disable-setuid \
+ --with-sections="1 1p 1x 2 2x 3 3p 3x 4 4x 5 5x 6 6x 7 7x 8 8x 9 0p tcl n l p o" \
+ --enable-nls \
+ --with-db=db
+ make
+}
+
+check() {
+ cd "$builddir"
+ make check
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+ rm "${pkgdir}"/usr/lib/charset.alias
+ rm -r "${pkgdir}"/usr/lib/tmpfiles.d # systemd
+}
+
+sha512sums="623c5e7f8b7c289908b2c926f8777293b8d39aeceef0d2509d701a8b0bfa81408650f655c8608318221786c751a79ee91124b07993de5298cd7fa6d8bb737301 man-db-2.7.6.1.tar.xz
+0d2ab0b42888178ffb83c5dd5eaac8005f047de56af55eb3046291318fd8ed8c4999a4ea0148367ea07c0a0490eb8b9bc726a03b46533ef51bec6a5747719b64 man-db.trigger
+bdf53b2868eb0652f8ca5bec340736a1923b52921bc1a33bde691f005be937f0a01dd32ff46d04ba956aa9c05b2cf276a03877de6c5fd1d997c4a5b029f330e2 man-db-2.7.5-iconv.patch"
diff --git a/system/man-db/man-db-2.7.5-iconv.patch b/system/man-db/man-db-2.7.5-iconv.patch
new file mode 100644
index 000000000..24fea8872
--- /dev/null
+++ b/system/man-db/man-db-2.7.5-iconv.patch
@@ -0,0 +1,75 @@
+diff --git man-db-2.7.5/src/man.c man-db-fixed/src/man.c
+index bea684f..df5f5cb 100644
+--- man-db-2.7.5/src/man.c
++++ man-db-fixed/src/man.c
+@@ -1503,11 +1503,9 @@ static void add_output_iconv (pipeline *p,
+ {
+ debug ("add_output_iconv: source %s, target %s\n", source, target);
+ if (source && target && !STREQ (source, target)) {
+- char *target_translit = xasprintf ("%s//TRANSLIT", target);
+ pipeline_command_args (p, "iconv", "-c",
+- "-f", source, "-t", target_translit,
++ "-f", source, "-t", target,
+ NULL);
+- free (target_translit);
+ }
+ }
+
+diff --git man-db-2.7.5/src/manconv.c man-db-fixed/src/manconv.c
+index cae9b67..48b7a81 100644
+--- man-db-2.7.5/src/manconv.c
++++ man-db-fixed/src/manconv.c
+@@ -106,10 +106,9 @@ static int try_iconv (pipeline *p, const char *try_from_code, const char *to,
+ static char *utf8 = NULL, *output = NULL;
+ size_t utf8left = 0;
+ iconv_t cd_utf8, cd = NULL;
+- int to_utf8 = STREQ (try_to_code, "UTF-8") ||
+- STRNEQ (try_to_code, "UTF-8//", 7);
+- const char *utf8_target = last ? "UTF-8//IGNORE" : "UTF-8";
+- int ignore_errors = (strstr (try_to_code, "//IGNORE") != NULL);;
++ int to_utf8 = STREQ (try_to_code, "UTF-8");
++ const char *utf8_target = "UTF-8";
++ int ignore_errors = 0;
+ int ret = 0;
+
+ debug ("trying encoding %s -> %s\n", try_from_code, try_to_code);
+diff --git man-db-2.7.5/src/manconv_client.c man-db-fixed/src/manconv_client.c
+index 2949c75..7805f90 100644
+--- man-db-2.7.5/src/manconv_client.c
++++ man-db-fixed/src/manconv_client.c
+@@ -131,7 +131,7 @@ void add_manconv (pipeline *p, const char *source, const char *target)
+ codes->from[2] = NULL;
+ name = appendstr (name, "UTF-8:", source, NULL);
+ }
+- codes->to = xasprintf ("%s//IGNORE", target);
++ codes->to = xstrdup (target);
+ /* informational only; no shell quoting concerns */
+ name = appendstr (name, " -t ", codes->to, NULL);
+ if (quiet >= 2)
+diff --git man-db-2.7.5/src/manconv_main.c man-db-fixed/src/manconv_main.c
+index 166a2b8..4e700e9 100644
+--- man-db-2.7.5/src/manconv_main.c
++++ man-db-fixed/src/manconv_main.c
+@@ -105,9 +105,6 @@ static error_t parse_opt (int key, char *arg, struct argp_state *state)
+ return 0;
+ case 't':
+ to_code = xstrdup (arg);
+- if (!strstr (to_code, "//"))
+- to_code = appendstr (to_code, "//TRANSLIT",
+- NULL);
+ return 0;
+ case 'd':
+ debug_level = 1;
+diff --git man-db-2.7.5/src/whatis.c man-db-fixed/src/whatis.c
+index 39aa093..0a25c92 100644
+--- man-db-2.7.5/src/whatis.c
++++ man-db-fixed/src/whatis.c
+@@ -948,7 +948,7 @@ int main (int argc, char *argv[])
+ display_seen = hashtable_create (&null_hashtable_free);
+
+ #ifdef HAVE_ICONV
+- locale_charset = xasprintf ("%s//IGNORE", get_locale_charset ());
++ locale_charset = xstrdup (get_locale_charset ());
+ conv_to_locale = iconv_open (locale_charset, "UTF-8");
+ free (locale_charset);
+ #endif /* HAVE_ICONV */
diff --git a/system/man-db/man-db.trigger b/system/man-db/man-db.trigger
new file mode 100644
index 000000000..fb76aa38c
--- /dev/null
+++ b/system/man-db/man-db.trigger
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec /usr/bin/mandb /usr/share/man
diff --git a/system/mawk/APKBUILD b/system/mawk/APKBUILD
new file mode 100644
index 000000000..bed717f6e
--- /dev/null
+++ b/system/mawk/APKBUILD
@@ -0,0 +1,37 @@
+# Contributor: A. Wilcox <awilfox@adelielinux.org>
+# Maintainer: A. Wilcox <awilfox@adelielinux.org>
+pkgname=mawk
+pkgver=20161120
+pkgrel=1
+pkgdesc="Pattern scanning and text processing language"
+url="http://invisible-island.net/mawk/mawk.html"
+arch="all"
+license="BSD-3-Clause"
+subpackages="$pkgname-doc"
+source="http://invisible-mirror.net/archives/$pkgname/$pkgname-1.3.4-$pkgver.tgz"
+builddir="$srcdir/$pkgname-1.3.4-$pkgver"
+
+build() {
+ cd "$builddir"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --localstatedir=/var
+ make
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+ ln -s mawk "$pkgdir"/usr/bin/awk
+}
+
+check() {
+ cd "$builddir"
+ make check
+}
+
+sha512sums="c5edcbff4ab1e40eb9b178a045fcd426a5f3c93a3ab5bc1ca1fa85a0977b8c9060967fcbda4e4a6e9e68628f50a2814e22939676008dced529377d2cf9bda5b2 mawk-1.3.4-20161120.tgz"
diff --git a/system/mesa/APKBUILD b/system/mesa/APKBUILD
deleted file mode 100644
index ceb22c20f..000000000
--- a/system/mesa/APKBUILD
+++ /dev/null
@@ -1,252 +0,0 @@
-# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
-pkgname=mesa
-pkgver=17.3.1
-pkgrel=1
-pkgdesc="Mesa DRI OpenGL library"
-url="http://www.mesa3d.org"
-arch="all"
-license="LGPL"
-depends=
-subpackages="$pkgname-dev
- $pkgname-dri-ati:_dri
- $pkgname-dri-nouveau:_dri
- $pkgname-dri-freedreno:_dri
- $pkgname-dri-swrast:_dri
- $pkgname-dri-virtio:_dri
- $pkgname-glapi $pkgname-egl $pkgname-gl $pkgname-gles
- $pkgname-xatracker $pkgname-osmesa $pkgname-gbm
- $pkgname-libwayland-egl:_wayland
- "
-_llvmver=4
-depends_dev="libdrm-dev dri2proto libxext-dev libxdamage-dev libxcb-dev glproto
- dri3proto presentproto libxshmfence-dev"
-makedepends="$depends_dev expat-dev xextproto libxt-dev makedepend py3-mako
- flex bison llvm$_llvmver-dev eudev-dev libvdpau-dev python3 py-libxml2
- libxvmc-dev gettext zlib-dev wayland-dev libelf-dev wayland-protocols
- autoconf automake libtool libxxf86vm-dev libx11-dev libxfixes-dev"
-source="https://mesa.freedesktop.org/archive/mesa-$pkgver.tar.xz
- glx_ro_text_segm.patch
- musl-fixes.patch
- musl-fix-includes.patch
- disk_cache-stack-overflow.patch
- drmdeps.patch
- python3-compat.patch
- "
-replaces="mesa-dricore"
-
-_dri_driverdir=/usr/lib/xorg/modules/dri
-_dri_drivers="r200,radeon,nouveau,swrast"
-_gallium_drivers="r300,r600,radeonsi,nouveau,freedreno,swrast,virgl"
-_vulkan_drivers="radeon"
-
-builddir="$srcdir/mesa-$pkgver"
-
-_arch_opts=
-
-case "$CARCH" in
-x86* | pmmx)
- _dri_drivers="${_dri_drivers},i915,i965"
- _gallium_drivers="${_gallium_drivers},svga"
- _vulkan_drivers="${_vulkan_drivers},intel"
- subpackages="$subpackages $pkgname-dri-intel:_dri $pkgname-dri-vmwgfx:_dri"
- ;;
-arm*)
- _gallium_drivers="${_gallium_drivers},vc4"
- case "$CARCH" in
- armhf) CFLAGS="$CFLAGS -mfpu=neon";;
- esac
- ;;
-esac
-
-prepare() {
- cd "$builddir"
- default_prepare
- libtoolize --force \
- && aclocal \
- && automake --add-missing \
- && autoreconf
-}
-
-build() {
- cd "$builddir"
-
- export CFLAGS="$CFLAGS -D_XOPEN_SOURCE=700"
- ./configure \
- --build=$CBUILD \
- --host=$CHOST \
- --prefix=/usr \
- --sysconfdir=/etc \
- --with-dri-driverdir=$_dri_driverdir \
- --disable-asm \
- --disable-xvmc \
- --enable-glx-rts \
- --with-gallium-drivers=${_gallium_drivers} \
- --with-dri-drivers=${_dri_drivers} \
- --with-vulkan-drivers=${_vulkan_drivers} \
- --with-llvm-prefix=/usr/lib/llvm$_llvmver \
- --enable-llvm-shared-libs \
- --enable-llvm \
- --with-platforms=x11,drm,wayland \
- --enable-shared-glapi \
- --enable-gbm \
- --disable-glx-tls \
- --disable-nine \
- --enable-dri \
- --enable-dri3 \
- --enable-glx \
- --enable-osmesa \
- --enable-gles1 \
- --enable-gles2 \
- --enable-egl \
- --enable-texture-float \
- --enable-xa \
- --enable-vdpau \
- $_arch_opts
-
- make
-}
-
-check() {
- cd "$builddir"
- # Compiler test requires LLVM 3.8 and Python 2
- for i in gtest util mapi; do
- make -C "src/$i" check
- done
-}
-
-package() {
- cd "$builddir"
- make -j1 DESTDIR="$pkgdir" install
-}
-
-egl() {
- replaces="mesa"
- pkgdesc="Mesa libEGL runtime libraries"
- install -d "$subpkgdir"/usr/lib
- mv "$pkgdir"/usr/lib/libEGL.so* \
- "$subpkgdir"/usr/lib/
-}
-
-gl() {
- replaces="mesa"
- pkgdesc="Mesa libGL runtime libraries"
- install -d "$subpkgdir"/usr/lib
- mv "$pkgdir"/usr/lib/libGL.so* \
- "$subpkgdir"/usr/lib/
-}
-
-glapi() {
- replaces="$pkgname-gles"
- pkgdesc="Mesa shared glapi"
- install -d "$subpkgdir"/usr/lib
- mv "$pkgdir"/usr/lib/libglapi.so.* \
- "$subpkgdir"/usr/lib/
-}
-
-gles() {
- replaces="mesa"
- pkgdesc="Mesa libGLESv2 runtime libraries"
- install -d "$subpkgdir"/usr/lib
- mv "$pkgdir"/usr/lib/libGLES*.so* \
- "$subpkgdir"/usr/lib/
-}
-
-xatracker() {
- pkgdesc="Mesa XA state tracker for vmware"
- install -d "$subpkgdir"/usr/lib
- mv "$pkgdir"/usr/lib/libxatracker*.so.* \
- "$subpkgdir"/usr/lib/
-}
-
-osmesa() {
- pkgdesc="Mesa offscreen rendering libraries"
- install -d "$subpkgdir"/usr/lib
- mv "$pkgdir"/usr/lib/libOSMesa.so.* \
- "$subpkgdir"/usr/lib/
-}
-
-gbm() {
- pkgdesc="Mesa gbm library"
- replaces="mesa"
- install -d "$subpkgdir"/usr/lib
- mv "$pkgdir"/usr/lib/libgbm.so.* \
- "$subpkgdir"/usr/lib/
-}
-
-_mv_dri() {
- install -d "$subpkgdir"/$_dri_driverdir
-
- while [ $# -gt 0 ]; do
- mv "$pkgdir"/$_dri_driverdir/${1}.so \
- "$subpkgdir"/$_dri_driverdir/ || return 1
- shift
- done
-}
-
-_mv_vdpau() {
- local i
- install -d "$subpkgdir"/usr/lib/vdpau
- for i in "$@"; do
- mv "$pkgdir"/usr/lib/vdpau/libvdpau_$i.* \
- "$subpkgdir"/usr/lib/vdpau/ || return 1
- done
-}
-
-_mv_gpipe() {
- return 0
- # http://cgit.freedesktop.org/mesa/mesa/commit/?id=44ec468e8033553c26a112cebba41c343db00eb1
- # https://code.google.com/p/chromium/issues/detail?id=412089
-# local i
-# install -d "$subpkgdir"/usr/lib/gallium-pipe
-# for i in "$@"; do
-# mv "$pkgdir"/usr/lib/gallium-pipe/pipe_$i.* \
-# "$subpkgdir"/usr/lib/gallium-pipe/ || return 1
-# done
-}
-
-_dri() {
- local n=${subpkgname##*-dri-}
- pkgdesc="Mesa DRI driver for $n"
- case $n in
- ati)
- _mv_dri radeon_dri r200_dri r300_dri r600_dri radeonsi_dri \
- && _mv_vdpau r300 r600 radeonsi \
- && _mv_gpipe r300 r600
- ;;
- intel)
- _mv_dri i915_dri i965_dri
- ;;
- nouveau)
- _mv_dri nouveau_dri nouveau_vieux_dri \
- && _mv_vdpau nouveau \
- && _mv_gpipe nouveau
- ;;
- freedreno)
- _mv_dri msm_dri kgsl_dri
- ;;
- swrast)
- _mv_dri swrast_dri kms_swrast_dri && _mv_gpipe swrast
- ;;
- vmwgfx)
- _mv_dri vmwgfx_dri && _mv_gpipe vmwgfx
- ;;
- virtio)
- _mv_dri virtio_gpu_dri
- ;;
- esac
-}
-
-_wayland() {
- pkgdesc="Mesa libwayland-egl library"
- mkdir -p "$subpkgdir"/usr/lib
- mv "$pkgdir"/usr/lib/libwayland-egl.so.* "$subpkgdir"/usr/lib/ \
- || return 1
-}
-
-sha512sums="a2bd0123bf2df0db03197001a9e001b25f2609f3c6bf1bae66f3bc50c51d2558b5b77e232e81c1658c3a4dec88eda32a8b5a85c1fedc937a7441476228ef8238 mesa-17.3.1.tar.xz
-c3d4804ebc24c7216e4c9d4995fb92e116be7f478024b44808ee134a4c93bb51d1f66fe5fb6eca254f124c4abf6f81272b027824b3e2650a9607818bf793035a glx_ro_text_segm.patch
-edb9c221b093117f48fa298ae557f1d6ed9bbf32d7d262ad4ddb51d26ece94e3efac17670784606052b2ebe8d3dc2b221164f6b52f5282eb3318e6377932be04 musl-fixes.patch
-c7d91a660a033df91fac9c557039efc8669f0c26b2d35997d50753938b70d1af0bd110dcab3f8236eafab7d4be5dd7cd128a3e057e67e7e6a38a73fd6a7ef62e musl-fix-includes.patch
-f40ff04ac73c090c74d1955de6013c5aa41fb77f28b2b82d89cfc1880306a9ca1dde4581592db19f0a0ec6d85032f1ed5d953103ab0d075f9f0b7e459a028c45 disk_cache-stack-overflow.patch
-6800bc62aebfba22a2562c858c27391b47c5675020bd67f040da93ffe4d5d8ac828907a44c7cee6a4ebe63821b58c2515b4012f1f23473670b1de8670426a430 drmdeps.patch
-be91c579111e4ceadf094fcd55fff46ff12c360e2d89c98fac50fbd3bb2459dbd1209d562d27338b94b20bbeae5fca2dd881694bd0da55fca8cdfe253ae384f1 python3-compat.patch"
diff --git a/system/mesa/disk_cache-stack-overflow.patch b/system/mesa/disk_cache-stack-overflow.patch
deleted file mode 100644
index 3fad95259..000000000
--- a/system/mesa/disk_cache-stack-overflow.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-The disk cache code tries to allocate a 256 Kbyte buffer on the stack.
-Since musl only gives 80 Kbyte of stack space per thread, this causes a trap.
-
---- mesa-17.3.1/src/util/disk_cache.c.old 2017-12-21 11:31:22.000000000 -0600
-+++ mesa-17.3.1/src/util/disk_cache.c 2017-12-29 01:17:15.625633901 -0600
-@@ -716,7 +716,7 @@
- deflate_and_write_to_disk(const void *in_data, size_t in_data_size, int dest,
- const char *filename)
- {
-- unsigned char out[BUFSIZE];
-+ unsigned char *out;
-
- /* allocate deflate state */
- z_stream strm;
-@@ -733,6 +733,11 @@
- /* compress until end of in_data */
- size_t compressed_size = 0;
- int flush;
-+
-+ out = calloc(1, BUFSIZE);
-+ if (out == NULL)
-+ return 0;
-+
- do {
- int remaining = in_data_size - BUFSIZE;
- flush = remaining > 0 ? Z_NO_FLUSH : Z_FINISH;
-@@ -754,6 +759,7 @@
- ssize_t written = write_all(dest, out, have);
- if (written == -1) {
- (void)deflateEnd(&strm);
-+ free(out);
- return 0;
- }
- } while (strm.avail_out == 0);
-@@ -768,6 +774,7 @@
-
- /* clean up and return */
- (void)deflateEnd(&strm);
-+ free(out);
- return compressed_size;
- }
-
diff --git a/system/mesa/drmdeps.patch b/system/mesa/drmdeps.patch
deleted file mode 100644
index edcb80643..000000000
--- a/system/mesa/drmdeps.patch
+++ /dev/null
@@ -1,41 +0,0 @@
---- a/src/gallium/winsys/radeon/drm/Makefile.am 2017-08-10 11:45:20.737377457 -0400
-+++ b/src/gallium/winsys/radeon/drm/Makefile.am 2017-08-10 11:50:23.414534307 -0400
-@@ -7,4 +7,6 @@
-
- noinst_LTLIBRARIES = libradeonwinsys.la
-
-+libradeonwinsys_la_LIBADD = -ldrm_radeon
-+
- libradeonwinsys_la_SOURCES = $(C_SOURCES)
---- a/src/gallium/winsys/radeon/drm/Makefile.in 2017-08-10 11:45:25.577298181 -0400
-+++ b/src/gallium/winsys/radeon/drm/Makefile.in 2017-08-10 11:57:11.151189074 -0400
-@@ -119,7 +119,7 @@
- CONFIG_CLEAN_FILES =
- CONFIG_CLEAN_VPATH_FILES =
- LTLIBRARIES = $(noinst_LTLIBRARIES)
--libradeonwinsys_la_LIBADD =
-+libradeonwinsys_la_LIBADD = -ldrm_radeon
- am__objects_1 = radeon_drm_bo.lo radeon_drm_cs.lo \
- radeon_drm_surface.lo radeon_drm_winsys.lo
- am_libradeonwinsys_la_OBJECTS = $(am__objects_1)
---- a/src/gallium/winsys/amdgpu/drm/Makefile.am 2017-12-21 11:31:21.000000000 -0600
-+++ b/src/gallium/winsys/amdgpu/drm/Makefile.am 2017-12-28 19:24:48.613693400 -0600
-@@ -11,6 +11,6 @@
- noinst_LTLIBRARIES = libamdgpuwinsys.la
-
- libamdgpuwinsys_la_LIBADD = \
-- $(top_builddir)/src/amd/addrlib/libamdgpu_addrlib.la
-+ $(top_builddir)/src/amd/addrlib/libamdgpu_addrlib.la -ldrm_amdgpu
-
- libamdgpuwinsys_la_SOURCES = $(C_SOURCES)
---- a/src/gallium/winsys/amdgpu/drm/Makefile.in 2017-12-21 11:31:30.000000000 -0600
-+++ b/src/gallium/winsys/amdgpu/drm/Makefile.in 2017-12-28 19:25:22.553597353 -0600
-@@ -572,7 +572,7 @@
- AM_CXXFLAGS = $(AM_CFLAGS)
- noinst_LTLIBRARIES = libamdgpuwinsys.la
- libamdgpuwinsys_la_LIBADD = \
-- $(top_builddir)/src/amd/addrlib/libamdgpu_addrlib.la
-+ $(top_builddir)/src/amd/addrlib/libamdgpu_addrlib.la -ldrm_amdgpu
-
- libamdgpuwinsys_la_SOURCES = $(C_SOURCES)
- all: all-am
diff --git a/system/mesa/glx_ro_text_segm.patch b/system/mesa/glx_ro_text_segm.patch
deleted file mode 100644
index 8cad4876b..000000000
--- a/system/mesa/glx_ro_text_segm.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-2011-02-09 Jeremy Huddleston <jeremyhu@freedesktop.org
-
- #240956
- * configure.ac add support to enable readonly test segment on x86
-
---- ./configure.ac.orig 2008-11-17 23:19:38.000000000 +0100
-+++ ./configure.ac 2008-11-17 23:20:17.000000000 +0100
-@@ -499,6 +499,20 @@
- enable_xcb=no
- fi
-
-+
-+dnl readonly text segment on x86 hardened platforms
-+AC_ARG_ENABLE([glx_rts],
-+ [AS_HELP_STRING([--enable-glx-rts],
-+ [on x86, use a readonly text segment for libGL @<:@default=disabled@:>@])],
-+ [enable_glx_rts="$enableval"],
-+ [enable_glx_rts=no])
-+if test "x$enable_glx_rts" = xyes; then
-+ DEFINES="$DEFINES -DGLX_X86_READONLY_TEXT"
-+else
-+ enable_glx_rts=no
-+fi
-+
-+
- dnl
- dnl libGL configuration per driver
- dnl
diff --git a/system/mesa/musl-fix-includes.patch b/system/mesa/musl-fix-includes.patch
deleted file mode 100644
index 2f6cc1d13..000000000
--- a/system/mesa/musl-fix-includes.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff --git a/src/util/rand_xor.c b/src/util/rand_xor.c
-index de05fa6..016703c 100644
---- a/src/util/rand_xor.c
-+++ b/src/util/rand_xor.c
-@@ -24,6 +24,9 @@
-
- #if defined(__linux__)
- #include <sys/file.h>
-+#include <sys/types.h>
-+#include <sys/stat.h>
-+#include <fcntl.h>
- #include <unistd.h>
- #else
- #include <time.h>
diff --git a/system/mesa/musl-fixes.patch b/system/mesa/musl-fixes.patch
deleted file mode 100644
index 60140d445..000000000
--- a/system/mesa/musl-fixes.patch
+++ /dev/null
@@ -1,22 +0,0 @@
---- ./src/gallium/winsys/svga/drm/vmw_screen.h.orig
-+++ ./src/gallium/winsys/svga/drm/vmw_screen.h
-@@ -34,7 +34,7 @@
- #ifndef VMW_SCREEN_H_
- #define VMW_SCREEN_H_
-
--
-+#include <sys/stat.h>
- #include "pipe/p_compiler.h"
- #include "pipe/p_state.h"
-
---- a/src/util/u_endian.h.orig 2016-11-04 12:16:00.480356454 +0100
-+++ b/src/util/u_endian.h 2016-11-04 12:16:11.984347944 +0100
-@@ -27,7 +27,7 @@
- #ifndef U_ENDIAN_H
- #define U_ENDIAN_H
-
--#if defined(__GLIBC__) || defined(ANDROID) || defined(__CYGWIN__)
-+#if defined(__linux__) || defined(ANDROID) || defined(__CYGWIN__)
- #include <endian.h>
-
- #if __BYTE_ORDER == __LITTLE_ENDIAN
diff --git a/system/mesa/python3-compat.patch b/system/mesa/python3-compat.patch
deleted file mode 100644
index 8532f8c0c..000000000
--- a/system/mesa/python3-compat.patch
+++ /dev/null
@@ -1,106 +0,0 @@
---- mesa-17.3.1/src/gallium/drivers/r600/egd_tables.py (original)
-+++ mesa-17.3.1/src/gallium/drivers/r600/egd_tables.py (refactored)
-@@ -60,7 +60,7 @@
- """
- fragments = [
- '"%s\\0" /* %s */' % (
-- te[0].encode('string_escape'),
-+ te[0].encode('unicode-escape'),
- ', '.join(str(idx) for idx in te[2])
- )
- for te in self.table
-@@ -217,10 +217,10 @@
- strings = StringTable()
- strings_offsets = IntTable("int")
-
-- print '/* This file is autogenerated by egd_tables.py from evergreend.h. Do not edit directly. */'
-- print
-- print CopyRight.strip()
-- print '''
-+ print('/* This file is autogenerated by egd_tables.py from evergreend.h. Do not edit directly. */')
-+ print()
-+ print(CopyRight.strip())
-+ print('''
- #ifndef EG_TABLES_H
- #define EG_TABLES_H
-
-@@ -242,20 +242,20 @@
- unsigned name_offset;
- unsigned op;
- };
--'''
--
-- print 'static const struct eg_packet3 packet3_table[] = {'
-+''')
-+
-+ print('static const struct eg_packet3 packet3_table[] = {')
- for pkt in packets:
-- print '\t{%s, %s},' % (strings.add(pkt[5:]), pkt)
-- print '};'
-- print
--
-- print 'static const struct eg_field egd_fields_table[] = {'
-+ print('\t{%s, %s},' % (strings.add(pkt[5:]), pkt))
-+ print('};')
-+ print()
-+
-+ print('static const struct eg_field egd_fields_table[] = {')
-
- fields_idx = 0
- for reg in regs:
- if len(reg.fields) and reg.own_fields:
-- print '\t/* %s */' % (fields_idx)
-+ print('\t/* %s */' % (fields_idx))
-
- reg.fields_idx = fields_idx
-
-@@ -266,34 +266,34 @@
- while value[1] >= len(values_offsets):
- values_offsets.append(-1)
- values_offsets[value[1]] = strings.add(strip_prefix(value[0]))
-- print '\t{%s, %s(~0u), %s, %s},' % (
-+ print('\t{%s, %s(~0u), %s, %s},' % (
- strings.add(field.name), field.s_name,
-- len(values_offsets), strings_offsets.add(values_offsets))
-+ len(values_offsets), strings_offsets.add(values_offsets)))
- else:
-- print '\t{%s, %s(~0u)},' % (strings.add(field.name), field.s_name)
-+ print('\t{%s, %s(~0u)},' % (strings.add(field.name), field.s_name))
- fields_idx += 1
-
-- print '};'
-- print
--
-- print 'static const struct eg_reg egd_reg_table[] = {'
-+ print('};')
-+ print()
-+
-+ print('static const struct eg_reg egd_reg_table[] = {')
- for reg in regs:
- if len(reg.fields):
-- print '\t{%s, %s, %s, %s},' % (strings.add(reg.name), reg.r_name,
-- len(reg.fields), reg.fields_idx if reg.own_fields else reg.fields_owner.fields_idx)
-+ print('\t{%s, %s, %s, %s},' % (strings.add(reg.name), reg.r_name,
-+ len(reg.fields), reg.fields_idx if reg.own_fields else reg.fields_owner.fields_idx))
- else:
-- print '\t{%s, %s},' % (strings.add(reg.name), reg.r_name)
-- print '};'
-- print
-+ print('\t{%s, %s},' % (strings.add(reg.name), reg.r_name))
-+ print('};')
-+ print()
-
- strings.emit(sys.stdout, "egd_strings")
-
-- print
-+ print()
-
- strings_offsets.emit(sys.stdout, "egd_strings_offsets")
-
-- print
-- print '#endif'
-+ print()
-+ print('#endif')
-
-
- def main():
diff --git a/system/mpc1/APKBUILD b/system/mpc1/APKBUILD
new file mode 100644
index 000000000..6552a588d
--- /dev/null
+++ b/system/mpc1/APKBUILD
@@ -0,0 +1,46 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=mpc1
+pkgver=1.0.3
+pkgrel=1
+pkgdesc="Multiprecision C library"
+url="http://www.multiprecision.org/"
+arch="all"
+license="LGPL-2.1"
+depends=
+makedepends_host="gmp-dev mpfr-dev"
+makedepends="$makedepends_host"
+install=
+subpackages="$pkgname-dev $pkgname-doc"
+source="http://ftp.gnu.org/gnu/mpc/mpc-$pkgver.tar.gz"
+
+builddir="$srcdir"/mpc-$pkgver
+
+build() {
+ cd "$builddir"
+ # workaround for a bug in configure script
+ EGREP=egrep \
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --with-sysroot="${CBUILDROOT}" \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ --enable-shared
+ make
+}
+
+check() {
+ cd "$builddir"
+ make check
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+}
+
+md5sums="d6a1d5f8ddea3abd2cc3e98f58352d26 mpc-1.0.3.tar.gz"
+sha256sums="617decc6ea09889fb08ede330917a00b16809b8db88c29c31bfbb49cbf88ecc3 mpc-1.0.3.tar.gz"
+sha512sums="0028b76df130720c1fad7de937a0d041224806ce5ef76589f19c7b49d956071a683e2f20d154c192a231e69756b19e48208f2889b0c13950ceb7b3cfaf059a43 mpc-1.0.3.tar.gz"
diff --git a/system/mpfr3/APKBUILD b/system/mpfr3/APKBUILD
new file mode 100644
index 000000000..a74cccb4c
--- /dev/null
+++ b/system/mpfr3/APKBUILD
@@ -0,0 +1,45 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=mpfr3
+pkgver=3.1.5
+pkgrel=1
+pkgdesc="multiple-precision floating-point library"
+url="http://www.mpfr.org/"
+arch="all"
+license="GPL LGPL"
+depends=""
+makedepends_build="texinfo"
+makedepends_host="gmp-dev"
+makedepends="$makedepends_build $makedepends_host"
+source="http://www.mpfr.org/mpfr-$pkgver/mpfr-$pkgver.tar.xz"
+subpackages="$pkgname-doc mpfr-dev"
+builddir="$srcdir/mpfr-$pkgver"
+
+build() {
+ cd "$builddir"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --with-sysroot="$CBUILDROOT" \
+ --prefix=/usr \
+ --enable-shared
+ make
+}
+
+check() {
+ cd "$builddir"
+ make check
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+}
+
+dev() {
+ replaces=mpfr
+ default_dev
+}
+
+md5sums="c4ac246cf9795a4491e7766002cd528f mpfr-3.1.5.tar.xz"
+sha256sums="015fde82b3979fbe5f83501986d328331ba8ddf008c1ff3da3c238f49ca062bc mpfr-3.1.5.tar.xz"
+sha512sums="3643469b9099b31e41d6ec9158196cd1c30894030c8864ee5b1b1e91b488bccbf7c263c951b03fe9f4ae6f9d29279e157a7dfed0885467d875f107a3d964f032 mpfr-3.1.5.tar.xz"
diff --git a/system/ncurses/APKBUILD b/system/ncurses/APKBUILD
new file mode 100644
index 000000000..541010af1
--- /dev/null
+++ b/system/ncurses/APKBUILD
@@ -0,0 +1,106 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=ncurses
+pkgver=6.0_p20180121
+_ver=${pkgver%_p*}-${pkgver#*_p}
+pkgrel=1
+pkgdesc="Console display library"
+url="https://www.gnu.org/software/ncurses/"
+arch="all"
+options="!check" # "tests" are actual demo programs, not a test suite.
+license="MIT"
+depends=
+makedepends_build="ncurses"
+source="http://invisible-mirror.net/archives/ncurses/current/ncurses-$_ver.tgz"
+subpackages="$pkgname-static $pkgname-dev $pkgname-doc $pkgname-libs
+ $pkgname-terminfo-base:base:noarch $pkgname-terminfo:terminfo:noarch"
+
+builddir="$srcdir"/ncurses-$_ver
+
+# secfixes:
+# 6.0_p20171125-r0:
+# - CVE-2017-16879
+# 6.0_p20170701-r0:
+# - CVE-2017-10684
+
+build() {
+ cd "$builddir"
+
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --mandir=/usr/share/man \
+ --without-ada \
+ --without-tests \
+ --disable-termcap \
+ --disable-rpath-hack \
+ --disable-stripping \
+ --with-pkg-config-libdir=/usr/lib/pkgconfig \
+ --without-cxx-binding \
+ --with-terminfo-dirs="/etc/terminfo:/usr/share/terminfo" \
+ --enable-pc-files \
+ --with-shared \
+ --enable-widec
+ make
+}
+
+package() {
+ cd "$builddir"
+ make -j1 DESTDIR="$pkgdir" install
+
+ # Install basic terms in /etc/terminfo
+ for i in ansi console dumb linux rxvt screen sun vt52 vt100 vt102 \
+ vt200 vt220 xterm xterm-color xterm-xfree86; do
+ local termfile=$(find "$pkgdir"/usr/share/terminfo/ -name "$i" 2>/dev/null) || true
+ local basedir=$(basename $(dirname "$termfile"))
+
+ [ -z "$termfile" ] && continue
+
+ install -d "$pkgdir"/etc/terminfo/$basedir
+ mv ${termfile} "$pkgdir"/etc/terminfo/$basedir/
+ ln -s ../../../../etc/terminfo/$basedir/$i \
+ "$pkgdir"/usr/share/terminfo/$basedir/$i
+ done
+}
+
+dev() {
+ default_dev
+ # force link against *w.so
+ for lib in ncurses ncurses++ form panel menu; do
+ echo "INPUT(-l${lib}w)" > "$subpkgdir"/usr/lib/lib${lib}.so
+ ln -s ${lib}w.pc "$subpkgdir"/usr/lib/pkgconfig/${lib}.pc
+ done
+ # link curses -> ncurses
+ echo "INPUT(-lncursesw)" > "$subpkgdir"/usr/lib/libcursesw.so
+ ln -s libncurses.so "$subpkgdir"/usr/lib/libcurses.so
+}
+
+terminfo() {
+ pkgdesc="$pkgdesc (other terminfo files)"
+ depends="$pkgname-terminfo-base"
+ rm -rf $subpkgdir
+ mkdir -p $subpkgdir/usr/share
+ mv $pkgdir/usr/share/terminfo $subpkgdir/usr/share
+}
+
+libs() {
+ pkgdesc="Ncurses libraries"
+ depends="$pkgname-terminfo-base"
+ provides="ncurses-widec-libs=$pkgver-r$pkgrel"
+
+ mkdir -p "$subpkgdir"/usr/
+ mv "$pkgdir"/usr/lib "$subpkgdir"/usr/
+}
+
+base() {
+ pkgdesc="Descriptions of common terminals"
+ mkdir -p "$subpkgdir"/etc
+ mv "$pkgdir"/etc/terminfo "$subpkgdir"/etc/
+}
+
+static() {
+ pkgdesc="Static libraries for the ncurses library"
+ mkdir -p "$subpkgdir"/usr/lib
+ mv "$pkgdir"/usr/lib/*.a "$subpkgdir"/usr/lib/
+}
+
+sha512sums="f233a0630df01d96e01c5fabfb8a3d96860c9d8827c910019af410ee1b3190979a8f357ca292b083914c5ef41532f068d46685d4919b4c1d9258add5fb4dc343 ncurses-6.0-20180121.tgz"
diff --git a/system/net-tools/APKBUILD b/system/net-tools/APKBUILD
new file mode 100644
index 000000000..6e2e9fdf4
--- /dev/null
+++ b/system/net-tools/APKBUILD
@@ -0,0 +1,98 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=net-tools
+pkgver=1.60_git20140218
+_ver=${pkgver%_git*}
+pkgrel=2
+pkgdesc="Linux networking base tools"
+url="https://sourceforge.net/projects/net-tools/"
+arch="all"
+license="GPL-2.0"
+depends="mii-tool"
+depends_dev=""
+makedepends="$depends_dev bash linux-headers"
+options="!check"
+install=""
+subpackages="$pkgname-doc $pkgname-dbg mii-tool:mii_tool"
+source="https://downloads.sourceforge.net/project/net-tools/net-tools-$_ver.tar.bz2
+ git.patch
+ musl-fixes.patch
+ "
+
+builddir="$srcdir"/net-tools-$_ver
+prepare() {
+ local i
+ cd "$builddir"
+ for i in $source; do
+ case $i in
+ *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+ esac
+ done
+ cat > config.make <<EOF
+# I18N=0
+HAVE_AFUNIX=1
+HAVE_AFINET=1
+HAVE_AFINET6=1
+# HAVE_AFIPX=0
+# HAVE_AFATALK=0
+# HAVE_AFAX25=0
+HAVE_AFNETROM=1
+# HAVE_AFROSE=0
+# HAVE_AFX25=0
+# HAVE_AFECONET=0
+# HAVE_AFDECnet=0
+# HAVE_AFASH=0
+# HAVE_AFBLUETOOTH=0
+HAVE_HWETHER=1
+# HAVE_HWARC=0
+HAVE_HWSLIP=1
+HAVE_HWPPP=1
+HAVE_HWTUNNEL=1
+# HAVE_HWSTRIP=0
+# HAVE_HWTR=0
+# HAVE_HWAX25=0
+# HAVE_HWROSE=0
+HAVE_HWNETROM=1
+# HAVE_HWX25=0
+# HAVE_HWFR=0
+# HAVE_HWSIT=0
+# HAVE_HWFDDI=0
+# HAVE_HWHIPPI=0
+# HAVE_HWASH=0
+# HAVE_HWHDLCLAPB=0
+# HAVE_HWIRDA=0
+# HAVE_HWEC=0
+# HAVE_HWEUI64=0
+# HAVE_HWIB=0
+HAVE_FW_MASQUERADE=1
+HAVE_IP_TOOLS=1
+HAVE_MII=1
+EOF
+ sed -n -e 's/^\(HAVE.*\)=\(.*\)/#define \1 \2/p' config.make > config.h
+}
+
+build() {
+ cd "$builddir"
+ make || return 1
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install || return 1
+}
+
+mii_tool() {
+ pkgdesc="media-independent interface (MII) tool"
+ depends=
+ mkdir -p "$subpkgdir"/sbin
+ mv "$pkgdir"/sbin/mii-tool "$subpkgdir"/sbin/
+}
+
+md5sums="888774accab40217dde927e21979c165 net-tools-1.60.tar.bz2
+fe7b9dfa9f68adcf6ca23b9616decdb4 git.patch
+d57bcd8c1aa8b92b1128a4fea4f033df musl-fixes.patch"
+sha256sums="7ae4dd6d44d6715f18e10559ffd270511b6e55a8900ca54fbebafe0ae6cf7d7b net-tools-1.60.tar.bz2
+6e0acc8f88135f2e12b79777914a732c64789b1f629ea97c1860ed324b21724c git.patch
+538f0115911867423d27ee9b3fcc1177e339b474c131332eb7758f5c220928e1 musl-fixes.patch"
+sha512sums="8e1ae9bca726ad7d795a06c58388f9e11c1d617d94eebb9ed18bd11e5f34c6541e1ffe631706c407996db86e78df6e5cf1968a2d90b242b473596fda3b6d1eae net-tools-1.60.tar.bz2
+5edc92e8cf46da11898ac1999cfccb5b7ae3407f649c75c2da43c4264e1271b010eafbc84283e4c41219870bf89722e09666b25d28c84cb4ac60ceebee9adb2d git.patch
+08c9e7681e069a42f4da714faf0b93ad1c569cf942a94a1b41103e86850235b507c0291e2f3839c84dd02aba0b1a16d79580fbfc55dd2af8d09b0ff71d714e9f musl-fixes.patch"
diff --git a/system/net-tools/git.patch b/system/net-tools/git.patch
new file mode 100644
index 000000000..eb35885e8
--- /dev/null
+++ b/system/net-tools/git.patch
@@ -0,0 +1,26170 @@
+diff --git a/.cvsignore b/.cvsignore
+index 1d4a063..ff65062 100644
+--- a/.cvsignore
++++ b/.cvsignore
+@@ -1,2 +1,3 @@
+ arp hostname ifconfig ipmaddr iptunnel netstat plipconfig rarp route slattach
+ version.h config.make config.status config.h nameif mii-tool
++.git
+diff --git a/.gitignore b/.gitignore
+new file mode 100644
+index 0000000..9184162
+--- /dev/null
++++ b/.gitignore
+@@ -0,0 +1,36 @@
++*.o
++
++*.diff
++*.patch
++*.rej
++*.orig
++
++.gdb_history
++.gdbinit
++core
++*.gdb
++
++/config.h
++/config.make
++/config.status
++
++/net-tools-*.tar*
++
++/lib/libnet-tools.a
++
++/po/*.mo
++
++/version.h
++
++/arp
++/hostname
++/ifconfig
++/ipmaddr
++/iptunnel
++/mii-tool
++/nameif
++/netstat
++/plipconfig
++/rarp
++/route
++/slattach
+diff --git a/COPYING b/COPYING
+index a43ea21..d159169 100644
+--- a/COPYING
++++ b/COPYING
+@@ -1,12 +1,12 @@
+- GNU GENERAL PUBLIC LICENSE
+- Version 2, June 1991
++ GNU GENERAL PUBLIC LICENSE
++ Version 2, June 1991
+
+- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+- 675 Mass Ave, Cambridge, MA 02139, USA
++ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
++ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+- Preamble
++ Preamble
+
+ The licenses for most software are designed to take away your
+ freedom to share and change it. By contrast, the GNU General Public
+@@ -15,7 +15,7 @@ software--to make sure the software is free for all its users. This
+ General Public License applies to most of the Free Software
+ Foundation's software and to any other program whose authors commit to
+ using it. (Some other Free Software Foundation software is covered by
+-the GNU Library General Public License instead.) You can apply it to
++the GNU Lesser General Public License instead.) You can apply it to
+ your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+@@ -55,8 +55,8 @@ patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+ modification follow.
+-
+- GNU GENERAL PUBLIC LICENSE
++
++ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+@@ -110,7 +110,7 @@ above, provided that you also meet all of these conditions:
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+-
++
+ These requirements apply to the modified work as a whole. If
+ identifiable sections of that work are not derived from the Program,
+ and can be reasonably considered independent and separate works in
+@@ -168,7 +168,7 @@ access to copy from a designated place, then offering equivalent
+ access to copy the source code from the same place counts as
+ distribution of the source code, even though third parties are not
+ compelled to copy the source along with the object code.
+-
++
+ 4. You may not copy, modify, sublicense, or distribute the Program
+ except as expressly provided under this License. Any attempt
+ otherwise to copy, modify, sublicense or distribute the Program is
+@@ -225,7 +225,7 @@ impose that choice.
+
+ This section is intended to make thoroughly clear what is believed to
+ be a consequence of the rest of this License.
+-
++
+ 8. If the distribution and/or use of the Program is restricted in
+ certain countries either by patents or by copyrighted interfaces, the
+ original copyright holder who places the Program under this License
+@@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals
+ of preserving the free status of all derivatives of our free software and
+ of promoting the sharing and reuse of software generally.
+
+- NO WARRANTY
++ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+ FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+@@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGES.
+
+- END OF TERMS AND CONDITIONS
+-
+- Appendix: How to Apply These Terms to Your New Programs
++ END OF TERMS AND CONDITIONS
++
++ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+ possible use to the public, the best way to achieve this is to make it
+@@ -291,7 +291,7 @@ convey the exclusion of warranty; and each file should have at least
+ the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+- Copyright (C) 19yy <name of author>
++ Copyright (C) <year> <name of author>
+
+ 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
+@@ -303,16 +303,16 @@ the "copyright" line and a pointer to where the full notice is found.
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+- You should have received a copy of the GNU General Public License
+- along with this program; if not, write to the Free Software
+- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
++ You should have received a copy of the GNU General Public License along
++ with this program; if not, write to the Free Software Foundation, Inc.,
++ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Also add information on how to contact you by electronic and paper mail.
+
+ If the program is interactive, make it output a short notice like this
+ when it starts in an interactive mode:
+
+- Gnomovision version 69, Copyright (C) 19yy name of author
++ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+@@ -335,5 +335,5 @@ necessary. Here is a sample; alter the names:
+ This General Public License does not permit incorporating your program into
+ proprietary programs. If your program is a subroutine library, you may
+ consider it more useful to permit linking proprietary applications with the
+-library. If this is what you want to do, use the GNU Library General
++library. If this is what you want to do, use the GNU Lesser General
+ Public License instead of this License.
+diff --git a/INSTALLING b/INSTALLING
+index c49f21f..f6180c8 100644
+--- a/INSTALLING
++++ b/INSTALLING
+@@ -27,7 +27,7 @@ of the other options should work as well.
+
+
+ COMPILE
+--------
++-------
+ To compile simply use "make".
+
+ There should be no warnings or errors.
+diff --git a/Makefile b/Makefile
+index 8fcc55c..edf80ec 100644
+--- a/Makefile
++++ b/Makefile
+@@ -5,14 +5,10 @@
+ # NET-3 Networking Distribution for the LINUX operating
+ # system.
+ #
+-# Version: 2001-02-13
+-#
+ # Author: Bernd Eckenfels <net-tools@lina.inka.de>
+ # Copyright 1995-1996 Bernd Eckenfels, Germany
+ #
+-# URLs: ftp://ftp.inka.de/pub/comp/Linux/networking/NetTools/
+-# ftp://ftp.linux.org.uk/pub/linux/Networking/PROGRAMS/NetTools/
+-# http://www.inka.de/sites/lina/linux/NetTools/index_en.html
++# URLs: http://net-tools.sourceforge.net/
+ #
+ # Based on: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+ # Copyright 1988-1993 MicroWalt Corporation
+@@ -22,55 +18,16 @@
+ # Alan Cox <A.Cox@swansea.ac.uk>
+ # Copyright 1993-1994 Swansea University Computer Society
+ #
+-# Be careful!
++# Be careful!
+ # This Makefile doesn't describe complete dependencies for all include files.
+-# If you change include files you might need to do make clean.
+-#
+-# {1.20} Bernd Eckenfels: Even more modifications for the new
+-# package layout
+-# {1.21} Bernd Eckenfels: Check if config.in is newer than
+-# config.status
+-# {1.22} Bernd Eckenfels: Include ypdomainname and nisdomainame
+-#
+-# 1.3.50-BETA6 private Release
+-#
+-#960125 {1.23} Bernd Eckenfels: Peter Tobias' rewrite for
+-# makefile-based installation
+-# 1.3.50-BETA6a private Release
+-#
+-#960201 {1.24} Bernd Eckenfels: net-features.h added
+-#
+-#960201 1.3.50-BETA6b private Release
+-#
+-#960203 1.3.50-BETA6c private Release
+-#
+-#960204 1.3.50-BETA6d private Release
+-#
+-#960204 {1.25} Bernd Eckenfels: DISTRIBUTION added
+-#
+-#960205 1.3.50-BETA6e private Release
+-#
+-#960206 {1.26} Bernd Eckenfels: afrt.o removed (cleaner solution)
+-#
+-#960215 1.3.50-BETA6f Release
+-#
+-#960216 {1.30} Bernd Eckenfels: net-lib support
+-#960322 {1.31} Bernd Eckenfels: moveable netlib, TOPDIR
+-#960424 {1.32} Bernd Eckenfels: included the URLs in the Comment
+-#
+-#960514 1.31-alpha release
+-#
+-#960518 {1.33} Bernd Eckenfels: -I/usr/src/linux/include comment added
+-#
+-# This program is free software; you can redistribute it
+-# and/or modify it under the terms of the GNU General
+-# Public License as published by the Free Software
+-# Foundation; either version 2 of the License, or (at
+-# your option) any later version.
++# If you change include files you might need to do make clean.
+ #
+
+-# set the base of the Installation
++# set the base of the Installation
+ # BASEDIR = /mnt
++BASEDIR ?= $(DESTDIR)
++BINDIR ?= /bin
++SBINDIR ?= /sbin
+
+ # path to the net-lib support library. Default: lib
+ NET_LIB_PATH = lib
+@@ -88,20 +45,26 @@ endif
+
+ # Compiler and Linker Options
+ # You may need to uncomment and edit these if you are using libc5 and IPv6.
+-COPTS = -D_GNU_SOURCE -O2 -Wall -g # -I/usr/inet6/include
+-ifeq ($(origin LOPTS), undefined)
+-LOPTS =
+-endif
++CFLAGS ?= -O2 -g
++CFLAGS += -Wall
++CFLAGS += -fno-strict-aliasing # code needs a lot of work before strict aliasing is safe
++CPPFLAGS += -D_GNU_SOURCE
+ RESLIB = # -L/usr/inet6/lib -linet6
+
+ ifeq ($(HAVE_AFDECnet),1)
+ DNLIB = -ldnet
+ endif
+
++ifeq ($(origin CC), undefined)
++CC = gcc
++endif
++LD = $(CC)
++PKG_CONFIG ?= pkg-config
++
+ # -------- end of user definitions --------
+
+-MAINTAINER = Philip.Blundell@pobox.com
+-RELEASE = 1.60
++MAINTAINER = net-tools-devel@lists.sourceforge.net
++RELEASE = 2.10-alpha
+
+ .EXPORT_ALL_VARIABLES:
+
+@@ -113,22 +76,22 @@ endif
+
+ NET_LIB = $(NET_LIB_PATH)/lib$(NET_LIB_NAME).a
+
+-CFLAGS = $(COPTS) -I. -idirafter ./include/ -I$(NET_LIB_PATH)
+-LDFLAGS = $(LOPTS) -L$(NET_LIB_PATH)
++ifeq ($(HAVE_SELINUX),1)
++SE_PC_CFLAGS := $(shell $(PKG_CONFIG) --cflags libselinux)
++SE_PC_LIBS := $(shell $(PKG_CONFIG) --libs libselinux || echo -lselinux)
++SELIB = $(SE_PC_LIBS)
++CPPFLAGS += $(SE_PC_CFLAGS)
++endif
+
+-SUBDIRS = man/ $(NET_LIB_PATH)/
++CPPFLAGS += -I. -I$(TOPDIR)/include -I$(NET_LIB_PATH)
++LDFLAGS += -L$(NET_LIB_PATH)
+
+-ifeq ($(origin CC), undefined)
+-CC = gcc
+-endif
+-LD = $(CC)
++SUBDIRS = man/ $(NET_LIB_PATH)/
+
+ NLIB = -l$(NET_LIB_NAME)
+
+-MDEFINES = COPTS='$(COPTS)' LOPTS='$(LOPTS)' TOPDIR='$(TOPDIR)'
+-
+-%.o: %.c config.h version.h intl.h net-features.h $<
+- $(CC) $(CFLAGS) -c $<
++%.o: %.c config.h version.h intl.h lib/net-features.h $<
++ $(CC) $(CFLAGS) $(CPPFLAGS) -c $<
+
+ all: config.h version.h subdirs $(PROGS)
+
+@@ -154,12 +117,21 @@ clobber: clean
+ @for i in $(SUBDIRS); do (cd $$i && $(MAKE) clobber) ; done
+
+
+-dist: clobber
+- @echo Creating net-tools-$(RELEASE) in ..
+- @tar -cvz -f ../net-tools-$(RELEASE).tar.gz -C .. net-tools
++dist:
++ rm -rf net-tools-$(RELEASE)
++ git archive --prefix=net-tools-$(RELEASE)/ HEAD | tar xf -
++ $(MAKE) -C net-tools-$(RELEASE)/po $@
++ tar cf - net-tools-$(RELEASE)/ | xz > net-tools-$(RELEASE).tar.xz
++ rm -rf net-tools-$(RELEASE)
+
++distcheck: dist
++ tar xf net-tools-$(RELEASE).tar.xz
++ yes "" | $(MAKE) -C net-tools-$(RELEASE) config
++ $(MAKE) -C net-tools-$(RELEASE)
++ rm -rf net-tools-$(RELEASE)
++ @printf "\nThe tarball is ready to go:\n%s\n" "`du -b net-tools-$(RELEASE).tar.xz`"
+
+-config.h: config.in Makefile
++config.h: config.in Makefile
+ @echo "Configuring the Linux net-tools (NET-3 Base Utilities)..." ; echo
+ @if [ config.status -nt config.in ]; \
+ then ./configure.sh config.status; \
+@@ -175,85 +147,91 @@ $(NET_LIB): config.h version.h intl.h libdir
+
+ i18n.h: i18ndir
+
+-libdir:
+- @$(MAKE) -C $(NET_LIB_PATH) $(MDEFINES)
++libdir: version.h
++ @$(MAKE) -C $(NET_LIB_PATH)
+
+ i18ndir:
+ @$(MAKE) -C po
+
+-subdirs:
+- @for i in $(SUBDIRS); do $(MAKE) -C $$i $(MDEFINES) ; done
++# use libdir target for lib/ to avoid parallel build issues
++subdirs: libdir
++ @for i in $(SUBDIRS:$(NET_LIB_PATH)/=); do $(MAKE) -C $$i || exit $$? ; done
+
+ ifconfig: $(NET_LIB) ifconfig.o
+- $(CC) $(LDFLAGS) -o ifconfig ifconfig.o $(NLIB) $(RESLIB)
+-
+-nameif: nameif.o
+- $(CC) $(LDFLAGS) -o nameif nameif.o
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ ifconfig.o $(NLIB) $(RESLIB)
++
++nameif: $(NET_LIB) nameif.o
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ nameif.o $(NLIB) $(RESLIB)
+
+ hostname: hostname.o
+- $(CC) $(LDFLAGS) -o hostname hostname.o $(DNLIB)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ hostname.o $(DNLIB)
+
+ route: $(NET_LIB) route.o
+- $(CC) $(LDFLAGS) -o route route.o $(NLIB) $(RESLIB)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ route.o $(NLIB) $(RESLIB)
+
+ arp: $(NET_LIB) arp.o
+- $(CC) $(LDFLAGS) -o arp arp.o $(NLIB) $(RESLIB)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ arp.o $(NLIB) $(RESLIB)
+
+ rarp: $(NET_LIB) rarp.o
+- $(CC) $(LDFLAGS) -o rarp rarp.o $(NLIB)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ rarp.o $(NLIB)
+
+ slattach: $(NET_LIB) slattach.o
+- $(CC) $(LDFLAGS) -o slattach slattach.o $(NLIB)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ slattach.o $(NLIB)
+
+ plipconfig: $(NET_LIB) plipconfig.o
+- $(CC) $(LDFLAGS) -o plipconfig plipconfig.o $(NLIB)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ plipconfig.o $(NLIB)
+
+ netstat: $(NET_LIB) netstat.o statistics.o
+- $(CC) $(LDFLAGS) -o netstat netstat.o statistics.o $(NLIB) $(RESLIB)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ netstat.o statistics.o $(NLIB) $(RESLIB) $(SELIB)
+
+ iptunnel: $(NET_LIB) iptunnel.o
+- $(CC) $(LDFLAGS) -o iptunnel iptunnel.o $(NLIB) $(RESLIB)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ iptunnel.o $(NLIB) $(RESLIB)
+
+ ipmaddr: $(NET_LIB) ipmaddr.o
+- $(CC) $(LDFLAGS) -o ipmaddr ipmaddr.o $(NLIB) $(RESLIB)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ ipmaddr.o $(NLIB) $(RESLIB)
+
+-mii-tool: mii-tool.o
+- $(CC) $(LDFLAGS) -o mii-tool mii-tool.o
++mii-tool: $(NET_LIB) mii-tool.o
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ mii-tool.o $(NLIB) $(RESLIB)
+
+ installbin:
+- install -m 0755 -d ${BASEDIR}/sbin
+- install -m 0755 -d ${BASEDIR}/bin
+- install -m 0755 arp ${BASEDIR}/sbin
+- install -m 0755 hostname ${BASEDIR}/bin
+- install -m 0755 ifconfig ${BASEDIR}/sbin
+- install -m 0755 nameif ${BASEDIR}/sbin
+- install -m 0755 netstat ${BASEDIR}/bin
+- install -m 0755 plipconfig $(BASEDIR)/sbin
+- install -m 0755 rarp ${BASEDIR}/sbin
+- install -m 0755 route ${BASEDIR}/sbin
+- install -m 0755 slattach $(BASEDIR)/sbin
++ @echo
++ @echo "######################################################"
++ @echo "Notice: ifconfig and route are now installed into /bin"
++ @echo "######################################################"
++ @echo
++ install -m 0755 -d ${BASEDIR}${SBINDIR}
++ install -m 0755 -d ${BASEDIR}${BINDIR}
++ install -m 0755 arp ${BASEDIR}${SBINDIR}
++ install -m 0755 hostname ${BASEDIR}${BINDIR}
++ install -m 0755 ifconfig ${BASEDIR}${BINDIR}
++ install -m 0755 nameif ${BASEDIR}${SBINDIR}
++ install -m 0755 netstat ${BASEDIR}${BINDIR}
++ install -m 0755 plipconfig $(BASEDIR)${SBINDIR}
++ install -m 0755 rarp ${BASEDIR}${SBINDIR}
++ install -m 0755 route ${BASEDIR}${BINDIR}
++ install -m 0755 slattach $(BASEDIR)${SBINDIR}
+ ifeq ($(HAVE_IP_TOOLS),1)
+- install -m 0755 ipmaddr $(BASEDIR)/sbin
+- install -m 0755 iptunnel $(BASEDIR)/sbin
++ install -m 0755 ipmaddr $(BASEDIR)${SBINDIR}
++ install -m 0755 iptunnel $(BASEDIR)${SBINDIR}
+ endif
+ ifeq ($(HAVE_MII),1)
+- install -m 0755 mii-tool $(BASEDIR)/sbin
++ install -m 0755 mii-tool $(BASEDIR)${SBINDIR}
+ endif
+- ln -fs hostname $(BASEDIR)/bin/dnsdomainname
+- ln -fs hostname $(BASEDIR)/bin/ypdomainname
+- ln -fs hostname $(BASEDIR)/bin/nisdomainname
+- ln -fs hostname $(BASEDIR)/bin/domainname
++ ln -fs hostname $(BASEDIR)${BINDIR}/dnsdomainname
++ ln -fs hostname $(BASEDIR)${BINDIR}/ypdomainname
++ ln -fs hostname $(BASEDIR)${BINDIR}/nisdomainname
++ ln -fs hostname $(BASEDIR)${BINDIR}/domainname
+ ifeq ($(HAVE_AFDECnet),1)
+- ln -fs hostname $(BASEDIR)/bin/nodename
++ ln -fs hostname $(BASEDIR)${BINDIR}/nodename
+ endif
+
+ savebin:
+- @for i in ${BASEDIR}/sbin/arp ${BASEDIR}/sbin/ifconfig \
+- ${BASEDIR}/bin/netstat \
+- ${BASEDIR}/sbin/rarp ${BASEDIR}/sbin/route \
+- ${BASEDIR}/bin/hostname ${BASEDIR}/bin/ypdomainname \
+- ${BASEDIR}/bin/dnsdomainname ${BASEDIR}/bin/nisdomainname \
+- ${BASEDIR}/bin/domainname ; do \
++ @for i in ${BASEDIR}${SBINDIR}/arp ${BASEDIR}${SBINDIR}/ifconfig \
++ ${BASEDIR}${BINDIR}/netstat \
++ ${BASEDIR}${SBINDIR}/rarp ${BASEDIR}${SBINDIR}/route \
++ ${BASEDIR}${BINDIR}/hostname ${BASEDIR}${BINDIR}/ypdomainname \
++ ${BASEDIR}${BINDIR}/dnsdomainname ${BASEDIR}${BINDIR}/nisdomainname \
++ ${BASEDIR}${BINDIR}/domainname ; do \
+ [ -f $$i ] && cp -f $$i $$i.old ; done ; echo Saved.
+
+ installdata:
+diff --git a/README b/README
+index 4e35868..aa6cc9a 100644
+--- a/README
++++ b/README
+@@ -10,29 +10,35 @@ This package includes the important tools for controlling the network
+ subsystem of the Linux kernel. This includes arp, hostname, ifconfig,
+ netstat, rarp and route. Additionally, this package contains
+ utilities relating to particular network hardware types (plipconfig,
+-slattach) and advanced aspects of IP configuration (iptunnel,
++slattach, mii-tool) and advanced aspects of IP configuration (iptunnel,
+ ipmaddr).
+
+ Please include the output of "program --version" when reporting bugs.
+
+
+ Contents:
+-
++
+ README This file.
+
+ README.ipv6 Notes for people hacking IPv6.
+
+ INSTALLING Installation instructions.
+
+- COPYING Your free copy of the GNU Public License.
++ COPYING Your free copy of the GNU General Public License.
+
+ TODO Some things that need to be done.
+
++The Homepage (including Git repository, release downloads, bug tracker and
++mailing list) is hosted by SourceForge.net. Please consider to
++join the project if you want to contribute:
++
++ https://sourceforge.net/projects/net-tools/
++
+
+ Notes
+ -----
+
+-This is net-tools 1.60.
++This is net-tools 1.6x.
+
+ You need kernel 2.0 or later to use these programs. These programs
+ should compile cleanly with both glibc (version 2.0 or 2.1) and libc5,
+@@ -59,6 +65,8 @@ all common environments but some of the more esoteric hardware and
+ protocol families may be more touchy. Feel free to send patches if
+ you have problems.
+
++For this release, the localized man pages are installed with UTF-8 encoding.
++
+ Phil Blundell
+ philb@gnu.org
+
+diff --git a/RPM/net-tools.spec b/RPM/net-tools.spec
+index 86b45db..b12f785 100644
+--- a/RPM/net-tools.spec
++++ b/RPM/net-tools.spec
+@@ -34,7 +34,7 @@ make BASEDIR=$RPM_BUILD_ROOT install
+ strip arp ifconfig rarp route slattach plipconfig ipmaddr iptunnel
+ cd ../bin
+ strip hostname netstat
+-)
++)
+
+ %clean
+ rm -rf $RPM_BUILD_ROOT
+@@ -92,7 +92,7 @@ rm -rf $RPM_BUILD_ROOT
+ * Fri Feb 27 1998 Jason Spangler <jasons@usemail.com>
+ - changed to net-tools 1.432
+ - removed old glibc 2.1 patch
+-
++
+ * Wed Oct 22 1997 Erik Troan <ewt@redhat.com>
+ - added extra patches for glibc 2.1
+
+diff --git a/TODO b/TODO
+index ec6aae8..c8a10dc 100644
+--- a/TODO
++++ b/TODO
+@@ -23,7 +23,7 @@ TODO for net-tools
+ [ ] supply some informations about new features to HOWTOs
+ [ ] Config file only works with bash not ash.
+ [ ] Token ring is almost totally untested.
+-[ ] additional tools for IPX, AX.25 etc be bundled [ipxripd004, ipx_* tools
++[ ] additional tools for IPX, AX.25 etc be bundled [ipxripd004, ipx_* tools
+ from caldera, axattach] into existing bins
+ [ ] "SIOCAX25OPTRT" [Joerg (DL1BKE)]. 1.3.75
+ [ ] dummy NOARP?! (2. default route for preveting hostunreachables on linedrop)
+diff --git a/arp.c b/arp.c
+index 509a804..5db71a7 100644
+--- a/arp.c
++++ b/arp.c
+@@ -8,7 +8,7 @@
+ * NET-3 Networking Distribution for the LINUX operating
+ * system.
+ *
+- * Version: $Id: arp.c,v 1.20 2001/04/08 17:05:05 pb Exp $
++ * Version: $Id: arp.c,v 1.27 2009/09/06 22:50:11 vapier Exp $
+ *
+ * Maintainer: Bernd 'eckes' Eckenfels, <net-tools@lina.inka.de>
+ *
+@@ -20,14 +20,14 @@
+ * Andrew Tridgell : proxy arp netmasks
+ * Bernd Eckenfels : -n option
+ * Bernd Eckenfels : Use only /proc for display
+- * {1.60} Bernd Eckenfels : new arpcode (-i) for 1.3.42 but works
++ * {1.60} Bernd Eckenfels : new arpcode (-i) for 1.3.42 but works
+ * with 1.2.x, too
+ * {1.61} Bernd Eckenfels : more verbose messages
+ * {1.62} Bernd Eckenfels : check -t for hw adresses and try to
+ * explain EINVAL (jeff)
+ *970125 {1.63} Bernd Eckenfels : -a print hardwarename instead of tiltle
+ *970201 {1.64} Bernd Eckenfels : net-features.h support
+- *970203 {1.65} Bernd Eckenfels : "#define" in "#if",
++ *970203 {1.65} Bernd Eckenfels : "#define" in "#if",
+ * -H|-A additional to -t|-p
+ *970214 {1.66} Bernd Eckenfels : Fix optarg required for -H and -A
+ *970412 {1.67} Bernd Eckenfels : device=""; is default
+@@ -35,7 +35,7 @@
+ *970517 {1.69} Bernd Eckenfels : usage() fixed
+ *970622 {1.70} Bernd Eckenfels : arp -d priv
+ *970106 {1.80} Bernd Eckenfels : new syntax without -D and with "dev <If>",
+- * ATF_MAGIC, ATF_DONTPUB support.
++ * ATF_MAGIC, ATF_DONTPUB support.
+ * Typo fix (Debian Bug#5728 Giuliano Procida)
+ *970803 {1.81} Bernd Eckenfels : removed junk comment line 1
+ *970925 {1.82} Bernd Eckenfels : include fix for libc6
+@@ -80,7 +80,7 @@
+ #define FEATURE_ARP
+ #include "lib/net-features.h"
+
+-char *Release = RELEASE, *Version = "arp 1.88 (2001-04-04)";
++static char *Release = RELEASE;
+
+ int opt_n = 0; /* do not resolve addresses */
+ int opt_N = 0; /* use symbolic names */
+@@ -100,9 +100,10 @@ static int arp_del(char **args)
+ {
+ char host[128];
+ struct arpreq req;
+- struct sockaddr sa;
++ struct sockaddr_storage ss;
++ struct sockaddr *sa;
+ int flags = 0;
+- int err;
++ int deleted = 0;
+
+ memset((char *) &req, 0, sizeof(req));
+
+@@ -112,12 +113,13 @@ static int arp_del(char **args)
+ return (-1);
+ }
+ safe_strncpy(host, *args, (sizeof host));
+- if (ap->input(0, host, &sa) < 0) {
++ sa = (struct sockaddr *)&ss;
++ if (ap->input(0, host, sa) < 0) {
+ ap->herror(host);
+ return (-1);
+ }
+ /* If a host has more than one address, use the correct one! */
+- memcpy((char *) &req.arp_pa, (char *) &sa, sizeof(struct sockaddr));
++ memcpy((char *) &req.arp_pa, (char *) sa, sizeof(struct sockaddr));
+
+ if (hw_set)
+ req.arp_ha.sa_family = hw->type;
+@@ -148,7 +150,7 @@ static int arp_del(char **args)
+ continue;
+ }
+ if (!strcmp(*args, "dontpub")) {
+-#ifdef HAVE_ATF_DONTPUB
++#ifdef ATF_DONTPUB
+ req.arp_flags |= ATF_DONTPUB;
+ #else
+ ENOSUPP("arp", "ATF_DONTPUB");
+@@ -157,7 +159,7 @@ static int arp_del(char **args)
+ continue;
+ }
+ if (!strcmp(*args, "auto")) {
+-#ifdef HAVE_ATF_MAGIC
++#ifdef ATF_MAGIC
+ req.arp_flags |= ATF_MAGIC;
+ #else
+ ENOSUPP("arp", "ATF_MAGIC");
+@@ -176,12 +178,12 @@ static int arp_del(char **args)
+ if (*++args == NULL)
+ usage();
+ if (strcmp(*args, "255.255.255.255") != 0) {
+- strcpy(host, *args);
+- if (ap->input(0, host, &sa) < 0) {
++ safe_strncpy(host, *args, (sizeof host));
++ if (ap->input(0, host, sa) < 0) {
+ ap->herror(host);
+ return (-1);
+ }
+- memcpy((char *) &req.arp_netmask, (char *) &sa,
++ memcpy((char *) &req.arp_netmask, (char *) sa,
+ sizeof(struct sockaddr));
+ req.arp_flags |= ATF_NETMASK;
+ }
+@@ -190,35 +192,41 @@ static int arp_del(char **args)
+ }
+ usage();
+ }
++
++ // if neighter priv nor pub is given, work on both
+ if (flags == 0)
+ flags = 3;
+
+- strcpy(req.arp_dev, device);
++ safe_strncpy(req.arp_dev, device, sizeof(req.arp_dev));
+
+- err = -1;
++ /* unfortuatelly the kernel interface does not allow us to
++ delete private entries anlone, so we need this hack
++ to avoid "not found" errors if we try both. */
++ deleted = 0;
+
+ /* Call the kernel. */
+ if (flags & 2) {
+ if (opt_v)
+- fprintf(stderr, "arp: SIOCDARP(nopub)\n");
+- if ((err = ioctl(sockfd, SIOCDARP, &req) < 0)) {
+- if (errno == ENXIO) {
++ fprintf(stderr, "arp: SIOCDARP(dontpub)\n");
++ if (ioctl(sockfd, SIOCDARP, &req) < 0) {
++ if ((errno == ENXIO) || (errno == ENOENT)) {
+ if (flags & 1)
+- goto nopub;
++ goto dontpub;
+ printf(_("No ARP entry for %s\n"), host);
+ return (-1);
+ }
+- perror("SIOCDARP(priv)");
++ perror("SIOCDARP(dontpub)");
+ return (-1);
+- }
++ } else
++ deleted = 1;
+ }
+- if ((flags & 1) && (err)) {
+- nopub:
++ if (!deleted && (flags & 1)) {
++ dontpub:
+ req.arp_flags |= ATF_PUBL;
+ if (opt_v)
+ fprintf(stderr, "arp: SIOCDARP(pub)\n");
+ if (ioctl(sockfd, SIOCDARP, &req) < 0) {
+- if (errno == ENXIO) {
++ if ((errno == ENXIO) || (errno == ENOENT)) {
+ printf(_("No ARP entry for %s\n"), host);
+ return (-1);
+ }
+@@ -235,7 +243,7 @@ static int arp_getdevhw(char *ifname, struct sockaddr *sa, struct hwtype *hw)
+ struct ifreq ifr;
+ struct hwtype *xhw;
+
+- strcpy(ifr.ifr_name, ifname);
++ safe_strncpy(ifr.ifr_name, ifname, IFNAMSIZ);
+ if (ioctl(sockfd, SIOCGIFHWADDR, &ifr) < 0) {
+ fprintf(stderr, _("arp: cant get HW-Address for `%s': %s.\n"), ifname, strerror(errno));
+ return (-1);
+@@ -260,7 +268,8 @@ static int arp_set(char **args)
+ {
+ char host[128];
+ struct arpreq req;
+- struct sockaddr sa;
++ struct sockaddr_storage ss;
++ struct sockaddr *sa;
+ int flags;
+
+ memset((char *) &req, 0, sizeof(req));
+@@ -271,12 +280,13 @@ static int arp_set(char **args)
+ return (-1);
+ }
+ safe_strncpy(host, *args++, (sizeof host));
+- if (ap->input(0, host, &sa) < 0) {
++ sa = (struct sockaddr *)&ss;
++ if (ap->input(0, host, sa) < 0) {
+ ap->herror(host);
+ return (-1);
+ }
+ /* If a host has more than one address, use the correct one! */
+- memcpy((char *) &req.arp_pa, (char *) &sa, sizeof(struct sockaddr));
++ memcpy((char *) &req.arp_pa, (char *) sa, sizeof(struct sockaddr));
+
+ /* Fetch the hardware address. */
+ if (*args == NULL) {
+@@ -317,7 +327,7 @@ static int arp_set(char **args)
+ continue;
+ }
+ if (!strcmp(*args, "dontpub")) {
+-#ifdef HAVE_ATF_DONTPUB
++#ifdef ATF_DONTPUB
+ flags |= ATF_DONTPUB;
+ #else
+ ENOSUPP("arp", "ATF_DONTPUB");
+@@ -326,7 +336,7 @@ static int arp_set(char **args)
+ continue;
+ }
+ if (!strcmp(*args, "auto")) {
+-#ifdef HAVE_ATF_MAGIC
++#ifdef ATF_MAGIC
+ flags |= ATF_MAGIC;
+ #else
+ ENOSUPP("arp", "ATF_MAGIC");
+@@ -345,12 +355,12 @@ static int arp_set(char **args)
+ if (*++args == NULL)
+ usage();
+ if (strcmp(*args, "255.255.255.255") != 0) {
+- strcpy(host, *args);
+- if (ap->input(0, host, &sa) < 0) {
++ safe_strncpy(host, *args, (sizeof host));
++ if (ap->input(0, host, sa) < 0) {
+ ap->herror(host);
+ return (-1);
+ }
+- memcpy((char *) &req.arp_netmask, (char *) &sa,
++ memcpy((char *) &req.arp_netmask, (char *) sa,
+ sizeof(struct sockaddr));
+ flags |= ATF_NETMASK;
+ }
+@@ -363,7 +373,7 @@ static int arp_set(char **args)
+ /* Fill in the remainder of the request. */
+ req.arp_flags = flags;
+
+- strcpy(req.arp_dev, device);
++ safe_strncpy(req.arp_dev, device, sizeof(req.arp_dev));
+
+ /* Call the kernel. */
+ if (opt_v)
+@@ -424,7 +434,7 @@ static int arp_file(char *name)
+
+
+ /* Print the contents of an ARP request block. */
+-static void arp_disp_2(char *name, int type, int arp_flags, char *hwa, char *mask, char *dev)
++static void arp_disp_2(const char *name, int type, int arp_flags, const char *hwa, const char *mask, const char *dev)
+ {
+ static int title = 0;
+ struct hwtype *xhw;
+@@ -445,11 +455,11 @@ static void arp_disp_2(char *name, int type, int arp_flags, char *hwa, char *mas
+ strcat(flags, "M");
+ if (arp_flags & ATF_PUBL)
+ strcat(flags, "P");
+-#ifdef HAVE_ATF_MAGIC
++#ifdef ATF_MAGIC
+ if (arp_flags & ATF_MAGIC)
+ strcat(flags, "A");
+ #endif
+-#ifdef HAVE_ATF_DONTPUB
++#ifdef ATF_DONTPUB
+ if (arp_flags & ATF_DONTPUB)
+ strcat(flags, "!");
+ #endif
+@@ -463,7 +473,7 @@ static void arp_disp_2(char *name, int type, int arp_flags, char *hwa, char *mas
+
+ if (!(arp_flags & ATF_COM)) {
+ if (arp_flags & ATF_PUBL)
+- printf("%-8.8s%-20.20s", "*", "*");
++ printf("%-8.8s%-20.20s", "*", _("<from_interface>"));
+ else
+ printf("%-8.8s%-20.20s", "", _("(incomplete)"));
+ } else {
+@@ -474,7 +484,7 @@ static void arp_disp_2(char *name, int type, int arp_flags, char *hwa, char *mas
+ }
+
+ /* Print the contents of an ARP request block. */
+-static void arp_disp(char *name, char *ip, int type, int arp_flags, char *hwa, char *mask, char *dev)
++static void arp_disp(const char *name, const char *ip, int type, int arp_flags, const char *hwa, const char *mask, const char *dev)
+ {
+ struct hwtype *xhw;
+
+@@ -486,7 +496,7 @@ static void arp_disp(char *name, char *ip, int type, int arp_flags, char *hwa, c
+
+ if (!(arp_flags & ATF_COM)) {
+ if (arp_flags & ATF_PUBL)
+- printf("* ");
++ printf("<from_interface> ");
+ else
+ printf(_("<incomplete> "));
+ } else {
+@@ -499,12 +509,12 @@ static void arp_disp(char *name, char *ip, int type, int arp_flags, char *hwa, c
+ if (arp_flags & ATF_PERM)
+ printf("PERM ");
+ if (arp_flags & ATF_PUBL)
+- printf("PUP ");
+-#ifdef HAVE_ATF_MAGIC
++ printf("PUB ");
++#ifdef ATF_MAGIC
+ if (arp_flags & ATF_MAGIC)
+ printf("AUTO ");
+ #endif
+-#ifdef HAVE_ATF_DONTPUB
++#ifdef ATF_DONTPUB
+ if (arp_flags & ATF_DONTPUB)
+ printf("DONTPUB ");
+ #endif
+@@ -519,7 +529,8 @@ static void arp_disp(char *name, char *ip, int type, int arp_flags, char *hwa, c
+ static int arp_show(char *name)
+ {
+ char host[100];
+- struct sockaddr sa;
++ struct sockaddr_storage ss;
++ struct sockaddr *sa;
+ char ip[100];
+ char hwa[100];
+ char mask[100];
+@@ -527,19 +538,20 @@ static int arp_show(char *name)
+ char dev[100];
+ int type, flags;
+ FILE *fp;
+- char *hostname;
++ const char *hostname;
+ int num, entries = 0, showed = 0;
+
+ host[0] = '\0';
+
++ sa = (struct sockaddr *)&ss;
+ if (name != NULL) {
+ /* Resolve the host name. */
+ safe_strncpy(host, name, (sizeof host));
+- if (ap->input(0, host, &sa) < 0) {
++ if (ap->input(0, host, sa) < 0) {
+ ap->herror(host);
+ return (-1);
+ }
+- safe_strncpy(host, ap->sprint(&sa, 1), sizeof(host));
++ safe_strncpy(host, ap->sprint(sa, 1), sizeof(host));
+ }
+ /* Open the PROCps kernel table. */
+ if ((fp = fopen(_PATH_PROCNET_ARP, "r")) == NULL) {
+@@ -548,11 +560,11 @@ static int arp_show(char *name)
+ }
+ /* Bypass header -- read until newline */
+ if (fgets(line, sizeof(line), fp) != (char *) NULL) {
+- strcpy(mask, "-");
+- strcpy(dev, "-");
++ safe_strncpy(mask, "-", sizeof(mask));
++ safe_strncpy(dev, "-", sizeof(dev));
+ /* Read the ARP cache entries. */
+ for (; fgets(line, sizeof(line), fp);) {
+- num = sscanf(line, "%s 0x%x 0x%x %100s %100s %100s\n",
++ num = sscanf(line, "%s 0x%x 0x%x %99s %99s %99s\n",
+ ip, &type, &flags, hwa, mask, dev);
+ if (num < 4)
+ break;
+@@ -575,10 +587,10 @@ static int arp_show(char *name)
+ if (opt_n)
+ hostname = "?";
+ else {
+- if (ap->input(0, ip, &sa) < 0)
++ if (ap->input(0, ip, sa) < 0)
+ hostname = ip;
+ else
+- hostname = ap->sprint(&sa, opt_n | 0x8000);
++ hostname = ap->sprint(sa, opt_n | 0x8000);
+ if (strcmp(hostname, ip) == 0)
+ hostname = "?";
+ }
+@@ -605,20 +617,20 @@ static int arp_show(char *name)
+
+ static void version(void)
+ {
+- fprintf(stderr, "%s\n%s\n%s\n", Release, Version, Features);
++ fprintf(stderr, "%s\n%s\n", Release, Features);
+ exit(E_VERSION);
+ }
+
+ static void usage(void)
+ {
+ fprintf(stderr, _("Usage:\n arp [-vn] [<HW>] [-i <if>] [-a] [<hostname>] <-Display ARP cache\n"));
+- fprintf(stderr, _(" arp [-v] [-i <if>] -d <hostname> [pub][nopub] <-Delete ARP entry\n"));
+- fprintf(stderr, _(" arp [-vnD] [<HW>] [-i <if>] -f [<filename>] <-Add entry from file\n"));
+- fprintf(stderr, _(" arp [-v] [<HW>] [-i <if>] -s <hostname> <hwaddr> [temp][nopub] <-Add entry\n"));
+- fprintf(stderr, _(" arp [-v] [<HW>] [-i <if>] -s <hostname> <hwaddr> [netmask <nm>] pub <-''-\n"));
+- fprintf(stderr, _(" arp [-v] [<HW>] [-i <if>] -Ds <hostname> <if> [netmask <nm>] pub <-''-\n\n"));
+-
++ fprintf(stderr, _(" arp [-v] [-i <if>] -d <host> [pub] <-Delete ARP entry\n"));
++ fprintf(stderr, _(" arp [-vnD] [<HW>] [-i <if>] -f [<filename>] <-Add entry from file\n"));
++ fprintf(stderr, _(" arp [-v] [<HW>] [-i <if>] -s <host> <hwaddr> [temp] <-Add entry\n"));
++ fprintf(stderr, _(" arp [-v] [<HW>] [-i <if>] -Ds <host> <if> [netmask <nm>] pub <-''-\n\n"));
++
+ fprintf(stderr, _(" -a display (all) hosts in alternative (BSD) style\n"));
++ fprintf(stderr, _(" -e display (all) hosts in default (Linux) style\n"));
+ fprintf(stderr, _(" -s, --set set a new ARP entry\n"));
+ fprintf(stderr, _(" -d, --delete delete a specified entry\n"));
+ fprintf(stderr, _(" -v, --verbose be verbose\n"));
+diff --git a/config.in b/config.in
+index f3310d6..e080937 100644
+--- a/config.in
++++ b/config.in
+@@ -1,5 +1,5 @@
+ #
+-# config.in Configure.sh source for the net-tools.
++# config.in configure.sh source for the net-tools.
+ # This file contains the definition of what the support
+ # library contains. Most of all, it defines which types
+ # of address families and hardware we know of.
+@@ -46,19 +46,20 @@ bool 'Does your system support GNU gettext?' I18N n
+ *
+ *
+ * Protocol Families.
+-*
++*
+ bool 'UNIX protocol family' HAVE_AFUNIX y
+ bool 'INET (TCP/IP) protocol family' HAVE_AFINET y
+-bool 'INET6 (IPv6) protocol family' HAVE_AFINET6 n
++bool 'INET6 (IPv6) protocol family' HAVE_AFINET6 y
+ bool 'Novell IPX/SPX protocol family' HAVE_AFIPX y
+ bool 'Appletalk DDP protocol family' HAVE_AFATALK y
+ bool 'AX25 (packet radio) protocol family' HAVE_AFAX25 y
+ bool 'NET/ROM (packet radio) protocol family' HAVE_AFNETROM y
+-bool 'Rose (packet radio) protocol family' HAVE_AFROSE n
++bool 'Rose (packet radio) protocol family' HAVE_AFROSE y
+ bool 'X.25 (CCITT) protocol family' HAVE_AFX25 y
+-bool 'Econet protocol family' HAVE_AFECONET n
++bool 'Econet protocol family' HAVE_AFECONET y
+ bool 'DECnet protocol family' HAVE_AFDECnet n
+-bool 'Ash protocol family' HAVE_AFASH n
++bool 'Ash protocol family' HAVE_AFASH y
++bool 'Bluetooth protocol family' HAVE_AFBLUETOOTH n
+ *
+ *
+ * Device Hardware types.
+@@ -68,24 +69,27 @@ bool 'ARCnet support' HAVE_HWARC y
+ bool 'SLIP (serial line) support' HAVE_HWSLIP y
+ bool 'PPP (serial line) support' HAVE_HWPPP y
+ bool 'IPIP Tunnel support' HAVE_HWTUNNEL y
+-bool 'STRIP (Metricom radio) support' HAVE_HWSTRIP y
+-bool 'Token ring (generic) support' HAVE_HWTR y
++bool 'STRIP (Metricom radio) support' HAVE_HWSTRIP n
++bool 'Token ring (generic) support' HAVE_HWTR n
+ bool 'AX25 (packet radio) support' HAVE_HWAX25 y
+-bool 'Rose (packet radio) support' HAVE_HWROSE n
++bool 'Rose (packet radio) support' HAVE_HWROSE y
+ bool 'NET/ROM (packet radio) support' HAVE_HWNETROM y
+ bool 'X.25 (generic) support' HAVE_HWX25 y
+ bool 'DLCI/FRAD (frame relay) support' HAVE_HWFR y
+-bool 'SIT (IPv6-in-IPv4) support' HAVE_HWSIT n
+-bool 'FDDI (generic) support' HAVE_HWFDDI n
+-bool 'HIPPI (generic) support' HAVE_HWHIPPI n
+-bool 'Ash hardware support' HAVE_HWASH n
+-bool '(Cisco)-HDLC/LAPB support' HAVE_HWHDLCLAPB n
++bool 'SIT (IPv6-in-IPv4) support' HAVE_HWSIT y
++bool 'FDDI (generic) support' HAVE_HWFDDI y
++bool 'HIPPI (generic) support' HAVE_HWHIPPI y
++bool 'Ash hardware support' HAVE_HWASH y
++bool '(Cisco)-HDLC/LAPB support' HAVE_HWHDLCLAPB y
+ bool 'IrDA support' HAVE_HWIRDA y
+-bool 'Econet hardware support' HAVE_HWEC n
++bool 'Econet hardware support' HAVE_HWEC y
++bool 'Generic EUI-64 hardware support' HAVE_HWEUI64 y
++bool 'InfiniBand hardware support' HAVE_HWIB y
+ *
+ *
+ * Other Features.
+ *
+-bool 'IP Masquerading support' HAVE_FW_MASQUERADE n
+-bool 'Build iptunnel and ipmaddr' HAVE_IP_TOOLS n
+-bool 'Build mii-tool' HAVE_MII n
++bool 'IP Masquerading support' HAVE_FW_MASQUERADE y
++bool 'Build iptunnel and ipmaddr' HAVE_IP_TOOLS y
++bool 'Build mii-tool' HAVE_MII y
++bool 'SELinux support' HAVE_SELINUX n
+diff --git a/configure.sh b/configure.sh
+index 9859b59..64b594f 100755
+--- a/configure.sh
++++ b/configure.sh
+@@ -1,6 +1,6 @@
+ #!/usr/bin/env bash
+ #
+-# Configure.sh Generates interactively a config.h from config.in
++# configure.sh Generates interactively a config.h from config.in
+ #
+ # net-tools A collection of programs that form the base set of the
+ # NET-3 Networking Distribution for the LINUX operating
+@@ -37,7 +37,15 @@ CONFIG=config.h
+ MAKECONFIG=config.make
+
+
+-[ -z "$BASH" ] && { echo "Configure requires bash" 1>&2; exit 1; }
++[ -z "$BASH" ] && { echo "configure.sh requires bash" 1>&2; exit 1; }
++
++cat <<EOF
++
++######################################################
++Notice: ifconfig and route are now installed into /bin
++######################################################
++
++EOF
+
+ # Disable filename globbing once and for all.
+ # Enable function cacheing.
+@@ -106,7 +114,7 @@ function int()
+ }
+
+ #
+- # Make sure we start out with a clean slate.
++ # Make sure we start out with a clean state.
+ #
+ > config.new
+ > ${CONFIG}
+diff --git a/hostname.c b/hostname.c
+index 8793fb9..ae98ca6 100644
+--- a/hostname.c
++++ b/hostname.c
+@@ -6,23 +6,22 @@
+ * Usage: hostname [-d|-f|-s|-a|-i|-y|-n]
+ * hostname [-h|-V]
+ * hostname {name|-F file}
+- * dnsdmoainname
++ * dnsdmoainname
+ * nisdomainname {name|-F file}
+ *
+- * Version: hostname 1.96 (1996-02-18)
++ * Version: hostname 1.101 (2003-10-11)
+ *
+ * Author: Peter Tobias <tobias@et-inf.fho-emden.de>
+ *
+ * Changes:
+- * {1.90} Peter Tobias : Added -a and -i options.
+- * {1.91} Bernd Eckenfels : -v,-V rewritten, long_opts
+- * (major rewrite), usage.
+- *960120 {1.95} Bernd Eckenfels : -y/nisdomainname - support for get/
+- * setdomainname added
+- *960218 {1.96} Bernd Eckenfels : netinet/in.h added
+- *980629 {1.97} Arnaldo Carvalho de Melo : gettext instead of catgets for i18n
+- *20000213 {1.99} Arnaldo Carvalho de Melo : fixed some i18n strings
++ * {1.90} Peter Tobias : Added -a and -i options.
++ * {1.91} Bernd Eckenfels : -v,-V rewritten, long_opts (major rewrite), usage.
++ *19960120 {1.95} Bernd Eckenfels : -y/nisdomainname - support for get/setdomainname added
++ *19960218 {1.96} Bernd Eckenfels : netinet/in.h added
++ *19980629 {1.97} Arnaldo Carvalho de Melo : gettext instead of catgets for i18n
++ *20000213 {1.99} Arnaldo Carvalho de Melo : fixed some i18n strings
+ *20010404 {1.100} Arnaldo Carvalho de Melo: use setlocale
++ *20031011 {1.101} Maik Broemme: gcc 3.x fixes (default: break)
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU General
+@@ -31,7 +30,9 @@
+ * your option) any later version.
+ */
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <unistd.h>
++#include <stdlib.h>
+ #include <getopt.h>
+ #include <string.h>
+ #include <netdb.h>
+@@ -41,13 +42,19 @@
+ #include <arpa/inet.h>
+ #include "config.h"
+ #include "version.h"
++#include "net-support.h"
+ #include "../intl.h"
+
++#if HAVE_AFINET6
++#include <sys/socket.h> /* for PF_INET6 */
++#include <sys/types.h> /* for inet_ntop */
++#endif
++
+ #if HAVE_AFDECnet
+ #include <netdnet/dn.h>
+ #endif
+
+-char *Release = RELEASE, *Version = "hostname 1.100 (2001-04-14)";
++static char *Release = RELEASE;
+
+ static char *program_name;
+ static int opt_v;
+@@ -72,12 +79,13 @@ static void setnname(char *nname)
+ if (setnodename(nname, strlen(nname))) {
+ switch(errno) {
+ case EPERM:
+- fprintf(stderr, _("%s: you must be root to change the node name\n"), program_name);
++ fprintf(stderr, _("%s: you don't have permission to set the node name\n"), program_name);
+ break;
+ case EINVAL:
+ fprintf(stderr, _("%s: name too long\n"), program_name);
+ break;
+ default:
++ break;
+ }
+ exit(1);
+ }
+@@ -92,12 +100,11 @@ static void sethname(char *hname)
+ if (sethostname(hname, strlen(hname))) {
+ switch (errno) {
+ case EPERM:
+- fprintf(stderr, _("%s: you must be root to change the host name\n"), program_name);
++ fprintf(stderr, _("%s: you don't have permission to set the host name\n"), program_name);
+ break;
+ case EINVAL:
+ fprintf(stderr, _("%s: name too long\n"), program_name);
+ break;
+- default:
+ }
+ exit(1);
+ };
+@@ -111,12 +118,11 @@ static void setdname(char *dname)
+ if (setdomainname(dname, strlen(dname))) {
+ switch (errno) {
+ case EPERM:
+- fprintf(stderr, _("%s: you must be root to change the domain name\n"), program_name);
++ fprintf(stderr, _("%s: you don't have permission to set the domain name\n"), program_name);
+ break;
+ case EINVAL:
+ fprintf(stderr, _("%s: name too long\n"), program_name);
+ break;
+- default:
+ }
+ exit(1);
+ };
+@@ -125,15 +131,23 @@ static void setdname(char *dname)
+ static void showhname(char *hname, int c)
+ {
+ struct hostent *hp;
++#if HAVE_AFINET6
++ struct in6_addr **ip6;
++#endif
+ register char *p, **alias;
+ struct in_addr **ip;
+
+ if (opt_v)
+ fprintf(stderr, _("Resolving `%s' ...\n"), hname);
+- if (!(hp = gethostbyname(hname))) {
++ if (
++#if HAVE_AFINET6
++ !(hp = gethostbyname2(hname, PF_INET6)) &&
++#endif
++ !(hp = gethostbyname(hname))) {
+ herror(program_name);
+ exit(1);
+ }
++
+ if (opt_v) {
+ fprintf(stderr, _("Result: h_name=`%s'\n"),
+ hp->h_name);
+@@ -142,11 +156,28 @@ static void showhname(char *hname, int c)
+ while (alias[0])
+ fprintf(stderr, _("Result: h_aliases=`%s'\n"),
+ *alias++);
+-
+- ip = (struct in_addr **) hp->h_addr_list;
+- while (ip[0])
+- fprintf(stderr, _("Result: h_addr_list=`%s'\n"),
+- inet_ntoa(**ip++));
++#if HAVE_AFINET6
++ if (hp->h_addrtype == PF_INET6) {
++ char addr[INET6_ADDRSTRLEN + 1];
++ addr[INET6_ADDRSTRLEN] = '\0';
++ ip6 = (struct in6_addr **) hp->h_addr_list;
++ while (ip6[0]) {
++ if (inet_ntop(PF_INET6, *ip6++, addr, INET6_ADDRSTRLEN))
++ fprintf(stderr, _("Result: h_addr_list=`%s'\n"), addr);
++ else if (errno == EAFNOSUPPORT)
++ fprintf(stderr, _("%s: protocol family not supported\n"),
++ program_name);
++ else if (errno == ENOSPC)
++ fprintf(stderr, _("%s: name too long\n"), program_name);
++ }
++ } else
++#endif
++ {
++ ip = (struct in_addr **) hp->h_addr_list;
++ while (ip[0])
++ fprintf(stderr, _("Result: h_addr_list=`%s'\n"),
++ inet_ntoa(**ip++));
++ }
+ }
+ if (!(p = strchr(hp->h_name, '.')) && (c == 'd'))
+ return;
+@@ -158,8 +189,29 @@ static void showhname(char *hname, int c)
+ printf("\n");
+ break;
+ case 'i':
+- while (hp->h_addr_list[0])
+- printf("%s ", inet_ntoa(*(struct in_addr *) *hp->h_addr_list++));
++#if HAVE_AFINET6
++ if (hp->h_addrtype == PF_INET6) {
++ char addr[INET6_ADDRSTRLEN + 1];
++ addr[INET6_ADDRSTRLEN] = '\0';
++ while (hp->h_addr_list[0]) {
++ if (inet_ntop(PF_INET6, (struct in6_addr *)*hp->h_addr_list++,
++ addr, INET6_ADDRSTRLEN)) {
++ printf("%s ", addr);
++ } else if (errno == EAFNOSUPPORT) {
++ fprintf(stderr, _("\n%s: protocol family not supported\n"),
++ program_name);
++ exit(1);
++ } else if (errno == ENOSPC) {
++ fprintf(stderr, _("\n%s: name too long\n"), program_name);
++ exit(1);
++ }
++ }
++ } else
++#endif
++ {
++ while (hp->h_addr_list[0])
++ printf("%s ", inet_ntoa(*(struct in_addr *)*hp->h_addr_list++));
++ }
+ printf("\n");
+ break;
+ case 'd':
+@@ -173,7 +225,6 @@ static void showhname(char *hname, int c)
+ *p = '\0';
+ printf("%s\n", hp->h_name);
+ break;
+- default:
+ }
+ }
+
+@@ -215,8 +266,8 @@ static void setfilename(char *name, int what)
+
+ static void version(void)
+ {
+- fprintf(stderr, "%s\n%s\n", Release, Version);
+- exit(5); /* E_VERSION */
++ fprintf(stderr, "%s\n", Release);
++ exit(E_VERSION);
+ }
+
+ static void usage(void)
+@@ -247,7 +298,7 @@ static void usage(void)
+ " FQDN (Fully Qualified Domain Name) and the DNS domain name (which is\n"
+ " part of the FQDN) in the /etc/hosts file.\n"));
+
+- exit(4); /* E_USAGE */
++ exit(E_USAGE);
+ }
+
+
+@@ -326,11 +377,12 @@ int main(int argc, char **argv)
+ break;
+ case 'V':
+ version();
++ break; // not reached
+ case '?':
+ case 'h':
+ default:
+ usage();
+-
++ break; // not reached
+ };
+
+
+@@ -371,7 +423,10 @@ int main(int argc, char **argv)
+ setdname(argv[optind]);
+ break;
+ }
+- getdomainname(myname, sizeof(myname));
++ if (getdomainname(myname, sizeof(myname)) < 0) {
++ perror("getdomainname()");
++ exit(1);
++ }
+ if (opt_v)
+ fprintf(stderr, _("getdomainname()=`%s'\n"), myname);
+ printf("%s\n", myname);
+diff --git a/ifconfig.c b/ifconfig.c
+index 73a4e9b..df9793a 100644
+--- a/ifconfig.c
++++ b/ifconfig.c
+@@ -3,7 +3,7 @@
+ * that either displays or sets the characteristics of
+ * one or more of the system's networking interfaces.
+ *
+- * Version: $Id: ifconfig.c,v 1.50 2001/04/13 18:25:18 pb Exp $
++ * Version: $Id: ifconfig.c,v 1.59 2011-01-01 03:22:31 ecki Exp $
+ *
+ * Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+ * and others. Copyright 1993 MicroWalt Corporation
+@@ -19,8 +19,8 @@
+ *
+ * {1.34} - 19980630 - Arnaldo Carvalho de Melo <acme@conectiva.com.br>
+ * - gettext instead of catgets for i18n
+- * 10/1998 - Andi Kleen. Use interface list primitives.
+- * 20001008 - Bernd Eckenfels, Patch from RH for setting mtu
++ * 10/1998 - Andi Kleen. Use interface list primitives.
++ * 20001008 - Bernd Eckenfels, Patch from RH for setting mtu
+ * (default AF was wrong)
+ * 20010404 - Arnaldo Carvalho de Melo, use setlocale
+ */
+@@ -49,7 +49,7 @@
+ #include <asm/types.h>
+
+
+-#ifdef HAVE_HWSLIP
++#if HAVE_HWSLIP
+ #include <linux/if_slip.h>
+ #endif
+
+@@ -85,19 +85,16 @@ struct in6_ifreq {
+ #include "sockets.h"
+ #include "util.h"
+
+-char *Release = RELEASE, *Version = "ifconfig 1.42 (2001-04-13)";
++static char *Release = RELEASE;
+
+ int opt_a = 0; /* show all interfaces */
+-int opt_i = 0; /* show the statistics */
+ int opt_v = 0; /* debugging output flag */
+
+ int addr_family = 0; /* currently selected AF */
+
+ /* for ipv4 add/del modes */
+-static int get_nmbc_parent(char *parent, unsigned long *nm,
+- unsigned long *bc);
+-static int set_ifstate(char *parent, unsigned long ip,
+- unsigned long nm, unsigned long bc,
++static int get_nmbc_parent(char *parent, in_addr_t *nm, in_addr_t *bc);
++static int set_ifstate(char *parent, in_addr_t ip, in_addr_t nm, in_addr_t bc,
+ int flag);
+
+ static int if_print(char *ifname)
+@@ -105,7 +102,7 @@ static int if_print(char *ifname)
+ int res;
+
+ if (ife_short)
+- printf(_("Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg\n"));
++ printf(_("Iface MTU RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg\n"));
+
+ if (!ifname) {
+ res = for_all_interfaces(do_if_print, &opt_a);
+@@ -113,11 +110,14 @@ static int if_print(char *ifname)
+ struct interface *ife;
+
+ ife = lookup_interface(ifname);
+- res = do_if_fetch(ife);
+- if (res >= 0)
++ if (!ife) {
++ return -1;
++ }
++ res = do_if_fetch(ife);
++ if (res >= 0)
+ ife_print(ife);
+ }
+- return res;
++ return res;
+ }
+
+ /* Set a certain interface flag. */
+@@ -127,7 +127,7 @@ static int set_flag(char *ifname, short flag)
+
+ safe_strncpy(ifr.ifr_name, ifname, IFNAMSIZ);
+ if (ioctl(skfd, SIOCGIFFLAGS, &ifr) < 0) {
+- fprintf(stderr, _("%s: unknown interface: %s\n"),
++ fprintf(stderr, _("%s: ERROR while getting interface flags: %s\n"),
+ ifname, strerror(errno));
+ return (-1);
+ }
+@@ -159,7 +159,7 @@ static int clr_flag(char *ifname, short flag)
+
+ safe_strncpy(ifr.ifr_name, ifname, IFNAMSIZ);
+ if (ioctl(fd, SIOCGIFFLAGS, &ifr) < 0) {
+- fprintf(stderr, _("%s: unknown interface: %s\n"),
++ fprintf(stderr, _("%s: ERROR while getting interface flags: %s\n"),
+ ifname, strerror(errno));
+ return -1;
+ }
+@@ -172,9 +172,35 @@ static int clr_flag(char *ifname, short flag)
+ return (0);
+ }
+
++/** test is a specified flag is set */
++static int test_flag(char *ifname, short flags)
++{
++ struct ifreq ifr;
++ int fd;
++
++ if (strchr(ifname, ':')) {
++ /* This is a v4 alias interface. Downing it via a socket for
++ another AF may have bad consequences. */
++ fd = get_socket_for_af(AF_INET);
++ if (fd < 0) {
++ fprintf(stderr, _("No support for INET on this system.\n"));
++ return -1;
++ }
++ } else
++ fd = skfd;
++
++ safe_strncpy(ifr.ifr_name, ifname, IFNAMSIZ);
++ if (ioctl(fd, SIOCGIFFLAGS, &ifr) < 0) {
++ fprintf(stderr, _("%s: ERROR while testing interface flags: %s\n"),
++ ifname, strerror(errno));
++ return -1;
++ }
++ return (ifr.ifr_flags & flags);
++}
++
+ static void usage(void)
+ {
+- fprintf(stderr, _("Usage:\n ifconfig [-a] [-i] [-v] [-s] <interface> [[<AF>] <address>]\n"));
++ fprintf(stderr, _("Usage:\n ifconfig [-a] [-v] [-s] <interface> [[<AF>] <address>]\n"));
+ #if HAVE_AFINET
+ fprintf(stderr, _(" [add <address>[/<prefixlen>]]\n"));
+ fprintf(stderr, _(" [del <address>[/<prefixlen>]]\n"));
+@@ -184,7 +210,7 @@ static void usage(void)
+ #ifdef SIOCSKEEPALIVE
+ fprintf(stderr, _(" [outfill <NN>] [keepalive <NN>]\n"));
+ #endif
+- fprintf(stderr, _(" [hw <HW> <address>] [metric <NN>] [mtu <NN>]\n"));
++ fprintf(stderr, _(" [hw <HW> <address>] [mtu <NN>]\n"));
+ fprintf(stderr, _(" [[-]trailers] [[-]arp] [[-]allmulti]\n"));
+ fprintf(stderr, _(" [multicast] [[-]promisc]\n"));
+ fprintf(stderr, _(" [mem_start <NN>] [io_addr <NN>] [irq <NN>] [media <type>]\n"));
+@@ -207,38 +233,39 @@ static void usage(void)
+
+ static void version(void)
+ {
+- fprintf(stderr, "%s\n%s\n", Release, Version);
+- exit(0);
++ fprintf(stderr, "%s\n", Release);
++ exit(E_VERSION);
+ }
+
+ static int set_netmask(int skfd, struct ifreq *ifr, struct sockaddr *sa)
+ {
+ int err = 0;
+
+- memcpy((char *) &ifr->ifr_netmask, (char *) sa,
+- sizeof(struct sockaddr));
++ memcpy(&ifr->ifr_netmask, sa, sizeof(struct sockaddr));
+ if (ioctl(skfd, SIOCSIFNETMASK, ifr) < 0) {
+ fprintf(stderr, "SIOCSIFNETMASK: %s\n",
+ strerror(errno));
+ err = 1;
+ }
+- return 0;
++ return err;
+ }
+
+ int main(int argc, char **argv)
+ {
+- struct sockaddr sa;
+- struct sockaddr_in sin;
++ struct sockaddr_storage _sa, _samask;
++ struct sockaddr *sa = (struct sockaddr *)&_sa;
++ struct sockaddr *samask = (struct sockaddr *)&_samask;
++ struct sockaddr_in *sin = (struct sockaddr_in *)sa;
+ char host[128];
+ struct aftype *ap;
+ struct hwtype *hw;
+ struct ifreq ifr;
+- int goterr = 0, didnetmask = 0;
++ int goterr = 0, didnetmask = 0, neednetmask=0;
+ char **spp;
+ int fd;
+ #if HAVE_AFINET6
+ extern struct aftype inet6_aftype;
+- struct sockaddr_in6 sa6;
++ struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa;
+ struct in6_ifreq ifr6;
+ unsigned long prefix_len;
+ char *cp;
+@@ -248,7 +275,7 @@ int main(int argc, char **argv)
+ #endif
+
+ #if I18N
+- setlocale (LC_ALL, "");
++ setlocale(LC_ALL, "");
+ bindtextdomain("net-tools", "/usr/share/locale");
+ textdomain("net-tools");
+ #endif
+@@ -265,7 +292,7 @@ int main(int argc, char **argv)
+
+ else if (!strcmp(*argv, "-v"))
+ opt_v = 1;
+-
++
+ else if (!strcmp(*argv, "-V") || !strcmp(*argv, "-version") ||
+ !strcmp(*argv, "--version"))
+ version();
+@@ -275,7 +302,7 @@ int main(int argc, char **argv)
+ usage();
+
+ else {
+- fprintf(stderr, _("ifconfig: option `%s' not recognised.\n"),
++ fprintf(stderr, _("ifconfig: option `%s' not recognised.\n"),
+ argv[0]);
+ fprintf(stderr, _("ifconfig: `--help' gives usage information.\n"));
+ exit(1);
+@@ -309,9 +336,9 @@ int main(int argc, char **argv)
+ /* The next argument is either an address family name, or an option. */
+ if ((ap = get_aftype(*spp)) != NULL)
+ spp++; /* it was a AF name */
+- else
++ else
+ ap = get_aftype(DFLT_AF);
+-
++
+ if (ap) {
+ addr_family = ap->af;
+ skfd = ap->fd;
+@@ -356,7 +383,7 @@ int main(int argc, char **argv)
+ goterr = 1;
+ } else {
+ if (ioctl(skfd, SIOCGIFMAP, &ifr) < 0) {
+- perror("port: SIOCGIFMAP");
++ perror("port: SIOCGIFMAP");
+ goterr = 1;
+ continue;
+ }
+@@ -388,6 +415,8 @@ int main(int argc, char **argv)
+ }
+ if (!strcmp(*spp, "-promisc")) {
+ goterr |= clr_flag(ifr.ifr_name, IFF_PROMISC);
++ if (test_flag(ifr.ifr_name, IFF_PROMISC) > 0)
++ fprintf(stderr, _("Warning: Interface %s still in promisc mode... maybe other application is running?\n"), ifr.ifr_name);
+ spp++;
+ continue;
+ }
+@@ -398,6 +427,8 @@ int main(int argc, char **argv)
+ }
+ if (!strcmp(*spp, "-multicast")) {
+ goterr |= clr_flag(ifr.ifr_name, IFF_MULTICAST);
++ if (test_flag(ifr.ifr_name, IFF_MULTICAST) > 0)
++ fprintf(stderr, _("Warning: Interface %s still in MULTICAST mode.\n"), ifr.ifr_name);
+ spp++;
+ continue;
+ }
+@@ -408,6 +439,8 @@ int main(int argc, char **argv)
+ }
+ if (!strcmp(*spp, "-allmulti")) {
+ goterr |= clr_flag(ifr.ifr_name, IFF_ALLMULTI);
++ if (test_flag(ifr.ifr_name, IFF_ALLMULTI) > 0)
++ fprintf(stderr, _("Warning: Interface %s still in ALLMULTI mode.\n"), ifr.ifr_name);
+ spp++;
+ continue;
+ }
+@@ -430,21 +463,12 @@ int main(int argc, char **argv)
+ if (!strcmp(*spp, "-dynamic")) {
+ goterr |= clr_flag(ifr.ifr_name, IFF_DYNAMIC);
+ spp++;
++ if (test_flag(ifr.ifr_name, IFF_DYNAMIC) > 0)
++ fprintf(stderr, _("Warning: Interface %s still in DYNAMIC mode.\n"), ifr.ifr_name);
+ continue;
+ }
+ #endif
+
+- if (!strcmp(*spp, "metric")) {
+- if (*++spp == NULL)
+- usage();
+- ifr.ifr_metric = atoi(*spp);
+- if (ioctl(skfd, SIOCSIFMETRIC, &ifr) < 0) {
+- fprintf(stderr, "SIOCSIFMETRIC: %s\n", strerror(errno));
+- goterr = 1;
+- }
+- spp++;
+- continue;
+- }
+ if (!strcmp(*spp, "mtu")) {
+ if (*++spp == NULL)
+ usage();
+@@ -460,7 +484,7 @@ int main(int argc, char **argv)
+ if (!strcmp(*spp, "keepalive")) {
+ if (*++spp == NULL)
+ usage();
+- ifr.ifr_data = (caddr_t) atoi(*spp);
++ ifr.ifr_data = (caddr_t) (uintptr_t) atoi(*spp);
+ if (ioctl(skfd, SIOCSKEEPALIVE, &ifr) < 0) {
+ fprintf(stderr, "SIOCSKEEPALIVE: %s\n", strerror(errno));
+ goterr = 1;
+@@ -474,7 +498,7 @@ int main(int argc, char **argv)
+ if (!strcmp(*spp, "outfill")) {
+ if (*++spp == NULL)
+ usage();
+- ifr.ifr_data = (caddr_t) atoi(*spp);
++ ifr.ifr_data = (caddr_t) (uintptr_t) atoi(*spp);
+ if (ioctl(skfd, SIOCSOUTFILL, &ifr) < 0) {
+ fprintf(stderr, "SIOCSOUTFILL: %s\n", strerror(errno));
+ goterr = 1;
+@@ -486,20 +510,24 @@ int main(int argc, char **argv)
+
+ if (!strcmp(*spp, "-broadcast")) {
+ goterr |= clr_flag(ifr.ifr_name, IFF_BROADCAST);
++ if (test_flag(ifr.ifr_name, IFF_BROADCAST) > 0)
++ fprintf(stderr, _("Warning: Interface %s still in BROADCAST mode.\n"), ifr.ifr_name);
+ spp++;
+ continue;
+ }
+ if (!strcmp(*spp, "broadcast")) {
+ if (*++spp != NULL) {
+ safe_strncpy(host, *spp, (sizeof host));
+- if (ap->input(0, host, &sa) < 0) {
+- ap->herror(host);
++ if (ap->input(0, host, sa) < 0) {
++ if (ap->herror)
++ ap->herror(host);
++ else
++ fprintf(stderr, _("ifconfig: Error resolving '%s' for broadcast\n"), host);
+ goterr = 1;
+ spp++;
+ continue;
+ }
+- memcpy((char *) &ifr.ifr_broadaddr, (char *) &sa,
+- sizeof(struct sockaddr));
++ memcpy(&ifr.ifr_broadaddr, sa, sizeof(struct sockaddr));
+ if (ioctl(ap->fd, SIOCSIFBRDADDR, &ifr) < 0) {
+ fprintf(stderr, "SIOCSIFBRDADDR: %s\n",
+ strerror(errno));
+@@ -514,14 +542,16 @@ int main(int argc, char **argv)
+ if (*++spp == NULL)
+ usage();
+ safe_strncpy(host, *spp, (sizeof host));
+- if (ap->input(0, host, &sa) < 0) {
+- ap->herror(host);
++ if (ap->input(0, host, sa) < 0) {
++ if (ap->herror)
++ ap->herror(host);
++ else
++ fprintf(stderr, _("ifconfig: Error resolving '%s' for dstaddr\n"), host);
+ goterr = 1;
+ spp++;
+ continue;
+ }
+- memcpy((char *) &ifr.ifr_dstaddr, (char *) &sa,
+- sizeof(struct sockaddr));
++ memcpy(&ifr.ifr_dstaddr, sa, sizeof(struct sockaddr));
+ if (ioctl(ap->fd, SIOCSIFDSTADDR, &ifr) < 0) {
+ fprintf(stderr, "SIOCSIFDSTADDR: %s\n",
+ strerror(errno));
+@@ -534,14 +564,17 @@ int main(int argc, char **argv)
+ if (*++spp == NULL || didnetmask)
+ usage();
+ safe_strncpy(host, *spp, (sizeof host));
+- if (ap->input(0, host, &sa) < 0) {
+- ap->herror(host);
++ if (ap->input(0, host, sa) < 0) {
++ if (ap->herror)
++ ap->herror(host);
++ else
++ fprintf(stderr, _("ifconfig: Error resolving '%s' for netmask\n"), host);
+ goterr = 1;
+ spp++;
+ continue;
+ }
+ didnetmask++;
+- goterr = set_netmask(ap->fd, &ifr, &sa);
++ goterr |= set_netmask(ap->fd, &ifr, sa);
+ spp++;
+ continue;
+ }
+@@ -563,8 +596,8 @@ int main(int argc, char **argv)
+ if (*++spp == NULL)
+ usage();
+ if (ioctl(skfd, SIOCGIFMAP, &ifr) < 0) {
+- fprintf(stderr, "mem_start: SIOCGIFMAP: %s\n", strerror(errno));
+- spp++;
++ fprintf(stderr, "mem_start: SIOCGIFMAP: %s\n", strerror(errno));
++ spp++;
+ goterr = 1;
+ continue;
+ }
+@@ -580,8 +613,8 @@ int main(int argc, char **argv)
+ if (*++spp == NULL)
+ usage();
+ if (ioctl(skfd, SIOCGIFMAP, &ifr) < 0) {
+- fprintf(stderr, "io_addr: SIOCGIFMAP: %s\n", strerror(errno));
+- spp++;
++ fprintf(stderr, "io_addr: SIOCGIFMAP: %s\n", strerror(errno));
++ spp++;
+ goterr = 1;
+ continue;
+ }
+@@ -597,9 +630,9 @@ int main(int argc, char **argv)
+ if (*++spp == NULL)
+ usage();
+ if (ioctl(skfd, SIOCGIFMAP, &ifr) < 0) {
+- fprintf(stderr, "irq: SIOCGIFMAP: %s\n", strerror(errno));
++ fprintf(stderr, "irq: SIOCGIFMAP: %s\n", strerror(errno));
+ goterr = 1;
+- spp++;
++ spp++;
+ continue;
+ }
+ ifr.ifr_map.irq = atoi(*spp);
+@@ -613,20 +646,24 @@ int main(int argc, char **argv)
+ if (!strcmp(*spp, "-pointopoint")) {
+ goterr |= clr_flag(ifr.ifr_name, IFF_POINTOPOINT);
+ spp++;
++ if (test_flag(ifr.ifr_name, IFF_POINTOPOINT) > 0)
++ fprintf(stderr, _("Warning: Interface %s still in POINTOPOINT mode.\n"), ifr.ifr_name);
+ continue;
+ }
+ if (!strcmp(*spp, "pointopoint")) {
+ if (*(spp + 1) != NULL) {
+ spp++;
+ safe_strncpy(host, *spp, (sizeof host));
+- if (ap->input(0, host, &sa)) {
+- ap->herror(host);
++ if (ap->input(0, host, sa)) {
++ if (ap->herror)
++ ap->herror(host);
++ else
++ fprintf(stderr, _("ifconfig: Error resolving '%s' for pointopoint\n"), host);
+ goterr = 1;
+ spp++;
+ continue;
+ }
+- memcpy((char *) &ifr.ifr_dstaddr, (char *) &sa,
+- sizeof(struct sockaddr));
++ memcpy(&ifr.ifr_dstaddr, sa, sizeof(struct sockaddr));
+ if (ioctl(ap->fd, SIOCSIFDSTADDR, &ifr) < 0) {
+ fprintf(stderr, "SIOCSIFDSTADDR: %s\n",
+ strerror(errno));
+@@ -652,17 +689,20 @@ int main(int argc, char **argv)
+ if (*++spp == NULL)
+ usage();
+ safe_strncpy(host, *spp, (sizeof host));
+- if (hw->input(host, &sa) < 0) {
++ if (hw->input(host, sa) < 0) {
+ fprintf(stderr, _("%s: invalid %s address.\n"), host, hw->name);
+ goterr = 1;
+ spp++;
+ continue;
+ }
+- memcpy((char *) &ifr.ifr_hwaddr, (char *) &sa,
+- sizeof(struct sockaddr));
++ memcpy(&ifr.ifr_hwaddr, sa, sizeof(struct sockaddr));
+ if (ioctl(skfd, SIOCSIFHWADDR, &ifr) < 0) {
+- fprintf(stderr, "SIOCSIFHWADDR: %s\n",
+- strerror(errno));
++ if (errno == EBUSY)
++ fprintf(stderr, "SIOCSIFHWADDR: %s - you may need to down the interface\n",
++ strerror(errno));
++ else
++ fprintf(stderr, "SIOCSIFHWADDR: %s\n",
++ strerror(errno));
+ goterr = 1;
+ }
+ spp++;
+@@ -681,22 +721,23 @@ int main(int argc, char **argv)
+ usage();
+ *cp = 0;
+ } else {
+- prefix_len = 0;
++ prefix_len = 128;
+ }
+ safe_strncpy(host, *spp, (sizeof host));
+- if (inet6_aftype.input(1, host,
+- (struct sockaddr *) &sa6) < 0) {
+- inet6_aftype.herror(host);
++ if (inet6_aftype.input(1, host, sa) < 0) {
++ if (inet6_aftype.herror)
++ inet6_aftype.herror(host);
++ else
++ fprintf(stderr, _("ifconfig: Error resolving '%s' for add\n"), host);
+ goterr = 1;
+ spp++;
+ continue;
+ }
+- memcpy((char *) &ifr6.ifr6_addr, (char *) &sa6.sin6_addr,
+- sizeof(struct in6_addr));
++ memcpy(&ifr6.ifr6_addr, &sin6->sin6_addr, sizeof(struct in6_addr));
+
+ fd = get_socket_for_af(AF_INET6);
+ if (fd < 0) {
+- fprintf(stderr,
++ fprintf(stderr,
+ _("No support for INET6 on this system.\n"));
+ goterr = 1;
+ spp++;
+@@ -718,11 +759,11 @@ int main(int argc, char **argv)
+ continue;
+ }
+ #endif
+-#ifdef HAVE_AFINET
++#if HAVE_AFINET
+ { /* ipv4 address a.b.c.d */
+- unsigned long ip, nm, bc;
++ in_addr_t ip, nm, bc;
+ safe_strncpy(host, *spp, (sizeof host));
+- if (inet_aftype.input(0, host, (struct sockaddr *)&sin) < 0) {
++ if (inet_aftype.input(0, host, sa) < 0) {
+ ap->herror(host);
+ goterr = 1;
+ spp++;
+@@ -730,15 +771,15 @@ int main(int argc, char **argv)
+ }
+ fd = get_socket_for_af(AF_INET);
+ if (fd < 0) {
+- fprintf(stderr,
++ fprintf(stderr,
+ _("No support for INET on this system.\n"));
+ goterr = 1;
+ spp++;
+ continue;
+ }
+
+- memcpy(&ip, &sin.sin_addr.s_addr, sizeof(unsigned long));
+-
++ memcpy(&ip, &sin->sin_addr.s_addr, sizeof(ip));
++
+ if (get_nmbc_parent(ifr.ifr_name, &nm, &bc) < 0) {
+ fprintf(stderr, _("Interface %s not initialized\n"),
+ ifr.ifr_name);
+@@ -747,7 +788,7 @@ int main(int argc, char **argv)
+ continue;
+ }
+ set_ifstate(ifr.ifr_name, ip, nm, bc, 1);
+-
++
+ }
+ spp++;
+ continue;
+@@ -771,22 +812,21 @@ int main(int argc, char **argv)
+ usage();
+ *cp = 0;
+ } else {
+- prefix_len = 0;
++ prefix_len = 128;
+ }
+ safe_strncpy(host, *spp, (sizeof host));
+- if (inet6_aftype.input(1, host,
+- (struct sockaddr *) &sa6) < 0) {
++ if (inet6_aftype.input(1, host, sa) < 0) {
+ inet6_aftype.herror(host);
+ goterr = 1;
+ spp++;
+ continue;
+ }
+- memcpy((char *) &ifr6.ifr6_addr, (char *) &sa6.sin6_addr,
++ memcpy(&ifr6.ifr6_addr, &sin6->sin6_addr,
+ sizeof(struct in6_addr));
+-
++
+ fd = get_socket_for_af(AF_INET6);
+ if (fd < 0) {
+- fprintf(stderr,
++ fprintf(stderr,
+ _("No support for INET6 on this system.\n"));
+ goterr = 1;
+ spp++;
+@@ -800,6 +840,8 @@ int main(int argc, char **argv)
+ }
+ ifr6.ifr6_ifindex = ifr.ifr_ifindex;
+ ifr6.ifr6_prefixlen = prefix_len;
++ if (opt_v)
++ fprintf(stderr, "now deleting: ioctl(SIOCDIFADDR,{ifindex=%d,prefixlen=%ld})\n",ifr.ifr_ifindex,prefix_len);
+ if (ioctl(fd, SIOCDIFADDR, &ifr6) < 0) {
+ fprintf(stderr, "SIOCDIFADDR: %s\n",
+ strerror(errno));
+@@ -809,12 +851,12 @@ int main(int argc, char **argv)
+ continue;
+ }
+ #endif
+-#ifdef HAVE_AFINET
++#if HAVE_AFINET
+ {
+ /* ipv4 address a.b.c.d */
+- unsigned long ip, nm, bc;
++ in_addr_t ip, nm, bc;
+ safe_strncpy(host, *spp, (sizeof host));
+- if (inet_aftype.input(0, host, (struct sockaddr *)&sin) < 0) {
++ if (inet_aftype.input(0, host, sa) < 0) {
+ ap->herror(host);
+ goterr = 1;
+ spp++;
+@@ -827,9 +869,11 @@ int main(int argc, char **argv)
+ spp++;
+ continue;
+ }
+-
+- memcpy(&ip, &sin.sin_addr.s_addr, sizeof(unsigned long));
+-
++
++ /* Clear "ip" in case sizeof(unsigned long) > sizeof(sin.sin_addr.s_addr) */
++ ip = 0;
++ memcpy(&ip, &sin->sin_addr.s_addr, sizeof(ip));
++
+ if (get_nmbc_parent(ifr.ifr_name, &nm, &bc) < 0) {
+ fprintf(stderr, _("Interface %s not initialized\n"),
+ ifr.ifr_name);
+@@ -859,17 +903,16 @@ int main(int argc, char **argv)
+ usage();
+ *cp = 0;
+ } else {
+- prefix_len = 0;
++ prefix_len = 128;
+ }
+ safe_strncpy(host, *spp, (sizeof host));
+- if (inet6_aftype.input(1, host, (struct sockaddr *) &sa6) < 0) {
++ if (inet6_aftype.input(1, host, sa) < 0) {
+ inet6_aftype.herror(host);
+ goterr = 1;
+ spp++;
+ continue;
+ }
+- memcpy((char *) &ifr6.ifr6_addr, (char *) &sa6.sin6_addr,
+- sizeof(struct in6_addr));
++ memcpy(&ifr6.ifr6_addr, &sin6->sin6_addr, sizeof(struct in6_addr));
+
+ fd = get_socket_for_af(AF_INET6);
+ if (fd < 0) {
+@@ -900,10 +943,10 @@ int main(int argc, char **argv)
+ /* If the next argument is a valid hostname, assume OK. */
+ safe_strncpy(host, *spp, (sizeof host));
+
+- /* FIXME: sa is too small for INET6 addresses, inet6 should use that too,
++ /* FIXME: sa is too small for INET6 addresses, inet6 should use that too,
+ broadcast is unexpected */
+ if (ap->getmask) {
+- switch (ap->getmask(host, &sa, NULL)) {
++ switch (ap->getmask(host, samask, NULL)) {
+ case -1:
+ usage();
+ break;
+@@ -911,8 +954,8 @@ int main(int argc, char **argv)
+ if (didnetmask)
+ usage();
+
+- goterr = set_netmask(skfd, &ifr, &sa);
+- didnetmask++;
++ // remeber to set the netmask from samask later
++ neednetmask = 1;
+ break;
+ }
+ }
+@@ -920,12 +963,14 @@ int main(int argc, char **argv)
+ fprintf(stderr, _("ifconfig: Cannot set address for this protocol family.\n"));
+ exit(1);
+ }
+- if (ap->input(0, host, &sa) < 0) {
+- ap->herror(host);
+- fprintf(stderr, _("ifconfig: `--help' gives usage information.\n"));
+- exit(1);
++ if (ap->input(0, host, sa) < 0) {
++ if (ap->herror)
++ ap->herror(host);
++ else
++ fprintf(stderr,_("ifconfig: error resolving '%s' to set address for af=%s\n"), host, ap->name); fprintf(stderr,
++ _("ifconfig: `--help' gives usage information.\n")); exit(1);
+ }
+- memcpy((char *) &ifr.ifr_addr, (char *) &sa, sizeof(struct sockaddr));
++ memcpy(&ifr.ifr_addr, sa, sizeof(struct sockaddr));
+ {
+ int r = 0; /* to shut gcc up */
+ switch (ap->af) {
+@@ -965,14 +1010,14 @@ int main(int argc, char **argv)
+ * end, since it's deleted already! - Roman
+ *
+ * Should really use regex.h here, not sure though how well it'll go
+- * with the cross-platform support etc.
++ * with the cross-platform support etc.
+ */
+ {
+ char *ptr;
+ short int found_colon = 0;
+ for (ptr = ifr.ifr_name; *ptr; ptr++ )
+ if (*ptr == ':') found_colon++;
+-
++
+ if (!(found_colon && *(ptr - 1) == '-'))
+ goterr |= set_flag(ifr.ifr_name, (IFF_UP | IFF_RUNNING));
+ }
+@@ -980,6 +1025,14 @@ int main(int argc, char **argv)
+ spp++;
+ }
+
++ if (neednetmask) {
++ goterr |= set_netmask(skfd, &ifr, samask);
++ didnetmask++;
++ }
++
++ if (opt_v && goterr)
++ fprintf(stderr, _("WARNING: at least one error occured. (%d)\n"), goterr);
++
+ return (goterr);
+ }
+
+@@ -1012,7 +1065,7 @@ static int do_ifcmd(struct interface *x, struct ifcmd *ptr)
+ char *z, *e;
+ struct sockaddr_in *sin;
+ int i;
+-
++
+ if (do_if_fetch(x) < 0)
+ return 0;
+ if (strncmp(x->name, ptr->base, ptr->baselen) != 0)
+@@ -1028,13 +1081,13 @@ static int do_ifcmd(struct interface *x, struct ifcmd *ptr)
+ if (i < 0 || i > 255)
+ abort();
+ searcher[i] = 1;
+-
++
+ /* copy */
+ sin = (struct sockaddr_in *)&x->dstaddr;
+ if (sin->sin_addr.s_addr != ptr->addr) {
+ return 0;
+ }
+-
++
+ if (ptr->flag) {
+ /* turn UP */
+ if (set_flag(x->name, IFF_UP | IFF_RUNNING) == -1)
+@@ -1044,49 +1097,48 @@ static int do_ifcmd(struct interface *x, struct ifcmd *ptr)
+ if (clr_flag(x->name, IFF_UP) == -1)
+ return -1;
+ }
+-
++
+ return 1; /* all done! */
+ }
+
+
+ static int get_nmbc_parent(char *parent,
+- unsigned long *nm, unsigned long *bc)
++ in_addr_t *nm, in_addr_t *bc)
+ {
+ struct interface *i;
+ struct sockaddr_in *sin;
+-
++
+ i = lookup_interface(parent);
+ if (!i)
+ return -1;
+ if (do_if_fetch(i) < 0)
+ return 0;
+ sin = (struct sockaddr_in *)&i->netmask;
+- memcpy(nm, &sin->sin_addr.s_addr, sizeof(unsigned long));
++ memcpy(nm, &sin->sin_addr.s_addr, sizeof(*nm));
+ sin = (struct sockaddr_in *)&i->broadaddr;
+- memcpy(bc, &sin->sin_addr.s_addr, sizeof(unsigned long));
++ memcpy(bc, &sin->sin_addr.s_addr, sizeof(*bc));
+ return 0;
+ }
+
+-static int set_ifstate(char *parent, unsigned long ip,
+- unsigned long nm, unsigned long bc,
++static int set_ifstate(char *parent, in_addr_t ip, in_addr_t nm, in_addr_t bc,
+ int flag)
+ {
+ char buf[IFNAMSIZ];
+ struct ifcmd pt;
+ int i;
+-
++
+ pt.base = parent;
+ pt.baselen = strlen(parent);
+ pt.addr = ip;
+ pt.flag = flag;
+ memset(searcher, 0, sizeof(searcher));
+- i = for_all_interfaces((int (*)(struct interface *,void *))do_ifcmd,
++ i = for_all_interfaces((int (*)(struct interface *,void *))do_ifcmd,
+ &pt);
+ if (i == -1)
+ return -1;
+ if (i == 1)
+ return 0;
+-
++
+ /* add a new interface */
+ for (i = 0; i < 256; i++)
+ if (searcher[i] == 0)
+@@ -1094,7 +1146,7 @@ static int set_ifstate(char *parent, unsigned long ip,
+
+ if (i == 256)
+ return -1; /* FAILURE!!! out of ip addresses */
+-
++
+ if (snprintf(buf, IFNAMSIZ, "%s:%d", parent, i) > IFNAMSIZ)
+ return -1;
+ if (set_ip_using(buf, SIOCSIFADDR, ip) == -1)
+diff --git a/include/interface.h b/include/interface.h
+index f95555c..1b58599 100644
+--- a/include/interface.h
++++ b/include/interface.h
+@@ -28,11 +28,10 @@ struct user_net_device_stats {
+ };
+
+ struct interface {
+- struct interface *next, *prev;
++ struct interface *next, *prev;
+ char name[IFNAMSIZ]; /* interface name */
+ short type; /* if type */
+ short flags; /* various flags */
+- int metric; /* routing metric */
+ int mtu; /* MTU value */
+ int tx_queue_len; /* transmit queue length */
+ struct ifmap map; /* hardware setup */
+@@ -64,13 +63,17 @@ struct interface {
+ extern int if_fetch(struct interface *ife);
+
+ extern int for_all_interfaces(int (*)(struct interface *, void *), void *);
+-extern int free_interface_list(void);
++extern int if_cache_free(void);
+ extern struct interface *lookup_interface(char *name);
+ extern int if_readlist(void);
+
+ extern int do_if_fetch(struct interface *ife);
+ extern int do_if_print(struct interface *ife, void *cookie);
+
++extern int procnetdev_version(char *buf);
++extern int get_dev_fields(char *bp, struct interface *ife);
++extern char * get_name(char *name, char *p);
++
+ extern void ife_print(struct interface *ptr);
+
+ extern int ife_short;
+@@ -84,7 +87,7 @@ extern const char *if_port_text[][4];
+ #endif
+
+ #if !defined(ifr_qlen)
+-/* Actually it is ifru_ivalue, but that is not present in 2.0 kernel headers */
++/* Actually it is ifru_ivalue, but that is not present in 2.0 kernel headers */
+ #define ifr_qlen ifr_ifru.ifru_mtu
+ #endif
+
+diff --git a/include/mii.h b/include/mii.h
+deleted file mode 100644
+index 1ef7ccc..0000000
+--- a/include/mii.h
++++ /dev/null
+@@ -1,86 +0,0 @@
+-/*
+- * mii.h 1.4 2000/04/25 22:06:15
+- *
+- * Media Independent Interface support: register layout and ioctl's
+- *
+- * Copyright (C) 2000 David A. Hinds -- dhinds@pcmcia.sourceforge.org
+- */
+-
+-#ifndef _LINUX_MII_H
+-#define _LINUX_MII_H
+-
+-/* network interface ioctl's for MII commands */
+-#ifndef SIOCGMIIPHY
+-#define SIOCGMIIPHY (SIOCDEVPRIVATE) /* Read from current PHY */
+-#define SIOCGMIIREG (SIOCDEVPRIVATE+1) /* Read any PHY register */
+-#define SIOCSMIIREG (SIOCDEVPRIVATE+2) /* Write any PHY register */
+-#define SIOCGPARAMS (SIOCDEVPRIVATE+3) /* Read operational parameters */
+-#define SIOCSPARAMS (SIOCDEVPRIVATE+4) /* Set operational parameters */
+-#endif
+-
+-#include <linux/types.h>
+-
+-/* This data structure is used for all the MII ioctl's */
+-struct mii_data {
+- __u16 phy_id;
+- __u16 reg_num;
+- __u16 val_in;
+- __u16 val_out;
+-};
+-
+-/* Basic Mode Control Register */
+-#define MII_BMCR 0x00
+-#define MII_BMCR_RESET 0x8000
+-#define MII_BMCR_LOOPBACK 0x4000
+-#define MII_BMCR_100MBIT 0x2000
+-#define MII_BMCR_AN_ENA 0x1000
+-#define MII_BMCR_ISOLATE 0x0400
+-#define MII_BMCR_RESTART 0x0200
+-#define MII_BMCR_DUPLEX 0x0100
+-#define MII_BMCR_COLTEST 0x0080
+-
+-/* Basic Mode Status Register */
+-#define MII_BMSR 0x01
+-#define MII_BMSR_CAP_MASK 0xf800
+-#define MII_BMSR_100BASET4 0x8000
+-#define MII_BMSR_100BASETX_FD 0x4000
+-#define MII_BMSR_100BASETX_HD 0x2000
+-#define MII_BMSR_10BASET_FD 0x1000
+-#define MII_BMSR_10BASET_HD 0x0800
+-#define MII_BMSR_NO_PREAMBLE 0x0040
+-#define MII_BMSR_AN_COMPLETE 0x0020
+-#define MII_BMSR_REMOTE_FAULT 0x0010
+-#define MII_BMSR_AN_ABLE 0x0008
+-#define MII_BMSR_LINK_VALID 0x0004
+-#define MII_BMSR_JABBER 0x0002
+-#define MII_BMSR_EXT_CAP 0x0001
+-
+-#define MII_PHY_ID1 0x02
+-#define MII_PHY_ID2 0x03
+-
+-/* Auto-Negotiation Advertisement Register */
+-#define MII_ANAR 0x04
+-/* Auto-Negotiation Link Partner Ability Register */
+-#define MII_ANLPAR 0x05
+-#define MII_AN_NEXT_PAGE 0x8000
+-#define MII_AN_ACK 0x4000
+-#define MII_AN_REMOTE_FAULT 0x2000
+-#define MII_AN_ABILITY_MASK 0x07e0
+-#define MII_AN_FLOW_CONTROL 0x0400
+-#define MII_AN_100BASET4 0x0200
+-#define MII_AN_100BASETX_FD 0x0100
+-#define MII_AN_100BASETX_HD 0x0080
+-#define MII_AN_10BASET_FD 0x0040
+-#define MII_AN_10BASET_HD 0x0020
+-#define MII_AN_PROT_MASK 0x001f
+-#define MII_AN_PROT_802_3 0x0001
+-
+-/* Auto-Negotiation Expansion Register */
+-#define MII_ANER 0x06
+-#define MII_ANER_MULT_FAULT 0x0010
+-#define MII_ANER_LP_NP_ABLE 0x0008
+-#define MII_ANER_NP_ABLE 0x0004
+-#define MII_ANER_PAGE_RX 0x0002
+-#define MII_ANER_LP_AN_ABLE 0x0001
+-
+-#endif /* _LINUX_MII_H */
+diff --git a/include/util-ank.h b/include/util-ank.h
+index 04ab16c..c8fcd08 100644
+--- a/include/util-ank.h
++++ b/include/util-ank.h
+@@ -75,6 +75,6 @@ extern int do_qdisc(int argc, char **argv);
+ extern int do_class(int argc, char **argv);
+ extern int do_filter(int argc, char **argv);
+
+-extern const char *format_host(int af, void *addr, __u8 *abuf, int alen);
++extern const char *format_host(int af, void *addr, char *abuf, int alen);
+
+ #endif /* __UTILS_H__ */
+diff --git a/ipmaddr.c b/ipmaddr.c
+index 2134e81..e4ed41d 100644
+--- a/ipmaddr.c
++++ b/ipmaddr.c
+@@ -32,6 +32,7 @@
+
+ #include "config.h"
+ #include "intl.h"
++#include "util.h"
+ #include "util-ank.h"
+ #include "net-support.h"
+ #include "version.h"
+@@ -44,13 +45,11 @@ int filter_family;
+ #define NEWADDR 1
+ #define DELADDR 2
+
+-char *Release = RELEASE,
+- *Version = "ipmaddr 1.1",
+- *Signature = "Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>";
++static char *Release = RELEASE, *Signature = "Alexey Kuznetsov";
+
+ static void version(void)
+ {
+- printf("%s\n%s\n%s\n", Release, Version, Signature);
++ printf("%s\n%s\n", Release, Signature);
+ exit(E_VERSION);
+ }
+
+@@ -61,7 +60,7 @@ static void usage(void)
+ fprintf(stderr, _("Usage: ipmaddr [ add | del ] MULTIADDR dev STRING\n"));
+ fprintf(stderr, _(" ipmaddr show [ dev STRING ] [ ipv4 | ipv6 | link | all ]\n"));
+ fprintf(stderr, _(" ipmaddr -V | -version\n"));
+- exit(-1);
++ exit(E_USAGE);
+ }
+
+ static void print_lla(FILE *fp, int len, unsigned char *addr)
+@@ -75,7 +74,7 @@ static void print_lla(FILE *fp, int len, unsigned char *addr)
+ }
+ }
+
+-static int parse_lla(char *str, unsigned char *addr)
++static int parse_lla(char *str, char *addr)
+ {
+ int len=0;
+
+@@ -159,8 +158,7 @@ void read_dev_mcast(struct ma_info **result_p)
+
+ len = parse_hex(hexa, (unsigned char*)&m.addr.data);
+ if (len >= 0) {
+- struct ma_info *ma = malloc(sizeof(m));
+-
++ struct ma_info *ma = xmalloc(sizeof(m));
+ memcpy(ma, &m, sizeof(m));
+ ma->addr.bytelen = len;
+ ma->addr.bitlen = len<<3;
+@@ -174,22 +172,21 @@ void read_dev_mcast(struct ma_info **result_p)
+
+ void read_igmp(struct ma_info **result_p)
+ {
+- struct ma_info m;
++ struct ma_info m, *ma = NULL;
+ char buf[256];
+ FILE *fp = fopen(_PATH_PROCNET_IGMP, "r");
+
+ if (!fp)
+ return;
+ memset(&m, 0, sizeof(m));
+- fgets(buf, sizeof(buf), fp);
++ if (fgets(buf, sizeof(buf), fp))
++ /* eat line */;
+
+ m.addr.family = AF_INET;
+ m.addr.bitlen = 32;
+ m.addr.bytelen = 4;
+
+ while (fgets(buf, sizeof(buf), fp)) {
+- struct ma_info *ma = malloc(sizeof(m));
+-
+ if (buf[0] != '\t') {
+ sscanf(buf, "%d%s", &m.index, m.name);
+ continue;
+@@ -200,7 +197,7 @@ void read_igmp(struct ma_info **result_p)
+
+ sscanf(buf, "%08x%d", (__u32*)&m.addr.data, &m.users);
+
+- ma = malloc(sizeof(m));
++ ma = xmalloc(sizeof(m));
+ memcpy(ma, &m, sizeof(m));
+ maddr_ins(result_p, ma);
+ }
+@@ -231,8 +228,7 @@ void read_igmp6(struct ma_info **result_p)
+
+ len = parse_hex(hexa, (unsigned char*)&m.addr.data);
+ if (len >= 0) {
+- struct ma_info *ma = malloc(sizeof(m));
+-
++ struct ma_info *ma = xmalloc(sizeof(m));
+ memcpy(ma, &m, sizeof(m));
+
+ ma->addr.bytelen = len;
+@@ -291,13 +287,15 @@ static void print_mlist(FILE *fp, struct ma_info *list)
+ static int multiaddr_list(int argc, char **argv)
+ {
+ struct ma_info *list = NULL;
++ size_t l;
+
+ while (argc > 0) {
+ if (strcmp(*argv, "dev") == 0) {
+ NEXT_ARG();
+- if (filter_dev[0])
++ l = strlen(*argv);
++ if (l <= 0 || l >= sizeof(filter_dev))
+ usage();
+- strcpy(filter_dev, *argv);
++ strncpy(filter_dev, *argv, sizeof (filter_dev));
+ } else if (strcmp(*argv, "all") == 0) {
+ filter_family = AF_UNSPEC;
+ } else if (strcmp(*argv, "ipv4") == 0) {
+@@ -307,9 +305,10 @@ static int multiaddr_list(int argc, char **argv)
+ } else if (strcmp(*argv, "link") == 0) {
+ filter_family = AF_PACKET;
+ } else {
+- if (filter_dev[0])
++ l = strlen(*argv);
++ if (l <= 0 || l >= sizeof(filter_dev))
+ usage();
+- strcpy(filter_dev, *argv);
++ strncpy(filter_dev, *argv, sizeof (filter_dev));
+ }
+ argv++; argc--;
+ }
+@@ -401,7 +400,7 @@ int main(int argc, char **argv)
+ basename = argv[0];
+ else
+ basename++;
+-
++
+ while (argc > 1) {
+ if (argv[1][0] != '-')
+ break;
+diff --git a/iptunnel.c b/iptunnel.c
+index 4943d83..ddf43b2 100644
+--- a/iptunnel.c
++++ b/iptunnel.c
+@@ -68,13 +68,11 @@
+
+ #include "util-ank.h"
+
+-char *Release = RELEASE,
+- *Version = "iptunnel 1.01",
+- *Signature = "Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>";
++static char *Release = RELEASE, *Signature = "Alexey Kuznetsov";
+
+ static void version(void)
+ {
+- printf("%s\n%s\n%s\n", Release, Version, Signature);
++ printf("%s\n%s\n", Release, Signature);
+ exit(E_VERSION);
+ }
+
+@@ -92,7 +90,7 @@ static void usage(void)
+ fprintf(stderr, _(" TOS := { NUMBER | inherit }\n"));
+ fprintf(stderr, _(" TTL := { 1..255 | inherit }\n"));
+ fprintf(stderr, _(" KEY := { DOTTED_QUAD | NUMBER }\n"));
+- exit(-1);
++ exit(E_USAGE);
+ }
+
+ static int do_ioctl_get_ifindex(char *dev)
+@@ -101,11 +99,12 @@ static int do_ioctl_get_ifindex(char *dev)
+ int fd;
+ int err;
+
+- strcpy(ifr.ifr_name, dev);
++ safe_strncpy(ifr.ifr_name, dev, IFNAMSIZ);
+ fd = socket(AF_INET, SOCK_DGRAM, 0);
+ err = ioctl(fd, SIOCGIFINDEX, &ifr);
+ if (err) {
+ perror("ioctl");
++ close(fd);
+ return 0;
+ }
+ close(fd);
+@@ -118,11 +117,12 @@ static int do_ioctl_get_iftype(char *dev)
+ int fd;
+ int err;
+
+- strcpy(ifr.ifr_name, dev);
++ safe_strncpy(ifr.ifr_name, dev, IFNAMSIZ);
+ fd = socket(AF_INET, SOCK_DGRAM, 0);
+ err = ioctl(fd, SIOCGIFHWADDR, &ifr);
+ if (err) {
+ perror("ioctl");
++ close(fd);
+ return -1;
+ }
+ close(fd);
+@@ -141,6 +141,7 @@ static char * do_ioctl_get_ifname(int idx)
+ err = ioctl(fd, SIOCGIFNAME, &ifr);
+ if (err) {
+ perror("ioctl");
++ close(fd);
+ return NULL;
+ }
+ close(fd);
+@@ -155,7 +156,7 @@ static int do_get_ioctl(char *basedev, struct ip_tunnel_parm *p)
+ int fd;
+ int err;
+
+- strcpy(ifr.ifr_name, basedev);
++ safe_strncpy(ifr.ifr_name, basedev, IFNAMSIZ);
+ ifr.ifr_ifru.ifru_data = (void*)p;
+ fd = socket(AF_INET, SOCK_DGRAM, 0);
+ err = ioctl(fd, SIOCGETTUNNEL, &ifr);
+@@ -171,7 +172,7 @@ static int do_add_ioctl(int cmd, char *basedev, struct ip_tunnel_parm *p)
+ int fd;
+ int err;
+
+- strcpy(ifr.ifr_name, basedev);
++ safe_strncpy(ifr.ifr_name, basedev, IFNAMSIZ);
+ ifr.ifr_ifru.ifru_data = (void*)p;
+ fd = socket(AF_INET, SOCK_DGRAM, 0);
+ err = ioctl(fd, cmd, &ifr);
+@@ -187,7 +188,7 @@ static int do_del_ioctl(char *basedev, struct ip_tunnel_parm *p)
+ int fd;
+ int err;
+
+- strcpy(ifr.ifr_name, basedev);
++ safe_strncpy(ifr.ifr_name, basedev, IFNAMSIZ);
+ ifr.ifr_ifru.ifru_data = (void*)p;
+ fd = socket(AF_INET, SOCK_DGRAM, 0);
+ err = ioctl(fd, SIOCDELTUNNEL, &ifr);
+@@ -375,7 +376,7 @@ static int do_add(int cmd, int argc, char **argv)
+ return do_add_ioctl(cmd, "gre0", &p);
+ case IPPROTO_IPV6:
+ return do_add_ioctl(cmd, "sit0", &p);
+- default:
++ default:
+ fprintf(stderr, _("cannot determine tunnel mode (ipip, gre or sit)\n"));
+ return -1;
+ }
+@@ -390,13 +391,13 @@ int do_del(int argc, char **argv)
+ return -1;
+
+ switch (p.iph.protocol) {
+- case IPPROTO_IPIP:
++ case IPPROTO_IPIP:
+ return do_del_ioctl(p.name[0] ? p.name : "tunl0", &p);
+- case IPPROTO_GRE:
++ case IPPROTO_GRE:
+ return do_del_ioctl(p.name[0] ? p.name : "gre0", &p);
+- case IPPROTO_IPV6:
++ case IPPROTO_IPV6:
+ return do_del_ioctl(p.name[0] ? p.name : "sit0", &p);
+- default:
++ default:
+ return do_del_ioctl(p.name, &p);
+ }
+ return -1;
+@@ -476,8 +477,10 @@ static int do_tunnels_list(struct ip_tunnel_parm *p)
+ return -1;
+ }
+
+- fgets(buf, sizeof(buf), fp);
+- fgets(buf, sizeof(buf), fp);
++ if (fgets(buf, sizeof(buf), fp))
++ /* eat line */;
++ if (fgets(buf, sizeof(buf), fp))
++ /* eat line */;
+
+ while (fgets(buf, sizeof(buf), fp) != NULL) {
+ char *ptr;
+@@ -485,9 +488,10 @@ static int do_tunnels_list(struct ip_tunnel_parm *p)
+ if ((ptr = strchr(buf, ':')) == NULL ||
+ (*ptr++ = 0, sscanf(buf, "%s", name) != 1)) {
+ fprintf(stderr, _("Wrong format of /proc/net/dev. Sorry.\n"));
++ fclose(fp);
+ return -1;
+ }
+- if (sscanf(ptr, "%ld%ld%ld%ld%ld%ld%ld%*d%ld%ld%ld%ld%ld%ld%ld",
++ if (sscanf(ptr, "%lu%lu%lu%lu%lu%lu%lu%*u%lu%lu%lu%lu%lu%lu%lu",
+ &rx_bytes, &rx_packets, &rx_errs, &rx_drops,
+ &rx_fifo, &rx_frame, &rx_multi,
+ &tx_bytes, &tx_packets, &tx_errs, &tx_drops,
+@@ -521,6 +525,7 @@ static int do_tunnels_list(struct ip_tunnel_parm *p)
+ tx_packets, tx_bytes, tx_errs, tx_colls, tx_carrier, tx_drops);
+ }
+ }
++ fclose(fp);
+ return 0;
+ }
+
+@@ -533,7 +538,7 @@ static int do_show(int argc, char **argv)
+ return -1;
+
+ switch (p.iph.protocol) {
+- case IPPROTO_IPIP:
++ case IPPROTO_IPIP:
+ err = do_get_ioctl(p.name[0] ? p.name : "tunl0", &p);
+ break;
+ case IPPROTO_GRE:
+@@ -592,7 +597,7 @@ int main(int argc, char **argv)
+ basename = argv[0];
+ else
+ basename++;
+-
++
+ while (argc > 1) {
+ if (argv[1][0] != '-')
+ break;
+diff --git a/lib/Makefile b/lib/Makefile
+index d714b2e..431f258 100644
+--- a/lib/Makefile
++++ b/lib/Makefile
+@@ -16,7 +16,7 @@
+ #
+
+
+-HWOBJS = hw.o loopback.o slip.o ether.o ax25.o ppp.o arcnet.o tr.o tunnel.o frame.o sit.o rose.o ash.o fddi.o hippi.o hdlclapb.o strip.o irda.o ec_hw.o x25.o
++HWOBJS = hw.o loopback.o slip.o ether.o ax25.o ppp.o arcnet.o tr.o tunnel.o frame.o sit.o rose.o ash.o fddi.o hippi.o hdlclapb.o strip.o irda.o ec_hw.o x25.o eui64.o ib.o
+ AFOBJS = unix.o inet.o inet6.o ax25.o ipx.o ddp.o ipx.o netrom.o af.o rose.o econet.o x25.o
+ AFGROBJS = inet_gr.o inet6_gr.o ipx_gr.o ddp_gr.o netrom_gr.o ax25_gr.o rose_gr.o getroute.o x25_gr.o
+ AFSROBJS = inet_sr.o inet6_sr.o netrom_sr.o ipx_sr.o setroute.o x25_sr.o
+@@ -36,7 +36,7 @@ OBJS = $(sort $(VARIA) $(AFOBJS) $(HWOBJS) \
+
+ # This can be overwritten by the TOPLEVEL Makefile
+ TOPDIR=..
+-CFLAGS += -I$(TOPDIR) -idirafter $(TOPDIR)/include # -fPIC
++CFLAGS += -I$(TOPDIR) -I$(TOPDIR)/include # -fPIC
+ SONAME=libnet-tools.so.0
+
+ .SUFFIXES: .a .so
+diff --git a/lib/af.c b/lib/af.c
+index 4f002c4..0500a0a 100644
+--- a/lib/af.c
++++ b/lib/af.c
+@@ -2,7 +2,7 @@
+ * lib/af.c This file contains the top-level part of the protocol
+ * support functions module for the NET-2 base distribution.
+ *
+- * Version: $Id: af.c,v 1.13 2000/05/20 13:38:10 pb Exp $
++ * Version: $Id: af.c,v 1.14 2007/12/01 17:49:35 ecki Exp $
+ *
+ * Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+ * Copyright 1993 MicroWalt Corporation
+@@ -35,8 +35,10 @@ int flag_netrom;
+ int flag_inet;
+ int flag_inet6;
+ int flag_econet;
++int flag_rose;
+ int flag_x25 = 0;
+ int flag_ash;
++int flag_bluetooth;
+
+
+ struct aftrans_t {
+@@ -58,6 +60,9 @@ struct aftrans_t {
+ "ipx", "ipx", &flag_ipx
+ },
+ {
++ "rose", "rose", &flag_rose
++ },
++ {
+ "appletalk", "ddp", &flag_ddp
+ },
+ {
+@@ -88,6 +93,9 @@ struct aftrans_t {
+ "ash", "ash", &flag_ash
+ },
+ {
++ "bluetooth", "bluetooth", &flag_bluetooth
++ },
++ {
+ 0, 0, 0
+ }
+ };
+@@ -193,15 +201,14 @@ void aftrans_def(char *tool, char *argv0, char *dflt)
+ char *tmp;
+ char *buf;
+
+- strcpy(afname, dflt);
++ safe_strncpy(afname, dflt, sizeof(afname));
+
+ if (!(tmp = strrchr(argv0, '/')))
+ tmp = argv0; /* no slash?! */
+ else
+ tmp++;
+
+- if (!(buf = strdup(tmp)))
+- return;
++ buf = xstrdup(tmp);
+
+ if (strlen(tool) >= strlen(tmp)) {
+ free(buf);
+@@ -219,7 +226,7 @@ void aftrans_def(char *tool, char *argv0, char *dflt)
+
+ afname[0] = '\0';
+ if (aftrans_opt(buf))
+- strcpy(afname, buf);
++ safe_strncpy(afname, buf, sizeof(afname));
+
+ free(buf);
+ }
+@@ -296,7 +303,6 @@ int aftrans_opt(const char *arg)
+ if (tmp2)
+ *(tmp2++) = '\0';
+
+- paft = aftrans;
+ for (paft = aftrans; paft->alias; paft++) {
+ if (strcmp(tmp1, paft->alias))
+ continue;
+@@ -335,7 +341,7 @@ void print_aflist(int type) {
+ if ((type == 1 && ((*afp)->rprint == NULL)) || ((*afp)->af == 0)) {
+ afp++; continue;
+ }
+- if ((count % 3) == 0) fprintf(stderr,count?"\n ":" ");
++ if ((count % 3) == 0) fprintf(stderr,count?"\n ":" ");
+ txt = (*afp)->name; if (!txt) txt = "..";
+ fprintf(stderr,"%s (%s) ",txt,(*afp)->title);
+ count++;
+diff --git a/lib/arcnet.c b/lib/arcnet.c
+index eb0f46e..9bc3267 100644
+--- a/lib/arcnet.c
++++ b/lib/arcnet.c
+@@ -35,7 +35,7 @@ extern struct hwtype arcnet_hwtype;
+
+
+ /* Display an ARCnet address in readable format. */
+-static char *pr_arcnet(unsigned char *ptr)
++static const char *pr_arcnet(const char *ptr)
+ {
+ static char buff[64];
+
+@@ -43,11 +43,16 @@ static char *pr_arcnet(unsigned char *ptr)
+ return (buff);
+ }
+
++#ifdef DEBUG
++#define _DEBUG 1
++#else
++#define _DEBUG 0
++#endif
+
+ /* Input an ARCnet address and convert to binary. */
+ static int in_arcnet(char *bufp, struct sockaddr *sap)
+ {
+- unsigned char *ptr;
++ char *ptr;
+ char c, *orig;
+ int i, val;
+
+@@ -66,9 +71,8 @@ static int in_arcnet(char *bufp, struct sockaddr *sap)
+ else if (c >= 'A' && c <= 'F')
+ val = c - 'A' + 10;
+ else {
+-#ifdef DEBUG
+- fprintf(stderr, _("in_arcnet(%s): invalid arcnet address!\n"), orig);
+-#endif
++ if (_DEBUG)
++ fprintf(stderr, _("in_arcnet(%s): invalid arcnet address!\n"), orig);
+ errno = EINVAL;
+ return (-1);
+ }
+@@ -81,9 +85,8 @@ static int in_arcnet(char *bufp, struct sockaddr *sap)
+ else if (c >= 'A' && c <= 'F')
+ val |= c - 'A' + 10;
+ else {
+-#ifdef DEBUG
+- fprintf(stderr, _("in_arcnet(%s): invalid arcnet address!\n"), orig);
+-#endif
++ if (_DEBUG)
++ fprintf(stderr, _("in_arcnet(%s): invalid arcnet address!\n"), orig);
+ errno = EINVAL;
+ return (-1);
+ }
+@@ -92,28 +95,21 @@ static int in_arcnet(char *bufp, struct sockaddr *sap)
+
+ /* We might get a semicolon here - not required. */
+ if (*bufp == ':') {
+- if (i == ETH_ALEN) {
+-#ifdef DEBUG
++ if (_DEBUG && i == ETH_ALEN)
+ fprintf(stderr, _("in_arcnet(%s): trailing : ignored!\n"),
+- orig)
+-#endif
+- ; /* nothing */
+- }
++ orig);
+ bufp++;
+ }
+ }
+
+ /* That's it. Any trailing junk? */
+- if ((i == ETH_ALEN) && (*bufp != '\0')) {
+-#ifdef DEBUG
++ if (_DEBUG && (i == ETH_ALEN) && (*bufp != '\0')) {
+ fprintf(stderr, _("in_arcnet(%s): trailing junk!\n"), orig);
+ errno = EINVAL;
+ return (-1);
+-#endif
+ }
+-#ifdef DEBUG
+- fprintf(stderr, "in_arcnet(%s): %s\n", orig, pr_arcnet(sap->sa_data));
+-#endif
++ if (_DEBUG)
++ fprintf(stderr, "in_arcnet(%s): %s\n", orig, pr_arcnet(sap->sa_data));
+
+ return (0);
+ }
+diff --git a/lib/ash.c b/lib/ash.c
+index c64667c..6cfc154 100644
+--- a/lib/ash.c
++++ b/lib/ash.c
+@@ -31,8 +31,8 @@ static unsigned char hamming[16] =
+ };
+
+ /* Display an Ash address in readable format. */
+-static char *
+-pr_ash(unsigned char *ptr)
++static const char *
++pr_ash(const char *ptr)
+ {
+ static char buff[128];
+ char *p = buff;
+@@ -57,10 +57,10 @@ pr_ash(unsigned char *ptr)
+
+ struct hwtype ash_hwtype;
+
+-static int
++static int
+ in_ash(char *bufp, struct sockaddr *sap)
+ {
+- unsigned char *ptr;
++ char *ptr;
+ unsigned int i = 0;
+
+ sap->sa_family = ash_hwtype.type;
+@@ -102,7 +102,7 @@ struct hwtype ash_hwtype =
+ #if HAVE_AFASH
+
+ /* Display an Ash socket address. */
+-static char *
++static const char *
+ pr_sash(struct sockaddr *sap, int numeric)
+ {
+ static char buf[64];
+diff --git a/lib/ax25.c b/lib/ax25.c
+index 11521d2..d57abe7 100644
+--- a/lib/ax25.c
++++ b/lib/ax25.c
+@@ -47,7 +47,7 @@ static char AX25_errmsg[128];
+
+ extern struct aftype ax25_aftype;
+
+-static char *AX25_print(unsigned char *ptr)
++static const char *AX25_print(const char *ptr)
+ {
+ static char buff[8];
+ int i;
+@@ -66,7 +66,7 @@ static char *AX25_print(unsigned char *ptr)
+
+
+ /* Display an AX.25 socket address. */
+-static char *
++static const char *
+ AX25_sprint(struct sockaddr *sap, int numeric)
+ {
+ static char buf[64];
+@@ -76,10 +76,15 @@ static char *
+ return (AX25_print(((struct sockaddr_ax25 *) sap)->sax25_call.ax25_call));
+ }
+
++#ifdef DEBUG
++#define _DEBUG 1
++#else
++#define _DEBUG 0
++#endif
+
+ static int AX25_input(int type, char *bufp, struct sockaddr *sap)
+ {
+- unsigned char *ptr;
++ char *ptr;
+ char *orig, c;
+ int i;
+
+@@ -95,9 +100,8 @@ static int AX25_input(int type, char *bufp, struct sockaddr *sap)
+ c = toupper(c);
+ if (!(isupper(c) || isdigit(c))) {
+ safe_strncpy(AX25_errmsg, _("Invalid callsign"), sizeof(AX25_errmsg));
+-#ifdef DEBUG
+- fprintf(stderr, "ax25_input(%s): %s !\n", AX25_errmsg, orig);
+-#endif
++ if (_DEBUG)
++ fprintf(stderr, "ax25_input(%s): %s !\n", AX25_errmsg, orig);
+ errno = EINVAL;
+ return (-1);
+ }
+@@ -107,10 +111,9 @@ static int AX25_input(int type, char *bufp, struct sockaddr *sap)
+
+ /* Callsign too long? */
+ if ((i == 6) && (*bufp != '-') && (*bufp != '\0')) {
+- strcpy(AX25_errmsg, _("Callsign too long"));
+-#ifdef DEBUG
+- fprintf(stderr, "ax25_input(%s): %s !\n", AX25_errmsg, orig);
+-#endif
++ safe_strncpy(AX25_errmsg, _("Callsign too long"), sizeof(AX25_errmsg));
++ if (_DEBUG)
++ fprintf(stderr, "ax25_input(%s): %s !\n", AX25_errmsg, orig);
+ errno = E2BIG;
+ return (-1);
+ }
+@@ -128,12 +131,12 @@ static int AX25_input(int type, char *bufp, struct sockaddr *sap)
+ }
+
+ /* All done. */
+-#ifdef DEBUG
+- fprintf(stderr, "ax25_input(%s): ", orig);
+- for (i = 0; i < sizeof(ax25_address); i++)
+- fprintf(stderr, "%02X ", sap->sa_data[i] & 0377);
+- fprintf(stderr, "\n");
+-#endif
++ if (_DEBUG) {
++ fprintf(stderr, "ax25_input(%s): ", orig);
++ for (i = 0; i < sizeof(ax25_address); i++)
++ fprintf(stderr, "%02X ", sap->sa_data[i] & 0377);
++ fprintf(stderr, "\n");
++ }
+
+ return (0);
+ }
+diff --git a/lib/ax25_gr.c b/lib/ax25_gr.c
+index 4dce92d..46a67ee 100644
+--- a/lib/ax25_gr.c
++++ b/lib/ax25_gr.c
+@@ -49,7 +49,8 @@ int AX25_rprint(int options)
+ }
+ printf(_("Kernel AX.25 routing table\n")); /* xxx */
+ printf(_("Destination Iface Use\n")); /* xxx */
+- fgets(buffer, 256, f);
++ if (fgets(buffer, 256, f))
++ /* eat line */;
+ while (fgets(buffer, 256, f)) {
+ buffer[9] = 0;
+ buffer[14] = 0;
+diff --git a/lib/ddp.c b/lib/ddp.c
+index 9b5e829..0a08fd2 100644
+--- a/lib/ddp.c
++++ b/lib/ddp.c
+@@ -32,7 +32,7 @@
+ #include "util.h"
+
+ /* Display a ddp domain address. */
+-static char *ddp_print(unsigned char *ptr)
++static const char *ddp_print(const char *ptr)
+ {
+ static char buff[64];
+ struct sockaddr_at *sat = (struct sockaddr_at *) (ptr - 2);
+@@ -42,7 +42,7 @@ static char *ddp_print(unsigned char *ptr)
+
+
+ /* Display a ddp domain address. */
+-static char *ddp_sprint(struct sockaddr *sap, int numeric)
++static const char *ddp_sprint(struct sockaddr *sap, int numeric)
+ {
+ static char buf[64];
+
+diff --git a/lib/ddp_gr.c b/lib/ddp_gr.c
+index 94169f0..d05c431 100644
+--- a/lib/ddp_gr.c
++++ b/lib/ddp_gr.c
+@@ -1,3 +1,20 @@
++/*
++ * lib/ddp_gr.c Prinbting of DDP (AppleTalk) routing table
++ * used by the NET-LIB.
++ *
++ * NET-LIB
++ *
++ * Version: $Id: ddp_gr.c,v 1.4 2002/06/02 05:25:15 ecki Exp $
++ *
++ * Author: Ajax <ajax@firest0rm.org>
++ *
++ * Modification:
++ * 2002-06-02 integrated into main source by Bernd Eckenfels
++ *
++ */
++
++/* TODO: name lookups (/etc/atalk.names? NBP?) */
++
+ #include "config.h"
+
+ #if HAVE_AFATALK
+@@ -16,9 +33,62 @@
+ #include "pathnames.h"
+ #include "intl.h"
+
++/* stolen from inet_gr.c */
++#define flags_decode(i,o) do { \
++ o[0] = '\0'; \
++ if (i & RTF_UP) strcat(o, "U"); \
++ if (i & RTF_GATEWAY) strcat(o, "G"); \
++ if (i & RTF_REJECT) strcat(o, "!"); \
++ if (i & RTF_HOST) strcat(o, "H"); \
++ if (i & RTF_REINSTATE) strcat(o, "R"); \
++ if (i & RTF_DYNAMIC) strcat(o, "D"); \
++ if (i & RTF_MODIFIED) strcat(o, "M"); \
++ if (i & RTF_DEFAULT) strcat(o, "d"); \
++ if (i & RTF_ALLONLINK) strcat(o, "a"); \
++ if (i & RTF_ADDRCONF) strcat(o, "c"); \
++ if (i & RTF_NONEXTHOP) strcat(o, "o"); \
++ if (i & RTF_EXPIRES) strcat(o, "e"); \
++ if (i & RTF_CACHE) strcat(o, "c"); \
++ if (i & RTF_FLOW) strcat(o, "f"); \
++ if (i & RTF_POLICY) strcat(o, "p"); \
++ if (i & RTF_LOCAL) strcat(o, "l"); \
++ if (i & RTF_MTU) strcat(o, "u"); \
++ if (i & RTF_WINDOW) strcat(o, "w"); \
++ if (i & RTF_IRTT) strcat(o, "i"); \
++ if (i & RTF_NOTCACHED) strcat(o, "n"); \
++ } while (0)
++
+ int DDP_rprint(int options)
+ {
+- fprintf(stderr, _("Routing table for `ddp' not yet supported.\n"));
+- return (1);
++ FILE *fp;
++ char *dest, *gw, *dev, *flags;
++ char oflags[32];
++ char *hdr = "Destination Gateway Device Flags";
++
++ fp = fopen(_PATH_PROCNET_ATALK_ROUTE, "r");
++
++ if (!fp) {
++ perror("Error opening " _PATH_PROCNET_ATALK_ROUTE);
++ fprintf(stderr, "DDP (AppleTalk) not configured on this system.\n");
++ return 1;
++ }
++
++ if (fscanf(fp, "%ms %ms %ms %ms\n", &dest, &gw, &flags, &dev))
++ /* eat line */;
++ free(dest); free(gw); free(flags); free(dev);
++
++ printf("%s\n", hdr);
++
++ while (fscanf(fp, "%ms %ms %ms %ms\n", &dest, &gw, &flags, &dev) == 4) {
++ int iflags = atoi(flags);
++ flags_decode(iflags, oflags);
++ printf("%-16s%-16s%-16s%-s\n", dest, gw, dev, oflags);
++ free(dest); free(gw); free(flags); free(dev);
++ }
++
++ fclose(fp);
++
++ return 0;
++
+ }
+ #endif
+diff --git a/lib/ec_hw.c b/lib/ec_hw.c
+index 825e501..088d125 100644
+--- a/lib/ec_hw.c
++++ b/lib/ec_hw.c
+@@ -2,7 +2,7 @@
+ * lib/ec_hw.c This file contains an implementation of the Econet
+ * hardware support functions.
+ *
+- * Version: $Id: ec_hw.c,v 1.2 1999/09/27 11:00:46 philip Exp $
++ * Version: $Id: ec_hw.c,v 1.3 2009/09/06 22:39:20 ecki Exp $
+ *
+ * Author: Philip Blundell <philb@gnu.org>
+ *
+@@ -16,6 +16,7 @@
+
+ #if HAVE_HWEC
+
++#include <stdlib.h>
+ #include <net/if_arp.h>
+ #include "net-support.h"
+
+diff --git a/lib/econet.c b/lib/econet.c
+index 1229a28..6cf8a9a 100644
+--- a/lib/econet.c
++++ b/lib/econet.c
+@@ -32,8 +32,8 @@
+
+
+ /* Display an Econet address */
+-static char *
+-ec_print(unsigned char *ptr)
++static const char *
++ec_print(const char *ptr)
+ {
+ static char buff[64];
+ struct ec_addr *ec = (struct ec_addr *) ptr;
+@@ -43,7 +43,7 @@ ec_print(unsigned char *ptr)
+
+
+ /* Display an Econet socket address */
+-static char *
++static const char *
+ ec_sprint(struct sockaddr *sap, int numeric)
+ {
+ struct sockaddr_ec *sec = (struct sockaddr_ec *) sap;
+@@ -51,10 +51,10 @@ ec_sprint(struct sockaddr *sap, int numeric)
+ if (sap->sa_family != AF_ECONET)
+ return _("[NONE SET]");
+
+- return ec_print((unsigned char *) &sec->addr);
++ return ec_print((const char *) &sec->addr);
+ }
+
+-static int
++static int
+ ec_input(int type, char *bufp, struct sockaddr *sap)
+ {
+ struct sockaddr_ec *sec = (struct sockaddr_ec *) sap;
+diff --git a/lib/ether.c b/lib/ether.c
+index a71aed7..dee9c73 100644
+--- a/lib/ether.c
++++ b/lib/ether.c
+@@ -2,7 +2,7 @@
+ * lib/ether.c This file contains an implementation of the "Ethernet"
+ * support functions.
+ *
+- * Version: $Id: ether.c,v 1.7 1999/09/27 11:00:47 philip Exp $
++ * Version: $Id: ether.c,v 1.8 2002/07/30 05:17:29 ecki Exp $
+ *
+ * Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+ * Copyright 1993 MicroWalt Corporation
+@@ -35,22 +35,27 @@ extern struct hwtype ether_hwtype;
+
+
+ /* Display an Ethernet address in readable format. */
+-static char *pr_ether(unsigned char *ptr)
++static const char *pr_ether(const char *ptr)
+ {
+ static char buff[64];
+
+- snprintf(buff, sizeof(buff), "%02X:%02X:%02X:%02X:%02X:%02X",
++ snprintf(buff, sizeof(buff), "%02x:%02x:%02x:%02x:%02x:%02x",
+ (ptr[0] & 0377), (ptr[1] & 0377), (ptr[2] & 0377),
+ (ptr[3] & 0377), (ptr[4] & 0377), (ptr[5] & 0377)
+ );
+ return (buff);
+ }
+
++#ifdef DEBUG
++#define _DEBUG 1
++#else
++#define _DEBUG 0
++#endif
+
+ /* Input an Ethernet address and convert to binary. */
+ static int in_ether(char *bufp, struct sockaddr *sap)
+ {
+- unsigned char *ptr;
++ char *ptr;
+ char c, *orig;
+ int i;
+ unsigned val;
+@@ -70,9 +75,8 @@ static int in_ether(char *bufp, struct sockaddr *sap)
+ else if (c >= 'A' && c <= 'F')
+ val = c - 'A' + 10;
+ else {
+-#ifdef DEBUG
+- fprintf(stderr, _("in_ether(%s): invalid ether address!\n"), orig);
+-#endif
++ if (_DEBUG)
++ fprintf(stderr, _("in_ether(%s): invalid ether address!\n"), orig);
+ errno = EINVAL;
+ return (-1);
+ }
+@@ -87,9 +91,8 @@ static int in_ether(char *bufp, struct sockaddr *sap)
+ else if (c == ':' || c == 0)
+ val >>= 4;
+ else {
+-#ifdef DEBUG
+- fprintf(stderr, _("in_ether(%s): invalid ether address!\n"), orig);
+-#endif
++ if (_DEBUG)
++ fprintf(stderr, _("in_ether(%s): invalid ether address!\n"), orig);
+ errno = EINVAL;
+ return (-1);
+ }
+@@ -100,28 +103,21 @@ static int in_ether(char *bufp, struct sockaddr *sap)
+
+ /* We might get a semicolon here - not required. */
+ if (*bufp == ':') {
+- if (i == ETH_ALEN) {
+-#ifdef DEBUG
++ if (_DEBUG && i == ETH_ALEN)
+ fprintf(stderr, _("in_ether(%s): trailing : ignored!\n"),
+- orig)
+-#endif
+- ; /* nothing */
+- }
++ orig);
+ bufp++;
+ }
+ }
+
+ /* That's it. Any trailing junk? */
+- if ((i == ETH_ALEN) && (*bufp != '\0')) {
+-#ifdef DEBUG
++ if (_DEBUG && (i == ETH_ALEN) && (*bufp != '\0')) {
+ fprintf(stderr, _("in_ether(%s): trailing junk!\n"), orig);
+ errno = EINVAL;
+ return (-1);
+-#endif
+ }
+-#ifdef DEBUG
+- fprintf(stderr, "in_ether(%s): %s\n", orig, pr_ether(sap->sa_data));
+-#endif
++ if (_DEBUG)
++ fprintf(stderr, "in_ether(%s): %s\n", orig, pr_ether(sap->sa_data));
+
+ return (0);
+ }
+diff --git a/lib/eui64.c b/lib/eui64.c
+new file mode 100644
+index 0000000..94831c0
+--- /dev/null
++++ b/lib/eui64.c
+@@ -0,0 +1,152 @@
++/*
++ * lib/eui64.c This file contains support for generic EUI-64 hw addressing
++ *
++ * Version: $Id: eui64.c,v 1.1 2001/11/12 02:12:05 ecki Exp $
++ *
++ * Author: Daniel Stodden <stodden@in.tum.de>
++ * Copyright 2001 Daniel Stodden
++ *
++ * blueprinted from ether.c
++ * Copyright 1993 MicroWalt Corporation
++ *
++ * This program is free software; you can redistribute it
++ * and/or modify it under the terms of the GNU General
++ * Public License as published by the Free Software
++ * Foundation; either version 2 of the License, or (at
++ * your option) any later version.
++ */
++#include "config.h"
++
++#if HAVE_HWEUI64
++
++#include <sys/types.h>
++#include <sys/ioctl.h>
++#include <sys/socket.h>
++#include <net/if_arp.h>
++#include <stdlib.h>
++#include <stdio.h>
++#include <ctype.h>
++#include <errno.h>
++#include <fcntl.h>
++#include <string.h>
++#include <termios.h>
++#include <unistd.h>
++#include "net-support.h"
++#include "pathnames.h"
++#include "intl.h"
++
++/*
++ * EUI-64 constants
++ */
++
++#define EUI64_ALEN 8
++
++#ifndef ARPHRD_EUI64
++#define ARPHRD_EUI64 27
++#warning "ARPHRD_EUI64 not defined in <net/if_arp.h>. Using private value 27"
++#endif
++
++struct hwtype eui64_hwtype;
++
++/* Display an EUI-64 address in readable format. */
++static const char *pr_eui64(const char *ptr)
++{
++ static char buff[64];
++
++ snprintf(buff, sizeof(buff), "%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X",
++ (ptr[0] & 0377), (ptr[1] & 0377), (ptr[2] & 0377), (ptr[3] & 0377),
++ (ptr[4] & 0377), (ptr[5] & 0377), (ptr[6] & 0377), (ptr[7] & 0377)
++ );
++ return (buff);
++}
++
++#ifdef DEBUG
++#define _DEBUG 1
++#else
++#define _DEBUG 0
++#endif
++
++/* Start the PPP encapsulation on the file descriptor. */
++static int in_eui64( char *bufp, struct sockaddr *sap )
++{
++ char *ptr;
++ char c, *orig;
++ int i;
++ unsigned val;
++
++ sap->sa_family = eui64_hwtype.type;
++ ptr = sap->sa_data;
++
++ i = 0;
++ orig = bufp;
++
++ while ((*bufp != '\0') && (i < EUI64_ALEN)) {
++ val = 0;
++ c = *bufp++;
++ if (isdigit(c))
++ val = c - '0';
++ else if (c >= 'a' && c <= 'f')
++ val = c - 'a' + 10;
++ else if (c >= 'A' && c <= 'F')
++ val = c - 'A' + 10;
++ else {
++ if (_DEBUG)
++ fprintf( stderr, _("in_eui64(%s): invalid eui64 address!\n"),
++ orig );
++ errno = EINVAL;
++ return (-1);
++ }
++
++ val <<= 4;
++ c = *bufp;
++ if (isdigit(c))
++ val |= c - '0';
++ else if (c >= 'a' && c <= 'f')
++ val |= c - 'a' + 10;
++ else if (c >= 'A' && c <= 'F')
++ val |= c - 'A' + 10;
++ else if (c == ':' || c == 0)
++ val >>= 4;
++ else {
++ if (_DEBUG)
++ fprintf( stderr, _("in_eui64(%s): invalid eui64 address!\n"),
++ orig );
++ errno = EINVAL;
++ return (-1);
++ }
++
++ if (c != 0)
++ bufp++;
++
++ *ptr++ = (unsigned char) (val & 0377);
++ i++;
++
++ /* We might get a semicolon here - not required. */
++ if (*bufp == ':') {
++ if (_DEBUG && i == EUI64_ALEN)
++ fprintf(stderr, _("in_eui64(%s): trailing : ignored!\n"),
++ orig);
++ bufp++;
++ }
++ }
++
++ /* That's it. Any trailing junk? */
++ if (_DEBUG && (i == EUI64_ALEN) && (*bufp != '\0')) {
++ fprintf(stderr, _("in_eui64(%s): trailing junk!\n"), orig);
++ errno = EINVAL;
++ return (-1);
++ }
++ if (_DEBUG)
++ fprintf(stderr, "in_eui64(%s): %s\n", orig, pr_eui64(sap->sa_data));
++
++ return (0);
++}
++
++struct hwtype eui64_hwtype =
++{
++ "eui64", NULL, /*"EUI-64 addressing", */ ARPHRD_EUI64, EUI64_ALEN,
++ pr_eui64, in_eui64, NULL, 0
++};
++
++
++#endif /* HAVE_EUI64 */
+diff --git a/lib/fddi.c b/lib/fddi.c
+index f6bf5ca..c18696e 100644
+--- a/lib/fddi.c
++++ b/lib/fddi.c
+@@ -46,7 +46,7 @@ extern struct hwtype fddi_hwtype;
+
+
+ /* Display an FDDI address in readable format. */
+-static char *pr_fddi(unsigned char *ptr)
++static const char *pr_fddi(const char *ptr)
+ {
+ static char buff[64];
+
+@@ -57,11 +57,16 @@ static char *pr_fddi(unsigned char *ptr)
+ return (buff);
+ }
+
++#ifdef DEBUG
++#define _DEBUG 1
++#else
++#define _DEBUG 0
++#endif
+
+ /* Input an FDDI address and convert to binary. */
+ static int in_fddi(char *bufp, struct sockaddr *sap)
+ {
+- unsigned char *ptr;
++ char *ptr;
+ char c, *orig;
+ int i, val;
+
+@@ -80,9 +85,8 @@ static int in_fddi(char *bufp, struct sockaddr *sap)
+ else if (c >= 'A' && c <= 'F')
+ val = c - 'A' + 10;
+ else {
+-#ifdef DEBUG
+- fprintf(stderr, _("in_fddi(%s): invalid fddi address!\n"), orig);
+-#endif
++ if (_DEBUG)
++ fprintf(stderr, _("in_fddi(%s): invalid fddi address!\n"), orig);
+ errno = EINVAL;
+ return (-1);
+ }
+@@ -95,9 +99,8 @@ static int in_fddi(char *bufp, struct sockaddr *sap)
+ else if (c >= 'A' && c <= 'F')
+ val |= c - 'A' + 10;
+ else {
+-#ifdef DEBUG
+- fprintf(stderr, _("in_fddi(%s): invalid fddi address!\n"), orig);
+-#endif
++ if (_DEBUG)
++ fprintf(stderr, _("in_fddi(%s): invalid fddi address!\n"), orig);
+ errno = EINVAL;
+ return (-1);
+ }
+@@ -106,28 +109,21 @@ static int in_fddi(char *bufp, struct sockaddr *sap)
+
+ /* We might get a semicolon here - not required. */
+ if (*bufp == ':') {
+- if (i == FDDI_K_ALEN) {
+-#ifdef DEBUG
++ if (_DEBUG && i == FDDI_K_ALEN)
+ fprintf(stderr, _("in_fddi(%s): trailing : ignored!\n"),
+- orig)
+-#endif
+- ; /* nothing */
+- }
++ orig);
+ bufp++;
+ }
+ }
+
+ /* That's it. Any trailing junk? */
+- if ((i == FDDI_K_ALEN) && (*bufp != '\0')) {
+-#ifdef DEBUG
++ if (_DEBUG && (i == FDDI_K_ALEN) && (*bufp != '\0')) {
+ fprintf(stderr, _("in_fddi(%s): trailing junk!\n"), orig);
+ errno = EINVAL;
+ return (-1);
+-#endif
+ }
+-#ifdef DEBUG
+- fprintf(stderr, "in_fddi(%s): %s\n", orig, pr_fddi(sap->sa_data));
+-#endif
++ if (_DEBUG)
++ fprintf(stderr, "in_fddi(%s): %s\n", orig, pr_fddi(sap->sa_data));
+
+ return (0);
+ }
+diff --git a/lib/frame.c b/lib/frame.c
+index 58d1ad4..ad265d6 100644
+--- a/lib/frame.c
++++ b/lib/frame.c
+@@ -37,7 +37,7 @@
+ #include "net-support.h"
+ #include "pathnames.h"
+
+-char *pr_dlci(unsigned char *ptr)
++static const char *pr_dlci(const char *ptr)
+ {
+ static char buf[12];
+
+diff --git a/lib/getargs.c b/lib/getargs.c
+index 4170097..6952777 100644
+--- a/lib/getargs.c
++++ b/lib/getargs.c
+@@ -24,12 +24,13 @@
+ #include <unistd.h>
+ #include "net-support.h"
+ #include "pathnames.h"
++#include "util.h"
+
+
+ /* Split the input string into multiple fields. */
+ int getargs(char *string, char *arguments[])
+ {
+- int len = strlen(string);
++ int len = strlen(string);
+ char temp[len+1];
+ char *sp, *ptr;
+ int i, argc;
+@@ -41,7 +42,7 @@ int getargs(char *string, char *arguments[])
+ */
+ sp = string;
+ i = 0;
+- strcpy(temp, string);
++ safe_strncpy(temp, string, sizeof(temp));
+ ptr = temp;
+
+ /*
+diff --git a/lib/hdlclapb.c b/lib/hdlclapb.c
+index c4ed074..b7d563e 100644
+--- a/lib/hdlclapb.c
++++ b/lib/hdlclapb.c
+@@ -1,11 +1,11 @@
+ /*
+- * lib/hdlclapb.c
++ * lib/hdlclapb.c
+ * This file contains the HDLC/LAPB support for the NET-2 base
+ * distribution.
+ *
+ * Version: $Id: hdlclapb.c,v 1.5 2000/03/05 11:26:02 philip Exp $
+ *
+- * Original Author:
++ * Original Author:
+ * Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+ * Copyright 1993 MicroWalt Corporation
+ *
+diff --git a/lib/hippi.c b/lib/hippi.c
+index 308db00..43e7a79 100644
+--- a/lib/hippi.c
++++ b/lib/hippi.c
+@@ -46,7 +46,7 @@ extern struct hwtype hippi_hwtype;
+
+
+ /* Display an HIPPI address in readable format. */
+-static char *pr_hippi(unsigned char *ptr)
++static const char *pr_hippi(const char *ptr)
+ {
+ static char buff[64];
+
+@@ -57,11 +57,16 @@ static char *pr_hippi(unsigned char *ptr)
+ return (buff);
+ }
+
++#ifdef DEBUG
++#define _DEBUG 1
++#else
++#define _DEBUG 0
++#endif
+
+ /* Input an HIPPI address and convert to binary. */
+ static int in_hippi(char *bufp, struct sockaddr *sap)
+ {
+- unsigned char *ptr;
++ char *ptr;
+ char c, *orig;
+ int i, val;
+
+@@ -80,9 +85,8 @@ static int in_hippi(char *bufp, struct sockaddr *sap)
+ else if (c >= 'A' && c <= 'F')
+ val = c - 'A' + 10;
+ else {
+-#ifdef DEBUG
+- fprintf(stderr, _("in_hippi(%s): invalid hippi address!\n"), orig);
+-#endif
++ if (_DEBUG)
++ fprintf(stderr, _("in_hippi(%s): invalid hippi address!\n"), orig);
+ errno = EINVAL;
+ return (-1);
+ }
+@@ -95,9 +99,8 @@ static int in_hippi(char *bufp, struct sockaddr *sap)
+ else if (c >= 'A' && c <= 'F')
+ val |= c - 'A' + 10;
+ else {
+-#ifdef DEBUG
+- fprintf(stderr, _("in_hippi(%s): invalid hippi address!\n"), orig);
+-#endif
++ if (_DEBUG)
++ fprintf(stderr, _("in_hippi(%s): invalid hippi address!\n"), orig);
+ errno = EINVAL;
+ return (-1);
+ }
+@@ -106,27 +109,20 @@ static int in_hippi(char *bufp, struct sockaddr *sap)
+
+ /* We might get a semicolon here - not required. */
+ if (*bufp == ':') {
+- if (i == HIPPI_ALEN) {
+-#ifdef DEBUG
+- fprintf(stderr, _("in_hippi(%s): trailing : ignored!\n"), orig)
+-#endif
+- ; /* nothing */
+- }
++ if (_DEBUG && i == HIPPI_ALEN)
++ fprintf(stderr, _("in_hippi(%s): trailing : ignored!\n"), orig);
+ bufp++;
+ }
+ }
+
+ /* That's it. Any trailing junk? */
+- if ((i == HIPPI_ALEN) && (*bufp != '\0')) {
+-#ifdef DEBUG
++ if (_DEBUG && (i == HIPPI_ALEN) && (*bufp != '\0')) {
+ fprintf(stderr, _("in_hippi(%s): trailing junk!\n"), orig);
+ errno = EINVAL;
+ return (-1);
+-#endif
+ }
+-#ifdef DEBUG
+- fprintf(stderr, "in_hippi(%s): %s\n", orig, pr_hippi(sap->sa_data));
+-#endif
++ if (_DEBUG)
++ fprintf(stderr, "in_hippi(%s): %s\n", orig, pr_hippi(sap->sa_data));
+
+ return (0);
+ }
+diff --git a/lib/hw.c b/lib/hw.c
+index 4989748..71dfcf9 100644
+--- a/lib/hw.c
++++ b/lib/hw.c
+@@ -2,7 +2,7 @@
+ * lib/hw.c This file contains the top-level part of the hardware
+ * support functions module.
+ *
+- * Version: $Id: hw.c,v 1.17 2000/05/20 13:38:10 pb Exp $
++ * Version: $Id: hw.c,v 1.19 2008/10/03 01:52:04 ecki Exp $
+ *
+ * Maintainer: Bernd 'eckes' Eckenfels, <net-tools@lina.inka.de>
+ *
+@@ -73,6 +73,10 @@ extern struct hwtype irda_hwtype;
+
+ extern struct hwtype ec_hwtype;
+
++extern struct hwtype ib_hwtype;
++
++extern struct hwtype eui64_hwtype;
++
+ static struct hwtype *hwtypes[] =
+ {
+
+@@ -97,7 +101,7 @@ static struct hwtype *hwtypes[] =
+ #if HAVE_HWTR
+ &tr_hwtype,
+ #ifdef ARPHRD_IEEE802_TR
+- &tr_hwtype1,
++ &tr_hwtype1,
+ #endif
+ #endif
+ #if HAVE_HWAX25
+@@ -144,6 +148,12 @@ static struct hwtype *hwtypes[] =
+ #if HAVE_HWX25
+ &x25_hwtype,
+ #endif
++#if HAVE_HWIB
++ &ib_hwtype,
++#endif
++#if HAVE_HWEUI64
++ &eui64_hwtype,
++#endif
+ &unspec_hwtype,
+ NULL
+ };
+@@ -211,12 +221,18 @@ void hwinit()
+ #if HAVE_HWTR
+ tr_hwtype.title = _("16/4 Mbps Token Ring");
+ #ifdef ARPHRD_IEEE802_TR
+- tr_hwtype1.title = _("16/4 Mbps Token Ring (New)") ;
++ tr_hwtype1.title = _("16/4 Mbps Token Ring (New)") ;
+ #endif
+ #endif
+ #if HAVE_HWEC
+ ec_hwtype.title = _("Econet");
+ #endif
++#if HAVE_HWIB
++ ib_hwtype.title = _("InfiniBand");
++#endif
++#if HAVE_HWEUI64
++ eui64_hwtype.title = _("Generic EUI-64");
++#endif
+ sVhwinit = 1;
+ }
+
+@@ -269,7 +285,7 @@ void print_hwlist(int type) {
+ if (((type == 1) && ((*hwp)->alen == 0)) || ((*hwp)->type == -1)) {
+ hwp++; continue;
+ }
+- if ((count % 3) == 0) fprintf(stderr,count?"\n ":" ");
++ if ((count % 3) == 0) fprintf(stderr,count?"\n ":" ");
+ txt = (*hwp)->name; if (!txt) txt = "..";
+ fprintf(stderr,"%s (%s) ",txt,(*hwp)->title);
+ count++;
+diff --git a/lib/ib.c b/lib/ib.c
+new file mode 100644
+index 0000000..1eeb7f0
+--- /dev/null
++++ b/lib/ib.c
+@@ -0,0 +1,151 @@
++/*
++ * lib/ib.c This file contains an implementation of the "Infiniband"
++ * support functions.
++ *
++ * Version: $Id: ib.c,v 1.1 2008/10/03 01:52:03 ecki Exp $
++ *
++ * Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
++ * Copyright 1993 MicroWalt Corporation
++ * Tom Duffy <tduffy@sun.com>
++ *
++ * This program is free software; you can redistribute it
++ * and/or modify it under the terms of the GNU General
++ * Public License as published by the Free Software
++ * Foundation; either version 2 of the License, or (at
++ * your option) any later version.
++ */
++#include "config.h"
++
++#if HAVE_HWIB
++#include <sys/types.h>
++#include <sys/socket.h>
++#include <net/if_arp.h>
++#include <linux/if_infiniband.h>
++#include <stdlib.h>
++#include <stdio.h>
++#include <errno.h>
++#include <ctype.h>
++#include <string.h>
++#include <unistd.h>
++#include "net-support.h"
++#include "pathnames.h"
++#include "intl.h"
++#include "util.h"
++
++extern struct hwtype ib_hwtype;
++
++
++/* Display an InfiniBand address in readable format. */
++static const char *pr_ib(const char *ptr)
++{
++ static char buff[128];
++ char *pos;
++ unsigned int i;
++
++ pos = buff;
++ for (i = 0; i < INFINIBAND_ALEN; i++) {
++ pos += sprintf(pos, "%02X:", (*ptr++ & 0377));
++ }
++ buff[strlen(buff) - 1] = '\0';
++ fprintf(stderr, _("Infiniband hardware address can be incorrect! Please read BUGS section in ifconfig(8).\n"));
++ /* snprintf(buff, sizeof(buff), "%02X:%02X:%02X:%02X:%02X:%02X",
++ (ptr[0] & 0377), (ptr[1] & 0377), (ptr[2] & 0377),
++ (ptr[3] & 0377), (ptr[4] & 0377), (ptr[5] & 0377)
++ );
++ */
++ return (buff);
++}
++
++#ifdef DEBUG
++#define _DEBUG 1
++#else
++#define _DEBUG 0
++#endif
++
++/* Input an Infiniband address and convert to binary. */
++static int in_ib(char *bufp, struct sockaddr *sap)
++{
++ char *ptr;
++ char c, *orig;
++ int i;
++ unsigned val;
++
++ sap->sa_family = ib_hwtype.type;
++ ptr = sap->sa_data;
++
++ i = 0;
++ orig = bufp;
++ while ((*bufp != '\0') && (i < INFINIBAND_ALEN)) {
++ val = 0;
++ c = *bufp++;
++ if (isdigit(c))
++ val = c - '0';
++ else if (c >= 'a' && c <= 'f')
++ val = c - 'a' + 10;
++ else if (c >= 'A' && c <= 'F')
++ val = c - 'A' + 10;
++ else {
++ if (_DEBUG)
++ fprintf(stderr, _("in_ib(%s): invalid infiniband address!\n"), orig);
++ errno = EINVAL;
++ return (-1);
++ }
++ val <<= 4;
++ c = *bufp;
++ if (isdigit(c))
++ val |= c - '0';
++ else if (c >= 'a' && c <= 'f')
++ val |= c - 'a' + 10;
++ else if (c >= 'A' && c <= 'F')
++ val |= c - 'A' + 10;
++ else if (c == ':' || c == 0)
++ val >>= 4;
++ else {
++#ifdef DEBUG
++ fprintf(stderr, _("in_ib(%s): invalid infiniband address!\n"), orig);
++#endif
++ errno = EINVAL;
++ return (-1);
++ }
++ if (c != 0)
++ bufp++;
++ *ptr++ = (unsigned char) (val & 0377);
++ i++;
++
++ /* We might get a semicolon here - not required. */
++ if (*bufp == ':') {
++ if (i == INFINIBAND_ALEN) {
++#ifdef DEBUG
++ fprintf(stderr, _("in_ib(%s): trailing : ignored!\n"),
++ orig)
++#endif
++ ; /* nothing */
++ }
++ bufp++;
++ }
++ }
++
++ /* That's it. Any trailing junk? */
++ if ((i == INFINIBAND_ALEN) && (*bufp != '\0')) {
++#ifdef DEBUG
++ fprintf(stderr, _("in_ib(%s): trailing junk!\n"), orig);
++ errno = EINVAL;
++ return (-1);
++#endif
++ }
++#ifdef DEBUG
++ fprintf(stderr, "in_ib(%s): %s\n", orig, pr_ib(sap->sa_data));
++#endif
++
++ return (0);
++}
++
++
++struct hwtype ib_hwtype =
++{
++ "infiniband", NULL, ARPHRD_INFINIBAND, INFINIBAND_ALEN,
++ pr_ib, in_ib, NULL
++};
++
++
++#endif /* HAVE_HWIB */
+diff --git a/lib/inet.c b/lib/inet.c
+index ae90664..fc23b17 100644
+--- a/lib/inet.c
++++ b/lib/inet.c
+@@ -3,7 +3,7 @@
+ * support functions for the net-tools.
+ * (NET-3 base distribution).
+ *
+- * Version: $Id: inet.c,v 1.13 1999/12/11 13:35:56 freitag Exp $
++ * Version: $Id: inet.c,v 1.14 2003/10/19 11:57:37 pb Exp $
+ *
+ * Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+ * Copyright 1993 MicroWalt Corporation
+@@ -14,11 +14,11 @@
+ *960203 {1.23} Bernd Eckenfels : net-features support
+ *960217 {1.24} Bernd Eckenfels : get_sname
+ *960219 {1.25} Bernd Eckenfels : extern int h_errno
+- *960329 {1.26} Bernd Eckenfels : resolve 255.255.255.255
++ *960329 {1.26} Bernd Eckenfels : resolve 255.255.255.255
+ *980101 {1.27} Bernd Eckenfels : resolve raw sockets in /etc/protocols
+ *990302 {1.28} Phil Blundell : add netmask to INET_rresolve
+ *991007 Kurt Garloff : rresolve, resolve: may be hosts
+- * <garloff@suse.de> store type (host?) in cache
++ * <garloff@suse.de> store type (host?) in cache
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU General
+@@ -96,9 +96,9 @@ static int INET_resolve(char *name, struct sockaddr_in *sin, int hostfirst)
+ #ifdef DEBUG
+ if (hostfirst) fprintf (stderr, "gethostbyname (%s)\n", name);
+ #endif
+- if (hostfirst &&
++ if (hostfirst &&
+ (hp = gethostbyname(name)) != (struct hostent *) NULL) {
+- memcpy((char *) &sin->sin_addr, (char *) hp->h_addr_list[0],
++ memcpy((char *) &sin->sin_addr, (char *) hp->h_addr_list[0],
+ sizeof(struct in_addr));
+ return 0;
+ }
+@@ -127,24 +127,24 @@ static int INET_resolve(char *name, struct sockaddr_in *sin, int hostfirst)
+ errno = h_errno;
+ return -1;
+ }
+- memcpy((char *) &sin->sin_addr, (char *) hp->h_addr_list[0],
++ memcpy((char *) &sin->sin_addr, (char *) hp->h_addr_list[0],
+ sizeof(struct in_addr));
+
+ return 0;
+ }
+
+
+-/* numeric: & 0x8000: default instead of *,
+- * & 0x4000: host instead of net,
++/* numeric: & 0x8000: default instead of *,
++ * & 0x4000: host instead of net,
+ * & 0x0fff: don't resolve
+ */
+-static int INET_rresolve(char *name, size_t len, struct sockaddr_in *sin,
++static int INET_rresolve(char *name, size_t len, struct sockaddr_in *sin,
+ int numeric, unsigned int netmask)
+ {
+ struct hostent *ent;
+ struct netent *np;
+ struct addr *pn;
+- unsigned long ad, host_ad;
++ u_int32_t ad, host_ad;
+ int host = 0;
+
+ /* Grmpf. -FvK */
+@@ -155,24 +155,34 @@ static int INET_rresolve(char *name, size_t len, struct sockaddr_in *sin,
+ errno = EAFNOSUPPORT;
+ return (-1);
+ }
+- ad = (unsigned long) sin->sin_addr.s_addr;
++ ad = sin->sin_addr.s_addr;
+ #ifdef DEBUG
+- fprintf (stderr, "rresolve: %08lx, mask %08x, num %08x \n", ad, netmask, numeric);
++ fprintf (stderr, "rresolve: %08lx, mask %08x, num %08x, len %d\n", ad, netmask, numeric, len);
+ #endif
++
++ // if no symbolic names are requested we shortcut with ntoa
++ if (numeric & 0x0FFF) {
++ safe_strncpy(name, inet_ntoa(sin->sin_addr), len);
++ return (0);
++ }
++
++ // we skip getnetbyaddr for 0.0.0.0/0 and 0.0.0.0/~0
+ if (ad == INADDR_ANY) {
+- if ((numeric & 0x0FFF) == 0) {
++ if (netmask == INADDR_ANY) {
++ // for 0.0.0.0/0 we hardcode symbolic name
+ if (numeric & 0x8000)
+ safe_strncpy(name, "default", len);
+ else
+ safe_strncpy(name, "*", len);
+ return (0);
++ } else {
++ // for 0.0.0.0/1 we skip getnetbyname()
++ safe_strncpy(name, "0.0.0.0", len);
++ return (0);
+ }
+ }
+- if (numeric & 0x0FFF) {
+- safe_strncpy(name, inet_ntoa(sin->sin_addr), len);
+- return (0);
+- }
+
++ // it is a host address if flagged or any host bits set
+ if ((ad & (~netmask)) != 0 || (numeric & 0x4000))
+ host = 1;
+ #if 0
+@@ -183,7 +193,7 @@ static int INET_rresolve(char *name, size_t len, struct sockaddr_in *sin,
+ if (pn->addr.sin_addr.s_addr == ad && pn->host == host) {
+ safe_strncpy(name, pn->name, len);
+ #ifdef DEBUG
+- fprintf (stderr, "rresolve: found %s %08lx in cache\n", (host? "host": "net"), ad);
++ fprintf (stderr, "rresolve: found %s %08lx in cache (name=%s, len=%d)\n", (host? "host": "net"), ad, name, len);
+ #endif
+ return (0);
+ }
+@@ -210,12 +220,11 @@ static int INET_rresolve(char *name, size_t len, struct sockaddr_in *sin,
+ }
+ if ((ent == NULL) && (np == NULL))
+ safe_strncpy(name, inet_ntoa(sin->sin_addr), len);
+- pn = (struct addr *) malloc(sizeof(struct addr));
++ pn = (struct addr *) xmalloc(sizeof(struct addr));
+ pn->addr = *sin;
+ pn->next = INET_nn;
+ pn->host = host;
+- pn->name = (char *) malloc(strlen(name) + 1);
+- strcpy(pn->name, name);
++ pn->name = xstrdup(name);
+ INET_nn = pn;
+
+ return (0);
+@@ -229,35 +238,35 @@ static void INET_reserror(char *text)
+
+
+ /* Display an Internet socket address. */
+-static char *INET_print(unsigned char *ptr)
++static const char *INET_print(const char *ptr)
+ {
+ return (inet_ntoa((*(struct in_addr *) ptr)));
+ }
+
+
+ /* Display an Internet socket address. */
+-static char *INET_sprint(struct sockaddr *sap, int numeric)
++static const char *INET_sprint(struct sockaddr *sap, int numeric)
+ {
+ static char buff[128];
+
+ if (sap->sa_family == 0xFFFF || sap->sa_family == 0)
+ return safe_strncpy(buff, _("[NONE SET]"), sizeof(buff));
+
+- if (INET_rresolve(buff, sizeof(buff), (struct sockaddr_in *) sap,
++ if (INET_rresolve(buff, sizeof(buff), (struct sockaddr_in *) sap,
+ numeric, 0xffffff00) != 0)
+ return (NULL);
+
+ return (buff);
+ }
+
+-char *INET_sprintmask(struct sockaddr *sap, int numeric,
++char *INET_sprintmask(struct sockaddr *sap, int numeric,
+ unsigned int netmask)
+ {
+ static char buff[128];
+
+ if (sap->sa_family == 0xFFFF || sap->sa_family == 0)
+ return safe_strncpy(buff, _("[NONE SET]"), sizeof(buff));
+- if (INET_rresolve(buff, sizeof(buff), (struct sockaddr_in *) sap,
++ if (INET_rresolve(buff, sizeof(buff), (struct sockaddr_in *) sap,
+ numeric, netmask) != 0)
+ return (NULL);
+ return (buff);
+@@ -385,10 +394,8 @@ static int read_services(void)
+ setservent(1);
+ while ((se = getservent())) {
+ /* Allocate a service entry. */
+- item = (struct service *) malloc(sizeof(struct service));
+- if (item == NULL)
+- perror("netstat");
+- item->name = strdup(se->s_name);
++ item = (struct service *) xmalloc(sizeof(struct service));
++ item->name = xstrdup(se->s_name);
+ item->number = se->s_port;
+
+ /* Fill it in. */
+@@ -398,16 +405,17 @@ static int read_services(void)
+ add2list(&udp_name, item);
+ } else if (!strcmp(se->s_proto, "raw")) {
+ add2list(&raw_name, item);
++ } else { /* sctp, ddp, dccp */
++ free(item->name);
++ free(item);
+ }
+ }
+ endservent();
+ setprotoent(1);
+ while ((pe = getprotoent())) {
+ /* Allocate a service entry. */
+- item = (struct service *) malloc(sizeof(struct service));
+- if (item == NULL)
+- perror("netstat");
+- item->name = strdup(pe->p_name);
++ item = (struct service *) xmalloc(sizeof(struct service));
++ item->name = xstrdup(pe->p_name);
+ item->number = htons(pe->p_proto);
+ add2list(&raw_name, item);
+ }
+@@ -416,35 +424,38 @@ static int read_services(void)
+ }
+
+
+-char *get_sname(int socknumber, char *proto, int numeric)
++const char *get_sname(int socknumber, const char *proto, int numeric)
+ {
+ static char buffer[64], init = 0;
+ struct service *item;
+
+ if (socknumber == 0)
+ return ("*");
+- if (numeric) {
+- sprintf(buffer, "%d", ntohs(socknumber));
+- return (buffer);
+- }
++ if (numeric)
++ goto do_ntohs;
++
+ if (!init) {
+ (void) read_services();
+ init = 1;
+ }
+ buffer[0] = '\0';
+- if (!strcmp(proto, "tcp")) {
+- if ((item = searchlist(tcp_name, socknumber)) != NULL)
+- sprintf(buffer, "%s", item->name);
+- } else if (!strcmp(proto, "udp")) {
+- if ((item = searchlist(udp_name, socknumber)) != NULL)
+- sprintf(buffer, "%s", item->name);
+- } else if (!strcmp(proto, "raw")) {
+- if ((item = searchlist(raw_name, socknumber)) != NULL)
+- sprintf(buffer, "%s", item->name);
+-
++ if (!strcmp(proto, "tcp"))
++ item = searchlist(tcp_name, socknumber);
++ else if (!strcmp(proto, "udp"))
++ item = searchlist(udp_name, socknumber);
++ else if (!strcmp(proto, "raw"))
++ item = searchlist(raw_name, socknumber);
++ else
++ item = NULL;
++ if (item) {
++ strncpy(buffer, item->name, sizeof(buffer));
++ buffer[sizeof(buffer) - 1] = '\0';
+ }
+- if (!buffer[0])
++
++ if (!buffer[0]) {
++ do_ntohs:
+ sprintf(buffer, "%d", ntohs(socknumber));
++ }
+ return (buffer);
+ }
+
+diff --git a/lib/inet6.c b/lib/inet6.c
+index 1f936b3..b428d07 100644
+--- a/lib/inet6.c
++++ b/lib/inet6.c
+@@ -3,7 +3,7 @@
+ * support functions for the net-tools.
+ * (most of it copied from lib/inet.c 1.26).
+ *
+- * Version: $Id: inet6.c,v 1.10 2000/10/28 11:04:00 pb Exp $
++ * Version: $Id: inet6.c,v 1.13 2010-07-05 22:52:00 ecki Exp $
+ *
+ * Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+ * Copyright 1993 MicroWalt Corporation
+@@ -44,6 +44,21 @@
+
+ extern int h_errno; /* some netdb.h versions don't export this */
+
++char * fix_v4_address(char *buf, struct in6_addr *in6)
++{
++ if (IN6_IS_ADDR_V4MAPPED(in6->s6_addr)) {
++ char *s =strchr(buf, '.');
++ if (s) {
++ while (s > buf && *s != ':')
++ --s;
++ if (*s == ':') ++s;
++ else s = NULL;
++ }
++ if (s) return s;
++ }
++ return buf;
++}
++
+ static int INET6_resolve(char *name, struct sockaddr_in6 *sin6)
+ {
+ struct addrinfo req, *ai;
+@@ -69,10 +84,9 @@ static int INET6_resolve(char *name, struct sockaddr_in6 *sin6)
+ #endif
+
+
+-static int INET6_rresolve(char *name, struct sockaddr_in6 *sin6, int numeric)
++static int INET6_rresolve(char *name, size_t namelen,
++ struct sockaddr_in6 *sin6, int numeric)
+ {
+- int s;
+-
+ /* Grmpf. -FvK */
+ if (sin6->sin6_family != AF_INET6) {
+ #ifdef DEBUG
+@@ -83,21 +97,20 @@ static int INET6_rresolve(char *name, struct sockaddr_in6 *sin6, int numeric)
+ return (-1);
+ }
+ if (numeric & 0x7FFF) {
+- inet_ntop(AF_INET6, &sin6->sin6_addr, name, 80);
++ inet_ntop( AF_INET6, &sin6->sin6_addr, name, namelen);
+ return (0);
+ }
+ if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) {
+ if (numeric & 0x8000)
+- strcpy(name, "default");
++ safe_strncpy(name, "default", namelen);
+ else
+- strcpy(name, "*");
++ safe_strncpy(name, "[::]", namelen);
+ return (0);
+ }
+
+- if ((s = getnameinfo((struct sockaddr *) sin6, sizeof(struct sockaddr_in6),
+- name, 255 /* !! */ , NULL, 0, 0))) {
+- fputs("getnameinfo failed\n", stderr);
+- return -1;
++ if (getnameinfo((struct sockaddr *) sin6, sizeof(struct sockaddr_in6),
++ name, namelen , NULL, 0, 0)) {
++ inet_ntop( AF_INET6, &sin6->sin6_addr, name, namelen);
+ }
+ return (0);
+ }
+@@ -109,41 +122,48 @@ static void INET6_reserror(char *text)
+ }
+
+
++
+ /* Display an Internet socket address. */
+-static char *INET6_print(unsigned char *ptr)
++static const char *INET6_print(const char *ptr)
+ {
+ static char name[80];
+
+ inet_ntop(AF_INET6, (struct in6_addr *) ptr, name, 80);
+- return name;
++ return fix_v4_address(name, (struct in6_addr *)ptr);
+ }
+
+
+ /* Display an Internet socket address. */
+ /* dirty! struct sockaddr usually doesn't suffer for inet6 addresses, fst. */
+-static char *INET6_sprint(struct sockaddr *sap, int numeric)
++static const char *INET6_sprint(struct sockaddr *sap, int numeric)
+ {
+ static char buff[128];
+
+ if (sap->sa_family == 0xFFFF || sap->sa_family == 0)
+ return safe_strncpy(buff, _("[NONE SET]"), sizeof(buff));
+- if (INET6_rresolve(buff, (struct sockaddr_in6 *) sap, numeric) != 0)
++ if (INET6_rresolve(buff, sizeof(buff),
++ (struct sockaddr_in6 *) sap, numeric) != 0)
+ return safe_strncpy(buff, _("[UNKNOWN]"), sizeof(buff));
+- return (buff);
++ return (fix_v4_address(buff, &((struct sockaddr_in6 *)sap)->sin6_addr));
+ }
+
+
+ static int INET6_getsock(char *bufp, struct sockaddr *sap)
+ {
+ struct sockaddr_in6 *sin6;
++ char *p;
+
+ sin6 = (struct sockaddr_in6 *) sap;
+ sin6->sin6_family = AF_INET6;
+ sin6->sin6_port = 0;
++ sin6->sin6_scope_id = 0;
++ sin6->sin6_flowinfo = 0;
+
+ if (inet_pton(AF_INET6, bufp, sin6->sin6_addr.s6_addr) <= 0)
+ return (-1);
+-
++ p = fix_v4_address(bufp, &sin6->sin6_addr);
++ if (p != bufp)
++ memcpy(bufp, p, strlen(p)+1);
+ return 16; /* ?;) */
+ }
+
+diff --git a/lib/inet6_gr.c b/lib/inet6_gr.c
+index 14f32eb..72b4a66 100644
+--- a/lib/inet6_gr.c
++++ b/lib/inet6_gr.c
+@@ -1,4 +1,4 @@
+-/*
++ /*
+ Modifications:
+ 1998-07-01 - Arnaldo Carvalho de Melo - GNU gettext instead of catgets,
+ snprintf instead of sprintf
+@@ -31,6 +31,7 @@
+ #include "pathnames.h"
+ #include "intl.h"
+ #include "net-features.h"
++#include "util.h"
+
+ /* neighbour discovery from linux-2.4.0/include/net/neighbour.h */
+
+@@ -63,7 +64,7 @@ int rprint_fib6(int ext, int numeric)
+ struct sockaddr_in6 saddr6, snaddr6;
+ int num, iflags, metric, refcnt, use, prefix_len, slen;
+ FILE *fp = fopen(_PATH_PROCNET_ROUTE6, "r");
+-
++
+ char addr6p[8][5], saddr6p[8][5], naddr6p[8][5];
+
+ if (!fp) {
+@@ -71,14 +72,18 @@ int rprint_fib6(int ext, int numeric)
+ printf(_("INET6 (IPv6) not configured in this system.\n"));
+ return 1;
+ }
+- printf(_("Kernel IPv6 routing table\n"));
+
+- printf(_("Destination "
+- "Next Hop "
+- "Flags Metric Ref Use Iface\n"));
++ if (numeric & RTF_CACHE)
++ printf(_("Kernel IPv6 routing cache\n"));
++ else
++ printf(_("Kernel IPv6 routing table\n"));
++
++ printf(_("Destination "
++ "Next Hop "
++ "Flag Met Ref Use If\n"));
+
+ while (fgets(buff, 1023, fp)) {
+- num = sscanf(buff, "%4s%4s%4s%4s%4s%4s%4s%4s %02x %4s%4s%4s%4s%4s%4s%4s%4s %02x %4s%4s%4s%4s%4s%4s%4s%4s %08x %08x %08x %08x %s\n",
++ num = sscanf(buff, "%4s%4s%4s%4s%4s%4s%4s%4s %02x %4s%4s%4s%4s%4s%4s%4s%4s %02x %4s%4s%4s%4s%4s%4s%4s%4s %08x %08x %08x %08x %15s\n",
+ addr6p[0], addr6p[1], addr6p[2], addr6p[3],
+ addr6p[4], addr6p[5], addr6p[6], addr6p[7],
+ &prefix_len,
+@@ -87,20 +92,24 @@ int rprint_fib6(int ext, int numeric)
+ &slen,
+ naddr6p[0], naddr6p[1], naddr6p[2], naddr6p[3],
+ naddr6p[4], naddr6p[5], naddr6p[6], naddr6p[7],
+- &metric, &use, &refcnt, &iflags, iface);
+-#if 0
+- if (num < 23)
+- continue;
+-#endif
+- if (!(iflags & RTF_UP))
++ &metric, &refcnt, &use, &iflags, iface);
++ if (0 && num < 23)
+ continue;
++ if (iflags & RTF_CACHE) {
++ if (!(numeric & RTF_CACHE))
++ continue;
++ } else {
++ if (numeric & RTF_CACHE)
++ continue;
++ }
++
+ /* Fetch and resolve the target address. */
+ snprintf(addr6, sizeof(addr6), "%s:%s:%s:%s:%s:%s:%s:%s",
+ addr6p[0], addr6p[1], addr6p[2], addr6p[3],
+ addr6p[4], addr6p[5], addr6p[6], addr6p[7]);
+ inet6_aftype.input(1, addr6, (struct sockaddr *) &saddr6);
+ snprintf(addr6, sizeof(addr6), "%s/%d",
+- inet6_aftype.sprint((struct sockaddr *) &saddr6, 1),
++ inet6_aftype.sprint((struct sockaddr *) &saddr6, numeric),
+ prefix_len);
+
+ /* Fetch and resolve the nexthop address. */
+@@ -109,10 +118,15 @@ int rprint_fib6(int ext, int numeric)
+ naddr6p[4], naddr6p[5], naddr6p[6], naddr6p[7]);
+ inet6_aftype.input(1, naddr6, (struct sockaddr *) &snaddr6);
+ snprintf(naddr6, sizeof(naddr6), "%s",
+- inet6_aftype.sprint((struct sockaddr *) &snaddr6, 1));
++ inet6_aftype.sprint((struct sockaddr *) &snaddr6, numeric));
+
+ /* Decode the flags. */
+- strcpy(flags, "U");
++
++ flags[0]=0;
++ if (iflags & RTF_UP)
++ strcat(flags, "U");
++ if (iflags & RTF_REJECT)
++ strcat(flags, "!");
+ if (iflags & RTF_GATEWAY)
+ strcat(flags, "G");
+ if (iflags & RTF_HOST)
+@@ -123,9 +137,19 @@ int rprint_fib6(int ext, int numeric)
+ strcat(flags, "A");
+ if (iflags & RTF_CACHE)
+ strcat(flags, "C");
++ if (iflags & RTF_ALLONLINK)
++ strcat(flags, "a");
++ if (iflags & RTF_EXPIRES)
++ strcat(flags, "e");
++ if (iflags & RTF_MODIFIED)
++ strcat(flags, "m");
++ if (iflags & RTF_NONEXTHOP)
++ strcat(flags, "n");
++ if (iflags & RTF_FLOW)
++ strcat(flags, "f");
+
+ /* Print the info. */
+- printf("%-43s %-39s %-5s %-6d %-2d %7d %-8s\n",
++ printf("%-30s %-26s %-4s %-3d %-1d%6d %s\n",
+ addr6, naddr6, flags, metric, refcnt, use, iface);
+ }
+
+@@ -138,14 +162,13 @@ int rprint_cache6(int ext, int numeric)
+ char buff[4096], iface[16], flags[16];
+ char addr6[128], haddr[20], statestr[20];
+ struct sockaddr_in6 saddr6;
+- int type, num, refcnt, prefix_len, location, state, gc;
++ int type, refcnt, prefix_len, location, state, gc;
+ long tstamp, expire, ndflags, reachable, stale, delete;
+ FILE *fp = fopen(_PATH_PROCNET_NDISC, "r");
+ char addr6p[8][5], haddrp[6][3];
+
+ if (!fp) {
+- ESYSNOT("nd_print", "ND Table");
+- return 1;
++ return rprint_fib6(ext, numeric | RTF_CACHE);
+ }
+ printf(_("Kernel IPv6 Neighbour Cache\n"));
+
+@@ -160,7 +183,7 @@ int rprint_cache6(int ext, int numeric)
+
+
+ while (fgets(buff, 1023, fp)) {
+- num = sscanf(buff, "%4s%4s%4s%4s%4s%4s%4s%4s %02x %02x %02x %02x %08lx %08lx %08lx %04x %04x %04lx %8s %2s%2s%2s%2s%2s%2s\n",
++ sscanf(buff, "%4s%4s%4s%4s%4s%4s%4s%4s %02x %02x %02x %02x %08lx %08lx %08lx %04x %04x %04lx %8s %2s%2s%2s%2s%2s%2s\n",
+ addr6p[0], addr6p[1], addr6p[2], addr6p[3],
+ addr6p[4], addr6p[5], addr6p[6], addr6p[7],
+ &location, &prefix_len, &type, &state, &expire, &tstamp, &reachable, &gc, &refcnt,
+@@ -194,31 +217,31 @@ int rprint_cache6(int ext, int numeric)
+ /* Decode the state */
+ switch (state) {
+ case NUD_NONE:
+- strcpy(statestr, "NONE");
++ safe_strncpy(statestr, "NONE", sizeof(statestr));
+ break;
+ case NUD_INCOMPLETE:
+- strcpy(statestr, "INCOMPLETE");
++ safe_strncpy(statestr, "INCOMPLETE", sizeof(statestr));
+ break;
+ case NUD_REACHABLE:
+- strcpy(statestr, "REACHABLE");
++ safe_strncpy(statestr, "REACHABLE", sizeof(statestr));
+ break;
+ case NUD_STALE:
+- strcpy(statestr, "STALE");
++ safe_strncpy(statestr, "STALE", sizeof(statestr));
+ break;
+ case NUD_DELAY:
+- strcpy(statestr, "DELAY");
++ safe_strncpy(statestr, "DELAY", sizeof(statestr));
+ break;
+ case NUD_PROBE:
+- strcpy(statestr, "PROBE");
++ safe_strncpy(statestr, "PROBE", sizeof(statestr));
+ break;
+ case NUD_FAILED:
+- strcpy(statestr, "FAILED");
++ safe_strncpy(statestr, "FAILED", sizeof(statestr));
+ break;
+ case NUD_NOARP:
+- strcpy(statestr, "NOARP");
++ safe_strncpy(statestr, "NOARP", sizeof(statestr));
+ break;
+ case NUD_PERMANENT:
+- strcpy(statestr, "PERM");
++ safe_strncpy(statestr, "PERM", sizeof(statestr));
+ break;
+ default:
+ snprintf(statestr, sizeof(statestr), "UNKNOWN(%02x)", state);
+diff --git a/lib/inet6_sr.c b/lib/inet6_sr.c
+index fbfe033..1ad9510 100644
+--- a/lib/inet6_sr.c
++++ b/lib/inet6_sr.c
+@@ -33,7 +33,7 @@
+ #include "pathnames.h"
+ #include "intl.h"
+ #include "net-features.h"
+-
++#include "util.h"
+
+
+ extern struct aftype inet6_aftype;
+@@ -63,7 +63,7 @@ static int INET6_setroute(int action, int options, char **args)
+ if (*args == NULL)
+ return (usage());
+
+- strcpy(target, *args++);
++ safe_strncpy(target, *args++, sizeof(target));
+ if (!strcmp(target, "default")) {
+ prefix_len = 0;
+ memset(&sa6, 0, sizeof(sa6));
+@@ -112,7 +112,7 @@ static int INET6_setroute(int action, int options, char **args)
+ return (usage());
+ if (rt.rtmsg_flags & RTF_GATEWAY)
+ return (usage());
+- strcpy(gateway, *args);
++ safe_strncpy(gateway, *args, sizeof(gateway));
+ if (inet6_aftype.input(1, gateway,
+ (struct sockaddr *) &sa6) < 0) {
+ inet6_aftype.herror(gateway);
+@@ -152,7 +152,7 @@ static int INET6_setroute(int action, int options, char **args)
+ }
+ if (devname) {
+ memset(&ifr, 0, sizeof(ifr));
+- strcpy(ifr.ifr_name, devname);
++ safe_strncpy(ifr.ifr_name, devname, sizeof(ifr.ifr_name));
+
+ if (ioctl(skfd, SIOGIFINDEX, &ifr) < 0) {
+ perror("SIOGIFINDEX");
+diff --git a/lib/inet_gr.c b/lib/inet_gr.c
+index d1e5efc..f67e89d 100644
+--- a/lib/inet_gr.c
++++ b/lib/inet_gr.c
+@@ -1,5 +1,5 @@
+ /*
+- $Id: inet_gr.c,v 1.13 2000/10/08 01:00:44 ecki Exp $
++ $Id: inet_gr.c,v 1.14 2009/07/08 00:24:03 ecki Exp $
+
+ Modifications:
+ 1998-07-01 - Arnaldo Carvalho de Melo - GNU gettext instead of catgets
+@@ -31,14 +31,15 @@
+ #include "intl.h"
+ #include "net-features.h"
+ #include "proc.h"
++#include "util.h"
+ extern struct aftype inet_aftype;
+
+-extern char *INET_sprintmask(struct sockaddr *sap, int numeric,
++extern char *INET_sprintmask(struct sockaddr *sap, int numeric,
+ unsigned int netmask);
+
+ int rprint_fib(int ext, int numeric)
+ {
+- char buff[1024], iface[16], flags[64];
++ char buff[1024], iface[17], flags[64];
+ char gate_addr[128], net_addr[128];
+ char mask_addr[128];
+ int num, iflags, metric, refcnt, use, mss, window, irtt;
+@@ -68,19 +69,19 @@ int rprint_fib(int ext, int numeric)
+ mss = 0;
+
+ fmt = proc_gen_fmt(_PATH_PROCNET_ROUTE, 0, fp,
+- "Iface", "%16s",
+- "Destination", "%128s",
+- "Gateway", "%128s",
++ "Iface", "%15s",
++ "Destination", "%127s",
++ "Gateway", "%127s",
+ "Flags", "%X",
+ "RefCnt", "%d",
+ "Use", "%d",
+ "Metric", "%d",
+- "Mask", "%128s",
++ "Mask", "%127s",
+ "MTU", "%d",
+ "Window", "%d",
+ "IRTT", "%d",
+ NULL);
+- /* "%16s %128s %128s %X %d %d %d %128s %d %d %d\n" */
++ /* "%15s %127s %127s %X %d %d %d %127s %d %d %d\n" */
+
+ if (!fmt)
+ return 1;
+@@ -104,18 +105,19 @@ int rprint_fib(int ext, int numeric)
+
+ /* Fetch and resolve the genmask. */
+ (void) inet_aftype.input(1, mask_addr, &snet_mask);
+-
++
+ sin_netmask = (struct sockaddr_in *)&snet_mask;
+- strcpy(net_addr, INET_sprintmask(&snet_target,
++ safe_strncpy(net_addr, INET_sprintmask(&snet_target,
+ (numeric | 0x8000 | (iflags & RTF_HOST? 0x4000: 0)),
+- sin_netmask->sin_addr.s_addr));
+- net_addr[15] = '\0';
++ sin_netmask->sin_addr.s_addr), sizeof(net_addr));
++ net_addr[15] = '\0';
+
+- strcpy(gate_addr, inet_aftype.sprint(&snet_gateway, numeric | 0x4000));
+- gate_addr[15] = '\0';
++ safe_strncpy(gate_addr, inet_aftype.sprint(&snet_gateway, numeric | 0x4000),
++ sizeof(gate_addr));
++ gate_addr[15] = '\0';
+
+- strcpy(mask_addr, inet_aftype.sprint(&snet_mask, 1));
+- mask_addr[15] = '\0';
++ safe_strncpy(mask_addr, inet_aftype.sprint(&snet_mask, 1), sizeof(mask_addr));
++ mask_addr[15] = '\0';
+
+ /* Decode the flags. */
+ flags[0] = '\0';
+@@ -125,7 +127,7 @@ int rprint_fib(int ext, int numeric)
+ strcat(flags, "G");
+ #if HAVE_RTF_REJECT
+ if (iflags & RTF_REJECT)
+- strcpy(flags, "!");
++ safe_strncpy(flags, "!", sizeof(flags));
+ #endif
+ if (iflags & RTF_HOST)
+ strcat(flags, "H");
+@@ -205,7 +207,7 @@ int rprint_fib(int ext, int numeric)
+
+ int rprint_cache(int ext, int numeric)
+ {
+- char buff[1024], iface[16], flags[64];
++ char buff[1024], iface[17], flags[64];
+ char gate_addr[128], dest_addr[128], specdst[128];
+ char src_addr[128];
+ struct sockaddr snet;
+@@ -221,17 +223,17 @@ int rprint_cache(int ext, int numeric)
+ return 1;
+ }
+
+- /* Okay, first thing we need to know is the format of the rt_cache.
++ /* Okay, first thing we need to know is the format of the rt_cache.
+ * I am aware of two possible layouts:
+ * 2.2.0
+ * "Iface\tDestination\tGateway \tFlags\t\tRefCnt\tUse\tMetric\tSource\t\tMTU\tWindow\tIRTT\tTOS\tHHRef\tHHUptod\tSpecDst"
+- * "%s\t%08lX\t%08lX\t%8X\t%d\t%u\t%d\t%08lX\t%d\t%u\t%u\t%02X\t%d\t%1d\t%08X"
++ * "%s\t%08lX\t%08lX\t%8X\t%d\t%u\t%d\t%08lX\t%d\t%u\t%u\t%02X\t%d\t%1d\t%08X"
+ *
+ * 2.0.36
+ * "Iface\tDestination\tGateway \tFlags\tRefCnt\tUse\tMetric\tSource\t\tMTU\tWindow\tIRTT\tHH\tARP"
+ * "%s\t%08lX\t%08lX\t%02X\t%d\t%u\t%d\t%08lX\t%d\t%lu\t%u\t%d\t%1d"
+ */
+-
++
+ format = proc_guess_fmt(_PATH_PROCNET_RTCACHE, fp, "IRTT",1,"TOS",2,"HHRef",4,"HHUptod",8,"SpecDst",16,"HH",32,"ARP",64,NULL);
+
+ printf(_("Kernel IP routing cache\n"));
+@@ -251,7 +253,7 @@ int rprint_cache(int ext, int numeric)
+ printf("ERROR: proc_guess_fmt(%s,... returned: %d\n",_PATH_PROCNET_RTCACHE, format);
+ break;
+ }
+-
++
+ rewind(fp);
+
+ if (ext == 1)
+@@ -268,21 +270,21 @@ int rprint_cache(int ext, int numeric)
+ "MSS Window irtt HH Arp\n"));
+
+ fmt = proc_gen_fmt(_PATH_PROCNET_RTCACHE, 0, fp,
+- "Iface", "%16s",
+- "Destination", "%128s",
+- "Gateway", "%128s",
++ "Iface", "%15s",
++ "Destination", "%127s",
++ "Gateway", "%127s",
+ "Flags", "%X",
+ "RefCnt", "%d",
+ "Use", "%d",
+ "Metric", "%d",
+- "Source", "%128s",
++ "Source", "%127s",
+ "MTU", "%d",
+ "Window", "%d",
+ "IRTT", "%d",
+ "HH", "%d",
+ "ARP", "%d",
+ NULL);
+- /* "%16s %128s %128s %X %d %d %d %128s %d %d %d %d %d\n" */
++ /* "%15s %127s %127s %X %d %d %d %127s %d %d %d %d %d\n" */
+ }
+
+ if (format == 2) {
+@@ -291,23 +293,23 @@ int rprint_cache(int ext, int numeric)
+ "Flags Metric Ref Use Iface "
+ "MSS Window irtt TOS HHRef HHUptod SpecDst\n"));
+ fmt = proc_gen_fmt(_PATH_PROCNET_RTCACHE, 0, fp,
+- "Iface", "%16s",
+- "Destination", "%128s",
+- "Gateway", "%128s",
++ "Iface", "%15s",
++ "Destination", "%127s",
++ "Gateway", "%127s",
+ "Flags", "%X",
+ "RefCnt", "%d",
+ "Use", "%d",
+ "Metric", "%d",
+- "Source", "%128s",
++ "Source", "%127s",
+ "MTU", "%d",
+ "Window", "%d",
+ "IRTT", "%d",
+ "TOS", "%d",
+ "HHRef", "%d",
+ "HHUptod", "%d",
+- "SpecDst", "%128s",
++ "SpecDst", "%127s",
+ NULL);
+- /* "%16s %128s %128s %X %d %d %d %128s %d %d %d %d %d %128s\n" */
++ /* "%15s %127s %127s %X %d %d %d %127s %d %d %d %d %d %127s\n" */
+ }
+
+
+@@ -333,27 +335,23 @@ int rprint_cache(int ext, int numeric)
+ if (num < 12)
+ continue;
+ }
+-
++
+
+ /* Fetch and resolve the target address. */
+ (void) inet_aftype.input(1, dest_addr, &snet);
+- strcpy(dest_addr, inet_aftype.sprint(&snet, numeric));
+- dest_addr[15] = '\0';
++ safe_strncpy(dest_addr, inet_aftype.sprint(&snet, numeric), sizeof(dest_addr));
+
+ /* Fetch and resolve the gateway address. */
+ (void) inet_aftype.input(1, gate_addr, &snet);
+- strcpy(gate_addr, inet_aftype.sprint(&snet, numeric));
+- gate_addr[15] = '\0';
++ safe_strncpy(gate_addr, inet_aftype.sprint(&snet, numeric), sizeof(gate_addr));
+
+ /* Fetch and resolve the source. */
+ (void) inet_aftype.input(1, src_addr, &snet);
+- strcpy(src_addr, inet_aftype.sprint(&snet, numeric));
+- src_addr[15] = '\0';
++ safe_strncpy(src_addr, inet_aftype.sprint(&snet, numeric), sizeof(src_addr));
+
+ /* Fetch and resolve the SpecDst addrerss. */
+ (void) inet_aftype.input(1, specdst, &snet);
+- strcpy(specdst, inet_aftype.sprint(&snet, numeric));
+- specdst[15] = '\0';
++ safe_strncpy(specdst, inet_aftype.sprint(&snet, numeric), sizeof(specdst));
+
+ /* Decode the flags. */
+ flags[0] = '\0';
+@@ -367,7 +365,7 @@ if (format == 1) {
+ strcat(flags, "G");
+ #if HAVE_RTF_REJECT
+ if (iflags & RTF_REJECT)
+- strcpy(flags, "!");
++ safe_strncpy(flags, "!", sizeof(flags));
+ #endif
+ if (iflags & RTF_REINSTATE)
+ strcat(flags, "R");
+diff --git a/lib/inet_sr.c b/lib/inet_sr.c
+index 6d010d5..1a876ae 100644
+--- a/lib/inet_sr.c
++++ b/lib/inet_sr.c
+@@ -3,6 +3,7 @@
+ 1998-07-01 - Arnaldo Carvalho de Melo - GNU gettext instead of catgets
+ 1999-10-07 - Kurt Garloff - for -host and gws: prefer host names
+ over networks (or even reject)
++ 2003-10-11 - Maik Broemme - gcc 3.x warnign fixes (default: break;)
+ */
+
+ #include "config.h"
+@@ -104,7 +105,6 @@ static int INET_setroute(int action, int options, char **args)
+ isnet = 1; break;
+ case 2:
+ isnet = 0; break;
+- default:
+ }
+
+ /* Fill in the other fields. */
+diff --git a/lib/interface.c b/lib/interface.c
+index f4d2a9a..67f0d8f 100644
+--- a/lib/interface.c
++++ b/lib/interface.c
+@@ -1,13 +1,13 @@
+ /* Code to manipulate interface information, shared between ifconfig and
+- netstat.
++ netstat.
+
+- 10/1998 partly rewriten by Andi Kleen to support an interface list.
+- I don't claim that the list operations are efficient @).
++ 10/1998 partly rewriten by Andi Kleen to support an interface list.
++ I don't claim that the list operations are efficient @).
+
+ 8/2000 Andi Kleen make the list operations a bit more efficient.
+ People are crazy enough to use thousands of aliases now.
+
+- $Id: interface.c,v 1.14 2001/02/10 19:31:15 pb Exp $
++ $Id: interface.c,v 1.35 2011-01-01 03:22:31 ecki Exp $
+ */
+
+ #include "config.h"
+@@ -23,6 +23,7 @@
+ #include <string.h>
+ #include <unistd.h>
+ #include <ctype.h>
++#include <string.h>
+
+ #if HAVE_AFIPX
+ #if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1)
+@@ -36,7 +37,7 @@
+ #include <neteconet/ec.h>
+ #endif
+
+-#ifdef HAVE_HWSLIP
++#if HAVE_HWSLIP
+ #include <linux/if_slip.h>
+ #include <net/if_arp.h>
+ #endif
+@@ -87,49 +88,58 @@ int procnetdev_vsn = 1;
+
+ int ife_short;
+
++int if_list_all = 0; /* do we have requested the complete proc list, yet? */
++
+ static struct interface *int_list, *int_last;
+
+ static int if_readlist_proc(char *);
+
+-static struct interface *add_interface(char *name)
++static struct interface *if_cache_add(char *name)
+ {
+ struct interface *ife, **nextp, *new;
+
++ if (!int_list)
++ int_last = NULL;
++
++ /* the cache is sorted, so if we hit a smaller if, exit */
+ for (ife = int_last; ife; ife = ife->prev) {
+- int n = nstrcmp(ife->name, name);
+- if (n == 0)
+- return ife;
+- if (n < 0)
+- break;
++ int n = nstrcmp(ife->name, name);
++ if (n == 0)
++ return ife;
++ if (n < 0)
++ break;
+ }
+- new(new);
+- safe_strncpy(new->name, name, IFNAMSIZ);
+- nextp = ife ? &ife->next : &int_list;
++ new(new);
++ safe_strncpy(new->name, name, IFNAMSIZ);
++ nextp = ife ? &ife->next : &int_list; // keep sorting
+ new->prev = ife;
+- new->next = *nextp;
+- if (new->next)
+- new->next->prev = new;
++ new->next = *nextp;
++ if (new->next)
++ new->next->prev = new;
+ else
+- int_last = new;
+- *nextp = new;
+- return new;
++ int_last = new;
++ *nextp = new;
++ return new;
+ }
+
+ struct interface *lookup_interface(char *name)
+ {
+- struct interface *ife = NULL;
++ /* if we have read all, use it */
++ if (if_list_all)
++ return if_cache_add(name);
+
+- if (if_readlist_proc(name) < 0)
+- return NULL;
+- ife = add_interface(name);
+- return ife;
++ /* otherwise we read a limited list */
++ if (if_readlist_proc(name) < 0)
++ return NULL;
++
++ return if_cache_add(name);
+ }
+
+ int for_all_interfaces(int (*doit) (struct interface *, void *), void *cookie)
+ {
+ struct interface *ife;
+
+- if (!int_list && (if_readlist() < 0))
++ if (!if_list_all && (if_readlist() < 0))
+ return -1;
+ for (ife = int_list; ife; ife = ife->next) {
+ int err = doit(ife, cookie);
+@@ -139,13 +149,15 @@ int for_all_interfaces(int (*doit) (struct interface *, void *), void *cookie)
+ return 0;
+ }
+
+-int free_interface_list(void)
++int if_cache_free(void)
+ {
+ struct interface *ife;
+ while ((ife = int_list) != NULL) {
+ int_list = ife->next;
+ free(ife);
+ }
++ int_last = NULL;
++ if_list_all = 0;
+ return 0;
+ }
+
+@@ -158,7 +170,7 @@ static int if_readconf(void)
+ int skfd;
+
+ /* SIOCGIFCONF currently seems to only work properly on AF_INET sockets
+- (as of 2.1.128) */
++ (as of 2.1.128) */
+ skfd = get_socket_for_af(AF_INET);
+ if (skfd < 0) {
+ fprintf(stderr, _("warning: no inet socket available: %s\n"),
+@@ -180,7 +192,7 @@ static int if_readconf(void)
+ }
+ if (ifc.ifc_len == sizeof(struct ifreq) * numreqs) {
+ /* assume it overflowed and try again */
+- numreqs += 10;
++ numreqs *= 2;
+ continue;
+ }
+ break;
+@@ -188,7 +200,7 @@ static int if_readconf(void)
+
+ ifr = ifc.ifc_req;
+ for (n = 0; n < ifc.ifc_len; n += sizeof(struct ifreq)) {
+- add_interface(ifr->ifr_name);
++ if_cache_add(ifr->ifr_name);
+ ifr++;
+ }
+ err = 0;
+@@ -198,7 +210,7 @@ out:
+ return err;
+ }
+
+-static char *get_name(char *name, char *p)
++char *get_name(char *name, char *p)
+ {
+ while (isspace(*p))
+ p++;
+@@ -206,16 +218,19 @@ static char *get_name(char *name, char *p)
+ if (isspace(*p))
+ break;
+ if (*p == ':') { /* could be an alias */
+- char *dot = p, *dotname = name;
+- *name++ = *p++;
+- while (isdigit(*p))
+- *name++ = *p++;
+- if (*p != ':') { /* it wasn't, backup */
+- p = dot;
+- name = dotname;
++ char *dot = p++;
++ while (*p && isdigit(*p)) p++;
++ if (*p == ':') {
++ /* Yes it is, backup and copy it. */
++ p = dot;
++ *name++ = *p++;
++ while (*p && isdigit(*p)) {
++ *name++ = *p++;
++ }
++ } else {
++ /* No, it isn't */
++ p = dot;
+ }
+- if (*p == '\0')
+- return NULL;
+ p++;
+ break;
+ }
+@@ -225,7 +240,7 @@ static char *get_name(char *name, char *p)
+ return p;
+ }
+
+-static int procnetdev_version(char *buf)
++int procnetdev_version(char *buf)
+ {
+ if (strstr(buf, "compressed"))
+ return 3;
+@@ -234,12 +249,12 @@ static int procnetdev_version(char *buf)
+ return 1;
+ }
+
+-static int get_dev_fields(char *bp, struct interface *ife)
++int get_dev_fields(char *bp, struct interface *ife)
+ {
+ switch (procnetdev_vsn) {
+ case 3:
+ sscanf(bp,
+- "%llu %llu %lu %lu %lu %lu %lu %lu %llu %llu %lu %lu %lu %lu %lu %lu",
++ "%Lu %Lu %lu %lu %lu %lu %lu %lu %Lu %Lu %lu %lu %lu %lu %lu %lu",
+ &ife->stats.rx_bytes,
+ &ife->stats.rx_packets,
+ &ife->stats.rx_errors,
+@@ -259,7 +274,7 @@ static int get_dev_fields(char *bp, struct interface *ife)
+ &ife->stats.tx_compressed);
+ break;
+ case 2:
+- sscanf(bp, "%llu %llu %lu %lu %lu %lu %llu %llu %lu %lu %lu %lu %lu",
++ sscanf(bp, "%Lu %Lu %lu %lu %lu %lu %Lu %Lu %lu %lu %lu %lu %lu",
+ &ife->stats.rx_bytes,
+ &ife->stats.rx_packets,
+ &ife->stats.rx_errors,
+@@ -277,7 +292,7 @@ static int get_dev_fields(char *bp, struct interface *ife)
+ ife->stats.rx_multicast = 0;
+ break;
+ case 1:
+- sscanf(bp, "%llu %lu %lu %lu %lu %llu %lu %lu %lu %lu %lu",
++ sscanf(bp, "%Lu %lu %lu %lu %lu %Lu %lu %lu %lu %lu %lu",
+ &ife->stats.rx_packets,
+ &ife->stats.rx_errors,
+ &ife->stats.rx_dropped,
+@@ -300,25 +315,21 @@ static int get_dev_fields(char *bp, struct interface *ife)
+
+ static int if_readlist_proc(char *target)
+ {
+- static int proc_read;
+ FILE *fh;
+ char buf[512];
+ struct interface *ife;
+ int err;
+
+- if (proc_read)
+- return 0;
+- if (!target)
+- proc_read = 1;
+-
+ fh = fopen(_PATH_PROCNET_DEV, "r");
+ if (!fh) {
+ fprintf(stderr, _("Warning: cannot open %s (%s). Limited output.\n"),
+- _PATH_PROCNET_DEV, strerror(errno));
+- return if_readconf();
+- }
+- fgets(buf, sizeof buf, fh); /* eat line */
+- fgets(buf, sizeof buf, fh);
++ _PATH_PROCNET_DEV, strerror(errno));
++ return -2;
++ }
++ if (fgets(buf, sizeof buf, fh))
++ /* eat line */;
++ if (fgets(buf, sizeof buf, fh))
++ /* eat line */;
+
+ #if 0 /* pretty, but can't cope with missing fields */
+ fmt = proc_gen_fmt(_PATH_PROCNET_DEV, 1, fh,
+@@ -349,8 +360,8 @@ static int if_readlist_proc(char *target)
+ err = 0;
+ while (fgets(buf, sizeof buf, fh)) {
+ char *s, name[IFNAMSIZ];
+- s = get_name(name, buf);
+- ife = add_interface(name);
++ s = get_name(name, buf);
++ ife = if_cache_add(name);
+ get_dev_fields(s, ife);
+ ife->statistics_valid = 1;
+ if (target && !strcmp(target,name))
+@@ -359,7 +370,6 @@ static int if_readlist_proc(char *target)
+ if (ferror(fh)) {
+ perror(_PATH_PROCNET_DEV);
+ err = -1;
+- proc_read = 0;
+ }
+
+ #if 0
+@@ -369,13 +379,23 @@ static int if_readlist_proc(char *target)
+ return err;
+ }
+
+-int if_readlist(void)
+-{
+- int err = if_readlist_proc(NULL);
+- if (!err)
+- err = if_readconf();
+- return err;
+-}
++int if_readlist(void)
++{
++ /* caller will/should check not to call this too often
++ * (i.e. only if if_list_all == 0
++ */
++ int proc_err, conf_err;
++
++ proc_err = if_readlist_proc(NULL);
++ conf_err = if_readconf();
++
++ if_list_all = 1;
++
++ if (proc_err < 0 && conf_err < 0)
++ return -1;
++ else
++ return 0;
++}
+
+ /* Support for fetching an IPX address */
+
+@@ -392,14 +412,14 @@ int if_fetch(struct interface *ife)
+ {
+ struct ifreq ifr;
+ int fd;
+- char *ifname = ife->name;
++ char *ifname = ife->name;
+
+- strcpy(ifr.ifr_name, ifname);
++ safe_strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
+ if (ioctl(skfd, SIOCGIFFLAGS, &ifr) < 0)
+ return (-1);
+ ife->flags = ifr.ifr_flags;
+
+- strcpy(ifr.ifr_name, ifname);
++ safe_strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
+ if (ioctl(skfd, SIOCGIFHWADDR, &ifr) < 0)
+ memset(ife->hwaddr, 0, 32);
+ else
+@@ -407,53 +427,47 @@ int if_fetch(struct interface *ife)
+
+ ife->type = ifr.ifr_hwaddr.sa_family;
+
+- strcpy(ifr.ifr_name, ifname);
+- if (ioctl(skfd, SIOCGIFMETRIC, &ifr) < 0)
+- ife->metric = 0;
+- else
+- ife->metric = ifr.ifr_metric;
+-
+- strcpy(ifr.ifr_name, ifname);
++ safe_strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
+ if (ioctl(skfd, SIOCGIFMTU, &ifr) < 0)
+ ife->mtu = 0;
+ else
+ ife->mtu = ifr.ifr_mtu;
+
+-#ifdef HAVE_HWSLIP
++#if HAVE_HWSLIP
+ if (ife->type == ARPHRD_SLIP || ife->type == ARPHRD_CSLIP ||
+ ife->type == ARPHRD_SLIP6 || ife->type == ARPHRD_CSLIP6 ||
+ ife->type == ARPHRD_ADAPT) {
+ #ifdef SIOCGOUTFILL
+- strcpy(ifr.ifr_name, ifname);
++ safe_strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
+ if (ioctl(skfd, SIOCGOUTFILL, &ifr) < 0)
+ ife->outfill = 0;
+ else
+- ife->outfill = (unsigned int) ifr.ifr_data;
++ ife->outfill = (unsigned long) ifr.ifr_data;
+ #endif
+ #ifdef SIOCGKEEPALIVE
+- strcpy(ifr.ifr_name, ifname);
++ safe_strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
+ if (ioctl(skfd, SIOCGKEEPALIVE, &ifr) < 0)
+ ife->keepalive = 0;
+ else
+- ife->keepalive = (unsigned int) ifr.ifr_data;
++ ife->keepalive = (unsigned long) ifr.ifr_data;
+ #endif
+ }
+ #endif
+
+- strcpy(ifr.ifr_name, ifname);
++ safe_strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
+ if (ioctl(skfd, SIOCGIFMAP, &ifr) < 0)
+ memset(&ife->map, 0, sizeof(struct ifmap));
+ else
+ memcpy(&ife->map, &ifr.ifr_map, sizeof(struct ifmap));
+
+- strcpy(ifr.ifr_name, ifname);
++ safe_strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
+ if (ioctl(skfd, SIOCGIFMAP, &ifr) < 0)
+ memset(&ife->map, 0, sizeof(struct ifmap));
+ else
+ ife->map = ifr.ifr_map;
+
+ #ifdef HAVE_TXQUEUELEN
+- strcpy(ifr.ifr_name, ifname);
++ safe_strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
+ if (ioctl(skfd, SIOCGIFTXQLEN, &ifr) < 0)
+ ife->tx_queue_len = -1; /* unknown value */
+ else
+@@ -466,24 +480,24 @@ int if_fetch(struct interface *ife)
+ /* IPv4 address? */
+ fd = get_socket_for_af(AF_INET);
+ if (fd >= 0) {
+- strcpy(ifr.ifr_name, ifname);
++ safe_strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
+ ifr.ifr_addr.sa_family = AF_INET;
+ if (ioctl(fd, SIOCGIFADDR, &ifr) == 0) {
+ ife->has_ip = 1;
+ ife->addr = ifr.ifr_addr;
+- strcpy(ifr.ifr_name, ifname);
++ safe_strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
+ if (ioctl(fd, SIOCGIFDSTADDR, &ifr) < 0)
+ memset(&ife->dstaddr, 0, sizeof(struct sockaddr));
+ else
+ ife->dstaddr = ifr.ifr_dstaddr;
+
+- strcpy(ifr.ifr_name, ifname);
++ safe_strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
+ if (ioctl(fd, SIOCGIFBRDADDR, &ifr) < 0)
+ memset(&ife->broadaddr, 0, sizeof(struct sockaddr));
+ else
+ ife->broadaddr = ifr.ifr_broadaddr;
+
+- strcpy(ifr.ifr_name, ifname);
++ safe_strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
+ if (ioctl(fd, SIOCGIFNETMASK, &ifr) < 0)
+ memset(&ife->netmask, 0, sizeof(struct sockaddr));
+ else
+@@ -497,7 +511,7 @@ int if_fetch(struct interface *ife)
+ /* DDP address maybe ? */
+ fd = get_socket_for_af(AF_APPLETALK);
+ if (fd >= 0) {
+- strcpy(ifr.ifr_name, ifname);
++ safe_strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
+ if (ioctl(fd, SIOCGIFADDR, &ifr) == 0) {
+ ife->ddpaddr = ifr.ifr_addr;
+ ife->has_ddp = 1;
+@@ -509,22 +523,22 @@ int if_fetch(struct interface *ife)
+ /* Look for IPX addresses with all framing types */
+ fd = get_socket_for_af(AF_IPX);
+ if (fd >= 0) {
+- strcpy(ifr.ifr_name, ifname);
++ safe_strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
+ if (!ipx_getaddr(fd, IPX_FRAME_ETHERII, &ifr)) {
+ ife->has_ipx_bb = 1;
+ ife->ipxaddr_bb = ifr.ifr_addr;
+ }
+- strcpy(ifr.ifr_name, ifname);
++ safe_strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
+ if (!ipx_getaddr(fd, IPX_FRAME_SNAP, &ifr)) {
+ ife->has_ipx_sn = 1;
+ ife->ipxaddr_sn = ifr.ifr_addr;
+ }
+- strcpy(ifr.ifr_name, ifname);
++ safe_strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
+ if (!ipx_getaddr(fd, IPX_FRAME_8023, &ifr)) {
+ ife->has_ipx_e3 = 1;
+ ife->ipxaddr_e3 = ifr.ifr_addr;
+ }
+- strcpy(ifr.ifr_name, ifname);
++ safe_strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
+ if (!ipx_getaddr(fd, IPX_FRAME_8022, &ifr)) {
+ ife->has_ipx_e2 = 1;
+ ife->ipxaddr_e2 = ifr.ifr_addr;
+@@ -536,7 +550,7 @@ int if_fetch(struct interface *ife)
+ /* Econet address maybe? */
+ fd = get_socket_for_af(AF_ECONET);
+ if (fd >= 0) {
+- strcpy(ifr.ifr_name, ifname);
++ safe_strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
+ if (ioctl(fd, SIOCGIFADDR, &ifr) == 0) {
+ ife->ecaddr = ifr.ifr_addr;
+ ife->has_econet = 1;
+@@ -548,29 +562,29 @@ int if_fetch(struct interface *ife)
+ }
+
+ int do_if_fetch(struct interface *ife)
+-{
++{
+ if (if_fetch(ife) < 0) {
+- char *errmsg;
+- if (errno == ENODEV) {
+- /* Give better error message for this case. */
+- errmsg = _("Device not found");
+- } else {
+- errmsg = strerror(errno);
++ char *errmsg;
++ if (errno == ENODEV) {
++ /* Give better error message for this case. */
++ errmsg = _("Device not found");
++ } else {
++ errmsg = strerror(errno);
+ }
+ fprintf(stderr, _("%s: error fetching interface information: %s\n"),
+ ife->name, errmsg);
+ return -1;
+ }
+- return 0;
++ return 0;
+ }
+
+ int do_if_print(struct interface *ife, void *cookie)
+ {
+ int *opt_a = (int *) cookie;
+- int res;
++ int res;
+
+- res = do_if_fetch(ife);
+- if (res >= 0) {
++ res = do_if_fetch(ife);
++ if (res >= 0) {
+ if ((ife->flags & IFF_UP) || *opt_a)
+ ife_print(ife);
+ }
+@@ -579,11 +593,11 @@ int do_if_print(struct interface *ife, void *cookie)
+
+ void ife_print_short(struct interface *ptr)
+ {
+- printf("%-5.5s ", ptr->name);
+- printf("%5d %3d", ptr->mtu, ptr->metric);
++ printf("%-8.8s ", ptr->name);
++ printf("%5d ", ptr->mtu);
+ /* If needed, display the interface statistics. */
+ if (ptr->statistics_valid) {
+- printf("%8llu %6lu %6lu %6lu",
++ printf("%8llu %6lu %6lu %-6lu ",
+ ptr->stats.rx_packets, ptr->stats.rx_errors,
+ ptr->stats.rx_dropped, ptr->stats.rx_fifo_errors);
+ printf("%8llu %6lu %6lu %6lu ",
+@@ -636,8 +650,9 @@ void ife_print_long(struct interface *ptr)
+ int hf;
+ int can_compress = 0;
+ unsigned long long rx, tx, short_rx, short_tx;
+- char Rext[5]="b";
+- char Text[5]="b";
++ const char *Rext = "B";
++ const char *Text = "B";
++ static char flags[200];
+
+ #if HAVE_AFIPX
+ static struct aftype *ipxtype = NULL;
+@@ -650,7 +665,7 @@ void ife_print_long(struct interface *ptr)
+ #endif
+ #if HAVE_AFINET6
+ FILE *f;
+- char addr6[40], devname[20];
++ char addr6[40], devname[21];
+ struct sockaddr_in6 sap;
+ int plen, scope, dad_status, if_idx;
+ extern struct aftype inet6_aftype;
+@@ -663,39 +678,79 @@ void ife_print_long(struct interface *ptr)
+
+ hf = ptr->type;
+
++#if HAVE_HWSLIP
+ if (hf == ARPHRD_CSLIP || hf == ARPHRD_CSLIP6)
+ can_compress = 1;
++#endif
+
+ hw = get_hwntype(hf);
+ if (hw == NULL)
+ hw = get_hwntype(-1);
+
+- printf(_("%-9.9s Link encap:%s "), ptr->name, hw->title);
+- /* For some hardware types (eg Ash, ATM) we don't print the
+- hardware address if it's null. */
+- if (hw->print != NULL && (! (hw_null_address(hw, ptr->hwaddr) &&
+- hw->suppress_null_addr)))
+- printf(_("HWaddr %s "), hw->print(ptr->hwaddr));
+-#ifdef IFF_PORTSEL
+- if (ptr->flags & IFF_PORTSEL) {
+- printf(_("Media:%s"), if_port_text[ptr->map.port][0]);
+- if (ptr->flags & IFF_AUTOMEDIA)
+- printf(_("(auto)"));
+- }
++ sprintf(flags, "flags=%d<", ptr->flags);
++ /* DONT FORGET TO ADD THE FLAGS IN ife_print_short, too */
++ if (ptr->flags == 0)
++ strcat(flags,">");
++ if (ptr->flags & IFF_UP)
++ strcat(flags,_("UP,"));
++ if (ptr->flags & IFF_BROADCAST)
++ strcat(flags,_("BROADCAST,"));
++ if (ptr->flags & IFF_DEBUG)
++ strcat(flags,_("DEBUG,"));
++ if (ptr->flags & IFF_LOOPBACK)
++ strcat(flags,_("LOOPBACK,"));
++ if (ptr->flags & IFF_POINTOPOINT)
++ strcat(flags,_("POINTOPOINT,"));
++ if (ptr->flags & IFF_NOTRAILERS)
++ strcat(flags,_("NOTRAILERS,"));
++ if (ptr->flags & IFF_RUNNING)
++ strcat(flags,_("RUNNING,"));
++ if (ptr->flags & IFF_NOARP)
++ strcat(flags,_("NOARP,"));
++ if (ptr->flags & IFF_PROMISC)
++ strcat(flags,_("PROMISC,"));
++ if (ptr->flags & IFF_ALLMULTI)
++ strcat(flags,_("ALLMULTI,"));
++ if (ptr->flags & IFF_SLAVE)
++ strcat(flags,_("SLAVE,"));
++ if (ptr->flags & IFF_MASTER)
++ strcat(flags,_("MASTER,"));
++ if (ptr->flags & IFF_MULTICAST)
++ strcat(flags,_("MULTICAST,"));
++#ifdef HAVE_DYNAMIC
++ if (ptr->flags & IFF_DYNAMIC)
++ strcat(flags,_("DYNAMIC,"));
++#endif
++ /* DONT FORGET TO ADD THE FLAGS IN ife_print_short */
++ if (flags[strlen(flags)-1] == ',')
++ flags[strlen(flags)-1] = '>';
++ else
++ flags[strlen(flags)-1] = 0;
++
++
++ printf(_("%s: %s mtu %d"),
++ ptr->name, flags, ptr->mtu);
++#ifdef SIOCSKEEPALIVE
++ if (ptr->outfill || ptr->keepalive)
++ printf(_(" outfill %d keepalive %d"),
++ ptr->outfill, ptr->keepalive);
+ #endif
+ printf("\n");
+
++
++
+ #if HAVE_AFINET
+ if (ptr->has_ip) {
+- printf(_(" %s addr:%s "), ap->name,
++ printf(_(" %s %s"), ap->name,
+ ap->sprint(&ptr->addr, 1));
+- if (ptr->flags & IFF_POINTOPOINT) {
+- printf(_(" P-t-P:%s "), ap->sprint(&ptr->dstaddr, 1));
+- }
++ printf(_(" netmask %s"), ap->sprint(&ptr->netmask, 1));
+ if (ptr->flags & IFF_BROADCAST) {
+- printf(_(" Bcast:%s "), ap->sprint(&ptr->broadaddr, 1));
++ printf(_(" broadcast %s"), ap->sprint(&ptr->broadaddr, 1));
+ }
+- printf(_(" Mask:%s\n"), ap->sprint(&ptr->netmask, 1));
++ if (ptr->flags & IFF_POINTOPOINT) {
++ printf(_(" destination %s"), ap->sprint(&ptr->dstaddr, 1));
++ }
++ printf("\n");
+ }
+ #endif
+
+@@ -703,7 +758,7 @@ void ife_print_long(struct interface *ptr)
+ /* FIXME: should be integrated into interface.c. */
+
+ if ((f = fopen(_PATH_PROCNET_IFINET6, "r")) != NULL) {
+- while (fscanf(f, "%4s%4s%4s%4s%4s%4s%4s%4s %02x %02x %02x %02x %20s\n",
++ while (fscanf(f, "%4s%4s%4s%4s%4s%4s%4s%4s %08x %02x %02x %02x %20s\n",
+ addr6p[0], addr6p[1], addr6p[2], addr6p[3],
+ addr6p[4], addr6p[5], addr6p[6], addr6p[7],
+ &if_idx, &plen, &scope, &dad_status, devname) != EOF) {
+@@ -712,29 +767,30 @@ void ife_print_long(struct interface *ptr)
+ addr6p[0], addr6p[1], addr6p[2], addr6p[3],
+ addr6p[4], addr6p[5], addr6p[6], addr6p[7]);
+ inet6_aftype.input(1, addr6, (struct sockaddr *) &sap);
+- printf(_(" inet6 addr: %s/%d"),
+- inet6_aftype.sprint((struct sockaddr *) &sap, 1), plen);
+- printf(_(" Scope:"));
+- switch (scope) {
+- case 0:
+- printf(_("Global"));
+- break;
+- case IPV6_ADDR_LINKLOCAL:
+- printf(_("Link"));
+- break;
+- case IPV6_ADDR_SITELOCAL:
+- printf(_("Site"));
+- break;
+- case IPV6_ADDR_COMPATv4:
+- printf(_("Compat"));
+- break;
+- case IPV6_ADDR_LOOPBACK:
+- printf(_("Host"));
+- break;
+- default:
+- printf(_("Unknown"));
++ printf(_(" %s %s prefixlen %d"),
++ inet6_aftype.name,
++ inet6_aftype.sprint((struct sockaddr *) &sap, 1),
++ plen);
++ printf(_(" scopeid 0x%x"), scope);
++
++ flags[0] = '<'; flags[1] = 0;
++ if (scope & IPV6_ADDR_COMPATv4) {
++ strcat(flags, _("compat,"));
++ scope -= IPV6_ADDR_COMPATv4;
+ }
+- printf("\n");
++ if (scope == 0)
++ strcat(flags, _("global,"));
++ if (scope & IPV6_ADDR_LINKLOCAL)
++ strcat(flags, _("link,"));
++ if (scope & IPV6_ADDR_SITELOCAL)
++ strcat(flags, _("site,"));
++ if (scope & IPV6_ADDR_LOOPBACK)
++ strcat(flags, _("host,"));
++ if (flags[strlen(flags)-1] == ',')
++ flags[strlen(flags)-1] = '>';
++ else
++ flags[strlen(flags)-1] = 0;
++ printf("%s\n", flags);
+ }
+ }
+ fclose(f);
+@@ -747,17 +803,17 @@ void ife_print_long(struct interface *ptr)
+
+ if (ipxtype != NULL) {
+ if (ptr->has_ipx_bb)
+- printf(_(" IPX/Ethernet II addr:%s\n"),
+- ipxtype->sprint(&ptr->ipxaddr_bb, 1));
++ printf(_(" %s Ethernet-II %s\n"),
++ ipxtype->name, ipxtype->sprint(&ptr->ipxaddr_bb, 1));
+ if (ptr->has_ipx_sn)
+- printf(_(" IPX/Ethernet SNAP addr:%s\n"),
+- ipxtype->sprint(&ptr->ipxaddr_sn, 1));
++ printf(_(" %s Ethernet-SNAP %s\n"),
++ ipxtype->name, ipxtype->sprint(&ptr->ipxaddr_sn, 1));
+ if (ptr->has_ipx_e2)
+- printf(_(" IPX/Ethernet 802.2 addr:%s\n"),
+- ipxtype->sprint(&ptr->ipxaddr_e2, 1));
++ printf(_(" %s Ethernet802.2 %s\n"),
++ ipxtype->name, ipxtype->sprint(&ptr->ipxaddr_e2, 1));
+ if (ptr->has_ipx_e3)
+- printf(_(" IPX/Ethernet 802.3 addr:%s\n"),
+- ipxtype->sprint(&ptr->ipxaddr_e3, 1));
++ printf(_(" %s Ethernet802.3 %s\n"),
++ ipxtype->name, ipxtype->sprint(&ptr->ipxaddr_e3, 1));
+ }
+ #endif
+
+@@ -766,7 +822,7 @@ void ife_print_long(struct interface *ptr)
+ ddptype = get_afntype(AF_APPLETALK);
+ if (ddptype != NULL) {
+ if (ptr->has_ddp)
+- printf(_(" EtherTalk Phase 2 addr:%s\n"), ddptype->sprint(&ptr->ddpaddr, 1));
++ printf(_(" %s %s\n"), ddptype->name, ddptype->sprint(&ptr->ddpaddr, 1));
+ }
+ #endif
+
+@@ -775,53 +831,30 @@ void ife_print_long(struct interface *ptr)
+ ectype = get_afntype(AF_ECONET);
+ if (ectype != NULL) {
+ if (ptr->has_econet)
+- printf(_(" econet addr:%s\n"), ectype->sprint(&ptr->ecaddr, 1));
++ printf(_(" %s %s\n"), ectype->name, ectype->sprint(&ptr->ecaddr, 1));
+ }
+ #endif
+
+- printf(" ");
+- /* DONT FORGET TO ADD THE FLAGS IN ife_print_short, too */
+- if (ptr->flags == 0)
+- printf(_("[NO FLAGS] "));
+- if (ptr->flags & IFF_UP)
+- printf(_("UP "));
+- if (ptr->flags & IFF_BROADCAST)
+- printf(_("BROADCAST "));
+- if (ptr->flags & IFF_DEBUG)
+- printf(_("DEBUG "));
+- if (ptr->flags & IFF_LOOPBACK)
+- printf(_("LOOPBACK "));
+- if (ptr->flags & IFF_POINTOPOINT)
+- printf(_("POINTOPOINT "));
+- if (ptr->flags & IFF_NOTRAILERS)
+- printf(_("NOTRAILERS "));
+- if (ptr->flags & IFF_RUNNING)
+- printf(_("RUNNING "));
+- if (ptr->flags & IFF_NOARP)
+- printf(_("NOARP "));
+- if (ptr->flags & IFF_PROMISC)
+- printf(_("PROMISC "));
+- if (ptr->flags & IFF_ALLMULTI)
+- printf(_("ALLMULTI "));
+- if (ptr->flags & IFF_SLAVE)
+- printf(_("SLAVE "));
+- if (ptr->flags & IFF_MASTER)
+- printf(_("MASTER "));
+- if (ptr->flags & IFF_MULTICAST)
+- printf(_("MULTICAST "));
+-#ifdef HAVE_DYNAMIC
+- if (ptr->flags & IFF_DYNAMIC)
+- printf(_("DYNAMIC "));
+-#endif
+- /* DONT FORGET TO ADD THE FLAGS IN ife_print_short */
+- printf(_(" MTU:%d Metric:%d"),
+- ptr->mtu, ptr->metric ? ptr->metric : 1);
+-#ifdef SIOCSKEEPALIVE
+- if (ptr->outfill || ptr->keepalive)
+- printf(_(" Outfill:%d Keepalive:%d"),
+- ptr->outfill, ptr->keepalive);
++ /* For some hardware types (eg Ash, ATM) we don't print the
++ hardware address if it's null. */
++ if (hw->print != NULL && (! (hw_null_address(hw, ptr->hwaddr) &&
++ hw->suppress_null_addr)))
++ printf(_(" %s %s"), hw->name, hw->print(ptr->hwaddr));
++ else
++ printf(_(" %s"), hw->name);
++ if (ptr->tx_queue_len != -1)
++ printf(_(" txqueuelen %d"), ptr->tx_queue_len);
++ printf(" (%s)\n", hw->title);
++
++#ifdef IFF_PORTSEL
++ if (ptr->flags & IFF_PORTSEL) {
++ printf(_(" media %s"), if_port_text[ptr->map.port][0]);
++ if (ptr->flags & IFF_AUTOMEDIA)
++ printf(_("autoselect"));
++ printf("\n");
++ }
+ #endif
+- printf("\n");
++
+
+ /* If needed, display the interface statistics. */
+
+@@ -830,55 +863,87 @@ void ife_print_long(struct interface *ptr)
+ * not for the aliases, although strictly speaking they're shared
+ * by all addresses.
+ */
+- printf(" ");
+-
+- printf(_("RX packets:%llu errors:%lu dropped:%lu overruns:%lu frame:%lu\n"),
+- ptr->stats.rx_packets, ptr->stats.rx_errors,
+- ptr->stats.rx_dropped, ptr->stats.rx_fifo_errors,
+- ptr->stats.rx_frame_errors);
+- if (can_compress)
+- printf(_(" compressed:%lu\n"), ptr->stats.rx_compressed);
+-
+- rx = ptr->stats.rx_bytes;
++ rx = ptr->stats.rx_bytes;
++ short_rx = rx * 10;
++ if (rx > 1125899906842624ull) {
++ short_rx /= 1125899906842624ull;
++ Rext = "PiB";
++ } else if (rx > 1099511627776ull) {
++ short_rx /= 1099511627776ull;
++ Rext = "TiB";
++ } else if (rx > 1073741824ull) {
++ short_rx /= 1073741824ull;
++ Rext = "GiB";
++ } else if (rx > 1048576) {
++ short_rx /= 1048576;
++ Rext = "MiB";
++ } else if (rx > 1024) {
++ short_rx /= 1024;
++ Rext = "KiB";
++ }
+ tx = ptr->stats.tx_bytes;
+- short_rx = rx * 10;
+ short_tx = tx * 10;
+- if (rx > 1048576) { short_rx /= 1048576; strcpy(Rext, "Mb"); }
+- else if (rx > 1024) { short_rx /= 1024; strcpy(Rext, "Kb"); }
+- if (tx > 1048576) { short_tx /= 1048576; strcpy(Text, "Mb"); }
+- else if (tx > 1024) { short_tx /= 1024; strcpy(Text, "Kb"); }
++ if (tx > 1125899906842624ull) {
++ short_tx /= 1125899906842624ull;
++ Text = "PiB";
++ } else if (tx > 1099511627776ull) {
++ short_tx /= 1099511627776ull;
++ Text = "TiB";
++ } else if (tx > 1073741824ull) {
++ short_tx /= 1073741824ull;
++ Text = "GiB";
++ } else if (tx > 1048576) {
++ short_tx /= 1048576;
++ Text = "MiB";
++ } else if (tx > 1024) {
++ short_tx /= 1024;
++ Text = "KiB";
++ }
+
+- printf(" ");
+- printf(_("TX packets:%llu errors:%lu dropped:%lu overruns:%lu carrier:%lu\n"),
+- ptr->stats.tx_packets, ptr->stats.tx_errors,
++ printf(" ");
++ printf(_("RX packets %llu bytes %llu (%lu.%lu %s)\n"),
++ ptr->stats.rx_packets,
++ rx, (unsigned long)(short_rx / 10),
++ (unsigned long)(short_rx % 10), Rext);
++ if (can_compress) {
++ printf(" ");
++ printf(_("RX compressed:%lu\n"), ptr->stats.rx_compressed);
++ }
++ printf(" ");
++ printf(_("RX errors %lu dropped %lu overruns %lu frame %lu\n"),
++ ptr->stats.rx_errors, ptr->stats.rx_dropped,
++ ptr->stats.rx_fifo_errors, ptr->stats.rx_frame_errors);
++
++
++ printf(" ");
++ printf(_("TX packets %llu bytes %llu (%lu.%lu %s)\n"),
++ ptr->stats.tx_packets,
++ tx, (unsigned long)(short_tx / 10),
++ (unsigned long)(short_tx % 10), Text);
++ if (can_compress) {
++ printf(" ");
++ printf(_("TX compressed %lu\n"), ptr->stats.tx_compressed);
++ }
++ printf(" ");
++ printf(_("TX errors %lu dropped %lu overruns %lu carrier %lu collisions %lu\n"),
++ ptr->stats.tx_errors,
+ ptr->stats.tx_dropped, ptr->stats.tx_fifo_errors,
+- ptr->stats.tx_carrier_errors);
+- printf(_(" collisions:%lu "), ptr->stats.collisions);
+- if (can_compress)
+- printf(_("compressed:%lu "), ptr->stats.tx_compressed);
+- if (ptr->tx_queue_len != -1)
+- printf(_("txqueuelen:%d "), ptr->tx_queue_len);
+- printf("\n ");
+- printf(_("RX bytes:%llu (%lu.%lu %s) TX bytes:%llu (%lu.%lu %s)\n"),
+- rx, (unsigned long)(short_rx / 10),
+- (unsigned long)(short_rx % 10), Rext,
+- tx, (unsigned long)(short_tx / 10),
+- (unsigned long)(short_tx % 10), Text);
++ ptr->stats.tx_carrier_errors, ptr->stats.collisions);
+ }
+
+ if ((ptr->map.irq || ptr->map.mem_start || ptr->map.dma ||
+- ptr->map.base_addr)) {
+- printf(" ");
++ ptr->map.base_addr >= 0x100)) {
++ printf(" device ");
+ if (ptr->map.irq)
+- printf(_("Interrupt:%d "), ptr->map.irq);
+- if (ptr->map.base_addr >= 0x100) /* Only print devices using it for
++ printf(_("interrupt %d "), ptr->map.irq);
++ if (ptr->map.base_addr >= 0x100) /* Only print devices using it for
+ I/O maps */
+- printf(_("Base address:0x%x "), ptr->map.base_addr);
++ printf(_("base 0x%x "), ptr->map.base_addr);
+ if (ptr->map.mem_start) {
+- printf(_("Memory:%lx-%lx "), ptr->map.mem_start, ptr->map.mem_end);
++ printf(_("memory 0x%lx-%lx "), ptr->map.mem_start, ptr->map.mem_end);
+ }
+ if (ptr->map.dma)
+- printf(_("DMA chan:%x "), ptr->map.dma);
++ printf(_(" dma 0x%x"), ptr->map.dma);
+ printf("\n");
+ }
+ printf("\n");
+diff --git a/lib/ipx.c b/lib/ipx.c
+index 0e760a3..837788c 100644
+--- a/lib/ipx.c
++++ b/lib/ipx.c
+@@ -42,7 +42,7 @@
+ #endif
+
+ /* Display a ipx domain address. */
+-static char *IPX_print(unsigned char *ptr)
++static const char *IPX_print(const char *ptr)
+ {
+ static char buff[64];
+ struct sockaddr_ipx *sipx = (struct sockaddr_ipx *) (ptr - 2);
+@@ -73,7 +73,7 @@ static char *IPX_print(unsigned char *ptr)
+
+
+ /* Display a ipx domain address. */
+-static char *IPX_sprint(struct sockaddr *sap, int numeric)
++static const char *IPX_sprint(struct sockaddr *sap, int numeric)
+ {
+ static char buf[64];
+
+@@ -87,12 +87,10 @@ static int IPX_getsock(char *bufp, struct sockaddr *sap)
+ {
+ char *sp = bufp, *bp;
+ unsigned int i;
+- unsigned char val;
+ struct sockaddr_ipx *sipx = (struct sockaddr_ipx *) sap;
+
+ sipx->sipx_port = 0;
+
+- val = 0;
+ bp = (char *) sipx->sipx_node;
+ for (i = 0; i < sizeof(sipx->sipx_node); i++) {
+ *sp = toupper(*sp);
+@@ -133,6 +131,9 @@ static int IPX_input(int type, char *bufp, struct sockaddr *sap)
+ char *ep;
+ int nbo;
+
++ if (!sai)
++ return (-1);
++
+ sai->sipx_family = AF_IPX;
+ sai->sipx_network = htonl(0);
+ sai->sipx_node[0] = sai->sipx_node[1] = sai->sipx_node[2] =
+diff --git a/lib/ipx_gr.c b/lib/ipx_gr.c
+index 3d7ef1d..09c8dcd 100644
+--- a/lib/ipx_gr.c
++++ b/lib/ipx_gr.c
+@@ -27,6 +27,7 @@
+ #include "net-support.h"
+ #include "pathnames.h"
+ #include "intl.h"
++#include "util.h"
+
+ /* UGLY */
+
+@@ -38,25 +39,32 @@ int IPX_rprint(int options)
+ char net[128], router_net[128];
+ char router_node[128];
+ int num;
+- FILE *fp = fopen(_PATH_PROCNET_IPX_ROUTE, "r");
++ FILE *fp;
+ struct aftype *ap;
+ struct sockaddr sa;
+
+- if ((ap = get_afntype(AF_IPX)) == NULL) {
+- EINTERN("lib/ipx_rt.c", "AF_IPX missing");
+- return (-1);
++ fp = fopen(_PATH_PROCNET_IPX_ROUTE1, "r");
++
++ if (!fp) {
++ fp = fopen(_PATH_PROCNET_IPX_ROUTE2, "r");
+ }
+
+ if (!fp) {
+- perror(_PATH_PROCNET_IPX_ROUTE);
+- printf(_("IPX not configured in this system.\n"));
++ perror(NULL);
++ printf(_("IPX routing not in file %s or %s found.\n"), _PATH_PROCNET_IPX_ROUTE1, _PATH_PROCNET_IPX_ROUTE2);
+ return 1;
+ }
+
++ if ((ap = get_afntype(AF_IPX)) == NULL) {
++ EINTERN("lib/ipx_rt.c", "AF_IPX missing");
++ return (-1);
++ }
++
+ printf(_("Kernel IPX routing table\n")); /* xxx */
+ printf(_("Destination Router Net Router Node\n"));
+
+- fgets(buff, 1023, fp);
++ if (fgets(buff, 1023, fp))
++ /* eat line */;
+
+ while (fgets(buff, 1023, fp)) {
+ num = sscanf(buff, "%s %s %s", net, router_net, router_node);
+@@ -65,15 +73,15 @@ int IPX_rprint(int options)
+
+ /* Fetch and resolve the Destination */
+ (void) ap->input(5, net, &sa);
+- strcpy(net, ap->sprint(&sa, numeric));
++ safe_strncpy(net, ap->sprint(&sa, numeric), sizeof(net));
+
+ /* Fetch and resolve the Router Net */
+ (void) ap->input(5, router_net, &sa);
+- strcpy(router_net, ap->sprint(&sa, numeric));
++ safe_strncpy(router_net, ap->sprint(&sa, numeric), sizeof(router_net));
+
+ /* Fetch and resolve the Router Node */
+ (void) ap->input(2, router_node, &sa);
+- strcpy(router_node, ap->sprint(&sa, numeric));
++ safe_strncpy(router_node, ap->sprint(&sa, numeric), sizeof(router_node));
+
+ printf("%-25s %-25s %-25s\n", net, router_net, router_node);
+ }
+diff --git a/lib/irda.c b/lib/irda.c
+index fa147fe..3658673 100644
+--- a/lib/irda.c
++++ b/lib/irda.c
+@@ -1,29 +1,31 @@
+ /*********************************************************************
+- *
++ *
+ * Filename: irda.c
+- * Version: 0.1
+- * Description: A first attempt to make ifconfig understand IrDA
++ * Version: 0.2
++ * Description: A second attempt to make ifconfig understand IrDA
+ * Status: Experimental.
+ * Author: Dag Brattli <dagb@cs.uit.no>
+ * Created at: Wed Apr 21 09:03:09 1999
+ * Modified at: Wed Apr 21 09:17:05 1999
+ * Modified by: Dag Brattli <dagb@cs.uit.no>
+- *
+- * This program is free software; you can redistribute it and/or
+- * modify it under the terms of the GNU General Public License as
+- * published by the Free Software Foundation; either version 2 of
++ * Modified at: Wed May 1 11:51:44 CEST 2002
++ * Modified by: Christoph Bartelmus <christoph@bartelmus.de>
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License as
++ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+- *
++ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+- *
+- * You should have received a copy of the GNU General Public License
+- * along with this program; if not, write to the Free Software
+- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+- *
++ *
+ ********************************************************************/
+
+ #include "config.h"
+@@ -57,11 +59,11 @@
+ * Print hardware address of interface
+ *
+ */
+-static char *irda_print(unsigned char *ptr)
++static const char *irda_print(const char *ptr)
+ {
+- static char buff[8];
++ static char buff[12];
+
+- sprintf(&buff[strlen(buff)], "%02x:%02x:%02x:%02x", ptr[3], ptr[2],
++ snprintf(buff, 12, "%02x:%02x:%02x:%02x", ptr[3], ptr[2],
+ ptr[1], ptr[0]);
+
+ return (buff);
+diff --git a/lib/loopback.c b/lib/loopback.c
+index 0f08ac2..1b7e9cc 100644
+--- a/lib/loopback.c
++++ b/lib/loopback.c
+@@ -32,7 +32,7 @@
+ #include "util.h"
+
+ /* Display an UNSPEC address. */
+-static char *pr_unspec(unsigned char *ptr)
++static const char *pr_unspec(const char *ptr)
+ {
+ static char buff[64];
+ char *pos;
+diff --git a/lib/masq_info.c b/lib/masq_info.c
+index 45ca689..3a97a98 100644
+--- a/lib/masq_info.c
++++ b/lib/masq_info.c
+@@ -6,7 +6,7 @@
+ * NET-3 Networking Distribution for the LINUX operating
+ * system. (net-tools, net-drivers)
+ *
+- * Version: $Id: masq_info.c,v 1.7 2000/10/08 01:00:44 ecki Exp $
++ * Version: $Id: masq_info.c,v 1.8 2009/09/06 22:52:01 vapier Exp $
+ *
+ * Author: Bernd 'eckes' Eckenfels <net-tools@lina.inka.de>
+ * Copyright 1999 Bernd Eckenfels, Germany
+@@ -119,7 +119,9 @@ static int read_masqinfo(FILE * f, struct masq *mslist, int nmslist)
+ ms->src.sin_family = AF_INET;
+ ms->dst.sin_family = AF_INET;
+
+- if (strcmp("TCP", buf) == 0)
++ if (strcmp("IP", buf) == 0)
++ ms->proto = "ip";
++ else if (strcmp("TCP", buf) == 0)
+ ms->proto = "tcp";
+ else if (strcmp("UDP", buf) == 0)
+ ms->proto = "udp";
+@@ -206,10 +208,9 @@ int ip_masq_info(int numeric_host, int numeric_port, int ext)
+ }
+ for (i = 0; i < ntotal; i++)
+ print_masq(&(mslist[i]), numeric_host, numeric_port, ext);
+- if (mslist)
+- free(mslist);
+-
+ }
++
++ free(mslist);
+ return 0;
+ }
+ #endif
+diff --git a/lib/net-features.h b/lib/net-features.h
+index 0de2730..569f4a5 100644
+--- a/lib/net-features.h
++++ b/lib/net-features.h
+@@ -20,7 +20,7 @@
+ * your option) any later version.
+ */
+
+-/*
++/*
+ * This needs to be included AFTER the KErnel Header Files
+ * one of the FEATURE_ should be defined to get the Feature Variable
+ * definition included
+@@ -117,6 +117,9 @@ static char *Features =
+ "-I18N"
+ #endif /* I18N */
+
++#if HAVE_SELINUX
++" +SELINUX"
++#endif
+
+ "\nAF: "
+ #ifdef DFLT_AF
+@@ -183,6 +186,12 @@ static char *Features =
+ "-"
+ #endif
+ "ROSE "
++#if HAVE_AFBLUETOOTH
++"+"
++#else
++"-"
++#endif
++"BLUETOOTH"
+
+ "\nHW: "
+
+@@ -295,6 +304,13 @@ static char *Features =
+ "-"
+ #endif
+ "HDLC/LAPB "
++
++#if HAVE_HWEUI64
++"+"
++#else
++"-"
++#endif
++"EUI64 "
+ ;
+
+
+diff --git a/lib/net-support.h b/lib/net-support.h
+index 568fe81..0841170 100644
+--- a/lib/net-support.h
++++ b/lib/net-support.h
+@@ -38,15 +38,15 @@ struct aftype {
+ char *title;
+ int af;
+ int alen;
+- char *(*print) (unsigned char *);
+- char *(*sprint) (struct sockaddr *, int numeric);
++ const char *(*print) (const char *);
++ const char *(*sprint) (struct sockaddr *, int numeric);
+ int (*input) (int type, char *bufp, struct sockaddr *);
+ void (*herror) (char *text);
+ int (*rprint) (int options);
+ int (*rinput) (int typ, int ext, char **argv);
+
+ /* may modify src */
+- int (*getmask) (char *src, struct sockaddr * mask, char *name);
++ int (*getmask) (char *src, struct sockaddr *mask, char *name);
+
+ int fd;
+ char *flag_file;
+@@ -60,7 +60,7 @@ struct hwtype {
+ char *title;
+ int type;
+ int alen;
+- char *(*print) (unsigned char *);
++ const char *(*print) (const char *);
+ int (*input) (char *, struct sockaddr *);
+ int (*activate) (int fd);
+ int suppress_null_addr;
+@@ -119,11 +119,12 @@ extern int IPX_rinput(int action, int flags, char **argv);
+ extern int NETROM_rinput(int action, int flags, char **argv);
+ extern int AX25_rinput(int action, int flags, char **argv);
+ extern int X25_rinput(int action, int flags, char **argv);
++extern int ROSE_rinput(int action, int flags, char **argv);
+
+ extern int aftrans_opt(const char *arg);
+ extern void aftrans_def(char *tool, char *argv0, char *dflt);
+
+-extern char *get_sname(int socknumber, char *proto, int numeric);
++extern const char *get_sname(int socknumber, const char *proto, int numeric);
+
+ extern int flag_unx;
+ extern int flag_ipx;
+@@ -131,14 +132,16 @@ extern int flag_ax25;
+ extern int flag_ddp;
+ extern int flag_netrom;
+ extern int flag_x25;
++extern int flag_rose;
+ extern int flag_inet;
+ extern int flag_inet6;
++extern int flag_bluetooth;
+
+-extern char afname[];
++extern char afname[256];
+
+ #define AFTRANS_OPTS \
+ {"ax25", 0, 0, 1}, \
+- {"x25", 0, 0, 1}, \
++ {"x25", 0, 0, 1}, \
+ {"ip", 0, 0, 1}, \
+ {"ipx", 0, 0, 1}, \
+ {"appletalk", 0, 0, 1}, \
+@@ -146,9 +149,11 @@ extern char afname[];
+ {"inet", 0, 0, 1}, \
+ {"inet6", 0, 0, 1}, \
+ {"ddp", 0, 0, 1}, \
++ {"rose", 0, 0, 1}, \
+ {"unix", 0, 0, 1}, \
++ {"bluetooth", 0, 0, 1}, \
+ {"tcpip", 0, 0, 1}
+-#define AFTRANS_CNT 11
++#define AFTRANS_CNT 12
+
+ #define EINTERN(file, text) fprintf(stderr, \
+ _("%s: Internal Error `%s'.\n"),file,text);
+@@ -163,8 +168,8 @@ extern char afname[];
+ #define E_NOTFOUND 8
+ #define E_SOCK 7
+ #define E_LOOKUP 6
+-#define E_VERSION 5
+-#define E_USAGE 4
++#define E_VERSION EXIT_SUCCESS
++#define E_USAGE EXIT_SUCCESS
+ #define E_OPTERR 3
+ #define E_INTERN 2
+ #define E_NOSUPP 1
+@@ -234,7 +239,7 @@ extern char afname[];
+ /* this is a 2.0.36 flag from /usr/src/linux/include/linux/route.h */
+ #define RTF_NOTCACHED 0x0400 /* this route isn't cached */
+
+-#ifdef HAVE_AFECONET
++#if HAVE_AFECONET
+ #ifndef AF_ECONET
+ #define AF_ECONET 19 /* Acorn Econet */
+ #endif
+diff --git a/lib/netrom.c b/lib/netrom.c
+index 1de9dc3..dfe1ae3 100644
+--- a/lib/netrom.c
++++ b/lib/netrom.c
+@@ -11,7 +11,7 @@
+ *
+ * Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+ * Copyright 1993 MicroWalt Corporation
+- *
++ *
+ * Changes:
+ * 980701 {1.21} Arnaldo Carvalho de Melo - GNU gettext instead of catgets,
+ * strncpy instead of strcpy for
+@@ -52,7 +52,7 @@ static char netrom_errmsg[128];
+
+ extern struct aftype netrom_aftype;
+
+-static char *NETROM_print(unsigned char *ptr)
++static const char *NETROM_print(const char *ptr)
+ {
+ static char buff[8];
+ int i;
+@@ -71,7 +71,7 @@ static char *NETROM_print(unsigned char *ptr)
+
+
+ /* Display an AX.25 socket address. */
+-static char *NETROM_sprint(struct sockaddr *sap, int numeric)
++static const char *NETROM_sprint(struct sockaddr *sap, int numeric)
+ {
+ char buf[64];
+ if (sap->sa_family == 0xFFFF || sap->sa_family == 0)
+@@ -79,10 +79,15 @@ static char *NETROM_sprint(struct sockaddr *sap, int numeric)
+ return (NETROM_print(((struct sockaddr_ax25 *) sap)->sax25_call.ax25_call));
+ }
+
++#ifdef DEBUG
++#define _DEBUG 1
++#else
++#define _DEBUG 0
++#endif
+
+ static int NETROM_input(int type, char *bufp, struct sockaddr *sap)
+ {
+- unsigned char *ptr;
++ char *ptr;
+ char *orig, c;
+ unsigned int i;
+
+@@ -98,9 +103,8 @@ static int NETROM_input(int type, char *bufp, struct sockaddr *sap)
+ c = toupper(c);
+ if (!(isupper(c) || isdigit(c))) {
+ safe_strncpy(netrom_errmsg, _("Invalid callsign"), sizeof(netrom_errmsg));
+-#ifdef DEBUG
+- fprintf(stderr, "netrom_input(%s): %s !\n", netrom_errmsg, orig);
+-#endif
++ if (_DEBUG)
++ fprintf(stderr, "netrom_input(%s): %s !\n", netrom_errmsg, orig);
+ errno = EINVAL;
+ return (-1);
+ }
+@@ -111,9 +115,8 @@ static int NETROM_input(int type, char *bufp, struct sockaddr *sap)
+ /* Callsign too long? */
+ if ((i == 6) && (*bufp != '-') && (*bufp != '\0')) {
+ safe_strncpy(netrom_errmsg, _("Callsign too long"), sizeof(netrom_errmsg));
+-#ifdef DEBUG
+- fprintf(stderr, "netrom_input(%s): %s !\n", netrom_errmsg, orig);
+-#endif
++ if (_DEBUG)
++ fprintf(stderr, "netrom_input(%s): %s !\n", netrom_errmsg, orig);
+ errno = E2BIG;
+ return (-1);
+ }
+@@ -131,12 +134,12 @@ static int NETROM_input(int type, char *bufp, struct sockaddr *sap)
+ }
+
+ /* All done. */
+-#ifdef DEBUG
+- fprintf(stderr, "netrom_input(%s): ", orig);
+- for (i = 0; i < sizeof(ax25_address); i++)
+- fprintf(stderr, "%02X ", sap->sa_data[i] & 0377);
+- fprintf(stderr, "\n");
+-#endif
++ if (_DEBUG) {
++ fprintf(stderr, "netrom_input(%s): ", orig);
++ for (i = 0; i < sizeof(ax25_address); i++)
++ fprintf(stderr, "%02X ", sap->sa_data[i] & 0377);
++ fprintf(stderr, "\n");
++ }
+
+ return (0);
+ }
+diff --git a/lib/netrom_gr.c b/lib/netrom_gr.c
+index adf54b2..ec82fe8 100644
+--- a/lib/netrom_gr.c
++++ b/lib/netrom_gr.c
+@@ -10,7 +10,7 @@
+ *
+ * Changes:
+ * 980701 {0.02} Arnaldo Carvalho de Melo GNU gettext instead of catgets
+- *
++ *
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU General
+@@ -39,9 +39,7 @@ int NETROM_rprint(int options)
+ /*int ext = options & FLAG_EXT;
+ int numeric = options & FLAG_NUM_HOST; */
+
+- f1 = fopen(_PATH_PROCNET_NR_NODES, "r");
+ if (!f1) perror(_PATH_PROCNET_NR_NODES);
+- f2 = fopen(_PATH_PROCNET_NR_NEIGH, "r");
+ if (!f2) perror(_PATH_PROCNET_NR_NEIGH);
+
+ if (f1 == NULL || f2 == NULL) {
+@@ -50,7 +48,8 @@ int NETROM_rprint(int options)
+ }
+ printf(_("Kernel NET/ROM routing table\n"));
+ printf(_("Destination Mnemonic Quality Neighbour Iface\n"));
+- fgets(buffer, 256, f1);
++ if (fgets(buffer, 256, f1))
++ /* eat line */;
+ while (fgets(buffer, 256, f1)) {
+ buffer[9] = 0;
+ buffer[17] = 0;
+@@ -60,7 +59,8 @@ int NETROM_rprint(int options)
+ qual = atoi(buffer + 24 + 15 * w);
+ n = atoi(buffer + 32 + 15 * w);
+ rewind(f2);
+- fgets(buffer, 256, f2);
++ if (fgets(buffer, 256, f2))
++ /* eat line */;
+ while (fgets(buffer, 256, f2)) {
+ if (atoi(buffer) == n) {
+ buffer[15] = 0;
+diff --git a/lib/nstrcmp.c b/lib/nstrcmp.c
+index 8b1ff30..e05c778 100644
+--- a/lib/nstrcmp.c
++++ b/lib/nstrcmp.c
+@@ -1,34 +1,190 @@
+ /* Copyright 1998 by Andi Kleen. Subject to the GPL. */
+-/* $Id: nstrcmp.c,v 1.2 1998/11/15 20:11:38 freitag Exp $ */
++/* rewritten by bernd eckenfels because of complicated alias semantic */
++/* $Id: nstrcmp.c,v 1.4 2004/06/03 22:49:17 ecki Exp $ */
+ #include <ctype.h>
+ #include <stdlib.h>
++#include <string.h>
+ #include "util.h"
+
+-/* like strcmp(), but knows about numbers */
+-int nstrcmp(const char *astr, const char *b)
++
++/* return numerical :999 suffix or null. sideeffect: replace ':' with \0 */
++char* cutalias(char* name)
++{
++ int digit = 0;
++ int pos;
++
++ for(pos=strlen(name); pos>0; pos--)
++ {
++ if (name[pos-1]==':' && digit)
++ {
++ name[pos-1]='\0';
++ return name+pos;
++ }
++ if (!isdigit(name[pos-1]))
++ break;
++ digit = 1;
++ }
++ return NULL;
++}
++
++
++/* return index of last non digit or -1 if it does not end with digits */
++int rindex_nondigit(char *name)
++{
++ int pos = strlen(name);
++
++ for(pos=strlen(name); pos>0; pos--)
++ {
++ if (!isdigit(name[pos-1]))
++ return pos;
++ }
++ return 0;
++}
++
++
++/* like strcmp(), but knows about numbers and ':' alias suffix */
++int nstrcmp(const char *ap, const char *bp)
++{
++ char *a = xstrdup(ap);
++ char *b = xstrdup(bp);
++ char *an, *bn;
++ int av = 0, bv = 0;
++ char *aalias=cutalias(a);
++ char *balias=cutalias(b);
++ int aindex=rindex_nondigit(a);
++ int bindex=rindex_nondigit(b);
++ int complen=(aindex<bindex)?aindex:bindex;
++ int res = strncmp(a, b, complen);
++
++ if (res != 0) {
++ goto out;
++ }
++
++ if (aindex > bindex) {
++ res = 1;
++ goto out;
++ }
++
++ if (aindex < bindex) {
++ res = -1;
++ goto out;
++ }
++
++ an = a+aindex;
++ bn = b+bindex;
++
++ av = atoi(an);
++ bv = atoi(bn);
++
++ if (av < bv) {
++ res = -1;
++ goto out;
++ }
++
++ if (av > bv) {
++ res = 1;
++ goto out;
++ }
++
++ res = strcmp(a, b);
++ if (res != 0) {
++ goto out;
++ }
++
++ av = -1;
++ if (aalias != NULL)
++ av = atoi(aalias);
++
++ bv = -1;
++ if (balias != NULL)
++ bv = atoi(balias);
++
++ if (av < bv) {
++ res = -1;
++ goto out;
++ }
++
++ if (av > bv) {
++ res = 1;
++ goto out;
++ }
++
++ if (aalias && balias) {
++ res = strcmp(aalias, balias);
++ }
++
++out:
++
++ free(a); free(b);
++
++ return res;
++}
++
++
++#ifdef NSTRCMP_TEST
++
++int cs(int s)
++{
++ if (s < 0) return -1;
++ if (s > 0) return 1;
++ return 0;
++}
++
++
++int dotest(char* a, char* b, int exp)
++{
++ int res = nstrcmp(a, b);
++ int err = (cs(res) != cs(exp));
++ printf("nstrcmp(\"%s\", \"%s\")=%d %d %s\n", a, b, res, exp, err?"WRONG":"OK");
++ return err;
++}
++
++int main()
+ {
+- const char *a = astr;
+-
+- while (*a == *b) {
+- if (*a == '\0')
+- return 0;
+- a++;
+- b++;
+- }
+- if (isdigit(*a)) {
+- if (!isdigit(*b))
+- return -1;
+- while (a > astr) {
+- a--;
+- if (!isdigit(*a)) {
+- a++;
+- break;
+- }
+- if (!isdigit(*b))
+- return -1;
+- b--;
+- }
+- return atoi(a) > atoi(b) ? 1 : -1;
+- }
+- return *a - *b;
++ int err = 0;
++
++ err |= dotest("eth1", "eth1", 0);
++ err |= dotest("eth0:1", "eth0:1", 0);
++ err |= dotest("lan", "lan", 0);
++ err |= dotest("100", "100", 0);
++ err |= dotest("", "", 0);
++ err |= dotest(":", ":", 0);
++ err |= dotest("a:b:c", "a:b:c", 0);
++ err |= dotest("a:", "a:", 0);
++ err |= dotest(":a", ":a", 0);
++
++ err |= dotest("a", "aa", -1);
++ err |= dotest("eth0", "eth1", -1);
++ err |= dotest("eth1", "eth20", -1);
++ err |= dotest("eth20", "eth100", -1);
++ err |= dotest("eth1", "eth13", -1);
++ err |= dotest("eth", "eth2", -1);
++ err |= dotest("eth0:1", "eth0:2", -1);
++ err |= dotest("eth1:10", "eth13:10", -1);
++ err |= dotest("eth1:1", "eth1:13", -1);
++ err |= dotest("a", "a:", -1);
++
++ err |= dotest("aa", "a", 1);
++ err |= dotest("eth2", "eth1", 1);
++ err |= dotest("eth13", "eth1", 1);
++ err |= dotest("eth2", "eth", 1);
++ err |= dotest("eth2:10", "eth2:1", 1);
++ err |= dotest("eth2:5", "eth2:4", 1);
++ err |= dotest("eth3:2", "eth2:3", 1);
++ err |= dotest("eth13:1", "eth1:0", 1);
++ err |= dotest("a:", "a", 1);
++ err |= dotest("a1b12", "a1b2", 1);
++
++ err |= dotest("eth1", "eth01", 1);
++ err |= dotest("eth01", "eth1", -1);
++ err |= dotest("eth1:1", "eth01:1", 1);
++ err |= dotest("eth01:1", "eth1:1", -1);
++ err |= dotest("eth1:1", "eth01:01", 1);
++ err |= dotest("eth1:01", "eth01:1", 1);
++ err |= dotest("eth01:1", "eth1:01", -1);
++ err |= dotest("eth01:01", "eth1:1", -1);
++
++ return err;
+ }
++
++#endif
+diff --git a/lib/pathnames.h b/lib/pathnames.h
+index 1f7fefb..14b051c 100644
+--- a/lib/pathnames.h
++++ b/lib/pathnames.h
+@@ -1,9 +1,8 @@
+-
+ /*
+- * lib/pathnames.h This file contains the definitions of the path
++ * lib/pathnames.h This file contains the definitions of the path
+ * names used by the NET-LIB.
+ *
+- * NET-LIB
++ * NET-LIB
+ *
+ * Version: lib/pathnames.h 1.37 (1997-08-23)
+ *
+@@ -17,6 +16,12 @@
+ #define _PATH_PROCNET_TCP6 "/proc/net/tcp6"
+ #define _PATH_PROCNET_UDP "/proc/net/udp"
+ #define _PATH_PROCNET_UDP6 "/proc/net/udp6"
++#define _PATH_PROCNET_UDPLITE "/proc/net/udplite"
++#define _PATH_PROCNET_UDPLITE6 "/proc/net/udplite6"
++#define _PATH_PROCNET_SCTPEPTS "/proc/net/sctp/eps"
++#define _PATH_PROCNET_SCTP6EPTS "/proc/net/sctp6/eps"
++#define _PATH_PROCNET_SCTPASSOCS "/proc/net/sctp/assocs"
++#define _PATH_PROCNET_SCTP6ASSOCS "/proc/net/sctp6/assocs"
+ #define _PATH_PROCNET_RAW "/proc/net/raw"
+ #define _PATH_PROCNET_RAW6 "/proc/net/raw6"
+ #define _PATH_PROCNET_UNIX "/proc/net/unix"
+@@ -29,8 +34,10 @@
+ #define _PATH_PROCNET_NR_NODES "/proc/net/nr_nodes"
+ #define _PATH_PROCNET_ARP "/proc/net/arp"
+ #define _PATH_PROCNET_AX25 "/proc/net/ax25"
+-#define _PATH_PROCNET_IPX "/proc/net/ipx"
+-#define _PATH_PROCNET_IPX_ROUTE "/proc/net/ipx_route"
++#define _PATH_PROCNET_IPX_SOCKET1 "/proc/net/ipx/socket"
++#define _PATH_PROCNET_IPX_SOCKET2 "/proc/net/ipx"
++#define _PATH_PROCNET_IPX_ROUTE1 "/proc/net/ipx/route"
++#define _PATH_PROCNET_IPX_ROUTE2 "/proc/net/ipx_route"
+ #define _PATH_PROCNET_ATALK "/proc/net/appletalk"
+ #define _PATH_PROCNET_IP_BLK "/proc/net/ip_block"
+ #define _PATH_PROCNET_IP_FWD "/proc/net/ip_forward"
+@@ -42,9 +49,12 @@
+ #define _PATH_PROCNET_RARP "/proc/net/rarp"
+ #define _PATH_ETHERS "/etc/ethers"
+ #define _PATH_PROCNET_ROSE_ROUTE "/proc/net/rose_routes"
+-#define _PATH_PROCNET_X25 "/proc/net/x25"
+-#define _PATH_PROCNET_X25_ROUTE "/proc/net/x25_routes"
++#define _PATH_PROCNET_X25 "/proc/net/x25"
++#define _PATH_PROCNET_X25_ROUTE "/proc/net/x25/route"
+ #define _PATH_PROCNET_DEV_MCAST "/proc/net/dev_mcast"
++#define _PATH_PROCNET_ATALK_ROUTE "/proc/net/atalk_route"
++#define _PATH_SYS_BLUETOOTH_L2CAP "/sys/class/bluetooth/l2cap"
++#define _PATH_SYS_BLUETOOTH_RFCOMM "/sys/class/bluetooth/rfcomm"
+
+ /* pathname for the netlink device */
+ #define _PATH_DEV_ROUTE "/dev/route"
+diff --git a/lib/ppp.c b/lib/ppp.c
+index 8bf1499..27d660c 100644
+--- a/lib/ppp.c
++++ b/lib/ppp.c
+@@ -8,7 +8,7 @@
+ * Copyright 1993 MicroWalt Corporation
+ *
+ * Modified by Alan Cox, May 94 to cover NET-3
+- *
++ *
+ * Changes:
+ * 980701 {1.12} Arnaldo Carvalho de Melo - GNU gettext instead of catgets
+ *
+diff --git a/lib/proc.c b/lib/proc.c
+index bf34dbe..8e4711d 100644
+--- a/lib/proc.c
++++ b/lib/proc.c
+@@ -1,11 +1,14 @@
+ /* Tolerant /proc file parser. Copyright 1998 Andi Kleen */
+-/* $Id: proc.c,v 1.4 1999/01/05 20:54:00 philip Exp $ */
+-/* Fixme: cannot currently cope with removed fields */
++/* $Id: proc.c,v 1.5 2007/12/01 18:44:57 ecki Exp $ */
++/* Fixme: cannot currently cope with removed fields */
+
+ #include <string.h>
+ #include <stdarg.h>
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <ctype.h>
++#include <unistd.h>
++#include "util.h"
+
+ /* Caller must free return string. */
+
+@@ -46,10 +49,10 @@ char *proc_gen_fmt(char *name, int more, FILE * fh,...)
+ name, title);
+ return NULL;
+ }
+- return strdup(format);
++ return xstrdup(format);
+ }
+
+-/*
++/*
+ * this will generate a bitmask of present/missing fields in the header of
+ * a /proc file.
+ */
+@@ -72,3 +75,22 @@ int proc_guess_fmt(char *name, FILE *fh, ...)
+ va_end(ap);
+ return flag;
+ }
++
++
++FILE *proc_fopen(const char *name)
++{
++ static char *buffer;
++ static size_t pagesz;
++ FILE *fd = fopen(name, "r");
++
++ if (fd == NULL)
++ return NULL;
++
++ if (!buffer) {
++ pagesz = getpagesize();
++ buffer = malloc(pagesz);
++ }
++
++ setvbuf(fd, buffer, _IOFBF, pagesz);
++ return fd;
++}
+diff --git a/lib/proc.h b/lib/proc.h
+index 91f803c..379de23 100644
+--- a/lib/proc.h
++++ b/lib/proc.h
+@@ -1,5 +1,7 @@
+-
+-
+-/* Generate a suitable scanf format for a column title line */
++/*
++ * prototypes for proc.c
++ */
+ char *proc_gen_fmt(char *name, int more, FILE * fh,...);
+ int proc_guess_fmt(char *name, FILE* fh,...);
++FILE *proc_fopen(const char *name);
++
+diff --git a/lib/rose.c b/lib/rose.c
+index 381226b..6286cb1 100644
+--- a/lib/rose.c
++++ b/lib/rose.c
+@@ -34,6 +34,7 @@
+ #include "net-support.h"
+ #include "pathnames.h"
+ #include "intl.h"
++#include "util.h"
+
+ #ifndef _NETROSE_ROSE_H
+ #include <linux/ax25.h>
+@@ -53,8 +54,8 @@ static char ROSE_errmsg[128];
+
+ extern struct aftype rose_aftype;
+
+-static char *
+- ROSE_print(unsigned char *ptr)
++static const char *
++ ROSE_print(const char *ptr)
+ {
+ static char buff[12];
+
+@@ -64,7 +65,7 @@ static char *
+ }
+
+ /* Display a ROSE socket address. */
+-static char *
++static const char *
+ ROSE_sprint(struct sockaddr *sap, int numeric)
+ {
+ if (sap->sa_family == 0xFFFF || sap->sa_family == 0)
+@@ -73,7 +74,6 @@ static char *
+ return (ROSE_print(((struct sockaddr_rose *) sap)->srose_addr.rose_addr));
+ }
+
+-
+ static int ROSE_input(int type, char *bufp, struct sockaddr *sap)
+ {
+ char *ptr;
+@@ -84,10 +84,7 @@ static int ROSE_input(int type, char *bufp, struct sockaddr *sap)
+
+ /* Node address the correct length ? */
+ if (strlen(bufp) != 10) {
+- strcpy(ROSE_errmsg, _("Node address must be ten digits"));
+-#ifdef DEBUG
+- fprintf(stderr, "rose_input(%s): %s !\n", ROSE_errmsg, orig);
+-#endif
++ safe_strncpy(ROSE_errmsg, _("Node address must be ten digits"), sizeof(ROSE_errmsg));
+ errno = EINVAL;
+ return (-1);
+ }
+@@ -98,13 +95,6 @@ static int ROSE_input(int type, char *bufp, struct sockaddr *sap)
+ }
+
+ /* All done. */
+-#ifdef DEBUG
+- fprintf(stderr, "rose_input(%s): ", orig);
+- for (i = 0; i < sizeof(rose_address); i++)
+- fprintf(stderr, "%02X ", sap->sa_data[i] & 0377);
+- fprintf(stderr, "\n");
+-#endif
+-
+ return (0);
+ }
+
+diff --git a/lib/rose_gr.c b/lib/rose_gr.c
+index cf0a60a..a0858fd 100644
+--- a/lib/rose_gr.c
++++ b/lib/rose_gr.c
+@@ -53,7 +53,8 @@ int ROSE_rprint(int options)
+ }
+ printf(_("Kernel ROSE routing table\n"));
+ printf(_("Destination Iface Use\n"));
+- fgets(buffer, 256, f);
++ if (fgets(buffer, 256, f))
++ /* eat line */;
+ while (fgets(buffer, 256, f)) {
+ buffer[9] = 0;
+ buffer[14] = 0;
+diff --git a/lib/strip.c b/lib/strip.c
+index fd396ba..ced2325 100644
+--- a/lib/strip.c
++++ b/lib/strip.c
+@@ -38,8 +38,8 @@
+
+ extern struct hwtype strip_hwtype;
+
+-static char *
+-pr_strip(unsigned char *ptr)
++static const char *
++pr_strip(const char *ptr)
+ {
+ static char buff[64];
+ if(ptr[1])
+diff --git a/lib/tr.c b/lib/tr.c
+index 8d86aa7..c5314da 100644
+--- a/lib/tr.c
++++ b/lib/tr.c
+@@ -2,7 +2,7 @@
+ * lib/tr.c This file contains an implementation of the "Tokenring"
+ * support functions.
+ *
+- * Version: $Id: tr.c,v 1.8 2000/02/02 08:56:30 freitag Exp $
++ * Version: $Id: tr.c,v 1.9 2005/05/16 03:15:12 ecki Exp $
+ *
+ * Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+ * Copyright 1993 MicroWalt Corporation
+@@ -30,10 +30,16 @@
+ #include "net-support.h"
+ #include "pathnames.h"
+ #include "intl.h"
++#include "util.h"
+
++
++/* actual definition at the end of file */
+ extern struct hwtype tr_hwtype;
++#ifdef ARPHRD_IEEE802_TR
++extern struct hwtype tr_hwtype1;
++#endif
+
+-static char *pr_tr(unsigned char *ptr)
++static const char *pr_tr(const char *ptr)
+ {
+ static char buff[64];
+
+@@ -42,16 +48,31 @@ static char *pr_tr(unsigned char *ptr)
+ (ptr[3] & 0377), (ptr[4] & 0377), (ptr[5] & 0377)
+ );
+ return (buff);
+-}
++ }
+
++#ifdef DEBUG
++#define _DEBUG 1
++#else
++#define _DEBUG 0
++#endif
+
+ static int in_tr(char *bufp, struct sockaddr *sap)
+ {
+- unsigned char *ptr;
++ char *ptr;
+ char c, *orig;
+ int i, val;
+
++#ifdef ARPHRD_IEEE802_TR
++ if (kernel_version() < KRELEASE(2,3,30)) {
++ sap->sa_family = tr_hwtype.type;
++ } else {
++ sap->sa_family = tr_hwtype1.type;
++ }
++#else
+ sap->sa_family = tr_hwtype.type;
++ #warning "Limited functionality, no support for ARPHRD_IEEE802_TR (old kernel headers?)"
++#endif
++
+ ptr = sap->sa_data;
+
+ i = 0;
+@@ -66,9 +87,8 @@ static int in_tr(char *bufp, struct sockaddr *sap)
+ else if (c >= 'A' && c <= 'F')
+ val = c - 'A' + 10;
+ else {
+-#ifdef DEBUG
+- fprintf(stderr, _("in_tr(%s): invalid token ring address!\n"), orig);
+-#endif
++ if (_DEBUG)
++ fprintf(stderr, _("in_tr(%s): invalid token ring address!\n"), orig);
+ errno = EINVAL;
+ return (-1);
+ }
+@@ -81,9 +101,8 @@ static int in_tr(char *bufp, struct sockaddr *sap)
+ else if (c >= 'A' && c <= 'F')
+ val |= c - 'A' + 10;
+ else {
+-#ifdef DEBUG
+- fprintf(stderr, _("in_tr(%s): invalid token ring address!\n"), orig);
+-#endif
++ if (_DEBUG)
++ fprintf(stderr, _("in_tr(%s): invalid token ring address!\n"), orig);
+ errno = EINVAL;
+ return (-1);
+ }
+@@ -92,28 +111,21 @@ static int in_tr(char *bufp, struct sockaddr *sap)
+
+ /* We might get a semicolon here - not required. */
+ if (*bufp == ':') {
+- if (i == TR_ALEN) {
+-#ifdef DEBUG
++ if (_DEBUG && i == TR_ALEN)
+ fprintf(stderr, _("in_tr(%s): trailing : ignored!\n"),
+- orig)
+-#endif
+- ; /* nothing */
+- }
++ orig);
+ bufp++;
+ }
+ }
+
+ /* That's it. Any trailing junk? */
+- if ((i == TR_ALEN) && (*bufp != '\0')) {
+-#ifdef DEBUG
++ if (_DEBUG && (i == TR_ALEN) && (*bufp != '\0')) {
+ fprintf(stderr, _("in_tr(%s): trailing junk!\n"), orig);
+ errno = EINVAL;
+ return (-1);
+-#endif
+ }
+-#ifdef DEBUG
+- fprintf(stderr, "in_tr(%s): %s\n", orig, pr_tr(sap->sa_data));
+-#endif
++ if (_DEBUG)
++ fprintf(stderr, "in_tr(%s): %s\n", orig, pr_tr(sap->sa_data));
+
+ return (0);
+ }
+diff --git a/lib/tunnel.c b/lib/tunnel.c
+index 19606c1..8a160bf 100644
+--- a/lib/tunnel.c
++++ b/lib/tunnel.c
+@@ -21,7 +21,7 @@
+
+ extern struct hwtype ether_hwtype;
+
+-static char *pr_tunnel(unsigned char *ptr)
++static const char *pr_tunnel(const char *ptr)
+ {
+ return ("");
+ }
+diff --git a/lib/unix.c b/lib/unix.c
+index fb4dcce..936cd48 100644
+--- a/lib/unix.c
++++ b/lib/unix.c
+@@ -32,7 +32,7 @@
+
+
+ /* Display an UNSPEC address. */
+-static char *UNSPEC_print(unsigned char *ptr)
++static const char *UNSPEC_print(const char *ptr)
+ {
+ static char buff[64];
+ char *pos;
+@@ -48,7 +48,7 @@ static char *UNSPEC_print(unsigned char *ptr)
+
+
+ /* Display an UNSPEC socket address. */
+-static char *UNSPEC_sprint(struct sockaddr *sap, int numeric)
++static const char *UNSPEC_sprint(struct sockaddr *sap, int numeric)
+ {
+ static char buf[64];
+
+@@ -61,14 +61,14 @@ static char *UNSPEC_sprint(struct sockaddr *sap, int numeric)
+ #if HAVE_AFUNIX
+
+ /* Display a UNIX domain address. */
+-static char *UNIX_print(unsigned char *ptr)
++static const char *UNIX_print(const char *ptr)
+ {
+ return (ptr);
+ }
+
+
+ /* Display a UNIX domain address. */
+-static char *UNIX_sprint(struct sockaddr *sap, int numeric)
++static const char *UNIX_sprint(struct sockaddr *sap, int numeric)
+ {
+ static char buf[64];
+
+diff --git a/lib/util-ank.c b/lib/util-ank.c
+index 43a7f1c..b077f35 100644
+--- a/lib/util-ank.c
++++ b/lib/util-ank.c
+@@ -293,7 +293,7 @@ int inet_addr_match(inet_prefix *a, inet_prefix *b, int bits)
+ return 0;
+ }
+
+-const char *format_host(int af, void *addr, __u8 *abuf, int alen)
++const char *format_host(int af, void *addr, char *abuf, int alen)
+ {
+ #ifdef RESOLVE_HOSTNAMES
+ if (resolve_hosts) {
+diff --git a/lib/util.c b/lib/util.c
+index ac932f4..0397f1e 100644
+--- a/lib/util.c
++++ b/lib/util.c
+@@ -1,4 +1,4 @@
+-/* Copyright 1998 by Andi Kleen. Subject to the GPL. */
++/* Copyright 1998 by Andi Kleen. Subject to the GPL. */
+ /* $Id: util.c,v 1.4 1998/11/17 15:17:02 freitag Exp $ */
+ #include <stdio.h>
+ #include <stdlib.h>
+@@ -22,6 +22,15 @@ void *xmalloc(size_t sz)
+ return p;
+ }
+
++/* Like strdup, but oom() instead of NULL */
++char *xstrdup(const char *s)
++{
++ char *d = strdup(s);
++ if (!d)
++ oom();
++ return d;
++}
++
+ void *xrealloc(void *oldp, size_t sz)
+ {
+ void *p = realloc(oldp, sz);
+@@ -33,19 +42,19 @@ void *xrealloc(void *oldp, size_t sz)
+ int kernel_version(void)
+ {
+ struct utsname uts;
+- int major, minor, patch;
++ int major, minor, patch=0;
+
+ if (uname(&uts) < 0)
+ return -1;
+- if (sscanf(uts.release, "%d.%d.%d", &major, &minor, &patch) != 3)
++ if (sscanf(uts.release, "%d.%d.%d", &major, &minor, &patch) < 2)
+ return -1;
+ return KRELEASE(major, minor, patch);
+ }
+
+
+-/* Like strncpy but make sure the resulting string is always 0 terminated. */
++/* Like strncpy but make sure the resulting string is always 0 terminated. */
+ char *safe_strncpy(char *dst, const char *src, size_t size)
+-{
++{
+ dst[size-1] = '\0';
+- return strncpy(dst,src,size-1);
++ return strncpy(dst,src,size-1);
+ }
+diff --git a/lib/util.h b/lib/util.h
+index 6acb158..b7598e8 100644
+--- a/lib/util.h
++++ b/lib/util.h
+@@ -2,6 +2,7 @@
+
+ void *xmalloc(size_t sz);
+ void *xrealloc(void *p, size_t sz);
++char *xstrdup(const char *src);
+
+ #define new(p) ((p) = xmalloc(sizeof(*(p))))
+
+@@ -12,5 +13,8 @@ int kernel_version(void);
+
+ int nstrcmp(const char *, const char *);
+
+-char *safe_strncpy(char *dst, const char *src, size_t size);
++char *safe_strncpy(char *dst, const char *src, size_t size);
+
++
++#define netmin(a,b) ((a)<(b) ? (a) : (b))
++#define netmax(a,b) ((a)>(b) ? (a) : (b))
+diff --git a/lib/x25.c b/lib/x25.c
+index 1ffb569..45de5af 100644
+--- a/lib/x25.c
++++ b/lib/x25.c
+@@ -38,6 +38,7 @@
+ #include "net-locale.h"
+ #endif
+ #include "intl.h"
++#include "util.h"
+
+ static char X25_errmsg[128];
+
+@@ -50,8 +51,8 @@ extern struct aftype x25_aftype;
+ #endif
+
+
+-static char *
+-X25_print(unsigned char *ptr)
++static const char *
++X25_print(const char *ptr)
+ {
+ static char buff[X25_ADDR_LEN+1];
+
+@@ -63,7 +64,7 @@ X25_print(unsigned char *ptr)
+
+
+ /* Display an X.25 socket address. */
+-static char *
++static const char *
+ X25_sprint(struct sockaddr *sap, int numeric)
+ {
+ if (sap->sa_family == 0xFFFF || sap->sa_family == 0)
+@@ -78,7 +79,7 @@ X25_sprint(struct sockaddr *sap, int numeric)
+ static int
+ X25_input(int type, char *bufp, struct sockaddr *sap)
+ {
+- unsigned char *ptr;
++ char *ptr;
+ char *p;
+ unsigned int sigdigits;
+
+@@ -88,9 +89,11 @@ X25_input(int type, char *bufp, struct sockaddr *sap)
+
+ /* Address the correct length ? */
+ if (strlen(bufp)>18) {
+- strcpy(X25_errmsg, _("Address can't exceed eighteen digits with sigdigits"));
++ safe_strncpy(X25_errmsg,
++ _("Address can't exceed eighteen digits with sigdigits"),
++ sizeof(X25_errmsg));
+ #ifdef DEBUG
+- fprintf(stderr, "x25_input(%s): %s !\n", X25_errmsg, orig);
++ fprintf(stderr, "x25_input(%s): %s !\n", bufp, X25_errmsg);
+ #endif
+ errno = EINVAL;
+ return(-1);
+@@ -105,10 +108,11 @@ X25_input(int type, char *bufp, struct sockaddr *sap)
+ }
+
+ if (strlen(bufp) < 1 || strlen(bufp) > 15 || sigdigits > strlen(bufp)) {
+- *p = '/';
+- strcpy(X25_errmsg, _("Invalid address"));
++ if (p != NULL)
++ *p = '/';
++ safe_strncpy(X25_errmsg, _("Invalid address"), sizeof(X25_errmsg));
+ #ifdef DEBUG
+- fprintf(stderr, "x25_input(%s): %s !\n", X25_errmsg, orig);
++ fprintf(stderr, "x25_input(%s): %s !\n", bufp, X25_errmsg);
+ #endif
+ errno = EINVAL;
+ return(-1);
+@@ -118,10 +122,7 @@ X25_input(int type, char *bufp, struct sockaddr *sap)
+
+ /* All done. */
+ #ifdef DEBUG
+- fprintf(stderr, "x25_input(%s): ", orig);
+- for (i = 0; i < sizeof(x25_address); i++)
+- fprintf(stderr, "%02X ", sap->sa_data[i] & 0377);
+- fprintf(stderr, "\n");
++ fprintf(stderr, "x25_input(%s)\n", bufp);
+ #endif
+
+ return sigdigits;
+@@ -152,7 +153,7 @@ struct hwtype x25_hwtype = {
+ };
+
+ struct aftype x25_aftype =
+-{
++{
+ "x25", NULL, /*"CCITT X.25", */ AF_X25, X25_ADDR_LEN,
+ X25_print, X25_sprint, X25_input, X25_herror,
+ X25_rprint, X25_rinput, NULL /* getmask */,
+diff --git a/lib/x25_gr.c b/lib/x25_gr.c
+index 187fc05..79682e0 100644
+--- a/lib/x25_gr.c
++++ b/lib/x25_gr.c
+@@ -37,6 +37,7 @@
+ #include <string.h>
+ #include "net-support.h"
+ #include "pathnames.h"
++#include "proc.h"
+ #define EXTERN
+ #if 0
+ #include "net-locale.h"
+@@ -48,9 +49,18 @@
+ #define X25_ADDR_LEN 16
+ #endif
+
++static FILE *proc_fopen_x25_route(void)
++{
++ FILE *ret = proc_fopen(_PATH_PROCNET_X25_ROUTE);
++ if (ret)
++ return ret;
++ /* try old linux-2.4 name */
++ return proc_fopen("/proc/net/x25_routes");
++}
++
+ int X25_rprint(int options)
+ {
+- FILE *f=fopen(_PATH_PROCNET_X25_ROUTE, "r");
++ FILE *f=proc_fopen_x25_route();
+ char buffer[256];
+ char *p;
+ int digits;
+@@ -62,7 +72,8 @@ int X25_rprint(int options)
+ }
+ printf( _("Kernel X.25 routing table\n")); /* xxx */
+ printf( _("Destination Iface\n")); /* xxx */
+- fgets(buffer,256,f);
++ if (fgets(buffer,256,f))
++ /* eat line */;
+ while(fgets(buffer,256,f))
+ {
+ p = strchr(buffer,'\n');
+diff --git a/lib/x25_sr.c b/lib/x25_sr.c
+index 8637c98..fde79dc 100644
+--- a/lib/x25_sr.c
++++ b/lib/x25_sr.c
+@@ -38,6 +38,7 @@
+ #include "net-locale.h"
+ #endif
+ #include "intl.h"
++#include "util.h"
+
+ #include "net-features.h"
+
+@@ -64,10 +65,10 @@ static int X25_setroute(int action, int options, char **args)
+ if (*args == NULL)
+ return(usage());
+
+- strcpy(target, *args++);
++ safe_strncpy(target, *args++, sizeof(target));
+
+ /* Clean out the x25_route_struct structure. */
+- memset((char *) &rt, 0, sizeof(struct x25_route_struct));
++ memset((char *) &rt, 0, sizeof(rt));
+
+
+ if ((sigdigits = x25_aftype.input(0, target, (struct sockaddr *)&sx25)) < 0) {
+@@ -76,8 +77,8 @@ static int X25_setroute(int action, int options, char **args)
+ }
+ rt.sigdigits=sigdigits;
+
+- /* x25_route_struct.address isn't type struct sockaddr_x25, Why? */
+- memcpy(&rt.address, &sx25.sx25_addr, sizeof(x25_address));
++ /* this works with 2.4 and 2.6 headers struct x25_address vs. typedef */
++ memcpy(&rt.address, &sx25.sx25_addr, sizeof(sx25.sx25_addr));
+
+ while (*args) {
+ if (!strcmp(*args,"device") || !strcmp(*args,"dev")) {
+@@ -89,7 +90,7 @@ static int X25_setroute(int action, int options, char **args)
+ return(usage());
+ if (rt.device[0])
+ return(usage());
+- strcpy(rt.device, *args);
++ safe_strncpy(rt.device, *args, sizeof(rt.device));
+ args++;
+ }
+ if (rt.device[0]=='\0')
+@@ -111,7 +112,7 @@ static int X25_setroute(int action, int options, char **args)
+ perror("socket");
+ return(E_SOCK);
+ }
+-
++
+ /* Tell the kernel to accept this route. */
+ if (action==RTACTION_DEL) {
+ if (ioctl(skfd, SIOCDELRT, &rt) < 0) {
+@@ -137,14 +138,14 @@ int X25_rinput(int action, int options, char **args)
+ if (action == RTACTION_FLUSH) {
+ fprintf(stderr,"Flushing `x25' routing table not supported\n");
+ return(usage());
+- }
++ }
+ if (options & FLAG_CACHE) {
+ fprintf(stderr,"Modifying `x25' routing cache not supported\n");
+ return(usage());
+- }
++ }
+ if ((*args == NULL) || (action == RTACTION_HELP))
+ return(usage());
+-
++
+ return(X25_setroute(action, options, args));
+ }
+ #endif /* HAVE_AFX25 */
+diff --git a/man/Makefile b/man/Makefile
+index 4ef1af8..23f5468 100644
+--- a/man/Makefile
++++ b/man/Makefile
+@@ -29,9 +29,14 @@ mandir=/usr/share/man
+
+ -include ../config.make
+ ifeq ($(I18N),1)
+-LANGS=`ls -d * | grep -v Makefile`
++ALL_LANGS = $(filter-out Makefile,$(wildcard *))
++ifeq ($(LINGUAS),)
++LANGS = $(ALL_LANGS)
+ else
+-LANGS=en_US
++LANGS = $(sort $(filter $(LINGUAS),$(ALL_LANGS)) en_US)
++endif
++else
++LANGS = en_US
+ endif
+
+ all:
+@@ -43,7 +48,7 @@ clean:
+ clobber: clean
+
+ install:
+- LANGS=$(LANGS) ; \
++ LANGS='$(LANGS)' ; \
+ for LANG in $$LANGS; do \
+ cd $$LANG; \
+ for SECTION in 1 5 8; do \
+diff --git a/man/de_DE/arp.8 b/man/de_DE/arp.8
+index debd879..79abfc7 100644
+--- a/man/de_DE/arp.8
++++ b/man/de_DE/arp.8
+@@ -1,149 +1,145 @@
+-.TH ARP 8 "6. M\(:arz 1999" "net-tools" "Handbuch f\(:ur Linuxprogrammierer"
++.TH ARP 8 "17. Oktober 2012" "net-tools" "Handbuch f\(:ur Linuxprogrammierer"
+ .SH NAME
+ arp \- Manipulation des ARP-Caches
+ .SH SYNOPSIS
+-.B arp
+-.RB [ \-vn ]
+-.RB [ "\-H Typ" ]
+-.RB [ "-i Schnittstelle" ]
+-.B -a
++.B arp
++.RB [ \-vn ]
++.RB [ "\-H Typ" ]
++.RB [ "-i Schnittstelle" ]
++.B -a
+ .RB [ Rechnername ]
+ .PP
+-.B arp
++.B arp
+ .RB [ \-v ]
+-.RB [ "\-i if" ]
++.RB [ "\-i Schnittstelle" ]
+ .B "\-d Rechnername"
+ .RB [ pub ]
+ .PP
+-.B arp
+-.RB [ \-v ]
+-.RB [ "\-H Typ" ]
+-.RB [ "\-i Schnittstelle" ]
++.B arp
++.RB [ \-v ]
++.RB [ "\-H Typ" ]
++.RB [ "\-i Schnittstelle" ]
+ .B -s Rechnername hw_adr
+-.RB [ temp ]
++.RB [ temp ]
+ .PP
+-.B arp
+-.RB [ \-v ]
+-.RB [ "\-H Typ" ]
+-.RB [ "\-i Interface" ]
++.B arp
++.RB [ \-v ]
++.RB [ "\-H Typ" ]
++.RB [ "\-i Interface" ]
+ .B -s Rechnername hw_adr
+-.RB [ "netmask nm" ]
++.RB [ "netmask Maske" ]
+ .B pub
+ .PP
+-.B arp
+-.RB [ \-v ]
+-.RB [ "\-H Typ" ]
+-.RB [ "\-i Schnittstelle" ]
+-.B -Ds Rechnername ifa
+-.RB [ "netmask nm" ]
++.B arp
++.RB [ \-v ]
++.RB [ "\-H Typ" ]
++.RB [ "\-i Schnittstelle" ]
++.B -Ds Rechnername Schnittstelle2
++.RB [ "netmask Maske" ]
+ .B pub
+ .PP
+-.B arp
++.B arp
+ .RB [ \-vnD ]
+-.RB [ "\-H Typ" ]
++.RB [ "\-H Typ" ]
+ .RB [ "-i Schnittstelle" ]
+ .B -f [Dateiname]
+
+ .SH BESCHREIBUNG
+ .B Arp
+ kann den ARP-Cache des Kernels auf verschiedene Arten manipulieren. Die
+-haupts\(:achliche Verwendung ist es Adresszuordnungseintr\(:age zu
++haupts\(:achliche Verwendung ist es, Adresszuordnungseintr\(:age zu
+ l\(:oschen und von Hand neue zu erzeugen. Zum Zweck der Fehlersuche ist
+-moeglich mit dem
+-.B arp
+-Programm den Inhalt des ARP-Caches vollst\(:andig auszugeben.
++es m\(:oglich, mit dem
++.BR arp -Programm
++den Inhalt des ARP-Caches vollst\(:andig auszugeben.
++
++.B ARP
++steht f\(:ur Address Resolution Protocol, welches dazu verwendet wird, \(:uber
++die IPv4-Adresse die MAC-Adresse von Nachbarn im Netzwerk zu finden.
+ .SH OPTIONEN
+ .TP
+ .B "\-v, \-\-verbose"
+ Ausf\(:uhrlichere Ausgaben.
+ .TP
+ .B "\-n, \-\-numeric"
+-macht numerische Adressausgaben anstatt zu versuche, den symbolischen Rechner-,
++Numerische Adressausgaben anstatt zu versuchen, den symbolischen Rechner-,
+ Port- oder Benutzernamen zu ermitteln.
+ .TP
+-.B "\-H type, \-\-hw-type type"
++.B "\-H Typ, \-\-hw-type Typ"
+ Beim Setzen oder Auslesen des ARP-Caches schr\(:ankt diese Option
+-ein, auf welcher Klasse von Eintr\(:agen
++ein, auf welcher Klasse von Eintr\(:agen
+ .B arp
+ operieren soll. Der Standardwert dieses Arguments ist
+ .B ether
+ (d.h. Hardwarecode 0x01 f\(:ur IEEE 802.3 10Mbps Ethernet).
+ Andere m\(:ogliche Werte sind Netzwerkstechnologien so wie z.B.
+-.RB "ARCnet (" arcnet ")"
+-,
+-.RB "PROnet (" pronet ")"
+-,
+-.RB "AX.25 (" ax25 ")"
+-and
+-.RB "NET/ROM (" netrom ")."
++.RB "ARCnet (" arcnet "), PROnet (" pronet "), AX.25 (" ax25 ") und NET/ROM (" netrom ")."
+ .TP
+ .B "\-a [Rechnername], \-\-display [Rechnername]"
+ Zeigt die Eintr\(:age der angegebenen Rechner an. Wird kein
+-.B hostname
+-Argument verwendet, so werden alle Eintr\(:age aufgelistet.
++.BR hostname -Argument
++verwendet, so werden alle Eintr\(:age aufgelistet.
+ .TP
+ .B "\-d Rechnername, \-\-delete Rechnername"
+-Alle Eintr\(:age f\(:ur den angegebenen Host entfernen. Dies kann z.B.
+-benutzt werden, wenn ein System angehalten wird.
++Alle Eintr\(:age f\(:ur den angegebenen Host entfernen. Dies kann z.B. benutzt
++werden, wenn ein System angehalten wird.
+ .TP
+ .B "\-D, \-\-use-device"
+ Die Hardwareadresse der Netzwerksschnittstelle
+-.B ifa
++.B Schnittstelle2
+ verwenden.
+ .TP
+-.B "\-i If, \-\-device Schnittstelle"
++.B "\-i Schnittstelle, \-\-device Schnittstelle"
+ Eine Netzwerksschnittstelle ausw\(:ahlen. Es werden nur Eintr\(:age
+-f\(:ur die angegebene Schnittstelle ausgedruckt. Beim Setzen von von
++f\(:ur die angegebene Schnittstelle ausgegeben. Beim Setzen von
+ permanenten oder tempor\(:aren Eintr\(:agen wird diese Schnittstelle mit
+ dem Eintrag assoziiert. Wird diese Option nicht verwendet, so versucht der
+-Kernel auf Basis der Routentabelle eine Schnittstelle auszuw\(:ahlen. F\(:ur
+-.B pub
+-Eintr\(:age ist die angegebene Schnittstelle diejenige, auf der ARP-Anfragen
++Kernel, auf Basis der Routentabelle eine Schnittstelle auszuw\(:ahlen. F\(:ur
++.BR pub -Eintr\(:age
++ist die angegebene Schnittstelle diejenige, auf der ARP-Anfragen
+ beantwortet werden.
+ .br
+ .B ANMERKUNG:
+-Diese Schnittstelle mu\(ss eine andere sein als die, auf die die IP-Datagramme
++Diese Schnittstelle mu\(ss eine andere sein als die, auf welche die IP-Datagramme
+ weitergeleitet werden.
+ .TP
+-.B "\-s Rechnername hw_addr, \-\-set Rechnername"
+-Erzeugt manuel einen ARP Adresseintrag f\(:ur den Rechner
+-.B Rechnername
++.B "\-s Rechnername hw_addr, \-\-set Rechnername hw_addr"
++Erzeugt manuell einen ARP-Adresseintrag f\(:ur den Rechner
++.BR Rechnername ,
+ in dem die Hardwareadresse auf
+ .B hw_addr
+ gesetzt ist. Das genaue Format der Hardwareadresse ist abh\(:angig von der
+-Hardwareklasse aber f\(:ur die meisten Klassen kann man davon ausgehen, da\(ss
++Hardwareklasse, aber f\(:ur die meisten Klassen kann man davon ausgehen, da\(ss
+ die \(:ubliche Darstellung verwendet wird. F\(:ur die Ethernetklasse sind
+-dies sechs hexadezimale, von Doppelpunkten getrennte Bytes. Beim Zuf\(:ugen
+-von Proxy-ARP-Entr\(:agen (das sind die mit der gesetzten
+-.BR pub lizieren
+-Flagge) kann
+-.B Netmaske
++dies sechs hexadezimale, durch Doppelpunkte getrennte Bytes. Beim Zuf\(:ugen
++von Proxy-ARP-Entr\(:agen (das sind die mit dem gesetzten
++.BR pub lished-Flag)
++kann die
++.B Maske
+ f\(:ur ARP-Eintr\(:age f\(:ur ganze Subnetze angegeben werde. Von dieser
+ Praxis wird abgeraten. Sie wird von \(:alteren Kerneln unterst\(:utzt, da
+-sie gelegentlich n\(:utzlich ist. Wird die
+-If the
+-.B temp
+-Flagge nicht angegeben, so werden die erzeugten Eintr\(:age nicht dauerhaft
+-in den ARP-Cache eingetragen.
++sie gelegentlich n\(:utzlich ist.
++Der Eintrag wird permanent im ARP-Cache gespeichert,
++wenn das \fBtemp\fR-Flag nicht angegeben wird.
+ .br
+ .B ANMERKUNG:
+-Ab der Kernelversion 2.2.0 ist es nicht mehr m\(:oglich ARP-Eintr\(:age f\(:ur
+-ganze Teilnetze zu erzeugen. Statt dessen wird automatisches Proxy ARP
++Ab der Kernelversion 2.2.0 ist es nicht mehr m\(:oglich, ARP-Eintr\(:age f\(:ur
++ganze Teilnetze zu erzeugen. Stattdessen wird automatisches Proxy ARP
+ durchgef\(:uhrt, d.h. wenn eine Route existiert und Forwarding eingeschaltet
+-ist wird automatisch ein tempor\(:arer Proxyarpeintrag erzeugt.
++ist, wird automatisch ein tempor\(:arer Proxyarpeintrag erzeugt.
+ Siehe auch
+ .BR arp (7)
+ f\(:ur mehr Details.
+ .TP
+-.B "\-f Dateiname, \-\-file Dateiname"
++.B "\-f [Dateiname], \-\-file [Dateiname]"
+ \(:Ahnlich der
+ .B \-s
+ Option, au\(sser, da\(ss diesmal die Adressinformation aus der Datei
+ .B Dateiname
+ verwendet wird. Dies kann verwendet werden, wenn ARP-Eintr\(:age f\(:ur
+ etliche Rechner erzeugt werden m\(:ussen. Der Name dieser Datei ist oft
+-.IR /etc/ethers ,
+-aber dies ist nicht offizieil standardisiert. Wenn kein Dateinamen
++.IR /etc/ethers ,
++aber dies ist nicht offizieil standardisiert. Wenn kein Dateinamen
+ angeben ist wird /etc/ethers benutzt.
+ .sp 1
+ Das Format der Datei ist einfach; es enth\(:alt nur ASCII-Textzeilen, die
+@@ -158,16 +154,28 @@ erwartet wird, kann auch eine
+ .B "IP-Adresse"
+ in Form eines durch Punkte getrennten Dezimalquadrupels angegeben werden.
+ .P
+-Aus Kompatiblit\(:atsgr\(:unden k\(:onnen Rechnername und die
++Aus Kompatiblit\(:atsgr\(:unden k\(:onnen Rechnername und die
+ Hardwareadresse auch vertauscht werden.
+-.LP
+-Jeder vollst\(:andige Eintrag wird im ARP-Cache mit der
+-.B C
+-Flagge markiert. Permanente Eintr\(:age werden mit
++.LP
++Jeder vollst\(:andige Eintrag wird im ARP-Cache mit dem
++.BR C -Flag
++markiert. Permanente Eintr\(:age werden mit
+ .B M
+-und zu publizierende Eintr\(:age mit der
++und zu publizierende Eintr\(:age mit
+ .B P
+-Flagge.
++markiert.
++.SH BEISPIELE
++.B /usr/sbin/arp -i eth0 -Ds 10.0.0.2 eth1 pub
++
++Beantwortet ARP-Anfragen f\(:ur 10.0.0.2 die auf der Schnittstelle eth0
++empfangen werden mit der MAC-Adresse f\(:ur eth1.
++
++.B /usr/sbin/arp -i eth1 -d 10.0.0.1
++
++Entfernt den ARP-Eintrag f\(:ur 10.0.0.1 auf der Schnittstelle
++.BR eth1 .
++Dies betrifft sowohl publizierte Proxy-ARP-Einträge als auch auf permanente ARP-Eintr\(:age.
++
+ .SH DATEIEN
+ .I /proc/net/arp,
+ .br
+@@ -176,10 +184,12 @@ Flagge.
+ .I /etc/hosts
+ .br
+ .I /etc/ethers
++
+ .SH SIEHE AUCH
+ ethers(5), rarp(8), route(8), ifconfig(8), netstat(8)
++
+ .SH AUTOREN
+-Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org> mit vielen Verbesserungen vom
+-Verwalter der Net-Tools Bernd Eckenfels <net-tools@lina.inka.de>.
++Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>, Bernd Eckenfels <net-tools@lina.inka.de>.
++
+ .SH \(:Ubersetzung
+-Ralf B\(:achle <ralf@gnu.org>
++Ralf B\(:achle <ralf@gnu.org>, Simon A. Eugster <simon.eu@gmail.com>
+diff --git a/man/de_DE/ifconfig.8 b/man/de_DE/ifconfig.8
+index aa2a4a0..9713965 100644
+--- a/man/de_DE/ifconfig.8
++++ b/man/de_DE/ifconfig.8
+@@ -73,9 +73,6 @@ Modus. Ist er eingeschaltet, so werden alle Multicastpakete vom Netzwerk
+ empfangen unabh\(:angig davon, ob sie an die Schnittstelle adressiert sind
+ oder nicht.
+ .TP
+-.B "metric N"
+-Dieses Argument setzt den Metrik-Wert f\(:ur die Schnittstelle auf N.
+-.TP
+ .B "mtu N"
+ Dieses Argument setzt die Maximum Transfer Unit (MTU) der Schnittstelle,
+ das ist das gr\(:o\(sste Paket, dass gesendet werden kann.
+@@ -98,7 +95,7 @@ F\(:ugt der Schnittstelle eine IPv6-Adresse zu.
+ .B "del addr/prefixlen"
+ Entfernt eine IPv6-Adresse von der Schnittstelle.
+ .TP
+-.B "tunnel aa.bb.cc.dd"
++.B "tunnel ::aa.bb.cc.dd"
+ Erzeugt ein neues SIT (IPv6-in-IPv4) Ger\(:at, das Pakete zum angegebenen
+ Ziel tunnelt.
+ .TP
+@@ -180,12 +177,10 @@ Seit Kernel Version 2.2 gibt es keine expliziten Statistiken f\(:ur
+ Schnittstellenaliase mehr. Die Statistiken f\(:ur die Originaladresse werden
+ mit allen Aliasen auf das gleiche Ger\(:at geteilt. Um Statistiken per
+ Adresse zu erhalten sollte explizite EIntr\(:age f\(:ur die Adresse mit dem
+-.BR ipchains(8)
++.BR iptables(8)
+ Kommando gemacht werden.
+
+ .SH DATEIEN
+-.I /proc/net/socket
+-.br
+ .I /proc/net/dev
+ .br
+ .I /proc/net/if_inet6
+@@ -193,7 +188,7 @@ Kommando gemacht werden.
+ W\(:ahrend AppleTalk DDP und IPX Adressen angezeigt werden, k\(:onnen sie mit
+ diesem Kommando nicht ge\(:andert werden.
+ .SH SIEHE AUCH
+-route(8), netstat(8), arp(8), rarp(8), ipchains(8)
++route(8), netstat(8), arp(8), rarp(8), iptables(8)
+ .SH AUTOREN
+ Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+ .br
+diff --git a/man/de_DE/netstat.8 b/man/de_DE/netstat.8
+index f59aec0..fdb76c9 100644
+--- a/man/de_DE/netstat.8
++++ b/man/de_DE/netstat.8
+@@ -9,7 +9,7 @@
+ .\" Modified: Tuan Hoang tuan@optimus.mitre.org
+ .\"
+ .\"
+-.TH NETSTAT 8 "6. M\(:arz 1999" "net-tools" "Handbuch f\(:ur Linuxprogrammierer"
++.TH NETSTAT 8 "2007-12-02" "net-tools" "Handbuch f\(:ur Linuxprogrammierer"
+
+ .SH NAME
+ netstat \- Anzeige von Netzwerksverbindungen, Routentabellen, Schnittstellenstatistiken, maskierten Verbindungen, Netlink-Nachrichten und Mitgliedschaft in Multicastgruppen
+@@ -20,6 +20,8 @@ netstat \- Anzeige von Netzwerksverbindungen, Routentabellen, Schnittstellenstat
+ .RB [ \-venaoc ]
+ .RB [ \-\-tcp | \-t ]
+ .RB [ \-\-udp | \-u ]
++.RB [ \-\-udplite | \-U ]
++.RB [ \-\-sctp | \-S ]
+ .RB [ \-\-raw | \-w ]
+ .RB [ \-\-groups | \-g ]
+ .RB [ \-\-unix | \-x ]
+@@ -44,7 +46,6 @@ netstat \- Anzeige von Netzwerksverbindungen, Routentabellen, Schnittstellenstat
+ .B netstat
+ .RB [ \-veenpac ]
+ .RB { \-\-interfaces | \-i }
+-.RI [ Schnittstelle ]
+
+ .PP
+
+@@ -68,6 +69,8 @@ netstat \- Anzeige von Netzwerksverbindungen, Routentabellen, Schnittstellenstat
+ .SH BESCHREIBUNG
+ .B Netstat
+ zeigt Informationen des Linux Netzwerkssystems an.
++.PP
++.B Bitte beachten Sie, dass der Inhalt der deutschen man-page nicht vollst\(:andig ist, im Moment.
+
+ .SS "(no option)"
+ Ohne Optionen zeigt
+@@ -103,18 +106,17 @@ benutzt das Ausgabeformat von
+ Wegen Details siehe
+ .BR route (8).
+
+-.SS "\-i, \-\-interface \fISchnittstelle\fI"
++.SS "\-i, \-\-interfaces"
+ Wird die
+ .BR -i ", " --interfaces
+-Option verwendet, so wird eine Tabelle aller (oder der angegebenen
+-.IR Schnittstellen )
++Option verwendet, so wird eine Tabelle aller Schnittstellen
+ ausgedruckt. Die Ausgabe ist im Format von
+ .B "ifconfig -e"
+ und wird in
+ .BR ifconfig (8)
+ beschrieben.
+ .B "netstat -ei"
+-druckt eine Tabelle oder einen Eintrag f\(:ur einen einzelnes Interface wie
++druckt eine Tabelle f\(:ur Interfaces wie
+ .BR ifconfig .
+ Die
+ .B -a
+@@ -182,7 +184,7 @@ Dies hat den gleichen Effekt wie die Langoptionen
+ und
+ .BR \-\-ddp.
+
+-.SS "\-c, \-\-continous"
++.SS "\-c, \-\-continuous"
+ Mit dieser Option wiederholt
+ .B netstat
+ im Sekundenabstand die Ausgabe, bis es abgebrochen wird.
+@@ -414,7 +416,7 @@ werden.)
+ Seit der Kern Version 2.2 zeigt netstat -i keine Schnittstellenstatistiken
+ von Schnittstellenaliasen mehr an. Um Statistiken per Schnittstelle zur
+ erhalten, m\(:ussen jetzt mit dem
+-.BR ipchains(8)
++.BR iptables(8)
+ Befehl explizite Regeln zugef\(:ugt werden.
+
+ .SH DATEIEN
+@@ -477,10 +479,7 @@ Befehl explizite Regeln zugef\(:ugt werden.
+ .SH SIEHE AUCH
+ .BR route (8),
+ .BR ifconfig (8),
+-.BR ipfw (4),
+-.BR ipfw (8),
+-.BR ipfwadm (8)
+-.BR ipchains (8)
++.BR iptables (8)
+
+ .PP
+ .SH PROBLEME
+diff --git a/man/de_DE/route.8 b/man/de_DE/route.8
+index a28c9d1..1a32712 100644
+--- a/man/de_DE/route.8
++++ b/man/de_DE/route.8
+@@ -55,7 +55,7 @@ Schnittstelle]
+ .SH BESCHREIBUNG
+ .B Route
+ wird zum \(:Andern der IP-Routing-Tabelle der Kernels verwendet. Seine
+-prim\(:are Verwendung ist statische Routen f\*:ur bestimmte Rechner oder
++prim\(:are Verwendung ist statische Routen f\(:ur bestimmte Rechner oder
+ Netzwerke \(:uber eine Schnittstelle einzutragen, nachdem diese mit dem
+ Programm
+ .BR ifconfig (8)
+diff --git a/man/en_US/arp.8 b/man/en_US/arp.8
+index d859b46..c065e22 100644
+--- a/man/en_US/arp.8
++++ b/man/en_US/arp.8
+@@ -1,56 +1,111 @@
+-.TH ARP 8 "5 Jan 1999" "net-tools" "Linux Programmer's Manual"
++.TH ARP 8 "2008\-10\-03" "net\-tools" "Linux System Administrator's Manual"
+ .SH NAME
+ arp \- manipulate the system ARP cache
+ .SH SYNOPSIS
+-.B arp
+-.RB [ \-vn ]
+-.RB [ "\-H type" ]
+-.RB [ "-i if" ]
+-.B -a
+-.RB [ hostname ]
++.B arp
++.RB [ \-vn ]
++.RB [ \-H
++.IR type ]
++.RB [ \-i
++.IR if ]
++.RB [ \-ae ]
++.RI [ hostname ]
+ .PP
+-.B arp
++.B arp
+ .RB [ \-v ]
+-.RB [ "\-i if" ]
+-.B "\-d hostname"
++.RB [ \-i
++.IR if ]
++.B \-d
++.I hostname
+ .RB [ pub ]
+ .PP
+-.B arp
+-.RB [ \-v ]
+-.RB [ "\-H type" ]
+-.RB [ "\-i if" ]
+-.B -s hostname hw_addr
+-.RB [ temp ]
++.B arp
++.RB [ \-v ]
++.RB [ \-H
++.IR type ]
++.RB [ \-i
++.IR if ]
++.B \-s
++.I hostname hw_addr
++.RB [ temp ]
+ .PP
+-.B arp
+-.RB [ \-v ]
+-.RB [ "\-H type" ]
+-.RB [ "\-i if" ]
+-.B -s hostname hw_addr
+-.RB [ "netmask nm" ]
++.B arp
++.RB [ \-v ]
++.RB [ \-H
++.IR type ]
++.RB [ \-i
++.IR if ]
++.B \-s
++.I hostname hw_addr
++.RB [ netmask
++.IR nm ]
+ .B pub
+ .PP
+-.B arp
+-.RB [ \-v ]
+-.RB [ "\-H type" ]
+-.RB [ "\-i if" ]
+-.B -Ds hostname ifa
+-.RB [ "netmask nm" ]
++.B arp
++.RB [ \-v ]
++.RB [ \-H
++.IR type ]
++.RB [ \-i
++.IR if ]
++.B \-Ds
++.I hostname
++.I ifname
++.RB [ netmask
++.IR nm ]
+ .B pub
+ .PP
+-.B arp
++.B arp
+ .RB [ \-vnD ]
+-.RB [ "\-H type" ]
+-.RB [ "-i if" ]
+-.B -f [filename]
++.RB [ \-H
++.IR type ]
++.RB [ \-i
++.IR if ]
++.B \-f
++.RI [ filename ]
+
+ .SH DESCRIPTION
+ .B Arp
+-manipulates the kernel's ARP cache in various ways. The primary options
+-are clearing an address mapping entry and manually setting up one. For
+-debugging purposes, the
++manipulates or displays the kernel's IPv4 network neighbour cache. It can add
++entries to the table, delete one or display the current content.
++
++.B ARP
++stands for Address Resolution Protocol, which is used to find the media
++access control address of a network neighbour for a given IPv4 Address.
++.SH MODES
+ .B arp
+-program also allows a complete dump of the ARP cache.
++with no mode specifier will print the current content of the table. It is
++possible to limit the number of entries printed, by specifying an hardware
++address type, interface name or host address.
++
++.B arp -d
++.I address
++will delete a ARP table entry. Root or netadmin privilege is required to do
++this. The entry is found by IP address. If a hostname is given, it will be
++resolved before looking up the entry in the ARP table.
++
++.B arp -s
++.I address hw_addr
++is used to set up a new table entry. The format of the
++.I hw_addr
++parameter is dependent on the hardware class, but for most classes one can
++assume that the usual presentation can be used. For the Ethernet class,
++this is 6 bytes in hexadecimal, separated by colons. When adding proxy arp
++entries (that is those with the
++.BR pub lish
++flag set) a
++.B netmask
++may be specified to proxy arp for entire subnets. This is not good
++practice, but is supported by older kernels because it can be
++useful. If the
++.B temp
++flag is not supplied entries will be permanent stored into the ARP
++cache. To simplify setting up entries for one of your own network interfaces, you can use the
++.B "arp \-Ds"
++.I address ifname
++form. In that case the hardware address is taken from the interface with the
++specified name.
++
++.br
+ .SH OPTIONS
+ .TP
+ .B "\-v, \-\-verbose"
+@@ -60,7 +115,7 @@ Tell the user what is going on by being verbose.
+ shows numerical addresses instead of trying to determine symbolic host, port
+ or user names.
+ .TP
+-.B "\-H type, \-\-hw-type type"
++\fB\-H\fI type\fR, \fB\-\-hw\-type\fI type\fR, \fB\-t\fI type\fR
+ When setting or reading the ARP cache, this optional parameter tells
+ .B arp
+ which class of entries it should check for. The default value of
+@@ -76,23 +131,18 @@ Other values might include network technologies such as
+ and
+ .RB "NET/ROM (" netrom ")."
+ .TP
+-.B "\-a [hostname], \-\-display [hostname]"
+-Shows the entries of the specified hosts. If the
+-.B hostname
+-parameter is not used,
+-.B all
+-entries will be displayed.
++.B \-a
++Use alternate BSD style output format (with no fixed columns).
+ .TP
+-.B "\-d hostname, \-\-delete hostname"
+-Remove any entry for the specified host. This can be used if the
+-indicated host is brought down, for example.
++.B \-e
++Use default Linux style output format (with fixed columns).
+ .TP
+ .B "\-D, \-\-use-device"
+-Use the interface
+-.BR ifa "'s"
+-hardware address.
++Instead of a hw_addr, the given argument is the name of an interface.
++.B arp
++will use the MAC address of that interface for the table entry. This is usually the best option to set up a proxy ARP entry to yourself.
+ .TP
+-.B "\-i If, \-\-device If"
++\fB\-i\fI If\fR, \fB\-\-device\fI If\fR
+ Select an interface. When dumping the ARP cache only entries matching
+ the specified interface will be printed. When setting a permanent or
+ .B temp
+@@ -101,53 +151,36 @@ option is not used, the kernel will guess based on the routing
+ table. For
+ .B pub
+ entries the specified interface is the interface on which ARP requests will
+-be answered.
++be answered.
+ .br
+ .B NOTE:
+ This has to be different from the interface to which the IP
+ datagrams will be routed.
+-.TP
+-.B "\-s hostname hw_addr, \-\-set hostname"
+-Manually create an ARP address mapping entry for host
+-.B hostname
+-with hardware address set to
+-.B hw_addr
+-. The format of the hardware address is dependent on the hardware
+-class, but for most classes one can assume that the usual presentation
+-can be used. For the Ethernet class, this is 6 bytes in hexadecimal,
+-separated by colons. When adding proxy arp entries (that is those with
+-the
+-.BR pub lish
+-flag set a
+-.B netmask
+-may be specified to proxy arp for entire subnets. This is not good
+-practice, but is supported by older kernels because it can be
+-useful. If the
+-.B temp
+-flag is not supplied entries will be permanent stored into the ARP
+-cache.
+-.br
+ .B NOTE:
+-As of kernel 2.2.0 it is no longer possible to set an ARP entry for an
++As of kernel 2.2.0 it is no longer possible to set an ARP entry for an
+ entire subnet. Linux instead does automagic proxy arp when a route
+-exists and it is forwarding. See
++exists and it is forwarding. See
+ .BR arp (7)
+-for details.
++for details. Also the
++.B dontpub
++option which is available for delete and set operations cannot be
++used with 2.4 and newer kernels.
+ .TP
+-.B "\-f filename, \-\-file filename"
++\fB\-f\fI filename\fR, \fB\-\-file\fI filename\fR
+ Similar to the
+ .B \-s
+ option, only this time the address info is taken from file
+-.B filename
+-. This can be used if ARP entries for a lot of hosts have to be
++.IR filename .
++This can be used if ARP entries for a lot of hosts have to be
+ set up. The name of the data file is very often
+-.IR /etc/ethers ,
+-but this is not official. If no filename is specified /etc/ethers
++.IR /etc/ethers ,
++but this is not official. If no filename is specified
++.I /etc/ethers
+ is used as default.
+ .sp 1
+ The format of the file is simple; it
+ only contains ASCII text lines with a hostname, and a hardware
+-address separated by whitespace. Additionally the
++address separated by whitespace. Additionally the
+ .BR "pub" , " temp" " and" " netmask"
+ flags can be used.
+ .LP
+@@ -157,9 +190,9 @@ is expected, one can also enter an
+ .B "IP address"
+ in dotted-decimal notation.
+ .P
+-As a special case for compatibility the order of the hostname and
++As a special case for compatibility the order of the hostname and
+ the hardware address can be exchanged.
+-.LP
++.LP
+ Each complete entry in the ARP cache will be marked with the
+ .B C
+ flag. Permanent entries are marked with
+@@ -167,8 +200,18 @@ flag. Permanent entries are marked with
+ and published entries have the
+ .B P
+ flag.
++.SH EXAMPLES
++.B /usr/sbin/arp -i eth0 -Ds 10.0.0.2 eth1 pub
++
++This will answer ARP requests for 10.0.0.2 on eth0 with the MAC address for
++eth1.
++
++.B /usr/sbin/arp -i eth1 -d 10.0.0.1
++
++Delete the ARP table entry for 10.0.0.1 on interface eth1. This will match
++published proxy ARP entries and permanent entries.
+ .SH FILES
+-.I /proc/net/arp,
++.I /proc/net/arp
+ .br
+ .I /etc/networks
+ .br
+@@ -178,5 +221,4 @@ flag.
+ .SH SEE ALSO
+ rarp(8), route(8), ifconfig(8), netstat(8)
+ .SH AUTHORS
+-Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org> with a lot of improvements
+-from net-tools Maintainer Bernd Eckenfels <net-tools@lina.inka.de>.
++Fred N. van Kempen <waltje@uwalt.nl.mugnet.org>, Bernd Eckenfels <net\-tools@lina.inka.de>.
+diff --git a/man/en_US/ethers.5 b/man/en_US/ethers.5
+index f3ba116..5a02892 100644
+--- a/man/en_US/ethers.5
++++ b/man/en_US/ethers.5
+@@ -1,4 +1,4 @@
+-.TH ETHERS 5 "April 26th, 1996" "" "File formats"
++.TH ETHERS 5 "2008\-10\-03" "net\-tools" "Linux System Administrator's Manual"
+ .SH NAME \"{{{roff}}}\"{{{
+ ethers \- Ethernet address to IP number database
+ .\"}}}
+@@ -7,17 +7,17 @@ ethers \- Ethernet address to IP number database
+ IP numbers, one line for each IP number:
+ .sp
+ .RS
+-\fIEthernet-address\fP \fIIP-number\fP
++\fIEthernet\-address\fP \fIIP\-number\fP
+ .RE
+ .sp
+-The two items are separated by any number of SPACE and/or TAB char
+-acters. A \fB#\fP at the beginning of a line starts a comment
+-which extends to the end of the line. The \fIEthernet-address\fP is
++The two items are separated by any number of SPACE and/or TAB characters.
++A \fB#\fP at the beginning of a line starts a comment
++which extends to the end of the line. The \fIEthernet\-address\fP is
+ written as
+ .IR x : x : x : x : x : x ,
+ where \fIx\fP is a hexadecimal number between \fB0\fP and \fBff\fP
+ which represents one byte of the address, which is in network byte
+-order (big-endian). The \fIIP-number\fP may be a hostname which
++order (big-endian). The \fIIP\-number\fP may be a hostname which
+ can be resolved by DNS or a dot separated number.
+ .\"}}}
+ .SH EXAMPLES \"{{{
+diff --git a/man/en_US/hostname.1 b/man/en_US/hostname.1
+index cea3f6e..c45b7b6 100644
+--- a/man/en_US/hostname.1
++++ b/man/en_US/hostname.1
+@@ -1,66 +1,60 @@
+-.TH HOSTNAME 1 "28 Jan 1996" "net-tools" "Linux Programmer's Manual"
++.TH HOSTNAME 1 "2013\-08\-29" "net\-tools" "Linux System Administrator's Manual"
+
+ .SH NAME
+ hostname \- show or set the system's host name
+ .br
+-domainname \- show or set the system's NIS/YP domain name
+-.br
+ dnsdomainname \- show the system's DNS domain name
+ .br
+-nisdomainname \- show or set system's NIS/YP domain name
++domainname \- show or set the system's NIS/YP domain name
+ .br
+-ypdomainname \- show or set the system's NIS/YP domain name
++nisdomainname \- show or set system's NIS/YP domain name
+ .br
+ nodename \- show or set the system's DECnet node name
++.br
++ypdomainname \- show or set the system's NIS/YP domain name
+
+ .SH SYNOPSIS
+ .B hostname
+ .RB [ \-v ]
+-.RB [ \-a ]
+-.RB [ \-\-alias ]
+-.RB [ \-d ]
+-.RB [ \-\-domain ]
+-.RB [ \-f ]
+-.RB [ \-\-fqdn ]
+-.RB [ \-i ]
+-.RB [ \-\-ip-address ]
+-.RB [ \-\-long ]
+-.RB [ \-s ]
+-.RB [ \-\-short ]
+-.RB [ \-y ]
+-.RB [ \-\-yp ]
+-.RB [ \-\-nis ]
+-.RB [ \-n ]
+-.RB [ \-\-node ]
++.RB [ \-s | \-\-short ]
++
++.PP
++.B hostname
++.RB [ \-v ]
++.RB [ \-a | \-\-alias ]
++.RB [ \-d | \-\-domain ]
++.RB [ \-f | \-\-fqdn | \-\-long ]
++.RB [ \-i | \-\-ip\-address ]
++
++.PP
++.B hostname
++.RB [ \-v ]
++.RB [ \-y | \-\-yp | \-\-nis ]
++.RB [ \-n | \-\-node ]
+
+ .PP
+ .B hostname
+ .RB [ \-v ]
+-.RB [ \-F\ filename ]
+-.RB [ \-\-file\ filename ]
+-.RB [ hostname ]
++.RB [ \-F\ filename | \-\-file\ filename ]
++.RI [ newname ]
+
+ .PP
+ .B domainname
+ .RB [ \-v ]
+-.RB [ \-F\ filename ]
+-.RB [ \-\-file\ filename ]
+-.RB [ name ]
++.RB [ \-F\ filename | \-\-file\ filename ]
++.RI [ newname ]
+
+ .PP
+ .B nodename
+ .RB [ \-v ]
+-.RB [ \-F\ filename ]
+-.RB [ \-\-file\ filename ]
+-.RB [ name ]
++.RB [ \-F\ filename | \-\-file\ filename ]
++.RI [ newname ]
+
+ .PP
+ .B hostname
+-.RB [ \-v ]
+-.RB [ \-h ]
+-.RB [ \-\-help ]
+-.RB [ \-V ]
+-.RB [ \-\-version ]
++.RB [ \-v | \-\-verbose ]
++.RB [ \-h | \-\-help ]
++.RB [ \-V | \-\-version ]
+
+ .PP
+ .B dnsdomainname
+@@ -124,12 +118,8 @@ command (see
+ below).
+
+ .LP
+-The host name is usually set once at system startup in
+-.I /etc/rc.d/rc.inet1
+-or
+-.I /etc/init.d/boot
+-(normally by reading the contents of a file which contains
+-the host name, e.g.
++The host name is usually set once at system startup by reading the
++contents of a file which contains the host name, e.g.
+ .IR /etc/hostname ).
+
+ .SS THE FQDN
+@@ -142,16 +132,17 @@ with this command. The FQDN of the system is the name that the
+ returns for the host name.
+
+ .LP
+-Technically: The FQDN is the name
+-.BR gethostbyname (2)
+-returns for the host name returned by
+-.BR gethostname (2).
+-The DNS domain name is the part after the first dot.
++Technically: The FQDN is the canonical name returned by
++.BR gethostbyname2 (2)
++when resolving the result of the
++.BR gethostname (2)
++name. The DNS domain name is the part after the first dot.
+ .LP
+ Therefore it depends on the configuration (usually in
+ .IR /etc/host.conf )
+-how you can change it. Usually (if the hosts file is parsed before DNS or
+-NIS) you can change it in
++how you can change it. If
++.B hosts
++is the first lookup method, you can change the FQDN in
+ .IR /etc/hosts .
+
+
+@@ -161,27 +152,23 @@ NIS) you can change it in
+ Display the alias name of the host (if used).
+ .TP
+ .I "\-d, \-\-domain"
+-Display the name of the DNS domain. Don't use the command
+-.B domainname
+-to get the DNS domain name because it will show the NIS domain name and
+-not the DNS domain name. Use
++Display the name of the DNS domain (this is the FQDN without the segment up
++to the first dot). This is equivalent to using the
+ .B dnsdomainname
+-instead.
++command.
+ .TP
+ .I "\-F, \-\-file filename"
+-Read the host name from the specified file. Comments (lines starting with
++Read the new host name from the specified file. Comments (lines starting with
+ a `#') are ignored.
+ .TP
+ .I "\-f, \-\-fqdn, \-\-long"
+-Display the FQDN (Fully Qualified Domain Name). A FQDN consists of a
+-short host name and the DNS domain name. Unless you are using bind or NIS
+-for host lookups you can change the FQDN and the DNS domain name (which is
+-part of the FQDN) in the \fI/etc/hosts\fR file.
++Display the FQDN (Fully Qualified Domain Name). A FQDN consists of name
++including the DNS domain.
+ .TP
+ .I "\-h, \-\-help"
+ Print a usage message and exit.
+ .TP
+-.I "\-i, \-\-ip-address"
++.I "\-i, \-\-ip\-address"
+ Display the IP address(es) of the host.
+ .TP
+ .I "\-n, \-\-node"
+@@ -203,11 +190,13 @@ Display the NIS domain name. If a parameter is given (or
+ .B \-\-file name
+ ) then root can also set a new NIS domain.
+ .SH FILES
++.B /etc/hostname
+ .B /etc/hosts
++.B /etc/host.conf
++
+ .SH AUTHOR
+-Peter Tobias, <tobias@et-inf.fho-emden.de>
++Peter Tobias, <tobias@et\-inf.fho\-emden.de>
+ .br
+-Bernd Eckenfels, <net-tools@lina.inka.de> (NIS and manpage).
++Bernd Eckenfels, <net\-tools@lina.inka.de> (NIS and manpage).
+ .br
+ Steve Whitehouse, <SteveW@ACM.org> (DECnet support and manpage).
+-
+diff --git a/man/en_US/ifconfig.8 b/man/en_US/ifconfig.8
+index e75cf59..0243be3 100644
+--- a/man/en_US/ifconfig.8
++++ b/man/en_US/ifconfig.8
+@@ -1,10 +1,10 @@
+-.TH IFCONFIG 8 "14 August 2000" "net-tools" "Linux Programmer's Manual"
++.TH IFCONFIG 8 "2008\-10\-03" "net\-tools" "Linux System Administrator's Manual"
+ .SH NAME
+ ifconfig \- configure a network interface
+ .SH SYNOPSIS
+-.B "ifconfig [interface]"
++.B "ifconfig [-v] [-a] [-s] [interface]"
+ .br
+-.B "ifconfig interface [aftype] options | address ..."
++.B "ifconfig [-v] interface [aftype] options | address ..."
+ .SH DESCRIPTION
+ .B Ifconfig
+ is used to configure the kernel-resident network interfaces. It is
+@@ -18,7 +18,7 @@ a single
+ .B interface
+ argument is given, it displays the status of the given interface
+ only; if a single
+-.B -a
++.B \-a
+ argument is given, it displays the status of all interfaces, even
+ those that are down. Otherwise, it configures an interface.
+
+@@ -39,13 +39,34 @@ supported address families include
+ (Novell IPX) and
+ .B netrom
+ (AMPR Packet radio).
++All numbers supplied as parts in IPv4 dotted decimal notation may be decimal,
++octal, or hexadecimal, as specified in the ISO C standard (that is, a leading 0x
++or 0X implies hexadecimal; otherwise, a leading '0' implies octal; otherwise,
++the number is interpreted as decimal). Use of hexadecimal and octal numbers
++is not RFC-compliant and therefore its use is discouraged.
+ .SH OPTIONS
+ .TP
++.B -a
++display all interfaces which are currently available, even if down
++.TP
++.B -s
++display a short list (like netstat -i)
++.TP
++.B -v
++be more verbose for some error conditions
++.TP
+ .B interface
+ The name of the interface. This is usually a driver name followed by
+ a unit number, for example
+ .B eth0
+-for the first Ethernet interface.
++for the first Ethernet interface. If your kernel supports alias interfaces,
++you can specify them with
++.B eth0:0
++for the first alias of eth0. You can use them to assign a second address. To
++delete an alias interface use
++.BR "ifconfig eth0:0 down" .
++Note: for every scope (i.e. same net with address/netmask combination) all
++aliases are deleted, if you delete the first (primary).
+ .TP
+ .B up
+ This flag causes the interface to be activated. It is implicitly
+@@ -69,9 +90,6 @@ Enable or disable
+ mode. If selected, all multicast packets on the network will be
+ received by the interface.
+ .TP
+-.B "metric N"
+-This parameter sets the interface metric.
+-.TP
+ .B "mtu N"
+ This parameter sets the Maximum Transfer Unit (MTU) of an interface.
+ .TP
+@@ -92,7 +110,7 @@ Add an IPv6 address to an interface.
+ .B "del addr/prefixlen"
+ Remove an IPv6 address from an interface.
+ .TP
+-.B "tunnel aa.bb.cc.dd"
++.B "tunnel ::aa.bb.cc.dd"
+ Create a new SIT (IPv6-in-IPv4) device, tunnelling to the given destination.
+ .TP
+ .B "irq addr"
+@@ -122,13 +140,13 @@ are
+ can be used to tell the driver to auto-sense the media. Again, not
+ all drivers can do this.
+ .TP
+-.B "[-]broadcast [addr]"
++.B "[\-]broadcast [addr]"
+ If the address argument is given, set the protocol broadcast
+ address for this interface. Otherwise, set (or clear) the
+ .B IFF_BROADCAST
+ flag for the interface.
+ .TP
+-.B "[-]pointopoint [addr]"
++.B "[\-]pointopoint [addr]"
+ This keyword enables the
+ .B point-to-point
+ mode of an interface, meaning that it is a direct link between two
+@@ -173,23 +191,40 @@ alias interfaces anymore. The statistics printed for the original address
+ are shared with all alias addresses on the same device. If you want per-address
+ statistics you should add explicit accounting
+ rules for the address using the
+-.BR ipchains(8)
++.BR iptables (8)
+ command.
+ .LP
+-Interrupt problems with Ethernet device drivers fail with EAGAIN. See
+-.I http://cesdis.gsfc.nasa.gov/linux/misc/irq-conflict.html
++Since net\-tools 1.60\-4 ifconfig is printing byte counters and human readable
++counters with IEC 60027-2 units. So 1 KiB are 2^10 byte. Note, the numbers
++are truncated to one decimal (which can by quite a large error if you
++consider 0.1 PiB is 112.589.990.684.262 bytes :)
++.LP
++Interrupt problems with Ethernet device drivers fail with EAGAIN
++.I (SIOCSIIFLAGS: Resource temporarily unavailable)
++it is most likely a interrupt conflict. See
++.I http://www.scyld.com/expert/irq\-conflict.html
+ for more information.
+ .SH FILES
+-.I /proc/net/socket
+-.br
+ .I /proc/net/dev
+ .br
+ .I /proc/net/if_inet6
+ .SH BUGS
++Ifconfig uses the ioctl access method to get the full address information,
++which limits hardware addresses to 8 bytes.
++Because Infiniband hardware address has 20 bytes,
++only the first 8 bytes are displayed correctly.
++Please use
++.B ip link
++command from
++.B iproute2
++package to display link layer informations including the hardware address.
++.LP
+ While appletalk DDP and IPX addresses will be displayed they cannot be
+ altered by this command.
+ .SH SEE ALSO
+-route(8), netstat(8), arp(8), rarp(8), ipchains(8)
++route(8), netstat(8), arp(8), rarp(8), iptables(8), ifup(8), interfaces(5).
++.br
++http://physics.nist.gov/cuu/Units/binary.html - Prefixes for binary multiples
+ .SH AUTHORS
+ Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+ .br
+@@ -198,3 +233,5 @@ Alan Cox, <Alan.Cox@linux.org>
+ Phil Blundell, <Philip.Blundell@pobox.com>
+ .br
+ Andi Kleen
++.br
++Bernd Eckenfels, <net\-tools@lina.inka.de>
+diff --git a/man/en_US/mii-tool.8 b/man/en_US/mii-tool.8
+index 6b773ec..7decaac 100644
+--- a/man/en_US/mii-tool.8
++++ b/man/en_US/mii-tool.8
+@@ -1,13 +1,12 @@
+ .\" Copyright (C) 2000 David A. Hinds -- dhinds@pcmcia.sourceforge.org
+-.\" mii-tool.8 1.5 2000/04/25 22:58:19
+ .\"
+-.TH MII-TOOL 8 "2000/04/25 22:58:19" "net-tools"
++.TH MII\-TOOL 8 "2013\-02\-15" "net\-tools" "Linux System Administrator's Manual"
+
+ .SH NAME
+-mii-tool \- view, manipulate media-independent interface status
++mii\-tool \- view, manipulate media-independent interface status
+
+ .SH SYNOPSIS
+-.B mii-tool
++.B mii\-tool
+ [\fB\-v\fR, \fB\-\-verbose\fR]
+ [\fB\-V\fR, \fB\-\-version\fR]
+ [\fB\-R\fR, \fB\-\-reset\fR]
+@@ -16,7 +15,8 @@ mii-tool \- view, manipulate media-independent interface status
+ [\fB\-l\fR, \fB\-\-log\fR]
+ [\fB\-A\fR, \fB\-\-advertise=\fImedia,...\fR]
+ [\fB\-F\fR, \fB\-\-force=\fImedia\fR]
+-.RI [ "interface\ ..." ]
++[\fB\-p\fR, \fB\-\-phy=\fIaddr\fR]
++.RI "interface\ ..."
+
+ .SH DESCRIPTION
+ This utility checks or sets the status of a network interface's Media
+@@ -32,18 +32,21 @@ single-speed hubs, are unable to autonegotiate. To handle such
+ devices, the MII protocol also allows for establishing a link by
+ simply detecting either a 10baseT or 100baseT link beat. The \fB\-F\fR
+ or \fB\-\-force\fR options can be used to force the MII to operate in
+-one mode, instead of autonegotiating. The \fB\-A\fR and \fB-F\fR
++one mode, instead of autonegotiating. The \fB\-A\fR and \fB\-F\fR
+ options are mutually exclusive.
+ .PP
+ The default short output reports the negotiated link speed and link
+-status for each interface. If an interface or interfaces are not
+-specified on the command line, then \fBmii-tool\fR will check any
+-available interfaces from \fBeth0\fR through \fBeth7\fR.
++status for each interface.
+ .SH OPTIONS
+ .TP
+ \fB\-v\fR, \fB\-\-verbose\fR
+ Display more detailed MII status information. If used twice, also
+ display raw MII register contents.
++.br
++\fBAlert:\fR If used three times, will force reading all MII
++registers, including non standard ones. It's not guaranteed any
++valid answer from PHY while PHY communication can even hang.
++With driver e1000e will fail while reading register 0x07.
+ .TP
+ \fB\-V\fR, \fB\-\-version\fR
+ Display program version information.
+@@ -59,7 +62,7 @@ Watch interface(s) and report changes in link status. The MII
+ interfaces are polled at one second intervals.
+ .TP
+ \fB\-l\fR, \fB\-\-log\fR
+-Used with \fB-w\fR, records link status changes in the system log
++Used with \fB\-w\fR, records link status changes in the system log
+ instead of printing on standard output.
+ .TP
+ \fB\-F\fI media\fR, \fB\-\-force=\fImedia\fR
+@@ -71,8 +74,31 @@ Enable and restart autonegotiation, and advertise only the specified
+ media technologies. Multiple technologies should be separated by
+ commas. Valid media are \fB100baseT4\fR, \fB100baseTx-FD\fR,
+ \fB100baseTx-HD\fR, \fB10baseT-FD\fR, and \fB10baseT-HD\fR.
++.TP
++\fB\-p\fI addr\fR, \fB\-\-phy=\fIaddr\fR
++Override the MII address provided by kernel with value \fBaddr\fR.
++
++.SH DIAGNOSTICS
++.TP
++SIOCGMIIPHY on 'eth?' failed: Invalid argument
++If the interface is not running (up), kernel will refuse to report its link state.
++.TP
++SIOCGMIIPHY on 'eth?' failed: Operation not permitted
++Most kernels restrict access to root.
++.TP
++SIOCGMIIPHY on 'eth?' failed: No such device
++This error is shown, if the kernel does not know about the named device.
++.TP
++SIOCGMIIPHY on 'eth?' failed: Operation not supported
++The interface in question does not support MII queries. Most likely, it does not have
++MII transceivers, at all.
+
+ .SH AUTHORS
+ David Hinds \- dhinds@pcmcia.sourceforge.org
+ .br
+ Donald Becker \- becker@scyld.com
++.br
++Bernd Eckenfels \- net-tools@lina.inka.de
++
++.SH SEE ALSO
++http://net-tools.sourceforge.net \- Homepage of the net-tools project
+diff --git a/man/en_US/nameif.8 b/man/en_US/nameif.8
+index ff2430f..195304d 100644
+--- a/man/en_US/nameif.8
++++ b/man/en_US/nameif.8
+@@ -1,10 +1,10 @@
+-.TH NAMEIF 8 "18 Oct 2000" "net-tools" "Linux's Administrator's Manual"
++.TH NAMEIF 8 "2008\-10\-03" "net\-tools" "Linux System Administrator's Manual"
+ .SH NAME
+ nameif \- name network interfaces based on MAC addresses
+ .SH SYNOPSIS
+-.B "nameif [-c configfile] [-s]"
++.B "nameif [\-c configfile] [\-s]"
+ .br
+-.B "nameif [-c configfile] [-s] {interface macaddress}"
++.B "nameif [\-c configfile] [\-s] {interface macaddress}"
+ .SH DESCRIPTION
+ .B nameif
+ renames network interfaces based on mac addresses. When no arguments are
+@@ -18,11 +18,11 @@ looks for the interface with the given MAC address and renames it to the
+ name given.
+
+ When the
+-.I -s
++.I \-s
+ argument is given all error messages go to the syslog.
+
+ When the
+-.I -c
++.I \-c
+ argument is given with a file name that file is read instead of /etc/mactab.
+
+ .SH NOTES
+diff --git a/man/en_US/netstat.8 b/man/en_US/netstat.8
+index b33996a..3157dc4 100644
+--- a/man/en_US/netstat.8
++++ b/man/en_US/netstat.8
+@@ -6,9 +6,10 @@
+ .\" Modified: Bernd.Eckenfels@inka.de
+ .\" Modified: Andi Kleen ak@muc.de
+ .\" Modified: Tuan Hoang tqhoang@bigfoot.com
++.\" Modified: Brian Micek bmicek@gmail.com
+ .\"
+ .\"
+-.TH NETSTAT 8 "19 December 2000" "net-tools" "Linux Programmer's Manual"
++.TH NETSTAT 8 "2012\-09\-15" "net\-tools" "Linux System Administrator's Manual"
+
+ .SH NAME
+ netstat \- Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships
+@@ -19,17 +20,20 @@ netstat \- Print network connections, routing tables, interface statistics, masq
+ .RI [ address_family_options ]
+ .RB [ \-\-tcp | \-t ]
+ .RB [ \-\-udp | \-u ]
++.RB [ \-\-udplite | \-U ]
++.RB [ \-\-sctp | \-S ]
+ .RB [ \-\-raw | \-w ]
+ .RB [ \-\-listening | \-l ]
+ .RB [ \-\-all | \-a ]
+ .RB [ \-\-numeric | \-n ]
+-.RB [ \-\-numeric-hosts ] [ \-\-numeric-ports ] [ \-\-numeric-ports ]
++.RB [ \-\-numeric\-hosts "] [" \-\-numeric\-ports "] [" \-\-numeric\-users ]
+ .RB [ \-\-symbolic | \-N ]
+ .RB [ \-\-extend | \-e [ \-\-extend | \-e] ]
+ .RB [ \-\-timers | \-o ]
+ .RB [ \-\-program | \-p ]
+ .RB [ \-\-verbose | \-v ]
+ .RB [ \-\-continuous | \-c]
++.RB [ \-\-wide | \-W]
+ .P
+ .B netstat
+ .RB { \-\-route | \-r }
+@@ -37,37 +41,38 @@ netstat \- Print network connections, routing tables, interface statistics, masq
+ .RB [ \-\-extend | \-e [ \-\-extend | \-e] ]
+ .RB [ \-\-verbose | \-v ]
+ .RB [ \-\-numeric | \-n ]
+-.RB [ \-\-numeric-hosts ] [ \-\-numeric-ports ] [ \-\-numeric-ports ]
++.RB [ \-\-numeric\-hosts "] [" \-\-numeric\-ports "] [" \-\-numeric\-users ]
+ .RB [ \-\-continuous | \-c]
+ .P
+ .B netstat
+ .RB { \-\-interfaces | \-i }
+-.RI [ iface ]
+ .RB [ \-\-all | \-a ]
+ .RB [ \-\-extend | \-e [ \-\-extend | \-e] ]
+ .RB [ \-\-verbose | \-v ]
+ .RB [ \-\-program | \-p ]
+ .RB [ \-\-numeric | \-n ]
+-.RB [ \-\-numeric-hosts ] [ \-\-numeric-ports ] [ \-\-numeric-ports ]
++.RB [ \-\-numeric-hosts "] [" \-\-numeric-ports "] [" \-\-numeric-users ]
+ .RB [ \-\-continuous | \-c]
+ .P
+ .B netstat
+ .RB { \-\-groups | \-g }
+ .RB [ \-\-numeric | \-n ]
+-.RB [ \-\-numeric-hosts ] [ \-\-numeric-ports ] [ \-\-numeric-ports ]
++.RB [ \-\-numeric\-hosts "] [" \-\-numeric\-ports "] [" \-\-numeric\-users ]
+ .RB [ \-\-continuous | \-c]
+ .P
+ .B netstat
+ .RB { \-\-masquerade | \-M }
+ .RB [ \-\-extend | \-e ]
+ .RB [ \-\-numeric | \-n ]
+-.RB [ \-\-numeric-hosts ] [ \-\-numeric-ports ] [ \-\-numeric-ports ]
++.RB [ \-\-numeric\-hosts "] [" \-\-numeric\-ports "] [" \-\-numeric\-users ]
+ .RB [ \-\-continuous | \-c]
+ .P
+ .B netstat
+ .RB { \-\-statistics | -s }
+ .RB [ \-\-tcp | \-t ]
+ .RB [ \-\-udp | \-u ]
++.RB [ \-\-udplite | \-U ]
++.RB [ \-\-sctp | \-S ]
+ .RB [ \-\-raw | \-w ]
+ .P
+ .B netstat
+@@ -78,13 +83,26 @@ netstat \- Print network connections, routing tables, interface statistics, masq
+ .P
+ .IR address_family_options :
+ .PP
+-.RB [ \-\-protocol= { inet , unix , ipx , ax25 , netrom , ddp }[, ...] ]
++.RB [ -4 | \-\-inet ]
++.RB [ -6 | \-\-inet6 ]
++.RB [ \-\-protocol= { inet , inet6 , unix , ipx , ax25 , netrom , ddp ", ... } ]"
+ .RB [ \-\-unix | \-x ]
+-.RB [ \-\-inet | \-\-ip ]
++.RB [ \-\-inet | \-\-ip | \-\-tcpip ]
+ .RB [ \-\-ax25 ]
++.RB [ \-\-x25 ]
++.RB [ \-\-rose ]
++.RB [ \-\-ash ]
+ .RB [ \-\-ipx ]
+ .RB [ \-\-netrom ]
+-.RB [ \-\-ddp ]
++.RB [ \-\-ddp | \-\-appletalk ]
++.RB [ \-\-econet | \-\-ec ]
++
++.SH NOTES
++This program is obsolete.
++Replacement for \fBnetstat\fR is \fBss\fR.
++Replacement for \fBnetstat -r\fR is \fBip route\fR.
++Replacement for \fBnetstat -i\fR is \fBip -s link\fR.
++Replacement for \fBnetstat -g\fR is \fBip maddr\fR.
+
+ .SH DESCRIPTION
+ .B Netstat
+@@ -98,12 +116,17 @@ displays a list of open sockets. If you don't specify any
+ address families, then the active sockets of all configured address
+ families will be printed.
+ .SS "\-\-route , \-r"
+-Display the kernel routing tables.
++Display the kernel routing tables. See the description in
++.BR route (8)
++for details.
++.B netstat -r
++and
++.B route -e
++produce the same output.
+ .SS "\-\-groups , \-g"
+ Display multicast group membership information for IPv4 and IPv6.
+-.SS "\-\-interface=\fIiface \fR, \fB\-i"
+-Display a table of all network interfaces, or the specified
+-.IR iface ) .
++.SS "\-\-interfaces, \-i"
++Display a table of all network interfaces.
+ .SS "\-\-masquerade , \-M"
+ Display a list of masqueraded connections.
+ .SS "\-\-statistics , \-s"
+@@ -112,16 +135,19 @@ Display summary statistics for each protocol.
+ .SS "\-\-verbose , \-v"
+ Tell the user what is going on by being verbose. Especially print some
+ useful information about unconfigured address families.
++.SS "\-\-wide , \-W"
++Do not truncate IP addresses by using output as wide as needed. This is
++optional for now to not break existing scripts.
+ .SS "\-\-numeric , \-n"
+ Show numerical addresses instead of trying to determine symbolic host, port
+ or user names.
+-.SS "\-\-numeric-hosts"
++.SS "\-\-numeric\-hosts"
+ shows numerical host addresses but does not affect the resolution of
+ port or user names.
+-.SS "\-\-numeric-ports"
++.SS "\-\-numeric\-ports"
+ shows numerical port numbers but does not affect the resolution of
+ host or user names.
+-.SS "\-\-numeric-users"
++.SS "\-\-numeric\-users"
+ shows numerical user IDs but does not affect the resolution of host or
+ port names.
+
+@@ -131,15 +157,18 @@ protocols) for which connections are to be shown.
+ .I family
+ is a comma (',') separated list of address family keywords like
+ .BR inet ,
++.BR inet6 ,
+ .BR unix ,
+ .BR ipx ,
+ .BR ax25 ,
+ .BR netrom ,
++.BR econet ,
+ and
+ .BR ddp .
+ This has the same effect as using the
+-.BR \-\-inet ,
+-.BR \-\-unix " (" \-x ),
++.BR \-\-inet | -4 ,
++.BR \-\-inet6 | -6 ,
++.BR \-\-unix | -x ,
+ .BR \-\-ipx ,
+ .BR \-\-ax25 ,
+ .BR \-\-netrom ,
+@@ -149,7 +178,7 @@ options.
+ .P
+ The address family
+ .B inet
+-includes raw, udp and tcp protocol sockets.
++(Iv4) includes raw, udp, udplite and tcp protocol sockets.
+ .SS "\-c, \-\-continuous"
+ This will cause
+ .B netstat
+@@ -164,23 +193,24 @@ Show the PID and name of the program to which each socket belongs.
+ Show only listening sockets. (These are omitted by default.)
+ .SS "\-a, \-\-all"
+ Show both listening and non-listening sockets. With the
+-.B --interfaces
+-option, show interfaces that are not marked
++.B \-\-interfaces
++option, show interfaces that are not up
+ .SS "\-F"
+ Print routing information from the FIB. (This is the default.)
+ .SS "\-C"
+ Print routing information from the route cache.
+-.IR UP .
+ .P
+ .SH OUTPUT
+ .P
+-.SS Active Internet connections \fR(TCP, UDP, raw)\fR
++.SS Active Internet connections \fR(TCP, UDP, UDPLite, raw)\fR
+ .SS "Proto"
+-The protocol (tcp, udp, raw) used by the socket.
+-.SS "Recv-Q"
+-The count of bytes not copied by the user program connected to this socket.
+-.SS "Send-Q"
+-The count of bytes not acknowledged by the remote host.
++The protocol (tcp, udp, udpl, raw) used by the socket.
++.SS "Recv\-Q"
++Established: The count of bytes not copied by the user program connected to this socket.
++Listening: Since Kernel 2.6.18 this column contains the current syn backlog.
++.SS "Send\-Q"
++Established: The count of bytes not acknowledged by the remote host.
++Listening: Since Kernel 2.6.18 this column contains the maximum size of the syn backlog.
+ .SS "Local Address"
+ Address and port number of the local end of the socket. Unless the
+ .BR \-\-numeric " (" \-n )
+@@ -192,7 +222,7 @@ Address and port number of the remote end of the socket.
+ Analogous to "Local Address."
+ .SS "State"
+ The state of the socket. Since there are no states in raw mode and usually no
+-states used in UDP, this column may be left blank. Normally this can be one
++states used in UDP and UDPLite, this column may be left blank. Normally this can be one
+ of several values:
+ .TP
+ .I
+@@ -221,7 +251,7 @@ TIME_WAIT
+ The socket is waiting after close to handle packets still in the network.
+ .TP
+ .I
+-CLOSED
++CLOSE
+ The socket is not being used.
+ .TP
+ .I
+@@ -255,7 +285,7 @@ The username or the user id (UID) of the owner of the socket.
+ .SS "PID/Program name"
+ Slash-separated pair of the process id (PID) and process name of the
+ process that owns the socket.
+-.B --program
++.B \-\-program
+ causes this column to be included. You will also need
+ .I superuser
+ privileges to see this information on sockets you don't own. This
+@@ -356,13 +386,6 @@ to the socket.
+ .SS Active AX.25 sockets
+ (this needs to be done by somebody who knows it)
+ .PP
+-.SH NOTES
+-Starting with Linux release 2.2
+-.B netstat -i
+-does not show interface statistics for alias interfaces. To get per
+-alias interface counters you need to setup explicit rules using the
+-.BR ipchains(8)
+-command.
+
+ .SH FILES
+ .ta
+@@ -385,6 +408,9 @@ status information via the following files.
+ .I /proc/net/udp
+ -- UDP socket information
+
++.I /proc/net/udplite
++-- UDPLite socket information
++
+ .I /proc/net/igmp
+ -- IGMP multicast information
+
+@@ -428,9 +454,10 @@ status information via the following files.
+ .SH SEE ALSO
+ .BR route (8),
+ .BR ifconfig (8),
+-.BR ipchains (8),
+ .BR iptables (8),
+ .BR proc (5)
++.BR ss (8)
++.BR ip (8)
+ .P
+ .SH BUGS
+ Occasionally strange information may appear if a socket changes
+@@ -438,12 +465,10 @@ as it is viewed. This is unlikely to occur.
+ .P
+ .SH AUTHORS
+ The netstat user interface was written by Fred Baumgarten
+-<dc6iq@insu1.etec.uni-karlsruhe.de> the man page basically
++<dc6iq@insu1.etec.uni\-karlsruhe.de>, the man page basically
+ by Matt Welsh <mdw@tc.cornell.edu>. It was updated by
+-Alan Cox <Alan.Cox@linux.org> but could do with a bit more
+-work. It was updated again by Tuan Hoang
+-<tqhoang@bigfoot.com>.
+-.br
+-The man page and the command included in the net-tools
+-package is totally rewritten by Bernd Eckenfels
+-<ecki@linux.de>.
++Alan Cox <Alan.Cox@linux.org>, updated again by Tuan Hoang
++<tqhoang@bigfoot.com>. The man page and the command included
++in the net\-tools package is totally rewritten by Bernd Eckenfels
++<ecki@linux.de>. UDPLite options were added by Brian Micek
++<bmicek@gmail.com>
+diff --git a/man/en_US/plipconfig.8 b/man/en_US/plipconfig.8
+index c6d2567..d42a0bc 100644
+--- a/man/en_US/plipconfig.8
++++ b/man/en_US/plipconfig.8
+@@ -1,10 +1,18 @@
+-.TH PLIPCONFIG 8 "17 February 1995" "" ""
++.TH PLIPCONFIG 8 "2008\-10\-03" "net\-tools" "Linux System Administrator's Manual"
+ .SH NAME
+ plipconfig \- fine tune PLIP device parameters
+ .SH SYNOPSIS
+-.B "plipconfig interface"
++.B plipconfig interface
++.RB [ nibble
++.IR NN ]
++.RB [ trigger
++.IR NN ]
+ .br
+-.B "plipconfig interface [nibble NN] [trigger NN] [unit NN]"
++.B plipconfig
++.RB [ \-V ]
++.RB [ \-\-version ]
++.RB [ \-h ]
++.RB [ \-\-help ]
+ .SH DESCRIPTION
+ .B Plipconfig
+ is used to (hopefully) improve PLIP performance by changing the default
+diff --git a/man/en_US/rarp.8 b/man/en_US/rarp.8
+index e462799..d9d31f9 100644
+--- a/man/en_US/rarp.8
++++ b/man/en_US/rarp.8
+@@ -1,20 +1,20 @@
+-.TH RARP 8 "4 August 1997" "net-tools" "Linux Programmer's Manual"
++.TH RARP 8 "2008\-10\-03" "net\-tools" "Linux System Administrator's Manual"
+ .SH NAME
+ rarp \- manipulate the system RARP table
+ .SH SYNOPSIS
+-.B "rarp [-V] [--version] [-h] [--help]"
++.B "rarp [\-V] [\-\-version] [\-h] [\-\-help]"
+ .br
+-.B "rarp -a"
++.B "rarp \-a"
+ .br
+-.B "rarp [-v] -d hostname ..."
++.B "rarp [\-v] \-d hostname ..."
+ .br
+-.B "rarp [-v] [-t type] -s hostname hw_addr"
++.B "rarp [\-v] [\-t type] \-s hostname hw_addr"
+ .SH NOTE
+ .P
+ This program is obsolete. From version 2.3, the Linux kernel
+ no longer contains RARP support. For a replacement RARP daemon, see
+ .I
+-ftp://ftp.dementia.org/pub/net-tools
++ftp://ftp.dementia.org/pub/net\-tools
+ .SH DESCRIPTION
+ .B Rarp
+ manipulates the kernel's RARP table in various ways. The primary options
+@@ -61,8 +61,8 @@ Remove all RARP entries for the specified host.
+ Create a RARP address mapping entry for host
+ .B hostname
+ with hardware address set to
+-.B hw_addr
+-. The format of the hardware address is dependent on the hardware
++.BR hw_addr .
++The format of the hardware address is dependent on the hardware
+ class, but for most classes one can assume that the usual presentation
+ can be used. For the Ethernet class, this is 6 bytes in hexadecimal,
+ separated by colons.
+diff --git a/man/en_US/route.8 b/man/en_US/route.8
+index f59c074..19895e9 100644
+--- a/man/en_US/route.8
++++ b/man/en_US/route.8
+@@ -1,57 +1,62 @@
+-.TH ROUTE 8 "2 January 2000" "net-tools" "Linux Programmer's Manual"
++.TH ROUTE 8 "2014\-02\-17" "net\-tools" "Linux System Administrator's Manual"
+ .SH NAME
+ route \- show / manipulate the IP routing table
+ .SH SYNOPSIS
+ .B route
+-.RB [ \-CFvnee ]
++.RB [ \-CFvnNee ]
++.RB [ \-A
++family
++.RB | \-4 | \-6 ]
+ .TP
+ .B route
+ .RB [ \-v ]
+ .RB [ \-A
+-family]
++family
++.RB | \-4 | \-6 ]
+ .B add
+ .RB [ \-net | \-host ]
+-target
++.I target
+ .RB [ netmask
+-Nm]
++.IR Nm ]
+ .RB [ gw
+-Gw]
++.IR Gw ]
+ .RB [ metric
+-N]
++.IR N ]
+ .RB [ mss
+-M]
++.IR M ]
+ .RB [ window
+-W]
++.IR W ]
+ .RB [ irtt
+-I]
++.IR I ]
+ .RB [ reject ]
+ .RB [ mod ]
+ .RB [ dyn ]
+ .RB [ reinstate ]
+ .RB [[ dev ]
+-If]
++.IR If ]
+ .TP
+ .B route
+ .RB [ \-v ]
+ .RB [ \-A
+-family]
++.I family
++.RB | \-4 | \-6 ]
+ .B del
+ .RB [ \-net | \-host ]
+-target
++.I target
+ .RB [ gw
+-Gw]
++.IR Gw ]
+ .RB [ netmask
+-Nm]
++.IR Nm ]
+ .RB [ metric
+-N]
++.IR M ]
+ .RB [[ dev ]
+-If]
++.IR If ]
+ .TP
+ .B route
+ .RB [ \-V ]
+ .RB [ \-\-version ]
+ .RB [ \-h ]
+-.RB [ \--help ]
++.RB [ \-\-help ]
+ .SH DESCRIPTION
+ .B Route
+ manipulates the kernel's IP routing tables. Its primary use is to set
+@@ -72,19 +77,27 @@ displays the current contents of the routing tables.
+
+ .SH OPTIONS
+ .TP
+-.B \-A family
+-use the specified address family (eg `inet'; use `route --help' for a full
+-list).
++\fB\-A \fIfamily\fR
++use the specified address family (eg `inet'). Use
++.B route \-\-help
++for a full list. You can use
++.B \-6
++as an alias for
++.B \-\-inet6
++and
++.B \-4
++as an alias for
++.B \-A inet
++.
+
+ .TP
+-.B -F
++.B \-F
+ operate on the kernel's FIB (Forwarding Information Base) routing
+ table.
+ This is the default.
+ .TP
+-.B -C
++.B \-C
+ operate on the kernel's routing cache.
+-
+ .TP
+ .B \-v
+ select verbose operation.
+@@ -96,11 +109,10 @@ nameserver has vanished.
+ .TP
+ .B \-e
+ use
+-.BR netstat (8)-format
++.BR netstat (8)\-format
+ for displaying the routing table.
+ .B \-ee
+ will generate a very long line with all parameters from the routing table.
+-
+ .TP
+ .B del
+ delete a route.
+@@ -108,25 +120,27 @@ delete a route.
+ .B add
+ add a new route.
+ .TP
+-.B target
+-the destination network or host. You can provide IP addresses in dotted
+-decimal or host/network names.
++.I target
++the destination network or host. You can provide an addresses or symbolic
++network or host name. Optionally you can use \fB/\fIprefixlen\fR notation
++instead of using the \fBnetmask\fR option.
+ .TP
+ .B \-net
+ the
+-.B target
++.I target
+ is a network.
+ .TP
+-.B -host
++.B \-host
+ the
+-.B target
++.I target
+ is a host.
+ .TP
+-.B netmask NM
++\fBnetmask \fINM\fR
+ when adding a network route, the netmask to be used.
+ .TP
+-.B gw GW
++\fBgw \fIGW\fR
+ route packets via a gateway.
++.br
+ .B NOTE:
+ The specified gateway must be reachable first. This usually means that
+ you have to set up a static route to the gateway beforehand. If you specify
+@@ -134,91 +148,94 @@ the address of one of your local interfaces, it will be used to decide about
+ the interface to which the packets should be routed to. This is a BSDism
+ compatibility hack.
+ .TP
+-.B metric M
+-set the metric field in the routing table (used by routing daemons) to M.
++\fBmetric \fIM\fR
++set the metric field in the routing table (used by routing daemons) to \fIM\fR. If this option is not specified the metric for inet6 (IPv6) address family defaults to '1', for inet (IPv4) it defaults to '0'. You should always specify an explicit metric value to not rely on those defaults - they also differ from iproute2.
+ .TP
+-.B mss M
+-set the TCP Maximum Segment Size (MSS) for connections over this route
+-to M bytes.
+-The default is the device MTU minus headers, or a lower MTU when path mtu
+-discovery occured. This setting can be used to force smaller TCP packets on the
+-other end when path mtu discovery does not work (usually because of
+-misconfigured firewalls that block ICMP Fragmentation Needed)
++\fBmss \fIM\fR
++sets MTU (Maximum Transmission Unit) of the route to \fIM\fR bytes.
++Note that the current implementation of the route command does not allow
++the option to set the Maximum Segment Size (MSS).
+ .TP
+-.B window W
+-set the TCP window size for connections over this route to W
++\fBwindow \fIW\fR
++set the TCP window size for connections over this route to \fIW\fR
+ bytes. This is typically only used on AX.25 networks and with drivers
+ unable to handle back to back frames.
+ .TP
+-.B irtt I
++\fBirtt \fII\fR
+ set the initial round trip time (irtt) for TCP connections over this
+-route to I milliseconds (1-12000). This is typically only used on
++route to \fII\fR milliseconds (1-12000). This is typically only used on
+ AX.25 networks. If omitted the RFC 1122 default of 300ms is used.
+ .TP
+ .B reject
+ install a blocking route, which will force a route lookup to fail.
+ This is for example used to mask out networks before using the default
+-route. This is NOT for firewalling.
++route. This is NOT for firewalling.
+ .TP
+ .B mod, dyn, reinstate
+ install a dynamic or modified route. These flags are for diagnostic
+ purposes, and are generally only set by routing daemons.
+ .TP
+-.B dev If
++\fBdev \fIIf\fR
+ force the route to be associated with the specified device, as the
+ kernel will otherwise try to determine the device on its own (by
+ checking already existing routes and device specifications, and where
+ the route is added to). In most normal networks you won't need this.
+
+-If
+-.B dev If
++If \fBdev \fIIf\fR
+ is the last option on the command line, the word
+ .B dev
+ may be omitted, as it's the default. Otherwise the order of the route
+-modifiers (metric - netmask - gw - dev) doesn't matter.
++modifiers (\fBmetric netmask gw dev\fR) doesn't matter.
+
+ .SH EXAMPLES
+ .TP
+-.B route add -net 127.0.0.0
+-adds the normal loopback entry, using netmask 255.0.0.0 (class A net,
+-determined from the destination address) and associated with the
+-"lo" device (assuming this device was prviously set up correctly with
++.B route add \-net 127.0.0.0 netmask 255.0.0.0 metric 1024 dev lo
++adds the normal loopback entry, using netmask 255.0.0.0 and associated with the
++"lo" device (assuming this device was previously set up correctly with
+ .BR ifconfig (8)).
+
+ .TP
+-.B route add -net 192.56.76.0 netmask 255.255.255.0 dev eth0
+-adds a route to the network 192.56.76.x via
+-"eth0". The Class C netmask modifier is not really necessary here because
+-192.* is a Class C IP address. The word "dev" can be omitted here.
++.B route add \-net 192.56.76.0 netmask 255.255.255.0 metric 1024 dev eth0
++adds a route to the local network 192.56.76.x via
++"eth0". The word "dev" can be omitted here.
+
+ .TP
+-.B route add default gw mango-gw
++.B route del default
++deletes the current default route, which is labeled "default" or 0.0.0.0
++in the destination field of the current routing table.
++
++.TP
++.B route add default gw mango
+ adds a default route (which will be used if no other route matches).
+-All packets using this route will be gatewayed through "mango-gw". The
++All packets using this route will be gatewayed through the address of a node
++named "mango". The
+ device which will actually be used for that route depends on how we
+-can reach "mango-gw" - the static route to "mango-gw" will have to be
+-set up before.
++can reach "mango" - "mango" must be on directly reachable route.
+
+ .TP
+-.B route add ipx4 sl0
+-Adds the route to the "ipx4" host via the SLIP interface (assuming that
+-"ipx4" is the SLIP host).
++.B route add mango sl0
++Adds the route to the host named "mango" via the SLIP interface (assuming that
++"mango" is the SLIP host).
+
+ .TP
+-.B route add -net 192.57.66.0 netmask 255.255.255.0 gw ipx4
++.B route add \-net 192.57.66.0 netmask 255.255.255.0 gw mango
+ This command adds the net "192.57.66.x" to be gatewayed through the former
+ route to the SLIP interface.
+
+ .TP
+-.B route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0
++.B route add \-net 224.0.0.0 netmask 240.0.0.0 dev eth0
+ This is an obscure one documented so people know how to do it. This sets
+ all of the class D (multicast) IP routes to go via "eth0". This is the
+ correct normal configuration line with a multicasting kernel.
+
+ .TP
+-.B route add -net 10.0.0.0 netmask 255.0.0.0 reject
++.B route add \-net 10.0.0.0 netmask 255.0.0.0 metric 1024 reject
+ This installs a rejecting route for the private network "10.x.x.x."
+
++.TP
++.B route -6 add 2001:0002::/48 metric 1 dev eth0
++This adds a IPv6 route with the specified metric to be directly reachable via eth0.
++
+ .LP
+ .SH OUTPUT
+ The output of the kernel routing table is organized in the following columns
+@@ -275,21 +292,20 @@ entry)
+ route)
+ .TP
+ .B Metric
+-The 'distance' to the target (usually counted in hops). It is not used by
+-recent kernels, but may be needed by routing daemons.
++The 'distance' to the target (usually counted in hops).
+ .TP
+ .B Ref
+ Number of references to this route. (Not used in the Linux kernel.)
+ .TP
+ .B Use
+-Count of lookups for the route. Depending on the use of -F and -C this will
+-be either route cache misses (-F) or hits (-C).
++Count of lookups for the route. Depending on the use of \-F and \-C this will
++be either route cache misses (\-F) or hits (\-C).
+ .TP
+ .B Iface
+ Interface to which packets for this route will be sent.
+ .TP
+ .B MSS
+-Default maximum segement size for TCP connections over this route.
++Default maximum segment size for TCP connections over this route.
+ .TP
+ .B Window
+ Default window size for TCP connections over this route.
+@@ -313,8 +329,12 @@ Whether or not the hardware address for the cached route is up to date.
+ .br
+ .I /proc/net/rt_cache
+ .LP
+-.SH SEE ALSO
+-.I ifconfig(8), netstat(8), arp(8), rarp(8)
++.SH "SEE ALSO"
++.IR ifconfig (8),
++.IR netstat (8),
++.IR arp (8),
++.IR rarp (8),
++.IR ip (8)
+ .LP
+ .SH HISTORY
+ .B Route
+@@ -323,4 +343,4 @@ for Linux was originally written by Fred N. van Kempen,
+ Linus Torvalds for pl15. Alan Cox added the mss and window options for
+ Linux 1.1.22. irtt support and merged with netstat from Bernd Eckenfels.
+ .SH AUTHOR
+-Currently maintained by Phil Blundell <Philip.Blundell@pobox.com>.
++Currently maintained by Phil Blundell <Philip.Blundell@pobox.com> and Bernd Eckenfels <net-tools@lina.inka.de>.
+diff --git a/man/en_US/slattach.8 b/man/en_US/slattach.8
+index 0c4c863..0e2cfcc 100644
+--- a/man/en_US/slattach.8
++++ b/man/en_US/slattach.8
+@@ -1,8 +1,8 @@
+-.TH SLATTACH 8 "12 Feb 1994" "" ""
++.TH SLATTACH 8 "2011\-12\-31" "net\-tools" "Linux System Administrator's Manual"
+ .SH NAME
+ slattach \- attach a network interface to a serial line
+ .SH SYNOPSIS
+-.B "slattach [-dehlLmnqv] [-c command] [-p proto] [-s speed] [tty]"
++.B "slattach [\-dehlLmnqv] [\-c command] [\-p proto] [\-s speed] [tty]"
+ .br
+ .SH DESCRIPTION
+ .B Slattach
+@@ -11,47 +11,53 @@ is a tiny little program that can be used to put a normal terminal
+ you to use it for point-to-point links to other computers.
+ .SH OPTIONS
+ .TP
+-.B "[-c command]"
++.B tty
++Path to a serial device like
++.IR /dev/ttyS* ", " /dev/cua* " or " /dev/ptmx
++to spawn a new pseudo tty.
++.TP
++.B "[\-c command]"
+ Execute
+ .B command
+ when the line is hung up. This can be used to run scripts or re-establish
+ connections when a link goes down.
+ .TP
+-.B "[-d]"
++.B "[\-d]"
+ Enable debugging output. Useful when determining why a given
+ setup doesn't work.
+ .TP
+-.B "[-h]"
++.B "[\-h]"
+ Exit when the carrier is lost. This works on both /dev/tty and /dev/cua
+ devices by directly monitoring the carrier status every 15 seconds.
+-.B "[-v]"
++.TP
++.B "[\-v]"
+ Enable verbose output. Useful in shell scripts.
+ .TP
+-.B "[-q]"
++.B "[\-q]"
+ Operate in quiet mode - no messages at all.
+ .TP
+-.B "[-l]"
++.B "[\-l]"
+ Create an UUCP-style lockfile for the device in /var/lock.
+ .TP
+-.B "[-n]"
++.B "[\-n]"
+ Equivalent to the "mesg n" command.
+ .TP
+-.B "[-m]"
++.B "[\-m]"
+ Do \fBnot\fP initialize the line into 8 bits raw mode.
+ .TP
+-.B "[-e]"
++.B "[\-e]"
+ Exit right after initializing device, instead of waiting for the
+-line to hangup.
++line to hang up.
+ .TP
+-.B "[-L]"
++.B "[\-L]"
+ Enable 3 wire operation. The terminal is moved into CLOCAL mode,
+ carrier watching is disabled.
+ .TP
+-.B "[-p proto]"
++.B "[\-p proto]"
+ Set a specific kind of protocol to use on the line. The default
+ is set to
+-.B "cslip"
+-, i.e. compressed SLIP. Other possible values are
++.BR "cslip" ,
++i.e. compressed SLIP. Other possible values are
+ .B "slip"
+ (normal SLIP),
+ .B "adaptive"
+@@ -70,14 +76,14 @@ to be active on the line. For kiss connections the
+ .B axattach
+ program should be used.
+ .TP
+-.B "[-s speed]"
++.B "[\-s speed]"
+ Set a specific line speed, other than the default.
+ .PP
+ If no arguments are given, the current terminal line (usually: the
+ login device) is used. Otherwise, an attempt is made to claim the
+ indicated terminal port, lock it, and open it.
+ .SH FILES
+-.I /dev/cua* /var/lock/LCK.*
++.I /dev/cua* /var/lock/LCK.* /dev/ttyS* /dev/ptmx
+ .SH BUGS
+ None known.
+ .SH SEE ALSO
+diff --git a/man/fr_FR/arp.8 b/man/fr_FR/arp.8
+index df37e8b..a669469 100644
+--- a/man/fr_FR/arp.8
++++ b/man/fr_FR/arp.8
+@@ -1,32 +1,32 @@
+-.TH ARP 8 "5 Jan 1999" "net-tools" "Linux Programmer's Manual"
++.TH ARP 8 "5 Jan 1999" "net-tools" "Linux Administrator's Manual"
+ .SH NOM
+-arp \- manipule la table ARP du systme
++arp \- manipule la table ARP du système
+ .SH SYNOPSIS
+ .B arp
+ .RB [ \-vn ]
+ .RB [ "\-H type" ]
+ .RB [ "-i if" ]
+ .B -a
+-.RB [ nom_hte ]
++.RB [ nom_hôte ]
+ .PP
+ .B arp
+ .RB [ \-v ]
+ .RB [ "\-i if" ]
+-.B "\-d nom_hte"
++.B "\-d nom_hôte"
+ .RB [ pub ]
+ .PP
+ .B arp
+ .RB [ \-v ]
+ .RB [ "\-H type" ]
+ .RB [ "\-i if" ]
+-.B -s nom_hte hw_addr
++.B -s nom_hôte hw_addr
+ .RB [ temp ]
+ .PP
+ .B arp
+ .RB [ \-v ]
+ .RB [ "\-H type" ]
+ .RB [ "\-i if" ]
+-.B -s nom_hte hw_addr
++.B -s nom_hôte hw_addr
+ .RB [ "netmask nm" ]
+ .B pub
+ .PP
+@@ -34,7 +34,7 @@ arp \- manipule la table ARP du syst
+ .RB [ \-v ]
+ .RB [ "\-H type" ]
+ .RB [ "\-i if" ]
+-.B -Ds nom_hte ifa
++.B -Ds nom_hôte ifa
+ .RB [ "netmask nm" ]
+ .B pub
+ .PP
+@@ -46,33 +46,33 @@ arp \- manipule la table ARP du syst
+
+ .SH DESCRIPTION
+ .B Arp
+-manipule la table ARP du noyau de diffrentes faons. Les options principales
+-permettent d'effacer une correspondance d'adresses et d'en dfinir
++manipule la table ARP du noyau de différentes façons. Les options principales
++permettent d'effacer une correspondance d'adresses et d'en définir
+ une manuellement.
+-Pour les besoins de dbogage, le programme
++Pour les besoins de débogage, le programme
+ .B arp
+ permet aussi d'effectuer un dump complet de la table ARP.
+ .SH OPTIONS
+ .TP
+ .B "\-v, \-\-verbose"
+-Dit l'utilisateur ce qui se passe en tant verbeux.
++Dit à l'utilisateur ce qui se passe en étant verbeux.
+ .TP
+ .B "\-n, \-\-numeric"
+-Affiche les adresses numriques au lieu d'essayer de dterminer les nom
+-d'htes symboliques.
++Affiche les adresses numériques au lieu d'essayer de déterminer les nom
++d'hôtes symboliques.
+ .TP
+ .B "\-H type, \-\-hw-type type"
+-En positionnant ou lisant les entres ARP, ce paramtre optionnel indique
+-
++En positionnant ou lisant les entrées ARP, ce paramètre optionnel indique
++à
+ .B arp
+-les classes d'entres qu'il doit contrler. La valeur par dfaut de
+-ce paramtre est
++les classes d'entrées qu'il doit contrôler. La valeur par défaut de
++ce paramètre est
+ .B ether
+-(i.e. code de matriel
++(i.e. code de matériel
+ .B 0x01
+ pour
+ .B "IEEE 802.3 10Mbps Ethernet".
+-D'autres valeurs doivent correspondre des technologies rseaux telles que
++D'autres valeurs doivent correspondre à des technologies réseaux telles que
+ .RB "ARCnet (" arcnet ")"
+ ,
+ .RB "PROnet (" pronet ")"
+@@ -81,89 +81,89 @@ D'autres valeurs doivent correspondre
+ and
+ .RB "NET/ROM (" netrom ")."
+ .TP
+-.B "\-a [nom_d_hte], \-\-display [nom_d_hte]"
+-Affiche les entres concernant l'hte spcifi. Si le paramtre
+-.B nom_d_hte
+-n'est pas utilis,
++.B "\-a [nom_d_hôte], \-\-display [nom_d_hôte]"
++Affiche les entrées concernant l'hôte spécifié. Si le paramètre
++.B nom_d_hôte
++n'est pas utilisé,
+ .B toutes
+-les entres seront affiches.
++les entrées seront affichées.
+ .TP
+-.B "\-d nom_d_hte, \-\-delete nom_d_hte"
+-Enlve une entre pour l'hte spcifi. Ceci peut tre
+-utilis si l'hte concern ne fonctionne plus, par exemple.
++.B "\-d nom_d_hôte, \-\-delete nom_d_hôte"
++Enlève une entrée pour l'hôte spécifié. Ceci peut être
++utilisé si l'hôte concerné ne fonctionne plus, par exemple.
+ .TP
+ .B "\-D, \-\-use-device"
+-Utilise l'adresse matrielle de l'interface
++Utilise l'adresse matérielle de l'interface
+ .BR ifa
+ .
+ .TP
+ .B "\-i If, \-\-device If"
+-Slectionne une interface. Lors du dump du cache ARP, seules les entres
+-correspondant l'interface spcifie seront affiches. Lorsque l'on dfinit
+-une entre permanente ou une entre
++Sélectionne une interface. Lors du dump du cache ARP, seules les entrées
++correspondant à l'interface spécifiée seront affichées. Lorsque l'on définit
++une entrée permanente ou une entrée
+ .B temp
+-, cette interface lui sera associe; si cette option n'est pas utilise,
+-le noyau fera des tentatives de rsolution selon la table de routage. Pour
+-les entres
++, cette interface lui sera associée; si cette option n'est pas utilisée,
++le noyau fera des tentatives de résolution selon la table de routage. Pour
++les entrées
+ .B pub
+-l'interface spcifie est celle pour laquelle les requtes ARP auront trouv
+-une rponse.
++l'interface spécifiée est celle pour laquelle les requêtes ARP auront trouvé
++une réponse.
+ .br
+ .B NOTE:
+-Ceci est diffrent de l'interface vers laquelle les datagrammes IP seront routs.
++Ceci est différent de l'interface vers laquelle les datagrammes IP seront routés.
+ .TP
+-.B "\-s nom_d_hte hw_addr, \-\-set hostname hw_addr"
+-Cre manuellement une correspondance d'adresses ARP pour l'hte
+-.B nom_d_hte
+-avec l'adresse matrielle positionne
++.B "\-s nom_d_hôte hw_addr, \-\-set hostname hw_addr"
++Crée manuellement une correspondance d'adresses ARP pour l'hôte
++.B nom_d_hôte
++avec l'adresse matérielle positionnée à
+ .B hw_addr.
+-Le format de l'adresse matrielle est dpendant de la classe du matriel,
+-mais pour la plupart on peut considrer que la prsentation classique
+-peut tre utilise. Pour la classe Ethernet, c'est 6 octets en hexadcimal,
+-spars par des double-points. Pour ajouter des entres proxy-arp
++Le format de l'adresse matérielle est dépendant de la classe du matériel,
++mais pour la plupart on peut considérer que la présentation classique
++peut être utilisée. Pour la classe Ethernet, c'est 6 octets en hexadécimal,
++séparés par des double-points. Pour ajouter des entrées proxy-arp
+ (Ce sont celles avec l'indicateur
+ .BR pub lish
+-positionn)
+-un masque rseau (
++positionné)
++un masque réseau (
+ .B netmask
+-) peut tre spcifi au proxy-arp pour le
+-sous-rseau entier. Ceci n'est pas trs recommand, mais est support par
++) peut être spécifié au proxy-arp pour le
++sous-réseau entier. Ceci n'est pas très recommandé, mais est supporté par
+ les anciens noyaux, car c'est utile dans certains cas. Si l'indicateur
+ .B temp
+-n'est pas fourni, les entres ARP seront permanentes.
++n'est pas fourni, les entrées ARP seront permanentes.
+ .br
+ .B NOTE:
+-A partir du noyau 2.2.0 il n'est plus possible de dfinir des entres ARP
+-pour un sous rseau entier.
++A partir du noyau 2.2.0 il n'est plus possible de définir des entrées ARP
++pour un sous réseau entier.
+ .TP
+ .B "\-f nom_de_fichier, \-\-file nom_de_fichier"
+-Similaire l'option
++Similaire à l'option
+ .B \-s
+ , mais cette fois les informations d'adresses sont prises dans le fichier
+-.B nom_de_fichier
+-. Ceci peut tre utilis si les entres ARP configurer sont
+-nombreuses. Le nom du fichier de donnes est trs souvent nomm
++.BR nom_de_fichier .
++Ceci peut être utilisé si les entrées ARP à configurer sont
++nombreuses. Le nom du fichier de données est très souvent nommé
+ .B /etc/ethers
+ , mais ce n'est pas officiel.
+ .sp 1
+ Le format du fichier est simple; Il contient
+-seulement des lignes de texte ASCII avec sur chaque ligne un nom d'hte et
+-une adresse matrielle, spars par des espaces. Les indicateurs
++seulement des lignes de texte ASCII avec sur chaque ligne un nom d'hôte et
++une adresse matérielle, séparés par des espaces. Les indicateurs
+ .BR "pub" , " temp" " et" " netmask"
+-peuvent galement tre utiliss.
++peuvent également être utilisés.
+ .LP
+-A tous les endroits o un
+-.B nom d'hte
++A tous les endroits où un
++.B nom d'hôte
+ est attendu, on peut aussi entrer une
+ .B "addresse IP"
+-en notation dcimale pointe.
++en notation décimale pointée.
+ .LP
+-Chaque entre complte se trouvant dans le cache ARP est marque de
++Chaque entrée complète se trouvant dans le cache ARP est marquée de
+ l'indicateur
+-.B C
+-. Les entres permanentes sont marques de l'indicateur
++.BR C .
++Les entrées permanentes sont marquées de l'indicateur
+ .B M
+-et les entres 'pub' ont l'indicateur
++et les entrées 'pub' ont l'indicateur
+ .B P
+ .
+ .SH FICHIERS
+@@ -177,8 +177,8 @@ et les entr
+ .SH VOIR AUSSI
+ rarp(8), route(8), ifconfig(8), netstat(8)
+ .SH AUTEUR
+-Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org> avec les amliorations
+-apportes par le mainteneur des net-tools Bernd Eckenfels
++Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org> avec les améliorations
++apportées par le mainteneur des net-tools Bernd Eckenfels
+ <net-tools@lina.inka.de>.
+ .SH TRADUCTION
+ Jean Michel VANSTEENE (vanstee@worldnet.fr)
+diff --git a/man/fr_FR/ethers.5 b/man/fr_FR/ethers.5
+index 5e70929..030fdf6 100644
+--- a/man/fr_FR/ethers.5
++++ b/man/fr_FR/ethers.5
+@@ -5,7 +5,7 @@
+ .\"
+ .TH ETHERS 5 "26 Avril 1996" "" "Formats de fichiers"
+ .SH NOM \"{{{roff}}}\"{{{
+-ethers \- Base de donnes adresses Ethernet - adresses IP
++ethers \- Base de données adresses Ethernet - adresses IP
+ .\"}}}
+ .SH DESCRIPTION \"{{{
+ \fB/etc/ethers\fP contient des adresses Ethernet sur 48 bits et leur
+@@ -15,14 +15,14 @@ adresse IP correspondante, une ligne par adresses IP:
+ \fIAdresse-Ethernet\fP \fIAdresse-IP\fP
+ .RE
+ .sp
+-Les deux items sont spars par un ou plusieurs espaces et/ou tabulations.
+-Un \fB#\fP en dbut de ligne est un commentaire pour tout le reste de la ligne.
+-L'\fIadresse-Ethernet\fP est crite sous la forme
++Les deux items sont séparés par un ou plusieurs espaces et/ou tabulations.
++Un \fB#\fP en début de ligne est un commentaire pour tout le reste de la ligne.
++L'\fIadresse-Ethernet\fP est écrite sous la forme
+ .IR x : x : x : x : x : x ,
+-o \fIx\fP est une valeur hxadecimale comprise entre \fB0\fP et \fBff\fP
+-reprsentant un octet de l'adresse, dans l'ordre du rseau (big-endian).
+-L'\fIAdresse-IP\fP peut tre soit un nom d'hte rsolu par DNS ou une adresse
+-en notation dcimale pointe.
++où \fIx\fP est une valeur héxadecimale comprise entre \fB0\fP et \fBff\fP
++représentant un octet de l'adresse, dans l'ordre du réseau (big-endian).
++L'\fIAdresse-IP\fP peut être soit un nom d'hôte résolu par DNS ou une adresse
++en notation décimale pointée.
+ .\"}}}
+ .SH EXEMPLES \"{{{
+ 08:00:20:00:61:CA pal
+diff --git a/man/fr_FR/hostname.1 b/man/fr_FR/hostname.1
+index c4cd412..3adaf4b 100644
+--- a/man/fr_FR/hostname.1
++++ b/man/fr_FR/hostname.1
+@@ -1,16 +1,16 @@
+ .TH HOSTNAME 1 "15 Mars 1999" "net-tools" "Linux Programmer's Manual"
+ .SH NOM
+-hostname \- affiche ou dfinit le nom d'hte du systme
++hostname \- affiche ou définit le nom d'hôte du système
+ .br
+-domainname \- affiche le nom de domaine NIS/YP du systme
++domainname \- affiche le nom de domaine NIS/YP du système
+ .br
+-dnsdomainname \- affiche le nom de domaine du systme
++dnsdomainname \- affiche le nom de domaine du système
+ .br
+-nisdomainname \- affiche ou dfinit le nom de domaine NIS/YP du systme
++nisdomainname \- affiche ou définit le nom de domaine NIS/YP du système
+ .br
+-ypdomainname \- affiche ou dfinit le nom de domaine NIS/YP du systme
++ypdomainname \- affiche ou définit le nom de domaine NIS/YP du système
+ .br
+-nodename \- affiche ou dfinit le nom de domaine DECnet du systme
++nodename \- affiche ou définit le nom de domaine DECnet du système
+
+ .SH SYNOPSIS
+ .B hostname
+@@ -73,45 +73,45 @@ nodename \- affiche ou d
+
+ .SH DESCRIPTION
+ .B Hostname
+-est le programme utilis soit pour dfinir le nom d'hte, soit
+-pour visualiser le nom d'hte ou de domaine du systme. Ce nom est
+-utilis par diffrents programmes rseaux pour identifier la machine. Le
+-nom de domaine est galement utilis par les NIS/YP.
++est le programme utilisé soit pour définir le nom d'hôte, soit
++pour visualiser le nom d'hôte ou de domaine du système. Ce nom est
++utilisé par différents programmes réseaux pour identifier la machine. Le
++nom de domaine est également utilisé par les NIS/YP.
+
+ .SS "OBTENTION DU NOM"
+-Appel sans argument, le programme affiche les noms courants:
++Appelé sans argument, le programme affiche les noms courants:
+
+ .LP
+ .B hostname
+-fournit le nom du systme tel qu'il est retourn par la fonction
+-.BR getdomainname (2)
+-. Ceci est connu comme nom de domaine YP/NIS du systme.
++fournit le nom du système tel qu'il est retourné par la fonction
++.BR getdomainname (2).
++Ceci est connu comme nom de domaine YP/NIS du système.
+
+
+ .LP
+ .B nodename
+-fournit le nom de noeud DECnet du systme tel qu'il est retourn par la
++fournit le nom de noeud DECnet du système tel qu'il est retourné par la
+ fonction
+ .BR getnodename (2)
+ .
+
+ .LP
+ .B dnsdomainname
+-fournit la partie domaine du nom compltement qualifi - FQDN (Fully
+-Qualified Domain Name). Le nom FQDN du systme est retourn par la commande
++fournit la partie domaine du nom complètement qualifié - FQDN (Fully
++Qualified Domain Name). Le nom FQDN du système est retourné par la commande
+ .BR "hostname \-\-fqdn" .
+
+ .SS "SET NAME"
+-Appel avec un argument ou avec l'option
++Appelé avec un argument ou avec l'option
+ .B \-\-file
+-, la commande dfinit le nom d'hte, le nom de domaine NIS/YP ou
++, la commande définit le nom d'hôte, le nom de domaine NIS/YP ou
+ le nom de noeud.
+
+ .LP
+ Notez que seul le super-utilisateur peut changer les noms.
+
+ .LP
+-Il n'est pas possible de dfinir le nom FQDN ou le nom de domaine DNS avec
++Il n'est pas possible de définir le nom FQDN ou le nom de domaine DNS avec
+ la commande
+ .B dnsdomainname
+ (voir
+@@ -119,8 +119,8 @@ la commande
+ ci-dessous).
+
+ .LP
+-Le nom d'hte est gnrallement dfinit une seule fois, au
+-dmarrage du systme, par le script de configuration
++Le nom d'hôte est générallement définit une seule fois, au
++démarrage du système, par le script de configuration
+ .I /etc/rc.d/rc.inet1.
+ ou
+ .I /etc/init.d/boot
+@@ -132,45 +132,45 @@ Vous pouvez modifier le FQDN (tel que fourni par la commande
+ .BR "hostname \-\-fqdn" )
+ ou le nom de domaine DNS (tel que fourni par la commande
+ .BR "dnsdomainname" )
+-avec cette commande. Le FQDN du systme est le nom que le resolveur (
++avec cette commande. Le FQDN du système est le nom que le resolveur (
+ .BR resolver (3)
+- ) retourne comme nom d'hte.
++ ) retourne comme nom d'hôte.
+
+ .LP
+ Techniquement: Le FQDN est le nom fourni par
+ .BR gethostbyname (2)
+- partir du nom d'hte retourn par
++à partir du nom d'hôte retourné par
+ .BR gethostname (2).
+ Le nom de domaine DNS est la partie suivant le premier point.
+ .LP
+-La faon dont vous pouvez le changer dpend de la configuration
++La façon dont vous pouvez le changer dépend de la configuration
+ (habituellement dans
+-.IR /etc/host.conf )
+-. Si le fichier 'hosts' est analys avant d'interroger le DNS ou
++.IR /etc/host.conf ).
++Si le fichier 'hosts' est analysé avant d'interroger le DNS ou
+ NIS) vous pouvez le changer dans le fichier
+ .IR /etc/hosts .
+
+ .SH OPTIONS
+ .TP
+ .I "\-a, \-\-alias"
+-Affiche l'alias de l'hte (si utilis).
++Affiche l'alias de l'hôte (si utilisé).
+ .TP
+ .I "\-d, \-\-domain"
+ Affiche le nom du domaine DNS. Ne pas utiliser la commande
+ .B domainname
+-pour obtenir le nom de domaine DNS car vous obtiendrez en ralit le
+-nom de domaine NIS. Utilisez plutt la commande
++pour obtenir le nom de domaine DNS car vous obtiendrez en réalité le
++nom de domaine NIS. Utilisez plutôt la commande
+ .B dnsdomainname
+ .
+ .TP
+ .I "\-F, \-\-file nom_fichier"
+-Lit le nom d'hte partir du fichier spcifi. Les commentaires (lignes commenant
+-par un `#') sont ignors.
++Lit le nom d'hôte à partir du fichier spécifié. Les commentaires (lignes commençant
++par un `#') sont ignorés.
+ .TP
+ .I "\-f, \-\-fqdn, \-\-long"
+-Affiche le nom pleinement qualifi - FQDN (Fully Qualified Domain Name). un
+-FQDN consiste en un nom d'hte court et un nom de domaine. A moins que vous
+-utilisiez 'bind' ou les NIS pour la recherche d'htes, vous pouvez changer
++Affiche le nom pleinement qualifié - FQDN (Fully Qualified Domain Name). un
++FQDN consiste en un nom d'hôte court et un nom de domaine. A moins que vous
++utilisiez 'bind' ou les NIS pour la recherche d'hôtes, vous pouvez changer
+ le nom FQDN et le nom de domaine (qui fait partie du FQDN) dans le fichier
+ \fI/etc/hosts\fR.
+ .TP
+@@ -178,15 +178,15 @@ le nom FQDN et le nom de domaine (qui fait partie du FQDN) dans le fichier
+ Affiche un message d'aide et se termine.
+ .TP
+ .I "\-i, \-\-ip-address"
+-Affiche la (les) adresse(s) IP de l'hte.
++Affiche la (les) adresse(s) IP de l'hôte.
+ .TP
+ .I "\-n, \-\-node"
+-Affiche le nom de noeud DECnet. Si un paramtre est fourni (ou
++Affiche le nom de noeud DECnet. Si un paramètre est fourni (ou
+ .B \-\-file nom_fichier
+-) le super-utilisateur peut galement dfinir un nouveau nom de neud.
++) le super-utilisateur peut également définir un nouveau nom de neud.
+ .TP
+ .I "\-s, \-\-short"
+-Affiche le nom d'hte en format court. Il s'agit du nom d'hte coup au
++Affiche le nom d'hôte en format court. Il s'agit du nom d'hôte coupé au
+ premier point.
+ .TP
+ .I "\-V, \-\-version"
+@@ -197,9 +197,9 @@ termine correctement.
+ Mode verbeux.
+ .TP
+ .I "\-y, \-\-yp, \-\-nis"
+-Affiche le nom de domaine NIS. Si un paramtre est fourni (ou
++Affiche le nom de domaine NIS. Si un paramètre est fourni (ou
+ .B \-\-file nom_fichier
+-) le super-utilisateur peut galement dfinir un nouveau nom de domaine NIS.
++) le super-utilisateur peut également définir un nouveau nom de domaine NIS.
+ .SH FICHIERS
+ .B /etc/hosts
+ .SH AUTEURS
+diff --git a/man/fr_FR/ifconfig.8 b/man/fr_FR/ifconfig.8
+index 0c29eb0..821f164 100644
+--- a/man/fr_FR/ifconfig.8
++++ b/man/fr_FR/ifconfig.8
+@@ -1,160 +1,178 @@
+-.TH IFCONFIG 8 "4 August 1997" "net-tools" "Linux Programmer's Manual"
++.\"
++.\" Traduction : Jean Michel VANSTEENE <vanstee@worldnet.fr>
++.\" zz/08/1997
++.\" Màj zz/08/2004 net-tools-1.60 Guillaume Audirac
++.\" Màj 17/08/2006 net-tools-1.65 Alain Portal
++.\"
++.TH IFCONFIG 8 "30 juin 2005" "net-tools" "Manuel de l'administrateur Linux"
+ .SH NOM
+-ifconfig \- configure une interface rseau
++ifconfig \- Configurer une interface réseau.
+ .SH SYNOPSIS
+-.B "ifconfig [interface]"
++.B "ifconfig [\-v] [\-a] [\-s] [interface]"
+ .br
+-.B "ifconfig interface [aftype] options | adresse ..."
++.B "ifconfig [\-v] interface [aftype] options | adresse ..."
+ .SH DESCRIPTION
+-.B Ifconfig
+-est utilis pour configurer (et maintenir ensuite) les interfaces
+-rseau rsidentes dans le noyau. Il est utilis lors du boot pour
+-configurer la plupart d'entre-elles et ainsi rendre le systme
+-oprationnel. Aprs, ce n'est quasiment plus utilis que pour
+-le dbogage ou pour des rglages si ncessaire.
++.B ifconfig
++permet de configurer les interfaces réseau présentes dans le noyau.
++On peut les configurer lors du démarrage quand c'est nécessaire. Ensuite,
++on l'utilise généralement pour le débogage ou pour d'éventuels réglages.
+ .LP
+-Si aucun argument n'est donn,
++Si aucun argument n'est donné,
+ .B ifconfig
+-affiche simplement l'tat des interfaces actuellement dfinies. Si
+-seul le paramtre
++affiche l'état des interfaces actives. Si seul le paramètre
+ .B interface
+-est donn, il affiche seulement l'tat de l'interface correspondante;
+-si seul le paramtre
+-.B -a
+-est fourni, il affiche l'tat de toutes les interfaces, mme celles qui
+-ne sont pas actives.
+-Autrement, il considre qu'il faut positionner de nouvelles valeurs.
+-
+-.SH Familles d'adresses
+-Si le premier argument aprs le nom de l'interface est reconnu comme
+-tant un nom de famille d'adresses support, cette famille d'adresses
+-est utilise pour dcoder et afficher toutes les adresses
+-protocolaires. Les familles d'adresses actuellement supportes comprennent
++est donné, il affiche seulement l'état de l'interface correspondante\ ;
++si seul le paramètre
++.B \-a
++est fourni, il affiche l'état de toutes les interfaces, même celles
++qui sont inactives. Autrement, il permet de configurer une interface.
++.SH Familles d'Adresses
++Si le premier argument après le nom d'interface est reconnu comme
++le nom d'une famille d'adresses prise en charge, alors cette famille
++d'adresses est utilisée pour décoder et afficher toutes les adresses
++du protocole. Les familles d'adresses actuellement prises en charge
++comprennent
+ .B inet
+-(TCP/IP, default)
++(TCP/IP, par défaut),
++.B inet6
++(IPv6),
+ .B ax25
+-(AMPR Packet Radio.)
++(AMPR Packet Radio),
+ .B ddp
+-(Appletalk Phase 2) and
++(Appletalk Phase 2),
+ .B ipx
+-(Novell IPX).
++(Novell IPX) et
++.B netrom
++(AMPR Packet Radio).
+ .SH OPTIONS
+ .TP
++.B \-a
++Afficher toutes les interfaces actuellement disponibles, même celles
++qui sont inactives.
++.TP
++.B \-s
++Afficher un résumé (comme netstat \-i).
++.TP
++.B \-v
++Mode volubile pour certains types d'erreurs.
++.TP
+ .B interface
+-Le nom de l'interface rseau. C'est gnralement un nom de pilote suivi
+-d'un numro d'ordre comme
++Correspond au nom de l'interface de réseau. C'est généralement un nom de
++pilote suivi d'un chiffre, comme
+ .B eth0
+-pour la premire interface Ethernet.
++pour la première interface Ethernet. Si votre noyau accepte les alias
++d'interfaces, vous pouvez les spécifier avec
++.B eth0:0
++pour le premier alias de eth0. On peut les utiliser pour les affecter
++à une seconde adresse. Pour supprimer un alias d'interface, utilisez
++.BR "ifconfig eth0:0 down" .
++Note\ : pour chaque groupe (un même noeud donné par une combinaison
++adresse/masque de réseau), si vous supprimez le premier alias (le
++principal), tous les alias sont supprimés.
+ .TP
+ .B up
+-Cette option active l'interface. Elle est implicitement spcifie
+-si une nouvelle adresse est affecte l'interface (voir plus loin).
++Activer l'interface donnée. Cette option est implicite si une adresse est
++affectée à l'interface.
+ .TP
+ .B down
+-Cette option arrte le fonctionnement du pilote pour cette interface, et
+-est utilise lorsque les choses commencent aller mal.
++Désactiver le pilote pour l'interface donnée.
+ .TP
+ .B "[\-]arp"
+-Valide ou invalide l'utilisation du protocole ARP sur cette interface. Si
+-le signe moins (\-) est prsent, l'option est invalide.
++Activer ou désactiver l'utilisation du protocole ARP sur une interface.
+ .TP
+ .B "[\-]promisc"
+-Valide ou invalide le mode
+-.B promiscuous
+-. S'il est valid, tous les paquets circulant sur le rseau
+-seront reus sur cette interface.
++Activer ou désactiver le mode
++.BR promiscuous .
++S'il est activé, tous les paquets circulant sur le réseau seront reçus
++par l'interface.
+ .TP
+ .B "[\-]allmulti"
+-Valide ou invalide le fonctionnement de l'interface en mode
+-.B all-multicast
+-. S'il est valid, tous les paquets multicast circulant sur le rseau
+-seront reus sur cette interface.
++Activer ou désactiver le mode
++.BR all-multicast .
++S'il est activé, l'interface recevra tous les paquets de multidiffusion
++circulant sur le réseau.
+ .TP
+ .B "metric N"
+-Ce paramtre dfinit la mtrique de l'interface. Il n'est pour
+-l'instant pas implment, mais le sera prochainement.
++Définir la métrique de l'interface.
+ .TP
+ .B "mtu N"
+-Ce paramtre dfinit le MTU (Maximum Transfer Unit) d'une
+-interface.
++Définir l'unité de transfert maximum ou MTU («\ Maximum Transfer Unit\ »)
++d'une interface.
+ .TP
+-.B "dstaddr adr"
+-Dfinit l'adresse IP de "l'autre bout" dans le cas d'un lien
+-point--point, comme PPP. Ce paramtre est obsolte; utilisez plutt
+-le paramtre
+-.B pointopoint.
++.B "dstaddr adresse"
++Définir l'adresse IP distante dans le cas d'un lien point-à-point
++(comme PPP). Cette option est obsolète\ ; utilisez à la place l'option
++.BR pointopoint .
+ .TP
+-.B "netmask adr"
+-Dfinit le masque de rseau IP pour cette interface. La valeur par
+-dfaut de cette valeur correspond au masque rseau usuel pour les
+-classes A, B ou C (dduite de l'adresse IP), mais toute autre valeur peut
+-tre dfinie selon les besoins en sous-rseaux.
++.B "netmask adresse"
++Définir le masque de réseau IP pour cette interface. La valeur par
++défaut correspond au masque de réseau usuel pour les classes A, B ou C
++(déduite de l'adresse IP), mais une autre valeur peut être définie.
+ .TP
+-.B "add adr/lg_prefix"
+-Ajoute une adresse IPv6 une interface.
++.B "add adresse/long_préfixe"
++Ajouter une adresse IPv6 à une interface.
+ .TP
+-.B "del adr/lg_prefix"
+-Supprime une adresse IPv6 d'une interface.
++.B "del adresse/long_préfixe"
++Supprimer une adresse IPv6 d'une interface.
+ .TP
+ .B "tunnel aa.bb.cc.dd"
+-Cre un nouveau priphrique SIT (IPv6-dans-IPv4), en mode
+-tunnel jusqu' la destination.
++Créer un nouveau périphérique SIT (IPv6-dans-IPv4), fonctionnant en mode
++tunnel jusqu'à la destination donnée.
+ .TP
+-.B "irq adr"
+-Dfinit la ligne d'interruption utilise par ce
+-priphrique. Certains priphriques ne supportent pas le
+-changement dynamique de l'IRQ.
++.B "irq adresse"
++Définir la ligne d'interruption utilisée par un périphérique.
++Certains périphériques ne sont pas capables de changer
++dynamiquement d'IRQ.
+ .TP
+-.B "io_addr adr"
+-Dfinit pour ce priphrique, l'adresse de dbut dans l'espace
+-d'entre-sortie I/O.
++.B "io_addr adresse"
++Définir l'adresse de début dans l'espace d'entrée-sortie pour un
++périphérique.
+ .TP
+-.B "mem_start adr"
+-Dfinit l'adresse de dbut de mmoire partage pour ce priphrique. Seuls
+-quelques priphriques ont besoin de ce paramtre.
++.B "mem_start adresse"
++Définir l'adresse de début de la mémoire partagée utilisée par un
++périphérique. Peu de périphériques ont besoin de ce paramètre.
+ .TP
+ .B "media type"
+-Dfinit le port physique ou le type de medium utilis par ce priphrique.
+-Tous les priphriques ne peuvent pas changer de configuration et les
+-valeurs supportes varient de l'un l'autre. Les valeur typiques sont
++Définir le port physique ou le type de médium utilisé par le périphérique.
++Tous les périphériques ne peuvent pas changer cette configuration et les
++types acceptés varient de l'un à l'autre. Les valeurs habituelles du
++.B type
++sont
+ .B 10base2
+ (Ethernet fin),
+ .B 10baseT
+-(10Mbps Ethernet paire torsade),
+-.B AUI
+-(transceiver externe) etc. Le type
++(Ethernet 10Mbps en paire torsadée),
++.B AUI
++(émetteur-récepteur externe), etc. Le médium spécial de type
+ .B auto
+-permet d'indiquer au pilote de dtecter automatiquement le medium
+-utilis. Une fois de plus, tous les priphriques ne supportent pas cette
+-option.
+-.TP
+-.B "[-]broadcast [adr]"
+-Si l'adresse est galement donne, dfinit l'adresse broadcast
+-protocolaire pour cette interface. Autrement, il permet d'armer (ou dsarmer)
+-l'indicateur
++permet d'indiquer au pilote de détecter automatiquement le médium utilisé.
++Une fois de plus, tous les pilotes n'acceptent pas cette option.
++.TP
++.B "[\-]broadcast [adresse]"
++Si l'adresse est donnée, elle définit l'adresse de diffusion du
++protocole pour cette interface. Autrement, on arme
++(ou désarme) l'indicateur
+ .B IFF_BROADCAST
+ de l'interface.
+ .TP
+-.B "[-]pointopoint [adr]"
+-Ce mot cl valide le mode
+-.B point--point
+-d'une interface, signifiant qu'il existe un lien direct entre 2 machines,
+-sans que personne d'autre ne puisse tre l'coute.
++.B "[\-]pointopoint [adresse]"
++Valider le mode
++.B point-à-point
++d'une interface, signifiant qu'il existe un lien direct entre 2\ machines,
++sans que personne d'autre ne puisse être à l'écoute.
+ .br
+-Si l'argument d'adresse est galement donn, il dfinit l'adresse
+-de l'autre machine, de la mme manire que le paramtre obsolte
+-.B dstaddr
+-.
+-Autrement il arme (ou dsarme) l'indicateur
++Si l'adresse est également donnée, cela définit l'adresse de
++protocole de l'autre machine, de la même manière que l'option obsolète
++.BR dstaddr .
++Autrement, il arme (ou désarme) l'indicateur
+ .B IFF_POINTOPOINT
+ de l'interface.
+ .TP
+ .B hw classe adresse
+-Dfinit l'adresse matrielle de l'interface, si le pilote du
+-priphrique supporte cette opration. Le mot cl doit tre
+-suivi du nom de la classe matrielle et de l'adresse matrielle en
+-caractres imprimables ASCII. Les classes matrielles actuellement
+-supportes comprennent
++Définir l'adresse matérielle de l'interface, si le pilote du périphérique
++accepte cette opération. L'option doit être suivie du nom de la classe
++matérielle et de l'adresse matérielle en caractères ASCII affichables.
++Les classes matérielles actuellement prises en charge comprennent
+ .B ether
+ (Ethernet),
+ .B ax25
+@@ -165,45 +183,82 @@ et
+ (AMPR NET/ROM).
+ .TP
+ .B multicast
+-Positionne l'indicateur multicast sur l'interface. Elle n'est
+-gnralement pas ncessaire puisque les pilotes positionnent
+-l'option correcte eux mme.
++Positionner l'indicateur de multidiffusion sur l'interface. Ce n'est
++généralement pas nécessaire puisque les pilotes positionnent correctement
++l'option eux-mêmes.
+ .TP
+ .B adresse
+-L'adresse IP de cette interface.
++Correspond à l'adresse IP affectée à cette interface.
+ .TP
+-.B txqueuelen length
+-Set the length of the transmit queue of the device. It is useful to set this
+-to small values for slower devices with a high latency (modem links, ISDN)
+-to prevent fast bulk transfers from disturbing interactive traffic like
+-telnet too much.
++.B txqueuelen longueur
++Définir la longueur de la file d'attente de transmission du périphérique.
++Il est utile de la fixer à des valeurs faibles pour les périphériques
++lents avec un temps d'attente important (modems, ISDN), pour empêcher
++d'être perturbé par de rapides transferts de masse issus des trafics
++interactifs, comme
++.BR telnet .
+ .SH NOTES
+-Depuis le noyau 2.2 il n'y a plus de statistiques d'interface explicite
+-pour les interfaces en alias. Les statistiques affiches pour la vritable
+-adresse sont partages avec toutes les adresses alias du mme priphrique.
+-Si vous voulez des adresses par interface, vous devez ajouter des rgles de
+-comptabilit particulires pour l'adresse en utilisant la commande
+-.BR ipchains(8)
+-.
+-
++Depuis la version 2.2 du noyau, il n'y a plus de statistiques d'interface
++explicites pour les alias d'interfaces. Les statistiques affichées pour la
++véritable adresse sont partagées avec toutes les adresses d'alias du même
++périphérique. Pour avoir des statistiques par adresse, il faut ajouter
++des règles de comptabilité particulières pour l'adresse en utilisant
++la commande
++.BR ipchains (8)
++ou
++.BR iptables (8).
++.LP
++Depuis net-tools 1.61,
++.B ifconfig
++affiche les compteurs d'octets et ceux lisibles par un utilisateur en
++unités IEC\ 60027-2. Ainsi, 1\ KiB vaut 2^10 octets. Notez que les nombres
++sont tronqués à la première décimale (ce qui peut être une erreur importante
++si vous considérez que 0,1\ PiB vaut 112.589.990.684.262\ octets\ :)
++.LP
++Des problèmes d'interruption avec les pilotes de périphériques Ethernet
++apparaissent avec EAGAIN
++(\fISIOCSIIFLAGS\ : Ressource temporairement indisponible\fR)
++il s'agit sûrement d'un conflit d'interruptions. Voir
++.I http://www.scyld.com/expert/irq-conflict.html
++pour plus d'informations.
+ .SH FICHIERS
+-.I /proc/net/socket
++.I /proc/net/socket
+ .br
+ .I /proc/net/dev
+ .br
+ .I /proc/net/if_inet6
+-.SH BUGS
+-Mme si les adresses appletalk DDP et IPX peuvent tre affiches,
+-elles ne peuvent tre modifies avec cette commande.
++.SH BOGUES
++Même si les adresses appletalk DDP et IPX peuvent être affichées,
++elles ne peuvent être modifiées avec cette commande.
+ .SH VOIR AUSSI
+-route(8), netstat(8), arp(8), rarp(8), ipchains(8)
+-.SH AUTHORS
++.BR route (8),
++.BR netstat (8),
++.BR arp (8),
++.BR rarp (8),
++.BR ipchains (8),
++.BR iptables (8)
++.br
++http://physics.nist.gov/cuu/Units/binary.html \- Préfixes
++pour les multiples binaires.
++.SH AUTEURS
+ Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+ .br
+ Alan Cox, <Alan.Cox@linux.org>
+ .br
+ Phil Blundell, <Philip.Blundell@pobox.com>
+ .br
+-Andi Kleen,
++Andi Kleen,
++.br
++Bernd Eckenfels, <net-tools@lina.inka.de>
+ .SH TRADUCTION
+-Jean-Michel VANSTEENE (vanstee@worldnet.fr)
++.PP
++Ce document est une traduction réalisée par Jean Michel Vansteene
++<vanstee\ AT\ worldnet\ DOT\ fr> en août\ 1997,
++mise à jour par Guillaume Audirac en août 2004
++et révisée le 17\ août\ 2006.
++.PP
++L'équipe de traduction a fait le maximum pour réaliser une adaptation
++française de qualité. La version anglaise la plus à jour de ce document est
++toujours consultable via la commande\ : «\ \fBLANG=C\ man\ 8\ ifconfig\fR\ ».
++N'hésitez pas à signaler à l'auteur ou au traducteur, selon le cas, toute
++erreur dans cette page de manuel.
+diff --git a/man/fr_FR/netstat.8 b/man/fr_FR/netstat.8
+index bf16bc6..c65d0be 100644
+--- a/man/fr_FR/netstat.8
++++ b/man/fr_FR/netstat.8
+@@ -8,11 +8,11 @@
+ .\" Modified: Tuan Hoang tuan@optimus.mitre.org
+ .\"
+ .\"
+-.TH NETSTAT 8 "25 Fv 1999" "net-tools" "Linux Programmer's Manual"
++.TH NETSTAT 8 "2007-12-02" "net-tools" "Linux Administrator's Manual"
+
+ .SH NAME
+-netstat \- Affiche les connexions rseau, les tables de routage, les
+-statistiques des interfaces, les connexions masques, les messages netlink,
++netstat \- Affiche les connexions réseau, les tables de routage, les
++statistiques des interfaces, les connexions masquées, les messages netlink,
+ et les membres multicast.
+
+ .SH SYNOPSIS
+@@ -21,6 +21,8 @@ et les membres multicast.
+ .RB [ \-venaoc ]
+ .RB [ \-\-tcp | \-t ]
+ .RB [ \-\-udp | \-u ]
++.RB [ \-\-udplite | \-U ]
++.RB [ \-\-sctp | \-S ]
+ .RB [ \-\-raw | \-w ]
+ .RB [ \-\-groups | \-g ]
+ .RB [ \-\-unix | \-x ]
+@@ -68,34 +70,34 @@ et les membres multicast.
+ .PP
+ .SH DESCRIPTION
+ .B Netstat
+-affiche les informations du sous-systme rseau de Linux
++affiche les informations du sous-système réseau de Linux
+
+ .SS "(no option)"
+-Vous pouvez voir l'tat des connexions rseau en listant les sockets
+-ouvertes. C'est l'option par dfaut : si vous ne spcifiez aucune famille
++Vous pouvez voir l'état des connexions réseau en listant les sockets
++ouvertes. C'est l'option par défaut : si vous ne spécifiez aucune famille
+ d'adresses, les sockets actives de toutes les familles d'adresses seront
+-affiches.
+-Avec le paramtre
++affichées.
++Avec le paramètre
+ .B -e
+-vous obtenez quelques informations supplmentaires (userid). Avec le paramtre
++vous obtenez quelques informations supplémentaires (userid). Avec le paramètre
+ .B -v
+-vous pouvez demander netstat de signaler des familles d'adresses connues
+-non supportes par le noyau. Le paramtre
++vous pouvez demander à netstat de signaler des familles d'adresses connues
++non supportées par le noyau. Le paramètre
+ .B -o
+-affiche des informations supplmentaires sur les timers rseau. En donnant
+-le paramtre
++affiche des informations supplémentaires sur les timers réseau. En donnant
++le paramètre
+ .B -p
+-vous verrez le PID et le nom du processus qui appartient la socket. Le paramtre
++vous verrez le PID et le nom du processus à qui appartient la socket. Le paramètre
+ .B -a
+-affiche toutes les sockets, y compris les sockets d'coute des serveurs. La famille
++affiche toutes les sockets, y compris les sockets d'écoute des serveurs. La famille
+ d'adresses
+ .B inet
+ affiche les sockets raw, udp et tcp.
+
+ .SS "\-r, \-\-route"
+-Avec le paramtre
++Avec le paramètre
+ .BR \-r ", " \-\-route
+-vous pouvez visualiser les tables de routage dans le mme format qu'avec la
++vous pouvez visualiser les tables de routage dans le même format qu'avec la
+ commande
+ .B "route -e"
+ .
+@@ -104,44 +106,44 @@ utilisera le format de la commande
+ .BR route .
+ Veuillez consulter
+ .BR route (8)
+-pour plus de dtails.
++pour plus de détails.
+
+-.SS "\-i, \-\-interface \fIiface\fI"
++.SS "\-i, \-\-interfaces \fIiface\fI"
+ Si vous utilisez l'option
+ .BR -i ", " --interfaces
+ , une table de toutes (ou de l'interface
+ .IR iface
+-spcifie) les interfaces rseau sera affiche. Le format de sortie est le
+-mme que celui de la commande
++spécifiée) les interfaces réseau sera affichée. Le format de sortie est le
++même que celui de la commande
+ .B "ifconfig -e"
+-, et est dcrit dans
++, et est décrit dans
+ .BR ifconfig (8).
+ .B "netstat -ei"
+-affiche une table ou une seule entre d'interface comme la commande
+-.B ifconfig
+-. Avec le paramtre
++affiche une table ou une seule entrée d'interface comme la commande
++.BR ifconfig .
++Avec le paramètre
+ .B -a
+-, vous pouvez inclure les interfaces qui ne sont pas configures (c.a.d qui
++, vous pouvez inclure les interfaces qui ne sont pas configurées (c.a.d qui
+ n'ont pas l'indicateur
+ .BR U = UP
+-arm).
++armé).
+
+ .SS "\-M, \-\-masquerade"
+
+-Permet de voir les sessions ayant de l'IP-masquerade. Avec le paramtre
++Permet de voir les sessions ayant de l'IP-masquerade. Avec le paramètre
+ .B -e
+-vous pouvez inclure quelques informations concernant les numros de
+-squence et les deltas causs par des rcritures de donnes sur des
+-sessions FTP (commande PORT). Le support de l'IP-Masquerade est utilis
+-pour cacher au monde extrieur des htes appartenant un rseau (et ayant
+-des adresses) non officiel, tel que dcrit dans
+-.BR ipfw (4), ipfwadm "(8) et " ipfw (8).
++vous pouvez inclure quelques informations concernant les numéros de
++séquence et les deltas causés par des réécritures de données sur des
++sessions FTP (commande PORT). Le support de l'IP-Masquerade est utilisé
++pour cacher au monde extérieur des hôtes appartenant à un réseau (et ayant
++des adresses) non officiel, tel que décrit dans
++.BR iptables (8).
+
+ .SS "\-N, \-\-netlink"
+
+-Les noyaux rcents supportent une communication avec l'utilisateur appele
+-netlink. Vous pouvez obtenir des messages relatifs la cration, la
+-suppression d'interfaces ou de routes partir de
++Les noyaux récents supportent une communication avec l'utilisateur appelée
++netlink. Vous pouvez obtenir des messages relatifs à la création, la
++suppression d'interfaces ou de routes à partir de
+ .I /dev/route
+ (36,0).
+
+@@ -149,23 +151,23 @@ suppression d'interfaces ou de routes
+ .SH OPTIONS
+ .SS "\-v, \-\-verbose"
+ active le mode verbeux. Affiche quelques informations utiles concernant les
+-familles d'adresses non configures.
++familles d'adresses non configurées.
+
+ .SS "\-n, \-\-numeric"
+-affiche les adresses en format numrique au lieu d'essayer de dterminer le
+-nom symbolique d'hte, de port ou d'utilisateur.
++affiche les adresses en format numérique au lieu d'essayer de déterminer le
++nom symbolique d'hôte, de port ou d'utilisateur.
+
+ .SS "\-p, \-\-programs"
+-affiche le nom et le PID des processus propritaires de chaque socket
+-dcrite. Vous devez tre le propritaire d'un processus pour visualiser les
+-sockets qui lui appartiennent ou tre l'utilisateur
++affiche le nom et le PID des processus propriétaires de chaque socket
++décrite. Vous devez être le propriétaire d'un processus pour visualiser les
++sockets qui lui appartiennent ou être l'utilisateur
+ .B root
+ pour disposer de toutes les informations.
+
+ .SS "\-A, \-\-af \fIfamille\fI"
+-utilise une mthode diffrente pour affecter les familles d'adresses.
++utilise une méthode différente pour affecter les familles d'adresses.
+ .I famille
+-est une liste de familles d'adresses spares par des (',') telles que
++est une liste de familles d'adresses séparées par des (',') telles que
+ .BR inet ,
+ .BR unix ,
+ .BR ipx ,
+@@ -173,7 +175,7 @@ est une liste de familles d'adresses s
+ .B netrom
+ et
+ .BR ddp .
+-L'utilisation des options longues suivantes a le mme effet
++L'utilisation des options longues suivantes a le même effet
+ .BR \-\-inet ,
+ .BR \-\-unix ,
+ .BR \-\-ipx ,
+@@ -183,9 +185,9 @@ et
+ .BR \-\-ddp.
+
+ .SS "\-c, \-\-continous"
+-Demandera
++Demandera à
+ .B netstat
+-d'afficher la table slectionne chaque seconde jusqu' ce que vous
++d'afficher la table sélectionnée chaque seconde jusqu'à ce que vous
+ l'interrompiez.
+
+ .PP
+@@ -195,102 +197,102 @@ l'interrompiez.
+ .SS Connexions Internet actives \fR(TCP, UDP, RAW)\fR
+
+ .SS "Proto"
+-Le protocole (TCP, UDP, RAW) utilis par la socket.
++Le protocole (TCP, UDP, RAW) utilisé par la socket.
+
+ .SS "Recv-Q"
+-Le nombre d'octets non encore lus par le programme utilisateur connect
+- cette socket.
++Le nombre d'octets non encore lus par le programme utilisateur connecté
++à cette socket.
+
+ .SS "Send-Q"
+-Le nombre d'octets non encore acquitts par l'hte distant.
++Le nombre d'octets non encore acquittés par l'hôte distant.
+
+ .SS "Local Address (Adresse locale)"
+-L'adresse locale (nom d'hte local) et numro de port de la
++L'adresse locale (nom d'hôte local) et numéro de port de la
+ socket. Sauf si l'option
+ .B -n
+-est donne, l'adresse de la prise est traduite en nom d'hte,
+-et le numro de port est traduit en nom de service correspondant.
++est donnée, l'adresse de la prise est traduite en nom d'hôte,
++et le numéro de port est traduit en nom de service correspondant.
+
+ .SS "Foreign Address (Adresse distante)"
+-L'adresse distante (nom d'hte distant) et le numro de port de
+-la prise. Comme pour l'adresse locale et le numro de port, l'option
++L'adresse distante (nom d'hôte distant) et le numéro de port de
++la prise. Comme pour l'adresse locale et le numéro de port, l'option
+ .B -n
+-invalide la traduction du nom d'hte et de service.
++invalide la traduction du nom d'hôte et de service.
+
+ .SS "State (Etat)"
+-L'tat de la socket. Puisqu'il n'y a pas d'tat dans le mode RAW
+-et gnralement pas d'tat utilis en UDP, cette colonne
++L'état de la socket. Puisqu'il n'y a pas d'état dans le mode RAW
++et généralement pas d'état utilisé en UDP, cette colonne
+ peut se trouver vierge. Normalement, on trouvera une des valeur suivante:
+
+ .TP
+ .I
+ ESTABLISHED
+-La socket a une connexion tablie.
++La socket a une connexion établie.
+ .TP
+ .I
+ SYN_SENT
+-La socket attend activement d'tablir une connexion.
++La socket attend activement d'établir une connexion.
+ .TP
+ .I
+ SYN_RECV
+-Une requte de connexion a t reue du rseau.
++Une requête de connexion a été reçue du réseau.
+ .TP
+ .I
+ FIN_WAIT1
+-La socket est ferme, et la connexion est en cours de terminaison.
++La socket est fermée, et la connexion est en cours de terminaison.
+ .TP
+ .I
+ FIN_WAIT2
+-La connexion est ferme, et la socket attend une terminaison du distant.
++La connexion est fermée, et la socket attend une terminaison du distant.
+ .TP
+ .I
+ TIME_WAIT
+-La socket attend le traitement de tous les paquets encore sur le rseau
++La socket attend le traitement de tous les paquets encore sur le réseau
+ avant d'entreprendre la fermeture.
+ .TP
+ .I
+-CLOSED
+-La socket n'est pas utilise.
++CLOSE
++La socket n'est pas utilisée.
+ .TP
+ .I
+ CLOSE_WAIT
+-Le distant a arrt, attendant la fermeture de la socket.
++Le distant a arrêté, attendant la fermeture de la socket.
+ .TP
+ .I
+ LAST_ACK
+-Le distant termine, et la socket est ferme. Attente d'acquittement.
++Le distant termine, et la socket est fermée. Attente d'acquittement.
+ .TP
+ .I
+ LISTEN
+-La socket est l'coute de connexions entrantes. Ces sockets ne sont
+-affiches que si le paramtre
++La socket est à l'écoute de connexions entrantes. Ces sockets ne sont
++affichées que si le paramètre
+ .BR -a , --listening
+ est fourni.
+ .TP
+ .I
+ CLOSING
+-Les deux prises sont arrtes mais toutes les donnes locales n'ont
+-pas encore t envoyes.
++Les deux prises sont arrêtées mais toutes les données locales n'ont
++pas encore été envoyées.
+ .TP
+ .I
+ UNKNOWN
+-L'tat de la prise est inconnu.
++L'état de la prise est inconnu.
+
+ .SS "User (Utilisateur)"
+-Le nom d'utilisateur ou l'UID du propritaire de la socket.
++Le nom d'utilisateur ou l'UID du propriétaire de la socket.
+
+ .SS "PID/Program name (PID/Nom de Programme)"
+-Le PID et le nom du programme (spars par un slash) propritaire de la
+-socket. Le paramtre
++Le PID et le nom du programme (séparés par un slash) propriétaire de la
++socket. Le paramètre
+ .B -p
+ active l'affichage de cette colonne. Vous devez avoir les droits de
+ .B root
+-puisque vous devez avoir les droits d'accs aux processus pour visualiser
++puisque vous devez avoir les droits d'accès aux processus pour visualiser
+ les sockets qui lui correspondent. Ces informations ne sont pas disponibles
+ avec les sockets IPX.
+
+ .SS "Timer"
+-(Ceci doit tre rdig)
++(Ceci doit être rédigé)
+
+
+ .PP
+@@ -298,28 +300,28 @@ avec les sockets IPX.
+
+
+ .SS "Proto"
+-Le protocole (habituellement UNIX) utilis par la socket.
++Le protocole (habituellement UNIX) utilisé par la socket.
+
+ .SS "RefCnt"
+-Le nombre de rfrences (i.e. processus attachs via cette socket).
++Le nombre de références (i.e. processus attachés via cette socket).
+
+ .SS "Flags (indicateurs)"
+-Les indicateurs affiche sont SO_ACCEPTON (affich
++Les indicateurs affichée sont SO_ACCEPTON (affiché
+ .BR ACC ),
+ SO_WAITDATA
+ .RB ( W )
+ ou SO_NOSPACE
+ .RB ( N ).
+-SO_ACCECPTON est utilis pour les sockets
+-non-connectes si les processus correspondant sont en attente de
+-demande de connexion. Les autres indicateurs sont d'un intrt limit.
++SO_ACCECPTON est utilisé pour les sockets
++non-connectées si les processus correspondant sont en attente de
++demande de connexion. Les autres indicateurs sont d'un intérêt limité.
+
+ .SS "Type"
+-Il y a diffrents types d'accs aux sockets :
++Il y a différents types d'accès aux sockets :
+ .TP
+ .I
+ SOCK_DGRAM
+-La prise est utilise en mode Datagram (sans connexion).
++La prise est utilisée en mode Datagram (sans connexion).
+ .TP
+ .I
+ SOCK_STREAM
+@@ -327,90 +329,89 @@ C'est une socket `stream' (connexion).
+ .TP
+ .I
+ SOCK_RAW
+-La prise est utilise en mode `raw'.
++La prise est utilisée en mode `raw'.
+ .TP
+ .I
+ SOCK_RDM
+-Celle-ci est utilise pour les messages dlivre de manire fiable.
++Celle-ci est utilisée pour les messages délivrée de manière fiable.
+ .TP
+ .I
+ SOCK_SEQPACKET
+-C'est une socket en mode paquets squentiels.
++C'est une socket en mode paquets séquentiels.
+ .TP
+ .I
+ SOCK_PACKET
+-Prise d'accs l'interface RAW.
++Prise d'accès à l'interface RAW.
+ .TP
+ .I
+ UNKNOWN
+-Qui sait ce que l'avenir nous rserve - Juste remplir ici :-)
++Qui sait ce que l'avenir nous réserve - Juste à remplir ici :-)
+
+ .PP
+ .SS "State (Etat)"
+-Ce champ contient un des mots cls suivants :
++Ce champ contient un des mots clés suivants :
+ .TP
+ .I
+ FREE
+-La socket n'est pas alloue
++La socket n'est pas allouée
+ .TP
+ .I
+ LISTENING
+-La socket est l'coute de demandes de connexions. Ces sockets ne sont
+-affiches que si le paramtre
++La socket est à l'écoute de demandes de connexions. Ces sockets ne sont
++affichées que si le paramètre
+ .BR -a , --listening
+ est fourni.
+ .TP
+ .I
+ CONNECTING
+-La prise est en cours d'tablissement de connexion.
++La prise est en cours d'établissement de connexion.
+ .TP
+ .I
+ CONNECTED
+-La socket est connecte.
++La socket est connectée.
+ .TP
+ .I
+ DISCONNECTING
+-La socket est en cours de dconnexion.
++La socket est en cours de déconnexion.
+ .TP
+ .I
+ (empty)
+-La socket n'est connecte aucune autre.
++La socket n'est connectée à aucune autre.
+ .TP
+ .I
+ UNKNOWN
+-Cet tat ne devrait pas apparatre.
++Cet état ne devrait pas apparaître.
+
+ .SS "PID/Program name (PID/Nom de programme"
+-Le PID et le nom du programme propritaire de la socket. Plus
++Le PID et le nom du programme propriétaire de la socket. Plus
+ d'informations sont disponibles dans la section
+ .B "Connexions Internet actives"
+ ci-dessus.
+
+ .SS "Path (chemin)"
+-Affiche le chemin correspondant l'attachement des processus la socket.
++Affiche le chemin correspondant à l'attachement des processus à la socket.
+
+ .PP
+ .SS Sockets IPX actives
+
+-( faire par quelqu'un qui connat)
++(à faire par quelqu'un qui connaît)
+
+ .PP
+ .SS Sockets NET/ROM actives
+
+-( faire par quelqu'un qui connat)
++(à faire par quelqu'un qui connaît)
+
+ .PP
+ .SS Sockets AX.25 actives
+
+-( faire par quelqu'un qui connat)
++(à faire par quelqu'un qui connaît)
+
+ .PP
+ .SH NOTES
+ Depuis la version 2.2 du noyau, netstat -i n'affiche plus les statistiques
+ des interfaces alias. Pour obtenir les compteurs par interface alias, vous
+-devez dfinir des rgles spcifiques l'aide de la commande
+-.BR ipchains(8)
+-.
++devez définir des règles spécifiques à l'aide de la commande
++.BR iptables(8).
+
+ .SH FICHIERS
+ .ta
+@@ -418,7 +419,7 @@ devez d
+ -- Le fichier de correspondance des services
+
+ .I /proc/net/dev
+--- informations priphriques
++-- informations périphériques
+
+ .I /proc/net/raw
+ -- informations sockets RAW
+@@ -471,31 +472,28 @@ devez d
+ .SH VOIR AUSSI
+ .BR route (8),
+ .BR ifconfig (8),
+-.BR ipfw (4),
+-.BR ipfw (8),
+-.BR ipfwadm (8)
+-.BR ipchains (8)
++.BR iptables (8)
+
+ .PP
+ .SH BUGS
+-Des informations tranges peuvent apparaitre occasionnellement
+-si une socket change d'tat au moment ou elle est visualise.
++Des informations étranges peuvent apparaitre occasionnellement
++si une socket change d'état au moment ou elle est visualisée.
+ Ceci est peut probable.
+ .br
+-Le paramtre
++Le paramètre
+ .B netstat -i
+-est dcrit tel qu'il fonctionnera lorsque le code de la version BETA du
+-paquetage net-tools aura t nettoy.
++est décrit tel qu'il fonctionnera lorsque le code de la version BETA du
++paquetage net-tools aura été nettoyé.
+
+ .PP
+ .SH AUTEURS
+-L'interface utilisateur de netstat a t dveloppe par
++L'interface utilisateur de netstat a été développée par
+ Fred Baumgarten <dc6iq@insu1.etec.uni-karlsruhe.de>. Les pages du
+-manuel essentiellement crites par Matt Welsh
+-<mdw@tc.cornell.edu>. Mis jour par Alan Cox <Alan.Cox@linux.org>.
++manuel essentiellement écrites par Matt Welsh
++<mdw@tc.cornell.edu>. Mis à jour par Alan Cox <Alan.Cox@linux.org>.
+ .br
+ La page de manuel et la commande incluse dans le paquetage net-tools
+-a t totallement rcrite par Bernd Eckenfels
++a été totallement réécrite par Bernd Eckenfels
+ <ecki@linux.de>.
+ .SH TRADUCTION
+ Jean Michel VANSTEENE (vanstee@worldnet.fr)
+diff --git a/man/fr_FR/plipconfig.8 b/man/fr_FR/plipconfig.8
+index cd44449..4d17ea2 100644
+--- a/man/fr_FR/plipconfig.8
++++ b/man/fr_FR/plipconfig.8
+@@ -1,44 +1,44 @@
+ .TH PLIPCONFIG 8 "17 February 1995" "" ""
+ .SH NOM
+-plipconfig \- rglage fin des paramtres du priphrique PLIP
++plipconfig \- réglage fin des paramètres du périphérique PLIP
+ .SH SYNOPSIS
+ .B "plipconfig interface"
+ .br
+ .B "plipconfig interface [nibble NN] [trigger NN] [unit NN]"
+ .SH DESCRIPTION
+ .B Plipconfig
+-est utilis pour amliorer (esprons-le) les performances PLIP
+-en changeant les timings par dfaut utiliss par le protocole PLIP. Les
+-rsultats dpendent du port parallle
+-utilis, du cable, et de la vitesse CPU de chaque machine
+- chaque bout du lien PLIP.
++est utilisé pour améliorer (espérons-le) les performances PLIP
++en changeant les timings par défaut utilisés par le protocole PLIP. Les
++résultats dépendent du port parallèle
++utilisé, du cable, et de la vitesse CPU de chaque machine
++à chaque bout du lien PLIP.
+ .LP
+ Si le seul argument est l'
+ .B interface
+ ,
+ .B plipconfig
+-affiche seulement l'tat de cette interface. Autrement, il essaiera de
+-positionner les options donnes.
++affiche seulement l'état de cette interface. Autrement, il essaiera de
++positionner les options données.
+ .SH OPTIONS
+ .TP
+ .B "nibble NN"
+-Dfinit la valeur d'attente des digits en microsecondes. Par dfault : 3000.
++Définit la valeur d'attente des digits en microsecondes. Par défault : 3000.
+ .TP
+ .B "trigger NN"
+-Dfinit le dlai de dclenchement en microsecondes. Par dfault : 500.
++Définit le délai de déclenchement en microsecondes. Par défault : 500.
+ .LP
+-La vitesse de PLIP peut, dans certains cas, tre amliore en
+-diminuant les valeurs par dfaut.
++La vitesse de PLIP peut, dans certains cas, être améliorée en
++diminuant les valeurs par défaut.
+ Les valeurs trop petites peuvent engendrer une utilisation excessive de CPU,
+-et un temps de rponse aux interruptions mauvais, dont le rsultat est
+-la perte de caractres lus sur le port, ou de paquets PLIP.
++et un temps de réponse aux interruptions mauvais, dont le résultat est
++la perte de caractères lus sur le port, ou de paquets PLIP.
+ La modification du MTU PLIP peut aussi affecter la vitesse PLIP.
+ .SH NOTE
+-Si vous n'obtenez aucune rponse, il est fort probable que l'IRQ configure
+-soit mauvaise, et qu'elle ncessite une configuration avec ifconfig.
+-Les quelques cas pour lesquels les timings par dfaut sont trop courts,
+-arrivent lorque l'on utilise de longs cables. Quelque chose ne pas faire,
+-puisque le port parallle n'est pas fait pour fonctionner avec de longs cables.
++Si vous n'obtenez aucune réponse, il est fort probable que l'IRQ configurée
++soit mauvaise, et qu'elle nécessite une configuration avec ifconfig.
++Les quelques cas pour lesquels les timings par défaut sont trop courts,
++arrivent lorque l'on utilise de longs cables. Quelque chose à ne pas faire,
++puisque le port parallèle n'est pas fait pour fonctionner avec de longs cables.
+ .SH VOIR AUSSI
+ .I ifconfig(8)
+ .SH BUGS
+diff --git a/man/fr_FR/rarp.8 b/man/fr_FR/rarp.8
+index 73e9328..e68730f 100644
+--- a/man/fr_FR/rarp.8
++++ b/man/fr_FR/rarp.8
+@@ -1,6 +1,6 @@
+-.TH RARP 8 "4 Aot 1997" "net-tools" "Linux Programmer's Manual"
++.TH RARP 8 "4 Août 1997" "net-tools" "Linux Administrator's Manual"
+ .SH NOM
+-rarp \- manipule la table systme RARP
++rarp \- manipule la table système RARP
+ .SH SYNOPSIS
+ .B "rarp [-V] [--version] [-h] [--help]"
+ .br
+@@ -11,30 +11,30 @@ rarp \- manipule la table syst
+ .B "rarp [-v] [-t type] -s nom_d_hote adr_materiel"
+ .SH DESCRIPTION
+ .B Rarp
+-manipule la table RARP du noyau de diffrentes faons. Les options de base
+-permettent d'effacer une entre de correspondance d'adresses et d'en
+-redfinir une manuellement. Pour des besoins de dbogage, le programme
++manipule la table RARP du noyau de différentes façons. Les options de base
++permettent d'effacer une entrée de correspondance d'adresses et d'en
++redéfinir une manuellement. Pour des besoins de débogage, le programme
+ .B rarp
+-permet aussi de vider compltement la table RARP.
++permet aussi de vider complètement la table RARP.
+ .SH OPTIONS
+ .TP
+ .B \-V
+-Affiche la version de RARP utilis.
++Affiche la version de RARP utilisé.
+ .TP
+ .B \-v
+-Dit l'utilisateur ce qui se passe, en tant verbeux.
++Dit à l'utilisateur ce qui se passe, en étant verbeux.
+ .TP
+ .B "\-t type"
+-En dfinissant ou lisant la table RARP, ce paramtre optionnel dit
++En définissant ou lisant la table RARP, ce paramètre optionnel dit à
+ .B rarp
+-quelles classes d'entres il doit contrler. La valeur par dfaut de
+-ce paramtre est
++quelles classes d'entrées il doit contrôler. La valeur par défaut de
++ce paramètre est
+ .B ether
+-(i.e. code matriel
++(i.e. code matériel
+ .B 0x01
+ pour
+ .B "IEEE 802.3 10Mbps Ethernet".
+-D'autres valeurs doivent correspondre des technologies rseaux telles que
++D'autres valeurs doivent correspondre à des technologies réseaux telles que
+ .B AX.25 (ax25).
+ et
+ .B NET/ROM (netrom).
+@@ -42,31 +42,31 @@ et
+ .B "\-a"
+ .TP
+ .B "\-\-list"
+-Liste les entres de la table RARP.
++Liste les entrées de la table RARP.
+ .TP
+ .B "\-d nom_d_hote"
+ .TP
+ .B "\-\-delete nom_d_hote"
+-Supprime toutes les entres RARP relatives l'hte spcifi.
++Supprime toutes les entrées RARP relatives à l'hôte spécifié.
+ .TP
+ .B "\-s nom_d_hote adr_materielle"
+ .TP
+ .B "\-\-set nom_d_hote adr_materielle"
+-Cre manuellement une correspondance d'adresses RARP pour l'hte
+-.B nom_d_hte
+-avec l'adresse matrielle
+-.B adr_materielle
+-. Le format de l'adresse matrielle est dpendant du matriel,
+-mais pour la plupart on peut considrer que la prsentation classique
+-peut tre utilise. Pour la classe Ethernet, c'est 6 octets en hexadcimal,
+-spars par des double-points.
++Crée manuellement une correspondance d'adresses RARP pour l'hôte
++.B nom_d_hôte
++avec l'adresse matérielle
++.BR adr_materielle .
++Le format de l'adresse matérielle est dépendant du matériel,
++mais pour la plupart on peut considérer que la présentation classique
++peut être utilisée. Pour la classe Ethernet, c'est 6 octets en hexadécimal,
++séparés par des double-points.
+
+ .SH ATTENTION
+-Certains systmes (notamment des vieux Sun's) supposent que l'hte
+-rpondant une requte RARP peut aussi fournir d'autres services
+-de boot distance. Par consquent n'ajoutez jamais
+-d'entres RARP la lgre moins que vous souhaitiez affronter la
+-colre de votre administrateur rseau.
++Certains systèmes (notamment des vieux Sun's) supposent que l'hôte
++répondant à une requête RARP peut aussi fournir d'autres services
++de boot à distance. Par conséquent n'ajoutez jamais
++d'entrées RARP à la légère à moins que vous souhaitiez affronter la
++colère de votre administrateur réseau.
+ .SH FICHIERS
+ .I /proc/net/rarp,
+ .SH VOIR AUSSI
+diff --git a/man/fr_FR/route.8 b/man/fr_FR/route.8
+index 9109e8d..986faf9 100644
+--- a/man/fr_FR/route.8
++++ b/man/fr_FR/route.8
+@@ -1,4 +1,4 @@
+-.TH ROUTE 8 "8 Aot 1997" "net-tools" "Linux Programmer's Manual"
++.TH ROUTE 8 "8 Août 1997" "net-tools" "Linux Administrator's Manual"
+ .SH NAME
+ route \- affiche / manipule la table de routage IP
+ .SH SYNOPSIS
+@@ -54,9 +54,9 @@ If]
+ .RB [ \--help ]
+ .SH DESCRIPTION
+ .B Route
+-manipule la table de routage IP du noyau. Son utilisation premire
+-consiste configurer des routes statiques vers des htes ou des rseaux
+-via une interface, aprs sa configuration par le programme
++manipule la table de routage IP du noyau. Son utilisation première
++consiste à configurer des routes statiques vers des hôtes ou des réseaux
++via une interface, après sa configuration par le programme
+ .B ifconfig(8).
+
+ .SH OPTIONS
+@@ -66,12 +66,12 @@ Active le mode verbeux.
+
+ .TP
+ .B \-A famille
+-Utilise la famille d'adresses spcifie (p.ex. `inet', `inet6').
++Utilise la famille d'adresses spécifiée (p.ex. `inet', `inet6').
+
+ .TP
+ .B \-n
+-Affiche les adresses numriques, au lieu
+-d'essayer de dterminer les noms d'htes. C'est utile si vous essayer de
++Affiche les adresses numériques, au lieu
++d'essayer de déterminer les noms d'hôtes. C'est utile si vous essayer de
+ savoir pourquoi la route vers votre serveur de nom a disparu.
+
+ .TP
+@@ -80,24 +80,24 @@ utilise
+ .BR netstat (8)-format
+ pour l'affichage de la table de routage.
+ .B \-ee
+-Gnre une trs longue ligne avec tous les paramtres partir de la table
++Génère une très longue ligne avec tous les paramètres à partir de la table
+ de routage.
+
+ .TP
+ .B \-net
+ la
+ .B cible
+-est un rseau.
++est un réseau.
+
+ .TP
+ .B -host
+ la
+ .B cible
+-est un hte.
++est un hôte.
+
+ .TP
+ .B -F
+-affiche la table de routage FIB du noyau. L'organisation peut tre change avec
++affiche la table de routage FIB du noyau. L'organisation peut être changée avec
+ .B \-e
+ et
+ .B \-ee
+@@ -117,131 +117,131 @@ ajoute une route.
+
+ .TP
+ .B cible
+-L'hte ou le rseau destination. Vous pouvez fournir une adresse IP en
+-notation dcimale pointe ou un nom d'hte ou de rseau.
++L'hôte ou le réseau destination. Vous pouvez fournir une adresse IP en
++notation décimale pointée ou un nom d'hôte ou de réseau.
+
+ .TP
+ .B netmask Nm
+-spcifie le masque rseau de la route ajouter.
++spécifie le masque réseau de la route à ajouter.
+
+ .TP
+ .B gw Gw
+-signifie que tout paquet IP envoy cette adresse sera rout par
+-la passerelle spcifie.
++signifie que tout paquet IP envoyé à cette adresse sera routé par
++la passerelle spécifiée.
+ .B NOTE:
+-La passerelle concerne doit pouvoir tre atteinte. Ceci signifie
+-qu'une route statique vers cette passerelle doit pralablement exister.
+-Si vous spcifiez l'adresse de l'une de vos interfaces locales, elle sera
+-utilise pour dcider de l'interface vers laquelle les paquets seront
+-envoys. Ceci est une bidouille permettant d'tre compatible BSD.
++La passerelle concernée doit pouvoir être atteinte. Ceci signifie
++qu'une route statique vers cette passerelle doit préalablement exister.
++Si vous spécifiez l'adresse de l'une de vos interfaces locales, elle sera
++utilisée pour décider de l'interface vers laquelle les paquets seront
++envoyés. Ceci est une bidouille permettant d'être compatible BSD.
+
+ .TP
+ .B metric M
+-Affecte la valeur M au champ mtrique de la table de routage (utilis par
+-les dmons de routage).
++Affecte la valeur M au champ métrique de la table de routage (utilisé par
++les démons de routage).
+
+ .TP
+ .B mss M
+-Spcifie le MSS (Maximum Segment Size, Taille maximum de segment) de TCP,
+-pour les connexions empreintant cette route. Ce n'est normalement utilis
++Spécifie le MSS (Maximum Segment Size, Taille maximum de segment) de TCP,
++pour les connexions empreintant cette route. Ce n'est normalement utilisé
+ que pour des optimisations fines des configurations de routage.
+
+
+ .TP
+ .B window W
+-Dfinit la taille de fentre TCP W octets pour les connexions relatives
+- cette route. C'est en gnral uniquement utilis sur les rseaux AX.25 et
+-avec les pilotes incapables de manipuler les trames dos dos.
++Définit la taille de fenêtre TCP à W octets pour les connexions relatives
++à cette route. C'est en général uniquement utilisé sur les réseaux AX.25 et
++avec les pilotes incapables de manipuler les trames dos à dos.
+
+ .TP
+ .B irtt I
+-Dfinit le iRTT initial (round trip time) pour les connexions TCP sur cette
+-route I millisecondes (1-12000). C'est en gnral uniquement utilis sur
+-les rseaux AX.25. Si omis, la valeur par dfaut (300 ms selon le RFC 1122)
+-est utilise.
++Définit le iRTT initial (round trip time) pour les connexions TCP sur cette
++route à I millisecondes (1-12000). C'est en général uniquement utilisé sur
++les réseaux AX.25. Si omis, la valeur par défaut (300 ms selon le RFC 1122)
++est utilisée.
+
+ .TP
+ .B reject
+-Installe une route bloquante, qui forcera l'chec d'une recherche.
+-C'est par exemple utilis pour masquer les rseaux avant d'utiliser la
+-route par dfaut. Ce n'est pas une fonction de pare-feu.
++Installe une route bloquante, qui forcera l'échec d'une recherche.
++C'est par exemple utilisé pour masquer les réseaux avant d'utiliser la
++route par défaut. Ce n'est pas une fonction de pare-feu.
+
+ .TP
+ .B mod, dyn, reinstate
+-Installe une route dynamique ou modifie. Les deux indicateurs ne sont en
+-gnral positionns que par le dmon de routage. Cela ne sert que pour des
++Installe une route dynamique ou modifiée. Les deux indicateurs ne sont en
++général positionnés que par le démon de routage. Cela ne sert que pour des
+ besoins de diagnostics.
+
+ .TP
+ .B dev If
+-Force la route tre associe au priphrique spcifi, sinon le noyau
+-tentera de le dterminer par lui-mme (en consultant les routes existantes
+-et les spcifications de priphriques). Dans la plupart des rseaux
++Force la route à être associée au périphérique spécifié, sinon le noyau
++tentera de le déterminer par lui-même (en consultant les routes existantes
++et les spécifications de périphériques). Dans la plupart des réseaux
+ normaux, vous n'aurez pas besoin de ceci.
+
+ If
+ .B dev If
+-est la dernire option de la ligne de commande, le mot
++est la dernière option de la ligne de commande, le mot
+ .B dev
+-peut tre omis, puisque c'est la valeur par dfaut. Autrement l'ordre des
++peut être omis, puisque c'est la valeur par défaut. Autrement l'ordre des
+ modificateurs de route (metric - netmask - gw - dev) n'a pas d'importance.
+
+ .SH EXEMPLES
+ .TP
+ .B route add -net 127.0.0.0
+-ajoute l'entre loopback normale, en utilisant le masque 255.0.0.0 (rseau
+-de classe A, selon l'adresse de destination) et associe avec l'interface
+-"lo" (en supposant que ce priphrique a t correctement configur avec
++ajoute l'entrée loopback normale, en utilisant le masque 255.0.0.0 (réseau
++de classe A, selon l'adresse de destination) et associée avec l'interface
++"lo" (en supposant que ce périphérique a été correctement configuré avec
+ .BR ifconfig (8)).
+
+ .TP
+ .B route add -net 192.56.76.0 netmask 255.255.255.0 dev eth0
+-ajoute une route vers le rseau 192.56.76.x via
+-"eth0". Le masque de classe C n'est pas vraiment ncessaire ici car
+-192.* est une adresse IP de classe C. Le mot "dev" peut tre omis.
++ajoute une route vers le réseau 192.56.76.x via
++"eth0". Le masque de classe C n'est pas vraiment nécessaire ici car
++192.* est une adresse IP de classe C. Le mot "dev" peut être omis.
+
+ .TP
+ .B route add default gw mango-gw
+-ajoute une route par dfaut (qui sera utilise si aucune autre route ne
++ajoute une route par défaut (qui sera utilisée si aucune autre route ne
+ convient). Tous les paquets empreintant cette route passeront par
+-"mango-gw". Le priphrique qui sera effectivement utilis pour cette route
+-dpend de la faon dont on atteint "mango-gw" - la route statique vers
+-"mango-gw" devra tre pralablement configure.
++"mango-gw". Le périphérique qui sera effectivement utilisé pour cette route
++dépend de la façon dont on atteint "mango-gw" - la route statique vers
++"mango-gw" devra être préalablement configurée.
+
+ .TP
+ .B route add ipx4 sl0
+-ajoute une route vers l'hte "ipx4" via l'interface SLIP (en supposant que
+-"ipx4" est l'hte SLIP).
++ajoute une route vers l'hôte "ipx4" via l'interface SLIP (en supposant que
++"ipx4" est l'hôte SLIP).
+
+ .TP
+ .B route add -net 192.57.66.0 netmask 255.255.255.0 gw ipx4
+-Cette commande route le rseau "192.57.66.x" par l'ancienne route vers l'interface SLIP.
++Cette commande route le réseau "192.57.66.x" par l'ancienne route vers l'interface SLIP.
+
+ .TP
+ .B route add 224.0.0.0 netmask 240.0.0.0 dev eth0
+-Ceci est une commande mal documente et les gens savent ce qu'il faut
+-faire? Ceci force toutes les routes IP des classes D (multicast)
++Ceci est une commande mal documentée et les gens savent ce qu'il faut
++faire? Ceci force toutes les routes IP des classes D (multicast) à
+ passer par "eth0". C'est la configuration correcte, normale pour un noyau
+ supportant le multicast.
+
+ .TP
+ .B route add 10.0.0.0 netmask 255.0.0.0 reject
+-Installe une route 'rejete' pour le rseau priv "10.x.x.x."
++Installe une route 'rejetée' pour le réseau privé "10.x.x.x."
+
+ .LP
+ .SH RESULTATS
+-Le contenu des tables de routage du noyaus est affich en colonnes comme
++Le contenu des tables de routage du noyaus est affiché en colonnes comme
+ suit
+ .TP
+ .B Destination
+-Le rseau ou hte destination.
++Le réseau ou hôte destination.
+ .TP
+ .B Gateway
+-L'adresse de la passerelle ou '*' si indfini.
++L'adresse de la passerelle ou '*' si indéfini.
+ .TP
+ .B Genmask
+-Le masque de rseau pour le rseau destinataire; '255.255.255.255' pour un hte
+-et '0.0.0.0' pour la route par dfaut (
++Le masque de réseau pour le réseau destinataire; '255.255.255.255' pour un hôte
++et '0.0.0.0' pour la route par défaut (
+ .B default
+ ).
+ .TP
+@@ -254,63 +254,63 @@ Les indicateurs possibles sont
+ .br
+ .B H
+ (la cible est un
+-.BR hte )
++.BR hôte )
+ .br
+ .B G
+ (utilise comme
+ .BR passerelle )
+ .br
+ .B R
+-.RB ( rtablit
++.RB ( rétablit
+ la route pour le routage dynamique)
+ .br
+ .B D
+ .RB ( dynamiquement
+-configure par le dmon ou par redirect)
++configurée par le démon ou par redirect)
+ .br
+ .B M
+-.RB ( modifie
+-par le dmon de routage ou par redirect)
++.RB ( modifiée
++par le démon de routage ou par redirect)
+ .br
+ .B !
+-.RB ( rejte
++.RB ( rejète
+ la route)
+ .TP
+ .B Metric
+-La 'distance' la cible (habituellement compte en hops). Ce n'est pas
+-utilis par les noyaux rcents, mais peut-tre requis par certains dmons
++La 'distance' à la cible (habituellement comptée en hops). Ce n'est pas
++utilisé par les noyaux récents, mais peut-être requis par certains démons
+ de routage.
+ .TP
+ .B Ref
+-Nombre de rfrences cette route. (Pas utilis dans le noyau Linux.)
++Nombre de références à cette route. (Pas utilisé dans le noyau Linux.)
+ .TP
+ .B Use
+ Count of lookups for the route. Depending on the use of -F and -C this will
+ be either route cache misses (-F) or hits (-C).
+ .TP
+ .B Iface
+-Interface vers laquelle les paquets empruntant cette route seront envoys.
++Interface vers laquelle les paquets empruntant cette route seront envoyés.
+ .TP
+ .B MSS
+-Taille de segment maximum par dfaut pour les connexions TCP sur cette
++Taille de segment maximum par défaut pour les connexions TCP sur cette
+ route.
+ .TP
+ .B Window
+-Taille de fentre par dfaut pour les connexions TCP sur cette route.
++Taille de fenêtre par défaut pour les connexions TCP sur cette route.
+ .TP
+ .B irtt
+ RTT Initial (Round Trip Time). Le noyau utilise ceci pour essayer les
+-meilleurs paramtres protocolaires TCP sans attendre de rponse
+-(ventuellement tardive).
++meilleurs paramètres protocolaires TCP sans attendre de réponse
++(éventuellement tardive).
+ .TP
+-.B HH (seulement cach)
+-Le nombre d'entres ARP et de routes caches faisant rfrence au cache
+-d'en-tte matriel pour la route en cache. Ce sera la valeur \-1 si aucune adresse
+-matrielle n'est ncessaire pour l'interface de la route cache (p.ex. lo).
++.B HH (seulement caché)
++Le nombre d'entrées ARP et de routes cachées faisant référence au cache
++d'en-tête matériel pour la route en cache. Ce sera la valeur \-1 si aucune adresse
++matérielle n'est nécessaire pour l'interface de la route cachée (p.ex. lo).
+ .TP
+-.B Arp (seulement cach)
+-Indique si oui ou non l'adresse matrielle pour la route en cache est encore
+- jour.
++.B Arp (seulement caché)
++Indique si oui ou non l'adresse matérielle pour la route en cache est encore
++à jour.
+ .LP
+ .SH FICHIERS
+ .I /proc/net/ipv6_route
+@@ -324,11 +324,11 @@ Indique si oui ou non l'adresse mat
+ .LP
+ .SH HISTORIQUE
+ .B Route
+-pour Linux a t originellement crit par Fred N. van Kempen,
+-<waltje@uwalt.nl.mugnet.org> puis modifi par Johannes Stille et
+-Linus Torvalds pour pl15. Alan Cox a ajout les options concernant
+-la gestion des fentres et MSS pour Linux 1.1.22. Le support de irtt
+-et la fusion avec netstat ont t raliss par Bernd Eckenfels.
++pour Linux a été originellement écrit par Fred N. van Kempen,
++<waltje@uwalt.nl.mugnet.org> puis modifié par Johannes Stille et
++Linus Torvalds pour pl15. Alan Cox a ajouté les options concernant
++la gestion des fenêtres et MSS pour Linux 1.1.22. Le support de irtt
++et la fusion avec netstat ont été réalisés par Bernd Eckenfels.
+ .SH AUTEUR
+ Maintenu par Phil Blundell <Philip.Blundell@pobox.com>.
+ .SH TRADUCTION
+diff --git a/man/fr_FR/slattach.8 b/man/fr_FR/slattach.8
+index 512d514..d21d0d7 100644
+--- a/man/fr_FR/slattach.8
++++ b/man/fr_FR/slattach.8
+@@ -1,87 +1,87 @@
+ .TH SLATTACH 8 "12 Feb 1994" "" ""
+ .SH NOM
+-slattach \- attache une interface rseau une ligne srie
++slattach \- attache une interface réseau à une ligne série
+ .SH SYNOPSIS
+ .B "slattach [-dehlLmnqv] [-c commande] [-p proto] [-s vitesse] [tty]"
+ .br
+ .SH DESCRIPTION
+ .B Slattach
+-est un minuscule programme qui peut tre utilis pour attacher
+-un terminal normal ("srie") dans un des diffrents modes "rseau",
+-ceci vous permettant de l'utiliser pour des liaisons point--point
+-vers d'autres systmes.
++est un minuscule programme qui peut être utilisé pour attacher
++un terminal normal ("série") dans un des différents modes "réseau",
++ceci vous permettant de l'utiliser pour des liaisons point-à-point
++vers d'autres systèmes.
+ .SH OPTIONS
+ .TP
+ .B "[-c commande]"
+-Excute
++Exécute
+ .B `commande'
+-lorsque la ligne est suspendue. Ceci peut tre utilis pour lancer
+-des scripts ou rtablir des connexions quand un lien tombe.
++lorsque la ligne est suspendue. Ceci peut être utilisé pour lancer
++des scripts ou réétablir des connexions quand un lien tombe.
+ .TP
+ .B "[-d]"
+-Valide le dbogage. Utile pour dterminer pourquoi une configuration
++Valide le débogage. Utile pour déterminer pourquoi une configuration
+ ne fonctionne pas.
+ .TP
+ .B "[-h]"
+-Termine lorsque la porteuse est perdue. Ceci fonctionne la fois sur
+-les priphriques /dev/tty et /dev/cua en contrlant directement
+-l'tat de la porteuse toutes les 15 secondes.
++Termine lorsque la porteuse est perdue. Ceci fonctionne à la fois sur
++les périphériques /dev/tty et /dev/cua en contrôlant directement
++l'état de la porteuse toutes les 15 secondes.
+ .TP
+ .B "[-v]"
+ Valide le mode verbeux. Utile pour les shell scripts.
+ .TP
+ .B "[-q]"
+-Opre en mode silencieux - pas de messages du tout.
++Opère en mode silencieux - pas de messages du tout.
+ .TP
+ .B "[-l]"
+-Cre un fichier de vrouillage pour le priphrique comme
++Crée un fichier de vérouillage pour le périphérique comme
+ pour UUCP dans /var/lock.
+ .TP
+ .B "[-n]"
+-Equivalent la commande "mesg n".
++Equivalent à la commande "mesg n".
+ .TP
+ .B "[-m]"
+ \fBn'\fPinitialise \fBpas\fP la ligne en mode raw 8 bits.
+ .TP
+ .B "[-e]"
+-Termine correctement aprs l'initialisation du priphrique,
++Termine correctement après l'initialisation du périphérique,
+ au lieu d'attendre que la ligne soit suspendue.
+ .TP
+ .B "[-L]"
+-Valide les oprations 3 lignes. Le terminal est mis en mode CLOCAL,
+-la surveillance de porteuse est invalide.
++Valide les opérations 3 lignes. Le terminal est mis en mode CLOCAL,
++la surveillance de porteuse est invalidée.
+ .TP
+ .B "[-p proto]"
+-Dfinit le protocole spcifique utiliser sur la ligne.
+-La valeur par dfaut est
++Définit le protocole spécifique à utiliser sur la ligne.
++La valeur par défaut est
+ .B "cslip"
+-, c'est--dire SLIP compress. Les autres valeurs possibles sont :
++, c'est-à-dire SLIP compressé. Les autres valeurs possibles sont :
+ .B "slip"
+ (SLIP normal),
+ .B "adaptive"
+ (CSLIP/SLIP adaptatifs),
+ .B "ppp"
+-(Protocole Point--Point)
++(Protocole Point-à-Point)
+ et
+ .B "kiss"
+-(un protocole utilis pour communiquer avec des controleurs AX.25 paquets radios).
+-L'argument spcifique
++(un protocole utilisé pour communiquer avec des controleurs AX.25 paquets radios).
++L'argument spécifique
+ .B "tty"
+-peut tre utilis pour refaire passer le priphrique en
+-fonctionnement srie normal. L'utilisation du mode 'ppp' n'est en
+-principe pas utile puisque ppp ncessite le dmon additionnel
++peut être utilisé pour refaire passer le périphérique en
++fonctionnement série normal. L'utilisation du mode 'ppp' n'est en
++principe pas utile puisque ppp nécessite le démon additionnel
+ .B pppd
+-pour tre actif sur la ligne. Pour les connexions `kiss', le programme
++pour être actif sur la ligne. Pour les connexions `kiss', le programme
+ .B axattach
+-doit tre utilis.
++doit être utilisé.
+ .TP
+ .B "[-s vitesse]"
+-Dfinit la vitesse de la ligne, diffrente de la valeur par dfaut.
++Définit la vitesse de la ligne, différente de la valeur par défaut.
+ .PP
+-Si aucun argument n'est donn, la ligne courante du terminal
+-(habituellement lie au login) est utilise. Autrement, une tentative
+-est effectue pour obtenir le port du terminal indiqu, puis il est
+-vrouill et ouvert.
++Si aucun argument n'est donné, la ligne courante du terminal
++(habituellement liée au login) est utilisée. Autrement, une tentative
++est effectuée pour obtenir le port du terminal indiqué, puis il est
++vérouillé et ouvert.
+ .SH FICHIERS
+ .I /dev/cua* /var/lock/LCK.*
+ .SH BUGS
+diff --git a/man/pt_BR/arp.8 b/man/pt_BR/arp.8
+index 41c8fd6..6c1e7f7 100644
+--- a/man/pt_BR/arp.8
++++ b/man/pt_BR/arp.8
+@@ -7,12 +7,12 @@ arp \- manipula o cache ARP do sistema
+ .RB [ "\-H tipo" ]
+ .RB [ "-i if" ]
+ .B -a
+-.RB [ mquina ]
++.RB [ máquina ]
+ .PP
+ .B arp
+ .RB [ \-v ]
+ .RB [ "\-i if" ]
+-.B "\-d mquina"
++.B "\-d máquina"
+ .RB [ pub ]
+ .RB [ nopub ]
+ .PP
+@@ -20,7 +20,7 @@ arp \- manipula o cache ARP do sistema
+ .RB [ \-v ]
+ .RB [ "\-H tipo" ]
+ .RB [ "\-i if" ]
+-.B -s mquina endereo_hardware
++.B -s máquina endereço_hardware
+ .RB [ temp ]
+ .RB [ nopub ]
+ .PP
+@@ -28,7 +28,7 @@ arp \- manipula o cache ARP do sistema
+ .RB [ \-v ]
+ .RB [ "\-H tipo" ]
+ .RB [ "\-i if" ]
+-.B -s mquina endereo_hardware
++.B -s máquina endereço_hardware
+ .RB [ "netmask nm" ]
+ .B pub
+ .PP
+@@ -36,7 +36,7 @@ arp \- manipula o cache ARP do sistema
+ .RB [ \-v ]
+ .RB [ "\-H tipo" ]
+ .RB [ "\-i if" ]
+-.B -Ds mquina ifa
++.B -Ds máquina ifa
+ .RB [ "netmask nm" ]
+ .B pub
+ .PP
+@@ -46,28 +46,28 @@ arp \- manipula o cache ARP do sistema
+ .RB [ "-i if" ]
+ .B -f arquivo
+
+-.SH DESCRIO
++.SH DESCRIÇÃO
+ .B arp
+-manipula o cache ARP do kernel de vrias maneiras. As principais opes
+-so remoo de uma entrada de mapeamento de endereo e configurao manual
+-de um endereo. Para propsitos de depurao, o programa
++manipula o cache ARP do kernel de várias maneiras. As principais opções
++são remoção de uma entrada de mapeamento de endereço e configuração manual
++de um endereço. Para propósitos de depuração, o programa
+ .B arp
+-tambm permite um dump completo do cache ARP.
+-.SH OPES
++também permite um dump completo do cache ARP.
++.SH OPÇÕES
+ .TP
+ .B "\-v, \-\-verbose"
+-Mostra ao usurio o que est acontecendo, de modo detalhado.
++Mostra ao usuário o que está acontecendo, de modo detalhado.
+ .TP
+ .B "\-n, \-\-numeric"
+-mostra endereos numricos, ao invs de tentar determinar os nomes simblicos da
+-mquina, porta e usurio.
++mostra endereços numéricos, ao invés de tentar determinar os nomes simbólicos da
++máquina, porta e usuário.
+ .TP
+ .B "\-H type, \-\-hw-type type"
+-Quando configurando ou lendo o cache ARP, este parmetro opcional informa ao
++Quando configurando ou lendo o cache ARP, este parâmetro opcional informa ao
+ .B arp
+-que classe de entradas devem ser verificadas. O valor padro deste parmetro
++que classe de entradas devem ser verificadas. O valor padrão deste parâmetro é
+ .B ether
+-(i.e. cdigo de hardware 0x01 para Ethernet IEEE 802.3 10Mbps).
++(i.e. código de hardware 0x01 para Ethernet IEEE 802.3 10Mbps).
+ Outros valores podem incluir tecnologias de rede como
+ .RB "ARCnet (" arcnet ")"
+ ,
+@@ -77,86 +77,86 @@ Outros valores podem incluir tecnologias de rede como
+ e
+ .RB "NET/ROM (" netrom ")."
+ .TP
+-.B "\-a [mquina], \-\-display [mquina]"
+-Mostra as entradas das mquinas especificadas. Se o parmetro
+-.B mquina
+-no for usado,
++.B "\-a [máquina], \-\-display [máquina]"
++Mostra as entradas das máquinas especificadas. Se o parâmetro
++.B máquina
++não for usado,
+ .B todas
+-as entradas sero mostradas.
++as entradas serão mostradas.
+ .TP
+-.B "\-d mquina, \-\-delete mquina"
+-Remove quaisquer entradas para a mquina especificada. Isto pode ser
+-usado se a mquina indicada for desligada, por exemplo. Nos kernels
++.B "\-d máquina, \-\-delete máquina"
++Remove quaisquer entradas para a máquina especificada. Isto pode ser
++usado se a máquina indicada for desligada, por exemplo. Nos kernels
+ mais recentes o
+ .BR arp (1)
+-suporta a especificao de
++suporta a especificação de
+ .B pub
+ ou
+ .B nopub
+-para decidir se uma entrada pblica ou privada deve ser removida. Se voc
+-no informar uma destas flags as duas entradas sero removidas.
++para decidir se uma entrada pública ou privada deve ser removida. Se você
++não informar uma destas flags as duas entradas serão removidas.
+ .TP
+ .B "\-D, \-\-use-device"
+-Usa o endereo de hardware da interface
++Usa o endereço de hardware da interface
+ .BR ifa
+ .TP
+ .B "\-i If, \-\-device If"
+ Seleciona uma interface. Quando mostrando o cache ARP somente entradas iguais
+- interface sero mostradas. Configura uma entrada ARP permanente ou
+-temporria que ser usada no dispositivo especificado. Se nenhum dispositivo for
++à interface serão mostradas. Configura uma entrada ARP permanente ou
++temporária que será usada no dispositivo especificado. Se nenhum dispositivo for
+ informado, o kernel descobre o dispositivo a partir da tabela de roteamento.
+ Para entradas
+ .B pub
+-a interface especificada a interface na qual as requisies ARP sero
++a interface especificada é a interface na qual as requisições ARP serão
+ respondidas.
+ .br
+ .B NOTA:
+-Deve ser diferente da interface para a qual os pacotes IP sero roteados.
++Deve ser diferente da interface para a qual os pacotes IP serão roteados.
+ .TP
+-.B "\-s mquina endereo_hardware, \-\-set mquina"
+-Cria manualmente uma entrada de mapeamento de endereo ARP para a mquina
+-.B mquina
+-com endereo de hardware configurado para
+-.B endereo_hardware.
+-O formato do endereo de hardware depende da classe de hardware, mas
+-para a maioria das classes pode-se assumir que a apresentao usual pode
+-ser usada. Para a classe Ethernet, so 6 bytes em hexadecimal, separados
+-por dois pontos (:). Quando adicionando entradas proxy arp (isto , aquelas
++.B "\-s máquina endereço_hardware, \-\-set máquina"
++Cria manualmente uma entrada de mapeamento de endereço ARP para a máquina
++.B máquina
++com endereço de hardware configurado para
++.B endereço_hardware.
++O formato do endereço de hardware depende da classe de hardware, mas
++para a maioria das classes pode-se assumir que a apresentação usual pode
++ser usada. Para a classe Ethernet, são 6 bytes em hexadecimal, separados
++por dois pontos (:). Quando adicionando entradas proxy arp (isto é, aquelas
+ com a flag
+-.BR pb lico
++.BR púb lico
+ setadas) uma
+ .B netmask
+ pode ser especificada para o proxy arp de uma subrede inteira.
+-Proxy arp para rotear redes inteiras no um bom protocolo, mas algumas
+-vezes til, ento suportado. Se a flag
++Proxy arp para rotear redes inteiras não é um bom protocolo, mas algumas
++vezes é útil, então é suportado. Se a flag
+ .B temp
+-no for fornecida, as entradas sero permanentemente armazenadas no cache ARP.
++não for fornecida, as entradas serão permanentemente armazenadas no cache ARP.
+ .TP
+ .B "\-f arquivo, \-\-file arquivo"
+-Similar opo
++Similar à opção
+ .B \-s
+-s que desta vez as informaes de endereos so obtidas a partir do arquivo
++só que desta vez as informações de endereços são obtidas a partir do arquivo
+ .B arquivo.
+-Isto pode ser usado se entradas ARP para muitas mquinas tiverem que ser
+-configuradas. O nome do arquivo de dados freqentemente
++Isto pode ser usado se entradas ARP para muitas máquinas tiverem que ser
++configuradas. O nome do arquivo de dados é freqüentemente
+ .IR /etc/ethers ,
+-mas isto no oficial.
++mas isto não é oficial.
+ .sp 1
+-O formato deste arquivo simples; ele somente contm linhas de texto ASCII com
+-um nome de mquina e um endereo de hardware separados por um espao em branco.
++O formato deste arquivo é simples; ele somente contém linhas de texto ASCII com
++um nome de máquina e um endereço de hardware separados por um espaço em branco.
+ Adicionalmente as flags
+ .BR "pub" , " nopub" , " temp" " and" " netmask"
+ podem ser usadas.
+ .LP
+ Em todos os lugares onde uma
+-.B mquina
+- esperada, voc tambm pode informar um
+-.B "endereo IP"
+-em notao decimal separada por pontos.
++.B máquina
++é esperada, você também pode informar um
++.B "endereço IP"
++em notação decimal separada por pontos.
+ .LP
+-Cada entrada completa no cache ARP ser marcada com uma flag
++Cada entrada completa no cache ARP será marcada com uma flag
+ .BR C .
+-Entradas permanentes so marcadas com um
++Entradas permanentes são marcadas com um
+ .B M
+ e entradas publicadas tem uma flag
+ .BR P .
+@@ -171,7 +171,7 @@ e entradas publicadas tem uma flag
+ .SH AUTOR
+ Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org> com muitas melhorias
+ feitas pelo mantenedor do net-tools, Bernd Eckenfels <net-tools@lina.inka.de>.
+-Traduo para a lngua portuguesa feita por
++Tradução para a língua portuguesa feita por
+ Arnaldo Carvalho de Melo <acme@conectiva.com.br> em 11/abril/1998.
+ Revisado por
+ Jorge Luiz Godoy Filho <jorge@bestway.com.br> em 15/abril/1998.
+diff --git a/man/pt_BR/hostname.1 b/man/pt_BR/hostname.1
+index fe00879..5880fc8 100644
+--- a/man/pt_BR/hostname.1
++++ b/man/pt_BR/hostname.1
+@@ -1,15 +1,15 @@
+ .TH HOSTNAME 1 "28 de janeiro de 1996" "net-tools" "Manual do Programador Linux"
+
+ .SH NOME
+-hostname \- mostra ou configura o nome da mquina
++hostname \- mostra ou configura o nome da máquina
+ .BR
+-domainname \- mostra ou configura o nome do domnio NIS/YP
++domainname \- mostra ou configura o nome do domínio NIS/YP
+ .BR
+-dnsdomainname \- mostra o nome do domnio DNS
++dnsdomainname \- mostra o nome do domínio DNS
+ .BR
+-nisdomainname \- mostra ou configura o nome do domnio NIS/YP
++nisdomainname \- mostra ou configura o nome do domínio NIS/YP
+ .BR
+-ypdomainname \- mostra ou configura o nome do domnio NIS/YP
++ypdomainname \- mostra ou configura o nome do domínio NIS/YP
+
+ .SH SINOPSE
+ .B hostname
+@@ -34,7 +34,7 @@ ypdomainname \- mostra ou configura o nome do dom
+ .RB [ \-v ]
+ .RB [ \-F\ arquivo ]
+ .RB [ \-\-file\ arquivo ]
+-.RB [ mquina ]
++.RB [ máquina ]
+
+ .PP
+ .B domainname
+@@ -61,11 +61,11 @@ ypdomainname \- mostra ou configura o nome do dom
+ .B ypdomainname
+ .RB [ \-v ]
+
+-.SH DESCRIO
++.SH DESCRIÇÃO
+ .B hostname
+- o programa usado para configurar ou mostrar o nome corrente da mquina
+-ou o domnio do sistema. Este nome usado por muitos dos programas de
+-rede para identificar a mquina. O nome do domnio tambm usado pelo
++é o programa usado para configurar ou mostrar o nome corrente da máquina
++ou o domínio do sistema. Este nome é usado por muitos dos programas de
++rede para identificar a máquina. O nome do domínio também é usado pelo
+ NIS/YP.
+
+ .SS "OBTER NOME"
+@@ -73,119 +73,119 @@ Quando chamado sem argumentos o programa mostra os nomes correntes:
+
+ .LP
+ .B hostname
+-mostrar o nome do sistema conforme retornado pela funo
++mostrará o nome do sistema conforme retornado pela função
+ .BR gethostname (2).
+
+
+ .LP
+ .B "domainname, nisdomainname, ypdomainname"
+-mostrar o nome do sistema conforme retornado pela funo
++mostrará o nome do sistema conforme retornado pela função
+ .BR getdomainname (2).
+-Isto tambm conhecido como o nome de domnio YP/NIS do sistema.
++Isto também é conhecido como o nome de domínio YP/NIS do sistema.
+
+ .LP
+ .B dnsdomainname
+-mostrara a parte do domnio do FQDN (Nome de domnio completamente qualificado).
+-O FQDN do sistema retornado pelo comando
++mostrara a parte do domínio do FQDN (Nome de domínio completamente qualificado).
++O FQDN do sistema é retornado pelo comando
+ .BR "hostname \-\-fqdn" .
+
+ .SS "CONFIGURAR NOME"
+-Quando chamado com um argumento ou com a opo
++Quando chamado com um argumento ou com a opção
+ .B \-\-file
+-, o comando configura o nome da mquina ou do domnio NIS/YP.
++, o comando configura o nome da máquina ou do domínio NIS/YP.
+
+ .LP
+-Note que somente o super usurio pode mudar os nomes.
++Note que somente o super usuário pode mudar os nomes.
+
+ .LP
+-Nao possvel configurar o FQDN ou o nome do domnio DNS com o comando
++Nao é possível configurar o FQDN ou o nome do domínio DNS com o comando
+ .B dnsdomainname
+ (veja
+ .B "O FQDN"
+ abaixo).
+
+ .LP
+-O nome da mquina normalmente configurado durante a inicializao do sistema,
++O nome da máquina é normalmente configurado durante a inicialização do sistema,
+ em
+ .I /etc/rc.d/rc.inet1
+ ou
+ .I /etc/init.d/boot
+-(normalmente lendo o contedo de um arquivo que contm o nome da mquina, ex.:
++(normalmente lendo o conteúdo de um arquivo que contém o nome da máquina, ex.:
+ .IR /etc/hostname ).
+
+ .SS O FQDN
+-Voc no pode mudar o FQDN (conforme retornado por
++Você não pode mudar o FQDN (conforme retornado por
+ .BR "hostname \-\-fqdn" )
+-ou o nome do domnio DNS (conforme retornado por
++ou o nome do domínio DNS (conforme retornado por
+ .BR "dnsdomainname" )
+-com este comando. O FQDN do sistema o nome que o
++com este comando. O FQDN do sistema é o nome que o
+ .BR resolver (3)
+-retorna para o nome da mquina.
++retorna para o nome da máquina.
+
+ .LP
+-Tecnicamente: O FQDN o nome retornado pelo
++Tecnicamente: O FQDN é o nome retornado pelo
+ .BR gethostbyname (2)
+ para o nome retornado pelo
+ .BR gethostname (2).
+-O nome do domnio DNS a parte aps o primeiro ponto.
++O nome do domínio DNS é a parte após o primeiro ponto.
+ .LP
+-Portanto isto depende da configurao (normalmente em
++Portanto isto depende da configuração (normalmente em
+ .IR /etc/host.conf )
+-para que voc possa mud-lo. Normalmente (se o arquivo hosts for lido antes
+-do DNS ou NIS) voc pode mud-lo em
++para que você possa mudá-lo. Normalmente (se o arquivo hosts for lido antes
++do DNS ou NIS) você pode mudá-lo em
+ .IR /etc/hosts .
+
+
+-.SH OPES
++.SH OPÇÕES
+ .TP
+ .I "\-a, \-\-alias"
+-Mostra o alias da mquina (se usado).
++Mostra o alias da máquina (se usado).
+ .TP
+ .I "\-d, \-\-domain"
+-Mostra o nome do domnio DNS. No use o comando
++Mostra o nome do domínio DNS. Não use o comando
+ .B domainname
+-para obter o nome do domnio DNS porque ele mostrar o nome do domnio NIS e
+-no o nome do domnio DNS. Use
++para obter o nome do domínio DNS porque ele mostrará o nome do domínio NIS e
++não o nome do domínio DNS. Use
+ .BR dnsdomainname .
+ .TP
+ .I "\-F, \-\-file arquivo"
+-Leia o nome da mquina a partir do arquivo especificado. Comentrios (linhas
+-comeando com um `#') so ignorados.
++Leia o nome da máquina a partir do arquivo especificado. Comentários (linhas
++começando com um `#') são ignorados.
+ .TP
+ .I "\-f, \-\-fqdn, \-\-long"
+-Mostra o FQDN (Nome de Domnio Completamente Qualificado). Um FQDN consiste de
+-um nome curto de mquina e do nome do domnio DNS. A menos que voc esteja
+-usando bind ou NIS para resoluo de nomes voc pode mudar o FQDN e o nome
+-do domnio DNS (que parte do FQDN) no arquivo \fI/etc/hosts\fR.
++Mostra o FQDN (Nome de Domínio Completamente Qualificado). Um FQDN consiste de
++um nome curto de máquina e do nome do domínio DNS. A menos que você esteja
++usando bind ou NIS para resolução de nomes você pode mudar o FQDN e o nome
++do domínio DNS (que é parte do FQDN) no arquivo \fI/etc/hosts\fR.
+ .TP
+ .I "\-h, \-\-help"
+ Mostra uma mensagem sobre como utilizar o comando e termina.
+ .TP
+ .I "\-i, \-\-ip-address"
+-Mostra o(s) endereo(s) IP da mquina.
++Mostra o(s) endereço(s) IP da máquina.
+ .TP
+ .I "\-s, \-\-short"
+-Mostra o nome curto da mquina. o nome da mquina at o primeiro ponto.
++Mostra o nome curto da máquina. É o nome da máquina até o primeiro ponto.
+ .TP
+ .I "\-V, \-\-version"
+-Mostra informao de verso na sada padro e termina com sucesso.
++Mostra informação de versão na saída padrão e termina com sucesso.
+ .TP
+ .I "\-v, \-\-verbose"
+-Mostra uma sada detalhada do que est acontecendo.
++Mostra uma saída detalhada do que está acontecendo.
+ .TP
+ .I "\-y, \-\-yp, \-\-nis"
+-Mostra o nome do domnio NIS. Se um parmetro for especificado (ou
++Mostra o nome do domínio NIS. Se um parâmetro for especificado (ou
+ .B \-\-file arquivo
+-) ento o root tambm pode configurar um novo domnio NIS.
++) então o root também pode configurar um novo domínio NIS.
+ .SH ARQUIVOS
+ .B /etc/hosts
+ .SH AUTOR
+ Peter Tobias, <tobias@et-inf.fho-emden.de>
+ .BR
+-Bernd Eckenfels, <net-tools@lina.inka.de> (NIS e pgina man).
++Bernd Eckenfels, <net-tools@lina.inka.de> (NIS e página man).
+ .BR
+-Arnaldo Carvalho de Melo, <acme@conectiva.com.br> Traduo para a lngua
++Arnaldo Carvalho de Melo, <acme@conectiva.com.br> Tradução para a língua
+ portuguesa.
+ .BR
+-Jorge Luiz Godoy Filho, <jorge@bestway.com.br> Reviso.
++Jorge Luiz Godoy Filho, <jorge@bestway.com.br> Revisão.
+ .BR
+diff --git a/man/pt_BR/ifconfig.8 b/man/pt_BR/ifconfig.8
+index 0a97683..1432dc5 100644
+--- a/man/pt_BR/ifconfig.8
++++ b/man/pt_BR/ifconfig.8
+@@ -4,13 +4,13 @@ ifconfig \- configura uma interface de rede
+ .SH SINOPSE
+ .B "ifconfig [interface]"
+ .br
+-.B "ifconfig interface [aftype] opes | endereos ..."
+-.SH DESCRIO
++.B "ifconfig interface [aftype] opções | endereços ..."
++.SH DESCRIÇÃO
+ .B ifconfig
+- usado para configurar (e posteriormente manter) as interfaces de
+-rede. usado durante o boot para configurar a maioria delas para
+-um estado usvel. Depois disto, normalmente somente necessrio
+-durante depuraes ou quando for necessria uma configurao fina
++é usado para configurar (e posteriormente manter) as interfaces de
++rede. É usado durante o boot para configurar a maioria delas para
++um estado usável. Depois disto, é normalmente somente necessário
++durante depurações ou quando for necessária uma configuração fina
+ do sistema.
+ .LP
+ Se nenhum argumento for informado,
+@@ -19,12 +19,12 @@ somente mostra o estado das interfaces correntemente definidas. Se
+ um argumento
+ .B interface
+ for informado, ele mostra somente o estado da interface informada. De
+-outra forma ele assume que os parmetros devem ser configurados.
+-.SH Famlias de Endereamento
+-Se o primeiro argumento aps o nome da interface for reconhecido
+-como um nome de uma famlia de endereamento suportada, esta famlia
+-de endereamento usada na decodificao e apresentao de todos
+-os endereos de protocolos. Atualmente as famlias de endereamento
++outra forma ele assume que os parâmetros devem ser configurados.
++.SH Famílias de Endereçamento
++Se o primeiro argumento após o nome da interface for reconhecido
++como um nome de uma família de endereçamento suportada, esta família
++de endereçamento é usada na decodificação e apresentação de todos
++os endereços de protocolos. Atualmente as famílias de endereçamento
+ suportadas incluem
+ .B inet
+ (TCP/IP, default)
+@@ -36,95 +36,91 @@ suportadas incluem
+ (Novell IPX) and
+ .B netrom
+ (AMPR Packet radio).
+-.SH OPES
++.SH OPÇÕES
+ .TP
+ .B interface
+-O nome da interface de rede. Usualmente um nome como
++O nome da interface de rede. Usualmente é um nome como
+ .B eth0
+ ,
+ .B sl3
+ ou algo parecido: um nome de driver de dispositivo seguido por um
+-nmero.
++número.
+ .TP
+ .B up
+-Esta flag causa a ativao da interface. especificada
+-implicitamente se a interface receber um novo endereo (veja
++Esta flag causa a ativação da interface. É especificada
++implicitamente se a interface receber um novo endereço (veja
+ abaixo).
+ .TP
+ .B down
+-Esta flag desativa o driver desta interface, til quando alguma
+-coisa comear a ter problemas.
++Esta flag desativa o driver desta interface, é útil quando alguma
++coisa começar a ter problemas.
+ .TP
+ .B "[\-]arp"
+ Habilita ou desabilita o uso do protocolo ARP para esta interface. Se
+-o sinal de menos (\-) estiver presente a opo desligada.
++o sinal de menos (\-) estiver presente a opção é desligada.
+ .TP
+ .B "[\-]trailers"
+-Habilita ou desabilita o uso de trailer em frames Ethernet. No
+-utilizada na implementao atual do pacote net-tools.
++Habilita ou desabilita o uso de trailer em frames Ethernet. Não é
++utilizada na implementação atual do pacote net-tools.
+ .TP
+ .B "[\-]allmulti"
+ Habilita ou desabilita o modo
+ .B promiscuous
+-da interface. Isto significa que todos os frames passaro pela camada
+-de rede do kernel, permitindo monitorao da rede.
+-.TP
+-.B "metric N"
+-Este parmetro configura a mtrica da interface. No usado atualmente,
+-mas ser implementado no futuro.
++da interface. Isto significa que todos os frames passarão pela camada
++de rede do kernel, permitindo monitoração da rede.
+ .TP
+ .B "mtu N"
+-Este parmetro configura a Unidade Mxima de Transferncia (MTU) de uma
+-interface. Para Ethernet um nmero entre 1000-2000 (o padro
+-1500). Para SLIP, use algo entre 200 e 4096. Note que a implementao
+-atual no manipula fragmentao IP ainda, ento melhor configurar
++Este parâmetro configura a Unidade Máxima de Transferência (MTU) de uma
++interface. Para Ethernet é um número entre 1000-2000 (o padrão é
++1500). Para SLIP, use algo entre 200 e 4096. Note que a implementação
++atual não manipula fragmentação IP ainda, então é melhor configurar
+ a MTU com um tamanho adequado!
+ .TP
+ .B "dstaddr addr"
+-Configura o endereo IP do "outro lado" no caso de um link Ponto-A-Ponto,
++Configura o endereço IP do "outro lado" no caso de um link Ponto-A-Ponto,
+ como PPP. Esta palavra-chave tornou-se obsoleta e deve ser usada a nova
+ palavra-chave
+ .BR pointopoint .
+ .TP
+ .B "netmask addr"
+-Configura a mscara de rede IP para esta interface. Este valor assume o
+-padro usual das classes A, B ou C (deduzindo-o a partir do endereo
++Configura a máscara de rede IP para esta interface. Este valor assume o
++padrão usual das classes A, B ou C (deduzindo-o a partir do endereço
+ IP da interface), mas pode ser configurado para qualquer valor para o
+ uso de sub-redes.
+
+ .TP
+ .B "irq addr"
+-Configura a linha de interrupo (IRQ) usada por este dispositivo. Muitos
+-dispositivos no suportam configurao dinmica de IRQ.
++Configura a linha de interrupção (IRQ) usada por este dispositivo. Muitos
++dispositivos não suportam configuração dinâmica de IRQ.
+ .TP
+-.B "[-]broadcast [endereo]"
+-Se o argumento endereo for informado, configura o endereo de protocolo
++.B "[-]broadcast [endereço]"
++Se o argumento endereço for informado, configura o endereço de protocolo
+ broadcast para esta interface. De outra forma ele somente configura a flag
+ .B IFF_BROADCAST
+ da interface. Se a palavra-chave for precedida por um sinal de menos
+ .B (-)
+-, ento a flag removida.
++, então a flag é removida.
+ .TP
+-.B "[-]pointopoint [endereo]"
++.B "[-]pointopoint [endereço]"
+ Esta palavra-chave habilita o modo
+ .B ponto-a-ponto
+-da interface, significando que ela um link direto entre duas mquinas
+-sem ningum ouvindo (ou, pelo menos ns esperamos que este seja o caso
++da interface, significando que ela é um link direto entre duas máquinas
++sem ninguém ouvindo (ou, pelo menos nós esperamos que este seja o caso
+ :-)
+ .BR
+-Se o argumento endereo for informado, configura o endereo de protocolo
++Se o argumento endereço for informado, configura o endereço de protocolo
+ do outro lado do link, exatamente como a palavra-chave obsoleta
+ .B dstaddr
+ faz. De outra forma, ela somente configura a flag
+ .B IFF_POINTOPOINT
+ da interface. Se a palavra-chave for precedida por um sinal de menos
+ .B (-)
+-, ento a flag removida.
++, então a flag é removida.
+ .TP
+ .B "hw"
+-Configura o endereo de hardware para esta interface, se o driver do
+-dispositivo suportar esta operao. A palavra-chave deve ser seguida
+-pelo nome da classe do hardware e o equivalente em ASCII do endereo
++Configura o endereço de hardware para esta interface, se o driver do
++dispositivo suportar esta operação. A palavra-chave deve ser seguida
++pelo nome da classe do hardware e o equivalente em ASCII do endereço
+ de hardware. As classes de hardware atualmente suportadas incluem
+ .B ether
+ (Ethernet),
+@@ -136,45 +132,34 @@ e
+ (AMPR NET/ROM).
+ .TP
+ .B multicast
+-Inicializa a flag de multicast para a interface. Normalmente, isto no ser
+-necessrio j que os drivers ajustam as flags corretas por si s.
++Inicializa a flag de multicast para a interface. Normalmente, isto não será
++necessário já que os drivers ajustam as flags corretas por si só.
+ .TP
+-.B endereo
+-O nome ou endereo IP da mquina (um nome de mquina ser traduzido para
+-um endereo IP) da interface. Este parmetro necessrio, apesar
+-da sintaxe atualmente no requisit-lo.
++.B endereço
++O nome ou endereço IP da máquina (um nome de máquina será traduzido para
++um endereço IP) da interface. Este parâmetro é necessário, apesar
++da sintaxe atualmente não requisitá-lo.
+ .SH NOTAS
+-
+-+Since kernel release 2.2 there are no explicit interface statistics for
+-+alias interfaces anymore. The statistics printed for the original address
+-+are shared with all alias addresses on the same device. If you want per-address
+-+statistics you should add explicit accounting
+-+rules for the address using the
+-+.BR ipchains(8)
+-+command.
+-
+-Deste o kernel 2.2 no existem mais estatsticas explcitas para os apelidos (aliases)
+-de interfaces. As estatsticas mostradas para o endereo original so compartilhadas
+-como todos os endereos associados ao mesmo dispositivo. Se desejar estatsticas
+-por endereo voc deve explicitamente adicionar regras de contabilizao para os
+-endereos usando o comando
+-.BR ipchains(8)
++Deste o kernel 2.2 não existem mais estatísticas explícitas para os apelidos (aliases)
++de interfaces. As estatísticas mostradas para o endereço original são compartilhadas
++como todos os endereços associados ao mesmo dispositivo. Se desejar estatísticas
++por endereço você deve explicitamente adicionar regras de contabilização para os
++endereços usando o comando
++.BR iptables(8)
+ .
+
+ .SH ARQUIVOS
+-.I /proc/net/socket
+-.br
+ .I /proc/net/dev
+ .SH BUGS
+-Os endereos appletalk DDP e IPX sero mostrados, mas no podem ser alterados
++Os endereços appletalk DDP e IPX serão mostrados, mas não podem ser alterados
+ com este comando.
+-.SH VEJA TAMBM
+-route(8), netstat(8), arp(8), rarp(8), ipchains(8)
++.SH VEJA TAMBÉM
++route(8), netstat(8), arp(8), rarp(8), iptables(8)
+ .SH AUTORES
+ Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+ Alan Cox, <Alan.Cox@linux.org>
+-.SH TRADUO E REVISO PARA A LNGUA PORTUGUESA
+-Arnaldo Carvalho de Melo <acme@conectiva.com.br> (traduo)
++.SH TRADUÇÃO E REVISÃO PARA A LÍNGUA PORTUGUESA
++Arnaldo Carvalho de Melo <acme@conectiva.com.br> (tradução)
+ .BR
+-Jorge Luiz Godoy Filho <jorge@bestway.com.br> (reviso)
++Jorge Luiz Godoy Filho <jorge@bestway.com.br> (revisão)
+
+diff --git a/man/pt_BR/netstat.8 b/man/pt_BR/netstat.8
+index b9b359a..d2d04ef 100644
+--- a/man/pt_BR/netstat.8
++++ b/man/pt_BR/netstat.8
+@@ -5,13 +5,13 @@
+ .\"
+ .\" Modificado por: Bernd.Eckenfels@inka.de
+ .\" Modificado por: Andi Kleen ak@muc.de
+-.\" Traduzido para portugus por Arnaldo Carvalho de Melo <acme@conectiva.com.br>
++.\" Traduzido para português por Arnaldo Carvalho de Melo <acme@conectiva.com.br>
+ .\" Revisado por Jorge Luiz Godoy Filho <jorge@bestway.com.br>
+ .\"
+-.TH NETSTAT 8 "19 de maio de 1997" "net-tools" "Manual do Programador Linux"
++.TH NETSTAT 8 "2007-12-02" "net-tools" "Manual do Programador Linux"
+
+ .SH NOME
+-netstat \- Mostra conexes de rede, tabelas de roteamento, estatsticas de interface e conexes
++netstat \- Mostra conexões de rede, tabelas de roteamento, estatísticas de interface e conexões
+ mascaradas.
+ .SH SINOPSE
+
+@@ -19,6 +19,8 @@ mascaradas.
+ .RB [ \-venaoc ]
+ .RB [ \-\-tcp | \-t ]
+ .RB [ \-\-udp | \-u ]
++.RB [ \-\-udplite | \-U ]
++.RB [ \-\-sctp | \-S ]
+ .RB [ \-\-raw | \-w ]
+ .RB [ \-\-unix | \-x ]
+ .RB [ \-\-inet | \-\-ip ]
+@@ -63,90 +65,90 @@ mascaradas.
+ .RB { \-h | \-\-help }
+
+ .PP
+-.SH DESCRIO
++.SH DESCRIÇÃO
+ .B netstat
+-mostra informaes do subsistema de rede do Linux.
++mostra informações do subsistema de rede do Linux.
+
+-.SS "(sem opes)"
+-Voc pode ver o estado das conexes de rede atravs da listagem dos sockets
+-abertos. Esta a operao padro: se voc no especificar nenhuma
+-famlia de endereos, os sockets ativos de todas as famlias de endereos
+-configuradas sero mostrados. Com
++.SS "(sem opções)"
++Você pode ver o estado das conexões de rede através da listagem dos sockets
++abertos. Esta é a operação padrão: se você não especificar nenhuma
++família de endereços, os sockets ativos de todas as famílias de endereços
++configuradas serão mostrados. Com
+ .B -e
+-voc obter informaes adicionais (userid). Com a chave
++você obterá informações adicionais (userid). Com a chave
+ .B -v
+-voc poder fazer com que o netstat reclame sobre famlias de endereos
+-conhecidas que no sejam suportadas pelo kernel. A opo
++você poderá fazer com que o netstat reclame sobre famílias de endereços
++conhecidas que não sejam suportadas pelo kernel. A opção
+ .B -o
+-mostra algumas informaes adicionais sobre temporizadores de rede.
++mostra algumas informações adicionais sobre temporizadores de rede.
+ .B -a
+-mostra todos os sockets, incluindo sockets de servidores. A famlia de
+-endereos
++mostra todos os sockets, incluindo sockets de servidores. A família de
++endereços
+ .B inet
+-mostrar sockets raw, udp e tcp.
++mostrará sockets raw, udp e tcp.
+
+ .SS "\-r, \-\-route"
+-Com a opo
++Com a opção
+ .BR \-r ", " \-\-route
+-voc obter as tabelas de roteamento do kernel no mesmo formato usado por
++você obterá as tabelas de roteamento do kernel no mesmo formato usado por
+ .BR "route -e" .
+ .B "netstat -er"
+-usar o formato de apresentao do comando
++usará o formato de apresentação do comando
+ .BR route .
+ Por favor veja
+ .BR route (8)
+ para maiores detalhes.
+
+-.SS "\-i, \-\-interface \fIiface\fI"
+-Se voc usar a opo
++.SS "\-i, \-\-interfaces \fIiface\fI"
++Se você usar a opção
+ .BR -i ", " --interfaces
+ , uma tabela de todas (ou da
+ .IR iface
+-especificada) as interfaces de rede ser mostrada. A sada usa o formato
++especificada) as interfaces de rede será mostrada. A saída usa o formato
+ .B "ifconfig -e"
+-, e descrita em
++, e é descrita em
+ .BR ifconfig (8).
+ .B "netstat -ei"
+-mostrar uma tabela ou uma entrada de interface como
++mostrará uma tabela ou uma entrada de interface como
+ .B ifconfig
+ mostra. Com a chave
+ .B -a
+-, voc pode incluir interfaces que no estejam configuradas (i.e. no tem
++, você pode incluir interfaces que não estejam configuradas (i.e. não tem
+ a flag
+ .BR U = UP
+ configurada).
+
+ .SS "\-M, \-\-masquerade"
+
+-Uma lista de todas as sesses mascaradas tambm pode ser vista. Com a chave
++Uma lista de todas as sessões mascaradas também pode ser vista. Com a chave
+ .B -e
+-voc pode incluir mais algumas informaes sobre numerao sequencial e deltas
+-, causados por reescritas de dados em sesses FTP (comando PORT).
+-O suporte a mascaramento usado para esconder mquinas em endereos de
+-rede no oficiais do resto do mundo, como descrito em
+-.BR ipfw (4), ipfwadm "(8) e ipfw (8).
++você pode incluir mais algumas informações sobre numeração sequencial e deltas
++, causados por reescritas de dados em sessões FTP (comando PORT).
++O suporte a mascaramento é usado para esconder máquinas em endereços de
++rede não oficiais do resto do mundo, como descrito em
++.BR iptables (8).
+
+ .SS "\-s, \-\-statistics"
+
+-Mostra estatsticas sobre o subsistema de rede do kernel do Linux, que
+-so lidas a partir de
++Mostra estatísticas sobre o subsistema de rede do kernel do Linux, que
++são lidas a partir de
+ .IR /proc/net/snmp .
+
+ .PP
+-.SH OPES
++.SH OPÇÕES
+ .SS "\-v, \-\-verbose"
+-Informa ao usurio o que est ocorrendo, sendo detalhado. Especialmente
+-mostra algumas informaes teis sobre famlias de endereos no
++Informa ao usuário o que está ocorrendo, sendo detalhado. Especialmente
++mostra algumas informações úteis sobre famílias de endereços não
+ configuradas.
+
+ .SS "\-n, \-\-numeric"
+-Mostra endereos numricos, sem tentar resolver os nomes da mquina, porta ou
+-usurio.
++Mostra endereços numéricos, sem tentar resolver os nomes da máquina, porta ou
++usuário.
+
+-.SS "\-A, \-\-af \fIfamlia\fI"
+-Usa um mtodo diferente para configurar as famlias de endereos.
+-.I famlia
+- uma lista de palavras-chave de famlias de endereos separadas por vrgulas
++.SS "\-A, \-\-af \fIfamília\fI"
++Usa um método diferente para configurar as famílias de endereços.
++.I família
++é uma lista de palavras-chave de famílias de endereços separadas por vírgulas
+ (',') como
+ .BR inet ,
+ .BR unix ,
+@@ -155,7 +157,7 @@ Usa um m
+ .B netrom
+ e
+ .BR ddp .
+-Tem o mesmo efeito de usar as opes longas
++Tem o mesmo efeito de usar as opções longas
+ .BR \-\-inet ,
+ .BR \-\-unix ,
+ .BR \-\-ipx ,
+@@ -165,99 +167,99 @@ e
+ .BR \-\-ddp.
+
+ .SS "\-c, \-\-continuous"
+-Isto far com que
++Isto fará com que
+ .B netstat
+-mostre a tabela selecionada a cada segundo, continuamente na tela at que
+-voc o interrompa.
++mostre a tabela selecionada a cada segundo, continuamente na tela até que
++você o interrompa.
+
+ .PP
+-.SH SADA
++.SH SAÍDA
+
+ .PP
+-.SS Conexes Internet Ativas \fR(TCP, UDP, RAW)\fR
++.SS Conexões Internet Ativas \fR(TCP, UDP, RAW)\fR
+
+ .SS "Proto"
+ O protocolo (tcp, udp, raw) usado pelo socket.
+
+ .SS "Recv-Q"
+-O contador de bytes no copiados pelo programa conectado a este socket.
++O contador de bytes não copiados pelo programa conectado a este socket.
+
+ .SS "Send-Q"
+-O contador de bytes no confirmados pela mquina remota.
++O contador de bytes não confirmados pela máquina remota.
+
+-.SS "Endereo Local"
+-O endereo local (nome da mquina local) e o numero da porta do socket. A menos
++.SS "Endereço Local"
++O endereço local (nome da máquina local) e o numero da porta do socket. A menos
+ que a chave
+ .B -n
+-seja especificada o endereo do socket ser resolvido para seu nome de mquina
+-cannico e o nmero da porta ser traduzido para o servio correspondente.
++seja especificada o endereço do socket será resolvido para seu nome de máquina
++canônico e o número da porta será traduzido para o serviço correspondente.
+
+-.SS "Endereo Remoto"
+-O endereo remoto (nome da mquina remota) e o nmero da porta do socket. Como
+-com o endereo local, a chave
++.SS "Endereço Remoto"
++O endereço remoto (nome da máquina remota) e o número da porta do socket. Como
++com o endereço local, a chave
+ .B -n
+-desliga a resoluo do nome da mquina e do servio.
++desliga a resolução do nome da máquina e do serviço.
+
+ .SS "Estado"
+-O estado do socket. Uma vez que no existem estados no modo RAW e normalmente
+-nenhum estado usado em UDP, esta linha pode ser deixada em branco. Normalmente
+-ele pode assumir um de vrios valores:
++O estado do socket. Uma vez que não existem estados no modo RAW e normalmente
++nenhum estado é usado em UDP, esta linha pode ser deixada em branco. Normalmente
++ele pode assumir um de vários valores:
+ .TP
+ .I
+ ESTABELECIDO
+-O socket tem uma conexo estabelecida.
++O socket tem uma conexão estabelecida.
+ .TP
+ .I
+ SYN_SENT
+-O socket est ativamente tentando estabelecer uma conexo.
++O socket está ativamente tentando estabelecer uma conexão.
+ .TP
+ .I
+ SYN_RECV
+-Uma requisio de conexo foi recebida da rede.
++Uma requisição de conexão foi recebida da rede.
+ .TP
+ .I
+ FIN_WAIT1
+-O socket est fechado e a conexo est terminando.
++O socket está fechado e a conexão está terminando.
+ .TP
+ .I
+ FIN_WAIT2
+-A conexo est fechada e o socket est esperando por uma terminao pela
+-mquina remota.
++A conexão está fechada e o socket está esperando por uma terminação pela
++máquina remota.
+ .TP
+ .I
+ TIME_WAIT
+-O socket est esperando aps o fechamento para tratar os pacotes ainda na rede.
++O socket está esperando após o fechamento para tratar os pacotes ainda na rede.
+ .TP
+ .I
+ FECHADO
+-O socket no est sendo usado.
++O socket não está sendo usado.
+ .TP
+ .I
+ CLOSE_WAIT
+ O lado remoto terminou, esperando pelo fechamento do socket.
+ .TP
+ .I
+-LTIMO_ACK
+-O lado remoto terminou, e o socket est fechado. Esperando por uma
+-confirmao.
++ÚLTIMO_ACK
++O lado remoto terminou, e o socket está fechado. Esperando por uma
++confirmação.
+ .TP
+ .I
+ OUVINDO
+-O socket est ouvindo por conexes. Estes socket so somente mostrados se
++O socket está ouvindo por conexões. Estes socket são somente mostrados se
+ a chave
+ .BR -a , --listening
+ for especificada.
+ .TP
+ .I
+ FECHANDO
+-Ambos os sockets esto terminados mas ns ainda no enviamos todos os nossos
++Ambos os sockets estão terminados mas nós ainda não enviamos todos os nossos
+ dados.
+ .TP
+ .I
+ DESCONHECIDO
+-O estado do socket desconhecido.
++O estado do socket é desconhecido.
+
+-.SS "Usurio"
++.SS "Usuário"
+ O nome ou UID do dono do socket.
+
+ .SS "Temporizador"
+@@ -272,198 +274,195 @@ O nome ou UID do dono do socket.
+ O protocolo (normalmente unix) usado pelo socket.
+
+ .SS "CntRef"
+-O contador de referncias (i.e. processos conectados via este socket).
++O contador de referências (i.e. processos conectados via este socket).
+
+ .SS "Flags"
+-As flags mostradas so SO_ACCEPTON (mostrada como
++As flags mostradas são SO_ACCEPTON (mostrada como
+ .BR ACC ),
+ SO_WAITDATA
+ .RB ( W )
+ ou SO_NOSPACE
+ .RB ( N ).
+ SO_ACCECPTON
+- usada para sockets no-conectados se seus processos correspondentes
+-estiverem esperando por uma solicitao de conexo. As demais flags no
+-so de interesse comum.
++é usada para sockets não-conectados se seus processos correspondentes
++estiverem esperando por uma solicitação de conexão. As demais flags não
++são de interesse comum.
+
+ .SS "Tipos"
+-H diversos tipos de acesso a sockets:
++Há diversos tipos de acesso a sockets:
+ .TP
+ .I
+ SOCK_DGRAM
+-O socket usado no modo de Datagramas (sem conexo).
++O socket é usado no modo de Datagramas (sem conexão).
+ .TP
+ .I
+ SOCK_STREAM
+- um socket usado quando h conexes (stream socket).
++É um socket usado quando há conexões (stream socket).
+ .TP
+ .I
+ SOCK_RAW
+- usado como o socket bsico (raw socket).
++É usado como o socket básico (raw socket).
+ .TP
+ .I
+ SOCK_RDM
+-Este usado para confirmao de entrega de mensagens.
++Este é usado para confirmação de entrega de mensagens.
+ .TP
+ .I
+ SOCK_SEQPACKET
+- um socket para um pacote sequencial.
++É um socket para um pacote sequencial.
+ .TP
+ .I
+ SOCK_PACKET
+-Socket para acesso da interface BSICA.
++Socket para acesso da interface BÁSICA.
+ .TP
+ .I
+ UNKNOWN
+-Quem sabe o que nos trar o futuro? Preencha aqui :-)
++Quem sabe o que nos trará o futuro? Preencha aqui :-)
+
+ .PP
+ .SS "Estados"
+-Este campo conter uma das seguintes palavras-chave:
++Este campo conterá uma das seguintes palavras-chave:
+ .TP
+ .I
+ FREE
+-Este socket no est alocado.
++Este socket não está alocado.
+ .TP
+ .I
+ LISTENING
+-O socket est aguardando por uma solicitao de conexo. So mostrados
+-apenas se as opes
++O socket está aguardando por uma solicitação de conexão. São mostrados
++apenas se as opções
+ .BR -a , --listening
+ forem selecionadas.
+ .TP
+ .I
+ CONNECTING
+-O socket est por estabelecer uma conexo.
++O socket está por estabelecer uma conexão.
+ .TP
+ .I
+ CONNECTED
+-O socket est conectado.
++O socket está conectado.
+ .TP
+ .I
+ DISCONNECTING
+-O socket est desconectado.
++O socket está desconectado.
+ .TP
+ .I
+ (nada)
+-O socket no est conectado a nenhum outro.
++O socket não está conectado a nenhum outro.
+ .TP
+ .I
+ UNKNOWN
+-Isto no deve acontecer nunca.
++Isto não deve acontecer nunca.
+
+ .SS "Path"
+-Mostra o caminho (path) do processo do qual est tratando esse socket.
++Mostra o caminho (path) do processo do qual está tratando esse socket.
+
+ .PP
+ .SS Sockets IPX ativos
+
+-(Isso precisa ser feito por algum que saiba faz-lo.)
++(Isso precisa ser feito por alguém que saiba fazê-lo.)
+
+ .PP
+ .SS Sockets NET/ROM ativos
+
+-(Isso precisa ser feito por algum que saiba faz-lo.)
++(Isso precisa ser feito por alguém que saiba fazê-lo.)
+
+ .PP
+ .SS Sockets AX.25 ativos
+
+-(Isso precisa ser feito por algum que saiba faz-lo.)
++(Isso precisa ser feito por alguém que saiba fazê-lo.)
+
+ .PP
+ .SH NOTAS
+-Desde o kernel 2.2 o netstat -i no mostra estatsticas para apelidos (aliases)
+-de interfaces. Para obter contadores por apelido de interface voc precisa
+-configurar regras explcitas usando o comando
+-+.BR ipchains(8)
++Desde o kernel 2.2 o netstat -i não mostra estatísticas para apelidos (aliases)
++de interfaces. Para obter contadores por apelido de interface você precisa
++configurar regras explícitas usando o comando
+++.BR iptables(8)
+ .
+ .SH FILES
+ .ta
+ .I /etc/services
+--- O arquivo de "traduo" (correspondncia) entre socket e servio.
++-- O arquivo de "tradução" (correspondência) entre socket e serviço.
+
+ .I /proc/net/dev
+--- Informaes de dispositivos.
++-- Informações de dispositivos.
+
+ .I /proc/net/snmp
+--- Estatsticas da rede.
++-- Estatísticas da rede.
+
+ .I /proc/net/raw
+--- Informao sobre o socket BSICO (RAW).
++-- Informação sobre o socket BÁSICO (RAW).
+
+ .I /proc/net/tcp
+--- Informao sobre o socket TCP.
++-- Informação sobre o socket TCP.
+
+ .I /proc/net/udp
+--- Informao sobre o socket UDP.
++-- Informação sobre o socket UDP.
+
+ .I /proc/net/unix
+--- Informao sobre o socket de domnio Unix.
++-- Informação sobre o socket de domínio Unix.
+
+ .I /proc/net/ipx
+--- Informao sobre o socket IPX.
++-- Informação sobre o socket IPX.
+
+ .I /proc/net/ax25
+--- Informao sobre o socket AX25.
++-- Informação sobre o socket AX25.
+
+ .I /proc/net/appletalk
+--- Informao sobre o socket DDP (Appletalk).
++-- Informação sobre o socket DDP (Appletalk).
+
+ .I /proc/net/nr
+--- Informao sobre o socket NET/ROM.
++-- Informação sobre o socket NET/ROM.
+
+ .I /proc/net/route
+--- Informao sobre os roteamentos IP realizados pelo kernel
++-- Informação sobre os roteamentos IP realizados pelo kernel
+
+ .I /proc/net/ax25_route
+--- Informao sobre os roteamentos AX25 realizados pelo kernel
++-- Informação sobre os roteamentos AX25 realizados pelo kernel
+
+ .I /proc/net/ipx_route
+--- Informao sobre os roteamentos IPX realizados pelo kernel
++-- Informação sobre os roteamentos IPX realizados pelo kernel
+
+ .I /proc/net/nr_nodes
+--- Lista de ns NET/ROM do kernel
++-- Lista de nós NET/ROM do kernel
+
+ .I /proc/net/nr_neigh
+ -- "Vizinhos" NET/ROM do kernel
+
+ .I /proc/net/ip_masquerade
+--- Conexes mascaradas do kernel
++-- Conexões mascaradas do kernel
+
+ .fi
+
+ .PP
+-.SH VEJA TAMBM
++.SH VEJA TAMBÉM
+ .BR route (8),
+ .BR ifconfig (8),
+-.BR ipfw (4),
+-.BR ipfw (8),
+-.BR ipfwadm (8)
+-.BR ipchains (8)
++.BR iptables (8)
+
+ .PP
+ .SH BUGS
+-Ocasionalmente informaes estranhas podem surgir se um socket mudar
+-enquanto visualizado. Isso incomum.
++Ocasionalmente informações estranhas podem surgir se um socket mudar
++enquanto é visualizado. Isso é incomum.
+ .br
+-As opes descritas para
++As opções descritas para
+ .B netstat -i
+-foram descritas como devero funcionar aps alguma limpeza da liberao
++foram descritas como deverão funcionar após alguma limpeza da liberação
+ BETA do pacote net-tools.
+
+ .PP
+ .SH AUTORES
+-A interface com o usurio foi escrita por Fred Baumgarten
+-<dc6iq@insu1.etec.uni-karlsruhe.de> a pgina do manual basicamente
++A interface com o usuário foi escrita por Fred Baumgarten
++<dc6iq@insu1.etec.uni-karlsruhe.de> a página do manual basicamente
+ por Matt Welsh <mdw@tc.cornell.edu>. Foi atualizada por
+ Alan Cox <Alan.Cox@linux.org> mas poderia ter sido feita com um pouco
+ mais de trabalho.
+ .BR
+ .LP
+-A pgina do manual e os comandos includos no pacote net-tools
++A página do manual e os comandos incluídos no pacote net-tools
+ foram totalmente reescritos desde Bernd Eckenfels
+ <ecki@linux.de>.
+ .BR
+-.SH TRADUO E REVISO PARA PORTUGUS
+-Traduzido para o portugus por Arnaldo Carvalho de Melo
++.SH TRADUÇÃO E REVISÃO PARA PORTUGUÊS
++Traduzido para o português por Arnaldo Carvalho de Melo
+ <acme@conectiva.com.br> e Jorge Luiz Godoy Filho <jorge@bestway.com.br>.
+diff --git a/man/pt_BR/rarp.8 b/man/pt_BR/rarp.8
+index de31931..b19f1b7 100644
+--- a/man/pt_BR/rarp.8
++++ b/man/pt_BR/rarp.8
+@@ -2,30 +2,30 @@
+ .SH NOME
+ rarp \- manipula a tabela RARP do sistema
+ .SH SINOPSE
+-.B "rarp [-v] [-t tipo] -a [mquina]"
++.B "rarp [-v] [-t tipo] -a [máquina]"
+ .br
+-.B "rarp [-v] -d mquina ..."
++.B "rarp [-v] -d máquina ..."
+ .br
+-.B "rarp [-v] [-t tipo] -s mquina endereo_hardware"
+-.SH DESCRIO
++.B "rarp [-v] [-t tipo] -s máquina endereço_hardware"
++.SH DESCRIÇÃO
+ .B Rarp
+-manipula as tabelas RARP do kernel de varias formas. As opes principais
+-so limpar uma entrada de mapeamento de endereos e manualmente configurar uma.
+-Para propsitos de depurao, o programa
++manipula as tabelas RARP do kernel de varias formas. As opções principais
++são limpar uma entrada de mapeamento de endereços e manualmente configurar uma.
++Para propósitos de depuração, o programa
+ .B rarp
+-tambm permite um dump completo da tabela RARP.
+-.SH OPES
++também permite um dump completo da tabela RARP.
++.SH OPÇÕES
+ .TP
+ .B \-v
+-Informe o usurio o que esta acontecendo, sendo detalhado.
++Informe o usuário o que esta acontecendo, sendo detalhado.
+ .TP
+ .B "\-t tipo"
+-quando configurando ou lendo a tabela RARP, este parmetro opcional informa ao
++quando configurando ou lendo a tabela RARP, este parâmetro opcional informa ao
+ .B rarp
+-que classe de entradas devem ser verificadas. O valor default para este parmetro
+-
++que classe de entradas devem ser verificadas. O valor default para este parâmetro
++é
+ .B ether
+-(i.e. cdigo de hardware
++(i.e. código de hardware
+ .B 0x01
+ para
+ .B "IEEE 802.3 10Mbps Ethernet".
+@@ -34,31 +34,31 @@ Outros valores podem incluir tecnologias de rede como
+ e
+ .B NET/ROM (netrom).
+ .TP
+-.B "\-a [mquina]"
+-Mostra as entradas dos mquinas especificadas. Se o
+-Mostra as entradas das mquinas especificadas. Se o parmetro
+-.B mquina
+-no for usado
++.B "\-a [máquina]"
++Mostra as entradas dos máquinas especificadas. Se o
++Mostra as entradas das máquinas especificadas. Se o parâmetro
++.B máquina
++não for usado
+ .B todas
+-as entradas sero mostradas.
++as entradas serão mostradas.
+ .TP
+-.B "\-d mquina"
+-Remove a(s) entrada(s) para a mquina especificada. Isto pode ser usado se a
+-mquina indicada for desligada, por exemplo.
++.B "\-d máquina"
++Remove a(s) entrada(s) para a máquina especificada. Isto pode ser usado se a
++máquina indicada for desligada, por exemplo.
+ .TP
+-.B "\-s mquina endereo_hardware"
+-Cria um mapeamento de endereos RARP para a mquina
+-.B mquina
+-com endereo de hardware configurado para
+-.B endereo_hardware
+-. O formato do endereo de hardware depende da classe do hardware, mas
+-para a maioria das classes voc pode assumir que a apresentao usual pode
+-ser usada. Para a classe Ethernet, so 6 bytes em hexadecimal, separados
++.B "\-s máquina endereço_hardware"
++Cria um mapeamento de endereços RARP para a máquina
++.B máquina
++com endereço de hardware configurado para
++.B endereço_hardware.
++O formato do endereço de hardware depende da classe do hardware, mas
++para a maioria das classes você pode assumir que a apresentação usual pode
++ser usada. Para a classe Ethernet, são 6 bytes em hexadecimal, separados
+ por dois pontos (:).
+-.SH ATENO
+-Alguns arquivos (principalmente Suns velhas) assumem que a mquina respondendo
+-ao query ARP tambm podem oferecer outros servios de boot remoto. Portanto
+-nunca adiciona gratuitamente entradas rarp a menos que deseje encontrar a fria
++.SH ATENÇÃO
++Alguns arquivos (principalmente Suns velhas) assumem que a máquina respondendo
++ao query ARP também podem oferecer outros serviços de boot remoto. Portanto
++nunca adiciona gratuitamente entradas rarp a menos que deseje encontrar a fúria
+ do administrador da rede.
+ .SH ARQUIVOS
+ .I /proc/net/rarp,
+@@ -66,5 +66,5 @@ do administrador da rede.
+ Ross D. Martin, <martin@trcsun3.eas.asu.edu>
+ .br
+ Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+-.SH TRADUO
++.SH TRADUÇÃO
+ Arnaldo Carvalho de Melo <acme@conectiva.com.br> - 13/04/1998
+diff --git a/man/pt_BR/route.8 b/man/pt_BR/route.8
+index c440974..eb152e2 100644
+--- a/man/pt_BR/route.8
++++ b/man/pt_BR/route.8
+@@ -50,44 +50,44 @@ If]
+ .RB [ \--help ]
+ .SH DESCRICAO
+ .B Route
+-manipula a tabela de roteamento IP do kernel. Seu principal uso
+-configurar rotas estticas para hosts ou redes especificadas atravs de
+-uma interface, aps a mesma ter sido configurada com o programa
++manipula a tabela de roteamento IP do kernel. Seu principal uso é
++configurar rotas estáticas para hosts ou redes especificadas através de
++uma interface, após a mesma ter sido configurada com o programa
+ .BR ifconfig (8)
+ .
+
+-.SH OPES
++.SH OPÇÕES
+ .TP
+ .B \-v
+-flag para detalhamento (no usada).
++flag para detalhamento (não usada).
+
+ .TP
+ .B \-n
+-mostra endereos numricos, sem tentar resolver o nomes simblicos das
+-mquinas. til se voc esta tentando determinar por que a rota para o seu
++mostra endereços numéricos, sem tentar resolver o nomes simbólicos das
++máquinas. Útil se você esta tentando determinar por que a rota para o seu
+ servidor de nomes sumiu.
+
+ .TP
+ .B \-e
+ use o formato
+ .BR netstat (8)
+-na apresentao da tabela de roteamento.
++na apresentação da tabela de roteamento.
+ .B \-ee
+-produzira uma linha bem grande com todos os parmetros da tabela de roteamento.
++produzira uma linha bem grande com todos os parâmetros da tabela de roteamento.
+
+ .TP
+ .B \-net
+ o
+ .B Alvo
+- o endereo de uma rede (encontrado no arquivo
++é o endereço de uma rede (encontrado no arquivo
+ .I /etc/networks
+-pela funo
++pela função
+ .BR getnetbyname (2)
+ ).
+
+ .TP
+ .B -host
+- o endereo de uma mquina (descoberto com a funo
++é o endereço de uma máquina (descoberto com a função
+ .BR gethostbyname (2)
+ ).
+
+@@ -110,150 +110,150 @@ adiciona uma rota.
+
+ .TP
+ .B Alvo
+-A mquina ou rede destino. Voc pode fornecer endereos IP em formato
+-decimal separado por pontos ou nomes de mquinas/redes.
++A máquina ou rede destino. Você pode fornecer endereços IP em formato
++decimal separado por pontos ou nomes de máquinas/redes.
+
+ .TP
+ .B netmask Nm
+ modificador para especificar a mascara de rede da rota a ser adicionada.
+-Somente faz sentido para uma rota para uma rede e quanto o endereo
++Somente faz sentido para uma rota para uma rede e quanto o endereço
+ .B Alvo
+- valido com relao a mascara especificada. Se nenhuma mascara de rede
++é valido com relação a mascara especificada. Se nenhuma mascara de rede
+ for especificada, o comando
+ .B route
+-descobre-a, desta forma, para a maioria das configuraes normais voc no
++descobre-a, desta forma, para a maioria das configurações normais você não
+ precisa especificar uma mascara de rede.
+
+ .TP
+ .B gw Gw
+-Quaisquer pacotes IP para a rede/mquina destino sero roteadas atravs
++Quaisquer pacotes IP para a rede/máquina destino serão roteadas através
+ do gateway/roteador especificado.
+ .B NOTA:
+-O gateway especificado deve ser alcanvel antes deste comando. Isto
+-normalmente significa que voc ter que configurar uma rota esttica para
+-o gateway antes de emitir este comando. Se voc especificar o endereo
+-de uma de suas interfaces locais, isto ser usado para decidir sobre
+-qual interface deve ser usada para rotear os pacotes. Isto esta disponvel
++O gateway especificado deve ser alcançável antes deste comando. Isto
++normalmente significa que você terá que configurar uma rota estática para
++o gateway antes de emitir este comando. Se você especificar o endereço
++de uma de suas interfaces locais, isto será usado para decidir sobre
++qual interface deve ser usada para rotear os pacotes. Isto esta disponível
+ para manter compatibilidade com os sistemas baseados em BSD.
+
+ .TP
+ .B metric M
+-Configura o campo de mtrica na tabela de roteamento, usado em daemons
+-para roteamento dinmico.
++Configura o campo de métrica na tabela de roteamento, usado em daemons
++para roteamento dinâmico.
+
+ .TP
+ .B mss M
+-Especifica o Tamanho Mximo do Segmento TCP em Bytes (MSS) para conexes
+-TCP atravs desta rota. Isto normalmente usado somente para otimizao
+-fina de configuraes de roteamento.
++Especifica o Tamanho Máximo do Segmento TCP em Bytes (MSS) para conexões
++TCP através desta rota. Isto é normalmente usado somente para otimização
++fina de configurações de roteamento.
+
+ .TP
+ .B window W
+-Especifica o tamanho da janela TCP para conexes TCP atravs desta rota.
++Especifica o tamanho da janela TCP para conexões TCP através desta rota.
+ Tipicamente somente usado para redes AX.25 e em drivers incapazes de
+ de tratar frames back to back.
+
+ .TP
+ .B irtt I
+-Especifica o tempo de ida e volta inicial (irtt) para conexes TCP atravs
+-desta rota. Tipicamente usado somente em redes AX.25. O numero especificado
+-em milisegundos (1-12000). Se omitido o default da RFC 1122 de 300ms usado.
++Especifica o tempo de ida e volta inicial (irtt) para conexões TCP através
++desta rota. Tipicamente usado somente em redes AX.25. O numero é especificado
++em milisegundos (1-12000). Se omitido o default da RFC 1122 de 300ms é usado.
+
+ .TP
+ .B reject
+-Instala uma rota de bloqueio, que forar falha na procura por esta rota.
+-Exemplo de utilizao: bloquear rotas antes do uso da rota default.
+-Isto no firewalling.
++Instala uma rota de bloqueio, que forçará falha na procura por esta rota.
++Exemplo de utilização: bloquear rotas antes do uso da rota default.
++Isto não é firewalling.
+
+ .TP
+ .B mod, dyn, reinstate
+-Instala uma rota modificada ou dinmica. Ambas as flags so geralmente somente
+-configuradas por um daemon de roteamento. Somente para propsitos de diagnostico.
++Instala uma rota modificada ou dinâmica. Ambas as flags são geralmente somente
++configuradas por um daemon de roteamento. Somente para propósitos de diagnostico.
+
+ .TP
+ .B dev If
+-Fora a associao da rota com o dispositivo especificado, pois o kernel
+-de outra forma tentara determinar o dispositivo por conta prpria
+-(atravs da checagem de rotas e especificaes de dispositivos j existentes
++Força a associação da rota com o dispositivo especificado, pois o kernel
++de outra forma tentara determinar o dispositivo por conta própria
++(através da checagem de rotas e especificações de dispositivos já existentes
+ e onde a rota esta adicionada).
+
+ If
+ .B dev If
+- a ltima opo na linha de comando, a palavra
++é a última opção na linha de comando, a palavra
+ .B dev
+-pode ser omitida, pois o default. De outra forma a ordem dos outros
+-modificadores do route (metric - netmask - gw - dev) no importa.
++pode ser omitida, pois é o default. De outra forma a ordem dos outros
++modificadores do route (metric - netmask - gw - dev) não importa.
+
+ .SH EXEMPLOS
+ .TP
+ .B route add -net 127.0.0.0
+ Adiciona a entrada para a interface loopback normal, usando mascara igual
+-a 255.0.0.0 (rede classe A, determinada a partir do endereo de destino),
++a 255.0.0.0 (rede classe A, determinada a partir do endereço de destino),
+ associada ao dispositivo "lo" (assumindo que este dispositivo tenha sido
+ previamente configurado com o
+ .BR ifconfig (8)).
+
+ .TP
+ .B route add -net 192.56.76.0 netmask 255.255.255.0 dev eth0
+-Adiciona uma rota para a rede 192.56.76.x atravs da interface "eth0". O
+-modificador de mascara classe C no realmente necessrio aqui por que
+-192.* um endereo IP de classe C. A palavra "dev" pode ser omitida aqui.
++Adiciona uma rota para a rede 192.56.76.x através da interface "eth0". O
++modificador de mascara classe C não é realmente necessário aqui por que
++192.* é um endereço IP de classe C. A palavra "dev" pode ser omitida aqui.
+
+ .TP
+ .B route add default gw mango-gw
+-Adiciona uma rota default (que ser usada se nenhuma outra rota for encontrada).
+-Todos os pacotes que usarem esta rota sero passados para a mquina "mango-gw".
+-O dispositivo que ser utilizado para esta rota depende de como possvel
+-alcanar "mango-gw" - a rota esttica para "mango-gw" ter que ser configurada
++Adiciona uma rota default (que será usada se nenhuma outra rota for encontrada).
++Todos os pacotes que usarem esta rota serão passados para a máquina "mango-gw".
++O dispositivo que será utilizado para esta rota depende de como é possível
++alcançar "mango-gw" - a rota estática para "mango-gw" terá que ser configurada
+ previamente.
+
+ .TP
+ .B route add ipx4 sl0
+-Adiciona uma rota para a mquina "ipx4" atravs da interface SLIP (assumindo
+-que "ipx4" a mquina SLIP).
++Adiciona uma rota para a máquina "ipx4" através da interface SLIP (assumindo
++que "ipx4" é a máquina SLIP).
+
+ .TP
+ .B route add -net 192.57.66.0 netmask 255.255.255.0 gw ipx4
+-Este comando adiciona a rede "192.57.66.x" para ser alcanada atravs da
+-rota anterior atravs da interface SLIP.
++Este comando adiciona a rede "192.57.66.x" para ser alcançada através da
++rota anterior através da interface SLIP.
+
+ .TP
+ .B route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0
+-Isto bem obscura, documentada para que as pessoas saibam como us-la.
+-Configura para que todas as rotas IP classe D (multicast) vo atravs da
+-interface "eth0". Esta a linha de configurao normal a ser usada com
++Isto é bem obscura, documentada para que as pessoas saibam como usá-la.
++Configura para que todas as rotas IP classe D (multicast) vão através da
++interface "eth0". Esta é a linha de configuração normal a ser usada com
+ um kernel multicast.
+
+ .TP
+ .B route add 10.0.0.0 netmask 255.0.0.0 reject
+-Esta instala uma rota de rejeio para a rede privada "10.x.x.x"
++Esta instala uma rota de rejeição para a rede privada "10.x.x.x"
+
+ .LP
+-.SH SADA
+-A sada da tabela de roteamento do kernel organizada nas seguintes colunas
++.SH SAÍDA
++A saída da tabela de roteamento do kernel é organizada nas seguintes colunas
+ .TP
+ .B Destino
+-A rede ou mquina de destino.
++A rede ou máquina de destino.
+ .TP
+ .B Roteador
+-A mquina roteador ou '*' se nenhuma estiver configurada.
++A máquina roteador ou '*' se nenhuma estiver configurada.
+ .TP
+-.B Mascara Genrica
+-A mascara para a rede destino. '255.255.255.255' para uma mquina de destino,
+-'0.0.0.0' para a rota
++.B Mascara Genérica
++A mascara para a rede destino. '255.255.255.255' para uma máquina de
++destino, '0.0.0.0' para a rota
+ .B default
+ .
+ .TP
+ .B Flags
+-Os flags possveis so
++Os flags possíveis são
+ .br
+ .B U
+ (rota esta
+ .BR Up )
+ .br
+ .B H
+-(alvo uma
+-.BR mquina )
++(alvo é uma
++.BR máquina )
+ .br
+ .B G
+ (use
+@@ -261,7 +261,7 @@ Os flags poss
+ .br
+ .B R
+ .RB ( reinstate
+-rota para roteamento dinmico)
++rota para roteamento dinâmico)
+ .br
+ .B D
+ Instalada
+@@ -278,29 +278,29 @@ Rota
+ )
+ .TP
+ .B Metric
+-A 'distncia' at o alvo (geralmente contada em hops). No utilizada pelos
++A 'distância' até o alvo (geralmente contada em hops). Não é utilizada pelos
+ kernels recentes, somente daemons de roteamento podem usa-la.
+ .TP
+ .B Ref
+-Numero de referncias a esta rota. No usado no kernel do Linux, sempre 0.
++Numero de referências a esta rota. Não usado no kernel do Linux, sempre 0.
+ .TP
+ .B Uso
+-Contagem de procuras por esta rota. Nos kernels recentes estes nmeros so
+-bem baixos, pois os sockets tem seu prprio cache e no precisam procurar
++Contagem de procuras por esta rota. Nos kernels recentes estes números são
++bem baixos, pois os sockets tem seu próprio cache e não precisam procurar
+ por rotas.
+ .TP
+ .B Iface
+-Interface atravs da qual os pacotes IP sero enviados.
++Interface através da qual os pacotes IP serão enviados.
+ .TP
+ .B MSS
+-Tamanho mximo de segmento default para conexes TCP atravs desta rota.
++Tamanho máximo de segmento default para conexões TCP através desta rota.
+ .TP
+ .B Window
+-Tamanho de janela default para conexes TCP atravs desta rota.
++Tamanho de janela default para conexões TCP através desta rota.
+ .TP
+ .B irtt
+ RTT (Tempo de Ida e Volta) Inicial. O kernel usa isto para inferir os melhores
+-parmetros do protocolo TCP sem esperar por respostas (possivelmente lentas).
++parâmetros do protocolo TCP sem esperar por respostas (possivelmente lentas).
+ .LP
+ .SH ARQUIVOS
+ .I /proc/net/route
+@@ -311,17 +311,17 @@ par
+ .br
+ .I /etc/init.d/network
+ .LP
+-.SH VEJA TAMBM
++.SH VEJA TAMBÉM
+ .I ifconfig(8), netstat(8), arp(8)
+ .LP
+-.SH HISTRICO
++.SH HISTÓRICO
+ .B Route
+ para o linux foi originalmente escrito por Fred N. van Kempen,
+ <waltje@uwalt.nl.mugnet.org> e depois modificado por Johannes Stille e
+-Linus Torvalds para a verso pl15. Alan Cox adicionou as opes para
++Linus Torvalds para a versão pl15. Alan Cox adicionou as opções para
+ mss e window no kernel 1.1.22. O suporte a irtt (compartilhado com o
+ netstat) foi feito por Bernd Eckenfels.
+-.SH TRADUO
++.SH TRADUÇÃO
+ Arnaldo Carvalho de Melo <acme@conectiva.com.br> - 13/04/1998
+ .SH BUGS
+ nenhum :)
+diff --git a/mii-tool.c b/mii-tool.c
+index ef2d48a..1cfecc2 100644
+--- a/mii-tool.c
++++ b/mii-tool.c
+@@ -29,8 +29,6 @@
+ http://www.national.com/pf/DP/DP83840.html
+ */
+
+-static char version[] =
+-"mii-tool.c 1.9 2000/04/28 00:56:08 (David Hinds)\n";
+
+ #include <unistd.h>
+ #include <stdlib.h>
+@@ -46,16 +44,25 @@ static char version[] =
+ #include <sys/socket.h>
+ #include <sys/ioctl.h>
+ #include <net/if.h>
++#include <linux/sockios.h>
++
+ #ifndef __GLIBC__
+ #include <linux/if_arp.h>
+ #include <linux/if_ether.h>
+ #endif
+-#include "mii.h"
++#include <linux/mii.h>
++#include <linux/sockios.h>
++#include "version.h"
++#include "net-support.h"
++#include "util.h"
++
++static char *Release = RELEASE, *Signature = "David Hinds based on Donald Becker's mii-diag";
+
+ #define MAX_ETH 8 /* Maximum # of interfaces */
++#define LPA_ABILITY_MASK 0x07e0
+
+ /* Table of known MII's */
+-static struct {
++static const struct {
+ u_short id1, id2;
+ char *name;
+ } mii_id[] = {
+@@ -64,16 +71,25 @@ static struct {
+ { 0x0000, 0x6b90, "AMD 79C901A HomePNA" },
+ { 0x0000, 0x6b70, "AMD 79C901A 10baseT" },
+ { 0x0181, 0xb800, "Davicom DM9101" },
+- { 0x0043, 0x7411, "Enable EL40-331" },
++ { 0x0043, 0x7410, "Enable EL40-331" },
++ { 0x0243, 0x0c50, "ICPlus IP101A" },
+ { 0x0015, 0xf410, "ICS 1889" },
+ { 0x0015, 0xf420, "ICS 1890" },
+ { 0x0015, 0xf430, "ICS 1892" },
+ { 0x02a8, 0x0150, "Intel 82555" },
+ { 0x7810, 0x0000, "Level One LXT970/971" },
++ { 0x0022, 0x1510, "Micrel KSZ8041" },
++ { 0x0022, 0x1610, "Micrel KSZ9021" },
+ { 0x2000, 0x5c00, "National DP83840A" },
++ { 0x2000, 0x5c70, "National DP83865" },
+ { 0x0181, 0x4410, "Quality QS6612" },
+ { 0x0282, 0x1c50, "SMSC 83C180" },
++ { 0x0203, 0x8460, "STMicroelectronics ST802RT" },
++ { 0x1c04, 0x0010, "STMicroelectronics STE100P" },
+ { 0x0300, 0xe540, "TDK 78Q2120" },
++ { 0x0141, 0x0c20, "Yukon 88E1011" },
++ { 0x0141, 0x0cc0, "Yukon-EC 88E1111" },
++ { 0x0141, 0x0c90, "Yukon-2 88E1112" },
+ };
+ #define NMII (sizeof(mii_id)/sizeof(mii_id[0]))
+
+@@ -81,10 +97,10 @@ static struct {
+
+ struct option longopts[] = {
+ /* { name has_arg *flag val } */
+- {"advertise", 1, 0, 'A'}, /* Change capabilities advertised. */
+- {"force", 1, 0, 'F'}, /* Change capabilities advertised. */
++ {"advertise", 1, 0, 'A'}, /* Advertise only specified media. */
++ {"force", 1, 0, 'F'}, /* Force specified media technology. */
+ {"phy", 1, 0, 'p'}, /* Set PHY (MII address) to report. */
+- {"log", 0, 0, 'l'}, /* Set PHY (MII address) to report. */
++ {"log", 0, 0, 'l'}, /* With --watch, write events to syslog. */
+ {"restart", 0, 0, 'r'}, /* Restart link negotiation */
+ {"reset", 0, 0, 'R'}, /* Reset the transceiver. */
+ {"verbose", 0, 0, 'v'}, /* Report each action taken. */
+@@ -112,7 +128,7 @@ static struct ifreq ifr;
+
+ static int mdio_read(int skfd, int location)
+ {
+- struct mii_data *mii = (struct mii_data *)&ifr.ifr_data;
++ struct mii_ioctl_data *mii = (struct mii_ioctl_data *)&ifr.ifr_data;
+ mii->reg_num = location;
+ if (ioctl(skfd, SIOCGMIIREG, &ifr) < 0) {
+ fprintf(stderr, "SIOCGMIIREG on %s failed: %s\n", ifr.ifr_name,
+@@ -124,7 +140,7 @@ static int mdio_read(int skfd, int location)
+
+ static void mdio_write(int skfd, int location, int value)
+ {
+- struct mii_data *mii = (struct mii_data *)&ifr.ifr_data;
++ struct mii_ioctl_data *mii = (struct mii_ioctl_data *)&ifr.ifr_data;
+ mii->reg_num = location;
+ mii->val_in = value;
+ if (ioctl(skfd, SIOCSMIIREG, &ifr) < 0) {
+@@ -137,40 +153,48 @@ static void mdio_write(int skfd, int location, int value)
+
+ const struct {
+ char *name;
+- u_short value;
++ u_short value[2];
+ } media[] = {
+ /* The order through 100baseT4 matches bits in the BMSR */
+- { "10baseT-HD", MII_AN_10BASET_HD },
+- { "10baseT-FD", MII_AN_10BASET_FD },
+- { "100baseTx-HD", MII_AN_100BASETX_HD },
+- { "100baseTx-FD", MII_AN_100BASETX_FD },
+- { "100baseT4", MII_AN_100BASET4 },
+- { "100baseTx", MII_AN_100BASETX_FD | MII_AN_100BASETX_HD },
+- { "10baseT", MII_AN_10BASET_FD | MII_AN_10BASET_HD },
++ { "10baseT-HD", {LPA_10HALF} },
++ { "10baseT-FD", {LPA_10FULL} },
++ { "100baseTx-HD", {LPA_100HALF} },
++ { "100baseTx-FD", {LPA_100FULL} },
++ { "100baseT4", {LPA_100BASE4} },
++ { "100baseTx", {LPA_100FULL | LPA_100HALF} },
++ { "10baseT", {LPA_10FULL | LPA_10HALF} },
++
++ { "1000baseT-HD", {0, ADVERTISE_1000HALF} },
++ { "1000baseT-FD", {0, ADVERTISE_1000FULL} },
++ { "1000baseT", {0, ADVERTISE_1000HALF|ADVERTISE_1000FULL} },
+ };
+ #define NMEDIA (sizeof(media)/sizeof(media[0]))
+-
++
+ /* Parse an argument list of media types */
+-static int parse_media(char *arg)
++static int parse_media(char *arg, unsigned *bmcr2)
+ {
+ int mask, i;
+ char *s;
+ mask = strtoul(arg, &s, 16);
+ if ((*arg != '\0') && (*s == '\0')) {
+- if ((mask & MII_AN_ABILITY_MASK) &&
+- !(mask & ~MII_AN_ABILITY_MASK))
+- return mask;
++ if ((mask & LPA_ABILITY_MASK) &&
++ !(mask & ~LPA_ABILITY_MASK)) {
++ *bmcr2 = 0;
++ return mask;
++ }
+ goto failed;
+- } else {
+- mask = 0;
+- s = strtok(arg, ", ");
+- do {
++ }
++ mask = 0;
++ *bmcr2 = 0;
++ s = strtok(arg, ", ");
++ do {
+ for (i = 0; i < NMEDIA; i++)
+- if (strcasecmp(media[i].name, s) == 0) break;
++ if (s && strcasecmp(media[i].name, s) == 0) break;
+ if (i == NMEDIA) goto failed;
+- mask |= media[i].value;
+- } while ((s = strtok(NULL, ", ")) != NULL);
+- }
++ mask |= media[i].value[0];
++ *bmcr2 |= media[i].value[1];
++ } while ((s = strtok(NULL, ", ")) != NULL);
++
+ return mask;
+ failed:
+ fprintf(stderr, "Invalid media specification '%s'.\n", arg);
+@@ -179,11 +203,25 @@ failed:
+
+ /*--------------------------------------------------------------------*/
+
+-static char *media_list(int mask, int best)
++static const char *media_list(unsigned mask, unsigned mask2, int best)
+ {
+ static char buf[100];
+ int i;
+ *buf = '\0';
++
++ if (mask & BMCR_SPEED1000) {
++ if (mask2 & ADVERTISE_1000HALF) {
++ strcat(buf, " ");
++ strcat(buf, "1000baseT-HD");
++ if (best) goto out;
++ }
++ if (mask2 & ADVERTISE_1000FULL) {
++ strcat(buf, " ");
++ strcat(buf, "1000baseT-FD");
++ if (best) goto out;
++ }
++ }
++
+ mask >>= 5;
+ for (i = 4; i >= 0; i--) {
+ if (mask & (1<<i)) {
+@@ -192,6 +230,7 @@ static char *media_list(int mask, int best)
+ if (best) break;
+ }
+ }
++ out:
+ if (mask & (1<<5))
+ strcat(buf, " flow-control");
+ return buf;
+@@ -199,49 +238,82 @@ static char *media_list(int mask, int best)
+
+ int show_basic_mii(int sock, int phy_id)
+ {
+- char buf[100];
++ char buf[200];
+ int i, mii_val[32];
+- int bmcr, bmsr, advert, lkpar;
++ unsigned bmcr, bmsr, advert, lkpar, bmcr2, lpa2;
+
+ /* Some bits in the BMSR are latched, but we can't rely on being
+ the only reader, so only the current values are meaningful */
+ mdio_read(sock, MII_BMSR);
+- for (i = 0; i < ((verbose > 1) ? 32 : 8); i++)
+- mii_val[i] = mdio_read(sock, i);
++ for (i = 0; i < ((verbose > 1) ? 32 : (MII_STAT1000+1)); i++)
++ switch (i & 0x1F) {
++ case MII_BMCR:
++ case MII_BMSR:
++ case MII_PHYSID1:
++ case MII_PHYSID2:
++ case MII_ADVERTISE:
++ case MII_LPA:
++ case MII_EXPANSION:
++ case MII_CTRL1000:
++ case MII_STAT1000:
++ case MII_ESTATUS:
++ case MII_DCOUNTER:
++ case MII_FCSCOUNTER:
++ case MII_NWAYTEST:
++ case MII_RERRCOUNTER:
++ case MII_SREVISION:
++ case MII_RESV1:
++ case MII_LBRERROR:
++ case MII_PHYADDR:
++ case MII_RESV2:
++ case MII_TPISTATUS:
++ case MII_NCONFIG:
++ mii_val[i] = mdio_read(sock, i);
++ break;
++ default:
++ if (verbose > 2)
++ mii_val[i] = mdio_read(sock, i);
++ else
++ mii_val[i] = 0;
++ break;
++ }
+
+- if (mii_val[MII_BMCR] == 0xffff) {
++ if (mii_val[MII_BMCR] == 0xffff || mii_val[MII_BMSR] == 0x0000) {
+ fprintf(stderr, " No MII transceiver present!.\n");
+ return -1;
+ }
+
+ /* Descriptive rename. */
+ bmcr = mii_val[MII_BMCR]; bmsr = mii_val[MII_BMSR];
+- advert = mii_val[MII_ANAR]; lkpar = mii_val[MII_ANLPAR];
++ advert = mii_val[MII_ADVERTISE]; lkpar = mii_val[MII_LPA];
++ bmcr2 = mii_val[MII_CTRL1000]; lpa2 = mii_val[MII_STAT1000];
+
+ sprintf(buf, "%s: ", ifr.ifr_name);
+- if (bmcr & MII_BMCR_AN_ENA) {
+- if (bmsr & MII_BMSR_AN_COMPLETE) {
++ if (bmcr & BMCR_ANENABLE) {
++ if (bmsr & BMSR_ANEGCOMPLETE) {
+ if (advert & lkpar) {
+- strcat(buf, (lkpar & MII_AN_ACK) ?
++ strcat(buf, (lkpar & LPA_LPACK) ?
+ "negotiated" : "no autonegotiation,");
+- strcat(buf, media_list(advert & lkpar, 1));
++ strcat(buf, media_list(advert & lkpar, bmcr2 & lpa2>>2, 1));
+ strcat(buf, ", ");
+ } else {
+ strcat(buf, "autonegotiation failed, ");
+ }
+- } else if (bmcr & MII_BMCR_RESTART) {
++ } else if (bmcr & BMCR_ANRESTART) {
+ strcat(buf, "autonegotiation restarted, ");
+ }
+ } else {
+ sprintf(buf+strlen(buf), "%s Mbit, %s duplex, ",
+- (bmcr & MII_BMCR_100MBIT) ? "100" : "10",
+- (bmcr & MII_BMCR_DUPLEX) ? "full" : "half");
++ ((bmcr2 & (ADVERTISE_1000HALF | ADVERTISE_1000FULL)) & lpa2 >> 2)
++ ? "1000"
++ : (bmcr & BMCR_SPEED100) ? "100" : "10",
++ (bmcr & BMCR_FULLDPLX) ? "full" : "half");
+ }
+- strcat(buf, (bmsr & MII_BMSR_LINK_VALID) ? "link ok" : "no link");
++ strcat(buf, (bmsr & BMSR_LSTATUS) ? "link ok" : "no link");
+
+ if (opt_watch) {
+ if (opt_log) {
+- syslog(LOG_INFO, buf);
++ syslog(LOG_INFO, "%s", buf);
+ } else {
+ char s[20];
+ time_t t = time(NULL);
+@@ -273,35 +345,36 @@ int show_basic_mii(int sock, int phy_id)
+ ((mii_val[2]<<6)|(mii_val[3]>>10))&0xff,
+ (mii_val[3]>>4)&0x3f, mii_val[3]&0x0f);
+ printf(" basic mode: ");
+- if (bmcr & MII_BMCR_RESET)
++ if (bmcr & BMCR_RESET)
+ printf("software reset, ");
+- if (bmcr & MII_BMCR_LOOPBACK)
++ if (bmcr & BMCR_LOOPBACK)
+ printf("loopback, ");
+- if (bmcr & MII_BMCR_ISOLATE)
++ if (bmcr & BMCR_ISOLATE)
+ printf("isolate, ");
+- if (bmcr & MII_BMCR_COLTEST)
++ if (bmcr & BMCR_CTST)
+ printf("collision test, ");
+- if (bmcr & MII_BMCR_AN_ENA) {
++ if (bmcr & BMCR_ANENABLE) {
+ printf("autonegotiation enabled\n");
+ } else {
+ printf("%s Mbit, %s duplex\n",
+- (bmcr & MII_BMCR_100MBIT) ? "100" : "10",
+- (bmcr & MII_BMCR_DUPLEX) ? "full" : "half");
++ (bmcr & BMCR_SPEED100) ? "100" : "10",
++ (bmcr & BMCR_FULLDPLX) ? "full" : "half");
+ }
+ printf(" basic status: ");
+- if (bmsr & MII_BMSR_AN_COMPLETE)
++ if (bmsr & BMSR_ANEGCOMPLETE)
+ printf("autonegotiation complete, ");
+- else if (bmcr & MII_BMCR_RESTART)
++ else if (bmcr & BMCR_ANRESTART)
+ printf("autonegotiation restarted, ");
+- if (bmsr & MII_BMSR_REMOTE_FAULT)
++ if (bmsr & BMSR_RFAULT)
+ printf("remote fault, ");
+- printf((bmsr & MII_BMSR_LINK_VALID) ? "link ok" : "no link");
+- printf("\n capabilities:%s", media_list(bmsr >> 6, 0));
+- printf("\n advertising: %s", media_list(advert, 0));
+- if (lkpar & MII_AN_ABILITY_MASK)
+- printf("\n link partner:%s", media_list(lkpar, 0));
++ printf((bmsr & BMSR_LSTATUS) ? "link ok" : "no link");
++ printf("\n capabilities:%s", media_list(bmsr >> 6, bmcr2, 0));
++ printf("\n advertising: %s", media_list(advert, bmcr2, 0));
++ if (lkpar & LPA_ABILITY_MASK)
++ printf("\n link partner:%s", media_list(lkpar, lpa2 >> 2, 0));
+ printf("\n");
+ }
++ fflush(stdout);
+ return 0;
+ }
+
+@@ -309,10 +382,10 @@ int show_basic_mii(int sock, int phy_id)
+
+ static int do_one_xcvr(int skfd, char *ifname, int maybe)
+ {
+- struct mii_data *mii = (struct mii_data *)&ifr.ifr_data;
++ struct mii_ioctl_data *mii = (struct mii_ioctl_data *)&ifr.ifr_data;
+
+ /* Get the vitals from the interface. */
+- strncpy(ifr.ifr_name, ifname, IFNAMSIZ);
++ safe_strncpy(ifr.ifr_name, ifname, IFNAMSIZ);
+ if (ioctl(skfd, SIOCGMIIPHY, &ifr) < 0) {
+ if (!maybe || (errno != ENODEV))
+ fprintf(stderr, "SIOCGMIIPHY on '%s' failed: %s\n",
+@@ -327,23 +400,23 @@ static int do_one_xcvr(int skfd, char *ifname, int maybe)
+
+ if (opt_reset) {
+ printf("resetting the transceiver...\n");
+- mdio_write(skfd, MII_BMCR, MII_BMCR_RESET);
++ mdio_write(skfd, MII_BMCR, BMCR_RESET);
+ }
+- if (nway_advertise) {
+- mdio_write(skfd, MII_ANAR, nway_advertise | 1);
++ if (nway_advertise > 0) {
++ mdio_write(skfd, MII_ADVERTISE, nway_advertise | 1);
+ opt_restart = 1;
+ }
+ if (opt_restart) {
+ printf("restarting autonegotiation...\n");
+ mdio_write(skfd, MII_BMCR, 0x0000);
+- mdio_write(skfd, MII_BMCR, MII_BMCR_AN_ENA|MII_BMCR_RESTART);
++ mdio_write(skfd, MII_BMCR, BMCR_ANENABLE|BMCR_ANRESTART);
+ }
+ if (fixed_speed) {
+ int bmcr = 0;
+- if (fixed_speed & (MII_AN_100BASETX_FD|MII_AN_100BASETX_HD))
+- bmcr |= MII_BMCR_100MBIT;
+- if (fixed_speed & (MII_AN_100BASETX_FD|MII_AN_10BASET_FD))
+- bmcr |= MII_BMCR_DUPLEX;
++ if (fixed_speed & (LPA_100FULL|LPA_100HALF))
++ bmcr |= BMCR_SPEED100;
++ if (fixed_speed & (LPA_100FULL|LPA_10FULL))
++ bmcr |= BMCR_FULLDPLX;
+ mdio_write(skfd, MII_BMCR, bmcr);
+ }
+
+@@ -357,12 +430,12 @@ static int do_one_xcvr(int skfd, char *ifname, int maybe)
+
+ static void watch_one_xcvr(int skfd, char *ifname, int index)
+ {
+- struct mii_data *mii = (struct mii_data *)&ifr.ifr_data;
++ struct mii_ioctl_data *mii = (struct mii_ioctl_data *)&ifr.ifr_data;
+ static int status[MAX_ETH] = { 0, /* ... */ };
+ int now;
+
+ /* Get the vitals from the interface. */
+- strncpy(ifr.ifr_name, ifname, IFNAMSIZ);
++ safe_strncpy(ifr.ifr_name, ifname, IFNAMSIZ);
+ if (ioctl(skfd, SIOCGMIIPHY, &ifr) < 0) {
+ if (errno != ENODEV)
+ fprintf(stderr, "SIOCGMIIPHY on '%s' failed: %s\n",
+@@ -379,27 +452,38 @@ static void watch_one_xcvr(int skfd, char *ifname, int index)
+ /*--------------------------------------------------------------------*/
+
+ const char *usage =
+-"usage: %s [-VvRrwl] [-A media,... | -F media] [interface ...]
+- -V, --version display version information
+- -v, --verbose more verbose output
+- -R, --reset reset MII to poweron state
+- -r, --restart restart autonegotiation
+- -w, --watch monitor for link status changes
+- -l, --log with -w, write events to syslog
+- -A, --advertise=media,... advertise only specified media
+- -F, --force=media force specified media technology
+-media: 100baseT4, 100baseTx-FD, 100baseTx-HD, 10baseT-FD, 10baseT-HD,
+- (to advertise both HD and FD) 100baseTx, 10baseT\n";
++"usage: %s [-VvRrwl] [-A media,... | -F media] [-p addr] <interface ...>\n"
++" -V, --version display version information\n"
++" -v, --verbose more verbose output\n"
++" -R, --reset reset MII to poweron state\n"
++" -r, --restart restart autonegotiation\n"
++" -w, --watch monitor for link status changes\n"
++" -l, --log with -w, write events to syslog\n"
++" -A, --advertise=media,... advertise only specified media\n"
++" -F, --force=media force specified media technology\n"
++" -p, --phy=addr set PHY (MII address) to report\n"
++"media: 1000baseTx-HD, 1000baseTx-FD,\n"
++" 100baseT4, 100baseTx-FD, 100baseTx-HD,\n"
++" 10baseT-FD, 10baseT-HD,\n"
++" (to advertise both HD and FD) 1000baseTx, 100baseTx, 10baseT\n";
++
++
++static void version(void)
++{
++ fprintf(stderr, "%s\n%s\n", Release, Signature);
++ exit(E_VERSION);
++}
++
+
+ int main(int argc, char **argv)
+ {
+ int i, c, ret, errflag = 0;
+- char s[6];
+-
++ unsigned ctrl1000 = 0;
++
+ while ((c = getopt_long(argc, argv, "A:F:p:lrRvVw?", longopts, 0)) != EOF)
+ switch (c) {
+- case 'A': nway_advertise = parse_media(optarg); break;
+- case 'F': fixed_speed = parse_media(optarg); break;
++ case 'A': nway_advertise = parse_media(optarg, &ctrl1000); break;
++ case 'F': fixed_speed = parse_media(optarg, &ctrl1000); break;
+ case 'p': override_phy = atoi(optarg); break;
+ case 'r': opt_restart++; break;
+ case 'R': opt_reset++; break;
+@@ -411,6 +495,10 @@ int main(int argc, char **argv)
+ }
+ /* Check for a few inappropriate option combinations */
+ if (opt_watch) verbose = 0;
++
++ if ((nway_advertise < 0) || (fixed_speed < 0))
++ return 2;
++
+ if (errflag || (fixed_speed & (fixed_speed-1)) ||
+ (fixed_speed && (opt_restart || nway_advertise))) {
+ fprintf(stderr, usage, argv[0]);
+@@ -418,7 +506,7 @@ int main(int argc, char **argv)
+ }
+
+ if (opt_version)
+- printf(version);
++ version();
+
+ /* Open a basic socket. */
+ if ((skfd = socket(AF_INET, SOCK_DGRAM,0)) < 0) {
+@@ -426,15 +514,15 @@ int main(int argc, char **argv)
+ exit(-1);
+ }
+
++ if (verbose > 1)
++ printf("Using SIOCGMIIPHY=0x%x\n", SIOCGMIIPHY);
++
+ /* No remaining args means show all interfaces. */
+ if (optind == argc) {
+- ret = 1;
+- for (i = 0; i < MAX_ETH; i++) {
+- sprintf(s, "eth%d", i);
+- ret &= do_one_xcvr(skfd, s, 1);
+- }
+- if (ret)
+- fprintf(stderr, "no MII interfaces found\n");
++ fprintf(stderr, "No interface specified\n");
++ fprintf(stderr, usage, argv[0]);
++ close(skfd);
++ return 2;
+ } else {
+ ret = 0;
+ for (i = optind; i < argc; i++) {
+@@ -445,15 +533,8 @@ int main(int argc, char **argv)
+ if (opt_watch && (ret == 0)) {
+ while (1) {
+ sleep(1);
+- if (optind == argc) {
+- for (i = 0; i < MAX_ETH; i++) {
+- sprintf(s, "eth%d", i);
+- watch_one_xcvr(skfd, s, i);
+- }
+- } else {
+- for (i = optind; i < argc; i++)
++ for (i = optind; i < argc; i++)
+ watch_one_xcvr(skfd, argv[i], i-optind);
+- }
+ }
+ }
+
+diff --git a/nameif.c b/nameif.c
+index 8d79b50..b280e59 100644
+--- a/nameif.c
++++ b/nameif.c
+@@ -1,11 +1,11 @@
+-/*
++/*
+ * Name Interfaces based on MAC address.
+ * Writen 2000 by Andi Kleen.
+- * Subject to the Gnu Public License, version 2.
++ * Subject to the Gnu Public License, version 2.
+ * TODO: make it support token ring etc.
+- * $Id: nameif.c,v 1.1 2000/10/18 17:26:29 ak Exp $
+- */
+-#ifndef _GNU_SOURCE
++ * $Id: nameif.c,v 1.4 2003/09/11 03:46:49 ak Exp $
++ */
++#ifndef _GNU_SOURCE
+ #define _GNU_SOURCE
+ #endif
+ #include <stdio.h>
+@@ -21,73 +21,68 @@
+ #include <net/if.h>
+ #include <linux/sockios.h>
+ #include <errno.h>
+-#include "intl.h"
+-
+-const char default_conf[] = "/etc/mactab";
+-const char *fname = default_conf;
+-int use_syslog;
+-int ctl_sk = -1;
+-
+-void err(char *msg)
+-{
+- if (use_syslog) {
+- syslog(LOG_ERR,"%s: %m", msg);
+- } else {
+- perror(msg);
+- }
+- exit(1);
++#include "intl.h"
++#include "net-support.h"
++#include "util.h"
++
++const char default_conf[] = "/etc/mactab";
++const char *fname = default_conf;
++int use_syslog;
++int ctl_sk = -1;
++
++void err(char *msg)
++{
++ if (use_syslog) {
++ syslog(LOG_ERR,"%s: %m", msg);
++ } else {
++ perror(msg);
++ }
++ exit(1);
+ }
+
+-void complain(char *fmt, ...)
+-{
++void complain(char *fmt, ...)
++{
+ va_list ap;
+ va_start(ap,fmt);
+- if (use_syslog) {
++ if (use_syslog) {
+ vsyslog(LOG_ERR,fmt,ap);
+ } else {
+ vfprintf(stderr,fmt,ap);
+- fputc('\n',stderr);
++ fputc('\n',stderr);
+ }
+- va_end(ap);
++ va_end(ap);
+ exit(1);
+-}
++}
+
+-void warning(char *fmt, ...)
+-{
++void warning(char *fmt, ...)
++{
+ va_list ap;
+ va_start(ap,fmt);
+- if (use_syslog) {
++ if (use_syslog) {
+ vsyslog(LOG_ERR,fmt,ap);
+ } else {
+ vfprintf(stderr,fmt,ap);
+- fputc('\n',stderr);
++ fputc('\n',stderr);
+ }
+- va_end(ap);
+-}
++ va_end(ap);
++}
+
+ int parsemac(char *str, unsigned char *mac)
+-{
+- char *s;
+- while ((s = strsep(&str, ":")) != NULL) {
++{
++ char *s;
++ while ((s = strsep(&str, ":")) != NULL) {
+ unsigned byte;
+- if (sscanf(s,"%x", &byte)!=1 || byte > 0xff)
++ if (sscanf(s,"%x", &byte)!=1 || byte > 0xff)
+ return -1;
+- *mac++ = byte;
+- }
++ *mac++ = byte;
++ }
+ return 0;
+-}
+-
+-void *xmalloc(unsigned sz)
+-{
+- void *p = calloc(sz,1);
+- if (!p) errno=ENOMEM, err("xmalloc");
+- return p;
+-}
++}
+
+ void opensock(void)
+ {
+- if (ctl_sk < 0)
+- ctl_sk = socket(PF_INET,SOCK_DGRAM,0);
++ if (ctl_sk < 0)
++ ctl_sk = socket(PF_INET,SOCK_DGRAM,0);
+ }
+
+ #ifndef ifr_newname
+@@ -97,10 +92,10 @@ void opensock(void)
+ int setname(char *oldname, char *newname)
+ {
+ struct ifreq ifr;
+- opensock();
++ opensock();
+ memset(&ifr,0,sizeof(struct ifreq));
+- strcpy(ifr.ifr_name, oldname);
+- strcpy(ifr.ifr_newname, newname);
++ safe_strncpy(ifr.ifr_name, oldname, IFNAMSIZ);
++ safe_strncpy(ifr.ifr_newname, newname, IFNAMSIZ);
+ return ioctl(ctl_sk, SIOCSIFNAME, &ifr);
+ }
+
+@@ -108,118 +103,118 @@ int getmac(char *name, unsigned char *mac)
+ {
+ int r;
+ struct ifreq ifr;
+- opensock();
++ opensock();
+ memset(&ifr,0,sizeof(struct ifreq));
+- strcpy(ifr.ifr_name, name);
++ safe_strncpy(ifr.ifr_name, name, IFNAMSIZ);
+ r = ioctl(ctl_sk, SIOCGIFHWADDR, &ifr);
+- memcpy(mac, ifr.ifr_hwaddr.sa_data, 6);
+- return r;
++ memcpy(mac, ifr.ifr_hwaddr.sa_data, 6);
++ return r;
+ }
+
+-struct change {
+- struct change *next,**pprev;
++struct change {
++ struct change *next;
++ int found;
+ char ifname[IFNAMSIZ+1];
+ unsigned char mac[6];
+-};
++};
+ struct change *clist;
+
+-struct change *lookupmac(unsigned char *mac)
+-{
++struct change *lookupmac(unsigned char *mac)
++{
+ struct change *ch;
+- for (ch = clist;ch;ch = ch->next)
++ for (ch = clist;ch;ch = ch->next)
+ if (!memcmp(ch->mac, mac, 6))
+ return ch;
+- return NULL;
+-}
++ return NULL;
++}
+
+ int addchange(char *p, struct change *ch, char *pos)
+ {
+ if (strchr(ch->ifname, ':'))
+- warning(_("alias device %s at %s probably has no mac"),
+- ch->ifname, pos);
+- if (parsemac(p,ch->mac) < 0)
+- complain(_("cannot parse MAC `%s' at %s"), p, pos);
+- if (clist)
+- clist->pprev = &ch->next;
++ warning(_("alias device %s at %s probably has no mac"),
++ ch->ifname, pos);
++ if (parsemac(p,ch->mac) < 0)
++ complain(_("cannot parse MAC `%s' at %s"), p, pos);
+ ch->next = clist;
+- ch->pprev = &clist;
+ clist = ch;
+- return 0;
++ return 0;
+ }
+
+ void readconf(void)
+ {
+- char *line;
+- size_t linel;
+- int linenum;
++ char *line;
++ size_t linel;
++ int linenum;
+ FILE *ifh;
+ char *p;
+ int n;
++ struct change *ch = NULL;
+
+ ifh = fopen(fname, "r");
+- if (!ifh)
+- complain(_("opening configuration file %s: %s"),fname,strerror(errno));
++ if (!ifh)
++ complain(_("opening configuration file %s: %s"),fname,strerror(errno));
+
+- line = NULL;
++ line = NULL;
+ linel = 0;
+- linenum = 1;
++ linenum = 1;
+ while (getdelim(&line, &linel, '\n', ifh) > 0) {
+- struct change *ch = xmalloc(sizeof(struct change));
+- char pos[20];
++ char pos[20];
+
+- sprintf(pos, _("line %d"), linenum);
++ sprintf(pos, _("line %d"), linenum);
+
+ if ((p = strchr(line,'#')) != NULL)
+ *p = '\0';
+- p = line;
++ p = line;
+ while (isspace(*p))
+- ++p;
++ ++p;
+ if (*p == '\0')
+- continue;
+- n = strcspn(p, " \t");
+- if (n > IFNAMSIZ)
+- complain(_("interface name too long at line %d"), line);
+- memcpy(ch->ifname, p, n);
+- ch->ifname[n] = 0;
+- p += n;
+- p += strspn(p, " \t");
+- n = strspn(p, "0123456789ABCDEFabcdef:");
+- p[n] = 0;
++ continue;
++ n = strcspn(p, " \t");
++ if (n > IFNAMSIZ-1)
++ complain(_("interface name too long at line %d"), line);
++ ch = xmalloc(sizeof(struct change));
++ memcpy(ch->ifname, p, n);
++ ch->ifname[n] = 0;
++ p += n;
++ p += strspn(p, " \t");
++ n = strspn(p, "0123456789ABCDEFabcdef:");
++ p[n] = 0;
+ addchange(p, ch, pos);
+ linenum++;
+- }
+- fclose(ifh);
++ }
++ fclose(ifh);
+ }
+
+-struct option lopt[] = {
++struct option lopt[] = {
+ {"syslog", 0, NULL, 's' },
+ {"config-file", 1, NULL, 'c' },
+- {"help", 0, NULL, '?' },
+- {NULL},
+-};
++ {"help", 0, NULL, '?' },
++ {NULL},
++};
+
+ void usage(void)
+ {
+- fprintf(stderr, _("usage: nameif [-c configurationfile] [-s] {ifname macaddress}"));
+- exit(1);
++ fprintf(stderr, _("usage: nameif [-c configurationfile] [-s] {ifname macaddress}\n"));
++ exit(E_USAGE);
+ }
+
+-int main(int ac, char **av)
+-{
+- FILE *ifh;
++int main(int ac, char **av)
++{
++ FILE *ifh;
+ char *p;
+ int n;
+- int linenum;
++ int linenum;
+ char *line = NULL;
+ size_t linel = 0;
++ int ret = 0;
+
+ for (;;) {
+ int c = getopt_long(ac,av,"c:s",lopt,NULL);
+ if (c == -1) break;
+- switch (c) {
++ switch (c) {
+ default:
+ case '?':
+- usage();
++ usage();
+ case 'c':
+ fname = optarg;
+ break;
+@@ -229,74 +224,76 @@ int main(int ac, char **av)
+ }
+ }
+
+- if (use_syslog)
++ if (use_syslog)
+ openlog("nameif",0,LOG_LOCAL0);
+-
+- while (optind < ac) {
+- struct change *ch = xmalloc(sizeof(struct change));
++
++ while (optind < ac) {
++ struct change *ch = xmalloc(sizeof(struct change));
+ char pos[30];
+
+- if ((ac-optind) & 1)
++ if ((ac-optind) & 1)
+ usage();
+- if (strlen(av[optind])+1>IFNAMSIZ)
++ if (strlen(av[optind])+1>IFNAMSIZ)
+ complain(_("interface name `%s' too long"), av[optind]);
+- strcpy(ch->ifname, av[optind]);
+- optind++;
+- sprintf(pos,_("argument %d"),optind);
+- addchange(av[optind], ch, pos);
+- optind++;
+- }
++ safe_strncpy(ch->ifname, av[optind], sizeof(ch->ifname));
++ optind++;
++ sprintf(pos,_("argument %d"),optind);
++ addchange(av[optind], ch, pos);
++ optind++;
++ }
+
+- if (!clist || fname != default_conf)
+- readconf();
++ if (!clist || fname != default_conf)
++ readconf();
+
+- ifh = fopen("/proc/net/dev", "r");
+- if (!ifh) complain(_("open of /proc/net/dev: %s"), strerror(errno));
++ ifh = fopen("/proc/net/dev", "r");
++ if (!ifh) complain(_("open of /proc/net/dev: %s"), strerror(errno));
+
+
+ linenum = 0;
+ while (getdelim(&line, &linel, '\n', ifh) > 0) {
+- struct change *ch;
++ struct change *ch;
+ unsigned char mac[6];
+
+- if (linenum++ < 2)
++ if (linenum++ < 2)
+ continue;
+-
+- p = line;
+- while (isspace(*p))
++
++ p = line;
++ while (isspace(*p))
+ ++p;
+- n = strcspn(p, ": \t");
+- p[n] = 0;
+-
+- if (n > IFNAMSIZ-1)
+- complain(_("interface name `%s' too long"), p);
+-
+- if (getmac(p, mac) < 0)
++ n = strcspn(p, ": \t");
++ p[n] = 0;
++
++ if (n > IFNAMSIZ-1)
++ complain(_("interface name `%s' too long"), p);
++
++ if (getmac(p, mac) < 0)
+ continue;
+-
+- ch = lookupmac(mac);
+- if (!ch)
++
++ ch = lookupmac(mac);
++ if (!ch)
+ continue;
+-
+- *ch->pprev = ch->next;
+- if (strcmp(p, ch->ifname)) {
+- if (setname(p, ch->ifname) < 0)
++
++ ch->found = 1;
++ if (strcmp(p, ch->ifname)) {
++ if (setname(p, ch->ifname) < 0)
+ complain(_("cannot change name of %s to %s: %s"),
+- p, ch->ifname, strerror(errno));
+- }
+- free(ch);
+- }
+- fclose(ifh);
+-
+- while (clist) {
++ p, ch->ifname, strerror(errno));
++ }
++ }
++ fclose(ifh);
++
++ while (clist) {
+ struct change *ch = clist;
+ clist = clist->next;
+- warning(_("interface '%s' not found"), ch->ifname);
+- free(ch);
++ if (!ch->found){
++ warning(_("interface '%s' not found"), ch->ifname);
++ ret = 1;
++ }
++ free(ch);
+ }
+
+ if (use_syslog)
+ closelog();
+- return 0;
+-}
++ return ret;
++}
+
+diff --git a/netstat.c b/netstat.c
+index 1ef790e..d0c364f 100644
+--- a/netstat.c
++++ b/netstat.c
+@@ -6,7 +6,7 @@
+ * NET-3 Networking Distribution for the LINUX operating
+ * system.
+ *
+- * Version: $Id: netstat.c,v 1.43 2001/04/15 14:41:17 pb Exp $
++ * Version: $Id: netstat.c,v 1.73 2011-04-20 01:35:22 ecki Exp $
+ *
+ * Authors: Fred Baumgarten, <dc6iq@insu1.etec.uni-karlsruhe.de>
+ * Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+@@ -23,24 +23,24 @@
+ * Modified:
+ *
+ *960116 {1.01} Bernd Eckenfels: verbose, cleanups
+- *960204 {1.10} Bernd Eckenfels: aftrans, usage, new route_info,
++ *960204 {1.10} Bernd Eckenfels: aftrans, usage, new route_info,
+ * DLFT_AF
+ *960204 {1.11} Bernd Eckenfels: netlink support
+ *960204 {1.12} Bernd Eckenfels: route_init()
+ *960215 {1.13} Bernd Eckenfels: netlink_print honors HAVE_
+- *960217 {1.14} Bernd Eckenfels: masq_info from Jos Vos and
++ *960217 {1.14} Bernd Eckenfels: masq_info from Jos Vos and
+ * ax25_info from Jonathan Naylor.
+ *960218 {1.15} Bernd Eckenfels: ipx_info rewritten, -e for tcp/ipx
+ *960220 {1.16} Bernd Eckenfels: minor output reformats, -a for -x
+ *960221 {1.17} Bernd Eckenfels: route_init->getroute_init
+ *960426 {1.18} Bernd Eckenfels: new RTACTION, SYM/NUM, FIB/CACHE
+- *960517 {1.19} Bernd Eckenfels: usage() spelling fix and --unix inode,
++ *960517 {1.19} Bernd Eckenfels: usage() spelling fix and --unix inode,
+ * ':' is part of sock_addr for --inet
+ *960822 {x.xx} Frank Strauss: INET6 support
+ *
+ *970406 {1.33} Philip Copeland Added snmp reporting support module -s
+ * code provided by Andi Kleen
+- * (relly needs to be kernel hooked but
++ * (relly needs to be kernel hooked but
+ * this will do in the meantime)
+ * minor header file misplacement tidy up.
+ *980815 {1.xx} Stephane Fillod: X.25 support
+@@ -58,6 +58,8 @@
+ *
+ *990420 {1.38} Tuan Hoang removed a useless assignment from igmp_do_one()
+ *20010404 {1.39} Arnaldo Carvalho de Melo - use setlocale
++ *20081201 {1.42} Brian Micek added -L|--udplite options for RFC 3828
++ *20020722 {1.51} Thomas Preusser added SCTP over IPv4 support
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU General
+@@ -83,6 +85,7 @@
+ #include <arpa/inet.h>
+ #include <netinet/in.h>
+ #include <sys/ioctl.h>
++#include <sys/stat.h>
+ #include <net/if.h>
+ #include <dirent.h>
+
+@@ -94,8 +97,18 @@
+ #include "sockets.h"
+ #include "interface.h"
+ #include "util.h"
++#include "proc.h"
++
++#if HAVE_SELINUX
++#include <selinux/selinux.h>
++#endif
++
++#if HAVE_AFBLUETOOTH
++#include <bluetooth/bluetooth.h>
++#endif
+
+ #define PROGNAME_WIDTH 20
++#define SELINUX_WIDTH 50
+
+ #if !defined(s6_addr32) && defined(in6a_words)
+ #define s6_addr32 in6a_words /* libinet6 */
+@@ -104,6 +117,8 @@
+ /* prototypes for statistics.c */
+ void parsesnmp(int, int, int);
+ void inittab(void);
++void parsesnmp6(int, int, int);
++void inittab6(void);
+
+ typedef enum {
+ SS_FREE = 0, /* not allocated */
+@@ -122,7 +137,7 @@ typedef enum {
+ #define FEATURE_NETSTAT
+ #include "lib/net-features.h"
+
+-char *Release = RELEASE, *Version = "netstat 1.42 (2001-04-15)", *Signature = "Fred Baumgarten, Alan Cox, Bernd Eckenfels, Phil Blundell, Tuan Hoang and others";
++static char *Release = RELEASE, *Signature = "Fred Baumgarten, Alan Cox, Bernd Eckenfels, Phil Blundell, Tuan Hoang, Brian Micek and others";
+
+
+ #define E_READ -1
+@@ -142,18 +157,24 @@ int flag_cf = 0;
+ int flag_opt = 0;
+ int flag_raw = 0;
+ int flag_tcp = 0;
++int flag_sctp= 0;
+ int flag_udp = 0;
++int flag_udplite = 0;
+ int flag_igmp= 0;
+ int flag_rom = 0;
+ int flag_exp = 1;
++int flag_wide= 0;
+ int flag_prg = 0;
+ int flag_arg = 0;
+ int flag_ver = 0;
++int flag_l2cap = 0;
++int flag_rfcomm = 0;
++int flag_selinux = 0;
+
+ FILE *procinfo;
+
+-#define INFO_GUTS1(file,name,proc) \
+- procinfo = fopen((file), "r"); \
++#define INFO_GUTS1(file,name,proc,prot) \
++ procinfo = proc_fopen((file)); \
+ if (procinfo == NULL) { \
+ if (errno != ENOENT) { \
+ perror((file)); \
+@@ -166,58 +187,63 @@ FILE *procinfo;
+ } else { \
+ do { \
+ if (fgets(buffer, sizeof(buffer), procinfo)) \
+- (proc)(lnr++, buffer); \
++ (proc)(lnr++, buffer,prot); \
+ } while (!feof(procinfo)); \
+ fclose(procinfo); \
+ }
+
+ #if HAVE_AFINET6
+-#define INFO_GUTS2(file,proc) \
++#define INFO_GUTS2(file,proc,prot) \
+ lnr = 0; \
+- procinfo = fopen((file), "r"); \
++ procinfo = proc_fopen((file)); \
+ if (procinfo != NULL) { \
+ do { \
+ if (fgets(buffer, sizeof(buffer), procinfo)) \
+- (proc)(lnr++, buffer); \
++ (proc)(lnr++, buffer,prot); \
+ } while (!feof(procinfo)); \
+ fclose(procinfo); \
+ }
+ #else
+-#define INFO_GUTS2(file,proc)
++#define INFO_GUTS2(file,proc,prot)
+ #endif
+
+ #define INFO_GUTS3 \
+ return rc;
+
+-#define INFO_GUTS6(file,file6,name,proc) \
++#define INFO_GUTS6(file,file6,name,proc,prot4,prot6) \
+ char buffer[8192]; \
+ int rc = 0; \
+ int lnr = 0; \
+ if (!flag_arg || flag_inet) { \
+- INFO_GUTS1(file,name,proc) \
++ INFO_GUTS1(file,name,proc,prot4) \
+ } \
+ if (!flag_arg || flag_inet6) { \
+- INFO_GUTS2(file6,proc) \
++ INFO_GUTS2(file6,proc,prot6) \
+ } \
+ INFO_GUTS3
+
+-#define INFO_GUTS(file,name,proc) \
++#define INFO_GUTS(file,name,proc,prot) \
+ char buffer[8192]; \
+ int rc = 0; \
+ int lnr = 0; \
+- INFO_GUTS1(file,name,proc) \
++ INFO_GUTS1(file,name,proc,prot) \
+ INFO_GUTS3
+
+ #define PROGNAME_WIDTHs PROGNAME_WIDTH1(PROGNAME_WIDTH)
+ #define PROGNAME_WIDTH1(s) PROGNAME_WIDTH2(s)
+ #define PROGNAME_WIDTH2(s) #s
+
++#define SELINUX_WIDTHs SELINUX_WIDTH1(SELINUX_WIDTH)
++#define SELINUX_WIDTH1(s) SELINUX_WIDTH2(s)
++#define SELINUX_WIDTH2(s) #s
++
+ #define PRG_HASH_SIZE 211
+
+ static struct prg_node {
+ struct prg_node *next;
+- int inode;
++ unsigned long inode;
+ char name[PROGNAME_WIDTH];
++ char scon[SELINUX_WIDTH];
+ } *prg_hash[PRG_HASH_SIZE];
+
+ static char prg_cache_loaded = 0;
+@@ -225,8 +251,11 @@ static char prg_cache_loaded = 0;
+ #define PRG_HASHIT(x) ((x) % PRG_HASH_SIZE)
+
+ #define PROGNAME_BANNER "PID/Program name"
++#define SELINUX_BANNER "Security Context"
++
++#define print_progname_banner() do { if (flag_prg) printf(" %-" PROGNAME_WIDTHs "s",PROGNAME_BANNER); } while (0)
+
+-#define print_progname_banner() do { if (flag_prg) printf("%-" PROGNAME_WIDTHs "s"," " PROGNAME_BANNER); } while (0)
++#define print_selinux_banner() do { if (flag_selinux) printf("%-" SELINUX_WIDTHs "s"," " SELINUX_BANNER); } while (0)
+
+ #define PRG_LOCAL_ADDRESS "local_address"
+ #define PRG_INODE "inode"
+@@ -246,40 +275,57 @@ static char prg_cache_loaded = 0;
+ #define PATH_PROC_X_FD PATH_PROC "/%s/" PATH_FD_SUFF
+ #define PATH_CMDLINE "cmdline"
+ #define PATH_CMDLINEl strlen(PATH_CMDLINE)
+-/* NOT working as of glibc-2.0.7: */
+-#undef DIRENT_HAVE_D_TYPE_WORKS
+
+-static void prg_cache_add(int inode, char *name)
++static void prg_cache_add(unsigned long inode, char *name, const char *scon)
+ {
+ unsigned hi = PRG_HASHIT(inode);
+ struct prg_node **pnp,*pn;
+
+- prg_cache_loaded=2;
+- for (pnp=prg_hash+hi;(pn=*pnp);pnp=&pn->next) {
+- if (pn->inode==inode) {
++ prg_cache_loaded = 2;
++ for (pnp = prg_hash + hi; (pn = *pnp); pnp = &pn->next) {
++ if (pn->inode == inode) {
+ /* Some warning should be appropriate here
+ as we got multiple processes for one i-node */
+ return;
+ }
+ }
+- if (!(*pnp=malloc(sizeof(**pnp))))
++ if (!(*pnp = malloc(sizeof(**pnp))))
+ return;
+- pn=*pnp;
+- pn->next=NULL;
+- pn->inode=inode;
+- if (strlen(name)>sizeof(pn->name)-1)
+- name[sizeof(pn->name)-1]='\0';
+- strcpy(pn->name,name);
++ pn = *pnp;
++ pn->next = NULL;
++ pn->inode = inode;
++ safe_strncpy(pn->name, name, sizeof(pn->name));
++
++ {
++ int len = (strlen(scon) - sizeof(pn->scon)) + 1;
++ if (len > 0)
++ safe_strncpy(pn->scon, &scon[len + 1], sizeof(pn->scon));
++ else
++ safe_strncpy(pn->scon, scon, sizeof(pn->scon));
++ }
++
++}
++
++static const char *prg_cache_get(unsigned long inode)
++{
++ unsigned hi = PRG_HASHIT(inode);
++ struct prg_node *pn;
++
++ for (pn = prg_hash[hi]; pn; pn = pn->next)
++ if (pn->inode == inode)
++ return (pn->name);
++ return ("-");
+ }
+
+-static const char *prg_cache_get(int inode)
++static const char *prg_cache_get_con(unsigned long inode)
+ {
+- unsigned hi=PRG_HASHIT(inode);
++ unsigned hi = PRG_HASHIT(inode);
+ struct prg_node *pn;
+
+- for (pn=prg_hash[hi];pn;pn=pn->next)
+- if (pn->inode==inode) return(pn->name);
+- return("-");
++ for (pn = prg_hash[hi]; pn; pn = pn->next)
++ if (pn->inode == inode)
++ return (pn->scon);
++ return ("-");
+ }
+
+ static void prg_cache_clear(void)
+@@ -287,143 +333,164 @@ static void prg_cache_clear(void)
+ struct prg_node **pnp,*pn;
+
+ if (prg_cache_loaded == 2)
+- for (pnp=prg_hash;pnp<prg_hash+PRG_HASH_SIZE;pnp++)
+- while ((pn=*pnp)) {
+- *pnp=pn->next;
++ for (pnp = prg_hash; pnp < prg_hash + PRG_HASH_SIZE; pnp++)
++ while ((pn = *pnp)) {
++ *pnp = pn->next;
+ free(pn);
+ }
+- prg_cache_loaded=0;
++ prg_cache_loaded = 0;
++}
++
++static void wait_continous(void)
++{
++ fflush(stdout);
++ sleep(1);
+ }
+
+-static void extract_type_1_socket_inode(const char lname[], long * inode_p) {
++static int extract_type_1_socket_inode(const char lname[], unsigned long * inode_p) {
+
+ /* If lname is of the form "socket:[12345]", extract the "12345"
+ as *inode_p. Otherwise, return -1 as *inode_p.
+ */
+
+- if (strlen(lname) < PRG_SOCKET_PFXl+3) *inode_p = -1;
+- else if (memcmp(lname, PRG_SOCKET_PFX, PRG_SOCKET_PFXl)) *inode_p = -1;
+- else if (lname[strlen(lname)-1] != ']') *inode_p = -1;
+- else {
++ if (strlen(lname) < PRG_SOCKET_PFXl+3) return(-1);
++
++ if (memcmp(lname, PRG_SOCKET_PFX, PRG_SOCKET_PFXl)) return(-1);
++ if (lname[strlen(lname)-1] != ']') return(-1);
++
++ {
+ char inode_str[strlen(lname + 1)]; /* e.g. "12345" */
+ const int inode_str_len = strlen(lname) - PRG_SOCKET_PFXl - 1;
+ char *serr;
+
+ strncpy(inode_str, lname+PRG_SOCKET_PFXl, inode_str_len);
+ inode_str[inode_str_len] = '\0';
+- *inode_p = strtol(inode_str,&serr,0);
+- if (!serr || *serr || *inode_p < 0 || *inode_p >= INT_MAX)
+- *inode_p = -1;
++ *inode_p = strtoul(inode_str, &serr, 0);
++ if (!serr || *serr || *inode_p == ~0)
++ return(-1);
+ }
++ return(0);
+ }
+
+
+
+-static void extract_type_2_socket_inode(const char lname[], long * inode_p) {
++static int extract_type_2_socket_inode(const char lname[], unsigned long * inode_p) {
+
+ /* If lname is of the form "[0000]:12345", extract the "12345"
+ as *inode_p. Otherwise, return -1 as *inode_p.
+ */
+
+- if (strlen(lname) < PRG_SOCKET_PFX2l+1) *inode_p = -1;
+- else if (memcmp(lname, PRG_SOCKET_PFX2, PRG_SOCKET_PFX2l)) *inode_p = -1;
+- else {
++ if (strlen(lname) < PRG_SOCKET_PFX2l+1) return(-1);
++ if (memcmp(lname, PRG_SOCKET_PFX2, PRG_SOCKET_PFX2l)) return(-1);
++
++ {
+ char *serr;
+
+- *inode_p=strtol(lname + PRG_SOCKET_PFX2l,&serr,0);
+- if (!serr || *serr || *inode_p < 0 || *inode_p >= INT_MAX)
+- *inode_p = -1;
++ *inode_p = strtoul(lname + PRG_SOCKET_PFX2l, &serr, 0);
++ if (!serr || *serr || *inode_p == ~0)
++ return(-1);
+ }
++ return(0);
+ }
+
+
+
++
+ static void prg_cache_load(void)
+ {
+- char line[LINE_MAX],eacces=0;
+- int procfdlen,fd,cmdllen,lnamelen;
+- char lname[30],cmdlbuf[512],finbuf[PROGNAME_WIDTH];
+- long inode;
+- const char *cs,*cmdlp;
+- DIR *dirproc=NULL,*dirfd=NULL;
+- struct dirent *direproc,*direfd;
++ char line[LINE_MAX], eacces=0;
++ int procfdlen, fd, cmdllen, lnamelen;
++ char lname[30], cmdlbuf[512], finbuf[PROGNAME_WIDTH];
++ unsigned long inode;
++ const char *cs, *cmdlp;
++ DIR *dirproc = NULL, *dirfd = NULL;
++ struct dirent *direproc, *direfd;
++#if HAVE_SELINUX
++ security_context_t scon = NULL;
++#endif
+
+ if (prg_cache_loaded || !flag_prg) return;
+- prg_cache_loaded=1;
+- cmdlbuf[sizeof(cmdlbuf)-1]='\0';
++ prg_cache_loaded = 1;
++ cmdlbuf[sizeof(cmdlbuf) - 1] = '\0';
+ if (!(dirproc=opendir(PATH_PROC))) goto fail;
+- while (errno=0,direproc=readdir(dirproc)) {
+-#ifdef DIRENT_HAVE_D_TYPE_WORKS
+- if (direproc->d_type!=DT_DIR) continue;
+-#endif
+- for (cs=direproc->d_name;*cs;cs++)
+- if (!isdigit(*cs))
++ while (errno = 0, direproc = readdir(dirproc)) {
++ for (cs = direproc->d_name; *cs; cs++)
++ if (!isdigit(*cs))
+ break;
+- if (*cs)
++ if (*cs)
+ continue;
+- procfdlen=snprintf(line,sizeof(line),PATH_PROC_X_FD,direproc->d_name);
+- if (procfdlen<=0 || procfdlen>=sizeof(line)-5)
++ procfdlen = snprintf(line,sizeof(line),PATH_PROC_X_FD,direproc->d_name);
++ if (procfdlen <= 0 || procfdlen >= sizeof(line) - 5)
+ continue;
+- errno=0;
+- dirfd=opendir(line);
++ errno = 0;
++ dirfd = opendir(line);
+ if (! dirfd) {
+- if (errno==EACCES)
+- eacces=1;
++ if (errno == EACCES)
++ eacces = 1;
+ continue;
+ }
+ line[procfdlen] = '/';
+ cmdlp = NULL;
+ while ((direfd = readdir(dirfd))) {
+-#ifdef DIRENT_HAVE_D_TYPE_WORKS
+- if (direfd->d_type!=DT_LNK)
+- continue;
+-#endif
+- if (procfdlen+1+strlen(direfd->d_name)+1>sizeof(line))
++ /* Skip . and .. */
++ if (!isdigit(direfd->d_name[0]))
++ continue;
++ if (procfdlen + 1 + strlen(direfd->d_name) + 1 > sizeof(line))
+ continue;
+ memcpy(line + procfdlen - PATH_FD_SUFFl, PATH_FD_SUFF "/",
+- PATH_FD_SUFFl+1);
+- strcpy(line + procfdlen + 1, direfd->d_name);
+- lnamelen=readlink(line,lname,sizeof(lname)-1);
++ PATH_FD_SUFFl + 1);
++ safe_strncpy(line + procfdlen + 1, direfd->d_name,
++ sizeof(line) - procfdlen - 1);
++ lnamelen = readlink(line, lname, sizeof(lname) - 1);
++ if (lnamelen == -1)
++ continue;
+ lname[lnamelen] = '\0'; /*make it a null-terminated string*/
+
+- extract_type_1_socket_inode(lname, &inode);
+-
+- if (inode < 0) extract_type_2_socket_inode(lname, &inode);
+-
+- if (inode < 0) continue;
++ if (extract_type_1_socket_inode(lname, &inode) < 0)
++ if (extract_type_2_socket_inode(lname, &inode) < 0)
++ continue;
+
+ if (!cmdlp) {
+- if (procfdlen - PATH_FD_SUFFl + PATH_CMDLINEl >=
+- sizeof(line) - 5)
++ if (procfdlen - PATH_FD_SUFFl + PATH_CMDLINEl >=
++ sizeof(line) - 5)
+ continue;
+- strcpy(line + procfdlen-PATH_FD_SUFFl, PATH_CMDLINE);
++ safe_strncpy(line + procfdlen - PATH_FD_SUFFl, PATH_CMDLINE,
++ sizeof(line) - procfdlen + PATH_FD_SUFFl);
+ fd = open(line, O_RDONLY);
+- if (fd < 0)
++ if (fd < 0)
+ continue;
+ cmdllen = read(fd, cmdlbuf, sizeof(cmdlbuf) - 1);
+- if (close(fd))
++ if (close(fd))
+ continue;
+- if (cmdllen == -1)
++ if (cmdllen == -1)
+ continue;
+- if (cmdllen < sizeof(cmdlbuf) - 1)
++ if (cmdllen < sizeof(cmdlbuf) - 1)
+ cmdlbuf[cmdllen]='\0';
+- if ((cmdlp = strrchr(cmdlbuf, '/')))
++ if (cmdlbuf[0] == '/' && (cmdlp = strrchr(cmdlbuf, '/')))
+ cmdlp++;
+- else
++ else
+ cmdlp = cmdlbuf;
+ }
+
+ snprintf(finbuf, sizeof(finbuf), "%s/%s", direproc->d_name, cmdlp);
+- prg_cache_add(inode, finbuf);
++#if HAVE_SELINUX
++ if (getpidcon(atoi(direproc->d_name), &scon) == -1) {
++ scon=xstrdup("-");
++ }
++ prg_cache_add(inode, finbuf, scon);
++ freecon(scon);
++#else
++ prg_cache_add(inode, finbuf, "-");
++#endif
+ }
+- closedir(dirfd);
++ closedir(dirfd);
+ dirfd = NULL;
+ }
+- if (dirproc)
++ if (dirproc)
+ closedir(dirproc);
+- if (dirfd)
++ if (dirfd)
+ closedir(dirfd);
+- if (!eacces)
++ if (!eacces)
+ return;
+ if (prg_cache_loaded == 1) {
+ fail:
+@@ -450,7 +517,7 @@ static int netrom_info(void)
+ char buffer[256], dev[16];
+ int st, vs, vr, sendq, recvq, ret;
+
+- f = fopen(_PATH_PROCNET_NR, "r");
++ f = proc_fopen(_PATH_PROCNET_NR);
+ if (f == NULL) {
+ if (errno != ENOENT) {
+ perror(_PATH_PROCNET_NR);
+@@ -465,7 +532,8 @@ static int netrom_info(void)
+ }
+ printf(_("Active NET/ROM sockets\n"));
+ printf(_("User Dest Source Device State Vr/Vs Send-Q Recv-Q\n"));
+- fgets(buffer, 256, f);
++ if (fgets(buffer, 256, f))
++ /* eat line */;
+
+ while (fgets(buffer, 256, f)) {
+ buffer[9] = 0;
+@@ -527,19 +595,22 @@ static void finish_this_one(int uid, unsigned long inode, const char *timers)
+
+ if (flag_exp > 1) {
+ if (!(flag_not & FLAG_NUM_USER) && ((pw = getpwuid(uid)) != NULL))
+- printf("%-10s ", pw->pw_name);
++ printf(" %-10s ", pw->pw_name);
+ else
+- printf("%-10d ", uid);
+- printf("%-10ld ",inode);
++ printf(" %-10d ", uid);
++ printf("%-10lu",inode);
+ }
+ if (flag_prg)
+- printf("%-" PROGNAME_WIDTHs "s",prg_cache_get(inode));
++ printf(" %-" PROGNAME_WIDTHs "s",prg_cache_get(inode));
++ if (flag_selinux)
++ printf(" %-" SELINUX_WIDTHs "s",prg_cache_get_con(inode));
++
+ if (flag_opt)
+- printf("%s", timers);
++ printf(" %s", timers);
+ putchar('\n');
+ }
+
+-static void igmp_do_one(int lnr, const char *line)
++static void igmp_do_one(int lnr, const char *line,const char *prot)
+ {
+ char mcast_addr[128];
+ #if HAVE_AFINET6
+@@ -598,8 +669,8 @@ static void igmp_do_one(int lnr, const char *line)
+ ((struct sockaddr *) &mcastaddr)->sa_family);
+ return;
+ }
+- safe_strncpy(mcast_addr, ap->sprint((struct sockaddr *) &mcastaddr,
+- flag_not), sizeof(mcast_addr));
++ safe_strncpy(mcast_addr, ap->sprint((struct sockaddr *) &mcastaddr,
++ flag_not & FLAG_NUM_HOST), sizeof(mcast_addr));
+ printf("%-15s %-6d %s\n", device, refcnt, mcast_addr);
+ #endif
+ } else { /* IPV4 */
+@@ -630,14 +701,14 @@ static void igmp_do_one(int lnr, const char *line)
+ fprintf(stderr, _("warning, got bogus igmp line %d.\n"), lnr);
+ return;
+ }
+-
++
+ if ((ap = get_afntype(((struct sockaddr *) &mcastaddr)->sa_family)) == NULL) {
+ fprintf(stderr, _("netstat: unsupported address family %d !\n"),
+ ((struct sockaddr *) &mcastaddr)->sa_family);
+ return;
+ }
+- safe_strncpy(mcast_addr, ap->sprint((struct sockaddr *) &mcastaddr,
+- flag_not), sizeof(mcast_addr));
++ safe_strncpy(mcast_addr, ap->sprint((struct sockaddr *) &mcastaddr,
++ flag_not & FLAG_NUM_HOST), sizeof(mcast_addr));
+ printf("%-15s %-6d %s\n", device, refcnt, mcast_addr );
+ #endif
+ } /* IPV4 */
+@@ -646,7 +717,7 @@ static void igmp_do_one(int lnr, const char *line)
+ #if HAVE_AFX25
+ static int x25_info(void)
+ {
+- FILE *f=fopen(_PATH_PROCNET_X25, "r");
++ FILE *f=proc_fopen(_PATH_PROCNET_X25);
+ char buffer[256],dev[16];
+ int st,vs,vr,sendq,recvq,lci;
+ static char *x25_state[5]=
+@@ -657,7 +728,7 @@ static int x25_info(void)
+ "ESTABLISHED",
+ "RECOVERY"
+ };
+- if(!(f=fopen(_PATH_PROCNET_X25, "r")))
++ if(!f)
+ {
+ if (errno != ENOENT) {
+ perror(_PATH_PROCNET_X25);
+@@ -673,7 +744,8 @@ static int x25_info(void)
+ printf( _("Active X.25 sockets\n"));
+ /* IMHO, Vr/Vs is not very usefull --SF */
+ printf( _("Dest Source Device LCI State Vr/Vs Send-Q Recv-Q\n"));
+- fgets(buffer,256,f);
++ if (fgets(buffer,256,f))
++ /* eat line */;
+ while(fgets(buffer,256,f))
+ {
+ buffer[10]=0;
+@@ -690,21 +762,206 @@ static int x25_info(void)
+ vr,vs,sendq,recvq);
+ }
+ fclose(f);
+- return 0;
++ return 0;
+ }
+ #endif
+
+ static int igmp_info(void)
+ {
+ INFO_GUTS6(_PATH_PROCNET_IGMP, _PATH_PROCNET_IGMP6, "AF INET (igmp)",
+- igmp_do_one);
++ igmp_do_one, "igmp", "igmp6");
++}
++
++static int ip_parse_dots(uint32_t *addr, char const *src) {
++ unsigned a, b, c, d;
++ unsigned ret = 4-sscanf(src, "%u.%u.%u.%u", &a, &b, &c, &d);
++ *addr = htonl((a << 24)|(b << 16)|(c << 8)|d);
++ return ret;
++}
++
++static void print_ip_service(struct sockaddr_in *addr, char const *protname,
++ char *buf, unsigned size) {
++ struct aftype *ap;
++
++ if(size == 0) return;
++
++ /* print host */
++ if((ap = get_afntype(addr->sin_family)) == NULL) {
++ fprintf(stderr, _("netstat: unsupported address family %d !\n"),
++ addr->sin_family);
++ return;
++ }
++ safe_strncpy(buf, ap->sprint((struct sockaddr*)addr, flag_not), size);
++
++ /* print service */
++ if(flag_all || (flag_lst && !addr->sin_port) || (!flag_lst && addr->sin_port)) {
++ char bfs[32];
++
++ snprintf(bfs, sizeof(bfs), "%s",
++ get_sname(addr->sin_port, (char*)protname, flag_not & FLAG_NUM_PORT));
++
++ /* check if we must cut on host and/or service name */
++ {
++ unsigned const bufl = strlen(buf);
++ unsigned const bfsl = strlen(bfs);
++
++ if(bufl+bfsl+2 > size) {
++ unsigned const half = (size-2)>>1;
++ if(bufl > half) {
++ if(bfsl > half) {
++ buf[size-2-half] = '\0';
++ bfs[half+1] = '\0';
++ }
++ else buf[size-2-bfsl] = '\0';
++ }
++ else bfs[size-2-bufl] = '\0';
++ }
++ }
++ strcat(buf, ":");
++ strcat(buf, bfs);
++ }
++}
++
++/* process single SCTP endpoint */
++static void sctp_do_ept(int lnr, char const *line, const char *prot)
++{
++ struct sockaddr_in laddr, raddr;
++ unsigned uid, inode;
++
++ char l_addr[23], r_addr[23];
++
++ /* fill sockaddr_in structures */
++ {
++ unsigned lport;
++ unsigned ate;
++
++ if(lnr == 0) return;
++ if(sscanf(line, "%*X %*X %*u %*u %*u %u %u %u %n",
++ &lport, &uid, &inode, &ate) < 3) goto err;
++
++ /* decode IP address */
++ if(ip_parse_dots(&laddr.sin_addr.s_addr, line+ate)) goto err;
++ raddr.sin_addr.s_addr = htonl(0);
++ laddr.sin_family = raddr.sin_family = AF_INET;
++ laddr.sin_port = htons(lport);
++ raddr.sin_port = htons(0);
++ }
++
++ /* print IP:service to l_addr and r_addr */
++ print_ip_service(&laddr, prot, l_addr, sizeof(l_addr));
++ print_ip_service(&raddr, prot, r_addr, sizeof(r_addr));
++
++ /* Print line */
++ printf("%-4s %6d %6d %-*s %-*s %-11s",
++ prot, 0, 0,
++ (int)netmax(23,strlen(l_addr)), l_addr,
++ (int)netmax(23,strlen(r_addr)), r_addr,
++ _(tcp_state[TCP_LISTEN]));
++ finish_this_one(uid, inode, "");
++ return;
++ err:
++ fprintf(stderr, "SCTP error in line: %d\n", lnr);
++}
++
++/* process single SCTP association */
++static void sctp_do_assoc(int lnr, char const *line, const char *prot)
++{
++ struct sockaddr_in laddr, raddr;
++ unsigned long rxq, txq;
++ unsigned uid, inode;
++
++ char l_addr[23], r_addr[23];
++
++ /* fill sockaddr_in structures */
++ {
++ unsigned lport, rport;
++ unsigned ate;
++ char const *addr;
++
++ if(lnr == 0) return;
++ if(sscanf(line, "%*X %*X %*u %*u %*u %*u %*u %lu %lu %u %u %u %u %n",
++ &txq, &rxq, &uid, &inode, &lport, &rport, &ate) < 6) goto err;
++
++ /* decode IP addresses */
++ addr = strchr(line+ate, '*');
++ if(addr == 0) goto err;
++ if(ip_parse_dots(&laddr.sin_addr.s_addr, ++addr)) goto err;
++ addr = strchr(addr, '*');
++ if(addr == 0) goto err;
++ if(ip_parse_dots(&raddr.sin_addr.s_addr, ++addr)) goto err;
++
++ /* complete sockaddr_in structures */
++ laddr.sin_family = raddr.sin_family = AF_INET;
++ laddr.sin_port = htons(lport);
++ raddr.sin_port = htons(rport);
++ }
++
++ /* print IP:service to l_addr and r_addr */
++ print_ip_service(&laddr, prot, l_addr, sizeof(l_addr));
++ print_ip_service(&raddr, prot, r_addr, sizeof(r_addr));
++
++ /* Print line */
++ printf("%-4s %6ld %6ld %-*s %-*s %-11s",
++ prot, rxq, txq,
++ (int)netmax(23,strlen(l_addr)), l_addr,
++ (int)netmax(23,strlen(r_addr)), r_addr,
++ _(tcp_state[TCP_ESTABLISHED]));
++ finish_this_one(uid, inode, "");
++ return;
++ err:
++ fprintf(stderr, "SCTP error in line: %d\n", lnr);
++}
++
++static int sctp_info_epts(void) {
++ INFO_GUTS6(_PATH_PROCNET_SCTPEPTS, _PATH_PROCNET_SCTP6EPTS, "AF INET (sctp)",
++ sctp_do_ept, "sctp", "sctp6");
++}
++
++static int sctp_info_assocs(void) {
++ INFO_GUTS6(_PATH_PROCNET_SCTPASSOCS, _PATH_PROCNET_SCTP6ASSOCS, "AF INET (sctp)",
++ sctp_do_assoc, "sctp", "sctp6");
++}
++
++static int sctp_info(void) {
++ int res;
++ res = sctp_info_epts();
++ if(res) return res;
++ return sctp_info_assocs();
++}
++
++static void addr_do_one(char *buf, size_t buf_len, size_t short_len, struct aftype *ap,
++#if HAVE_AFINET6
++ struct sockaddr_in6 *addr,
++#else
++ struct sockaddr_in *addr,
++#endif
++ int port, const char *proto
++)
++{
++ const char *sport, *saddr;
++ size_t port_len, addr_len;
++
++ saddr = ap->sprint((struct sockaddr *)addr, flag_not & FLAG_NUM_HOST);
++ sport = get_sname(htons(port), proto, flag_not & FLAG_NUM_PORT);
++ addr_len = strlen(saddr);
++ port_len = strlen(sport);
++ if (!flag_wide && (addr_len + port_len > short_len)) {
++ /* Assume port name is short */
++ port_len = netmin(port_len, short_len - 4);
++ addr_len = short_len - port_len;
++ strncpy(buf, saddr, addr_len);
++ buf[addr_len] = '\0';
++ strcat(buf, ":");
++ strncat(buf, sport, port_len);
++ } else
++ snprintf(buf, buf_len, "%s:%s", saddr, sport);
+ }
+
+-static void tcp_do_one(int lnr, const char *line)
++static void tcp_do_one(int lnr, const char *line, const char *prot)
+ {
+ unsigned long rxq, txq, time_len, retr, inode;
+ int num, local_port, rem_port, d, state, uid, timer_run, timeout;
+- char rem_addr[128], local_addr[128], timers[64], buffer[1024], more[512];
++ char rem_addr[128], local_addr[128], timers[64];
+ struct aftype *ap;
+ #if HAVE_AFINET6
+ struct sockaddr_in6 localaddr, remaddr;
+@@ -719,9 +976,17 @@ static void tcp_do_one(int lnr, const char *line)
+ return;
+
+ num = sscanf(line,
+- "%d: %64[0-9A-Fa-f]:%X %64[0-9A-Fa-f]:%X %X %lX:%lX %X:%lX %lX %d %d %ld %512s\n",
++ "%d: %64[0-9A-Fa-f]:%X %64[0-9A-Fa-f]:%X %X %lX:%lX %X:%lX %lX %d %d %lu %*s\n",
+ &d, local_addr, &local_port, rem_addr, &rem_port, &state,
+- &txq, &rxq, &timer_run, &time_len, &retr, &uid, &timeout, &inode, more);
++ &txq, &rxq, &timer_run, &time_len, &retr, &uid, &timeout, &inode);
++
++ if (num < 11) {
++ fprintf(stderr, _("warning, got bogus tcp line.\n"));
++ return;
++ }
++
++ if (!flag_all && ((flag_lst && rem_port) || (!flag_lst && !rem_port)))
++ return;
+
+ if (strlen(local_addr) > 8) {
+ #if HAVE_AFINET6
+@@ -748,45 +1013,16 @@ static void tcp_do_one(int lnr, const char *line)
+ ((struct sockaddr *) &remaddr)->sa_family = AF_INET;
+ }
+
+- if (num < 11) {
+- fprintf(stderr, _("warning, got bogus tcp line.\n"));
+- return;
+- }
+ if ((ap = get_afntype(((struct sockaddr *) &localaddr)->sa_family)) == NULL) {
+ fprintf(stderr, _("netstat: unsupported address family %d !\n"),
+ ((struct sockaddr *) &localaddr)->sa_family);
+ return;
+ }
+- if (state == TCP_LISTEN) {
+- time_len = 0;
+- retr = 0L;
+- rxq = 0L;
+- txq = 0L;
+- }
+- safe_strncpy(local_addr, ap->sprint((struct sockaddr *) &localaddr,
+- flag_not), sizeof(local_addr));
+- safe_strncpy(rem_addr, ap->sprint((struct sockaddr *) &remaddr, flag_not),
+- sizeof(rem_addr));
+- if (flag_all || (flag_lst && !rem_port) || (!flag_lst && rem_port)) {
+- snprintf(buffer, sizeof(buffer), "%s",
+- get_sname(htons(local_port), "tcp",
+- flag_not & FLAG_NUM_PORT));
+-
+- if ((strlen(local_addr) + strlen(buffer)) > 22)
+- local_addr[22 - strlen(buffer)] = '\0';
+-
+- strcat(local_addr, ":");
+- strcat(local_addr, buffer);
+- snprintf(buffer, sizeof(buffer), "%s",
+- get_sname(htons(rem_port), "tcp", flag_not & FLAG_NUM_PORT));
+-
+- if ((strlen(rem_addr) + strlen(buffer)) > 22)
+- rem_addr[22 - strlen(buffer)] = '\0';
+-
+- strcat(rem_addr, ":");
+- strcat(rem_addr, buffer);
+- timers[0] = '\0';
+
++ addr_do_one(local_addr, sizeof(local_addr), 22, ap, &localaddr, local_port, "tcp");
++ addr_do_one(rem_addr, sizeof(rem_addr), 22, ap, &remaddr, rem_port, "tcp");
++
++ timers[0] = '\0';
+ if (flag_opt)
+ switch (timer_run) {
+ case 0:
+@@ -813,23 +1049,23 @@ static void tcp_do_one(int lnr, const char *line)
+ timer_run, (double) time_len / HZ, retr, timeout);
+ break;
+ }
+- printf("tcp %6ld %6ld %-23s %-23s %-12s",
+- rxq, txq, local_addr, rem_addr, _(tcp_state[state]));
++
++ printf("%-4s %6ld %6ld %-*s %-*s %-11s",
++ prot, rxq, txq, (int)netmax(23,strlen(local_addr)), local_addr, (int)netmax(23,strlen(rem_addr)), rem_addr, _(tcp_state[state]));
+
+ finish_this_one(uid,inode,timers);
+- }
+ }
+
+ static int tcp_info(void)
+ {
+ INFO_GUTS6(_PATH_PROCNET_TCP, _PATH_PROCNET_TCP6, "AF INET (tcp)",
+- tcp_do_one);
++ tcp_do_one, "tcp", "tcp6");
+ }
+
+-static void udp_do_one(int lnr, const char *line)
++static void udp_do_one(int lnr, const char *line,const char *prot)
+ {
+- char buffer[8192], local_addr[64], rem_addr[64];
+- char *udp_state, timers[64], more[512];
++ char local_addr[64], rem_addr[64];
++ char *udp_state, timers[64];
+ int num, local_port, rem_port, d, state, timer_run, uid, timeout;
+ #if HAVE_AFINET6
+ struct sockaddr_in6 localaddr, remaddr;
+@@ -845,12 +1081,16 @@ static void udp_do_one(int lnr, const char *line)
+ if (lnr == 0)
+ return;
+
+- more[0] = '\0';
+ num = sscanf(line,
+- "%d: %64[0-9A-Fa-f]:%X %64[0-9A-Fa-f]:%X %X %lX:%lX %X:%lX %lX %d %d %ld %512s\n",
++ "%d: %64[0-9A-Fa-f]:%X %64[0-9A-Fa-f]:%X %X %lX:%lX %X:%lX %lX %d %d %lu %*s\n",
+ &d, local_addr, &local_port,
+ rem_addr, &rem_port, &state,
+- &txq, &rxq, &timer_run, &time_len, &retr, &uid, &timeout, &inode, more);
++ &txq, &rxq, &timer_run, &time_len, &retr, &uid, &timeout, &inode);
++
++ if (num < 10) {
++ fprintf(stderr, _("warning, got bogus udp line.\n"));
++ return;
++ }
+
+ if (strlen(local_addr) > 8) {
+ #if HAVE_AFINET6
+@@ -877,13 +1117,7 @@ static void udp_do_one(int lnr, const char *line)
+ }
+
+ retr = 0L;
+- if (!flag_opt)
+- more[0] = '\0';
+
+- if (num < 10) {
+- fprintf(stderr, _("warning, got bogus udp line.\n"));
+- return;
+- }
+ if ((ap = get_afntype(((struct sockaddr *) &localaddr)->sa_family)) == NULL) {
+ fprintf(stderr, _("netstat: unsupported address family %d !\n"),
+ ((struct sockaddr *) &localaddr)->sa_family);
+@@ -917,24 +1151,8 @@ static void udp_do_one(int lnr, const char *line)
+
+ if (flag_all || (notnull(remaddr) && !flag_lst) || (!notnull(remaddr) && flag_lst))
+ {
+- safe_strncpy(local_addr, ap->sprint((struct sockaddr *) &localaddr,
+- flag_not), sizeof(local_addr));
+- snprintf(buffer, sizeof(buffer), "%s",
+- get_sname(htons(local_port), "udp",
+- flag_not & FLAG_NUM_PORT));
+- if ((strlen(local_addr) + strlen(buffer)) > 22)
+- local_addr[22 - strlen(buffer)] = '\0';
+- strcat(local_addr, ":");
+- strcat(local_addr, buffer);
+-
+- snprintf(buffer, sizeof(buffer), "%s",
+- get_sname(htons(rem_port), "udp", flag_not & FLAG_NUM_PORT));
+- safe_strncpy(rem_addr, ap->sprint((struct sockaddr *) &remaddr,
+- flag_not), sizeof(rem_addr));
+- if ((strlen(rem_addr) + strlen(buffer)) > 22)
+- rem_addr[22 - strlen(buffer)] = '\0';
+- strcat(rem_addr, ":");
+- strcat(rem_addr, buffer);
++ addr_do_one(local_addr, sizeof(local_addr), 22, ap, &localaddr, local_port, "udp");
++ addr_do_one(rem_addr, sizeof(rem_addr), 22, ap, &remaddr, rem_port, "udp");
+
+ timers[0] = '\0';
+ if (flag_opt)
+@@ -953,8 +1171,8 @@ static void udp_do_one(int lnr, const char *line)
+ retr, timeout);
+ break;
+ }
+- printf("udp %6ld %6ld %-23s %-23s %-12s",
+- rxq, txq, local_addr, rem_addr, udp_state);
++ printf("%-5s %6ld %6ld %-23s %-23s %-11s",
++ prot, rxq, txq, local_addr, rem_addr, udp_state);
+
+ finish_this_one(uid,inode,timers);
+ }
+@@ -963,13 +1181,19 @@ static void udp_do_one(int lnr, const char *line)
+ static int udp_info(void)
+ {
+ INFO_GUTS6(_PATH_PROCNET_UDP, _PATH_PROCNET_UDP6, "AF INET (udp)",
+- udp_do_one);
++ udp_do_one, "udp", "udp6");
+ }
+
+-static void raw_do_one(int lnr, const char *line)
++static int udplite_info(void)
+ {
+- char buffer[8192], local_addr[64], rem_addr[64];
+- char timers[64], more[512];
++ INFO_GUTS6(_PATH_PROCNET_UDPLITE, _PATH_PROCNET_UDPLITE6,
++ "AF INET (udplite)", udp_do_one, "udpl", "udpl6" );
++}
++
++static void raw_do_one(int lnr, const char *line,const char *prot)
++{
++ char local_addr[64], rem_addr[64];
++ char timers[64];
+ int num, local_port, rem_port, d, state, timer_run, uid, timeout;
+ #if HAVE_AFINET6
+ struct sockaddr_in6 localaddr, remaddr;
+@@ -985,11 +1209,15 @@ static void raw_do_one(int lnr, const char *line)
+ if (lnr == 0)
+ return;
+
+- more[0] = '\0';
+ num = sscanf(line,
+- "%d: %64[0-9A-Fa-f]:%X %64[0-9A-Fa-f]:%X %X %lX:%lX %X:%lX %lX %d %d %ld %512s\n",
++ "%d: %64[0-9A-Fa-f]:%X %64[0-9A-Fa-f]:%X %X %lX:%lX %X:%lX %lX %d %d %lu %*s\n",
+ &d, local_addr, &local_port, rem_addr, &rem_port, &state,
+- &txq, &rxq, &timer_run, &time_len, &retr, &uid, &timeout, &inode, more);
++ &txq, &rxq, &timer_run, &time_len, &retr, &uid, &timeout, &inode);
++
++ if (num < 10) {
++ fprintf(stderr, _("warning, got bogus raw line.\n"));
++ return;
++ }
+
+ if (strlen(local_addr) > 8) {
+ #if HAVE_AFINET6
+@@ -1026,34 +1254,10 @@ static void raw_do_one(int lnr, const char *line)
+ }
+ #endif
+
+- if (!flag_opt)
+- more[0] = '\0';
+-
+- if (num < 10) {
+- fprintf(stderr, _("warning, got bogus raw line.\n"));
+- return;
+- }
+-
+ if (flag_all || (notnull(remaddr) && !flag_lst) || (!notnull(remaddr) && flag_lst))
+ {
+- snprintf(buffer, sizeof(buffer), "%s",
+- get_sname(htons(local_port), "raw",
+- flag_not & FLAG_NUM_PORT));
+- safe_strncpy(local_addr, ap->sprint((struct sockaddr *) &localaddr,
+- flag_not), sizeof(local_addr));
+- if ((strlen(local_addr) + strlen(buffer)) > 22)
+- local_addr[22 - strlen(buffer)] = '\0';
+- strcat(local_addr, ":");
+- strcat(local_addr, buffer);
+-
+- snprintf(buffer, sizeof(buffer), "%s",
+- get_sname(htons(rem_port), "raw", flag_not & FLAG_NUM_PORT));
+- safe_strncpy(rem_addr, ap->sprint((struct sockaddr *) &remaddr,
+- flag_not), sizeof(rem_addr));
+- if ((strlen(rem_addr) + strlen(buffer)) > 22)
+- rem_addr[22 - strlen(buffer)] = '\0';
+- strcat(rem_addr, ":");
+- strcat(rem_addr, buffer);
++ addr_do_one(local_addr, sizeof(local_addr), 22, ap, &localaddr, local_port, "raw");
++ addr_do_one(rem_addr, sizeof(rem_addr), 22, ap, &remaddr, rem_port, "raw");
+
+ timers[0] = '\0';
+ if (flag_opt)
+@@ -1074,8 +1278,8 @@ static void raw_do_one(int lnr, const char *line)
+ retr, timeout);
+ break;
+ }
+- printf("raw %6ld %6ld %-23s %-23s %-12d",
+- rxq, txq, local_addr, rem_addr, state);
++ printf("%-4s %6ld %6ld %-23s %-23s %-11d",
++ prot, rxq, txq, local_addr, rem_addr, state);
+
+ finish_this_one(uid,inode,timers);
+ }
+@@ -1084,7 +1288,7 @@ static void raw_do_one(int lnr, const char *line)
+ static int raw_info(void)
+ {
+ INFO_GUTS6(_PATH_PROCNET_RAW, _PATH_PROCNET_RAW6, "AF INET (raw)",
+- raw_do_one);
++ raw_do_one, "raw", "raw6");
+ }
+
+ #endif
+@@ -1094,14 +1298,14 @@ static int raw_info(void)
+
+ #define HAS_INODE 1
+
+-static void unix_do_one(int nr, const char *line)
++static void unix_do_one(int nr, const char *line, const char *prot)
+ {
+ static int has = 0;
+ char path[MAXPATHLEN], ss_flags[32];
+ char *ss_proto, *ss_state, *ss_type;
+- int num, state, type, inode;
++ int num, state, type;
+ void *d;
+- unsigned long refcnt, proto, flags;
++ unsigned long refcnt, proto, flags, inode;
+
+ if (nr == 0) {
+ if (strstr(line, "Inode"))
+@@ -1109,14 +1313,14 @@ static void unix_do_one(int nr, const char *line)
+ return;
+ }
+ path[0] = '\0';
+- num = sscanf(line, "%p: %lX %lX %lX %X %X %d %s",
++ num = sscanf(line, "%p: %lX %lX %lX %X %X %lu %s",
+ &d, &refcnt, &proto, &flags, &type, &state, &inode, path);
+ if (num < 6) {
+ fprintf(stderr, _("warning, got bogus unix line.\n"));
+ return;
+ }
+ if (!(has & HAS_INODE))
+- snprintf(path,sizeof(path),"%d",inode);
++ snprintf(path,sizeof(path),"%lu",inode);
+
+ if (!flag_all) {
+ if ((state == SS_UNCONNECTED) && (flags & SO_ACCEPTCON)) {
+@@ -1195,7 +1399,7 @@ static void unix_do_one(int nr, const char *line)
+ ss_state = _("UNKNOWN");
+ }
+
+- strcpy(ss_flags, "[ ");
++ safe_strncpy(ss_flags, "[ ", sizeof(ss_flags));
+ if (flags & SO_ACCEPTCON)
+ strcat(ss_flags, "ACC ");
+ if (flags & SO_WAITDATA)
+@@ -1208,12 +1412,15 @@ static void unix_do_one(int nr, const char *line)
+ printf("%-5s %-6ld %-11s %-10s %-13s ",
+ ss_proto, refcnt, ss_flags, ss_type, ss_state);
+ if (has & HAS_INODE)
+- printf("%-6d ",inode);
++ printf("%-8lu",inode);
+ else
+- printf("- ");
++ printf("- ");
+ if (flag_prg)
+- printf("%-" PROGNAME_WIDTHs "s",(has & HAS_INODE?prg_cache_get(inode):"-"));
+- puts(path);
++ printf(" %-" PROGNAME_WIDTHs "s",(has & HAS_INODE?prg_cache_get(inode):"-"));
++ if (flag_selinux)
++ printf(" %-" SELINUX_WIDTHs "s",(has & HAS_INODE?prg_cache_get_con(inode):"-"));
++
++ printf(" %s\n", path);
+ }
+
+ static int unix_info(void)
+@@ -1229,12 +1436,13 @@ static int unix_info(void)
+ printf(_("(w/o servers)"));
+ }
+
+- printf(_("\nProto RefCnt Flags Type State I-Node"));
++ printf(_("\nProto RefCnt Flags Type State I-Node "));
+ print_progname_banner();
++ print_selinux_banner();
+ printf(_(" Path\n")); /* xxx */
+
+ {
+- INFO_GUTS(_PATH_PROCNET_UNIX, "AF UNIX", unix_do_one);
++ INFO_GUTS(_PATH_PROCNET_UNIX, "AF UNIX", unix_do_one, "unix");
+ }
+ }
+ #endif
+@@ -1256,7 +1464,7 @@ static int ax25_info(void)
+ N_("ESTABLISHED"),
+ N_("RECOVERY")
+ };
+- if (!(f = fopen(_PATH_PROCNET_AX25, "r"))) {
++ if (!(f = proc_fopen(_PATH_PROCNET_AX25))) {
+ if (errno != ENOENT) {
+ perror(_PATH_PROCNET_AX25);
+ return (-1);
+@@ -1350,18 +1558,37 @@ static int ipx_info(void)
+ char sad[50], dad[50];
+ struct sockaddr sa;
+ unsigned sport = 0, dport = 0;
+-
+- if (!(f = fopen(_PATH_PROCNET_IPX, "r"))) {
+- if (errno != ENOENT) {
+- perror(_PATH_PROCNET_IPX);
+- return (-1);
+- }
+- if (flag_arg || flag_ver)
+- ESYSNOT("netstat", "AF IPX");
+- if (flag_arg)
+- return (1);
+- else
+- return (0);
++ struct stat s;
++
++ f = proc_fopen(_PATH_PROCNET_IPX_SOCKET1);
++ if (!f) {
++ if (errno != ENOENT) {
++ perror(_PATH_PROCNET_IPX_SOCKET1);
++ return (-1);
++ }
++ f = proc_fopen(_PATH_PROCNET_IPX_SOCKET2);
++
++ /* We need to check for directory */
++ if (f) {
++ if (fstat (fileno(f), &s) == -1 ||
++ !S_ISREG(s.st_mode)) {
++ fclose(f);
++ f=NULL;
++ }
++ }
++
++ if (!f) {
++ if (errno != ENOENT) {
++ perror(_PATH_PROCNET_IPX_SOCKET2);
++ return (-1);
++ }
++ if (flag_arg || flag_ver)
++ ESYSNOT("netstat", "AF IPX");
++ if (flag_arg)
++ return (1);
++ else
++ return (0);
++ }
+ }
+ printf(_("Active IPX sockets\nProto Recv-Q Send-Q Local Address Foreign Address State")); /* xxx */
+ if (flag_exp > 1)
+@@ -1369,19 +1596,22 @@ static int ipx_info(void)
+ printf("\n");
+ if ((ap = get_afntype(AF_IPX)) == NULL) {
+ EINTERN("netstat.c", "AF_IPX missing");
++ fclose(f);
+ return (-1);
+ }
+- fgets(buf, 255, f);
++ if (fgets(buf, 255, f))
++ /* eat line */;
+
+ while (fgets(buf, 255, f) != NULL) {
+- sscanf(buf, "%s %s %lX %lX %d %d",
++ sscanf(buf, "%s %s %lX %lX %u %u",
+ sad, dad, &txq, &rxq, &state, &uid);
+ if ((st = rindex(sad, ':'))) {
+ *st++ = '\0';
+ sscanf(st, "%X", &sport); /* net byt order */
+ sport = ntohs(sport);
+ } else {
+- EINTERN("netstat.c", _PATH_PROCNET_IPX " sport format error");
++ EINTERN("netstat.c", "ipx socket format error in source port");
++ fclose(f);
+ return (-1);
+ }
+ nc = 0;
+@@ -1391,7 +1621,8 @@ static int ipx_info(void)
+ sscanf(st, "%X", &dport); /* net byt order */
+ dport = ntohs(dport);
+ } else {
+- EINTERN("netstat.c", _PATH_PROCNET_IPX " dport format error");
++ EINTERN("netstat.c", "ipx socket format error in destination port");
++ fclose(f);
+ return (-1);
+ }
+ } else
+@@ -1413,16 +1644,16 @@ static int ipx_info(void)
+
+ /* Fetch and resolve the Source */
+ (void) ap->input(4, sad, &sa);
+- safe_strncpy(buf, ap->sprint(&sa, flag_not), sizeof(buf));
++ safe_strncpy(buf, ap->sprint(&sa, flag_not & FLAG_NUM_HOST), sizeof(buf));
+ snprintf(sad, sizeof(sad), "%s:%04X", buf, sport);
+
+ if (!nc) {
+ /* Fetch and resolve the Destination */
+ (void) ap->input(4, dad, &sa);
+- safe_strncpy(buf, ap->sprint(&sa, flag_not), sizeof(buf));
++ safe_strncpy(buf, ap->sprint(&sa, flag_not & FLAG_NUM_HOST), sizeof(buf));
+ snprintf(dad, sizeof(dad), "%s:%04X", buf, dport);
+ } else
+- strcpy(dad, "-");
++ safe_strncpy(dad, "-", sizeof(dad));
+
+ printf("IPX %6ld %6ld %-26s %-26s %-5s", txq, rxq, sad, dad, st);
+ if (flag_exp > 1) {
+@@ -1438,6 +1669,116 @@ static int ipx_info(void)
+ }
+ #endif
+
++#if HAVE_AFBLUETOOTH
++const char *bluetooth_state(int state)
++{
++ switch (state) {
++ case BT_CONNECTED:
++ return _("CONNECTED");
++ case BT_OPEN:
++ return _("OPEN");
++ case BT_BOUND:
++ return _("BOUND");
++ case BT_LISTEN:
++ return _("LISTEN");
++ case BT_CONNECT:
++ return _("CONNECT");
++ case BT_CONNECT2:
++ return _("CONNECT2");
++ case BT_CONFIG:
++ return _("CONFIG");
++ case BT_DISCONN:
++ return _("DISCONN");
++ case BT_CLOSED:
++ return _("CLOSED");
++ default:
++ return _("UNKNOWN");
++ }
++}
++
++static void l2cap_do_one(int nr, const char *line, const char *prot)
++{
++ char daddr[18], saddr[18];
++ unsigned state, psm, dcid, scid, imtu, omtu, sec_level;
++ int num;
++ const char *bt_state, *bt_sec_level;
++
++ num = sscanf(line, "%17s %17s %d %d 0x%04x 0x%04x %d %d %d",
++ daddr, saddr, &state, &psm, &dcid, &scid, &imtu, &omtu, &sec_level);
++
++ if (num < 9) {
++ fprintf(stderr, _("warning, got bogus l2cap line.\n"));
++ return;
++ }
++
++ if (flag_lst && !(state == BT_LISTEN || state == BT_BOUND))
++ return;
++ if (!(flag_all || flag_lst) && (state == BT_LISTEN || state == BT_BOUND))
++ return;
++
++ bt_state = bluetooth_state(state);
++ switch (sec_level) {
++ case BT_SECURITY_SDP:
++ bt_sec_level = _("SDP");
++ break;
++ case BT_SECURITY_LOW:
++ bt_sec_level = _("LOW");
++ break;
++ case BT_SECURITY_MEDIUM:
++ bt_sec_level = _("MEDIUM");
++ break;
++ case BT_SECURITY_HIGH:
++ bt_sec_level = _("HIGH");
++ break;
++ default:
++ bt_sec_level = _("UNKNOWN");
++ }
++
++ printf("l2cap %-17s %-17s %-9s %7d 0x%04x 0x%04x %7d %7d %-7s\n",
++ (strcmp (daddr, "00:00:00:00:00:00") == 0 ? "*" : daddr),
++ (strcmp (saddr, "00:00:00:00:00:00") == 0 ? "*" : saddr),
++ bt_state, psm, dcid, scid, imtu, omtu, bt_sec_level);
++}
++
++static int l2cap_info(void)
++{
++ printf("%-6s %-17s %-17s %-9s %7s %-6s %-6s %7s %7s %-7s\n",
++ "Proto", "Destination", "Source", "State", "PSM", "DCID", "SCID", "IMTU", "OMTU", "Security");
++ INFO_GUTS(_PATH_SYS_BLUETOOTH_L2CAP, "AF BLUETOOTH", l2cap_do_one, "l2cap");
++}
++
++static void rfcomm_do_one(int nr, const char *line, const char *prot)
++{
++ char daddr[18], saddr[18];
++ unsigned state, channel;
++ int num;
++ const char *bt_state;
++
++ num = sscanf(line, "%17s %17s %d %d", daddr, saddr, &state, &channel);
++ if (num < 4) {
++ fprintf(stderr, _("warning, got bogus rfcomm line.\n"));
++ return;
++ }
++
++ if (flag_lst && !(state == BT_LISTEN || state == BT_BOUND))
++ return;
++ if (!(flag_all || flag_lst) && (state == BT_LISTEN || state == BT_BOUND))
++ return;
++
++ bt_state = bluetooth_state(state);
++ printf("rfcomm %-17s %-17s %-9s %7d\n",
++ (strcmp (daddr, "00:00:00:00:00:00") == 0 ? "*" : daddr),
++ (strcmp (saddr, "00:00:00:00:00:00") == 0 ? "*" : saddr),
++ bt_state, channel);
++}
++
++static int rfcomm_info(void)
++{
++ printf("%-6s %-17s %-17s %-9s %7s\n", "Proto", "Destination", "Source", "State", "Channel");
++ INFO_GUTS(_PATH_SYS_BLUETOOTH_RFCOMM, "AF BLUETOOTH", rfcomm_do_one, "rfcomm");
++}
++#endif
++
+ static int iface_info(void)
+ {
+ if (skfd < 0) {
+@@ -1449,7 +1790,7 @@ static int iface_info(void)
+ }
+ if (flag_exp < 2) {
+ ife_short = 1;
+- printf(_("Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg\n"));
++ printf(_("Iface MTU RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg\n"));
+ }
+
+ if (for_all_interfaces(do_if_print, &flag_all) < 0) {
+@@ -1457,7 +1798,7 @@ static int iface_info(void)
+ exit(1);
+ }
+ if (flag_cnt)
+- free_interface_list();
++ if_cache_free();
+ else {
+ close(skfd);
+ skfd = -1;
+@@ -1469,16 +1810,16 @@ static int iface_info(void)
+
+ static void version(void)
+ {
+- printf("%s\n%s\n%s\n%s\n", Release, Version, Signature, Features);
++ printf("%s\n%s\n%s\n", Release, Signature, Features);
+ exit(E_VERSION);
+ }
+
+
+ static void usage(void)
+ {
+- fprintf(stderr, _("usage: netstat [-veenNcCF] [<Af>] -r netstat {-V|--version|-h|--help}\n"));
+- fprintf(stderr, _(" netstat [-vnNcaeol] [<Socket> ...]\n"));
+- fprintf(stderr, _(" netstat { [-veenNac] -i | [-cnNe] -M | -s }\n\n"));
++ fprintf(stderr, _("usage: netstat [-vWeenNcCF] [<Af>] -r netstat {-V|--version|-h|--help}\n"));
++ fprintf(stderr, _(" netstat [-vWnNcaeol] [<Socket> ...]\n"));
++ fprintf(stderr, _(" netstat { [-vWeenNac] -i | [-cnNe] -M | -s [-6tuw] }\n\n"));
+
+ fprintf(stderr, _(" -r, --route display routing table\n"));
+ fprintf(stderr, _(" -i, --interfaces display interface table\n"));
+@@ -1487,7 +1828,9 @@ static void usage(void)
+ #if HAVE_FW_MASQUERADE
+ fprintf(stderr, _(" -M, --masquerade display masqueraded connections\n\n"));
+ #endif
++
+ fprintf(stderr, _(" -v, --verbose be verbose\n"));
++ fprintf(stderr, _(" -W, --wide don't truncate IP addresses\n"));
+ fprintf(stderr, _(" -n, --numeric don't resolve names\n"));
+ fprintf(stderr, _(" --numeric-hosts don't resolve host names\n"));
+ fprintf(stderr, _(" --numeric-ports don't resolve port names\n"));
+@@ -1495,15 +1838,19 @@ static void usage(void)
+ fprintf(stderr, _(" -N, --symbolic resolve hardware names\n"));
+ fprintf(stderr, _(" -e, --extend display other/more information\n"));
+ fprintf(stderr, _(" -p, --programs display PID/Program name for sockets\n"));
++ fprintf(stderr, _(" -o, --timers display timers\n"));
+ fprintf(stderr, _(" -c, --continuous continuous listing\n\n"));
+ fprintf(stderr, _(" -l, --listening display listening server sockets\n"));
+- fprintf(stderr, _(" -a, --all, --listening display all sockets (default: connected)\n"));
+- fprintf(stderr, _(" -o, --timers display timers\n"));
++ fprintf(stderr, _(" -a, --all display all sockets (default: connected)\n"));
+ fprintf(stderr, _(" -F, --fib display Forwarding Information Base (default)\n"));
+- fprintf(stderr, _(" -C, --cache display routing cache instead of FIB\n\n"));
++ fprintf(stderr, _(" -C, --cache display routing cache instead of FIB\n"));
++#if HAVE_SELINUX
++ fprintf(stderr, _(" -Z, --context display SELinux security context for sockets\n"));
++#endif
+
+- fprintf(stderr, _(" <Socket>={-t|--tcp} {-u|--udp} {-w|--raw} {-x|--unix} --ax25 --ipx --netrom\n"));
+- fprintf(stderr, _(" <AF>=Use '-A <af>' or '--<af>'; default: %s\n"), DFLT_AF);
++ fprintf(stderr, _("\n <Socket>={-t|--tcp} {-u|--udp} {-U|--udplite} {-S|--sctp} {-w|--raw}\n"));
++ fprintf(stderr, _(" {-x|--unix} --ax25 --ipx --netrom\n"));
++ fprintf(stderr, _(" <AF>=Use '-6|-4' or '-A <af>' or '--<af>'; default: %s\n"), DFLT_AF);
+ fprintf(stderr, _(" List of possible address families (which support routing):\n"));
+ print_aflist(1); /* 1 = routeable */
+ exit(E_USAGE);
+@@ -1514,7 +1861,7 @@ int main
+ (int argc, char *argv[]) {
+ int i;
+ int lop;
+- struct option longopts[] =
++ static struct option longopts[] =
+ {
+ AFTRANS_OPTS,
+ {"version", 0, 0, 'V'},
+@@ -1526,9 +1873,13 @@ int main
+ #endif
+ {"protocol", 1, 0, 'A'},
+ {"tcp", 0, 0, 't'},
++ {"sctp", 0, 0, 'S'},
+ {"udp", 0, 0, 'u'},
++ {"udplite", 0, 0, 'U'},
+ {"raw", 0, 0, 'w'},
+ {"unix", 0, 0, 'x'},
++ {"l2cap", 0, 0, '2'},
++ {"rfcomm", 0, 0, 'f'},
+ {"listening", 0, 0, 'l'},
+ {"all", 0, 0, 'a'},
+ {"timers", 0, 0, 'o'},
+@@ -1537,6 +1888,7 @@ int main
+ {"programs", 0, 0, 'p'},
+ {"verbose", 0, 0, 'v'},
+ {"statistics", 0, 0, 's'},
++ {"wide", 0, 0, 'W'},
+ {"numeric", 0, 0, 'n'},
+ {"numeric-hosts", 0, 0, '!'},
+ {"numeric-ports", 0, 0, '@'},
+@@ -1545,6 +1897,7 @@ int main
+ {"cache", 0, 0, 'C'},
+ {"fib", 0, 0, 'F'},
+ {"groups", 0, 0, 'g'},
++ {"context", 0, 0, 'Z'},
+ {NULL, 0, 0, 0}
+ };
+
+@@ -1556,7 +1909,7 @@ int main
+ getroute_init(); /* Set up AF routing support */
+
+ afname[0] = '\0';
+- while ((i = getopt_long(argc, argv, "MCFA:acdegphinNorstuVv?wxl", longopts, &lop)) != EOF)
++ while ((i = getopt_long(argc, argv, "A:CFMacdeghilnNoprsStuUvVWwx64?Z", longopts, &lop)) != EOF)
+ switch (i) {
+ case -1:
+ break;
+@@ -1600,6 +1953,9 @@ int main
+ case 'i':
+ flag_int++;
+ break;
++ case 'W':
++ flag_wide++;
++ break;
+ case 'n':
+ flag_not |= FLAG_NUM;
+ break;
+@@ -1624,6 +1980,14 @@ int main
+ case 'o':
+ flag_opt++;
+ break;
++ case '6':
++ if (aftrans_opt("inet6"))
++ exit(1);
++ break;
++ case '4':
++ if (aftrans_opt("inet"))
++ exit(1);
++ break;
+ case 'V':
+ version();
+ /*NOTREACHED */
+@@ -1633,21 +1997,45 @@ int main
+ case 'r':
+ flag_rou++;
+ break;
+-
+ case 't':
+ flag_tcp++;
+ break;
+-
++ case 'S':
++ flag_sctp++;
++ break;
+ case 'u':
+ flag_udp++;
+ break;
++ case 'U':
++ flag_udplite++;
++ break;
+ case 'w':
+ flag_raw++;
+ break;
++ case '2':
++ flag_l2cap++;
++ break;
++ case 'f':
++ flag_rfcomm++;
++ break;
+ case 'x':
+ if (aftrans_opt("unix"))
+ exit(1);
+ break;
++ case 'Z':
++#if HAVE_SELINUX
++ if (is_selinux_enabled() <= 0) {
++ fprintf(stderr, _("SELinux is not enabled on this machine.\n"));
++ exit(1);
++ }
++ flag_prg++;
++ flag_selinux++;
++#else
++ fprintf(stderr, _("SELinux is not enabled for this application.\n"));
++ exit(1);
++#endif
++
++ break;
+ case '?':
+ case 'h':
+ usage();
+@@ -1658,46 +2046,71 @@ int main
+ if (flag_int + flag_rou + flag_mas + flag_sta > 1)
+ usage();
+
+- if ((flag_inet || flag_inet6 || flag_sta) && !(flag_tcp || flag_udp || flag_raw))
+- flag_tcp = flag_udp = flag_raw = 1;
++ if ((flag_inet || flag_inet6 || flag_sta) &&
++ !(flag_tcp || flag_sctp || flag_udp || flag_udplite || flag_raw))
++ flag_tcp = flag_sctp = flag_udp = flag_udplite = flag_raw = 1;
+
+- if ((flag_tcp || flag_udp || flag_raw || flag_igmp) && !(flag_inet || flag_inet6))
++ if ((flag_tcp || flag_sctp || flag_udp || flag_udplite || flag_raw || flag_igmp) &&
++ !(flag_inet || flag_inet6))
+ flag_inet = flag_inet6 = 1;
+
+- flag_arg = flag_tcp + flag_udp + flag_raw + flag_unx + flag_ipx
+- + flag_ax25 + flag_netrom + flag_igmp + flag_x25;
++ if (flag_bluetooth && !(flag_l2cap || flag_rfcomm))
++ flag_l2cap = flag_rfcomm = 1;
++
++ flag_arg = flag_tcp + flag_sctp + flag_udplite + flag_udp + flag_raw + flag_unx
++ + flag_ipx + flag_ax25 + flag_netrom + flag_igmp + flag_x25 + flag_rose
++ + flag_l2cap + flag_rfcomm;
+
+ if (flag_mas) {
+ #if HAVE_FW_MASQUERADE && HAVE_AFINET
+ #if MORE_THAN_ONE_MASQ_AF
+ if (!afname[0])
+- strcpy(afname, DFLT_AF);
++ safe_strncpy(afname, DFLT_AF, sizeof(afname));
+ #endif
+ for (;;) {
+ i = ip_masq_info(flag_not & FLAG_NUM_HOST,
+ flag_not & FLAG_NUM_PORT, flag_exp);
+ if (i || !flag_cnt)
+ break;
+- sleep(1);
++ wait_continous();
+ }
+ #else
+- ENOSUPP("netstat.c", "FW_MASQUERADE");
++ ENOSUPP("netstat", "FW_MASQUERADE");
+ i = -1;
+ #endif
+ return (i);
+ }
+
+ if (flag_sta) {
+- inittab();
+- parsesnmp(flag_raw, flag_tcp, flag_udp);
+- exit(0);
++ if (!afname[0])
++ safe_strncpy(afname, DFLT_AF, sizeof(afname));
++
++ if (!strcmp(afname, "inet")) {
++#if HAVE_AFINET
++ inittab();
++ parsesnmp(flag_raw, flag_tcp, flag_udp);
++#else
++ ENOSUPP("netstat", "AF INET");
++#endif
++ } else if(!strcmp(afname, "inet6")) {
++#if HAVE_AFINET6
++ inittab6();
++ parsesnmp6(flag_raw, flag_tcp, flag_udp);
++#else
++ ENOSUPP("netstat", "AF INET6");
++#endif
++ } else {
++ printf(_("netstat: No statistics support for specified address family: %s\n"), afname);
++ exit(1);
++ }
++ exit(0);
+ }
+-
++
+ if (flag_rou) {
+ int options = 0;
+
+ if (!afname[0])
+- strcpy(afname, DFLT_AF);
++ safe_strncpy(afname, DFLT_AF, sizeof(afname));
+
+ if (flag_exp == 2)
+ flag_exp = 1;
+@@ -1712,7 +2125,7 @@ int main
+ i = route_info(afname, options);
+ if (i || !flag_cnt)
+ break;
+- sleep(1);
++ wait_continous();
+ }
+ return (i);
+ }
+@@ -1721,12 +2134,12 @@ int main
+ i = iface_info();
+ if (!flag_cnt || i)
+ break;
+- sleep(1);
++ wait_continous();
+ }
+ return (i);
+ }
+ for (;;) {
+- if (!flag_arg || flag_tcp || flag_udp || flag_raw) {
++ if (!flag_arg || flag_tcp || flag_sctp || flag_udp || flag_udplite || flag_raw) {
+ #if HAVE_AFINET
+ prg_cache_load();
+ printf(_("Active Internet connections ")); /* xxx */
+@@ -1743,6 +2156,7 @@ int main
+ if (flag_exp > 1)
+ printf(_(" User Inode "));
+ print_progname_banner();
++ print_selinux_banner();
+ if (flag_opt)
+ printf(_(" Timer")); /* xxx */
+ printf("\n");
+@@ -1759,11 +2173,25 @@ int main
+ if (i)
+ return (i);
+ }
++
++ if (!flag_arg || flag_sctp) {
++ i = sctp_info();
++ if (i)
++ return (i);
++ }
++
+ if (!flag_arg || flag_udp) {
+ i = udp_info();
+ if (i)
+ return (i);
+ }
++
++ if (!flag_arg || flag_udplite) {
++ i = udplite_info();
++ if (i)
++ return (i);
++ }
++
+ if (!flag_arg || flag_raw) {
+ i = raw_info();
+ if (i)
+@@ -1845,9 +2273,55 @@ int main
+ }
+ #endif
+ }
++ if (!flag_arg || flag_rose) {
++#if 0 && HAVE_AFROSE
++ i = rose_info();
++ if (i)
++ return (i);
++#else
++ if (flag_arg) {
++ i = 1;
++ ENOSUPP("netstat", "AF ROSE");
++ }
++#endif
++ }
++
++ if (!flag_arg || flag_l2cap || flag_rfcomm) {
++#if HAVE_AFBLUETOOTH
++ printf(_("Active Bluetooth connections ")); /* xxx */
++
++ if (flag_all)
++ printf(_("(servers and established)"));
++ else {
++ if (flag_lst)
++ printf(_("(only servers)"));
++ else
++ printf(_("(w/o servers)"));
++ }
++ printf("\n");
++#else
++ if (flag_arg) {
++ i = 1;
++ ENOSUPP("netstat", "AF BLUETOOTH");
++ }
++#endif
++ }
++#if HAVE_AFBLUETOOTH
++ if (!flag_arg || flag_l2cap) {
++ i = l2cap_info();
++ if (i)
++ return (i);
++ }
++ if (!flag_arg || flag_rfcomm) {
++ i = rfcomm_info();
++ if (i)
++ return (i);
++ }
++#endif
++
+ if (!flag_cnt || i)
+ break;
+- sleep(1);
++ wait_continous();
+ prg_cache_clear();
+ }
+ return (i);
+diff --git a/plipconfig.c b/plipconfig.c
+index 1f972a7..86fa890 100644
+--- a/plipconfig.c
++++ b/plipconfig.c
+@@ -4,7 +4,7 @@
+ Copyright (c) 1994 John Paul Morrison (VE7JPM).
+
+ version 0.2
+-
++
+ Changed by Alan Cox, to reflect the way SIOCDEVPRIVATE is meant to work
+ and for the extra parameter added by Niibe.
+
+@@ -42,31 +42,27 @@
+ #include "intl.h"
+ #include "net-support.h"
+ #include "version.h"
++#include "util.h"
+
+-int opt_a = 0;
+-int opt_i = 0;
+-int opt_v = 0;
+ int skfd = -1;
+
+ struct ifreq ifr;
+ struct plipconf *plip;
+
+-char *Release = RELEASE,
+- *Version = "plipconfig 0.2",
+- *Signature = "John Paul Morrison, Alan Cox et al.";
++static char *Release = RELEASE, *Signature = "John Paul Morrison, Alan Cox et al.";
+
+ static void version(void)
+ {
+- printf("%s\n%s\n%s\n", Release, Version, Signature);
++ printf("%s\n%s\n", Release, Signature);
+ exit(E_VERSION);
+ }
+
+ void usage(void)
+ {
+- fprintf(stderr, _("Usage: plipconfig [-a] [-i] [-v] interface\n"));
+- fprintf(stderr, _(" [nibble NN] [trigger NN]\n"));
++ fprintf(stderr, _("Usage: plipconfig interface [nibble NN] [trigger NN]\n"));
+ fprintf(stderr, _(" plipconfig -V | --version\n"));
+- exit(-1);
++ fprintf(stderr, _(" plipconfig -h | --help\n"));
++ exit(E_USAGE);
+ }
+
+ void print_plip(void)
+@@ -93,12 +89,10 @@ int main(int argc, char **argv)
+ argc--;
+ argv++;
+ while (argv[0] && *argv[0] == '-') {
+- if (!strcmp(*argv, "-a"))
+- opt_a = 1;
+- if (!strcmp(*argv, "-v"))
+- opt_v = 1;
+ if (!strcmp(*argv, "-V") || !strcmp(*argv, "--version"))
+ version();
++ else
++ usage();
+ argv++;
+ argc--;
+ }
+@@ -107,7 +101,7 @@ int main(int argc, char **argv)
+ usage();
+
+ spp = argv;
+- strncpy(ifr.ifr_name, *spp++, IFNAMSIZ);
++ safe_strncpy(ifr.ifr_name, *spp++, IFNAMSIZ);
+ plip=(struct plipconf *)&ifr.ifr_data;
+
+ plip->pcmd = PLIP_GET_TIMEOUT; /* get current settings for device */
+diff --git a/po/Makefile b/po/Makefile
+index 0fdf82d..c7f27fb 100644
+--- a/po/Makefile
++++ b/po/Makefile
+@@ -3,16 +3,24 @@ INSTALL_PROGRAM= ${INSTALL}
+ INSTALL_DATA= ${INSTALL} -m 644
+ INSTALLNLSDIR=${BASEDIR}/usr/share/locale
+
+-TUPDATE = tupdate
++TUPDATE = msgmerge
+
+ NLSPACKAGE = net-tools
+
+ -include ../config.make
++ALL_POS = $(wildcard *.po)
++ALL_LANGS = $(ALL_POS:%.po=%)
++ALL_CATALOGS = $(ALL_LANGS:%=%.mo)
+ ifeq ($(I18N),1)
+-CATALOGS = de.mo fr.mo pt_BR.mo et_EE.mo cs.mo
++ifeq ($(LINGUAS),)
++LANGS = $(ALL_LANGS)
+ else
+-CATALOGS =
++LANGS = $(filter $(LINGUAS),$(ALL_LANGS))
+ endif
++else
++LANGS =
++endif
++CATALOGS = $(LANGS:%=%.mo)
+
+ POTFILES=../arp.c ../hostname.c ../ifconfig.c ../netstat.c ../rarp.c \
+ ../route.c ../plipconfig.c ../iptunnel.c ../statistics.c \
+@@ -44,12 +52,12 @@ $(NLSPACKAGE).pot: $(POTFILES)
+
+ update-po: Makefile
+ $(MAKE) $(NLSPACKAGE).pot
+- catalogs='$(CATALOGS)'; \
+- for cat in $$catalogs; do \
+- lang=`echo $$cat | sed 's/.mo//'`; \
++ langs='$(ALL_LANGS)'; \
++ for lang in $$langs; do \
++ cat=$$lang.mo; \
+ mv $$lang.po $$lang.old.po; \
+ echo "$$lang:"; \
+- if $(TUPDATE) $(NLSPACKAGE).pot $$lang.old.po > $$lang.po; then \
++ if $(TUPDATE) $$lang.old.po $(NLSPACKAGE).pot > $$lang.po; then \
+ rm -f $$lang.old.po; \
+ else \
+ echo "tupdate for $$cat failed!"; \
+@@ -61,18 +69,19 @@ update-po: Makefile
+ clean:
+ rm -f *mo
+
++dist: $(ALL_CATALOGS)
++
+ distclean: clean
+ rm -f .depend Makefile
+
+ depend:
+
+ install: $(CATALOGS)
+- catalogs='$(CATALOGS)'; \
+- for n in $$catalogs; do \
+- l=`basename $$n .mo`; \
++ langs='$(LANGS)'; \
++ for l in $$langs; do \
+ $(INSTALL) -m 755 -d $(INSTALLNLSDIR)/$$l; \
+ $(INSTALL) -m 755 -d $(INSTALLNLSDIR)/$$l/LC_MESSAGES; \
+- $(INSTALL) -m 644 $$n $(INSTALLNLSDIR)/$$l/LC_MESSAGES/net-tools.mo; \
++ $(INSTALL) -m 644 $$l.mo $(INSTALLNLSDIR)/$$l/LC_MESSAGES/net-tools.mo; \
+ done
+
+ %.mo: %.po
+diff --git a/po/cs.po b/po/cs.po
+index b4b66a1..c1d6a8a 100644
+--- a/po/cs.po
++++ b/po/cs.po
+@@ -1,359 +1,385 @@
+ # Czech translation of net-tools
+ # Copyright (C) 1999 Free Software Foundation, Inc.
+-# Ji Pavlovsk <pavlovsk@ffcuni.cz>, 1999.
++# Jiří Pavlovský <pavlovsk@ffcuni.cz>, 1999.
++# Petr Pisar <petr.pisar@atlas.cz>, 2009.
+ #
+ msgid ""
+ msgstr ""
+-"Project-Id-Version: net-tools-1.51\n"
+-"POT-Creation-Date: 2000-02-14 02:31+0100\n"
+-"PO-Revision-Date: 1999-08-29 23:20+0200\n"
+-"Last-Translator: Ji Pavlovsk <pavlovsk@ff.cuni.cz>\n"
+-"Language-Team: Czech <cs@li.org>\n"
++"Project-Id-Version: net-tools cvs-20090825\n"
++"Report-Msgid-Bugs-To: \n"
++"POT-Creation-Date: 2009-08-25 18:34+0200\n"
++"PO-Revision-Date: 2009-08-26 22:18+0200\n"
++"Last-Translator: Petr Pisar <petr.pisar@atlas.cz>\n"
++"Language-Team: Czech <translation-team-cs@lists.sourceforge.net>\n"
+ "MIME-Version: 1.0\n"
+-"Content-Type: text/plain; charset=iso-8859-2\n"
++"Content-Type: text/plain; charset=UTF-8\n"
+ "Content-Transfer-Encoding: 8bit\n"
+
+-#: ../arp.c:110 ../arp.c:269
++#: ../arp.c:112 ../arp.c:279
++#, c-format
+ msgid "arp: need host name\n"
+-msgstr "arp: je teba jmno potae\n"
++msgstr "arp: je třeba jméno počítače\n"
+
+-#: ../arp.c:207 ../arp.c:221
++#: ../arp.c:215 ../arp.c:230
+ #, c-format
+ msgid "No ARP entry for %s\n"
+-msgstr "Pro %s neexistuje ARP poloka\n"
++msgstr "Pro %s neexistuje ARP položka\n"
+
+-#: ../arp.c:239
++#: ../arp.c:248
+ #, c-format
+ msgid "arp: cant get HW-Address for `%s': %s.\n"
+ msgstr "arp: HW adresu `%s' nelze zjistit: %s\n"
+
+-#: ../arp.c:243
++#: ../arp.c:252
++#, c-format
+ msgid "arp: protocol type mismatch.\n"
+-msgstr "arp: chybn zadan typ protokolu\n"
++msgstr "arp: chybně zadaný typ protokolu\n"
+
+-#: ../arp.c:252
++#: ../arp.c:261
+ #, c-format
+ msgid "arp: device `%s' has HW address %s `%s'.\n"
+-msgstr "arp: zazen `%s' m Hw adresu %s `%s'.\n"
++msgstr "arp: zařízení `%s' má Hw adresu %s `%s'.\n"
+
+-#: ../arp.c:282
++#: ../arp.c:293
++#, c-format
+ msgid "arp: need hardware address\n"
+-msgstr "arp: je teba hardwarov adresa\n"
++msgstr "arp: je třeba hardwarová adresa\n"
+
+-#: ../arp.c:290
++#: ../arp.c:301
++#, c-format
+ msgid "arp: invalid hardware address\n"
+-msgstr "arp: nesprvn hardwarov adresa\n"
++msgstr "arp: nesprávná hardwarová adresa\n"
+
+-#: ../arp.c:387
++#: ../arp.c:398
+ #, c-format
+ msgid "arp: cannot open etherfile %s !\n"
+-msgstr "arp: databzi ethernetovch adres %s nelze otevt!\n"
++msgstr "arp: databázi ethernetových adres %s nelze otevřít!\n"
+
+-#: ../arp.c:403
++#: ../arp.c:414
+ #, c-format
+ msgid "arp: format error on line %u of etherfile %s !\n"
+-msgstr "arp: syntaktick chyba na dku %u databze ethernetovch adres %s!\n"
++msgstr "arp: syntaktická chyba na řádku %u databáze ethernetových adres %s!\n"
+
+-#: ../arp.c:416
++#: ../arp.c:427
+ #, c-format
+ msgid "arp: cannot set entry on line %u of etherfile %s !\n"
+ msgstr ""
+-"arp: poloku na dku %u databze ethernetovch adres %s nelze nastavit!\n"
++"arp: položku na řádku %u databáze ethernetových adres %s nelze nastavit!\n"
++
++#: ../arp.c:448
++#, c-format
++msgid ""
++"Address HWtype HWaddress Flags Mask "
++"Iface\n"
++msgstr ""
++"Adresa HWtyp HWadresa Příz. Maska "
++"Rozhr\n"
+
+-#: ../arp.c:437
+-msgid "Address\t\t\tHWtype\tHWaddress\t Flags Mask\t\t Iface\n"
+-msgstr "Adresa\t\t\t HWtyp\t HWadresa\t Pz Maska\t\t Rozhran\n"
++#: ../arp.c:476
++msgid "<from_interface>"
++msgstr "<z_rozhraní>"
+
+-#: ../arp.c:467
++#: ../arp.c:478
+ msgid "(incomplete)"
+-msgstr "(nekompletn)"
++msgstr "(nekompletní)"
+
+-#: ../arp.c:484
++#: ../arp.c:495
+ #, c-format
+ msgid "%s (%s) at "
+ msgstr "%s (%s) na "
+
+-#: ../arp.c:490
++#: ../arp.c:501
++#, c-format
+ msgid "<incomplete> "
+-msgstr "<nekompletn>"
++msgstr "<nekompletní>"
+
+-#: ../arp.c:496
++#: ../arp.c:507
+ #, c-format
+ msgid "netmask %s "
+-msgstr "sov maska %s "
++msgstr "síťová maska %s "
+
+-#: ../arp.c:513
++#: ../arp.c:524
+ #, c-format
+ msgid "on %s\n"
+ msgstr "na %s\n"
+
+-#: ../arp.c:592
++#: ../arp.c:605
+ #, c-format
+ msgid "Entries: %d\tSkipped: %d\tFound: %d\n"
+-msgstr "Poloky: %d\tVynechno: %d\tNalezeno: %d\n"
++msgstr "Položky: %d\tVynecháno: %d\tNalezeno: %d\n"
+
+-#: ../arp.c:596
++#: ../arp.c:609
+ #, c-format
+ msgid "%s (%s) -- no entry\n"
+-msgstr "%s (%s) -- dn poloka\n"
++msgstr "%s (%s) -- žádná položka\n"
+
+-#: ../arp.c:598
++#: ../arp.c:611
+ #, c-format
+ msgid "arp: in %d entries no match found.\n"
+-msgstr "arp: dn z poloek (%d) nevyhovuje.\n"
++msgstr "arp: žádná z položek (%d) nevyhovuje.\n"
+
+-#: ../arp.c:613
++#: ../arp.c:626
++#, c-format
+ msgid ""
+ "Usage:\n"
+ " arp [-vn] [<HW>] [-i <if>] [-a] [<hostname>] <-Display ARP "
+ "cache\n"
+ msgstr ""
+-"Pouit:\n"
+-" arp [-vn] [<HW>] [-i <if> [-a] [<pota>] <-Zobraz ARP "
++"Použití:\n"
++" arp [-vn] [<HW>] [-i <rozhraní>] [-a] [<počítač>] <-Zobrazí ARP "
+ "cache\n"
+
+-#: ../arp.c:614
++#: ../arp.c:627
++#, c-format
+ msgid ""
+-" arp [-v] [-i <if>] -d <hostname> [pub][nopub] <-Delete ARP "
++" arp [-v] [-i <if>] -d <host> [pub] <-Delete ARP "
+ "entry\n"
+ msgstr ""
+-" arp [-v] [-i <if>] -d <pota> [pub][nopub] <-Smae poloku "
++" arp [-v] [-i <rozhraní>] -d <počítač> [pub] <-Smaže položku "
+ "ARP\n"
+
+-#: ../arp.c:615
+-#, fuzzy
++#: ../arp.c:628
++#, c-format
+ msgid ""
+-" arp [-vnD] [<HW>] [-i <if>] -f [<filename>] <-Add entry from "
++" arp [-vnD] [<HW>] [-i <if>] -f [<filename>] <-Add entry from "
+ "file\n"
+ msgstr ""
+-" arp [-vnD] [<HW>] [-i <if>] -f <soubor> <-Pid poloku "
+-"ze\n"
+-" souboru\n"
++" arp [-vnD] [<HW>] [-i <rozhraní>] -f [<soubor>] <-Přidá položku ze "
++"souboru\n"
+
+-#: ../arp.c:616
++#: ../arp.c:629
++#, c-format
+ msgid ""
+-" arp [-v] [<HW>] [-i <if>] -s <hostname> <hwaddr> [temp][nopub] <-Add "
++" arp [-v] [<HW>] [-i <if>] -s <host> <hwaddr> [temp] <-Add "
+ "entry\n"
+ msgstr ""
+-" arp [-v] [<HW> [-i <if> -s <pota> <hwadr> [temp][nopub] <-Pid "
+-"poloku\n"
+-
+-#: ../arp.c:617
+-msgid ""
+-" arp [-v] [<HW>] [-i <if>] -s <hostname> <hwaddr> [netmask <nm>] pub "
+-"<-''-\n"
+-msgstr ""
+-" arp [-v] [<HW>] [-i <if>] -s <soubor> <hwadr> [smask <s>] <-''-\n"
++" arp [-v] [<HW>] [-i <rozhraní>] -s <počítač> <hwadr> [temp] <-Přidá "
++"položku\n"
+
+-#: ../arp.c:618
++#: ../arp.c:630
++#, c-format
+ msgid ""
+-" arp [-v] [<HW>] [-i <if>] -Ds <hostname> <if> [netmask <nm>] pub "
++" arp [-v] [<HW>] [-i <if>] -Ds <host> <if> [netmask <nm>] pub "
+ "<-''-\n"
+ "\n"
+ msgstr ""
+-" arp [-v] [<HW> [-i <if> -Ds <pota> <if> [smask <s>] pub "
+-"<-''-\n"
++" arp [-v] [<HW>] [-i <rozhraní>] -Ds <počítač> <rozhraní> [síťmask <čís>] "
++"pub\n"
++" <-Totéž\n"
+
+-#: ../arp.c:620
++#: ../arp.c:632
++#, c-format
+ msgid ""
+ " -a display (all) hosts in alternative (BSD) "
+ "style\n"
+ msgstr ""
+-" -a zobraz jmna vech pota alternativnm\n"
+-" (BSD) zpsobem\n"
++" -a zobrazí jména všech počítačů alternativním\n"
++" (BSD) způsobem\n"
+
+-#: ../arp.c:621
++#: ../arp.c:633
++#, c-format
+ msgid " -s, --set set a new ARP entry\n"
+-msgstr " -s, --set nastav novou ARP poloku\n"
++msgstr " -s, --set nastaví novou ARP položku\n"
+
+-#: ../arp.c:622
++#: ../arp.c:634
++#, c-format
+ msgid " -d, --delete delete a specified entry\n"
+-msgstr " -d, --delete smae zadanou ARP poloku\n"
++msgstr " -d, --delete smaže zadanou ARP položku\n"
+
+-#: ../arp.c:623 ../netstat.c:1436 ../route.c:85
++#: ../arp.c:635 ../netstat.c:1520 ../route.c:86
++#, c-format
+ msgid " -v, --verbose be verbose\n"
+ msgstr ""
+-" -v, --verbose bude vypisovat podrobn zprvy\n"
+-" o innosti\n"
++" -v, --verbose bude vypisovat podrobné zprávy o činnosti\n"
+
+-#: ../arp.c:624 ../netstat.c:1437 ../route.c:86
+-msgid " -n, --numeric dont resolve names\n"
+-msgstr ""
+-" -n, --numeric nebude pevdt seln adresy\n"
+-" na kanonick jmna\n"
++#: ../arp.c:636 ../netstat.c:1522 ../route.c:87
++#, c-format
++msgid " -n, --numeric don't resolve names\n"
++msgstr " -n, --numeric nebude převádět jména\n"
+
+-#: ../arp.c:625
++#: ../arp.c:637
++#, c-format
+ msgid ""
+ " -i, --device specify network interface (e.g. eth0)\n"
+-msgstr " -i, --device zadv sov rozhran (nap. eth0)\n"
++msgstr " -i, --device zadává síťové rozhraní (např. eth0)\n"
+
+-#: ../arp.c:626
++#: ../arp.c:638
++#, c-format
+ msgid " -D, --use-device read <hwaddr> from given device\n"
+-msgstr " -D, --use-device te <hwadr> ze zadanho zazen\n"
++msgstr " -D, --use-device čte <hwadr> ze zadaného zařízení\n"
+
+-#: ../arp.c:627
+-#, fuzzy
++#: ../arp.c:639
++#, c-format
+ msgid " -A, -p, --protocol specify protocol family\n"
+-msgstr " -r, --route vype smrovac tabulku\n"
++msgstr " -A, -p, --protocol určuje rodinu protokolů\n"
+
+-#: ../arp.c:628
+-#, fuzzy
++#: ../arp.c:640
++#, c-format
+ msgid ""
+-" -f, --file read new entries from file or from "
+-"/etc/ethers\n"
++" -f, --file read new entries from file or from /etc/"
++"ethers\n"
+ "\n"
+ msgstr ""
+-" -f, --file te nov poloky ze souboru\n"
+-"\n"
++" -f, --file čte nové položky ze souboru nebo z /etc/"
++"ethers\n"
+
+-#: ../arp.c:630 ../rarp.c:181
++#: ../arp.c:642 ../rarp.c:183
+ #, c-format
+ msgid " <HW>=Use '-H <hw>' to specify hardware address type. Default: %s\n"
+ msgstr ""
+-" <HW>=Pouijte '-H <hw> pro zadn hardwarovho typu adresy.\n"
+-" Implicitn: %s\n"
++" <HW>=Použijte '-H <hw> pro zadání hardwarového typu adresy.\n"
++" Implicitně: %s\n"
+
+-#: ../arp.c:631 ../rarp.c:182
++#: ../arp.c:643 ../rarp.c:184
++#, c-format
+ msgid " List of possible hardware types (which support ARP):\n"
+-msgstr " Seznam monch hardwarovch typ (podporujcch ARP):\n"
++msgstr " Seznam možných hardwarových typů (podporujících ARP):\n"
+
+-#: ../arp.c:664
++#: ../arp.c:677 ../arp.c:762
+ #, c-format
+ msgid "%s: hardware type not supported!\n"
+-msgstr "hardwarov typ %s nen podporovn!\n"
++msgstr "hardwarový typ %s není podporován!\n"
+
+-#: ../arp.c:668
++#: ../arp.c:681
+ #, c-format
+ msgid "%s: address family not supported!\n"
+-msgstr "tda adres %s nen podporovna!\n"
++msgstr "třída adres %s není podporována!\n"
+
+-#: ../arp.c:703
++#: ../arp.c:716
++#, c-format
+ msgid "arp: -N not yet supported.\n"
+-msgstr "arp: pepna -N nen zatm podporovn\n"
++msgstr "arp: přepínač -N není zatím podporován\n"
+
+-#: ../arp.c:713
++#: ../arp.c:726
+ #, c-format
+ msgid "arp: %s: unknown address family.\n"
+-msgstr "arp: neznm tda adres %s.\n"
++msgstr "arp: neznámá třída adres %s.\n"
+
+-#: ../arp.c:722
++#: ../arp.c:735
+ #, c-format
+ msgid "arp: %s: unknown hardware type.\n"
+-msgstr "arp: neznm hardwarov typ %s.\n"
++msgstr "arp: neznámý hardwarový typ %s.\n"
+
+-#: ../arp.c:741
++#: ../arp.c:754
+ #, c-format
+ msgid "arp: %s: kernel only supports 'inet'.\n"
+-msgstr "arp: %s: jdro podporuje pouze 'inet'.\n"
++msgstr "arp: %s: jádro podporuje pouze 'inet'.\n"
+
+-#: ../arp.c:746
++#: ../arp.c:767
+ #, c-format
+ msgid "arp: %s: hardware type without ARP support.\n"
+-msgstr "arp: hardwarov typ %s nepodporuje ARP.\n"
++msgstr "arp: hardwarový typ %s nepodporuje ARP.\n"
+
+-#: ../hostname.c:69
++#: ../hostname.c:71
+ #, c-format
+ msgid "Setting nodename to `%s'\n"
+-msgstr "Nastavuji jmno uzlu na `%s'\n"
++msgstr "Nastavuji jméno uzlu na `%s'\n"
+
+-#: ../hostname.c:74
++#: ../hostname.c:76
+ #, c-format
+ msgid "%s: you must be root to change the node name\n"
+-msgstr "%s: jmno uzlu me zmnit pouze superuivatel\n"
++msgstr "%s: jméno uzlu může změnit pouze superuživatel\n"
+
+-#: ../hostname.c:77 ../hostname.c:97 ../hostname.c:116
++#: ../hostname.c:79 ../hostname.c:100 ../hostname.c:118
+ #, c-format
+ msgid "%s: name too long\n"
+-msgstr "jmno %s je pli dlouh\n"
++msgstr "jméno %s je příliš dlouhé\n"
+
+-#: ../hostname.c:89
++#: ../hostname.c:92
+ #, c-format
+ msgid "Setting hostname to `%s'\n"
+-msgstr "Nastavuji jmno potae na `%s'\n"
++msgstr "Nastavuji jméno počítače na `%s'\n"
+
+-#: ../hostname.c:94
++#: ../hostname.c:97
+ #, c-format
+ msgid "%s: you must be root to change the host name\n"
+-msgstr "%s: jmno potae me zmnit pouze superuivatel\n"
++msgstr "%s: jméno počítače může změnit pouze superuživatel\n"
+
+-#: ../hostname.c:108
++#: ../hostname.c:110
+ #, c-format
+ msgid "Setting domainname to `%s'\n"
+-msgstr "Nastavuji jmno domny na `%s'\n"
++msgstr "Nastavuji jméno domény na `%s'\n"
+
+-#: ../hostname.c:113
++#: ../hostname.c:115
+ #, c-format
+ msgid "%s: you must be root to change the domain name\n"
+-msgstr "%s: jmno domny me zmnit pouze superuivatel\n"
++msgstr "%s: jméno domény může změnit pouze superuživatel\n"
+
+-#: ../hostname.c:131
++#: ../hostname.c:132
+ #, c-format
+ msgid "Resolving `%s' ...\n"
+-msgstr "Vyhledvm `%s' ...\n"
++msgstr "Vyhledávám `%s' ...\n"
+
+-#: ../hostname.c:137
++#: ../hostname.c:138
+ #, c-format
+ msgid "Result: h_name=`%s'\n"
+-msgstr "Vsledek: h_name=`%s'\n"
++msgstr "Výsledek: h_name=`%s'\n"
+
+-#: ../hostname.c:142
++#: ../hostname.c:143
+ #, c-format
+ msgid "Result: h_aliases=`%s'\n"
+-msgstr "Vsledek: h_aliases=`%s'\n"
++msgstr "Výsledek: h_aliases=`%s'\n"
+
+-#: ../hostname.c:147
++#: ../hostname.c:148
+ #, c-format
+ msgid "Result: h_addr_list=`%s'\n"
+-msgstr "Vsledek: h_addr_list=`%s'\n"
++msgstr "Výsledek: h_addr_list=`%s'\n"
+
+ #: ../hostname.c:209
+ #, c-format
+ msgid "%s: can't open `%s'\n"
+-msgstr "%s: `%s' nelze otevt\n"
++msgstr "%s: `%s' nelze otevřít\n"
+
+ #: ../hostname.c:223
++#, c-format
+ msgid "Usage: hostname [-v] {hostname|-F file} set hostname (from file)\n"
+ msgstr ""
+-"Pouit:\n"
+-" hostname [-v] {jmno|-F soubor} nastav jmno potae (ze "
++"Použití:\n"
++" hostname [-v] {jméno|-F soubor} nastaví jméno počítače (ze "
+ "souboru)\n"
+
+ #: ../hostname.c:224
++#, c-format
+ msgid ""
+ " domainname [-v] {nisdomain|-F file} set NIS domainname (from file)\n"
+ msgstr ""
+-" domainname [-v] {jmno|-F soubor} nastav jmno NIS domny (ze\n"
++" domainname [-v] {jméno|-F soubor} nastaví jméno NIS domény (ze\n"
+ " souboru)\n"
+
+ #: ../hostname.c:226
++#, c-format
+ msgid ""
+ " nodename [-v] {nodename|-F file} set DECnet node name (from "
+ "file)\n"
+ msgstr ""
+-" nodename [-v] {jmno|-F soubor} nastav jmno DECnet uzlu (ze\n"
++" nodename [-v] {jméno|-F soubor} nastaví jméno DECnet uzlu (ze\n"
+ " souboru)\n"
+
+ #: ../hostname.c:228
++#, c-format
+ msgid " hostname [-v] [-d|-f|-s|-a|-i|-y|-n] display formatted name\n"
+-msgstr " hostname [-v] [-d|-f|-s|-a|-i|-y|-n] vype formtovan jmno\n"
++msgstr " hostname [-v] [-d|-f|-s|-a|-i|-y|-n] vypíše formátované jméno\n"
+
+ #: ../hostname.c:229
++#, c-format
+ msgid ""
+ " hostname [-v] display hostname\n"
+ "\n"
+ msgstr ""
+-" hostname [-v] vype jmno potae\n"
++" hostname [-v] vypíše jméno počítače\n"
+ "\n"
+
+ #: ../hostname.c:230
++#, c-format
+ msgid ""
+ " hostname -V|--version|-h|--help print info and exit\n"
+ "\n"
+ msgstr ""
+-" hostname -V|--version|-h|--help vype informace a skon\n"
++" hostname -V|--version|-h|--help vypíše informace a skončí\n"
+ "\n"
+
+ #: ../hostname.c:231
++#, c-format
+ msgid ""
+ " dnsdomainname=hostname -d, {yp,nis,}domainname=hostname -y\n"
+ "\n"
+@@ -362,42 +388,51 @@ msgstr ""
+ "\n"
+
+ #: ../hostname.c:232
++#, c-format
+ msgid " -s, --short short host name\n"
+-msgstr " -s, --short krtk jmno potae\n"
++msgstr " -s, --short krátké jméno počítače\n"
+
+ #: ../hostname.c:233
++#, c-format
+ msgid " -a, --alias alias names\n"
+-msgstr " -a, --alias pezdvky\n"
++msgstr " -a, --alias přezdívky\n"
+
+ #: ../hostname.c:234
++#, c-format
+ msgid " -i, --ip-address addresses for the hostname\n"
+-msgstr " -i, --ip-address adresy odpovdajc jmnu potae\n"
++msgstr " -i, --ip-address adresy odpovídající jménu počítače\n"
+
+ #: ../hostname.c:235
++#, c-format
+ msgid " -f, --fqdn, --long long host name (FQDN)\n"
+-msgstr " -f, --fqdn, --long dlouh jmno potae (kanonick)\n"
++msgstr " -f, --fqdn, --long dlouhé jméno počítače (kanonické)\n"
+
+ #: ../hostname.c:236
++#, c-format
+ msgid " -d, --domain DNS domain name\n"
+-msgstr " -d, --domain jmno DNS domny\n"
++msgstr " -d, --domain jméno DNS domény\n"
+
+ #: ../hostname.c:237
++#, c-format
+ msgid " -y, --yp, --nis NIS/YP domainname\n"
+-msgstr " -y, --yp, --nis jmno NIS/YP domny\n"
++msgstr " -y, --yp, --nis jméno NIS/YP domény\n"
+
+ #: ../hostname.c:239
++#, c-format
+ msgid " -n, --node DECnet node name\n"
+-msgstr " -n, --node jmno DECnet uzlu\n"
++msgstr " -n, --node jméno DECnet uzlu\n"
+
+ #: ../hostname.c:241
++#, c-format
+ msgid ""
+ " -F, --file read hostname or NIS domainname from given file\n"
+ "\n"
+ msgstr ""
+-" -F, --file te jmno potae i nis domny ze souboru\n"
++" -F, --file čte jméno počítače či nis domény ze souboru\n"
+ "\n"
+
+ #: ../hostname.c:243
++#, c-format
+ msgid ""
+ " This command can read or set the hostname or the NIS domainname. You can\n"
+ " also read the DNS domain or the FQDN (fully qualified domain name).\n"
+@@ -405,931 +440,929 @@ msgid ""
+ " FQDN (Fully Qualified Domain Name) and the DNS domain name (which is\n"
+ " part of the FQDN) in the /etc/hosts file.\n"
+ msgstr ""
++" Tento příkaz může přečíst nebo nastavit název stroje nebo doménové jméno\n"
++" NIS. Načíst lze rovněž DNS doménu nebo FQDN (plně kvalifikované doménové\n"
++" jméno). Pokud pro vyhledávání strojů nepoužíváte bind nebo NIS, můžete\n"
++" změnit FQDN (Fully Qualified Domain Name) a doménové jméno DNS (což je\n"
++" část FQDN) v souboru /etc/hosts.\n"
+
+-#: ../hostname.c:338
++#: ../hostname.c:340
+ #, c-format
+ msgid "%s: You can't change the DNS domain name with this command\n"
+-msgstr "%s: Tmto pkazem nelze DNS jmno domny zmnit\n"
++msgstr "%s: Tímto příkazem nelze DNS jméno domény změnit\n"
+
+-#: ../hostname.c:339
++#: ../hostname.c:341
++#, c-format
+ msgid ""
+ "\n"
+ "Unless you are using bind or NIS for host lookups you can change the DNS\n"
+ msgstr ""
+ "\n"
+-"Pokud nepouvte bind i NIS pro vyhledvn jmen pota, pak mete "
+-"zmnit\n"
++"Pokud nepoužíváte bind či NIS pro vyhledávání jmen počítačů, pak můžete "
++"změnit\n"
+
+-#: ../hostname.c:340
++#: ../hostname.c:342
++#, c-format
+ msgid "domain name (which is part of the FQDN) in the /etc/hosts file.\n"
+ msgstr ""
+-"DNS jmno domny (je soust kanonickho jmna potae) v souboru\n"
++"DNS jméno domény (je součástí kanonického jména počítače) v souboru\n"
+ "/etc/hosts\n"
+
+-#: ../hostname.c:357
++#: ../hostname.c:359
+ #, c-format
+ msgid "gethostname()=`%s'\n"
+ msgstr "gethostname()=`%s'\n"
+
+-#: ../hostname.c:374
++#: ../hostname.c:376
+ #, c-format
+ msgid "getdomainname()=`%s'\n"
+ msgstr "getdomainname()=`%s'\n"
+
+-#: ../hostname.c:389
++#: ../hostname.c:391
+ #, c-format
+ msgid "getnodename()=`%s'\n"
+ msgstr "getnodename()=`%s'\n"
+
+-#: ../ifconfig.c:159
+-#, c-format
+-msgid "%-9.9s Link encap:%s "
+-msgstr "%-9.9s Zapouzden:%s "
+-
+-#: ../ifconfig.c:164
++#: ../ifconfig.c:107 ../netstat.c:1482
+ #, c-format
+-msgid "HWaddr %s "
+-msgstr "HWadr %s "
++msgid ""
++"Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR "
++"Flg\n"
++msgstr ""
++"Rozhr MTU Met PŘ-OK PŘ-CHYB PŘ-ZAH PŘ-PŘT OD-OK OD-CHYB OD-ZAH OD-PŘT "
++"Přízn\n"
+
+-#: ../ifconfig.c:167
++#: ../ifconfig.c:132 ../ifconfig.c:164
+ #, c-format
+-msgid "Media:%s"
+-msgstr "Mdium:%s"
++msgid "%s: ERROR while getting interface flags: %s\n"
++msgstr "%s: CHYBA při získávání příznaků rozhraní: %s\n"
+
+-#: ../ifconfig.c:169
+-msgid "(auto)"
+-msgstr "(auto)"
+-
+-#: ../ifconfig.c:176
++#: ../ifconfig.c:156 ../ifconfig.c:188 ../ifconfig.c:794 ../ifconfig.c:887
++#: ../ifconfig.c:1000
+ #, c-format
+-msgid " %s addr:%s "
+-msgstr " %s adr:%s "
++msgid "No support for INET on this system.\n"
++msgstr "Tento systém nepodporuje INET.\n"
+
+-#: ../ifconfig.c:179
++#: ../ifconfig.c:196
+ #, c-format
+-msgid " P-t-P:%s "
+-msgstr " P-t-P:%s "
++msgid "%s: ERROR while testing interface flags: %s\n"
++msgstr "%s: CHYBA při zkoušení příznaků rozhraní: %s\n"
+
+-# V ostatnch katalozch se pekld Broadcast -> vesmrov vysln.
+-# Tudi bcast -> Vesmr :)
+-#: ../ifconfig.c:182
++#: ../ifconfig.c:205
+ #, c-format
+-msgid " Bcast:%s "
+-msgstr " Vesmr:%s "
++msgid ""
++"Usage:\n"
++" ifconfig [-a] [-v] [-s] <interface> [[<AF>] <address>]\n"
++msgstr ""
++"Použití:\n"
++" ifconfig [-a] [-v] [-s] <rozhraní> [[<AF>] <adresa>]\n"
+
+-#: ../ifconfig.c:184
++#: ../ifconfig.c:207
+ #, c-format
+-msgid " Mask:%s\n"
+-msgstr "Maska:%s\n"
++msgid " [add <address>[/<prefixlen>]]\n"
++msgstr " [add <adresa>[/<délka prefixu>]]\n"
+
+-#: ../ifconfig.c:201
++#: ../ifconfig.c:208
+ #, c-format
+-msgid " inet6 addr: %s/%d"
+-msgstr " inet6-adr: %s/%d"
+-
+-#: ../ifconfig.c:203
+-msgid " Scope:"
+-msgstr " Rozsah:"
+-
+-#: ../ifconfig.c:206
+-msgid "Global"
+-msgstr "Globl"
++msgid " [del <address>[/<prefixlen>]]\n"
++msgstr " [del <adresa>[/<délka prefixu>]]\n"
+
+ #: ../ifconfig.c:209
+-msgid "Link"
+-msgstr "Linka"
+-
+-#: ../ifconfig.c:212
+-msgid "Site"
+-msgstr "Stanovit"
+-
+-#: ../ifconfig.c:215
+-msgid "Compat"
+-msgstr "Kompatibilita"
+-
+-#: ../ifconfig.c:218
+-msgid "Host"
+-msgstr "Pota"
+-
+-#: ../ifconfig.c:221
+-msgid "Unknown"
+-msgstr "Neznm."
+-
+-#: ../ifconfig.c:236
+-#, c-format
+-msgid " IPX/Ethernet II addr:%s\n"
+-msgstr " IPX/Ethernet II adr: %s\n"
+-
+-#: ../ifconfig.c:239
+ #, c-format
+-msgid " IPX/Ethernet SNAP addr:%s\n"
+-msgstr " IPX/Ethernet SNAP adr:%s\n"
+-
+-#: ../ifconfig.c:242
+-#, c-format
+-msgid " IPX/Ethernet 802.2 addr:%s\n"
+-msgstr " IPX/Ethernet 802.2 adr:%s\n"
++msgid " [[-]broadcast [<address>]] [[-]pointopoint [<address>]]\n"
++msgstr " [[-]broadcast [<adresa>]] [[-]pointopoint [<adresa>]]\n"
+
+-#: ../ifconfig.c:245
++#: ../ifconfig.c:210
+ #, c-format
+-msgid " IPX/Ethernet 802.3 addr:%s\n"
+-msgstr " IPX/Ethernet 802.3 adr:%s\n"
++msgid " [netmask <address>] [dstaddr <address>] [tunnel <address>]\n"
++msgstr " [netmask <adresa>] [dstaddr <adresa>] [tunnel <adresa>]\n"
+
+-#: ../ifconfig.c:255
++#: ../ifconfig.c:213
+ #, c-format
+-msgid " EtherTalk Phase 2 addr:%s\n"
+-msgstr " EtherTalk Phase 2 adr:%s\n"
++msgid " [outfill <NN>] [keepalive <NN>]\n"
++msgstr " [outfill <NN>] [keepalive <NN>]\n"
+
+-#: ../ifconfig.c:264
++#: ../ifconfig.c:215
+ #, c-format
+-msgid " econet addr:%s\n"
+-msgstr " econet adr:%s\n"
+-
+-# Hic sunt leones ...
+-#: ../ifconfig.c:270
+-msgid "[NO FLAGS] "
+-msgstr "[DN PZNAKY]"
+-
+-#: ../ifconfig.c:272
+-msgid "UP "
+-msgstr "AKTIVOVNO "
+-
+-#: ../ifconfig.c:274
+-msgid "BROADCAST "
+-msgstr "VESMROV_VYSLN "
+-
+-#: ../ifconfig.c:276
+-msgid "DEBUG "
+-msgstr "DEBUG "
+-
+-#: ../ifconfig.c:278
+-msgid "LOOPBACK "
+-msgstr "SMYKA "
+-
+-#: ../ifconfig.c:280
+-msgid "POINTOPOINT "
+-msgstr "POINTOPOINT "
+-
+-# ??
+-#: ../ifconfig.c:282
+-msgid "NOTRAILERS "
+-msgstr "NOTRAILERS "
+-
+-#: ../ifconfig.c:284
+-msgid "RUNNING "
+-msgstr "B̮ "
+-
+-#: ../ifconfig.c:286
+-msgid "NOARP "
+-msgstr "NEARP "
+-
+-#: ../ifconfig.c:288
+-msgid "PROMISC "
+-msgstr "PROMISK "
+-
+-#: ../ifconfig.c:290
+-msgid "ALLMULTI "
+-msgstr "ALLMULTI "
+-
+-#: ../ifconfig.c:292
+-msgid "SLAVE "
+-msgstr "SLAVE "
+-
+-#: ../ifconfig.c:294
+-msgid "MASTER "
+-msgstr "MASTER "
+-
+-#: ../ifconfig.c:296
+-msgid "MULTICAST "
+-msgstr "MULTICAST "
+-
+-#: ../ifconfig.c:299
+-msgid "DYNAMIC "
+-msgstr "DYNAMIC "
++msgid " [hw <HW> <address>] [metric <NN>] [mtu <NN>]\n"
++msgstr " [hw <HW> <adresa>] [metric <NN>] [mtu <NN>]\n"
+
+-#: ../ifconfig.c:302
++#: ../ifconfig.c:216
+ #, c-format
+-msgid " MTU:%d Metric:%d"
+-msgstr " MTU:%d Metrika:%d"
++msgid " [[-]trailers] [[-]arp] [[-]allmulti]\n"
++msgstr " [[-]trailers] [[-]arp] [[-]allmulti]\n"
+
+-#: ../ifconfig.c:306
++#: ../ifconfig.c:217
+ #, c-format
+-msgid " Outfill:%d Keepalive:%d"
+-msgstr " Outfill:%d Keepalive:%d"
++msgid " [multicast] [[-]promisc]\n"
++msgstr " [multicast] [[-]promisc]\n"
+
+-#: ../ifconfig.c:320
++#: ../ifconfig.c:218
+ #, c-format
+-msgid "RX packets:%lu errors:%lu dropped:%lu overruns:%lu frame:%lu\n"
+-msgstr "pijmutch paket:%lu chyb:%lu zahozeno:%lu peteen:%lu rmc:%lu\n"
++msgid " [mem_start <NN>] [io_addr <NN>] [irq <NN>] [media <type>]\n"
++msgstr " [mem_start <NN>] [io_addr <NN>] [irq <NN>] [media <typ>]\n"
+
+-#: ../ifconfig.c:325
++#: ../ifconfig.c:220
+ #, c-format
+-msgid " compressed:%lu\n"
+-msgstr " komprimovno:%lu\n"
++msgid " [txqueuelen <NN>]\n"
++msgstr " [txqueuelen délka]\n"
+
+-# carrier?
+-#: ../ifconfig.c:329
++#: ../ifconfig.c:223
+ #, c-format
+-msgid "TX packets:%lu errors:%lu dropped:%lu overruns:%lu carrier:%lu\n"
+-msgstr "odeslanch paket:%lu chyb:%lu zahozeno:%lu peteen:%lu penos:%lu\n"
++msgid " [[-]dynamic]\n"
++msgstr " [[-]dynamic]\n"
+
+-#: ../ifconfig.c:333
++#: ../ifconfig.c:225
+ #, c-format
+-msgid " collisions:%lu "
+-msgstr " koliz:%lu "
++msgid ""
++" [up|down] ...\n"
++"\n"
++msgstr ""
++" [up|down] ...\n"
++"\n"
+
+-#: ../ifconfig.c:335
++#: ../ifconfig.c:227
+ #, c-format
+-msgid "compressed:%lu "
+-msgstr "komprimovno:%lu "
++msgid " <HW>=Hardware Type.\n"
++msgstr " <HW> = Hardwarový Typ.\n"
+
+-#: ../ifconfig.c:337
++#: ../ifconfig.c:228
+ #, c-format
+-msgid "txqueuelen:%d "
+-msgstr "dlka odchoz fronty:%d "
++msgid " List of possible hardware types:\n"
++msgstr " Seznam možných hardwarových typů:\n"
+
+-#: ../ifconfig.c:345
++#. 1 = ARPable
++#: ../ifconfig.c:230
+ #, c-format
+-msgid "Interrupt:%d "
+-msgstr "Peruen:%d "
++msgid " <AF>=Address family. Default: %s\n"
++msgstr " <AF> = Třída adres. Implicitní: %s\n"
+
+-#. Only print devices using it for
+-#. I/O maps
+-#: ../ifconfig.c:348
++#: ../ifconfig.c:231
+ #, c-format
+-msgid "Base address:0x%x "
+-msgstr "Vstupn/Vstupn port:0x%x "
++msgid " List of possible address families:\n"
++msgstr " Seznam možných tříd adres:\n"
+
+-#: ../ifconfig.c:350
++#: ../ifconfig.c:307
+ #, c-format
+-msgid "Memory:%lx-%lx "
+-msgstr "Pam:%lx-%lx "
++msgid "ifconfig: option `%s' not recognised.\n"
++msgstr "ifconfig: přepínač „%s“ nebyl rozpoznán.\n"
+
+-#: ../ifconfig.c:353
++#: ../ifconfig.c:309 ../ifconfig.c:990
+ #, c-format
+-msgid "DMA chan:%x "
+-msgstr "Kanl DMA:%x "
++msgid "ifconfig: `--help' gives usage information.\n"
++msgstr "ifconfig: návod na použití lze získat pomocí „--help“\n"
+
+-#: ../ifconfig.c:384 ../ifconfig.c:405
++#: ../ifconfig.c:384
+ #, c-format
+-msgid "%s: unknown interface: %s\n"
+-msgstr "%s: rozhran %s nen znmo\n"
++msgid "Unknown media type.\n"
++msgstr "Neznámý typ média.\n"
+
+ #: ../ifconfig.c:421
++#, c-format
+ msgid ""
+-"Usage:\n"
+-" ifconfig [-a] [-i] [-v] <interface> [[<AF>] <address>]\n"
++"Warning: Interface %s still in promisc mode... maybe other application is "
++"running?\n"
+ msgstr ""
+-"Pouit:\n"
+-" ifconfig [-a] [-i] [-v] <rozhran> [[<AF>] <adresa>]\n"
+-
+-#: ../ifconfig.c:425
+-msgid " [add <address>[/<prefixlen>]]\n"
+-msgstr " [add <adresa>[/<dlka prefixu>]]\n"
+-
+-#: ../ifconfig.c:427
+-msgid " [del <address>[/<prefixlen>]]\n"
+-msgstr " [del <adresa>[/<dlka prefixu>]]\n"
+-
+-#: ../ifconfig.c:432
+-msgid " [[-]broadcast [<address>]] [[-]pointopoint [<address>]]\n"
+-msgstr " [[-]broadcast [<adresa>]] [[-]pointopoint [<adresa>]]\n"
++"Pozor: Rozhraní %s je stále v promiskuitním režimu. Neběží jiná aplikace?\n"
+
+ #: ../ifconfig.c:433
+-msgid " [netmask <address>] [dstaddr <address>] [tunnel <address>]\n"
+-msgstr " [netmask <adresa>] [dstaddr <adresa>] [tunnel <adresa>]\n"
+-
+-#: ../ifconfig.c:436
+-msgid " [outfill <NN>] [keepalive <NN>]\n"
+-msgstr " [outfill <NN>] [keepalive <NN>]\n"
++#, c-format
++msgid "Warning: Interface %s still in MULTICAST mode.\n"
++msgstr "Pozor: Rozhraní %s je stále v režimu MULTICAST.\n"
+
+-#: ../ifconfig.c:438
+-msgid " [hw <HW> <address>] [metric <NN>] [mtu <NN>]\n"
+-msgstr " [hw <HW> <adresa>] [metric <NN>] [mtu <NN>]\n"
++#: ../ifconfig.c:445
++#, c-format
++msgid "Warning: Interface %s still in ALLMULTI mode.\n"
++msgstr "Pozor: Rozhraní %s je stále v režimu ALLMULTI.\n"
+
+-#: ../ifconfig.c:439
+-msgid " [[-]trailers] [[-]arp] [[-]allmulti]\n"
+-msgstr " [[-]trailers] [[-]arp] [[-]allmulti]\n"
++#: ../ifconfig.c:469
++#, c-format
++msgid "Warning: Interface %s still in DYNAMIC mode.\n"
++msgstr "Pozor: Rozhraní %s je stále v režimu DYNAMIC.\n"
+
+-#: ../ifconfig.c:440
+-msgid " [multicast] [[-]promisc]\n"
+-msgstr " [multicast] [[-]promisc]\n"
++#: ../ifconfig.c:527
++#, c-format
++msgid "Warning: Interface %s still in BROADCAST mode.\n"
++msgstr "Pozor: Rozhraní %s je stále v režimu VŠESMĚR.\n"
+
+-#: ../ifconfig.c:441
+-msgid " [mem_start <NN>] [io_addr <NN>] [irq <NN>] [media <type>]\n"
+-msgstr " [mem_start <NN>] [io_addr <NN>] [irq <NN>] [media <typ>]\n"
++#: ../ifconfig.c:538
++#, c-format
++msgid "ifconfig: Error resolving '%s' for broadcast\n"
++msgstr "ifconfig: Chyba při překládání „%s“ pro všesměr\n"
+
+-#: ../ifconfig.c:443
+-msgid " [txqueuelen <NN>]\n"
+-msgstr " [txqueuelen dlka]\n"
++#: ../ifconfig.c:563
++#, c-format
++msgid "ifconfig: Error resolving '%s' for dstaddr\n"
++msgstr "ifconfig: Chyba při překládání „%s“ pro adresu cíle\n"
+
+-#: ../ifconfig.c:446
+-msgid " [[-]dynamic]\n"
+-msgstr " [[-]dynamic]\n"
++#: ../ifconfig.c:586
++#, c-format
++msgid "ifconfig: Error resolving '%s' for netmask\n"
++msgstr "ifconfig: Chyba při překládání „%s“ pro masku sítě\n"
+
+-#: ../ifconfig.c:448
+-msgid ""
+-" [up|down] ...\n"
+-"\n"
+-msgstr ""
+-" [up|down] ...\n"
+-"\n"
++#: ../ifconfig.c:665
++#, c-format
++msgid "Warning: Interface %s still in POINTOPOINT mode.\n"
++msgstr "Pozor: Rozhraní %s je stále v DVOUBODOVÉM režimu.\n"
+
+-#: ../ifconfig.c:450
+-msgid " <HW>=Hardware Type.\n"
+-msgstr " <HW>=Hardwarov Typ.\n"
++#: ../ifconfig.c:676
++#, c-format
++msgid "ifconfig: Error resolving '%s' for pointopoint\n"
++msgstr "ifconfig: Chyba při překládání „%s“ pro dvoubodové nastavení\n"
+
+-#: ../ifconfig.c:451
+-msgid " List of possible hardware types:\n"
+-msgstr " Seznam monch hardwarovch typ:\n"
++#: ../ifconfig.c:700
++#, c-format
++msgid "hw address type `%s' has no handler to set address. failed.\n"
++msgstr ""
++"Pro typ hardwarové adresy „%s“ neexistuje obsluha na nastavování adresy.\n"
++"Operace selhala.\n"
+
+-#. 1 = ARPable
+-#: ../ifconfig.c:453
++#: ../ifconfig.c:709
+ #, c-format
+-msgid " <AF>=Address family. Default: %s\n"
+-msgstr " <AF>=tda adres. Implicitn: %s\n"
++msgid "%s: invalid %s address.\n"
++msgstr "%s: adresa %s je nesprávná.\n"
+
+-#: ../ifconfig.c:454
+-msgid " List of possible address families:\n"
+-msgstr " Seznam monch td adres:\n"
++#: ../ifconfig.c:749
++#, c-format
++msgid "ifconfig: Error resolving '%s' for add\n"
++msgstr "ifconfig: Chyba při překládání „%s“ pro adresu\n"
+
+-#: ../ifconfig.c:593
+-msgid "Unknown media type.\n"
+-msgstr "Neznm typ mdia.\n"
++#: ../ifconfig.c:760 ../ifconfig.c:850 ../ifconfig.c:938
++#, c-format
++msgid "No support for INET6 on this system.\n"
++msgstr "Tento systém nepodporuje INET6.\n"
+
+-#: ../ifconfig.c:881
++#: ../ifconfig.c:803 ../ifconfig.c:896
+ #, c-format
+-msgid "%s: invalid %s address.\n"
+-msgstr "%s: adresa %s je nesprvn.\n"
++msgid "Interface %s not initialized\n"
++msgstr "Rozhraní %s není inicializováno\n"
+
+-#: ../ifconfig.c:920 ../ifconfig.c:963 ../ifconfig.c:1011
+-msgid "No support for INET6 on this system.\n"
+-msgstr "Tento systm nepodporuje INET6.\n"
++#: ../ifconfig.c:815 ../ifconfig.c:907
++#, c-format
++msgid "Bad address.\n"
++msgstr "Chybná adresa.\n"
+
+-#: ../ifconfig.c:983
++#: ../ifconfig.c:910
++#, c-format
+ msgid "Address deletion not supported on this system.\n"
+-msgstr "Tento systm nepodporuje mazn adres.\n"
++msgstr "Tento systém nepodporuje mazání adres.\n"
+
+-#: ../ifconfig.c:1066
+-msgid "No support for INET on this system.\n"
+-msgstr "Tento systm nepodporuje INET.\n"
++#: ../ifconfig.c:982
++#, c-format
++msgid "ifconfig: Cannot set address for this protocol family.\n"
++msgstr "ifconfig: Pro tuto rodinu protokolů nelze nastavit adresu.\n"
++
++#: ../ifconfig.c:989
++#, c-format
++msgid "ifconfig: error resolving '%s' to set address for af=%s\n"
++msgstr "ifconfig: chyba při překládání „%s“ za účelem nastavení adresy AF=%s\n"
+
+-#: ../ifconfig.c:1076
++#: ../ifconfig.c:1010
++#, c-format
+ msgid "No support for ECONET on this system.\n"
+-msgstr "Tento systm nepodporuje ECONET.\n"
++msgstr "Tento systém nepodporuje ECONET.\n"
+
+-#: ../ifconfig.c:1084
++#: ../ifconfig.c:1018
+ #, c-format
+ msgid "Don't know how to set addresses for family %d.\n"
+-msgstr "Nevm, jak nastavit adresu tdy %d.\n"
++msgstr "Nevím, jak nastavit adresu třídy %d.\n"
++
++#: ../ifconfig.c:1053
++#, c-format
++msgid "WARNING: at least one error occured. (%d)\n"
++msgstr "POZOR: Vyskytla se alespoň jedna chyba. (%d)\n"
+
+-#: ../netstat.c:383
++#: ../netstat.c:434
+ #, c-format
+ msgid ""
+ "(No info could be read for \"-p\": geteuid()=%d but you should be root.)\n"
+ msgstr ""
+-"(Pro \"-p\" nelze zskat dn informace: geteuid()=%d, ale je teba, aby "
++"(Pro \"-p\" nelze získat žádné informace: geteuid()=%d, ale je třeba, aby "
+ "jste\n"
+-"byl superuivatelem)\n"
++"byl superuživatelem)\n"
+
+-#: ../netstat.c:387
++#: ../netstat.c:438
++#, c-format
+ msgid ""
+ "(Not all processes could be identified, non-owned process info\n"
+ " will not be shown, you would have to be root to see it all.)\n"
+ msgstr ""
+-"(Vechny procesy nemohly bt identifikovny. Budou vypsany informace\n"
+-"pouze o procesech, jich jste vlastnkem. Aby jste mohl vidt ve, musel\n"
+-"byste bt superuivatelem.)\n"
++"(Všechny procesy nemohly být identifikovány. Budou vypsány informace\n"
++"pouze o procesech, jichž jste vlastníkem. Aby jste mohl vidět vše, musel\n"
++"byste být superuživatelem.)\n"
+
+-#: ../netstat.c:394 ../netstat.c:1089 ../netstat.c:1166
++#: ../netstat.c:445 ../netstat.c:1186 ../netstat.c:1264
+ msgid "LISTENING"
+-msgstr "NASLOUCH"
++msgstr "NASLOUCHÁ"
+
+-#: ../netstat.c:395
++#: ../netstat.c:446
+ msgid "CONN SENT"
+-msgstr "CONN ODESLN"
++msgstr "CONN ODESLÁN"
+
+-#: ../netstat.c:396 ../netstat.c:1168
++#: ../netstat.c:447 ../netstat.c:1266
+ msgid "DISC SENT"
+-msgstr "DISC ODESLN"
++msgstr "DISC ODESLÁN"
+
+-#: ../netstat.c:397 ../netstat.c:464 ../netstat.c:809 ../netstat.c:1169
++#: ../netstat.c:448 ../netstat.c:515 ../netstat.c:898 ../netstat.c:1267
+ msgid "ESTABLISHED"
+ msgstr "SPOJENO"
+
+-#: ../netstat.c:419
++#: ../netstat.c:470
++#, c-format
+ msgid "Active NET/ROM sockets\n"
+-msgstr "Aktivn NET/ROM sokety\n"
++msgstr "Aktivní NET/ROM sokety\n"
+
+-#: ../netstat.c:420
++#: ../netstat.c:471
++#, c-format
+ msgid ""
+-"User Dest Source Device State Vr/Vs Send-Q "
+-"Recv-Q\n"
++"User Dest Source Device State Vr/Vs Send-Q Recv-"
++"Q\n"
+ msgstr ""
+-"Uivatel Cl Zdroj Zazen Stav Vr/Vs Odch-F "
+-"Pch-F\n"
++"Uživatel Cíl Zdroj Zařízení Stav Vr/Vs Odch-F Přích-"
++"F\n"
+
+-#: ../netstat.c:430 ../netstat.c:1208
++#: ../netstat.c:481 ../netstat.c:1306
+ #, c-format
+ msgid "Problem reading data from %s\n"
+-msgstr "Chyba pi ten dat z %s\n"
++msgstr "Chyba při čtení dat z %s\n"
+
+-# nsledujc radji ponechat v originle ?!
+-#: ../netstat.c:465
++# následující raději ponechat v originále ?!
++#: ../netstat.c:516
+ msgid "SYN_SENT"
+ msgstr "SYN_SENT"
+
+-#: ../netstat.c:466
++#: ../netstat.c:517
+ msgid "SYN_RECV"
+ msgstr "SYN_RECV"
+
+-#: ../netstat.c:467
++#: ../netstat.c:518
+ msgid "FIN_WAIT1"
+ msgstr "FIN_WAIT1"
+
+-#: ../netstat.c:468
++#: ../netstat.c:519
+ msgid "FIN_WAIT2"
+ msgstr "FIN_WAIT2"
+
+-#: ../netstat.c:469
++#: ../netstat.c:520
+ msgid "TIME_WAIT"
+ msgstr "TIME_WAIT"
+
+-#: ../netstat.c:470
++#: ../netstat.c:521
+ msgid "CLOSE"
+-msgstr "ZAVEN"
++msgstr "ZAVŘEN"
+
+-#: ../netstat.c:471
++#: ../netstat.c:522
+ msgid "CLOSE_WAIT"
+ msgstr "CLOSE_WAIT"
+
+-#: ../netstat.c:472
++#: ../netstat.c:523
+ msgid "LAST_ACK"
+-msgstr "POSLEDN ACK"
++msgstr "POSLEDNÍ ACK"
+
+-#: ../netstat.c:473
++#: ../netstat.c:524
+ msgid "LISTEN"
+-msgstr "LISTEN"
++msgstr "NASLOUCHÁ"
+
+-#: ../netstat.c:474
++#: ../netstat.c:525
+ msgid "CLOSING"
+-msgstr "ZAVR"
++msgstr "ZAVíRÁ"
+
+-#: ../netstat.c:544
++#: ../netstat.c:596
+ #, c-format
+ msgid "warning, got bogus igmp6 line %d.\n"
+-msgstr "varovn, nesmysln igmp6 dek %d.\n"
++msgstr "varování, nesmyslný igmp6 řádek %d.\n"
+
+-#: ../netstat.c:549 ../netstat.c:587 ../netstat.c:670 ../netstat.c:803
+-#: ../netstat.c:935 ../netstat.c:940
++#: ../netstat.c:601 ../netstat.c:639 ../netstat.c:763 ../netstat.c:892
++#: ../netstat.c:1029 ../netstat.c:1034
+ #, c-format
+ msgid "netstat: unsupported address family %d !\n"
+-msgstr "netstat: tda adres %d nen podporovna !\n"
++msgstr "netstat: třída adres %d není podporována !\n"
+
+-#: ../netstat.c:562 ../netstat.c:567 ../netstat.c:575 ../netstat.c:582
++#: ../netstat.c:614 ../netstat.c:619 ../netstat.c:627 ../netstat.c:634
+ #, c-format
+ msgid "warning, got bogus igmp line %d.\n"
+-msgstr "varovn, nesmysln igmp dek %d.\n"
++msgstr "varování, nesmyslný igmp řádek %d.\n"
++
++#: ../netstat.c:677
++#, c-format
++msgid "Active X.25 sockets\n"
++msgstr "Aktivní X.25 sokety\n"
++
++#. IMHO, Vr/Vs is not very usefull --SF
++#: ../netstat.c:679
++#, c-format
++msgid ""
++"Dest Source Device LCI State Vr/Vs Send-Q Recv-"
++"Q\n"
++msgstr ""
++"Cíl Zdroj Zaříz LCI Stav Vr/Vs Odhod-F Přích-"
++"F\n"
+
+-#: ../netstat.c:666
++#: ../netstat.c:759
++#, c-format
+ msgid "warning, got bogus tcp line.\n"
+-msgstr "varovn, nesmysln tcp dek.\n"
++msgstr "varování, nesmyslný tcp řádek.\n"
+
+-#: ../netstat.c:704 ../netstat.c:855 ../netstat.c:975
++#: ../netstat.c:798 ../netstat.c:947 ../netstat.c:1072
+ #, c-format
+ msgid "off (0.00/%ld/%d)"
+ msgstr "vyp (0.00/%ld/%d)"
+
+-#: ../netstat.c:708
+-#, fuzzy, c-format
++#: ../netstat.c:802
++#, c-format
+ msgid "on (%2.2f/%ld/%d)"
+-msgstr "zap%d (%2.2f/%ld/%d)"
++msgstr "zapnut (%2.2f/%ld/%d)"
+
+-#: ../netstat.c:713
+-#, fuzzy, c-format
++#: ../netstat.c:807
++#, c-format
+ msgid "keepalive (%2.2f/%ld/%d)"
+-msgstr "zap%d (%2.2f/%ld/%d)"
++msgstr "keepalive (%2.2f/%ld/%d)"
+
+-#: ../netstat.c:718
+-#, fuzzy, c-format
++#: ../netstat.c:812
++#, c-format
+ msgid "timewait (%2.2f/%ld/%d)"
+-msgstr "zap%d (%2.2f/%ld/%d)"
++msgstr "timewait (%2.2f/%ld/%d)"
+
+-#: ../netstat.c:723 ../netstat.c:864 ../netstat.c:985
++#: ../netstat.c:817 ../netstat.c:956 ../netstat.c:1082
+ #, c-format
+ msgid "unkn-%d (%2.2f/%ld/%d)"
+ msgstr "nezn-%d (%2.2f/%ld/%d)"
+
+-#: ../netstat.c:799
++#: ../netstat.c:888
++#, c-format
+ msgid "warning, got bogus udp line.\n"
+-msgstr "varovn, nesmysln udp dek.\n"
++msgstr "varování, nesmyslný udp řádek.\n"
+
+-#: ../netstat.c:817 ../netstat.c:1075 ../netstat.c:1108
++#: ../netstat.c:906 ../netstat.c:1172 ../netstat.c:1205
+ msgid "UNKNOWN"
+-msgstr "NEZNM"
++msgstr "NEZNÁM"
+
+-#: ../netstat.c:860 ../netstat.c:980
++#: ../netstat.c:952 ../netstat.c:1077
+ #, c-format
+ msgid "on%d (%2.2f/%ld/%d)"
+ msgstr "zap%d (%2.2f/%ld/%d)"
+
+-#: ../netstat.c:949
++#: ../netstat.c:1043
++#, c-format
+ msgid "warning, got bogus raw line.\n"
+-msgstr "varovn, nesmysln 'raw' dek.\n"
++msgstr "varování, nesmyslný 'raw' řádek.\n"
+
+-#: ../netstat.c:1028
++#: ../netstat.c:1125
++#, c-format
+ msgid "warning, got bogus unix line.\n"
+-msgstr "varovn, netstat 'unix' dek.\n"
++msgstr "varování, netstat 'unix' řádek.\n"
+
+-#: ../netstat.c:1055
++#: ../netstat.c:1152
+ msgid "STREAM"
+ msgstr "STREAM"
+
+-#: ../netstat.c:1059
++#: ../netstat.c:1156
+ msgid "DGRAM"
+ msgstr "DGRAM"
+
+-#: ../netstat.c:1063
++#: ../netstat.c:1160
+ msgid "RAW"
+ msgstr "RAW"
+
+-#: ../netstat.c:1067
++#: ../netstat.c:1164
+ msgid "RDM"
+ msgstr "RDM"
+
+-#: ../netstat.c:1071
++#: ../netstat.c:1168
+ msgid "SEQPACKET"
+ msgstr "SEQPACKET"
+
+-#: ../netstat.c:1080
++#: ../netstat.c:1177
+ msgid "FREE"
+-msgstr "NEALOKOVN"
++msgstr "NEALOKOVÁN"
+
+-#: ../netstat.c:1096
++#: ../netstat.c:1193
+ msgid "CONNECTING"
+ msgstr "SPOJUJE"
+
+-#: ../netstat.c:1100
++#: ../netstat.c:1197
+ msgid "CONNECTED"
+ msgstr "SPOJEN"
+
+-#: ../netstat.c:1104
++#: ../netstat.c:1201
+ msgid "DISCONNECTING"
+ msgstr "ODPOJUJE"
+
+-#: ../netstat.c:1135
++#: ../netstat.c:1233
++#, c-format
+ msgid "Active UNIX domain sockets "
+-msgstr "Aktivn sokety domny UNIX "
++msgstr "Aktivní sokety domény UNIX "
+
+-#: ../netstat.c:1137 ../netstat.c:1666
++#: ../netstat.c:1235 ../netstat.c:1801
++#, c-format
+ msgid "(servers and established)"
+-msgstr "(servery a navzan spojen)"
++msgstr "(servery a navázaná spojení)"
+
+-#: ../netstat.c:1140 ../netstat.c:1669
++#: ../netstat.c:1238 ../netstat.c:1804
++#, c-format
+ msgid "(only servers)"
+ msgstr "(pouze servery)"
+
+-#: ../netstat.c:1142 ../netstat.c:1671
++#: ../netstat.c:1240 ../netstat.c:1806
++#, c-format
+ msgid "(w/o servers)"
+ msgstr "(w/o servery)"
+
+-#: ../netstat.c:1145
++#: ../netstat.c:1243
++#, c-format
+ msgid ""
+ "\n"
+-"Proto RefCnt Flags Type State I-Node"
++"Proto RefCnt Flags Type State I-Node "
+ msgstr ""
+ "\n"
+-"Proto ta Pznaky Typ Stav I-Uzel"
++"Proto Čítač Příznaky Typ Stav I-Uzel "
+
+-#: ../netstat.c:1147
++#: ../netstat.c:1245
++#, c-format
+ msgid " Path\n"
+ msgstr " Cesta\n"
+
+-#: ../netstat.c:1167
++#: ../netstat.c:1265
+ msgid "SABM SENT"
+-msgstr "SABM ODESLN"
++msgstr "SABM ODESLÁN"
+
+-#: ../netstat.c:1170
++#: ../netstat.c:1268
+ msgid "RECOVERY"
+ msgstr "OBNOVA"
+
+-#: ../netstat.c:1184
++#: ../netstat.c:1282
++#, c-format
+ msgid "Active AX.25 sockets\n"
+-msgstr "Aktivn AX.25 sokety\n"
++msgstr "Aktivní AX.25 sokety\n"
+
+-#: ../netstat.c:1185
++#: ../netstat.c:1283
++#, c-format
+ msgid "Dest Source Device State Vr/Vs Send-Q Recv-Q\n"
+-msgstr "Cl Zdroj Zaz Stav Vr/Vs Odhod-F Pch-F\n"
++msgstr "Cíl Zdroj Zaříz Stav Vr/Vs Odhod-F Přích-F\n"
+
+-#: ../netstat.c:1228
++#: ../netstat.c:1326
+ #, c-format
+ msgid "problem reading data from %s\n"
+-msgstr "chyba pi ten dat z %s\n"
++msgstr "chyba při čtení dat z %s\n"
+
+-#: ../netstat.c:1279
++#: ../netstat.c:1396
++#, c-format
+ msgid ""
+ "Active IPX sockets\n"
+ "Proto Recv-Q Send-Q Local Address Foreign Address "
+ "State"
+ msgstr ""
+-"Aktivn IPX sokety\n"
+-"Proto Pch-F Odch-F Lokl adresa Vzdlen adresa "
+-" Stav"
++"Aktivní IPX sokety\n"
++"Proto Přích-F Odch-F Lokál adresa Vzdálená "
++"adresa Stav"
+
+-#: ../netstat.c:1281
++#: ../netstat.c:1398
++#, c-format
+ msgid " User"
+-msgstr " Uivatel"
++msgstr " Uživatel"
+
+-#: ../netstat.c:1315
++#: ../netstat.c:1432
+ msgid "ESTAB"
+ msgstr "SPOJEN"
+
+-#: ../netstat.c:1323
++#: ../netstat.c:1440
+ msgid "UNK."
+ msgstr "NEZ."
+
+-#: ../netstat.c:1367
+-msgid " - no statistics available -"
+-msgstr " - statistick data nejsou dostupn -"
+-
+-#: ../netstat.c:1370
+-msgid "[NO FLAGS]"
+-msgstr "[DN PZNAKY]"
+-
+-#: ../netstat.c:1400
++#: ../netstat.c:1478
++#, c-format
+ msgid "Kernel Interface table\n"
+-msgstr "Tabulka rozhran v jdru\n"
++msgstr "Tabulka rozhraní v jádru\n"
+
+-#: ../netstat.c:1401
+-msgid ""
+-"Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR "
+-"Flg\n"
+-msgstr ""
+-"Rozhr MTU Met P-OK P-CHYB P-ZAH P-PT OD-OK OD-CHYB OD-ZAH OD-PT "
+-"PZ\n"
+-
+-#: ../netstat.c:1404
++#: ../netstat.c:1486
+ msgid "missing interface information"
+-msgstr "chyb informace o rozhran"
++msgstr "chybí informace o rozhraní"
+
+-#: ../netstat.c:1425
++#: ../netstat.c:1509
++#, c-format
+ msgid ""
+-"usage: netstat [-veenNcCF] [<Af>] -r netstat "
+-"{-V|--version|-h|--help}\n"
++"usage: netstat [-vWeenNcCF] [<Af>] -r netstat {-V|--version|-h|--"
++"help}\n"
+ msgstr ""
+-"Pouit: netstat [--veenNcCF] [<TA>] -r netstat "
+-"{-V|--version|-h|--help}\n"
++"Použití: netstat [-vWeenNcCF] [<AF>] -r netstat {-V|--version|-h|--"
++"help}\n"
+
+-#: ../netstat.c:1426
+-msgid " netstat [-vnNcaeol] [<Socket> ...]\n"
+-msgstr " netstat [-vnNcaeol] [<Soket> ...]\n"
++#: ../netstat.c:1510
++#, c-format
++msgid " netstat [-vWnNcaeol] [<Socket> ...]\n"
++msgstr " netstat [-vWnNcaeol] [<Socket>…]\n"
+
+-#: ../netstat.c:1427
++#: ../netstat.c:1511
++#, c-format
+ msgid ""
+-" netstat { [-veenNac] -i | [-cnNe] -M | -s }\n"
++" netstat { [-vWeenNac] -i | [-cnNe] -M | -s [-6tuw] }\n"
+ "\n"
+ msgstr ""
+-" netstat { [-veenNac] -i | [-cnNe] -M | -s }\n"
++" netstat { [-vWeenNac] -i | [-cnNe] -M | -s [-6tuw] }\n"
+ "\n"
+
+-#: ../netstat.c:1429
++#: ../netstat.c:1513
++#, c-format
+ msgid " -r, --route display routing table\n"
+-msgstr " -r, --route vype smrovac tabulku\n"
++msgstr " -r, --route vypíše směrovací tabulku\n"
+
+-#: ../netstat.c:1430
++#: ../netstat.c:1514
++#, c-format
+ msgid " -i, --interfaces display interface table\n"
+-msgstr " -i, --interfaces vype tabulku rozhran\n"
++msgstr " -i, --interfaces vypíše tabulku rozhraní\n"
+
+-#: ../netstat.c:1431
++#: ../netstat.c:1515
++#, c-format
+ msgid " -g, --groups display multicast group memberships\n"
+ msgstr ""
+-" -g, --groups vype lenstv v multicast skupinch\n"
++" -g, --groups vypíše členství v multicast skupinách\n"
+
+-#: ../netstat.c:1432
++#: ../netstat.c:1516
++#, c-format
+ msgid ""
+ " -s, --statistics display networking statistics (like SNMP)\n"
+ msgstr ""
+-" -s, --statistics vype statistiku sov aktivity (jako "
++" -s, --statistics vypíše statistiku síťové aktivity (jako "
+ "SNMP)\n"
+
+-#: ../netstat.c:1434
++#: ../netstat.c:1518
++#, c-format
+ msgid ""
+ " -M, --masquerade display masqueraded connections\n"
+ "\n"
+ msgstr ""
+-" -M, --masquerade vype maskovan spojen\n"
++" -M, --masquerade vypíše maskovaná spojení\n"
+ "\n"
+
+-#: ../netstat.c:1438 ../route.c:87
++#: ../netstat.c:1521
++#, c-format
++msgid " -W, --wide don't truncate IP addresses\n"
++msgstr " -W, --wide nezkracuje IP adresy\n"
++
++#: ../netstat.c:1523
++#, c-format
++msgid " --numeric-hosts don't resolve host names\n"
++msgstr " --numeric-hosts nepřekládá názvy strojů\n"
++
++#: ../netstat.c:1524
++#, c-format
++msgid " --numeric-ports don't resolve port names\n"
++msgstr " --numeric-ports nepřekládá názvy portů\n"
++
++#: ../netstat.c:1525
++#, c-format
++msgid " --numeric-users don't resolve user names\n"
++msgstr " --numeric-users nepřekládá uživatelské jména\n"
++
++#: ../netstat.c:1526
++#, c-format
+ msgid " -N, --symbolic resolve hardware names\n"
+-msgstr " -N, --symbolic pevede hw jmna\n"
++msgstr " -N, --symbolic převede hw jména\n"
+
+-#: ../netstat.c:1439 ../route.c:88
++#: ../netstat.c:1527 ../route.c:88
++#, c-format
+ msgid " -e, --extend display other/more information\n"
+-msgstr " -e, --extend vype podrobnj informace\n"
++msgstr " -e, --extend vypíše podrobnější informace\n"
+
+-#: ../netstat.c:1440
++#: ../netstat.c:1528
++#, c-format
+ msgid " -p, --programs display PID/Program name for sockets\n"
+ msgstr ""
+-" -p, --programs vype PID/jmno programu pro sokety\n"
++" -p, --programs vypíše PID/jméno programu pro sokety\n"
+
+-#: ../netstat.c:1441
++#: ../netstat.c:1529
++#, c-format
+ msgid ""
+ " -c, --continuous continuous listing\n"
+ "\n"
+ msgstr ""
+-" -c, --continuous neperuovan vpis\n"
++" -c, --continuous nepřerušovaný výpis\n"
+ "\n"
+
+-#: ../netstat.c:1442
++#: ../netstat.c:1530
++#, c-format
+ msgid " -l, --listening display listening server sockets\n"
+ msgstr ""
+-" -l, --listening vype sokety, na nich je naslouchno\n"
++" -l, --listening vypíše sokety, na nichž je nasloucháno\n"
+
+-#: ../netstat.c:1443
++#: ../netstat.c:1531
++#, c-format
+ msgid ""
+ " -a, --all, --listening display all sockets (default: connected)\n"
+ msgstr ""
+-" -a, --all, --listening vype vechny sokety (implicitn: "
+-"spojen)\n"
++" -a, --all, --listening vypíše všechny sokety (implicitně: "
++"spojené)\n"
+
+-#: ../netstat.c:1444
++#: ../netstat.c:1532
++#, c-format
+ msgid " -o, --timers display timers\n"
+-msgstr " -o, --timers zobraz asovae\n"
++msgstr " -o, --timers zobrazí časovače\n"
+
+-#: ../netstat.c:1445 ../route.c:89
++#: ../netstat.c:1533 ../route.c:89
++#, c-format
+ msgid ""
+ " -F, --fib display Forwarding Information Base "
+ "(default)\n"
+ msgstr ""
+-" -F, --fib zobraz Forwarding Infomation Base\n"
+-" (implicitn)\n"
++" -F, --fib zobrazí Forwarding Information Base\n"
++" (implicitní)\n"
+
+-#: ../netstat.c:1446 ../route.c:90
++#: ../netstat.c:1534 ../route.c:90
++#, c-format
+ msgid ""
+ " -C, --cache display routing cache instead of FIB\n"
+ "\n"
+-msgstr " -C, --cache msto FIB zobraz smrovac cache\n"
++msgstr " -C, --cache místo FIB zobrazí směrovací cache\n"
+
+-#: ../netstat.c:1448
++#: ../netstat.c:1536
++#, c-format
+ msgid ""
+-" <Socket>={-t|--tcp} {-u|--udp} {-w|--raw} {-x|--unix} --ax25 --ipx "
+-"--netrom\n"
++" <Socket>={-t|--tcp} {-u|--udp} {-U|--udplite} {-w|--raw} {-x|--unix} --"
++"ax25 --ipx --netrom\n"
+ msgstr ""
+-" <Soket>={-t|--tcp} {-u|--udp} {-w|--raw} {-x|--unix} --ax25 --ipx "
+-"--netrom\n"
++" <Socket>={-t|--tcp} {-u|--udp} {-U|--udplite} {-w|--raw} {-x|--unix} --"
++"ax25 --ipx --netrom\n"
+
+-#: ../netstat.c:1449 ../route.c:92
++#: ../netstat.c:1537
+ #, c-format
+-msgid " <AF>=Use '-A <af>' or '--<af>' Default: %s\n"
+-msgstr " <AF>=Pouijte '-A <af>' or '--<af>' Implicitn: %s\n"
++msgid " <AF>=Use '-6|-4' or '-A <af>' or '--<af>'; default: %s\n"
++msgstr " <AF>=Použijte „-6|-4“ nebo „-A <af>“ nebo „--<af>“. Implicitní: %s\n"
+
+-#: ../netstat.c:1450 ../route.c:93
++#: ../netstat.c:1538 ../route.c:93
++#, c-format
+ msgid " List of possible address families (which support routing):\n"
+-msgstr " Seznam monch td adres (podporujcch smrovn):\n"
++msgstr " Seznam možných tříd adres (podporujících směrování):\n"
++
++#: ../netstat.c:1756
++#, c-format
++msgid "netstat: No statistics support for specified address family: %s\n"
++msgstr "netstat: Pro zadanou rodinu adres není podporována statistika: %s\n"
+
+-#: ../netstat.c:1663
++#: ../netstat.c:1798
++#, c-format
+ msgid "Active Internet connections "
+-msgstr "Aktivn Internetov spojen "
++msgstr "Aktivní Internetová spojení "
+
+-#: ../netstat.c:1673
++#: ../netstat.c:1808
++#, c-format
+ msgid ""
+ "\n"
+-"Proto Recv-Q Send-Q Local Address Foreign Address State "
+-" "
++"Proto Recv-Q Send-Q Local Address Foreign Address "
++"State "
+ msgstr ""
+ "\n"
+-"Proto Pch-F Odch-F Mstn Adresa Vzdlen Adresa Stav "
++"Proto Přích-F Odch-F Místní Adresa Vzdálená Adresa Stav "
+
+-#: ../netstat.c:1675
++#: ../netstat.c:1810
++#, c-format
+ msgid " User Inode "
+-msgstr " Uivatel I-uzel "
++msgstr " Uživatel I-uzel "
+
+-#: ../netstat.c:1678
++#: ../netstat.c:1813
++#, c-format
+ msgid " Timer"
+-msgstr " asova"
++msgstr " Časovač"
+
+-#: ../netstat.c:1708
++#: ../netstat.c:1851
++#, c-format
+ msgid "IPv4 Group Memberships\n"
+-msgstr "lenstv v IPv4 skupinch\n"
++msgstr "Členství v IPv4 skupinách\n"
+
+-#: ../netstat.c:1709
++#: ../netstat.c:1852
++#, c-format
+ msgid "Interface RefCnt Group\n"
+-msgstr "Rozhran ta Skupina\n"
++msgstr "Rozhraní Čítač Skupina\n"
+
+-#: ../rarp.c:43
++#: ../rarp.c:45
+ msgid "This kernel does not support RARP.\n"
+-msgstr "Toto jdro nepodporuje RARP.\n"
++msgstr "Toto jádro nepodporuje RARP.\n"
+
+-#: ../rarp.c:82
++#: ../rarp.c:84
+ #, c-format
+ msgid "no RARP entry for %s.\n"
+-msgstr "pro %s neexistuje RARP poloka.\n"
++msgstr "pro %s neexistuje RARP položka.\n"
+
+-#: ../rarp.c:95
++#: ../rarp.c:97
+ #, c-format
+ msgid "%s: bad hardware address\n"
+-msgstr "hardwarov adresa %s je nesprvn\n"
++msgstr "hardwarová adresa %s je nesprávná\n"
+
+-#: ../rarp.c:127
++#: ../rarp.c:129
+ #, c-format
+ msgid "rarp: cannot open file %s:%s.\n"
+-msgstr "rarp: soubor %s:%s nelze otevt.\n"
++msgstr "rarp: soubor %s:%s nelze otevřít.\n"
+
+-#: ../rarp.c:139
++#: ../rarp.c:141
+ #, c-format
+ msgid "rarp: format error at %s:%u\n"
+-msgstr "rarp: syntaktick chyba na dku %2$u souboru %1$s\n"
++msgstr "rarp: syntaktická chyba na řádku %2$u souboru %1$s\n"
+
+-#: ../rarp.c:143 ../rarp.c:287
++#: ../rarp.c:145 ../rarp.c:290
+ #, c-format
+ msgid "rarp: %s: unknown host\n"
+-msgstr "rarp: pota %s nen znm\n"
++msgstr "rarp: počítač %s není znám\n"
+
+-#: ../rarp.c:146
++#: ../rarp.c:148
+ #, c-format
+ msgid "rarp: cannot set entry from %s:%u\n"
+-msgstr "rarp: nelze nastavit poloku z dku %2$u souboru %1$s\n"
++msgstr "rarp: nelze nastavit položku z řádku %2$u souboru %1$s\n"
+
+-#: ../rarp.c:175
++#: ../rarp.c:177
++#, c-format
+ msgid "Usage: rarp -a list entries in cache.\n"
+-msgstr "Pouit: rarp -a vype poloky z cache.\n"
++msgstr "Použití: rarp -a vypíše položky z cache.\n"
+
+-#: ../rarp.c:176
++#: ../rarp.c:178
++#, c-format
+ msgid " rarp -d <hostname> delete entry from cache.\n"
+-msgstr " rarp -d <jmno> smae poloku z cache.\n"
++msgstr " rarp -d <jméno> smaže položku z cache.\n"
+
+-#: ../rarp.c:177
++#: ../rarp.c:179
++#, c-format
+ msgid " rarp [<HW>] -s <hostname> <hwaddr> add entry to cache.\n"
+ msgstr ""
+-" rarp [<HW>] -s <jmno> <hwadr> pid poloku do cache.\n"
++" rarp [<HW>] -s <jméno> <hwadr> přidá položku do cache.\n"
+
+-#: ../rarp.c:178
++#: ../rarp.c:180
++#, c-format
+ msgid ""
+ " rarp -f add entries from /etc/ethers.\n"
+ msgstr ""
+-" rarp -f pid poloky z /etc/ethers.\n"
++" rarp -f přidá položky z /etc/ethers.\n"
+
+-#: ../rarp.c:179
++#: ../rarp.c:181
++#, c-format
+ msgid ""
+ " rarp -V display program version.\n"
+ "\n"
+ msgstr ""
+-" rarp -V vype oznaen verze "
++" rarp -V vypíše označení verze "
+ "programu.\n"
+ "\n"
+
+-#: ../rarp.c:236
++#: ../rarp.c:239
+ #, c-format
+ msgid "%s: illegal option mix.\n"
+-msgstr "Kombinace pepna %s je nesprvn.\n"
++msgstr "Kombinace přepínačů %s je nesprávná.\n"
+
+-#: ../rarp.c:267
++#: ../rarp.c:270
+ #, c-format
+ msgid "rarp: %s: unknown hardware type.\n"
+-msgstr "rarp: hardwarov typ %s nen znm.\n"
++msgstr "rarp: hardwarový typ %s není znám.\n"
+
+-#: ../route.c:79
++#: ../route.c:80
++#, c-format
+ msgid ""
+ "Usage: route [-nNvee] [-FC] [<AF>] List kernel routing tables\n"
+ msgstr ""
+-"Pouit: route [-nNvee] [-FC] [<AF>] Zobraz smrovac tabulky v "
+-"jdru\n"
++"Použití: route [-nNvee] [-FC] [<AF>] Zobrazí směrovací tabulky v "
++"jádru\n"
+
+-#: ../route.c:80
++#: ../route.c:81
++#, c-format
+ msgid ""
+ " route [-v] [-FC] {add|del|flush} ... Modify routing table for AF.\n"
+ "\n"
+ msgstr ""
+-" route [-v] [-FC] {add|del|flush} ... Zmn smrovac tabulku pro "
++" route [-v] [-FC] {add|del|flush} ... Změní směrovací tabulku pro "
+ "AF.\n"
+ "\n"
+
+-#: ../route.c:82
++#: ../route.c:83
++#, c-format
+ msgid ""
+ " route {-h|--help} [<AF>] Detailed usage syntax for "
+ "specified AF.\n"
+ msgstr ""
+-" route {-h|--help [<AF>] Npovda pro pouit s AF.\n"
++" route {-h|--help [<AF>] Nápověda pro použití s AF.\n"
+
+-#: ../route.c:83
++#: ../route.c:84
++#, c-format
+ msgid ""
+ " route {-V|--version} Display version/author and "
+ "exit.\n"
+ "\n"
+ msgstr ""
+-" route {-V|--version} Vype oznaen verze a autora\n"
++" route {-V|--version} Vypíše označení verze a autora\n"
+ " programu.\n"
+
++#: ../route.c:92
++#, c-format
++msgid " <AF>=Use '-A <af>' or '--<af>'; default: %s\n"
++msgstr " <AF>=Použijte „-A <af>“ nebo „--<af>“. Implicitní: %s\n"
++
+ #: ../plipconfig.c:66
++#, c-format
+ msgid "Usage: plipconfig [-a] [-i] [-v] interface\n"
+-msgstr "Pouit: plipconfig [-a] [-i] [-v] rozhran\n"
++msgstr "Použití: plipconfig [-a] [-i] [-v] rozhraní\n"
+
+ #: ../plipconfig.c:67
++#, c-format
+ msgid " [nibble NN] [trigger NN]\n"
+ msgstr " [nibble NN] [trigger NN]\n"
+
+ #: ../plipconfig.c:68
++#, c-format
+ msgid " plipconfig -V | --version\n"
+ msgstr " plipconfig -V | --version\n"
+
+@@ -1338,25 +1371,30 @@ msgstr " plipconfig -V | --version\n"
+ msgid "%s\tnibble %lu trigger %lu\n"
+ msgstr "%s\tnibble %lu trigger %lu\n"
+
+-#: ../iptunnel.c:79
++#: ../iptunnel.c:85
++#, c-format
+ msgid "Usage: iptunnel { add | change | del | show } [ NAME ]\n"
+-msgstr "Pouit: iptunnel { add | change | del | show } [ JMNO ]\n"
++msgstr "Použití: iptunnel { add | change | del | show } [ JMÉNO ]\n"
+
+-#: ../iptunnel.c:80
++#: ../iptunnel.c:86
++#, c-format
+ msgid ""
+ " [ mode { ipip | gre | sit } ] [ remote ADDR ] [ local ADDR ]\n"
+ msgstr ""
+-" [ mode { ipip | gre | sit } ] [ vzdlen ADR ] [ mstn ADR ]\n"
++" [ mode { ipip | gre | sit } ] [ vzdálená ADR ] [ místní ADR ]\n"
+
+-#: ../iptunnel.c:81
++#: ../iptunnel.c:87
++#, c-format
+ msgid " [ [i|o]seq ] [ [i|o]key KEY ] [ [i|o]csum ]\n"
+-msgstr " [ [i|o]seq ] [ [i|o]key KL ] [ [i|o]csum ]\n"
++msgstr " [ [i|o]seq ] [ [i|o]key KLÍČ ] [ [i|o]csum ]\n"
+
+-#: ../iptunnel.c:82
++#: ../iptunnel.c:88
++#, c-format
+ msgid " [ ttl TTL ] [ tos TOS ] [ nopmtudisc ] [ dev PHYS_DEV ]\n"
+-msgstr " [ ttl TTL ] [ tos TOS ] [ nopmtudisc ] [ dev ZAZEN ]\n"
++msgstr " [ ttl TTL ] [ tos TOS ] [ nopmtudisc ] [ dev ZAŘÍZENÍ ]\n"
+
+-#: ../iptunnel.c:83
++#: ../iptunnel.c:89
++#, c-format
+ msgid ""
+ " iptunnel -V | --version\n"
+ "\n"
+@@ -1364,1068 +1402,1781 @@ msgstr ""
+ " iptunnel -V | --version\n"
+ "\n"
+
+-#: ../iptunnel.c:84
++#: ../iptunnel.c:90
++#, c-format
+ msgid "Where: NAME := STRING\n"
+-msgstr "Kde: JMNO := ETZEC\n"
++msgstr "Kde: JMÉNO := ŘETĚZEC\n"
+
+-#: ../iptunnel.c:85
++#: ../iptunnel.c:91
++#, c-format
+ msgid " ADDR := { IP_ADDRESS | any }\n"
+ msgstr " ADR := { IP-ADRESA | any }\n"
+
+-#: ../iptunnel.c:86
++#: ../iptunnel.c:92
++#, c-format
+ msgid " TOS := { NUMBER | inherit }\n"
+-msgstr " TOS := { SLO | inherit }\n"
++msgstr " TOS := { ČÍSLO | inherit }\n"
+
+-#: ../iptunnel.c:87
++#: ../iptunnel.c:93
++#, c-format
+ msgid " TTL := { 1..255 | inherit }\n"
+ msgstr " TTL := { 1..255 | inherit }\n"
+
+-#: ../iptunnel.c:88
++#: ../iptunnel.c:94
++#, c-format
+ msgid " KEY := { DOTTED_QUAD | NUMBER }\n"
+-msgstr " KL := { DOTTED_QUAD | SLO }\n"
++msgstr " KLÍČ := { DOTTED_QUAD | ČÍSLO }\n"
+
+-#: ../iptunnel.c:326
++#: ../iptunnel.c:332
++#, c-format
+ msgid "Keys are not allowed with ipip and sit.\n"
+-msgstr "S ipip a sit nejsou kle povoleny.\n"
++msgstr "S ipip a sit nejsou klíče povoleny.\n"
+
+-#: ../iptunnel.c:346
++#: ../iptunnel.c:352
++#, c-format
+ msgid "Broadcast tunnel requires a source address.\n"
+-msgstr "Tunel se vesmrovm vyslnm vyaduje zdrojovou adresu.\n"
++msgstr "Tunel se všesměrovým vysíláním vyžaduje zdrojovou adresu.\n"
+
+-#: ../iptunnel.c:361
++#: ../iptunnel.c:367
++#, c-format
+ msgid "ttl != 0 and noptmudisc are incompatible\n"
+-msgstr "ttl != 0 a noptmudisc se navzjem vyluuj\n"
++msgstr "ttl != 0 a noptmudisc se navzájem vylučují\n"
+
+-#: ../iptunnel.c:373
++#: ../iptunnel.c:379
++#, c-format
+ msgid "cannot determine tunnel mode (ipip, gre or sit)\n"
+-msgstr "reim tunelu (ipip, gre i sit) nelze zjistit\n"
++msgstr "režim tunelu (ipip, gre či sit) nelze zjistit\n"
+
+-#: ../iptunnel.c:411
++#: ../iptunnel.c:417
+ #, c-format
+ msgid "%s: %s/ip remote %s local %s "
+-msgstr "%s: %s/ip vzdlen %s mstn %s "
++msgstr "%s: %s/ip vzdálený %s místní %s "
+
+-#: ../iptunnel.c:415
++#: ../iptunnel.c:421
+ msgid "unknown"
+-msgstr "Neznm."
++msgstr "Neznám."
+
+-#: ../iptunnel.c:447
++#: ../iptunnel.c:453
++#, c-format
+ msgid " Drop packets out of sequence.\n"
+-msgstr " Zahazuje pakety mimo poad.\n"
++msgstr " Zahazuje pakety mimo pořadí.\n"
+
+-#: ../iptunnel.c:449
++#: ../iptunnel.c:455
++#, c-format
+ msgid " Checksum in received packet is required.\n"
+-msgstr " Pijman pakety mus mt kontroln souet.\n"
++msgstr " Přijímané pakety musí mít kontrolní součet.\n"
+
+ # ???
+-#: ../iptunnel.c:451
++#: ../iptunnel.c:457
++#, c-format
+ msgid " Sequence packets on output.\n"
+-msgstr " ad odchoz pakety.\n"
++msgstr " Řadí odchozí pakety.\n"
+
+-#: ../iptunnel.c:453
++#: ../iptunnel.c:459
++#, c-format
+ msgid " Checksum output packets.\n"
+-msgstr " Odchoz pakety budou mt kontroln souet.\n"
++msgstr " Odchozí pakety budou mít kontrolní součet.\n"
+
+-#: ../iptunnel.c:481
++#: ../iptunnel.c:487
++#, c-format
+ msgid "Wrong format of /proc/net/dev. Sorry.\n"
+-msgstr "Lituji, formt /proc/net/dev je chybn.\n"
++msgstr "Lituji, formát /proc/net/dev je chybný.\n"
+
+-#: ../iptunnel.c:494
++#: ../iptunnel.c:500
+ #, c-format
+ msgid "Failed to get type of [%s]\n"
+-msgstr "Typ [%s] se nepodailo zjistit.\n"
++msgstr "Typ [%s] se nepodařilo zjistit.\n"
+
+-#: ../iptunnel.c:510
++#: ../iptunnel.c:516
++#, c-format
+ msgid "RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n"
+-msgstr "RX: Pakety Bajty Chyby CsumChyb MimoPo Mcasts\n"
++msgstr "RX: Pakety Bajty Chyby CsumChyb MimoPoř Mcasts\n"
+
+-#: ../iptunnel.c:513
++#: ../iptunnel.c:519
++#, c-format
+ msgid "TX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n"
+ msgstr "TX: Pakety Bajty Chyby DeadLoop NoRoute NoBufs\n"
+
+-#: ../statistics.c:45
++#: ../statistics.c:48
+ msgid "ICMP input histogram:"
+-msgstr "histogram ICMP vstupu:"
++msgstr "Histogram ICMP vstupu:"
+
+-#: ../statistics.c:46
++#: ../statistics.c:49
+ msgid "ICMP output histogram:"
+-msgstr "histogram ICMP vstupu:"
++msgstr "Histogram ICMP výstupu:"
++
++#: ../statistics.c:66
++#, c-format
++msgid "Forwarding is %s"
++msgstr "Předávání je %s"
++
++#: ../statistics.c:67
++#, c-format
++msgid "Default TTL is %u"
++msgstr "Implicitní TTL je %u"
++
++#: ../statistics.c:68 ../statistics.c:89
++#, c-format
++msgid "%u total packets received"
++msgstr "Celkem přijatých paketů: %u"
++
++#: ../statistics.c:69 ../statistics.c:90
++#, c-format
++msgid "%u with invalid headers"
++msgstr "S nesprávnými hlavičkami: %u"
++
++#: ../statistics.c:70 ../statistics.c:93
++#, c-format
++msgid "%u with invalid addresses"
++msgstr "S nesprávnými adresami: %u"
++
++#: ../statistics.c:71 ../statistics.c:98
++#, c-format
++msgid "%u forwarded"
++msgstr "Přeposláno: %u"
++
++#: ../statistics.c:72 ../statistics.c:94
++#, c-format
++msgid "%u with unknown protocol"
++msgstr "S neznámým protokolem: %u"
++
++#: ../statistics.c:73 ../statistics.c:96
++#, c-format
++msgid "%u incoming packets discarded"
++msgstr "Počet zahozených příchozích paketů: %u"
++
++#: ../statistics.c:74 ../statistics.c:97
++#, c-format
++msgid "%u incoming packets delivered"
++msgstr "Počet doručených příchozích paketů: %u"
++
++#: ../statistics.c:75 ../statistics.c:99
++#, c-format
++msgid "%u requests sent out"
++msgstr "Počet požadavků na odeslání: %u"
++
++#. ?
++#: ../statistics.c:76 ../statistics.c:100
++#, c-format
++msgid "%u outgoing packets dropped"
++msgstr "Počet zahozených odchozích paketů: %u"
++
++#: ../statistics.c:77 ../statistics.c:101
++#, c-format
++msgid "%u dropped because of missing route"
++msgstr "Zahozeno kvůli chybějící cestě: %u"
++
++#: ../statistics.c:78 ../statistics.c:102
++#, c-format
++msgid "%u fragments dropped after timeout"
++msgstr "Počet fragmentů zahozených po vypršení času: %u"
++
++#: ../statistics.c:79 ../statistics.c:103
++#, c-format
++msgid "%u reassemblies required"
++msgstr "Počet nutných znovusestavení: %u"
++
++#. ?
++#: ../statistics.c:80 ../statistics.c:104
++#, c-format
++msgid "%u packets reassembled ok"
++msgstr "Počet v pořádku znovu sestavených paketů: %u"
++
++#: ../statistics.c:81 ../statistics.c:105
++#, c-format
++msgid "%u packet reassembles failed"
++msgstr "Počet paketů, jež se nepodařilo znovu sestavit: %u"
++
++#: ../statistics.c:82 ../statistics.c:106
++#, c-format
++msgid "%u fragments received ok"
++msgstr "Počet v pořádku přijatých fragmentů: %u"
++
++#: ../statistics.c:83 ../statistics.c:107
++#, c-format
++msgid "%u fragments failed"
++msgstr "Počet chybných fragmentů: %u"
++
++#: ../statistics.c:84 ../statistics.c:108
++#, c-format
++msgid "%u fragments created"
++msgstr "Počet vytvořených fragmentů: %u"
++
++#: ../statistics.c:91
++#, c-format
++msgid "%u with packets too big"
++msgstr "Počet příliš velkých packetů: %u"
++
++#: ../statistics.c:92
++#, c-format
++msgid "%u incoming packets with no route"
++msgstr "Počet příchozích paketů bez odpovídající cesty: %u"
++
++#: ../statistics.c:95
++#, c-format
++msgid "%u with truncated packets"
++msgstr "Počet zkrácených packetů: %u"
++
++#: ../statistics.c:109
++#, c-format
++msgid "%u incoming multicast packets"
++msgstr "Počet příchozích multicastových paketů: %u"
++
++#: ../statistics.c:110
++#, c-format
++msgid "%u outgoing multicast packets"
++msgstr "Počet odchozích multicastových paketů: %u"
++
++#: ../statistics.c:115 ../statistics.c:145
++#, c-format
++msgid "%u ICMP messages received"
++msgstr "Počet přijatých ICMP zpráv: %u"
++
++#: ../statistics.c:116 ../statistics.c:146
++#, c-format
++msgid "%u input ICMP message failed."
++msgstr "Počet chybných příchozích ICMP zpráv: %u"
++
++#: ../statistics.c:117 ../statistics.c:130 ../statistics.c:147
++#: ../statistics.c:162
++#, c-format
++msgid "destination unreachable: %u"
++msgstr "Adresát nedostupný: %u"
++
++#: ../statistics.c:118
++#, c-format
++msgid "timeout in transit: %u"
++msgstr "Vypršel čas při přenosu: %u"
++
++#: ../statistics.c:119 ../statistics.c:132
++#, c-format
++msgid "wrong parameters: %u"
++msgstr "Chybné parametry: %u"
++
++#. ?
++#: ../statistics.c:120
++#, c-format
++msgid "source quenches: %u"
++msgstr "Zahlcení zdroje: %u"
++
++#: ../statistics.c:121 ../statistics.c:160 ../statistics.c:175
++#, c-format
++msgid "redirects: %u"
++msgstr "Počet přesměrování: %u"
++
++#: ../statistics.c:122 ../statistics.c:151 ../statistics.c:166
++#, c-format
++msgid "echo requests: %u"
++msgstr "Žádost o echo: %u"
++
++#: ../statistics.c:123 ../statistics.c:136 ../statistics.c:152
++#: ../statistics.c:167
++#, c-format
++msgid "echo replies: %u"
++msgstr "Odpověď na žádost o echo: %u"
++
++#: ../statistics.c:124
++#, c-format
++msgid "timestamp request: %u"
++msgstr "Žádost o čas: %u"
++
++#: ../statistics.c:125
++#, c-format
++msgid "timestamp reply: %u"
++msgstr "Odpověď na žádost o čas: %u"
++
++#: ../statistics.c:126
++#, c-format
++msgid "address mask request: %u"
++msgstr "Žádost o masku podsítě: %u"
++
++#. ?
++#: ../statistics.c:127 ../statistics.c:140
++#, c-format
++msgid "address mask replies: %u"
++msgstr "Odpověď na žádost o masku podsítě: %u"
++
++#. ?
++#: ../statistics.c:128 ../statistics.c:161
++#, c-format
++msgid "%u ICMP messages sent"
++msgstr "Počet odeslaných ICMP zpráv: %u"
++
++#: ../statistics.c:129
++#, c-format
++msgid "%u ICMP messages failed"
++msgstr "Počet chybných ICMP zpráv: %u"
++
++#: ../statistics.c:131
++#, c-format
++msgid "time exceeded: %u"
++msgstr "Vypršení životnosti: %u"
++
++#. ?
++#: ../statistics.c:133
++#, c-format
++msgid "source quench: %u"
++msgstr "Zahlcení zdroje: %u"
++
++#: ../statistics.c:134
++#, c-format
++msgid "redirect: %u"
++msgstr "Počet přesměrování: %u"
++
++#: ../statistics.c:135
++#, c-format
++msgid "echo request: %u"
++msgstr "Žádost o echo: %u"
++
++#: ../statistics.c:137
++#, c-format
++msgid "timestamp requests: %u"
++msgstr "žádost o čas: %u"
++
++#: ../statistics.c:138
++#, c-format
++msgid "timestamp replies: %u"
++msgstr "Odpověď na žádost o čas: %u"
++
++#: ../statistics.c:139
++#, c-format
++msgid "address mask requests: %u"
++msgstr "Žádost o masku podsítě: %u"
++
++#: ../statistics.c:148 ../statistics.c:163
++#, c-format
++msgid "packets too big: %u"
++msgstr "Příliš velkých packetů: %u"
++
++#: ../statistics.c:149
++#, c-format
++msgid "received ICMPv6 time exceeded: %u"
++msgstr "Přijato ICMPv6 vypršení životnosti: %u"
++
++#: ../statistics.c:150 ../statistics.c:165
++#, c-format
++msgid "parameter problem: %u"
++msgstr "Problém s parametrem: %u"
++
++#: ../statistics.c:153 ../statistics.c:168
++#, c-format
++msgid "group member queries: %u"
++msgstr "Dotazů na členství ve skupině: %u"
++
++#: ../statistics.c:154 ../statistics.c:169
++#, c-format
++msgid "group member responses: %u"
++msgstr "Odpovědí na členství ve skupině: %u"
++
++#: ../statistics.c:155 ../statistics.c:170
++#, c-format
++msgid "group member reductions: %u"
++msgstr "Počet snížení členů skupiny: %u"
++
++#: ../statistics.c:156 ../statistics.c:171
++#, c-format
++msgid "router solicits: %u"
++msgstr "Počet výzev směrovači: %u"
++
++#: ../statistics.c:157 ../statistics.c:172
++#, c-format
++msgid "router advertisement: %u"
++msgstr "Počet oznámení směrovače: %u"
++
++#: ../statistics.c:158
++#, c-format
++msgid "neighbour solicits: %u"
++msgstr "Počet výzev sousedovi: %u"
++
++#: ../statistics.c:159
++#, c-format
++msgid "neighbour advertisement: %u"
++msgstr "Počet oznámení souseda: %u"
++
++#: ../statistics.c:164
++#, c-format
++msgid "sent ICMPv6 time exceeded: %u"
++msgstr "Počet odeslaných ICMPv6 vypršení životnosti: %u"
++
++#: ../statistics.c:173
++#, c-format
++msgid "neighbor solicits: %u"
++msgstr "Počet výzev sousedovi: %u"
++
++#: ../statistics.c:174
++#, c-format
++msgid "neighbor advertisements: %u"
++msgstr "Počet oznámení souseda: %u"
++
++#: ../statistics.c:180
++#, c-format
++msgid "RTO algorithm is %s"
++msgstr "RTO algoritmus je %s"
++
++#: ../statistics.c:184
++#, c-format
++msgid "%u active connections openings"
++msgstr "Počet aktivně navázaných spojení: %u"
++
++#: ../statistics.c:185
++#, c-format
++msgid "%u passive connection openings"
++msgstr "Počet pasivně navázaných spojení: %u"
++
++#: ../statistics.c:186
++#, c-format
++msgid "%u failed connection attempts"
++msgstr "Počet neúspěšných pokusů o spojení: %u"
++
++#: ../statistics.c:187
++#, c-format
++msgid "%u connection resets received"
++msgstr "Počet přijatých resetů spojení: %u"
++
++#: ../statistics.c:188
++#, c-format
++msgid "%u connections established"
++msgstr "Počet navázaných spojení: %u"
++
++#: ../statistics.c:189
++#, c-format
++msgid "%u segments received"
++msgstr "Počet přijatých segmentů: %u"
++
++#: ../statistics.c:190
++#, c-format
++msgid "%u segments send out"
++msgstr "Počet odeslaných segmentů: %u"
++
++#: ../statistics.c:191
++#, c-format
++msgid "%u segments retransmited"
++msgstr "Počet přenesených segmentů: %u"
++
++#: ../statistics.c:192
++#, c-format
++msgid "%u bad segments received."
++msgstr "Počet chybných příchozích segmentů: %u"
++
++#: ../statistics.c:193
++#, c-format
++msgid "%u resets sent"
++msgstr "Počet odeslaných resetů: %u"
++
++#: ../statistics.c:198 ../statistics.c:206
++#, c-format
++msgid "%u packets received"
++msgstr "Počet přijatých paketů: %u"
++
++#: ../statistics.c:199 ../statistics.c:207
++#, c-format
++msgid "%u packets to unknown port received."
++msgstr "Počet paketů přijatých pro neznámý port: %u"
++
++#: ../statistics.c:200 ../statistics.c:208
++#, c-format
++msgid "%u packet receive errors"
++msgstr "Počet chyb při příjmu paketů: %u"
++
++#: ../statistics.c:201 ../statistics.c:209
++#, c-format
++msgid "%u packets sent"
++msgstr "Počet odeslaných paketů: %u"
++
++#: ../statistics.c:214
++#, c-format
++msgid "%u SYN cookies sent"
++msgstr "Počet odeslaných SYN cookies: %u"
+
+-#: ../statistics.c:63
++#: ../statistics.c:215
+ #, c-format
+-msgid "Forwarding is %s"
+-msgstr "Pedvn je %s"
++msgid "%u SYN cookies received"
++msgstr "Počet přijatých SYN cookies: %u"
+
+-#: ../statistics.c:64
++#: ../statistics.c:216
+ #, c-format
+-msgid "Default TTL is %d"
+-msgstr "Implicitn TTL je %d"
++msgid "%u invalid SYN cookies received"
++msgstr "Počet chybných příchozích SYN cookies: %u"
+
+-#: ../statistics.c:65
++#: ../statistics.c:218
+ #, c-format
+-msgid "%d total packets received"
+-msgstr "celkem pijmutch paket: %d"
++msgid "%u resets received for embryonic SYN_RECV sockets"
++msgstr "Počet resetů přijatých pro sokety v zárodečném stavu SYN_PŘÍCH: %u"
+
+-#: ../statistics.c:66
++#: ../statistics.c:220
+ #, c-format
+-msgid "%d with invalid headers"
+-msgstr "s nesprvnmi hlavikami: %d"
++msgid "%u packets pruned from receive queue because of socket buffer overrun"
++msgstr ""
++"Počet packetů odstraněných z přijímací fronty kvůli přetečení bufferu "
++"socketu: %u"
+
+-#: ../statistics.c:67
++#. obsolete: 2.2.0 doesn't do that anymore
++#: ../statistics.c:223
+ #, c-format
+-msgid "%d with invalid addresses"
+-msgstr "s nesprvnmi adresami: %d"
++msgid "%u packets pruned from receive queue"
++msgstr "Počet packetů odstraněných z přijímací fronty: %u"
+
+-#: ../statistics.c:68
++#: ../statistics.c:224
+ #, c-format
+-msgid "%d forwarded"
+-msgstr "pedno: %d"
++msgid ""
++"%u packets dropped from out-of-order queue because of socket buffer overrun"
++msgstr ""
++"Počet packetů zahozených z fronty mimo-pořadí kvůli přetečení bufferu "
++"socketu: %u"
+
+-#: ../statistics.c:69
++#: ../statistics.c:226
+ #, c-format
+-msgid "%d with unknown protocol"
+-msgstr "s neznmm protokolem: %d"
++msgid "%u ICMP packets dropped because they were out-of-window"
++msgstr "Počet ICMP packetů zahozených, protože byly mimo okno: %u"
+
+-#: ../statistics.c:70
++#: ../statistics.c:228
+ #, c-format
+-msgid "%d incoming packets discarded"
+-msgstr "poet zahozench pchozch paket: %d"
++msgid "%u ICMP packets dropped because socket was locked"
++msgstr "Počet ICMP packetů zahozených kvůli zamčenému socketu: %u"
+
+-#: ../statistics.c:71
++#: ../statistics.c:230
+ #, c-format
+-msgid "%d incoming packets delivered"
+-msgstr "poet doruench pchozch paket: %d"
++msgid "%u TCP sockets finished time wait in fast timer"
++msgstr ""
++"Počet TCP socketů, které ukončily fázi time-wait uvnitř rychlého časovače: %u"
+
+-#: ../statistics.c:72
++#: ../statistics.c:231
+ #, c-format
+-msgid "%d requests sent out"
+-msgstr "poet odeslanch poadavk: %d"
++msgid "%u time wait sockets recycled by time stamp"
++msgstr ""
++"Počet socketů ve fázi time-wait, které byly znovu použity díky časovému "
++"razítku: %u"
+
+-#. ?
+-#: ../statistics.c:73
++#: ../statistics.c:232
+ #, c-format
+-msgid "%d outgoing packets dropped"
+-msgstr "poet zahozench odchozch paket: %d"
++msgid "%u TCP sockets finished time wait in slow timer"
++msgstr ""
++"Počet TCP socketů, které ukončily fázi time-wait uvnitř pomalého časovače: %u"
+
+-#: ../statistics.c:74
++#: ../statistics.c:233
+ #, c-format
+-msgid "%d dropped because of missing route"
+-msgstr "zahozeno kvli chybjc cest: %d"
++msgid "%u passive connections rejected because of time stamp"
++msgstr "Počet odmítnutých pasivních spojení kvůli časovému razítku: %u"
+
+-#: ../statistics.c:75
++#: ../statistics.c:235
+ #, c-format
+-msgid "%d fragments dropped after timeout"
+-msgstr "poet fragment zahozench po vypren asu: %d"
++msgid "%u active connections rejected because of time stamp"
++msgstr "Počet odmítnutých aktivních spojení kvůli časovému razítku: %u"
+
+-#: ../statistics.c:76
++#: ../statistics.c:237
+ #, c-format
+-msgid "%d reassemblies required"
+-msgstr "poet nutnch znovusestaven: %d"
++msgid "%u packets rejects in established connections because of timestamp"
++msgstr ""
++"Počet odmítnutých packetů uvnitř navázaného spojení kvůli časovému razítku: %"
++"u"
+
+-#. ?
+-#: ../statistics.c:77
++#: ../statistics.c:239
+ #, c-format
+-msgid "%d packets reassembled ok"
+-msgstr "poet v podku znovu sestavench paket: %d"
++msgid "%u delayed acks sent"
++msgstr "Počet odeslaných zpožděných potvrzení: %u"
+
+-#: ../statistics.c:78
++#: ../statistics.c:240
+ #, c-format
+-msgid "%d packet reassembles failed"
+-msgstr "poet paket, je se nepodailo znovu sestavit: %d"
++msgid "%u delayed acks further delayed because of locked socket"
++msgstr ""
++"Počet zpožděných potvrzení dále pozdržených kvůli zamčenému socketu: %u"
+
+-#: ../statistics.c:79
++#: ../statistics.c:242
+ #, c-format
+-msgid "%d fragments received ok"
+-msgstr "poet v podku pijmutch fragment: %d"
++msgid "Quick ack mode was activated %u times"
++msgstr "Počet aktivovaní rychlého potvrzovacího režimu: %u"
+
+-#: ../statistics.c:80
++#: ../statistics.c:243
+ #, c-format
+-msgid "%d fragments failed"
+-msgstr "poet chybnch fragment: %d"
++msgid "%u times the listen queue of a socket overflowed"
++msgstr "Počet přetečení naslouchací fronty socketu: %u"
+
+-#: ../statistics.c:81
++#: ../statistics.c:245
+ #, c-format
+-msgid "%d fragments created"
+-msgstr "poet vytvoench fragment: %d"
++msgid "%u SYNs to LISTEN sockets dropped"
++msgstr "Počet zahozených SYN packetů určených naslouchajícímu socketu: %u"
+
+-#: ../statistics.c:86
++#: ../statistics.c:246
+ #, c-format
+-msgid "%d ICMP messages received"
+-msgstr "poet pijmutch ICMP zprv: %d"
++msgid "%u packets directly queued to recvmsg prequeue."
++msgstr "Počet packetů přímo zařazených do předfronty recvmsg: %u"
+
+-#: ../statistics.c:87
++#: ../statistics.c:248
+ #, c-format
+-msgid "%d input ICMP message failed."
+-msgstr "poet chybnch pchozch ICMP zprv: %d"
++msgid "%u bytes directly in process context from backlog"
++msgstr "Počet bajtů předaných přímo z backlogu do kontextu procesu: %u"
+
+-#: ../statistics.c:88 ../statistics.c:101
++#: ../statistics.c:249
+ #, c-format
+-msgid "destination unreachable: %d"
+-msgstr "adrest nedostupn: %d"
++msgid "%u bytes directly received in process context from prequeue"
++msgstr "Počet bajtů přímo přijatých do kontextu procesu z předfronty: %u"
+
+-#: ../statistics.c:89
++#: ../statistics.c:251
+ #, c-format
+-msgid "timeout in transit: %d"
+-msgstr "vyprel as pi penosu: %d"
++msgid "%u packets dropped from prequeue"
++msgstr "Počet paketů odstraněných z předfronty: %u"
+
+-#: ../statistics.c:90 ../statistics.c:103
++#: ../statistics.c:252
+ #, c-format
+-msgid "wrong parameters: %d"
+-msgstr "chybn parametry: %d"
++msgid "%u packet headers predicted"
++msgstr "Počet předpovězených hlaviček packetů: %u"
+
+-#. ?
+-#: ../statistics.c:91
++#: ../statistics.c:253
+ #, c-format
+-msgid "source quenchs: %d"
+-msgstr "zen toku dat: %d"
++msgid "%u packets header predicted and directly queued to user"
++msgstr "Počet hlaviček packetů předpovězených a přímo předaných uživateli: %u"
+
+-#: ../statistics.c:92
++#: ../statistics.c:255
+ #, c-format
+-msgid "redirects: %d"
+-msgstr "zmna cesty: %d"
++msgid "Ran %u times out of system memory during packet sending"
++msgstr "Kolikrát systému došla paměť při odesílání packetu: %u"
+
+-#: ../statistics.c:93
++#: ../statistics.c:257
+ #, c-format
+-msgid "echo requests: %d"
+-msgstr "dost o echo: %d"
++msgid "%u acknowledgments not containing data payload received"
++msgstr "Počet přijatých potvrzení neobsahující data: %u"
+
+-#: ../statistics.c:94 ../statistics.c:107
++#: ../statistics.c:258
+ #, c-format
+-msgid "echo replies: %d"
+-msgstr "odpov na dost o echo: %d"
++msgid "%u predicted acknowledgments"
++msgstr "Počet předpovězených potvrzení: %u"
+
+-#: ../statistics.c:95
++#: ../statistics.c:259
+ #, c-format
+-msgid "timestamp request: %d"
+-msgstr "dost o as: %d"
++msgid "%u times recovered from packet loss due to fast retransmit"
++msgstr "Počet zotavení ze ztráty packetu kvůli rychle opakovanému odeslání: %u"
+
+-#: ../statistics.c:96
++#: ../statistics.c:260
+ #, c-format
+-msgid "timestamp reply: %d"
+-msgstr "odpov na dost o as: %d"
++msgid "%u times recovered from packet loss by selective acknowledgements"
++msgstr "Počet zotavení ze ztráty packetu pomocí vyběrových potvrzení: %u"
+
+-#: ../statistics.c:97
++#: ../statistics.c:261
+ #, c-format
+-msgid "address mask request: %d"
+-msgstr "dost o masku podst: %d"
++msgid "%u bad SACK blocks received"
++msgstr "Počet přijatých chybných SACK bloků: %u"
+
+-#. ?
+-#: ../statistics.c:98
+-msgid "address mask replies"
+-msgstr "odpovdi na dost o masku podst"
++#: ../statistics.c:262
++#, c-format
++msgid "Detected reordering %u times using FACK"
++msgstr "Kolikrát byla nalezena změna pořadí pomocí FACK: %u"
+
+-#. ?
+-#: ../statistics.c:99
++#: ../statistics.c:263
+ #, c-format
+-msgid "%d ICMP messages sent"
+-msgstr "poet odeslanch ICMP zprv: %d"
++msgid "Detected reordering %u times using SACK"
++msgstr "Kolikrát byla nalezena změna pořadí pomocí SACK: %u"
+
+-#: ../statistics.c:100
++#: ../statistics.c:264
+ #, c-format
+-msgid "%d ICMP messages failed"
+-msgstr "poet chybnch ICMP zprv: %d"
++msgid "Detected reordering %u times using time stamp"
++msgstr "Kolikrát byla nalezena změna pořadí pomocí časového razítka: %u"
+
+-#: ../statistics.c:102
++#: ../statistics.c:265
+ #, c-format
+-msgid "time exceeded: %d"
+-msgstr "vypren ivotnosti: %d"
++msgid "Detected reordering %u times using reno fast retransmit"
++msgstr ""
++"Kolikrát byla nalezena změna pořadí kvůli rychlému znovuodeslání Reno: %u"
+
+-#. ?
+-#: ../statistics.c:104
++#: ../statistics.c:266
+ #, c-format
+-msgid "source quench: %d"
+-msgstr "zen toku dat: %d"
++msgid "%u congestion windows fully recovered without slow start"
++msgstr "Počet plných zotavení ze zahlcení okna bez pomalého startu: %u"
+
+-#: ../statistics.c:105
++#: ../statistics.c:267
+ #, c-format
+-msgid "redirect: %d"
+-msgstr "zmna cesty: %d"
++msgid "%u congestion windows partially recovered using Hoe heuristic"
++msgstr "Počet částečných zotavení ze zahlcení okna pomocí heuristiky Hoe: %u"
+
+-#: ../statistics.c:106
++#: ../statistics.c:268
+ #, c-format
+-msgid "echo request: %d"
+-msgstr "dost o echo: %d"
++msgid "%u congestion window recovered without slow start using DSACK"
++msgstr "Počet zotavení ze zahlceného okna bez pomalého startu pomocí DSACK: %u"
+
+-#: ../statistics.c:108
++#: ../statistics.c:269
+ #, c-format
+-msgid "timestamp requests: %d"
+-msgstr "dost o as: %d"
++msgid "%u congestion windows recovered without slow start after partial ack"
++msgstr ""
++"Počet zotavení ze zahlcení okna bez pomalého startu po částečném potvrzení: %"
++"u"
+
+-#: ../statistics.c:109
++#: ../statistics.c:270
+ #, c-format
+-msgid "timestamp replies: %d"
+-msgstr "odpov na dost o as: %d"
++msgid "%u retransmits lost"
++msgstr "Počet ztracených opakovaných odeslání: %u"
+
+-#: ../statistics.c:110
++#: ../statistics.c:271
+ #, c-format
+-msgid "address mask requests: %d"
+-msgstr "dost o masku podst: %d"
++msgid "%u timeouts after reno fast retransmit"
++msgstr "Počet vypršení času po rychlém opakovaném odeslání Reno: %u"
+
+-#: ../statistics.c:111
++#: ../statistics.c:272
+ #, c-format
+-msgid "address mask replies: %d"
+-msgstr "odpov na dost o masku podst: %d"
++msgid "%u timeouts after SACK recovery"
++msgstr "Počet vypršení času po zotavení pomocí SACK: %u"
+
+-#: ../statistics.c:116
++#: ../statistics.c:273
+ #, c-format
+-msgid "RTO algorithm is %s"
+-msgstr "RTO algoritmus je %s"
++msgid "%u timeouts in loss state"
++msgstr "Počet vypršení času ve stavu ztráty: %u"
+
+-#: ../statistics.c:120
++#: ../statistics.c:274
+ #, c-format
+-msgid "%d active connections openings"
+-msgstr "poet aktivn navzanch spojen: %d"
++msgid "%u fast retransmits"
++msgstr "Počet rychlých opakování odeslání: %u"
+
+-#: ../statistics.c:121
++#: ../statistics.c:275
+ #, c-format
+-msgid "%d passive connection openings"
+-msgstr "poet pasivn navzanch spojen: %d"
++msgid "%u forward retransmits"
++msgstr "Počet dopředných opakovaných odeslání: %u"
+
+-#: ../statistics.c:122
++#: ../statistics.c:276
+ #, c-format
+-msgid "%d failed connection attempts"
+-msgstr "poet nespnch pokus o spojen: %d"
++msgid "%u retransmits in slow start"
++msgstr "Počet opakovaných odeslání v pomalém startu: %u"
+
+-#: ../statistics.c:123
++#: ../statistics.c:277
+ #, c-format
+-msgid "%d connection resets received"
+-msgstr "poet pijmutch reset: %d"
++msgid "%u other TCP timeouts"
++msgstr "Počet jiných vypršení časovače TCP: %u"
+
+-#: ../statistics.c:124
++#: ../statistics.c:278
+ #, c-format
+-msgid "%d connections established"
+-msgstr "poet navzanch spojen: %d"
++msgid "%u reno fast retransmits failed"
++msgstr "Počet selhání rychlých opakovaných odeslání Reno: %u"
+
+-#: ../statistics.c:125
++#: ../statistics.c:279
+ #, c-format
+-msgid "%d segments received"
+-msgstr "poet pijmutch segment: %d"
++msgid "%u SACK retransmits failed"
++msgstr "Počet selhání opakovaných odeslání SACK: %u"
+
+-#: ../statistics.c:126
++#: ../statistics.c:280
+ #, c-format
+-msgid "%d segments send out"
+-msgstr "poet odeslanch segment: %d"
++msgid "%u times receiver scheduled too late for direct processing"
++msgstr "Kolikrát byl přijímač naplánován příliš pozdě na přímé zpracovaní: %u"
+
+-#: ../statistics.c:127
++#: ../statistics.c:281
+ #, c-format
+-msgid "%d segments retransmited"
+-msgstr "poet penesench segment: %d"
++msgid "%u packets collapsed in receive queue due to low socket buffer"
++msgstr ""
++"Počet packetů sloučených v přijímací frontě kvůli malému bufferu socketu: %u"
+
+-#: ../statistics.c:128
++#: ../statistics.c:282
+ #, c-format
+-msgid "%d bad segments received."
+-msgstr "poet chybnch pchozch segment: %d."
++msgid "%u DSACKs sent for old packets"
++msgstr "Počet packetů DSACK odeslaných kvůli starým packetům: %u"
+
+-#: ../statistics.c:129
++#: ../statistics.c:283
+ #, c-format
+-msgid "%d resets sent"
+-msgstr "poet odeslanch reset: %d"
++msgid "%u DSACKs sent for out of order packets"
++msgstr "Počet packetů DSCACK odeslaných kvůli packetům mimo pořadí: %u"
+
+-#: ../statistics.c:134
++#: ../statistics.c:284
+ #, c-format
+-msgid "%d packets received"
+-msgstr "poet pijmutch paket: %d"
++msgid "%u DSACKs received"
++msgstr "Počet přijatých paketů DSACK: %u"
+
+-#: ../statistics.c:135
++#: ../statistics.c:285
+ #, c-format
+-msgid "%d packets to unknown port received."
+-msgstr "poet paket pijmutch pro neznm port: %d."
++msgid "%u DSACKs for out of order packets received"
++msgstr "Počet packetů DSACK přijatých kvůli packetům mimo pořadí: %u"
+
+-#: ../statistics.c:136
++#: ../statistics.c:286
+ #, c-format
+-msgid "%d packet receive errors"
+-msgstr "poet chyb pi pjmu paket: %d"
++msgid "%u connections reset due to unexpected SYN"
++msgstr "Počet resetů spojení kvůli neočekávanému SYN: %u"
+
+-#: ../statistics.c:137
++#: ../statistics.c:287
+ #, c-format
+-msgid "%d packets sent"
+-msgstr "poet odeslanch paket: %d"
++msgid "%u connections reset due to unexpected data"
++msgstr "Počet resetů spojení kvůli neočekávaným datům: %u"
+
+-#: ../statistics.c:142
++#: ../statistics.c:288
+ #, c-format
+-msgid "%d SYN cookies sent"
+-msgstr "poet odeslanch SYN cookies: %d"
++msgid "%u connections reset due to early user close"
++msgstr "Počet resetů spojení kvůli časnému uzavření uživatelem: %u"
+
+-#: ../statistics.c:143
++#: ../statistics.c:289
+ #, c-format
+-msgid "%d SYN cookies received"
+-msgstr "poet pijmutch SYN cookies: %d"
++msgid "%u connections aborted due to memory pressure"
++msgstr "Počet zrušených spojení kvůli paměťové tísni: %u"
+
+-#: ../statistics.c:144
++#: ../statistics.c:290
+ #, c-format
+-msgid "%d invalid SYN cookies received"
+-msgstr "poet chybnch pchozch SYN cookies: %d"
++msgid "%u connections aborted due to timeout"
++msgstr "Počet zrušených spojení kvůli vypršení časovače: %u"
+
+-#: ../statistics.c:146
++#: ../statistics.c:291
+ #, c-format
+-msgid "%d resets received for embryonic SYN_RECV sockets"
+-msgstr "poet reset pijmutch pro sokety ve stavu SYN_PCH: %d"
++msgid "%u connections aborted after user close in linger timeout"
++msgstr ""
++"Počet zrušených spojení po té, co je uživatel uzavřel ve fázi dožití: %u"
+
+-#: ../statistics.c:148
++#: ../statistics.c:292
+ #, c-format
+-msgid "%d packets pruned from receive queue because of socket buffer overrun"
+-msgstr "poet paket odstrannch z fronty kvli peteen bufferu soketu: %d"
++msgid "%u times unabled to send RST due to no memory"
++msgstr "Kolikrát nebylo možné odeslat RST kvůli nedostatku paměti: %u"
+
+-#. obsolete: 2.2.0 doesn't do that anymore
+-#: ../statistics.c:151
++#: ../statistics.c:293
+ #, c-format
+-msgid "%d packets pruned from out-of-order queue"
+-msgstr "poet paket odstrannch z fronty mimo-poad: %d"
++msgid "TCP ran low on memory %u times"
++msgstr "Kolikrát TCP zpomalilo kvůli paměti: %u"
+
+-#: ../statistics.c:152
++#: ../statistics.c:294
+ #, c-format
+-msgid ""
+-"%d packets dropped from out-of-order queue because of socket buffer overrun"
+-msgstr ""
+-"poet paket zahozench z fronty mimo-poad kvli peteen bufferu soketu: "
+-"%d"
++msgid "%u TCP data loss events"
++msgstr "Počet ztrát dat TCP: %u"
+
+-#: ../statistics.c:154
++#: ../statistics.c:295
+ #, c-format
+-msgid "%d ICMP packets dropped because they were out-of-window"
+-msgstr "poet ICMP paket zahozench, protoe byly mimo-okno: %d"
++msgid "%u congestion windows recovered without slow start by DSACK"
++msgstr "Počet zotavení ze zahlcení okna bez pomalého startu pomocí DSACK: %u"
+
+-#: ../statistics.c:156
++#: ../statistics.c:297
+ #, c-format
+-msgid "%d ICMP packets dropped because socket was locked"
+-msgstr "poet ICMP paket zahozench kvli zamenmu soketu: %d"
++msgid "%u classic Reno fast retransmits failed"
++msgstr "Počet selhání klasického rychlého opakovaného odeslání Reno: %u"
+
+-#: ../statistics.c:222
++#: ../statistics.c:373
+ msgid "enabled"
+ msgstr "zapnuto"
+
+-#: ../statistics.c:222
++#: ../statistics.c:373
+ msgid "disabled"
+ msgstr "vypnuto"
+
+-#: ../statistics.c:272
++#: ../statistics.c:511 ../statistics.c:555
++msgid "cannot open /proc/net/snmp"
++msgstr "/proc/net/snmp nelze otevřít"
++
++#: ../statistics.c:516
+ #, c-format
+-msgid "unknown title %s\n"
+-msgstr "titulek %s je neznm\n"
++msgid "Problem while parsing /proc/net/snmp\n"
++msgstr "Potíže při při zpracování /proc/net/snmp\n"
+
+-#: ../statistics.c:298
+-msgid "error parsing /proc/net/snmp"
+-msgstr "chyba pi zpracovn /proc/net/snmp"
++#: ../statistics.c:527
++#, c-format
++msgid "Problem while parsing /proc/net/netstat\n"
++msgstr "Potíže při při zpracování /proc/net/netstat\n"
+
+-#: ../statistics.c:311
+-msgid "cannot open /proc/net/snmp"
+-msgstr "/proc/net/snmp nelze otevt"
++#: ../statistics.c:545
++msgid "cannot open /proc/net/snmp6"
++msgstr "/proc/net/snmp6 nelze otevřít"
+
+ #: ../lib/activate.c:69
+ #, c-format
+ msgid "Hardware type `%s' not supported.\n"
+-msgstr "Hardwarov typ `%s' nen podporovn.\n"
++msgstr "Hardwarový typ „%s“ není podporován.\n"
+
+ #: ../lib/activate.c:73
+ #, c-format
+ msgid "Cannot change line discipline to `%s'.\n"
+-msgstr "Linkovou disciplnu nelze na `%s' zmnit.\n"
++msgstr "Linkovou disciplínu nelze na „%s“ změnit.\n"
+
+-#: ../lib/af.c:145 ../lib/hw.c:148
++#: ../lib/af.c:157 ../lib/hw.c:166
+ msgid "UNSPEC"
+-msgstr "NEZNM"
++msgstr "NEZNÁM"
+
+-#: ../lib/af.c:147
++#: ../lib/af.c:159
+ msgid "UNIX Domain"
+-msgstr "Domna UNIX"
++msgstr "Doména UNIX"
+
+-#: ../lib/af.c:150
++#: ../lib/af.c:162
+ msgid "DARPA Internet"
+ msgstr "DARPA Internet"
+
+-#: ../lib/af.c:153
++#: ../lib/af.c:165
+ msgid "IPv6"
+ msgstr "IPv6"
+
+-#: ../lib/af.c:156 ../lib/hw.c:169
++#: ../lib/af.c:168 ../lib/hw.c:187
+ msgid "AMPR AX.25"
+ msgstr "AMPR AX.25"
+
+-#: ../lib/af.c:159 ../lib/hw.c:175
++#: ../lib/af.c:171 ../lib/hw.c:193
+ msgid "AMPR NET/ROM"
+ msgstr "AMPR NET/ROM"
+
+-#: ../lib/af.c:162
++#: ../lib/af.c:174
+ msgid "Novell IPX"
+ msgstr "Novell IPX"
+
+-#: ../lib/af.c:165
++#: ../lib/af.c:177
+ msgid "Appletalk DDP"
+ msgstr "Appletalk DDP"
+
+-#: ../lib/af.c:168 ../lib/hw.c:207
++#: ../lib/af.c:180 ../lib/hw.c:228
+ msgid "Econet"
+ msgstr "Econet"
+
+-#: ../lib/af.c:171 ../lib/hw.c:172
++#: ../lib/af.c:183
++msgid "CCITT X.25"
++msgstr "CCITT X.25"
++
++#: ../lib/af.c:186 ../lib/hw.c:190
+ msgid "AMPR ROSE"
+ msgstr "AMPR ROSE"
+
+-#: ../lib/af.c:174 ../lib/hw.c:160
++#: ../lib/af.c:189 ../lib/hw.c:178
+ msgid "Ash"
+ msgstr "Ash"
+
+-#: ../lib/af.c:232
++#: ../lib/af.c:247
++#, c-format
+ msgid "Please don't supply more than one address family.\n"
+-msgstr "Nezadvejte vce ne jednu tdu adres.\n"
++msgstr "Nezadávejte více než jednu třídu adres.\n"
+
+-#: ../lib/af.c:293
++#: ../lib/af.c:308
++#, c-format
+ msgid "Too much address family arguments.\n"
+-msgstr "Bylo zadno pli mnoho td adres.\n"
++msgstr "Bylo zadáno příliš mnoho tříd adres.\n"
+
+-#: ../lib/af.c:304
++#: ../lib/af.c:319
+ #, c-format
+ msgid "Unknown address family `%s'.\n"
+-msgstr "Tda adres `%s' nen znma.\n"
+-
+-#: ../lib/arcnet.c:53 ../lib/ax25.c:75 ../lib/ddp.c:50 ../lib/econet.c:52
+-#: ../lib/fddi.c:67 ../lib/hippi.c:68 ../lib/inet.c:244 ../lib/inet.c:259
+-#: ../lib/inet6.c:129 ../lib/ipx.c:81 ../lib/netrom.c:78 ../lib/rose.c:71
+-#: ../lib/rose.c:126 ../lib/unix.c:56 ../lib/unix.c:76
+-msgid "[NONE SET]"
+-msgstr "[NENASTAVENO]"
++msgstr "Třída adres `%s' není známa.\n"
+
+-#: ../lib/arcnet.c:81 ../lib/arcnet.c:96
++#: ../lib/arcnet.c:70 ../lib/arcnet.c:85
+ #, c-format
+ msgid "in_arcnet(%s): invalid arcnet address!\n"
+-msgstr "in_arcnet(%s): chybn arcnet adresa!\n"
++msgstr "in_arcnet(%s): chybná arcnet adresa!\n"
+
+-#: ../lib/arcnet.c:108
++#: ../lib/arcnet.c:97
+ #, c-format
+ msgid "in_arcnet(%s): trailing : ignored!\n"
+-msgstr "in_arcnet(%s): nadbyten : ignorovno!\n"
++msgstr "in_arcnet(%s): nadbytečné : ignorováno!\n"
+
+-#: ../lib/arcnet.c:120
++#: ../lib/arcnet.c:109
+ #, c-format
+ msgid "in_arcnet(%s): trailing junk!\n"
+-msgstr "in_arcnet(%s): nadbyten znaky!\n"
++msgstr "in_arcnet(%s): nadbytečné znaky!\n"
+
+ #: ../lib/ash.c:81
++#, c-format
+ msgid "Malformed Ash address"
+-msgstr "Chybn Ash adresa"
++msgstr "Chybná Ash adresa"
++
++#: ../lib/ax25.c:75 ../lib/ddp.c:50 ../lib/econet.c:52 ../lib/inet.c:244
++#: ../lib/inet.c:259 ../lib/inet6.c:145 ../lib/ipx.c:81 ../lib/netrom.c:78
++#: ../lib/rose.c:71 ../lib/unix.c:56 ../lib/unix.c:76
++msgid "[NONE SET]"
++msgstr "[NENASTAVENO]"
+
+ #: ../lib/ax25.c:97 ../lib/netrom.c:100
+ msgid "Invalid callsign"
+-msgstr "Nesprvn volac znak"
++msgstr "Nesprávný volací znak"
+
+ #: ../lib/ax25.c:110 ../lib/netrom.c:113
+ msgid "Callsign too long"
+-msgstr "Volac znak je pli dlouh."
++msgstr "Volací znak je příliš dlouhý."
+
+ #: ../lib/ax25_gr.c:47
++#, c-format
+ msgid "AX.25 not configured in this system.\n"
+-msgstr "AX.25 nen na tomto systmu nakonfigurovno.\n"
++msgstr "AX.25 není na tomto systému nakonfigurováno.\n"
+
+ #: ../lib/ax25_gr.c:50
++#, c-format
+ msgid "Kernel AX.25 routing table\n"
+-msgstr "Smrovac tabulka v jdru pro AX.25\n"
++msgstr "Směrovací tabulka v jádru pro AX.25\n"
+
+ #. xxx
+ #: ../lib/ax25_gr.c:51 ../lib/rose_gr.c:55
++#, c-format
+ msgid "Destination Iface Use\n"
+-msgstr "Adrest Rozhran Uit\n"
+-
+-#: ../lib/ddp_gr.c:21
+-msgid "Routing table for `ddp' not yet supported.\n"
+-msgstr "Smrovac tabulka pro `ddp' nen zatm podporovna.\n"
++msgstr "Adresát Rozhraní Užití\n"
+
+ #: ../lib/ether.c:74 ../lib/ether.c:91
+ #, c-format
+ msgid "in_ether(%s): invalid ether address!\n"
+-msgstr "in_ether(%s): chybn ethernetov adresa!\n"
++msgstr "in_ether(%s): chybná ethernetová adresa!\n"
+
+ #: ../lib/ether.c:105
+ #, c-format
+ msgid "in_ether(%s): trailing : ignored!\n"
+-msgstr "in_ether(%s): nadbyten : ignorovno!\n"
++msgstr "in_ether(%s): nadbytečné : ignorováno!\n"
+
+ #: ../lib/ether.c:117
+ #, c-format
+ msgid "in_ether(%s): trailing junk!\n"
+-msgstr "in_ether(%s): nadbyten znaky!\n"
++msgstr "in_ether(%s): nadbytečné znaky!\n"
+
+-#: ../lib/fddi.c:95 ../lib/fddi.c:110
++#: ../lib/fddi.c:84 ../lib/fddi.c:99
+ #, c-format
+ msgid "in_fddi(%s): invalid fddi address!\n"
+-msgstr "in_fddi(%s): chybn fddi adresa!\n"
++msgstr "in_fddi(%s): chybná fddi adresa!\n"
+
+-#: ../lib/fddi.c:122
++#: ../lib/fddi.c:111
+ #, c-format
+ msgid "in_fddi(%s): trailing : ignored!\n"
+-msgstr "in_fddi(%s): nadbyten : ignorovno!\n"
++msgstr "in_fddi(%s): nadbytečné : ignorováno!\n"
+
+-#: ../lib/fddi.c:134
++#: ../lib/fddi.c:123
+ #, c-format
+ msgid "in_fddi(%s): trailing junk!\n"
+-msgstr "in_fddi(%s): nadbyten znaky!\n"
++msgstr "in_fddi(%s): nadbytečné znaky!\n"
+
+-#: ../lib/getroute.c:97 ../lib/setroute.c:76
++#: ../lib/getroute.c:101 ../lib/setroute.c:80
+ #, c-format
+ msgid "Address family `%s' not supported.\n"
+-msgstr "Tda adres `%s' nen podporovna.\n"
++msgstr "Třída adres `%s' není podporována.\n"
+
+-#: ../lib/getroute.c:103 ../lib/setroute.c:80
++#: ../lib/getroute.c:107 ../lib/setroute.c:84
+ #, c-format
+ msgid "No routing for address family `%s'.\n"
+-msgstr "Pro tdu adres `%s' nen dn smrovn.\n"
++msgstr "Pro třídu adres `%s' není žádné směrování.\n"
+
+-#: ../lib/hippi.c:96 ../lib/hippi.c:111
++#: ../lib/hippi.c:84 ../lib/hippi.c:99
+ #, c-format
+ msgid "in_hippi(%s): invalid hippi address!\n"
+-msgstr "in_hippi(%s): chybn hippi adresa!\n"
++msgstr "in_hippi(%s): chybná hippi adresa!\n"
+
+-#: ../lib/hippi.c:123
++#: ../lib/hippi.c:111
+ #, c-format
+ msgid "in_hippi(%s): trailing : ignored!\n"
+-msgstr "in_hippi(%s): nadbyten : ignorovno!\n"
++msgstr "in_hippi(%s): nadbytečné : ignorováno!\n"
+
+-#: ../lib/hippi.c:134
++#: ../lib/hippi.c:122
+ #, c-format
+ msgid "in_hippi(%s): trailing junk!\n"
+-msgstr "in_hippi(%s): nadbyten znaky!\n"
++msgstr "in_hippi(%s): nadbytečné znaky!\n"
+
+-#: ../lib/hw.c:147
++#: ../lib/hw.c:165
+ msgid "Local Loopback"
+-msgstr "Mstn smyka"
++msgstr "Místní smyčka"
+
+-#: ../lib/hw.c:150
++#: ../lib/hw.c:168
+ msgid "Serial Line IP"
+-msgstr "IP po sriov lince"
++msgstr "IP po sériové lince"
+
+-#: ../lib/hw.c:151
++#: ../lib/hw.c:169
+ msgid "VJ Serial Line IP"
+-msgstr "Vj IP po sriov lince"
++msgstr "VJ IP po sériové lince"
+
+-#: ../lib/hw.c:152
++#: ../lib/hw.c:170
+ msgid "6-bit Serial Line IP"
+-msgstr "6bitov IP po sriov lince"
++msgstr "6bitový IP po sériové lince"
+
+-#: ../lib/hw.c:153
++#: ../lib/hw.c:171
+ msgid "VJ 6-bit Serial Line IP"
+-msgstr "6bitov VJ IP po sriov lince"
++msgstr "6bitový VJ IP po sériové lince"
+
+-#: ../lib/hw.c:154
++#: ../lib/hw.c:172
+ msgid "Adaptive Serial Line IP"
+-msgstr "Adaptivn IP po sriov lince"
++msgstr "Adaptivní IP po sériové lince"
+
+-#: ../lib/hw.c:157
++#: ../lib/hw.c:175
+ msgid "Ethernet"
+ msgstr "Ethernet"
+
+-#: ../lib/hw.c:163
++#: ../lib/hw.c:181
+ msgid "Fiber Distributed Data Interface"
+ msgstr "Fiber Distributed Data Interface"
+
+-#: ../lib/hw.c:166
++#: ../lib/hw.c:184
+ msgid "HIPPI"
+ msgstr "HIPPI"
+
+-#: ../lib/hw.c:178
++#: ../lib/hw.c:196
++msgid "generic X.25"
++msgstr "obecné X.25"
++
++#: ../lib/hw.c:199
+ msgid "IPIP Tunnel"
+ msgstr "IPIP Tunnel"
+
+-#: ../lib/hw.c:181
++#: ../lib/hw.c:202
+ msgid "Point-to-Point Protocol"
+-msgstr "Point-to-Point Protokol"
++msgstr "Dvoubodový protokol"
+
+-#: ../lib/hw.c:184
++#: ../lib/hw.c:205
+ msgid "(Cisco)-HDLC"
+ msgstr "(Cisco)-HDLC"
+
+-#: ../lib/hw.c:185
++#: ../lib/hw.c:206
+ msgid "LAPB"
+ msgstr "LAPB"
+
+-#: ../lib/hw.c:188
++#: ../lib/hw.c:209
+ msgid "ARCnet"
+ msgstr "ARCnet"
+
+-#: ../lib/hw.c:191
++#: ../lib/hw.c:212
+ msgid "Frame Relay DLCI"
+ msgstr "Frame Relay DLCI"
+
+-#: ../lib/hw.c:192
++#: ../lib/hw.c:213
+ msgid "Frame Relay Access Device"
+-msgstr "Pstupov zazen Frame Relay"
++msgstr "Přístupové zařízení Frame Relay"
+
+-#: ../lib/hw.c:195
++#: ../lib/hw.c:216
+ msgid "IPv6-in-IPv4"
+ msgstr "IPv6-in-IPv4"
+
+-#: ../lib/hw.c:198
++#: ../lib/hw.c:219
+ msgid "IrLAP"
+ msgstr "IrLAP"
+
+-#: ../lib/hw.c:201
++#: ../lib/hw.c:222
+ msgid "16/4 Mbps Token Ring"
+ msgstr "Token Ring 16/4 Mb/s"
+
+-#: ../lib/hw.c:203
+-#, fuzzy
++#: ../lib/hw.c:224
+ msgid "16/4 Mbps Token Ring (New)"
+-msgstr "Token Ring 16/4 Mb/s"
++msgstr "Token Ring 16/4 Mb/s (Nový)"
+
+-#: ../lib/inet.c:153 ../lib/inet6.c:79
++#: ../lib/hw.c:231
++msgid "InfiniBand"
++msgstr "InfiniBand"
++
++#: ../lib/hw.c:234
++msgid "Generic EUI-64"
++msgstr "Obecné EUI-64"
++
++#: ../lib/inet.c:153 ../lib/inet6.c:94
+ #, c-format
+ msgid "rresolve: unsupport address family %d !\n"
+-msgstr "rresolve: tda adres %d nen podporovna!\n"
++msgstr "rresolve: třída adres %d není podporována!\n"
+
+-#: ../lib/inet6_gr.c:79
++#: ../lib/inet6.c:147
++msgid "[UNKNOWN]"
++msgstr "[NEZNÁMÝ]"
++
++#: ../lib/inet6_gr.c:71
++#, c-format
+ msgid "INET6 (IPv6) not configured in this system.\n"
+-msgstr "INET6 (IPv6) nen na tomto systmu nakonfigurovno.\n"
++msgstr "INET6 (IPv6) není na tomto systému nakonfigurováno.\n"
+
+-#: ../lib/inet6_gr.c:82
++#: ../lib/inet6_gr.c:76
++#, c-format
++msgid "Kernel IPv6 routing cache\n"
++msgstr "Směrovací cache v jádru pro IPv6\n"
++
++#: ../lib/inet6_gr.c:78
++#, c-format
+ msgid "Kernel IPv6 routing table\n"
+-msgstr "Smrovac tabulka v jdru pro IPv6\n"
++msgstr "Směrovací tabulka v jádru pro IPv6\n"
+
+-#: ../lib/inet6_gr.c:84
++#: ../lib/inet6_gr.c:80
++#, c-format
+ msgid ""
+-"Destination Next Hop "
+-" Flags Metric Ref Use Iface\n"
++"Destination Next Hop Flag Met Ref Use "
++"If\n"
+ msgstr ""
+-"Adrest Dal Smrova "
+-" Pzn Metrika Odkaz Uit Rozhran\n"
++"Adresát Další směrovač Příz Met Odk Užt "
++"Rozhr\n"
+
+-#: ../lib/inet6_gr.c:158
++#: ../lib/inet6_gr.c:174
++#, c-format
+ msgid "Kernel IPv6 Neighbour Cache\n"
+-msgstr "Cache soused v jdru pro IPv6\n"
++msgstr "Cache sousedů v jádru pro IPv6\n"
+
+-#: ../lib/inet6_gr.c:161
++#: ../lib/inet6_gr.c:177
++#, c-format
+ msgid ""
+ "Neighbour HW Address Iface Flags "
+ "Ref State\n"
+ msgstr ""
+-"Soused HW Adresa Rozhran Pzn "
++"Soused HW Adresa Rozhraní Přízn "
+ "Odkazy Stav\n"
+
+-#: ../lib/inet6_gr.c:165
++#: ../lib/inet6_gr.c:181
++#, c-format
+ msgid ""
+ "Neighbour HW Address Iface Flags "
+ "Ref State Stale(sec) Delete(sec)\n"
+ msgstr ""
+-"Soused HW Adresa Rozhran "
+-"Pznaky Odkazy Stav Prol(sec) Smazat(sec)\n"
++"Soused HW Adresa Rozhraní "
++"Příznaky Odkazy Stav Prošlý(sec) Smazat(sec)\n"
+
+ #: ../lib/inet6_sr.c:46
++#, c-format
+ msgid "Usage: inet6_route [-vF] del Target\n"
+-msgstr "Pouit: inet6_route [-vF] del Cl\n"
++msgstr "Použití: inet6_route [-vF] del Cíl\n"
+
+ #: ../lib/inet6_sr.c:47
++#, c-format
+ msgid " inet6_route [-vF] add Target [gw Gw] [metric M] [[dev] If]\n"
+-msgstr " inet6_route [-vF] add Cl [gw Gw] [metrika M] [[dev] If]\n"
++msgstr " inet6_route [-vF] add Cíl [gw Gw] [metrika M] [[dev] If]\n"
+
+ #: ../lib/inet6_sr.c:48
++#, c-format
+ msgid " inet6_route [-FC] flush NOT supported\n"
+-msgstr " inet6_route [-FC] flush NEN podporovno\n"
++msgstr " inet6_route [-FC] flush NENÍ podporováno\n"
+
+-#: ../lib/inet6_sr.c:182
++#: ../lib/inet6_sr.c:188
++#, c-format
+ msgid "Flushing `inet6' routing table not supported\n"
+-msgstr "Smrovac tabulku `inet6' nelze vyprazdovat\n"
++msgstr "Směrovací tabulku `inet6' nelze vyprazdňovat\n"
+
+ #: ../lib/inet_gr.c:50 ../lib/inet_gr.c:220
++#, c-format
+ msgid "INET (IPv4) not configured in this system.\n"
+-msgstr "INET (IPv4) nen na tomto systmu nakonfigurovno.\n"
++msgstr "INET (IPv4) není na tomto systému nakonfigurováno.\n"
+
+ #: ../lib/inet_gr.c:53
++#, c-format
+ msgid "Kernel IP routing table\n"
+-msgstr "Smrovac tabulka v jdru pro IP\n"
++msgstr "Směrovací tabulka v jádru pro IP\n"
+
+ #: ../lib/inet_gr.c:56
++#, c-format
+ msgid ""
+ "Destination Gateway Genmask Flags Metric Ref Use "
+ "Iface\n"
+ msgstr ""
+-"Adrest Brna Maska Pzn Metrik Odkaz Ut "
+-"Rozhran\n"
++"Adresát Brána Maska Přízn Metrik Odkazů Užt "
++"Rozhraní\n"
+
+ #: ../lib/inet_gr.c:59
++#, c-format
+ msgid ""
+ "Destination Gateway Genmask Flags MSS Window irtt "
+ "Iface\n"
+ msgstr ""
+-"Adrest Brna Maska Pzn MSS Okno irtt "
+-"Rozhran\n"
++"Adresát Brána Maska Přízn MSS Okno irtt "
++"Rozhraní\n"
+
+ #: ../lib/inet_gr.c:62
++#, c-format
+ msgid ""
+ "Destination Gateway Genmask Flags Metric Ref Use "
+ "Iface MSS Window irtt\n"
+ msgstr ""
+-"Adrest Brna Maska Pzn Metrik Odkazy Ut "
+-"Rozhran MSS Okno irtt\n"
++"Adresát Brána Maska Přízn Metrik Odkazy Užt "
++"Rozhraní MSS Okno irtt\n"
+
+ #: ../lib/inet_gr.c:237
++#, c-format
+ msgid "Kernel IP routing cache\n"
+-msgstr "Smrovac cache v jdru pro IP\n"
++msgstr "Směrovací cache v jádru pro IP\n"
+
+ #: ../lib/inet_gr.c:258
++#, c-format
+ msgid ""
+ "Source Destination Gateway Flags Metric Ref Use "
+ "Iface\n"
+ msgstr ""
+-"Odeslatel Adrest Maska Pzn Metrik Odkazy Ut "
+-"Rozhran\n"
++"Odesílatel Adresát Maska Přízn Metrik Odkazy Užt "
++"Rozhraní\n"
+
+ #: ../lib/inet_gr.c:261
++#, c-format
+ msgid ""
+ "Source Destination Gateway Flags MSS Window irtt "
+ "Iface\n"
+ msgstr ""
+-"Odeslatel Adrest Maska Pzn MSS Okno irtt "
+-"Rozhran\n"
++"Odesílatel Adresát Maska Přízn MSS Okno irtt "
++"Rozhraní\n"
+
+ #: ../lib/inet_gr.c:266
++#, c-format
+ msgid ""
+ "Source Destination Gateway Flags Metric Ref Use "
+ "Iface MSS Window irtt HH Arp\n"
+ msgstr ""
+-"Odeslatel Adrest Maska Pzn Metrik Odkazy Ut "
+-"Rozhran MSS Okno irtt HH Arp\n"
++"Odesílatel Adresát Maska Přízn Metrik Odkazy Užt "
++"Rozhraní MSS Okno irtt HH Arp\n"
+
+ #: ../lib/inet_gr.c:290
++#, c-format
+ msgid ""
+ "Source Destination Gateway Flags Metric Ref Use "
+ "Iface MSS Window irtt TOS HHRef HHUptod SpecDst\n"
+ msgstr ""
+-"Odeslatel Adrest Maska Pzn Metrik Odkazy Ut "
+-"Rozhran MSS Okno irtt TOS HHOdk HHAktul ZvltCl\n"
++"Odesílatel Adresát Maska Přízn Metrik Odkazy Užt "
++"Rozhraní MSS Okno irtt TOS HHOdk HHAktuál ZvláštCíl\n"
+
+-#: ../lib/inet_sr.c:50
++#: ../lib/inet_sr.c:51
++#, c-format
+ msgid ""
+ "Usage: inet_route [-vF] del {-host|-net} Target[/prefix] [gw Gw] [metric M] "
+ "[[dev] If]\n"
+ msgstr ""
+-"Pouit: inet_route [-vF] del {-host|-net} Cl[/prefix] [gw Gw] [metrika M] "
++"Použití: inet_route [-vF] del {-host|-net} Cíl[/prefix] [gw Gw] [metrika M] "
+ "[[dev] If]\n"
+
+-#: ../lib/inet_sr.c:51
++#: ../lib/inet_sr.c:52
++#, c-format
+ msgid ""
+ " inet_route [-vF] add {-host|-net} Target[/prefix] [gw Gw] [metric M]\n"
+ msgstr ""
+-" inet_route [-vF] add {-host|-net} Cl[/prefix] [gw Gw] [metrika M]\n"
++" inet_route [-vF] add {-host|-net} Cíl[/prefix] [gw Gw] [metrika M]\n"
+
+-#: ../lib/inet_sr.c:52
++#: ../lib/inet_sr.c:53
++#, c-format
+ msgid ""
+ " [netmask N] [mss Mss] [window W] [irtt I]\n"
+ msgstr ""
+ " [netmask N] [mss Mss] [window W] [irtt I]\n"
+
+-#: ../lib/inet_sr.c:53
++#: ../lib/inet_sr.c:54
++#, c-format
+ msgid " [mod] [dyn] [reinstate] [[dev] If]\n"
+ msgstr " [mod] [dyn] [reinstate] [[dev] If]\n"
+
+-#: ../lib/inet_sr.c:54
++#: ../lib/inet_sr.c:55
++#, c-format
+ msgid ""
+ " inet_route [-vF] add {-host|-net} Target[/prefix] [metric M] reject\n"
+ msgstr ""
+-" inet_route [-vF] add {-host|-net} Cl/[prefix] [metrika M] reject\n"
++" inet_route [-vF] add {-host|-net} Cíl/[prefix] [metrika M] reject\n"
+
+-#: ../lib/inet_sr.c:55
++#: ../lib/inet_sr.c:56
++#, c-format
+ msgid " inet_route [-FC] flush NOT supported\n"
+-msgstr " inet_route [-FC] flush NEN podporovno\n"
++msgstr " inet_route [-FC] flush NENÍ podporováno\n"
+
+ #: ../lib/inet_sr.c:158
+ #, c-format
+ msgid "route: %s: cannot use a NETWORK as gateway!\n"
+-msgstr "route: %s: s nelze pout jako brnu!\n"
++msgstr "route: %s: síť nelze použít jako bránu!\n"
+
+ #: ../lib/inet_sr.c:174
+-#, fuzzy
++#, c-format
+ msgid "route: Invalid MSS/MTU.\n"
+-msgstr "route: Nesprvn NSS.\n"
++msgstr "route: Neplatné MSS/MTU.\n"
+
+ #: ../lib/inet_sr.c:187
++#, c-format
+ msgid "route: Invalid window.\n"
+-msgstr "route: Nesprvn okno.\n"
++msgstr "route: Nesprávné okno.\n"
+
+ #: ../lib/inet_sr.c:203
++#, c-format
+ msgid "route: Invalid initial rtt.\n"
+-msgstr "route: Nesprvn zahajovac rtt.\n"
++msgstr "route: Nesprávné zahajovací rtt.\n"
+
+ #: ../lib/inet_sr.c:261
+ #, c-format
+ msgid "route: netmask %.8x doesn't make sense with host route\n"
+-msgstr "route: sov maska %.8x nedv smysl, kdy clem je cesty pota\n"
++msgstr "route: síťová maska %.8x nedává smysl, když cílem je cesty počítač\n"
+
+ #: ../lib/inet_sr.c:265
+ #, c-format
+ msgid "route: bogus netmask %s\n"
+-msgstr "route: sov maska %s je nesprvn\n"
++msgstr "route: síťová maska %s je nesprávná\n"
+
+ #: ../lib/inet_sr.c:270
++#, c-format
+ msgid "route: netmask doesn't match route address\n"
+-msgstr "route: sov maska nevyhovuje adrese cesty\n"
++msgstr "route: síťová maska nevyhovuje adrese cesty\n"
+
+ #: ../lib/inet_sr.c:306
++#, c-format
+ msgid "Flushing `inet' routing table not supported\n"
+-msgstr "Smrovac cache `inet' nelze vyprazdovat\n"
++msgstr "Směrovací cache `inet' nelze vyprazdňovat\n"
+
+ #: ../lib/inet_sr.c:310
++#, c-format
+ msgid "Modifying `inet' routing cache not supported\n"
+-msgstr "Smrovac cache `inet' nelze mnit\n"
++msgstr "Směrovací cache `inet' nelze měnit\n"
+
+-#: ../lib/ipx_gr.c:52
+-msgid "IPX not configured in this system.\n"
+-msgstr "IPX nen na tomto systmu nakonfigurovno.\n"
++#: ../lib/ipx_gr.c:53
++#, c-format
++msgid "IPX routing not in file %s or %s found.\n"
++msgstr "Směrování IPX nenalezeno v souboru %s nebo %s.\n"
+
+-#: ../lib/ipx_gr.c:56
++#: ../lib/ipx_gr.c:62
++#, c-format
+ msgid "Kernel IPX routing table\n"
+-msgstr "Smrovac tabulka v jdru pro IPX\n"
++msgstr "Směrovací tabulka v jádru pro IPX\n"
+
+ #. xxx
+-#: ../lib/ipx_gr.c:57
++#: ../lib/ipx_gr.c:63
++#, c-format
+ msgid "Destination Router Net Router Node\n"
+-msgstr "Cl Smrova S Smrova Uzel\n"
++msgstr "Cíl Směrovač Síť Směrovač Uzel\n"
+
+ #: ../lib/ipx_sr.c:33
++#, c-format
+ msgid "IPX: this needs to be written\n"
+-msgstr "IPX: toto je teba uloit\n"
++msgstr "IPX: toto je třeba uložit\n"
+
+-#: ../lib/masq_info.c:197
++#: ../lib/masq_info.c:198
++#, c-format
+ msgid "IP masquerading entries\n"
+-msgstr "IP maskovac poloky\n"
++msgstr "IP maskovací položky\n"
+
+-#: ../lib/masq_info.c:200
++#: ../lib/masq_info.c:201
++#, c-format
+ msgid "prot expire source destination ports\n"
+-msgstr "prot ivot zdroj cl porty\n"
++msgstr "prot život zdroj cíl porty\n"
+
+-#: ../lib/masq_info.c:203
++#: ../lib/masq_info.c:204
++#, c-format
+ msgid ""
+-"prot expire initseq delta prevd source destination "
+-" ports\n"
++"prot expire initseq delta prevd source "
++"destination ports\n"
+ msgstr ""
+-"prot ivot zahajsek delta pedchd zdroj cl "
+-" porty\n"
++"prot život zahajsek delta předchd zdroj "
++"cíl porty\n"
+
+ #: ../lib/netrom_gr.c:48
++#, c-format
+ msgid "NET/ROM not configured in this system.\n"
+-msgstr "NET/ROM nen na tomto systmu nakonfigurovno.\n"
++msgstr "NET/ROM není na tomto systému nakonfigurováno.\n"
+
+ #: ../lib/netrom_gr.c:51
++#, c-format
+ msgid "Kernel NET/ROM routing table\n"
+-msgstr "Smrovac tabulka v jdru pro NET/ROM\n"
++msgstr "Směrovací tabulka v jádru pro NET/ROM\n"
+
+ #: ../lib/netrom_gr.c:52
++#, c-format
+ msgid "Destination Mnemonic Quality Neighbour Iface\n"
+-msgstr "Cl Mnemonika Kvalita Soused Rozhran\n"
++msgstr "Cíl Mnemonika Kvalita Soused Rozhraní\n"
+
+ #: ../lib/netrom_sr.c:34
++#, c-format
+ msgid "netrom usage\n"
+-msgstr "pouit netrom\n"
++msgstr "použití netrom\n"
+
+ #: ../lib/netrom_sr.c:44
++#, c-format
+ msgid "NET/ROM: this needs to be written\n"
+-msgstr "NET/ROM: toto je poteba uloit\n"
++msgstr "NET/ROM: toto je potřeba uložit\n"
+
+ #: ../lib/ppp.c:44
++#, c-format
+ msgid "You cannot start PPP with this program.\n"
+-msgstr "Tmto programem nelze PPP spustit.\n"
++msgstr "Tímto programem nelze PPP spustit.\n"
+
+ #: ../lib/ppp_ac.c:38
++#, c-format
+ msgid "Sorry, use pppd!\n"
+-msgstr "Lituji, pouijte pppd!\n"
++msgstr "Lituji, použijte pppd!\n"
+
+ #: ../lib/rose.c:87
+ msgid "Node address must be ten digits"
+-msgstr "Adresa uzlu mus mt 10 slic"
++msgstr "Adresa uzlu musí mít 10 číslic"
+
+ #: ../lib/rose_gr.c:51
++#, c-format
+ msgid "ROSE not configured in this system.\n"
+-msgstr "ROSE nen na tomto systmu nakonfigurovno.\n"
++msgstr "ROSE není na tomto systému nakonfigurováno.\n"
+
+ #: ../lib/rose_gr.c:54
++#, c-format
+ msgid "Kernel ROSE routing table\n"
+-msgstr "Smrovac tabulka v jdru pro ROSE\n"
++msgstr "Směrovací tabulka v jádru pro ROSE\n"
+
+-#: ../lib/tr.c:70 ../lib/tr.c:85
++#: ../lib/tr.c:86 ../lib/tr.c:101
+ #, c-format
+ msgid "in_tr(%s): invalid token ring address!\n"
+-msgstr "in_tr(%s): nesprvn token ring adresa!\n"
++msgstr "in_tr(%s): nesprávná token ring adresa!\n"
+
+-#: ../lib/tr.c:97
++#: ../lib/tr.c:113
+ #, c-format
+ msgid "in_tr(%s): trailing : ignored!\n"
+-msgstr "in_tr(%s): nadbyten: ignorovno!\n"
++msgstr "in_tr(%s): nadbytečné: ignorováno!\n"
+
+-#: ../lib/tr.c:109
++#: ../lib/tr.c:125
+ #, c-format
+ msgid "in_tr(%s): trailing junk!\n"
+-msgstr "in_tr(%s): nadbyten znaky!\n"
++msgstr "in_tr(%s): nadbytečné znaky!\n"
+
+-#: ../lib/interface.c:124
++#: ../lib/interface.c:176
+ #, c-format
+ msgid "warning: no inet socket available: %s\n"
+-msgstr "varovn: nen dostupn dn inet soket: %s\n"
++msgstr "varování: není dostupný žádný inet soket: %s\n"
+
+-#: ../lib/interface.c:270
++#: ../lib/interface.c:325
+ #, c-format
+ msgid "Warning: cannot open %s (%s). Limited output.\n"
+-msgstr ""
++msgstr "Pozor: %s nelze otevřít (%s). Výstup omezen.\n"
+
+ #. Give better error message for this case.
+-#: ../lib/interface.c:504
++#: ../lib/interface.c:571
+ msgid "Device not found"
+-msgstr "Zazen nebylo nalezeno"
++msgstr "Zařízení nebylo nalezeno"
+
+-#: ../lib/interface.c:508
++#: ../lib/interface.c:575
+ #, c-format
+ msgid "%s: error fetching interface information: %s\n"
+-msgstr "%s: chyba pi zskvn informac o rozhran %s\n"
++msgstr "%s: chyba při získávání informací o rozhraní %s\n"
++
++#: ../lib/interface.c:608
++msgid " - no statistics available -"
++msgstr " - statistická data nejsou dostupná -"
++
++#: ../lib/interface.c:612
++#, c-format
++msgid "[NO FLAGS]"
++msgstr "[ŽÁDNÉ PŘÍZNAKY]"
++
++#: ../lib/interface.c:694
++msgid "UP,"
++msgstr "AKTIVOVÁNO,"
++
++#: ../lib/interface.c:696
++msgid "BROADCAST,"
++msgstr "VŠESMĚR,"
++
++#: ../lib/interface.c:698
++msgid "DEBUG,"
++msgstr "LADĚNÍ,"
++
++#: ../lib/interface.c:700
++msgid "LOOPBACK,"
++msgstr "SMYČKA,"
++
++#: ../lib/interface.c:702
++msgid "POINTOPOINT,"
++msgstr "DVOUBODOVÉ,"
++
++# ??
++#: ../lib/interface.c:704
++msgid "NOTRAILERS,"
++msgstr "ŽÁDNÉ_TRAILERS"
++
++#: ../lib/interface.c:706
++msgid "RUNNING,"
++msgstr "BĚŽÍ,"
++
++#: ../lib/interface.c:708
++msgid "NOARP,"
++msgstr "NEARP,"
++
++#: ../lib/interface.c:710
++msgid "PROMISC,"
++msgstr "PROMISK,"
++
++#: ../lib/interface.c:712
++msgid "ALLMULTI,"
++msgstr "ALLMULTI,"
++
++#: ../lib/interface.c:714
++msgid "SLAVE,"
++msgstr "PODŘÍZENÝ,"
++
++#: ../lib/interface.c:716
++msgid "MASTER,"
++msgstr "NADŘÍZENÝ,"
++
++#: ../lib/interface.c:718
++msgid "MULTICAST,"
++msgstr "MULTICAST,"
++
++#: ../lib/interface.c:721
++msgid "DYNAMIC,"
++msgstr "DYNAMIC,"
++
++#: ../lib/interface.c:730
++#, c-format
++msgid "%s: %s mtu %d metric %d"
++msgstr "%s: %s mtu %d metrika %d"
++
++#: ../lib/interface.c:734
++#, c-format
++msgid " outfill %d keepalive %d"
++msgstr " outfill %d keepalive %d"
++
++#: ../lib/interface.c:743 ../lib/interface.c:841
++#, c-format
++msgid " %s %s"
++msgstr " %s %s"
++
++#: ../lib/interface.c:745
++#, c-format
++msgid " netmask %s"
++msgstr " síťová_maska %s"
++
++#: ../lib/interface.c:747
++#, c-format
++msgid " broadcast %s"
++msgstr " všesměr %s"
++
++#: ../lib/interface.c:750
++#, c-format
++msgid " destination %s"
++msgstr " cíl %s"
++
++#: ../lib/interface.c:769
++#, c-format
++msgid " %s %s prefixlen %d"
++msgstr " %s %s délka_prefixu %d"
++
++#: ../lib/interface.c:773
++#, c-format
++msgid " scopeid 0x%x"
++msgstr " scopeid 0x%x"
++
++#: ../lib/interface.c:777
++msgid "compat,"
++msgstr "kompat,"
++
++#: ../lib/interface.c:781
++msgid "global,"
++msgstr "globální,"
++
++#: ../lib/interface.c:783
++msgid "link,"
++msgstr "linka,"
++
++#: ../lib/interface.c:785
++msgid "site,"
++msgstr "oblast,"
++
++#: ../lib/interface.c:787
++msgid "host,"
++msgstr "stroj,"
++
++#: ../lib/interface.c:805
++#, c-format
++msgid " %s Ethernet-II %s\n"
++msgstr " %s Ethernet-II %s\n"
++
++#: ../lib/interface.c:808
++#, c-format
++msgid " %s Ethernet-SNAP %s\n"
++msgstr " %s Ethernet-SNAP %s\n"
++
++#: ../lib/interface.c:811
++#, c-format
++msgid " %s Ethernet802.2 %s\n"
++msgstr " %s Ethernet802.2 %s\n"
++
++#: ../lib/interface.c:814
++#, c-format
++msgid " %s Ethernet802.3 %s\n"
++msgstr " %s Ethernet802.3 %s\n"
++
++#: ../lib/interface.c:824 ../lib/interface.c:833
++#, c-format
++msgid " %s %s\n"
++msgstr " %s %s\n"
++
++#: ../lib/interface.c:843
++#, c-format
++msgid " %s"
++msgstr " %s"
++
++#: ../lib/interface.c:845
++#, c-format
++msgid " txqueuelen %d"
++msgstr " délka_odchozí_fronty %d"
++
++#: ../lib/interface.c:850
++#, c-format
++msgid " media %s"
++msgstr " médium %s"
++
++#: ../lib/interface.c:852
++#, c-format
++msgid "autoselect"
++msgstr "automatika"
++
++#: ../lib/interface.c:903
++#, c-format
++msgid "RX packets %llu bytes %llu (%lu.%lu %s)\n"
++msgstr "RX packetů %llu bajtů %llu (%lu,%lu %s)\n"
++
++#: ../lib/interface.c:909
++#, c-format
++msgid "RX compressed:%lu\n"
++msgstr "RX komprimováno %lu\n"
++
++#: ../lib/interface.c:912
++#, c-format
++msgid "RX errors %lu dropped %lu overruns %lu frame %lu\n"
++msgstr "RX chyb %lu zahozeno %lu přetečení %lu rámců %lu\n"
++
++#: ../lib/interface.c:918
++#, c-format
++msgid "TX packets %llu bytes %llu (%lu.%lu %s)\n"
++msgstr "TX packetů %llu bajtů %llu (%lu,%lu %s)\n"
++
++#: ../lib/interface.c:924
++#, c-format
++msgid "TX compressed %lu\n"
++msgstr "TX komprimováno %lu\n"
++
++# carrier?
++#: ../lib/interface.c:927
++#, c-format
++msgid "TX errors %lu dropped %lu overruns %lu carrier %lu collisions %lu\n"
++msgstr "TX chyb %lu zahozeno %lu přetečení %lu přenos %lu kolizí %lu\n"
+
+-#: ../lib/sockets.c:59
++#: ../lib/interface.c:937
++#, c-format
++msgid "interrupt %d "
++msgstr "přerušení %d "
++
++#. Only print devices using it for
++#. I/O maps
++#: ../lib/interface.c:940
++#, c-format
++msgid "base 0x%x "
++msgstr "základ 0x%x "
++
++#: ../lib/interface.c:942
++#, c-format
++msgid "memory 0x%lx-%lx "
++msgstr "paměť 0x%lx–%lx "
++
++#: ../lib/interface.c:945
++#, c-format
++msgid " dma 0x%x"
++msgstr " DMA 0x%x"
++
++#: ../lib/sockets.c:63
++#, c-format
+ msgid "No usable address families found.\n"
+-msgstr "Nebyla nalezena dn pouiteln tda adres.\n"
++msgstr "Nebyla nalezena žádná použitelná třída adres.\n"
+
+ #: ../lib/util-ank.c:229
+ #, c-format
+ msgid "ip: %s is invalid inet address\n"
+-msgstr "ip: %s nen platnou inet adresou\n"
++msgstr "ip: %s není platnou inet adresou\n"
+
+ #: ../lib/util-ank.c:238
+ #, c-format
+ msgid "ip: %s is invalid inet prefix\n"
+-msgstr "ip: %s nen platnm inet prefixem\n"
++msgstr "ip: %s není platným inet prefixem\n"
+
+ #: ../lib/util-ank.c:248
+ #, c-format
+ msgid "ip: %s is invalid IPv4 address\n"
+-msgstr "ip: %s nen platnou IPv4 adresou\n"
++msgstr "ip: %s není platnou IPv4 adresou\n"
+
+ #: ../lib/util-ank.c:256
+ #, c-format
+ msgid "ip: argument is wrong: %s\n"
+-msgstr "ip: argument %s je nesprvn\n"
++msgstr "ip: argument %s je nesprávný\n"
+
+-#: ../ipmaddr.c:56
++#: ../ipmaddr.c:61
++#, c-format
+ msgid "Usage: ipmaddr [ add | del ] MULTIADDR dev STRING\n"
+-msgstr " Usage: ipmaddr [ add | del ] MULTIADR dev ETZEC\n"
++msgstr " Usage: ipmaddr [ add | del ] MULTIADR dev ŘETĚZEC\n"
+
+-#: ../ipmaddr.c:57
++#: ../ipmaddr.c:62
++#, c-format
+ msgid " ipmaddr show [ dev STRING ] [ ipv4 | ipv6 | link | all ]\n"
+-msgstr " ipmaddr show [ dev ETZEC ] [ ipv4 | ipv6 | link | all ]\n"
++msgstr " ipmaddr show [ dev ŘETĚZEC ] [ ipv4 | ipv6 | link | all ]\n"
+
+-#: ../ipmaddr.c:58
++#: ../ipmaddr.c:63
++#, c-format
+ msgid " ipmaddr -V | -version\n"
+ msgstr " ipmaddr -V | -version\n"
+
+-#: ../ipmaddr.c:258
++#: ../ipmaddr.c:263
+ #, c-format
+ msgid "family %d "
+-msgstr "tda %d "
++msgstr "třída %d "
+
+-#: ../ipmaddr.c:267
++#: ../ipmaddr.c:272
+ #, c-format
+ msgid " users %d"
+-msgstr " uivatel %d"
++msgstr " uživatelé %d"
+
+-#: ../ipmaddr.c:353
++#: ../ipmaddr.c:361
+ msgid "Cannot create socket"
+-msgstr "Soket nelze vytvoit"
++msgstr "Soket nelze vytvořit"
+
+ #: ../slattach.c:180
+ #, c-format
+ msgid "slattach: /dev/%s already locked!\n"
+-msgstr "slattach: zazen /dev/%s je ji zameno!\n"
++msgstr "slattach: zařízení /dev/%s je již zamčeno!\n"
+
+ #: ../slattach.c:186
+ #, c-format
+@@ -2433,80 +3184,169 @@ msgid "slattach: tty_lock: (%s): %s\n"
+ msgstr "slattach: tty_lock: (%s): %s\n"
+
+ #: ../slattach.c:192
++#, c-format
+ msgid "slattach: cannot write PID file\n"
+ msgstr "slattach: do PID souboru nelze zapisovat\n"
+
+ #: ../slattach.c:202
+ #, c-format
+ msgid "slattach: tty_lock: UUCP user %s unknown!\n"
+-msgstr "slattach: tty_lock: uivatel UUCP %s nen znm!\n"
++msgstr "slattach: tty_lock: uživatel UUCP %s není znám!\n"
+
+-#: ../slattach.c:430
++#: ../slattach.c:432
+ #, c-format
+ msgid "slattach: tty_hangup(DROP): %s\n"
+ msgstr "slattach: tty_hangup(DROP): %s\n"
+
+-#: ../slattach.c:437
++#: ../slattach.c:439
+ #, c-format
+ msgid "slattach: tty_hangup(RAISE): %s\n"
+ msgstr "slattach: tty_hangup(RAISE): %s\n"
+
+-#: ../slattach.c:486
++#: ../slattach.c:470
++#, c-format
++msgid "slattach: tty name too long\n"
++msgstr "slattach: název TTY je příliš dlouhý\n"
++
++#: ../slattach.c:500
++#, c-format
+ msgid "slattach: tty_open: cannot get current state!\n"
+-msgstr "slattach: tty_open: aktuln stav nelze zjistit!\n"
++msgstr "slattach: tty_open: aktuální stav nelze zjistit!\n"
+
+-#: ../slattach.c:493
++#: ../slattach.c:507
++#, c-format
+ msgid "slattach: tty_open: cannot get current line disc!\n"
+-msgstr "slattach: tty_open: aktuln linkovou disciplnu nelze zjistit!\n"
++msgstr "slattach: tty_open: aktuální linkovou disciplínu nelze zjistit!\n"
+
+-#: ../slattach.c:501
++#: ../slattach.c:515
++#, c-format
+ msgid "slattach: tty_open: cannot set RAW mode!\n"
+-msgstr "slattach: tty_open: reim RAW nelze nastavit!\n"
++msgstr "slattach: tty_open: režim RAW nelze nastavit!\n"
+
+-#: ../slattach.c:508
++#: ../slattach.c:522
+ #, c-format
+ msgid "slattach: tty_open: cannot set %s bps!\n"
+ msgstr "slattach: tty_open: %s bps nelze nastavit!\n"
+
+-#: ../slattach.c:518
++#: ../slattach.c:532
++#, c-format
+ msgid "slattach: tty_open: cannot set 8N1 mode!\n"
+-msgstr "slattach: tty_open: reim 8N1 nelze nastavit!\n"
++msgstr "slattach: tty_open: režim 8N1 nelze nastavit!\n"
++
++#: ../slattach.c:674
++#, c-format
++msgid "slattach: setvbuf(stdout,0,_IOLBF,0) : %s\n"
++msgstr "slattach: setvbuf(stdout, 0, _IOLBF, 0): %s\n"
+
+-#: ../slattach.c:686
++#: ../slattach.c:706
+ #, c-format
+ msgid "%s started"
+-msgstr "protokol %s sputn"
++msgstr "protokol %s spuštěn"
+
+-#: ../slattach.c:687
++#: ../slattach.c:707
+ #, c-format
+ msgid " on %s"
+ msgstr " na %s"
+
+-#: ../slattach.c:688
++#: ../slattach.c:708
+ #, c-format
+ msgid " interface %s\n"
+-msgstr " rozhran %s\n"
++msgstr " rozhraní %s\n"
++
++#~ msgid ""
++#~ " arp [-v] [<HW>] [-i <if>] -s <hostname> <hwaddr> [netmask <nm>] pub "
++#~ "<-''-\n"
++#~ msgstr ""
++#~ " arp [-v] [<HW>] [-i <if>] -s <soubor> <hwadr> [síťmask <čís>] <-''-\n"
++
++#~ msgid "%-9.9s Link encap:%s "
++#~ msgstr "%-9.9s Zapouzdření:%s "
++
++#~ msgid "HWaddr %s "
++#~ msgstr "HWadr %s "
++
++#~ msgid "Media:%s"
++#~ msgstr "Médium:%s"
++
++#~ msgid "(auto)"
++#~ msgstr "(auto)"
++
++#~ msgid " P-t-P:%s "
++#~ msgstr " P-t-P:%s "
++
++# V ostatních katalozích se překládá Broadcast -> všesměrové vysílání.
++# Tudiž bcast -> Všesměr :)
++#~ msgid " Bcast:%s "
++#~ msgstr " Všesměr:%s "
++
++#~ msgid " Mask:%s\n"
++#~ msgstr "Maska:%s\n"
++
++#~ msgid " Scope:"
++#~ msgstr " Rozsah:"
++
++#~ msgid "Unknown"
++#~ msgstr "Neznám."
++
++#~ msgid " EtherTalk Phase 2 addr:%s\n"
++#~ msgstr " EtherTalk Phase 2 adr:%s\n"
++
++#~ msgid " econet addr:%s\n"
++#~ msgstr " econet adr:%s\n"
++
++# Hic sunt leones ...
++#~ msgid "[NO FLAGS] "
++#~ msgstr "[ŽÁDNÉ PŘÍZNAKY]"
++
++#~ msgid " MTU:%d Metric:%d"
++#~ msgstr " MTU:%d Metrika:%d"
++
++#~ msgid " compressed:%lu\n"
++#~ msgstr " komprimováno:%lu\n"
++
++#~ msgid " collisions:%lu "
++#~ msgstr " kolizí:%lu "
++
++#~ msgid "DMA chan:%x "
++#~ msgstr "Kanál DMA:%x "
++
++#~ msgid "%s: unknown interface: %s\n"
++#~ msgstr "%s: rozhraní %s není známo\n"
++
++#~ msgid "address mask replies"
++#~ msgstr "odpovědi na žádost o masku podsítě"
++
++#~ msgid "unknown title %s\n"
++#~ msgstr "titulek %s je neznámý\n"
++
++#~ msgid "Routing table for `ddp' not yet supported.\n"
++#~ msgstr "Směrovací tabulka pro `ddp' není zatím podporována.\n"
++
++#~ msgid "IPX not configured in this system.\n"
++#~ msgstr "IPX není na tomto systému nakonfigurováno.\n"
+
+ #~ msgid ""
+-#~ " This comand can read or set the hostname or the NIS domainname. You can\n"
++#~ " This comand can read or set the hostname or the NIS domainname. You "
++#~ "can\n"
+ #~ msgstr ""
+-#~ " Tento program zjiuje a nastavuje jmno potae i NIS domny. Me "
+-#~ "tak\n"
++#~ " Tento program zjišťuje a nastavuje jméno počítače či NIS domény. Může "
++#~ "také\n"
+
+ #~ msgid ""
+ #~ " also read the DNS domain or the FQDN (fully qualified domain name).\n"
+-#~ msgstr " zjistit DNS domnu i kanonick jmno potae.\n"
++#~ msgstr " zjistit DNS doménu či kanonické jméno počítače.\n"
+
+ #~ msgid ""
+ #~ " Unless you are using bind or NIS for host lookups you can change the\n"
+ #~ msgstr ""
+-#~ " Pokud nepouvte bind i NIS pro vyhledvn jmen pota, pak mete\n"
++#~ " Pokud nepoužíváte bind či NIS pro vyhledávání jmen počítačů, pak "
++#~ "můžete\n"
+
+ #~ msgid ""
+ #~ " FQDN (Fully Qualified Domain Name) and the DNS domain name (which is\n"
+ #~ msgstr ""
+-#~ " zmnit kanonick jmno potae a jmno DNS domny (je soust "
+-#~ "kanonickho\n"
++#~ " změnit kanonické jméno počítače a jméno DNS domény (je součástí "
++#~ "kanonického\n"
+
+ #~ msgid " part of the FQDN) in the /etc/hosts file.\n"
+-#~ msgstr " jmna potae) v souboru /etc/hosts.\n"
++#~ msgstr " jména počítače) v souboru /etc/hosts.\n"
+diff --git a/po/de.po b/po/de.po
+index f884dd9..9f8f679 100644
+--- a/po/de.po
++++ b/po/de.po
+@@ -1,4 +1,4 @@
+-# $Id: de.po,v 1.10 2000/08/01 03:19:48 ecki Exp $
++# $Id: de.po,v 1.11 2003/10/25 21:15:09 ecki Exp $
+ # German translation for net-tools 1.51
+ # Copyright (C) 1999 Ralf Bchle <ralf@gnu.org>
+ msgid ""
+@@ -9,7 +9,7 @@ msgstr ""
+ "Last-Translator: Ralf Bchle <ralf@gnu.org>\n"
+ "Language-Team:\n"
+ "MIME-Version: 1.0\n"
+-"Content-Type: text/plain; charset=iso8859-1\n"
++"Content-Type: text/plain; charset=iso-8859-1\n"
+ "Content-Transfer-Encoding: 8bit\n"
+
+ #: ../arp.c:110 ../arp.c:269
+@@ -59,12 +59,16 @@ msgid "arp: cannot set entry on line %u of etherfile %s !\n"
+ msgstr "arp: Kann Eintrag auf Zeile %u von Etherdatei %s nicht setzen!\n"
+
+ #: ../arp.c:437
+-msgid "Address\t\t\tHWtype\tHWaddress\t Flags Mask\t\t Iface\n"
+-msgstr "Adresse\t\t\tHWTyp\tHWAdresse\t Flags Maske\t\t Iface\n"
++msgid ""
++"Address HWtype HWaddress Flags Mask "
++"Iface\n"
++msgstr ""
++"Adresse HW-Typ HW-Adresse Flags Maske "
++"Iface\n"
+
+ #: ../arp.c:467
+ msgid "(incomplete)"
+-msgstr "(unvollsndig)"
++msgstr "(unvollstndig)"
+
+ #: ../arp.c:484
+ #, c-format
+diff --git a/po/et_EE.po b/po/et_EE.po
+index d748410..827406d 100644
+--- a/po/et_EE.po
++++ b/po/et_EE.po
+@@ -1,66 +1,65 @@
+ # Estonian translations for net-tools
+-# Copyright (C) 1999 Free Software Foundation, Inc.
+-# Meelis Roos <Meelis.Roos@mail.ee>, 1999.
++# Copyright (C) 1999-2001 Free Software Foundation, Inc.
++# Meelis Roos <mroos@linux.ee>, 1999-2001.
+ #
+-#, fuzzy
+ msgid ""
+ msgstr ""
+-"Project-Id-Version: net-tools 1.58\n"
+-"POT-Creation-Date: 2001-02-15 21:28+0200\n"
+-"PO-Revision-Date: 2001-02-15 18:00+0300\n"
++"Project-Id-Version: net-tools 1.60\n"
++"POT-Creation-Date: 2001-04-16 20:24+0200\n"
++"PO-Revision-Date: 2001-04-16 20:30+0200\n"
+ "Last-Translator: Meelis Roos <mroos@linux.ee>\n"
+ "Language-Team: Estonian <linux-ee@eenet.ee>\n"
+ "MIME-Version: 1.0\n"
+ "Content-Type: text/plain; charset=iso-8859-15\n"
+ "Content-Transfer-Encoding: 8bit\n"
+
+-#: ../arp.c:110 ../arp.c:269
++#: ../arp.c:111 ../arp.c:270
+ msgid "arp: need host name\n"
+ msgstr "arp: puudub hosti nimi\n"
+
+-#: ../arp.c:207 ../arp.c:221
++#: ../arp.c:208 ../arp.c:222
+ #, c-format
+ msgid "No ARP entry for %s\n"
+ msgstr "%s jaoks pole ARP kirjet\n"
+
+-#: ../arp.c:239
++#: ../arp.c:240
+ #, c-format
+ msgid "arp: cant get HW-Address for `%s': %s.\n"
+ msgstr "arp: ei saa riistvaralist aadressi `%s' jaoks: %s\n"
+
+-#: ../arp.c:243
++#: ../arp.c:244
+ msgid "arp: protocol type mismatch.\n"
+ msgstr "arp: vale protokolli tp\n"
+
+-#: ../arp.c:252
++#: ../arp.c:253
+ #, c-format
+ msgid "arp: device `%s' has HW address %s `%s'.\n"
+ msgstr "arp: seadmel `%s' on riistvaraline aadress %s `%s'\n"
+
+-#: ../arp.c:282
++#: ../arp.c:283
+ msgid "arp: need hardware address\n"
+ msgstr "arp: puudub riistvaraline aadress\n"
+
+-#: ../arp.c:290
++#: ../arp.c:291
+ msgid "arp: invalid hardware address\n"
+ msgstr "arp: vigane riistvaraline aadress\n"
+
+-#: ../arp.c:387
++#: ../arp.c:388
+ #, c-format
+ msgid "arp: cannot open etherfile %s !\n"
+ msgstr "arp: ei saa avada faili %s\n"
+
+-#: ../arp.c:403
++#: ../arp.c:404
+ #, c-format
+ msgid "arp: format error on line %u of etherfile %s !\n"
+ msgstr "arp: formaadiviga real %u failis %s\n"
+
+-#: ../arp.c:416
++#: ../arp.c:417
+ #, c-format
+ msgid "arp: cannot set entry on line %u of etherfile %s !\n"
+ msgstr "arp: ei saa kehtestada ARP kirjet real %u failis %s\n"
+
+-#: ../arp.c:437
++#: ../arp.c:438
+ msgid ""
+ "Address HWtype HWaddress Flags Mask "
+ "Iface\n"
+@@ -68,45 +67,45 @@ msgstr ""
+ "Aadress HWtp HWaadress Lipud Mask "
+ "Liides\n"
+
+-#: ../arp.c:467
++#: ../arp.c:468
+ msgid "(incomplete)"
+ msgstr "(mittetielik)"
+
+-#: ../arp.c:484
++#: ../arp.c:485
+ #, c-format
+ msgid "%s (%s) at "
+ msgstr "%s (%s) aadressil "
+
+-#: ../arp.c:490
++#: ../arp.c:491
+ msgid "<incomplete> "
+ msgstr "<mittetielik>"
+
+-#: ../arp.c:496
++#: ../arp.c:497
+ #, c-format
+ msgid "netmask %s "
+ msgstr "vrgumask %s "
+
+-#: ../arp.c:513
++#: ../arp.c:514
+ #, c-format
+ msgid "on %s\n"
+ msgstr "liides %s\n"
+
+-#: ../arp.c:592
++#: ../arp.c:593
+ #, c-format
+ msgid "Entries: %d\tSkipped: %d\tFound: %d\n"
+ msgstr "ARP kirjeid kokku: %s\tignoreerisin: %d\tleidsin: %d\n"
+
+-#: ../arp.c:596
++#: ../arp.c:597
+ #, c-format
+ msgid "%s (%s) -- no entry\n"
+ msgstr "%s (%s) -- pole kirjet\n"
+
+-#: ../arp.c:598
++#: ../arp.c:599
+ #, c-format
+ msgid "arp: in %d entries no match found.\n"
+ msgstr "arp: ei leidnud %d kirje hulgast sobivat\n"
+
+-#: ../arp.c:613
++#: ../arp.c:614
+ msgid ""
+ "Usage:\n"
+ " arp [-vn] [<HW>] [-i <if>] [-a] [<hostname>] <-Display ARP "
+@@ -116,7 +115,7 @@ msgstr ""
+ "ARP cache vaatamine:\n"
+ " arp [-vn] [<HW>] [-i <if>] [-a] [<hosti nimi>]\n"
+
+-#: ../arp.c:614
++#: ../arp.c:615
+ msgid ""
+ " arp [-v] [-i <if>] -d <hostname> [pub][nopub] <-Delete ARP "
+ "entry\n"
+@@ -124,7 +123,7 @@ msgstr ""
+ "ARP kirje kustutamine:\n"
+ " arp [-v] [-i <if>] -d <hosti nimi> [pub] [nopub]\n"
+
+-#: ../arp.c:615
++#: ../arp.c:616
+ msgid ""
+ " arp [-vnD] [<HW>] [-i <if>] -f [<filename>] <-Add entry from "
+ "file\n"
+@@ -132,7 +131,7 @@ msgstr ""
+ "ARP kirjete lisamine failist:\n"
+ " arp [-vnD] [<HW>] [-i <if>] -f [<failinimi>]\n"
+
+-#: ../arp.c:616
++#: ../arp.c:617
+ msgid ""
+ " arp [-v] [<HW>] [-i <if>] -s <hostname> <hwaddr> [temp][nopub] <-Add "
+ "entry\n"
+@@ -140,14 +139,14 @@ msgstr ""
+ "ARP kirje lisamine:\n"
+ " arp [-v] [<HW>] [-i <if>] -s <hosti nimi> <hwaddr> [temp] [nopub]\n"
+
+-#: ../arp.c:617
++#: ../arp.c:618
+ msgid ""
+ " arp [-v] [<HW>] [-i <if>] -s <hostname> <hwaddr> [netmask <nm>] pub "
+ "<-''-\n"
+ msgstr ""
+ " arp [-v] [<HW>] [-i <if>] -s <hosti nimi> <hwaddr> [netmask <nm>] pub\n"
+
+-#: ../arp.c:618
++#: ../arp.c:619
+ msgid ""
+ " arp [-v] [<HW>] [-i <if>] -Ds <hostname> <if> [netmask <nm>] pub "
+ "<-''-\n"
+@@ -156,7 +155,7 @@ msgstr ""
+ " arp [-v] [<HW>] [-i <if>] -Ds <hosti nimi> <if> [netmask <nm>] pub\n"
+ "\n"
+
+-#: ../arp.c:620
++#: ../arp.c:621
+ msgid ""
+ " -a display (all) hosts in alternative (BSD) "
+ "style\n"
+@@ -164,37 +163,37 @@ msgstr ""
+ " -a nita kiki hoste alternatiivsel (BSD) "
+ "kujul\n"
+
+-#: ../arp.c:621
++#: ../arp.c:622
+ msgid " -s, --set set a new ARP entry\n"
+ msgstr " -s, --set uue ARP kirje seadmine\n"
+
+-#: ../arp.c:622
++#: ../arp.c:623
+ msgid " -d, --delete delete a specified entry\n"
+ msgstr " -d, --delete mratud kirje kustutamine\n"
+
+-#: ../arp.c:623 ../netstat.c:1485 ../route.c:85
++#: ../arp.c:624 ../netstat.c:1490 ../route.c:86
+ msgid " -v, --verbose be verbose\n"
+ msgstr " -v, --verbose jutukas vljund\n"
+
+-#: ../arp.c:624
++#: ../arp.c:625 ../netstat.c:1491 ../route.c:87
+ msgid " -n, --numeric don't resolve names\n"
+ msgstr " -n, --numeric mitte lahendada nimesid\n"
+
+-#: ../arp.c:625
++#: ../arp.c:626
+ msgid ""
+ " -i, --device specify network interface (e.g. eth0)\n"
+ msgstr ""
+ " -i, --device vrguliidese tpsustamine (niteks eth0)\n"
+
+-#: ../arp.c:626
++#: ../arp.c:627
+ msgid " -D, --use-device read <hwaddr> from given device\n"
+ msgstr " -D, --use-device lugeda <hwaddr> vastavalt liideselt\n"
+
+-#: ../arp.c:627
++#: ../arp.c:628
+ msgid " -A, -p, --protocol specify protocol family\n"
+ msgstr " -A, -p, --protocol protokollipere mramine\n"
+
+-#: ../arp.c:628
++#: ../arp.c:629
+ msgid ""
+ " -f, --file read new entries from file or from "
+ "/etc/ethers\n"
+@@ -204,125 +203,125 @@ msgstr ""
+ "/etc/ethers'st\n"
+ "\n"
+
+-#: ../arp.c:630 ../rarp.c:181
++#: ../arp.c:631 ../rarp.c:182
+ #, c-format
+ msgid " <HW>=Use '-H <hw>' to specify hardware address type. Default: %s\n"
+ msgstr ""
+ " <HW>=kasutage '-H <hw>' riistvaralise aadressi mramiseks.\n"
+ " Vaikimisi: %s\n"
+
+-#: ../arp.c:631 ../rarp.c:182
++#: ../arp.c:632 ../rarp.c:183
+ msgid " List of possible hardware types (which support ARP):\n"
+ msgstr " Vimalike ARP-i toetavate riistvara tpide nimekiri:\n"
+
+-#: ../arp.c:664 ../arp.c:749
++#: ../arp.c:666 ../arp.c:751
+ #, c-format
+ msgid "%s: hardware type not supported!\n"
+ msgstr "arp: riistvara tpi %s ei toetata\n"
+
+-#: ../arp.c:668
++#: ../arp.c:670
+ #, c-format
+ msgid "%s: address family not supported!\n"
+ msgstr "arp: aadressiperekonda %s ei toetata\n"
+
+-#: ../arp.c:703
++#: ../arp.c:705
+ msgid "arp: -N not yet supported.\n"
+ msgstr "arp: -N toetust pole veel\n"
+
+-#: ../arp.c:713
++#: ../arp.c:715
+ #, c-format
+ msgid "arp: %s: unknown address family.\n"
+ msgstr "arp: tundmatu aadressiperekond %s\n"
+
+-#: ../arp.c:722
++#: ../arp.c:724
+ #, c-format
+ msgid "arp: %s: unknown hardware type.\n"
+ msgstr "arp: tundmatu riistvara tp %s\n"
+
+-#: ../arp.c:741
++#: ../arp.c:743
+ #, c-format
+ msgid "arp: %s: kernel only supports 'inet'.\n"
+ msgstr "arp: tuumas on ainult 'inet' aadressiperekonna toetus\n"
+
+-#: ../arp.c:754
++#: ../arp.c:756
+ #, c-format
+ msgid "arp: %s: hardware type without ARP support.\n"
+ msgstr "arp: riistvara tbil %s pole ARP toetust\n"
+
+-#: ../hostname.c:69
++#: ../hostname.c:70
+ #, c-format
+ msgid "Setting nodename to `%s'\n"
+ msgstr "Sean slme nimeks `%s'\n"
+
+-#: ../hostname.c:74
++#: ../hostname.c:75
+ #, c-format
+ msgid "%s: you must be root to change the node name\n"
+ msgstr "%s: ainult root saab slme nime muuta\n"
+
+-#: ../hostname.c:77 ../hostname.c:97 ../hostname.c:116
++#: ../hostname.c:78 ../hostname.c:98 ../hostname.c:117
+ #, c-format
+ msgid "%s: name too long\n"
+ msgstr "%s: nimi on liiga pikk\n"
+
+-#: ../hostname.c:89
++#: ../hostname.c:90
+ #, c-format
+ msgid "Setting hostname to `%s'\n"
+ msgstr "Sean hosti nimeks `%s'\n"
+
+-#: ../hostname.c:94
++#: ../hostname.c:95
+ #, c-format
+ msgid "%s: you must be root to change the host name\n"
+ msgstr "%s: ainult root saab hosti nime muuta\n"
+
+-#: ../hostname.c:108
++#: ../hostname.c:109
+ #, c-format
+ msgid "Setting domainname to `%s'\n"
+ msgstr "Sean domeeni nimeks `%s'\n"
+
+-#: ../hostname.c:113
++#: ../hostname.c:114
+ #, c-format
+ msgid "%s: you must be root to change the domain name\n"
+ msgstr "%s: ainult root saab domeeni nime muuta\n"
+
+-#: ../hostname.c:131
++#: ../hostname.c:132
+ #, c-format
+ msgid "Resolving `%s' ...\n"
+ msgstr "Lahendan `%s' ...\n"
+
+-#: ../hostname.c:137
++#: ../hostname.c:138
+ #, c-format
+ msgid "Result: h_name=`%s'\n"
+ msgstr "Tulemus: h_name=`%s'\n"
+
+-#: ../hostname.c:142
++#: ../hostname.c:143
+ #, c-format
+ msgid "Result: h_aliases=`%s'\n"
+ msgstr "Tulemus: h_aliases=`%s'\n"
+
+-#: ../hostname.c:147
++#: ../hostname.c:148
+ #, c-format
+ msgid "Result: h_addr_list=`%s'\n"
+ msgstr "Tulemus: h_addr_list=`%s'\n"
+
+-#: ../hostname.c:209
++#: ../hostname.c:210
+ #, c-format
+ msgid "%s: can't open `%s'\n"
+ msgstr "%s: ei saa avada faili `%s'\n"
+
+-#: ../hostname.c:223
++#: ../hostname.c:224
+ msgid "Usage: hostname [-v] {hostname|-F file} set hostname (from file)\n"
+ msgstr ""
+ "Kasutamine:\n"
+ " hostname [-v] {hosti nimi|-F fail} hosti nime seadmine (ka "
+ "failist)\n"
+
+-#: ../hostname.c:224
++#: ../hostname.c:225
+ msgid ""
+ " domainname [-v] {nisdomain|-F file} set NIS domainname (from file)\n"
+ msgstr ""
+ " domainname [-v] {nisdomeen|-F fail} NIS domeeni nime seadmine\n"
+
+-#: ../hostname.c:226
++#: ../hostname.c:227
+ msgid ""
+ " nodename [-v] {nodename|-F file} set DECnet node name (from "
+ "file)\n"
+@@ -330,18 +329,18 @@ msgstr ""
+ " nodename [-v] {nodename|-F fail} DECneti vrguslme nime "
+ "seadmine\n"
+
+-#: ../hostname.c:228
++#: ../hostname.c:229
+ msgid " hostname [-v] [-d|-f|-s|-a|-i|-y|-n] display formatted name\n"
+ msgstr ""
+ " hostname [-v] [-d|-f|-s|-a|-i|-y|-n] nime nitamine antud formaadis\n"
+
+-#: ../hostname.c:229
++#: ../hostname.c:230
+ msgid ""
+ " hostname [-v] display hostname\n"
+ "\n"
+ msgstr " hostname [-v] hosti nime nitamine\n"
+
+-#: ../hostname.c:230
++#: ../hostname.c:231
+ msgid ""
+ " hostname -V|--version|-h|--help print info and exit\n"
+ "\n"
+@@ -350,7 +349,7 @@ msgstr ""
+ " hostname -h|--help seesama abiinfo\n"
+ "\n"
+
+-#: ../hostname.c:231
++#: ../hostname.c:232
+ msgid ""
+ " dnsdomainname=hostname -d, {yp,nis,}domainname=hostname -y\n"
+ "\n"
+@@ -358,36 +357,36 @@ msgstr ""
+ " dnsdomainname=hostname -d, {yp,nis,}domainname=hostname -y\n"
+ "\n"
+
+-#: ../hostname.c:232
++#: ../hostname.c:233
+ msgid " -s, --short short host name\n"
+ msgstr " -s, --short lhike hosti nimi\n"
+
+-#: ../hostname.c:233
++#: ../hostname.c:234
+ msgid " -a, --alias alias names\n"
+ msgstr " -a, --alias alias-nimed\n"
+
+-#: ../hostname.c:234
++#: ../hostname.c:235
+ msgid " -i, --ip-address addresses for the hostname\n"
+ msgstr " -i, --ip-address hosti IP aadressid\n"
+
+-#: ../hostname.c:235
++#: ../hostname.c:236
+ msgid " -f, --fqdn, --long long host name (FQDN)\n"
+ msgstr ""
+ " -f, --fqdn, --long pikk hosti nimi (FQDN - tielik ssteeminimi)\n"
+
+-#: ../hostname.c:236
++#: ../hostname.c:237
+ msgid " -d, --domain DNS domain name\n"
+ msgstr " -d, --domain DNS domeeni nimi\n"
+
+-#: ../hostname.c:237
++#: ../hostname.c:238
+ msgid " -y, --yp, --nis NIS/YP domainname\n"
+ msgstr " -y, --yp, --nis NIS/YP domeeni nimi\n"
+
+-#: ../hostname.c:239
++#: ../hostname.c:240
+ msgid " -n, --node DECnet node name\n"
+ msgstr " -n, --node DECneti vrguslme nimi\n"
+
+-#: ../hostname.c:241
++#: ../hostname.c:242
+ msgid ""
+ " -F, --file read hostname or NIS domainname from given file\n"
+ "\n"
+@@ -395,7 +394,7 @@ msgstr ""
+ " -F, --file lugeda hosti vi NIS domeeni nimi failist\n"
+ "\n"
+
+-#: ../hostname.c:243
++#: ../hostname.c:244
+ msgid ""
+ " This command can read or set the hostname or the NIS domainname. You can\n"
+ " also read the DNS domain or the FQDN (fully qualified domain name).\n"
+@@ -409,12 +408,12 @@ msgstr ""
+ " tielikku ssteeminime (FQDN) ja DNS domeeni nime (mis on tieliku nime\n"
+ " osa) muuta failist /etc/hosts.\n"
+
+-#: ../hostname.c:338
++#: ../hostname.c:340
+ #, c-format
+ msgid "%s: You can't change the DNS domain name with this command\n"
+ msgstr "%s: selle ksuga ei saa muuta DNS domeeni nime\n"
+
+-#: ../hostname.c:339
++#: ../hostname.c:341
+ msgid ""
+ "\n"
+ "Unless you are using bind or NIS for host lookups you can change the DNS\n"
+@@ -422,26 +421,26 @@ msgstr ""
+ "\n"
+ "Kui Te EI kasuta bind'i ega NIS'i nimede lahendamiseks, saate DNS domeeni\n"
+
+-#: ../hostname.c:340
++#: ../hostname.c:342
+ msgid "domain name (which is part of the FQDN) in the /etc/hosts file.\n"
+ msgstr "(mis on tieliku nime osa) nime muuta failist /etc/hosts.\n"
+
+-#: ../hostname.c:357
++#: ../hostname.c:359
+ #, c-format
+ msgid "gethostname()=`%s'\n"
+ msgstr "gethostname()=`%s'\n"
+
+-#: ../hostname.c:374
++#: ../hostname.c:376
+ #, c-format
+ msgid "getdomainname()=`%s'\n"
+ msgstr "getdomainname()=`%s'\n"
+
+-#: ../hostname.c:389
++#: ../hostname.c:391
+ #, c-format
+ msgid "getnodename()=`%s'\n"
+ msgstr "getnodename()=`%s'\n"
+
+-#: ../ifconfig.c:110
++#: ../ifconfig.c:108
+ msgid ""
+ "Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR "
+ "Flg\n"
+@@ -449,16 +448,16 @@ msgstr ""
+ "Liides MTU Meetr. RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR "
+ "Lip\n"
+
+-#: ../ifconfig.c:132 ../ifconfig.c:164
++#: ../ifconfig.c:130 ../ifconfig.c:162
+ #, c-format
+ msgid "%s: unknown interface: %s\n"
+ msgstr "ifconfig: tundmatu liides %s: %s\n"
+
+-#: ../ifconfig.c:156 ../ifconfig.c:740 ../ifconfig.c:831 ../ifconfig.c:937
++#: ../ifconfig.c:154 ../ifconfig.c:734 ../ifconfig.c:825 ../ifconfig.c:936
+ msgid "No support for INET on this system.\n"
+ msgstr "Antud ssteem ei toeta INET aadressiperekonda\n"
+
+-#: ../ifconfig.c:179
++#: ../ifconfig.c:177
+ msgid ""
+ "Usage:\n"
+ " ifconfig [-a] [-i] [-v] [-s] <interface> [[<AF>] <address>]\n"
+@@ -466,51 +465,51 @@ msgstr ""
+ "Kasutamine:\n"
+ " ifconfig [-a] [-i] [-v] [-s] <liides> [[<AF>] <aadress>]\n"
+
+-#: ../ifconfig.c:181
++#: ../ifconfig.c:179
+ msgid " [add <address>[/<prefixlen>]]\n"
+ msgstr " [add <aadress>[/<prefiksi pikkus>]]\n"
+
+-#: ../ifconfig.c:182
++#: ../ifconfig.c:180
+ msgid " [del <address>[/<prefixlen>]]\n"
+ msgstr " [del <aadress>[/<prefiksi pikkus>]]\n"
+
+-#: ../ifconfig.c:183
++#: ../ifconfig.c:181
+ msgid " [[-]broadcast [<address>]] [[-]pointopoint [<address>]]\n"
+ msgstr " [[-]broadcast [<aadress>]] [[-]pointopoint [<aadress>]]\n"
+
+-#: ../ifconfig.c:184
++#: ../ifconfig.c:182
+ msgid " [netmask <address>] [dstaddr <address>] [tunnel <address>]\n"
+ msgstr " [netmask <aadress>] [dstaddr <aadress>] [tunnel <aadress>]\n"
+
+-#: ../ifconfig.c:187
++#: ../ifconfig.c:185
+ msgid " [outfill <NN>] [keepalive <NN>]\n"
+ msgstr " [outfill <NN>] [keepalive <NN>]\n"
+
+-#: ../ifconfig.c:189
++#: ../ifconfig.c:187
+ msgid " [hw <HW> <address>] [metric <NN>] [mtu <NN>]\n"
+ msgstr " [hw <HW> <aadress>] [metric <NN>] [mtu <NN>]\n"
+
+-#: ../ifconfig.c:190
++#: ../ifconfig.c:188
+ msgid " [[-]trailers] [[-]arp] [[-]allmulti]\n"
+ msgstr " [[-]trailers] [[-]arp] [[-]allmulti]\n"
+
+-#: ../ifconfig.c:191
++#: ../ifconfig.c:189
+ msgid " [multicast] [[-]promisc]\n"
+ msgstr " [multicast] [[-]promisc]\n"
+
+-#: ../ifconfig.c:192
++#: ../ifconfig.c:190
+ msgid " [mem_start <NN>] [io_addr <NN>] [irq <NN>] [media <type>]\n"
+ msgstr " [mem_start <NN>] [io_addr <NN>] [irq <NN>] [media <tp>]\n"
+
+-#: ../ifconfig.c:194
++#: ../ifconfig.c:192
+ msgid " [txqueuelen <NN>]\n"
+ msgstr " [txqueuelen <NN>]\n"
+
+-#: ../ifconfig.c:197
++#: ../ifconfig.c:195
+ msgid " [[-]dynamic]\n"
+ msgstr " [[-]dynamic]\n"
+
+-#: ../ifconfig.c:199
++#: ../ifconfig.c:197
+ msgid ""
+ " [up|down] ...\n"
+ "\n"
+@@ -518,73 +517,86 @@ msgstr ""
+ " [up|down] ...\n"
+ "\n"
+
+-#: ../ifconfig.c:201
++#: ../ifconfig.c:199
+ msgid " <HW>=Hardware Type.\n"
+ msgstr " <HW>=riistvara tp\n"
+
+-#: ../ifconfig.c:202
++#: ../ifconfig.c:200
+ msgid " List of possible hardware types:\n"
+ msgstr " Vimalike riistvara tpide nimekiri:\n"
+
+ #. 1 = ARPable
+-#: ../ifconfig.c:204
++#: ../ifconfig.c:202
+ #, c-format
+ msgid " <AF>=Address family. Default: %s\n"
+ msgstr " <AF>=aadressiperekond, vaikimisi %s\n"
+
+-#: ../ifconfig.c:205
++#: ../ifconfig.c:203
+ msgid " List of possible address families:\n"
+ msgstr " Vimalike aadressiperekondade nimekiri:\n"
+
+-#: ../ifconfig.c:361
++#: ../ifconfig.c:278
++#, c-format
++msgid "ifconfig: option `%s' not recognised.\n"
++msgstr ""
++
++#: ../ifconfig.c:280 ../ifconfig.c:925
++msgid "ifconfig: `--help' gives usage information.\n"
++msgstr ""
++
++#: ../ifconfig.c:355
+ msgid "Unknown media type.\n"
+ msgstr "Tundmatu meedia tp\n"
+
+-#: ../ifconfig.c:653
++#: ../ifconfig.c:647
+ #, c-format
+ msgid "hw address type `%s' has no handler to set address. failed.\n"
+ msgstr ""
+ "riistvara aadressi tbil `%s' pole ksitlejat aadressi seadmiseks - ebann\n"
+
+-#: ../ifconfig.c:662
++#: ../ifconfig.c:656
+ #, c-format
+ msgid "%s: invalid %s address.\n"
+ msgstr "%s: vigane %s aadress\n"
+
+-#: ../ifconfig.c:706 ../ifconfig.c:796 ../ifconfig.c:882
++#: ../ifconfig.c:700 ../ifconfig.c:790 ../ifconfig.c:876
+ msgid "No support for INET6 on this system.\n"
+ msgstr "Antud ssteem ei toeta INET6 aadressiperekonda\n"
+
+-#: ../ifconfig.c:749 ../ifconfig.c:840
++#: ../ifconfig.c:743 ../ifconfig.c:834
+ #, c-format
+ msgid "Interface %s not initialized\n"
+ msgstr "Liides %s pole initsialiseeritud\n"
+
+-#: ../ifconfig.c:761 ../ifconfig.c:851
++#: ../ifconfig.c:755 ../ifconfig.c:845
+ msgid "Bad address.\n"
+ msgstr "Vigane aadress\n"
+
+-#: ../ifconfig.c:854
++#: ../ifconfig.c:848
+ msgid "Address deletion not supported on this system.\n"
+ msgstr "Antud ssteem ei toeta aadresside kustutamist\n"
+
+-#: ../ifconfig.c:947
++#: ../ifconfig.c:920
++msgid "ifconfig: Cannot set address for this protocol family.\n"
++msgstr "Ei oska seada aadresse selle aadressiperekonna jaoks\n"
++
++#: ../ifconfig.c:946
+ msgid "No support for ECONET on this system.\n"
+ msgstr "Antud ssteem ei toeta ECONET aadressiperekonda\n"
+
+-#: ../ifconfig.c:955
++#: ../ifconfig.c:954
+ #, c-format
+ msgid "Don't know how to set addresses for family %d.\n"
+ msgstr "Ei oska seada aadresse aadressiperekonna %d jaoks\n"
+
+-#: ../netstat.c:429
++#: ../netstat.c:430
+ #, c-format
+ msgid ""
+ "(No info could be read for \"-p\": geteuid()=%d but you should be root.)\n"
+ msgstr ""
+ "(\"-p\" jaoks ei saanud infot lugeda: geteuid()=%d, aga vaja oleks root'u)\n"
+
+-#: ../netstat.c:433
++#: ../netstat.c:434
+ msgid ""
+ "(Not all processes could be identified, non-owned process info\n"
+ " will not be shown, you would have to be root to see it all.)\n"
+@@ -592,27 +604,27 @@ msgstr ""
+ "(Mnesid protsesse ei saanud identifitseerida, teiste kasutajate\n"
+ "info lugemiseks peab olema root)\n"
+
+-#: ../netstat.c:440 ../netstat.c:1171 ../netstat.c:1248
++#: ../netstat.c:441 ../netstat.c:1176 ../netstat.c:1253
+ msgid "LISTENING"
+ msgstr "LISTENING"
+
+-#: ../netstat.c:441
++#: ../netstat.c:442
+ msgid "CONN SENT"
+ msgstr "CONN SENT"
+
+-#: ../netstat.c:442 ../netstat.c:1250
++#: ../netstat.c:443 ../netstat.c:1255
+ msgid "DISC SENT"
+ msgstr "DISC SENT"
+
+-#: ../netstat.c:443 ../netstat.c:510 ../netstat.c:889 ../netstat.c:1251
++#: ../netstat.c:444 ../netstat.c:511 ../netstat.c:894 ../netstat.c:1256
+ msgid "ESTABLISHED"
+ msgstr "ESTABLISHED"
+
+-#: ../netstat.c:465
++#: ../netstat.c:466
+ msgid "Active NET/ROM sockets\n"
+ msgstr "Aktiivsed NET/ROM soklid\n"
+
+-#: ../netstat.c:466
++#: ../netstat.c:467
+ msgid ""
+ "User Dest Source Device State Vr/Vs Send-Q "
+ "Recv-Q\n"
+@@ -620,182 +632,182 @@ msgstr ""
+ "Kasutaja Sihtpunkt Lhtepunkt Liides Olek Vr/Vs SaatJrk "
+ "VvJrk\n"
+
+-#: ../netstat.c:476 ../netstat.c:1290
++#: ../netstat.c:477 ../netstat.c:1295
+ #, c-format
+ msgid "Problem reading data from %s\n"
+ msgstr "Probleem andmete lugemisel failist %s\n"
+
+-#: ../netstat.c:511
++#: ../netstat.c:512
+ msgid "SYN_SENT"
+ msgstr "SYN_SENT"
+
+-#: ../netstat.c:512
++#: ../netstat.c:513
+ msgid "SYN_RECV"
+ msgstr "SYN_RECV"
+
+-#: ../netstat.c:513
++#: ../netstat.c:514
+ msgid "FIN_WAIT1"
+ msgstr "FIN_WAIT1"
+
+-#: ../netstat.c:514
++#: ../netstat.c:515
+ msgid "FIN_WAIT2"
+ msgstr "FIN_WAIT2"
+
+-#: ../netstat.c:515
++#: ../netstat.c:516
+ msgid "TIME_WAIT"
+ msgstr "TIME_WAIT"
+
+-#: ../netstat.c:516
++#: ../netstat.c:517
+ msgid "CLOSE"
+ msgstr "CLOSE"
+
+-#: ../netstat.c:517
++#: ../netstat.c:518
+ msgid "CLOSE_WAIT"
+ msgstr "CLOSE_WAIT"
+
+-#: ../netstat.c:518
++#: ../netstat.c:519
+ msgid "LAST_ACK"
+ msgstr "LAST_ACK"
+
+-#: ../netstat.c:519
++#: ../netstat.c:520
+ msgid "LISTEN"
+ msgstr "LISTEN"
+
+-#: ../netstat.c:520
++#: ../netstat.c:521
+ msgid "CLOSING"
+ msgstr "CLOSING"
+
+-#: ../netstat.c:587
++#: ../netstat.c:592
+ #, c-format
+ msgid "warning, got bogus igmp6 line %d.\n"
+ msgstr "Hoiatus - sain imeliku igmp6 rea (nr. %d)\n"
+
+-#: ../netstat.c:592 ../netstat.c:630 ../netstat.c:751 ../netstat.c:883
+-#: ../netstat.c:1014 ../netstat.c:1019
++#: ../netstat.c:597 ../netstat.c:635 ../netstat.c:756 ../netstat.c:888
++#: ../netstat.c:1019 ../netstat.c:1024
+ #, c-format
+ msgid "netstat: unsupported address family %d !\n"
+ msgstr "netstat: aadressiperekonda %d ei toetata\n"
+
+-#: ../netstat.c:605 ../netstat.c:610 ../netstat.c:618 ../netstat.c:625
++#: ../netstat.c:610 ../netstat.c:615 ../netstat.c:623 ../netstat.c:630
+ #, c-format
+ msgid "warning, got bogus igmp line %d.\n"
+ msgstr "Hoiatus - sain imeliku igmp rea (nr. %d)\n"
+
+-#: ../netstat.c:668
++#: ../netstat.c:673
+ msgid "Active X.25 sockets\n"
+ msgstr "Aktiivsed X.25 soklid\n"
+
+ #. IMHO, Vr/Vs is not very usefull --SF
+-#: ../netstat.c:670
++#: ../netstat.c:675
+ msgid ""
+ "Dest Source Device LCI State Vr/Vs Send-Q "
+ "Recv-Q\n"
+ msgstr ""
+ "Sihtpunkt Lhtepunkt Liides LCI Olek Vr/Vs SaatJrk VvJrk\n"
+
+-#: ../netstat.c:747
++#: ../netstat.c:752
+ msgid "warning, got bogus tcp line.\n"
+ msgstr "Hoiatus - sain imeliku tcp rea\n"
+
+-#: ../netstat.c:788 ../netstat.c:938 ../netstat.c:1057
++#: ../netstat.c:793 ../netstat.c:943 ../netstat.c:1062
+ #, c-format
+ msgid "off (0.00/%ld/%d)"
+ msgstr "eiki ((0.00/%ld/%d)"
+
+-#: ../netstat.c:792
++#: ../netstat.c:797
+ #, c-format
+ msgid "on (%2.2f/%ld/%d)"
+ msgstr "kib (%2.2f/%ld/%d)"
+
+-#: ../netstat.c:797
++#: ../netstat.c:802
+ #, c-format
+ msgid "keepalive (%2.2f/%ld/%d)"
+ msgstr "keepalive (%2.2f/%ld/%d)"
+
+-#: ../netstat.c:802
++#: ../netstat.c:807
+ #, c-format
+ msgid "timewait (%2.2f/%ld/%d)"
+ msgstr "timewait (%2.2f/%ld/%d)"
+
+-#: ../netstat.c:807 ../netstat.c:947 ../netstat.c:1067
++#: ../netstat.c:812 ../netstat.c:952 ../netstat.c:1072
+ #, c-format
+ msgid "unkn-%d (%2.2f/%ld/%d)"
+ msgstr "eitea-%d (%2.2f/%ld/%d)"
+
+-#: ../netstat.c:879
++#: ../netstat.c:884
+ msgid "warning, got bogus udp line.\n"
+ msgstr "Hoiatus - sain imeliku udp rea\n"
+
+-#: ../netstat.c:897 ../netstat.c:1157 ../netstat.c:1190
++#: ../netstat.c:902 ../netstat.c:1162 ../netstat.c:1195
+ msgid "UNKNOWN"
+ msgstr "TUNDMATU"
+
+-#: ../netstat.c:943 ../netstat.c:1062
++#: ../netstat.c:948 ../netstat.c:1067
+ #, c-format
+ msgid "on%d (%2.2f/%ld/%d)"
+ msgstr "kib-%d (%2.2f/%ld/%d)"
+
+-#: ../netstat.c:1028
++#: ../netstat.c:1033
+ msgid "warning, got bogus raw line.\n"
+ msgstr "Hoiatus - sain imeliku raw rea\n"
+
+-#: ../netstat.c:1110
++#: ../netstat.c:1115
+ msgid "warning, got bogus unix line.\n"
+ msgstr "Hoiatus - sain imeliku unix rea\n"
+
+-#: ../netstat.c:1137
++#: ../netstat.c:1142
+ msgid "STREAM"
+ msgstr "STREAM"
+
+-#: ../netstat.c:1141
++#: ../netstat.c:1146
+ msgid "DGRAM"
+ msgstr "DGRAM"
+
+-#: ../netstat.c:1145
++#: ../netstat.c:1150
+ msgid "RAW"
+ msgstr "RAW"
+
+-#: ../netstat.c:1149
++#: ../netstat.c:1154
+ msgid "RDM"
+ msgstr "RDM"
+
+-#: ../netstat.c:1153
++#: ../netstat.c:1158
+ msgid "SEQPACKET"
+ msgstr "SEQPACKET"
+
+-#: ../netstat.c:1162
++#: ../netstat.c:1167
+ msgid "FREE"
+ msgstr "VABA"
+
+-#: ../netstat.c:1178
++#: ../netstat.c:1183
+ msgid "CONNECTING"
+ msgstr "HENDUMAS"
+
+-#: ../netstat.c:1182
++#: ../netstat.c:1187
+ msgid "CONNECTED"
+ msgstr "HENDATUD"
+
+-#: ../netstat.c:1186
++#: ../netstat.c:1191
+ msgid "DISCONNECTING"
+ msgstr "LAHTIHENDUMAS"
+
+-#: ../netstat.c:1217
++#: ../netstat.c:1222
+ msgid "Active UNIX domain sockets "
+ msgstr "Aktiivsed UNIX domeeni soklid "
+
+-#: ../netstat.c:1219 ../netstat.c:1729
++#: ../netstat.c:1224 ../netstat.c:1735
+ msgid "(servers and established)"
+ msgstr "(serverid ja hendatud)"
+
+-#: ../netstat.c:1222 ../netstat.c:1732
++#: ../netstat.c:1227 ../netstat.c:1738
+ msgid "(only servers)"
+ msgstr "(ainult serverid)"
+
+-#: ../netstat.c:1224 ../netstat.c:1734
++#: ../netstat.c:1229 ../netstat.c:1740
+ msgid "(w/o servers)"
+ msgstr "(ilma serveriteta)"
+
+-#: ../netstat.c:1227
++#: ../netstat.c:1232
+ msgid ""
+ "\n"
+ "Proto RefCnt Flags Type State I-Node"
+@@ -803,32 +815,32 @@ msgstr ""
+ "\n"
+ "Proto Mitu Lipud Tp Olek I-kirje "
+
+-#: ../netstat.c:1229
++#: ../netstat.c:1234
+ msgid " Path\n"
+ msgstr "Tee\n"
+
+-#: ../netstat.c:1249
++#: ../netstat.c:1254
+ msgid "SABM SENT"
+ msgstr "SABM SENT"
+
+-#: ../netstat.c:1252
++#: ../netstat.c:1257
+ msgid "RECOVERY"
+ msgstr "RECOVERY"
+
+-#: ../netstat.c:1266
++#: ../netstat.c:1271
+ msgid "Active AX.25 sockets\n"
+ msgstr "Aktiivsed AX.25 soklid\n"
+
+-#: ../netstat.c:1267
++#: ../netstat.c:1272
+ msgid "Dest Source Device State Vr/Vs Send-Q Recv-Q\n"
+ msgstr "Sihtpunkt Lhtepunkt Liides Olek Vr/Vs SaatJrk VvJrk\n"
+
+-#: ../netstat.c:1310
++#: ../netstat.c:1315
+ #, c-format
+ msgid "problem reading data from %s\n"
+ msgstr "Probleem andmete lugemisel failist %s\n"
+
+-#: ../netstat.c:1361
++#: ../netstat.c:1366
+ msgid ""
+ "Active IPX sockets\n"
+ "Proto Recv-Q Send-Q Local Address Foreign Address "
+@@ -838,23 +850,23 @@ msgstr ""
+ "Proto VvJrk SaatJrk Kohalik aadress Vline aadress "
+ "Olek "
+
+-#: ../netstat.c:1363
++#: ../netstat.c:1368
+ msgid " User"
+ msgstr " Kasutaja"
+
+-#: ../netstat.c:1397
++#: ../netstat.c:1402
+ msgid "ESTAB"
+ msgstr "ESTAB"
+
+-#: ../netstat.c:1405
++#: ../netstat.c:1410
+ msgid "UNK."
+ msgstr "UNK."
+
+-#: ../netstat.c:1443
++#: ../netstat.c:1448
+ msgid "Kernel Interface table\n"
+ msgstr "Tuuma liideste tabel\n"
+
+-#: ../netstat.c:1447
++#: ../netstat.c:1452
+ msgid ""
+ "Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR "
+ "Flg\n"
+@@ -862,11 +874,11 @@ msgstr ""
+ "Liides MTU Meetr RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR "
+ "Lip\n"
+
+-#: ../netstat.c:1451
++#: ../netstat.c:1456
+ msgid "missing interface information"
+ msgstr "Puudulik informatsioon liideste kohta"
+
+-#: ../netstat.c:1474
++#: ../netstat.c:1479
+ msgid ""
+ "usage: netstat [-veenNcCF] [<Af>] -r netstat "
+ "{-V|--version|-h|--help}\n"
+@@ -874,11 +886,11 @@ msgstr ""
+ "Kasutamine: netstat [-veenNcCF] [<Af>] -r\n"
+ " netstat {-V|--version|-h|--help}\n"
+
+-#: ../netstat.c:1475
++#: ../netstat.c:1480
+ msgid " netstat [-vnNcaeol] [<Socket> ...]\n"
+ msgstr " netstat [-vnNcaeol] [<Sokkel> ...]\n"
+
+-#: ../netstat.c:1476
++#: ../netstat.c:1481
+ msgid ""
+ " netstat { [-veenNac] -i | [-cnNe] -M | -s }\n"
+ "\n"
+@@ -886,25 +898,25 @@ msgstr ""
+ " netstat { [-veenNac] -i | [-cnNe] -M | -s }\n"
+ "\n"
+
+-#: ../netstat.c:1478
++#: ../netstat.c:1483
+ msgid " -r, --route display routing table\n"
+ msgstr " -r, --route ruutingutabeli nitamine\n"
+
+-#: ../netstat.c:1479
++#: ../netstat.c:1484
+ msgid " -i, --interfaces display interface table\n"
+ msgstr " -i, --interfaces liideste tabeli nitamine\n"
+
+-#: ../netstat.c:1480
++#: ../netstat.c:1485
+ msgid " -g, --groups display multicast group memberships\n"
+ msgstr " -g, --groups multiedastuse gruppide nitamine\n"
+
+-#: ../netstat.c:1481
++#: ../netstat.c:1486
+ msgid ""
+ " -s, --statistics display networking statistics (like SNMP)\n"
+ msgstr ""
+ " -s, --statistics vrgu statistika nitamine (SNMP stiilis)\n"
+
+-#: ../netstat.c:1483
++#: ../netstat.c:1488
+ msgid ""
+ " -M, --masquerade display masqueraded connections\n"
+ "\n"
+@@ -912,36 +924,32 @@ msgstr ""
+ " -M, --masquerade maskeeritavate henduste nitamine\n"
+ "\n"
+
+-#: ../netstat.c:1486 ../route.c:86
+-msgid " -n, --numeric dont resolve names\n"
+-msgstr " -n, --numeric mitte lahendada numbreid nimedeks\n"
+-
+-#: ../netstat.c:1487
+-msgid " --numeric-hosts dont resolve host names\n"
++#: ../netstat.c:1492
++msgid " --numeric-hosts don't resolve host names\n"
+ msgstr " --numeric-hosts mitte lahendada hostinimesid\n"
+
+-#: ../netstat.c:1488
+-msgid " --numeric-ports dont resolve port names\n"
++#: ../netstat.c:1493
++msgid " --numeric-ports don't resolve port names\n"
+ msgstr " --numeric-ports mitte lahendada pordinimesid\n"
+
+-#: ../netstat.c:1489
+-msgid " --numeric-users dont resolve user names\n"
++#: ../netstat.c:1494
++msgid " --numeric-users don't resolve user names\n"
+ msgstr " --numeric-users mitte lahendada kasutajanimesid\n"
+
+-#: ../netstat.c:1490
++#: ../netstat.c:1495
+ msgid " -N, --symbolic resolve hardware names\n"
+ msgstr " -N, --symbolic lahendada riistvara aadressid\n"
+
+-#: ../netstat.c:1491 ../route.c:87
++#: ../netstat.c:1496 ../route.c:88
+ msgid " -e, --extend display other/more information\n"
+ msgstr " -e, --extend muu info/lisainfo nitamine\n"
+
+-#: ../netstat.c:1492
++#: ../netstat.c:1497
+ msgid " -p, --programs display PID/Program name for sockets\n"
+ msgstr ""
+ " -p, --programs soklite kohta PID/protsessi nime nitamine\n"
+
+-#: ../netstat.c:1493
++#: ../netstat.c:1498
+ msgid ""
+ " -c, --continuous continuous listing\n"
+ "\n"
+@@ -949,22 +957,22 @@ msgstr ""
+ " -c, --continuous pidevalt uuenev nimekiri\n"
+ "\n"
+
+-#: ../netstat.c:1494
++#: ../netstat.c:1499
+ msgid " -l, --listening display listening server sockets\n"
+ msgstr " -l, --listening kuulavate serversoklite nitamine\n"
+
+-#: ../netstat.c:1495
++#: ../netstat.c:1500
+ msgid ""
+ " -a, --all, --listening display all sockets (default: connected)\n"
+ msgstr ""
+ " -a, --all, --listening kigi soklite nitamine (vaikimisi "
+ "hendatud)\n"
+
+-#: ../netstat.c:1496
++#: ../netstat.c:1501
+ msgid " -o, --timers display timers\n"
+ msgstr " -o, --timers taimerite nitamine\n"
+
+-#: ../netstat.c:1497 ../route.c:88
++#: ../netstat.c:1502 ../route.c:89
+ msgid ""
+ " -F, --fib display Forwarding Information Base "
+ "(default)\n"
+@@ -972,7 +980,7 @@ msgstr ""
+ " -F, --fib ldiste ruutingutabelite nitamine "
+ "(vaikimisi)\n"
+
+-#: ../netstat.c:1498 ../route.c:89
++#: ../netstat.c:1503 ../route.c:90
+ msgid ""
+ " -C, --cache display routing cache instead of FIB\n"
+ "\n"
+@@ -981,7 +989,7 @@ msgstr ""
+ "nitamine\n"
+ "\n"
+
+-#: ../netstat.c:1500
++#: ../netstat.c:1505
+ msgid ""
+ " <Socket>={-t|--tcp} {-u|--udp} {-w|--raw} {-x|--unix} --ax25 --ipx "
+ "--netrom\n"
+@@ -989,20 +997,19 @@ msgstr ""
+ " <Sokkel>={-t|--tcp} {-u|--udp} {-w|--raw} {-x|--unix} --ax25 --ipx "
+ "--netrom\n"
+
+-#: ../netstat.c:1501 ../route.c:91
+-#, c-format
+-msgid " <AF>=Use '-A <af>' or '--<af>' Default: %s\n"
+-msgstr " <AF>=kasutage '-A <af>' vi '--<af>' vaikimisi: %s\n"
++#: ../netstat.c:1506 ../route.c:92
++msgid " <AF>=Use '-A <af>' or '--<af>'; default: %s\n"
++msgstr " <AF>=kasutage '-A <af>' vi '--<af>'; vaikimisi: %s\n"
+
+-#: ../netstat.c:1502 ../route.c:92
++#: ../netstat.c:1507 ../route.c:93
+ msgid " List of possible address families (which support routing):\n"
+ msgstr " Vimalike ruutingu toetavate aadressiperekondade nimekiri:\n"
+
+-#: ../netstat.c:1726
++#: ../netstat.c:1732
+ msgid "Active Internet connections "
+ msgstr "Aktiivsed internetihendused "
+
+-#: ../netstat.c:1736
++#: ../netstat.c:1742
+ msgid ""
+ "\n"
+ "Proto Recv-Q Send-Q Local Address Foreign Address State "
+@@ -1012,77 +1019,77 @@ msgstr ""
+ "Proto VvJrk SaatJrk Kohalik aadress Vline aadress Olek "
+ " "
+
+-#: ../netstat.c:1738
++#: ../netstat.c:1744
+ msgid " User Inode "
+ msgstr " Kasutaja I-kirje "
+
+-#: ../netstat.c:1741
++#: ../netstat.c:1747
+ msgid " Timer"
+ msgstr " Taimer"
+
+-#: ../netstat.c:1771
++#: ../netstat.c:1777
+ msgid "IPv4 Group Memberships\n"
+ msgstr "IPv4 grupikuuluvused\n"
+
+-#: ../netstat.c:1772
++#: ../netstat.c:1778
+ msgid "Interface RefCnt Group\n"
+ msgstr "Liides Mitu Grupp\n"
+
+-#: ../rarp.c:43
++#: ../rarp.c:44
+ msgid "This kernel does not support RARP.\n"
+ msgstr "rarp: tuum ei toeta RARP'i\n"
+
+-#: ../rarp.c:82
++#: ../rarp.c:83
+ #, c-format
+ msgid "no RARP entry for %s.\n"
+ msgstr "rarp: %s jaoks pole RARP kirjet\n"
+
+-#: ../rarp.c:95
++#: ../rarp.c:96
+ #, c-format
+ msgid "%s: bad hardware address\n"
+ msgstr "rarp: vigane riistvaraline aadress %s\n"
+
+-#: ../rarp.c:127
++#: ../rarp.c:128
+ #, c-format
+ msgid "rarp: cannot open file %s:%s.\n"
+ msgstr "rarp: ei saa avada faili %s:%s\n"
+
+-#: ../rarp.c:139
++#: ../rarp.c:140
+ #, c-format
+ msgid "rarp: format error at %s:%u\n"
+ msgstr "rarp: vorminguviga failis %s real %u\n"
+
+-#: ../rarp.c:143 ../rarp.c:287
++#: ../rarp.c:144 ../rarp.c:289
+ #, c-format
+ msgid "rarp: %s: unknown host\n"
+ msgstr "rarp: tundmatu host %s\n"
+
+-#: ../rarp.c:146
++#: ../rarp.c:147
+ #, c-format
+ msgid "rarp: cannot set entry from %s:%u\n"
+ msgstr "rarp: ei saa kehtestada kirjet failist %s realt %u\n"
+
+-#: ../rarp.c:175
++#: ../rarp.c:176
+ msgid "Usage: rarp -a list entries in cache.\n"
+ msgstr ""
+ "Kasutamine:\n"
+ " rarp -a puhvris olevate kirjete vaatamine\n"
+
+-#: ../rarp.c:176
++#: ../rarp.c:177
+ msgid " rarp -d <hostname> delete entry from cache.\n"
+ msgstr " rarp -d <hosti nimi> kirje kustutamine puhvrist\n"
+
+-#: ../rarp.c:177
++#: ../rarp.c:178
+ msgid " rarp [<HW>] -s <hostname> <hwaddr> add entry to cache.\n"
+ msgstr " rarp [<HW>] -s <hosti nimi> <hwaddr> kirje lisamine puhvrisse\n"
+
+-#: ../rarp.c:178
++#: ../rarp.c:179
+ msgid ""
+ " rarp -f add entries from /etc/ethers.\n"
+ msgstr ""
+ " rarp -f kirjete lisamine failist /etc/ethers\n"
+
+-#: ../rarp.c:179
++#: ../rarp.c:180
+ msgid ""
+ " rarp -V display program version.\n"
+ "\n"
+@@ -1090,24 +1097,24 @@ msgstr ""
+ " rarp -V programmi versiooni nitamine\n"
+ "\n"
+
+-#: ../rarp.c:236
++#: ../rarp.c:238
+ #, c-format
+ msgid "%s: illegal option mix.\n"
+ msgstr "%s: lubamatu vtmete kombinatsioon\n"
+
+-#: ../rarp.c:267
++#: ../rarp.c:269
+ #, c-format
+ msgid "rarp: %s: unknown hardware type.\n"
+ msgstr "rarp: tundmatu riistvara tp %s\n"
+
+-#: ../route.c:79
++#: ../route.c:80
+ msgid ""
+ "Usage: route [-nNvee] [-FC] [<AF>] List kernel routing tables\n"
+ msgstr ""
+ "Kasutamine:\n"
+ " route [-nNvee] [-FC] [<AF>] Tuuma ruutingutabeli nitamine\n"
+
+-#: ../route.c:80
++#: ../route.c:81
+ msgid ""
+ " route [-v] [-FC] {add|del|flush} ... Modify routing table for AF.\n"
+ "\n"
+@@ -1115,7 +1122,7 @@ msgstr ""
+ " route [-v] [-FC] {add|del|flush} ... Tuuma ruutingutabeli muutmine\n"
+ "\n"
+
+-#: ../route.c:82
++#: ../route.c:83
+ msgid ""
+ " route {-h|--help} [<AF>] Detailed usage syntax for "
+ "specified AF.\n"
+@@ -1123,7 +1130,7 @@ msgstr ""
+ " route {-h|--help} [<AF>] Detailne sntaks perekonna AF "
+ "jaoks\n"
+
+-#: ../route.c:83
++#: ../route.c:84
+ msgid ""
+ " route {-V|--version} Display version/author and "
+ "exit.\n"
+@@ -1149,25 +1156,25 @@ msgstr " plipconfig -V | --version\n"
+ msgid "%s\tnibble %lu trigger %lu\n"
+ msgstr "%s\tnibble %lu trigger %lu\n"
+
+-#: ../iptunnel.c:84
++#: ../iptunnel.c:85
+ msgid "Usage: iptunnel { add | change | del | show } [ NAME ]\n"
+ msgstr "Kasutamine: iptunnel { add | change | del | show } [ NIMI ]\n"
+
+-#: ../iptunnel.c:85
++#: ../iptunnel.c:86
+ msgid ""
+ " [ mode { ipip | gre | sit } ] [ remote ADDR ] [ local ADDR ]\n"
+ msgstr ""
+ " [ mode { ipip | gre | sit } ] [ remote AADR ] [ local AADR ]\n"
+
+-#: ../iptunnel.c:86
++#: ../iptunnel.c:87
+ msgid " [ [i|o]seq ] [ [i|o]key KEY ] [ [i|o]csum ]\n"
+ msgstr " [ [i|o]seq ] [ [i|o]key KEY ] [ [i|o]csum ]\n"
+
+-#: ../iptunnel.c:87
++#: ../iptunnel.c:88
+ msgid " [ ttl TTL ] [ tos TOS ] [ nopmtudisc ] [ dev PHYS_DEV ]\n"
+ msgstr " [ ttl TTL ] [ tos TOS ] [ nopmtudisc ] [ dev LIIDES ]\n"
+
+-#: ../iptunnel.c:88
++#: ../iptunnel.c:89
+ msgid ""
+ " iptunnel -V | --version\n"
+ "\n"
+@@ -1175,83 +1182,83 @@ msgstr ""
+ " iptunnel -V | --version\n"
+ "\n"
+
+-#: ../iptunnel.c:89
++#: ../iptunnel.c:90
+ msgid "Where: NAME := STRING\n"
+ msgstr "Kus: NIMI := STRING\n"
+
+-#: ../iptunnel.c:90
++#: ../iptunnel.c:91
+ msgid " ADDR := { IP_ADDRESS | any }\n"
+ msgstr " AADR := { IP_AADRESS | any }\n"
+
+-#: ../iptunnel.c:91
++#: ../iptunnel.c:92
+ msgid " TOS := { NUMBER | inherit }\n"
+ msgstr " TOS := { ARV | inherit }\n"
+
+-#: ../iptunnel.c:92
++#: ../iptunnel.c:93
+ msgid " TTL := { 1..255 | inherit }\n"
+ msgstr " TTL := { 1..255 | inherit }\n"
+
+-#: ../iptunnel.c:93
++#: ../iptunnel.c:94
+ msgid " KEY := { DOTTED_QUAD | NUMBER }\n"
+ msgstr ""
+ " KEY := { PUNKTIDEGA_ARVUNELIK | ARV }\n"
+ " LIIDES := FSILISE_LIIDESE_NIMI\n"
+
+-#: ../iptunnel.c:331
++#: ../iptunnel.c:332
+ msgid "Keys are not allowed with ipip and sit.\n"
+ msgstr "ipip ja sit juures ei ole vtmed lubatud\n"
+
+-#: ../iptunnel.c:351
++#: ../iptunnel.c:352
+ msgid "Broadcast tunnel requires a source address.\n"
+ msgstr "Leviedastusega tunnel vajab lhteaadressi\n"
+
+-#: ../iptunnel.c:366
++#: ../iptunnel.c:367
+ msgid "ttl != 0 and noptmudisc are incompatible\n"
+ msgstr "ttl != 0 ning noptmudisc ei sobi kokku\n"
+
+-#: ../iptunnel.c:378
++#: ../iptunnel.c:379
+ msgid "cannot determine tunnel mode (ipip, gre or sit)\n"
+ msgstr "Ei suuda mrata tunneli moodi (ipip, gre vi sit)\n"
+
+-#: ../iptunnel.c:416
++#: ../iptunnel.c:417
+ #, c-format
+ msgid "%s: %s/ip remote %s local %s "
+ msgstr "%s: %s/ip teises otsas %s siin %s "
+
+-#: ../iptunnel.c:420
++#: ../iptunnel.c:421
+ msgid "unknown"
+ msgstr "tundmatu"
+
+-#: ../iptunnel.c:452
++#: ../iptunnel.c:453
+ msgid " Drop packets out of sequence.\n"
+ msgstr " Jrjekorravlised paketid visatakse minema\n"
+
+-#: ../iptunnel.c:454
++#: ../iptunnel.c:455
+ msgid " Checksum in received packet is required.\n"
+ msgstr " Vastuvetavates pakettides on kontrollsumma kohustuslik\n"
+
+-#: ../iptunnel.c:456
++#: ../iptunnel.c:457
+ msgid " Sequence packets on output.\n"
+ msgstr " Vljuvad paketid varustatakse jrjekorranumbritega\n"
+
+-#: ../iptunnel.c:458
++#: ../iptunnel.c:459
+ msgid " Checksum output packets.\n"
+ msgstr " Vljuvad paketid varustatakse kontrollsummaga\n"
+
+-#: ../iptunnel.c:486
++#: ../iptunnel.c:487
+ msgid "Wrong format of /proc/net/dev. Sorry.\n"
+ msgstr "/proc/net/dev on vales formaadis. Vale tuuma versioon?\n"
+
+-#: ../iptunnel.c:499
++#: ../iptunnel.c:500
+ #, c-format
+ msgid "Failed to get type of [%s]\n"
+ msgstr "Ei suutnud kindlaks teha liidese %s tpi\n"
+
+-#: ../iptunnel.c:515
++#: ../iptunnel.c:516
+ msgid "RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n"
+ msgstr "RX: Pakette Baite Vigu KSumVigu JrkVigu Levipakette\n"
+
+-#: ../iptunnel.c:518
++#: ../iptunnel.c:519
+ msgid "TX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n"
+ msgstr "TX: Pakette Baite Vigu DeadLoop EiRuudi MluOtsas\n"
+
+@@ -1972,15 +1979,15 @@ msgstr "rresolve: toetuseta aadressiperekond %d\n"
+ msgid "[UNKNOWN]"
+ msgstr "[TUNDMATU]"
+
+-#: ../lib/inet6_gr.c:79
++#: ../lib/inet6_gr.c:71
+ msgid "INET6 (IPv6) not configured in this system.\n"
+ msgstr "INET6 (IPv6) pole antud ssteemis konfigureeritud\n"
+
+-#: ../lib/inet6_gr.c:82
++#: ../lib/inet6_gr.c:74
+ msgid "Kernel IPv6 routing table\n"
+ msgstr "Tuuma IPv6 ruutingutabel\n"
+
+-#: ../lib/inet6_gr.c:84
++#: ../lib/inet6_gr.c:76
+ msgid ""
+ "Destination Next Hop "
+ " Flags Metric Ref Use Iface\n"
+@@ -1988,11 +1995,11 @@ msgstr ""
+ "Sihtpunkt Jrgmine samm "
+ " Lipud Meetr Mitu Kasut Liides\n"
+
+-#: ../lib/inet6_gr.c:158
++#: ../lib/inet6_gr.c:150
+ msgid "Kernel IPv6 Neighbour Cache\n"
+ msgstr "Tuuma IPv6 naabrite puhver\n"
+
+-#: ../lib/inet6_gr.c:161
++#: ../lib/inet6_gr.c:153
+ msgid ""
+ "Neighbour HW Address Iface Flags "
+ "Ref State\n"
+@@ -2000,7 +2007,7 @@ msgstr ""
+ "Naaber HW Aadress Liides Lipud "
+ "Mitu Olek\n"
+
+-#: ../lib/inet6_gr.c:165
++#: ../lib/inet6_gr.c:157
+ msgid ""
+ "Neighbour HW Address Iface Flags "
+ "Ref State Stale(sec) Delete(sec)\n"
+@@ -2538,29 +2545,29 @@ msgstr "iptunnel: %s on vigane IPv4 aadress\n"
+ msgid "ip: argument is wrong: %s\n"
+ msgstr "iptunnel: vale argument %s\n"
+
+-#: ../ipmaddr.c:58
++#: ../ipmaddr.c:61
+ msgid "Usage: ipmaddr [ add | del ] MULTIADDR dev STRING\n"
+ msgstr "Kasutamine: ipmaddr [ add | del ] MULTIAADR dev STRING\n"
+
+-#: ../ipmaddr.c:59
++#: ../ipmaddr.c:62
+ msgid " ipmaddr show [ dev STRING ] [ ipv4 | ipv6 | link | all ]\n"
+ msgstr " ipmaddr show [ dev STRING ] [ ipv4 | ipv6 | link | all ]\n"
+
+-#: ../ipmaddr.c:60
++#: ../ipmaddr.c:63
+ msgid " ipmaddr -V | -version\n"
+ msgstr " ipmaddr -V | -version\n"
+
+-#: ../ipmaddr.c:260
++#: ../ipmaddr.c:263
+ #, c-format
+ msgid "family %d "
+ msgstr "perekond %d "
+
+-#: ../ipmaddr.c:269
++#: ../ipmaddr.c:272
+ #, c-format
+ msgid " users %d"
+ msgstr " kasutajaid %d"
+
+-#: ../ipmaddr.c:355
++#: ../ipmaddr.c:358
+ msgid "Cannot create socket"
+ msgstr "Ei saa avada soklit"
+
+diff --git a/po/fr.po b/po/fr.po
+index e8e7542..e4e8245 100644
+--- a/po/fr.po
++++ b/po/fr.po
+@@ -9,7 +9,7 @@ msgstr ""
+ "Last-Translator: J.M.Vansteene <vanstee@worldnet.fr>\n"
+ "Language-Team:\n"
+ "MIME-Version: 1.0\n"
+-"Content-Type: text/plain; charset=iso8859-1\n"
++"Content-Type: text/plain; charset=iso-8859-1\n"
+ "Content-Transfer-Encoding: 8bit\n"
+
+ #: ../arp.c:110 ../arp.c:269
+@@ -59,8 +59,12 @@ msgid "arp: cannot set entry on line %u of etherfile %s !\n"
+ msgstr "arp: ne peut dfinir l'entre en ligne %u du fichier ether %s !\n"
+
+ #: ../arp.c:437
+-msgid "Address\t\t\tHWtype\tHWaddress\t Flags Mask\t\t Iface\n"
+-msgstr "Adresse\t\t\tTypeMap\tAdresseMat\t Indicateurs\t\t Iface\n"
++msgid ""
++"Address HWtype HWaddress Flags Mask "
++"Iface\n"
++msgstr ""
++"Adresse TypeMap AdresseMat Indicateurs "
++"Iface\n"
+
+ #: ../arp.c:467
+ msgid "(incomplete)"
+diff --git a/po/net-tools.pot b/po/net-tools.pot
+index 0231aac..cdeccc9 100644
+--- a/po/net-tools.pot
++++ b/po/net-tools.pot
+@@ -1,263 +1,285 @@
+ # SOME DESCRIPTIVE TITLE.
+-# Copyright (C) YEAR Free Software Foundation, Inc.
++# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
++# This file is distributed under the same license as the PACKAGE package.
+ # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+ #
+ #, fuzzy
+ msgid ""
+ msgstr ""
+ "Project-Id-Version: PACKAGE VERSION\n"
+-"POT-Creation-Date: 2001-04-15 15:40+0100\n"
++"Report-Msgid-Bugs-To: \n"
++"POT-Creation-Date: 2005-05-16 05:18+0200\n"
+ "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+ "Language-Team: LANGUAGE <LL@li.org>\n"
+ "MIME-Version: 1.0\n"
+ "Content-Type: text/plain; charset=CHARSET\n"
+-"Content-Transfer-Encoding: ENCODING\n"
++"Content-Transfer-Encoding: 8bit\n"
+
+-#: ../arp.c:111 ../arp.c:270
++#: ../arp.c:111 ../arp.c:276
++#, c-format
+ msgid "arp: need host name\n"
+ msgstr ""
+
+-#: ../arp.c:208 ../arp.c:222
++#: ../arp.c:213 ../arp.c:228
+ #, c-format
+ msgid "No ARP entry for %s\n"
+ msgstr ""
+
+-#: ../arp.c:240
++#: ../arp.c:246
+ #, c-format
+ msgid "arp: cant get HW-Address for `%s': %s.\n"
+ msgstr ""
+
+-#: ../arp.c:244
++#: ../arp.c:250
++#, c-format
+ msgid "arp: protocol type mismatch.\n"
+ msgstr ""
+
+-#: ../arp.c:253
++#: ../arp.c:259
+ #, c-format
+ msgid "arp: device `%s' has HW address %s `%s'.\n"
+ msgstr ""
+
+-#: ../arp.c:283
++#: ../arp.c:289
++#, c-format
+ msgid "arp: need hardware address\n"
+ msgstr ""
+
+-#: ../arp.c:291
++#: ../arp.c:297
++#, c-format
+ msgid "arp: invalid hardware address\n"
+ msgstr ""
+
+-#: ../arp.c:388
++#: ../arp.c:394
+ #, c-format
+ msgid "arp: cannot open etherfile %s !\n"
+ msgstr ""
+
+-#: ../arp.c:404
++#: ../arp.c:410
+ #, c-format
+ msgid "arp: format error on line %u of etherfile %s !\n"
+ msgstr ""
+
+-#: ../arp.c:417
++#: ../arp.c:423
+ #, c-format
+ msgid "arp: cannot set entry on line %u of etherfile %s !\n"
+ msgstr ""
+
+-#: ../arp.c:438
++#: ../arp.c:444
++#, c-format
+ msgid ""
+ "Address HWtype HWaddress Flags Mask "
+ "Iface\n"
+ msgstr ""
+
+-#: ../arp.c:468
++#: ../arp.c:472
++msgid "<from_interface>"
++msgstr ""
++
++#: ../arp.c:474
+ msgid "(incomplete)"
+ msgstr ""
+
+-#: ../arp.c:485
++#: ../arp.c:491
+ #, c-format
+ msgid "%s (%s) at "
+ msgstr ""
+
+-#: ../arp.c:491
++#: ../arp.c:497
++#, c-format
+ msgid "<incomplete> "
+ msgstr ""
+
+-#: ../arp.c:497
++#: ../arp.c:503
+ #, c-format
+ msgid "netmask %s "
+ msgstr ""
+
+-#: ../arp.c:514
++#: ../arp.c:520
+ #, c-format
+ msgid "on %s\n"
+ msgstr ""
+
+-#: ../arp.c:593
++#: ../arp.c:599
+ #, c-format
+ msgid "Entries: %d\tSkipped: %d\tFound: %d\n"
+ msgstr ""
+
+-#: ../arp.c:597
++#: ../arp.c:603
+ #, c-format
+ msgid "%s (%s) -- no entry\n"
+ msgstr ""
+
+-#: ../arp.c:599
++#: ../arp.c:605
+ #, c-format
+ msgid "arp: in %d entries no match found.\n"
+ msgstr ""
+
+-#: ../arp.c:614
++#: ../arp.c:620
++#, c-format
+ msgid ""
+ "Usage:\n"
+ " arp [-vn] [<HW>] [-i <if>] [-a] [<hostname>] <-Display ARP "
+ "cache\n"
+ msgstr ""
+
+-#: ../arp.c:615
++#: ../arp.c:621
++#, c-format
+ msgid ""
+ " arp [-v] [-i <if>] -d <hostname> [pub][nopub] <-Delete ARP "
+ "entry\n"
+ msgstr ""
+
+-#: ../arp.c:616
++#: ../arp.c:622
++#, c-format
+ msgid ""
+-" arp [-vnD] [<HW>] [-i <if>] -f [<filename>] <-Add entry from "
++" arp [-vnD] [<HW>] [-i <if>] -f [<filename>] <-Add entry from "
+ "file\n"
+ msgstr ""
+
+-#: ../arp.c:617
++#: ../arp.c:623
++#, c-format
+ msgid ""
+ " arp [-v] [<HW>] [-i <if>] -s <hostname> <hwaddr> [temp][nopub] <-Add "
+ "entry\n"
+ msgstr ""
+
+-#: ../arp.c:618
+-msgid ""
+-" arp [-v] [<HW>] [-i <if>] -s <hostname> <hwaddr> [netmask <nm>] pub "
+-"<-''-\n"
+-msgstr ""
+-
+-#: ../arp.c:619
++#: ../arp.c:624
++#, c-format
+ msgid ""
+ " arp [-v] [<HW>] [-i <if>] -Ds <hostname> <if> [netmask <nm>] pub "
+ "<-''-\n"
+ "\n"
+ msgstr ""
+
+-#: ../arp.c:621
++#: ../arp.c:626
++#, c-format
+ msgid ""
+ " -a display (all) hosts in alternative (BSD) "
+ "style\n"
+ msgstr ""
+
+-#: ../arp.c:622
++#: ../arp.c:627
++#, c-format
+ msgid " -s, --set set a new ARP entry\n"
+ msgstr ""
+
+-#: ../arp.c:623
++#: ../arp.c:628
++#, c-format
+ msgid " -d, --delete delete a specified entry\n"
+ msgstr ""
+
+-#: ../arp.c:624 ../netstat.c:1490 ../route.c:86
++#: ../arp.c:629 ../netstat.c:1503 ../route.c:86
++#, c-format
+ msgid " -v, --verbose be verbose\n"
+ msgstr ""
+
+-#: ../arp.c:625 ../netstat.c:1491 ../route.c:87
++#: ../arp.c:630 ../netstat.c:1504 ../route.c:87
++#, c-format
+ msgid " -n, --numeric don't resolve names\n"
+ msgstr ""
+
+-#: ../arp.c:626
++#: ../arp.c:631
++#, c-format
+ msgid ""
+ " -i, --device specify network interface (e.g. eth0)\n"
+ msgstr ""
+
+-#: ../arp.c:627
++#: ../arp.c:632
++#, c-format
+ msgid " -D, --use-device read <hwaddr> from given device\n"
+ msgstr ""
+
+-#: ../arp.c:628
++#: ../arp.c:633
++#, c-format
+ msgid " -A, -p, --protocol specify protocol family\n"
+ msgstr ""
+
+-#: ../arp.c:629
++#: ../arp.c:634
++#, c-format
+ msgid ""
+-" -f, --file read new entries from file or from "
+-"/etc/ethers\n"
++" -f, --file read new entries from file or from /etc/"
++"ethers\n"
+ "\n"
+ msgstr ""
+
+-#: ../arp.c:631 ../rarp.c:182
++#: ../arp.c:636 ../rarp.c:182
+ #, c-format
+ msgid " <HW>=Use '-H <hw>' to specify hardware address type. Default: %s\n"
+ msgstr ""
+
+-#: ../arp.c:632 ../rarp.c:183
++#: ../arp.c:637 ../rarp.c:183
++#, c-format
+ msgid " List of possible hardware types (which support ARP):\n"
+ msgstr ""
+
+-#: ../arp.c:666 ../arp.c:751
++#: ../arp.c:671 ../arp.c:756
+ #, c-format
+ msgid "%s: hardware type not supported!\n"
+ msgstr ""
+
+-#: ../arp.c:670
++#: ../arp.c:675
+ #, c-format
+ msgid "%s: address family not supported!\n"
+ msgstr ""
+
+-#: ../arp.c:705
++#: ../arp.c:710
++#, c-format
+ msgid "arp: -N not yet supported.\n"
+ msgstr ""
+
+-#: ../arp.c:715
++#: ../arp.c:720
+ #, c-format
+ msgid "arp: %s: unknown address family.\n"
+ msgstr ""
+
+-#: ../arp.c:724
++#: ../arp.c:729
+ #, c-format
+ msgid "arp: %s: unknown hardware type.\n"
+ msgstr ""
+
+-#: ../arp.c:743
++#: ../arp.c:748
+ #, c-format
+ msgid "arp: %s: kernel only supports 'inet'.\n"
+ msgstr ""
+
+-#: ../arp.c:756
++#: ../arp.c:761
+ #, c-format
+ msgid "arp: %s: hardware type without ARP support.\n"
+ msgstr ""
+
+-#: ../hostname.c:70
++#: ../hostname.c:71
+ #, c-format
+ msgid "Setting nodename to `%s'\n"
+ msgstr ""
+
+-#: ../hostname.c:75
++#: ../hostname.c:76
+ #, c-format
+ msgid "%s: you must be root to change the node name\n"
+ msgstr ""
+
+-#: ../hostname.c:78 ../hostname.c:98 ../hostname.c:117
++#: ../hostname.c:79 ../hostname.c:100 ../hostname.c:118
+ #, c-format
+ msgid "%s: name too long\n"
+ msgstr ""
+
+-#: ../hostname.c:90
++#: ../hostname.c:92
+ #, c-format
+ msgid "Setting hostname to `%s'\n"
+ msgstr ""
+
+-#: ../hostname.c:95
++#: ../hostname.c:97
+ #, c-format
+ msgid "%s: you must be root to change the host name\n"
+ msgstr ""
+
+-#: ../hostname.c:109
++#: ../hostname.c:110
+ #, c-format
+ msgid "Setting domainname to `%s'\n"
+ msgstr ""
+
+-#: ../hostname.c:114
++#: ../hostname.c:115
+ #, c-format
+ msgid "%s: you must be root to change the domain name\n"
+ msgstr ""
+@@ -282,83 +304,99 @@ msgstr ""
+ msgid "Result: h_addr_list=`%s'\n"
+ msgstr ""
+
+-#: ../hostname.c:210
++#: ../hostname.c:209
+ #, c-format
+ msgid "%s: can't open `%s'\n"
+ msgstr ""
+
+-#: ../hostname.c:224
++#: ../hostname.c:223
++#, c-format
+ msgid "Usage: hostname [-v] {hostname|-F file} set hostname (from file)\n"
+ msgstr ""
+
+-#: ../hostname.c:225
++#: ../hostname.c:224
++#, c-format
+ msgid ""
+ " domainname [-v] {nisdomain|-F file} set NIS domainname (from file)\n"
+ msgstr ""
+
+-#: ../hostname.c:227
++#: ../hostname.c:226
++#, c-format
+ msgid ""
+ " nodename [-v] {nodename|-F file} set DECnet node name (from "
+ "file)\n"
+ msgstr ""
+
+-#: ../hostname.c:229
++#: ../hostname.c:228
++#, c-format
+ msgid " hostname [-v] [-d|-f|-s|-a|-i|-y|-n] display formatted name\n"
+ msgstr ""
+
+-#: ../hostname.c:230
++#: ../hostname.c:229
++#, c-format
+ msgid ""
+ " hostname [-v] display hostname\n"
+ "\n"
+ msgstr ""
+
+-#: ../hostname.c:231
++#: ../hostname.c:230
++#, c-format
+ msgid ""
+ " hostname -V|--version|-h|--help print info and exit\n"
+ "\n"
+ msgstr ""
+
+-#: ../hostname.c:232
++#: ../hostname.c:231
++#, c-format
+ msgid ""
+ " dnsdomainname=hostname -d, {yp,nis,}domainname=hostname -y\n"
+ "\n"
+ msgstr ""
+
+-#: ../hostname.c:233
++#: ../hostname.c:232
++#, c-format
+ msgid " -s, --short short host name\n"
+ msgstr ""
+
+-#: ../hostname.c:234
++#: ../hostname.c:233
++#, c-format
+ msgid " -a, --alias alias names\n"
+ msgstr ""
+
+-#: ../hostname.c:235
++#: ../hostname.c:234
++#, c-format
+ msgid " -i, --ip-address addresses for the hostname\n"
+ msgstr ""
+
+-#: ../hostname.c:236
++#: ../hostname.c:235
++#, c-format
+ msgid " -f, --fqdn, --long long host name (FQDN)\n"
+ msgstr ""
+
+-#: ../hostname.c:237
++#: ../hostname.c:236
++#, c-format
+ msgid " -d, --domain DNS domain name\n"
+ msgstr ""
+
+-#: ../hostname.c:238
++#: ../hostname.c:237
++#, c-format
+ msgid " -y, --yp, --nis NIS/YP domainname\n"
+ msgstr ""
+
+-#: ../hostname.c:240
++#: ../hostname.c:239
++#, c-format
+ msgid " -n, --node DECnet node name\n"
+ msgstr ""
+
+-#: ../hostname.c:242
++#: ../hostname.c:241
++#, c-format
+ msgid ""
+ " -F, --file read hostname or NIS domainname from given file\n"
+ "\n"
+ msgstr ""
+
+-#: ../hostname.c:244
++#: ../hostname.c:243
++#, c-format
+ msgid ""
+ " This command can read or set the hostname or the NIS domainname. You can\n"
+ " also read the DNS domain or the FQDN (fully qualified domain name).\n"
+@@ -373,12 +411,14 @@ msgid "%s: You can't change the DNS domain name with this command\n"
+ msgstr ""
+
+ #: ../hostname.c:341
++#, c-format
+ msgid ""
+ "\n"
+ "Unless you are using bind or NIS for host lookups you can change the DNS\n"
+ msgstr ""
+
+ #: ../hostname.c:342
++#, c-format
+ msgid "domain name (which is part of the FQDN) in the /etc/hosts file.\n"
+ msgstr ""
+
+@@ -397,557 +437,697 @@ msgstr ""
+ msgid "getnodename()=`%s'\n"
+ msgstr ""
+
+-#: ../ifconfig.c:108
++#: ../ifconfig.c:107 ../netstat.c:1465
++#, c-format
+ msgid ""
+-"Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR "
++"Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR "
+ "Flg\n"
+ msgstr ""
+
+-#: ../ifconfig.c:130 ../ifconfig.c:162
++#: ../ifconfig.c:129 ../ifconfig.c:161
+ #, c-format
+-msgid "%s: unknown interface: %s\n"
++msgid "%s: ERROR while getting interface flags: %s\n"
+ msgstr ""
+
+-#: ../ifconfig.c:154 ../ifconfig.c:734 ../ifconfig.c:825 ../ifconfig.c:936
++#: ../ifconfig.c:153 ../ifconfig.c:185 ../ifconfig.c:791 ../ifconfig.c:884
++#: ../ifconfig.c:997
++#, c-format
+ msgid "No support for INET on this system.\n"
+ msgstr ""
+
+-#: ../ifconfig.c:177
++#: ../ifconfig.c:193
++#, c-format
++msgid "%s: ERROR while testing interface flags: %s\n"
++msgstr ""
++
++#: ../ifconfig.c:202
++#, c-format
+ msgid ""
+ "Usage:\n"
+-" ifconfig [-a] [-i] [-v] [-s] <interface> [[<AF>] <address>]\n"
++" ifconfig [-a] [-v] [-s] <interface> [[<AF>] <address>]\n"
+ msgstr ""
+
+-#: ../ifconfig.c:179
++#: ../ifconfig.c:204
++#, c-format
+ msgid " [add <address>[/<prefixlen>]]\n"
+ msgstr ""
+
+-#: ../ifconfig.c:180
++#: ../ifconfig.c:205
++#, c-format
+ msgid " [del <address>[/<prefixlen>]]\n"
+ msgstr ""
+
+-#: ../ifconfig.c:181
++#: ../ifconfig.c:206
++#, c-format
+ msgid " [[-]broadcast [<address>]] [[-]pointopoint [<address>]]\n"
+ msgstr ""
+
+-#: ../ifconfig.c:182
++#: ../ifconfig.c:207
++#, c-format
+ msgid " [netmask <address>] [dstaddr <address>] [tunnel <address>]\n"
+ msgstr ""
+
+-#: ../ifconfig.c:185
++#: ../ifconfig.c:210
++#, c-format
+ msgid " [outfill <NN>] [keepalive <NN>]\n"
+ msgstr ""
+
+-#: ../ifconfig.c:187
++#: ../ifconfig.c:212
++#, c-format
+ msgid " [hw <HW> <address>] [metric <NN>] [mtu <NN>]\n"
+ msgstr ""
+
+-#: ../ifconfig.c:188
++#: ../ifconfig.c:213
++#, c-format
+ msgid " [[-]trailers] [[-]arp] [[-]allmulti]\n"
+ msgstr ""
+
+-#: ../ifconfig.c:189
++#: ../ifconfig.c:214
++#, c-format
+ msgid " [multicast] [[-]promisc]\n"
+ msgstr ""
+
+-#: ../ifconfig.c:190
++#: ../ifconfig.c:215
++#, c-format
+ msgid " [mem_start <NN>] [io_addr <NN>] [irq <NN>] [media <type>]\n"
+ msgstr ""
+
+-#: ../ifconfig.c:192
++#: ../ifconfig.c:217
++#, c-format
+ msgid " [txqueuelen <NN>]\n"
+ msgstr ""
+
+-#: ../ifconfig.c:195
++#: ../ifconfig.c:220
++#, c-format
+ msgid " [[-]dynamic]\n"
+ msgstr ""
+
+-#: ../ifconfig.c:197
++#: ../ifconfig.c:222
++#, c-format
+ msgid ""
+ " [up|down] ...\n"
+ "\n"
+ msgstr ""
+
+-#: ../ifconfig.c:199
++#: ../ifconfig.c:224
++#, c-format
+ msgid " <HW>=Hardware Type.\n"
+ msgstr ""
+
+-#: ../ifconfig.c:200
++#: ../ifconfig.c:225
++#, c-format
+ msgid " List of possible hardware types:\n"
+ msgstr ""
+
+ #. 1 = ARPable
+-#: ../ifconfig.c:202
++#: ../ifconfig.c:227
+ #, c-format
+ msgid " <AF>=Address family. Default: %s\n"
+ msgstr ""
+
+-#: ../ifconfig.c:203
++#: ../ifconfig.c:228
++#, c-format
+ msgid " List of possible address families:\n"
+ msgstr ""
+
+-#: ../ifconfig.c:278
++#: ../ifconfig.c:304
+ #, c-format
+ msgid "ifconfig: option `%s' not recognised.\n"
+ msgstr ""
+
+-#: ../ifconfig.c:280 ../ifconfig.c:925
++#: ../ifconfig.c:306 ../ifconfig.c:987
++#, c-format
+ msgid "ifconfig: `--help' gives usage information.\n"
+ msgstr ""
+
+-#: ../ifconfig.c:355
++#: ../ifconfig.c:381
++#, c-format
+ msgid "Unknown media type.\n"
+ msgstr ""
+
+-#: ../ifconfig.c:647
++#: ../ifconfig.c:418
++#, c-format
++msgid ""
++"Warning: Interface %s still in promisc mode... maybe other application is "
++"running?\n"
++msgstr ""
++
++#: ../ifconfig.c:430
++#, c-format
++msgid "Warning: Interface %s still in MULTICAST mode.\n"
++msgstr ""
++
++#: ../ifconfig.c:442
++#, c-format
++msgid "Warning: Interface %s still in ALLMULTI mode.\n"
++msgstr ""
++
++#: ../ifconfig.c:466
++#, c-format
++msgid "Warning: Interface %s still in DYNAMIC mode.\n"
++msgstr ""
++
++#: ../ifconfig.c:524
++#, c-format
++msgid "Warning: Interface %s still in BROADCAST mode.\n"
++msgstr ""
++
++#: ../ifconfig.c:535
++#, c-format
++msgid "ifconfig: Error resolving '%s' for broadcast\n"
++msgstr ""
++
++#: ../ifconfig.c:560
++#, c-format
++msgid "ifconfig: Error resolving '%s' for dstaddr\n"
++msgstr ""
++
++#: ../ifconfig.c:583
++#, c-format
++msgid "ifconfig: Error resolving '%s' for netmask\n"
++msgstr ""
++
++#: ../ifconfig.c:662
++#, c-format
++msgid "Warning: Interface %s still in POINTOPOINT mode.\n"
++msgstr ""
++
++#: ../ifconfig.c:673
++#, c-format
++msgid "ifconfig: Error resolving '%s' for pointopoint\n"
++msgstr ""
++
++#: ../ifconfig.c:697
+ #, c-format
+ msgid "hw address type `%s' has no handler to set address. failed.\n"
+ msgstr ""
+
+-#: ../ifconfig.c:656
++#: ../ifconfig.c:706
+ #, c-format
+ msgid "%s: invalid %s address.\n"
+ msgstr ""
+
+-#: ../ifconfig.c:700 ../ifconfig.c:790 ../ifconfig.c:876
++#: ../ifconfig.c:746
++#, c-format
++msgid "ifconfig: Error resolving '%s' for add\n"
++msgstr ""
++
++#: ../ifconfig.c:757 ../ifconfig.c:847 ../ifconfig.c:935
++#, c-format
+ msgid "No support for INET6 on this system.\n"
+ msgstr ""
+
+-#: ../ifconfig.c:743 ../ifconfig.c:834
++#: ../ifconfig.c:800 ../ifconfig.c:893
+ #, c-format
+ msgid "Interface %s not initialized\n"
+ msgstr ""
+
+-#: ../ifconfig.c:755 ../ifconfig.c:845
++#: ../ifconfig.c:812 ../ifconfig.c:904
++#, c-format
+ msgid "Bad address.\n"
+ msgstr ""
+
+-#: ../ifconfig.c:848
++#: ../ifconfig.c:907
++#, c-format
+ msgid "Address deletion not supported on this system.\n"
+ msgstr ""
+
+-#: ../ifconfig.c:920
++#: ../ifconfig.c:979
++#, c-format
+ msgid "ifconfig: Cannot set address for this protocol family.\n"
+ msgstr ""
+
+-#: ../ifconfig.c:946
++#: ../ifconfig.c:986
++#, c-format
++msgid "ifconfig: error resolving '%s' to set address for af=%s\n"
++msgstr ""
++
++#: ../ifconfig.c:1007
++#, c-format
+ msgid "No support for ECONET on this system.\n"
+ msgstr ""
+
+-#: ../ifconfig.c:954
++#: ../ifconfig.c:1015
+ #, c-format
+ msgid "Don't know how to set addresses for family %d.\n"
+ msgstr ""
+
+-#: ../netstat.c:430
++#: ../ifconfig.c:1050
++#, c-format
++msgid "WARNING: at least one error occured. (%d)\n"
++msgstr ""
++
++#: ../netstat.c:434
+ #, c-format
+ msgid ""
+ "(No info could be read for \"-p\": geteuid()=%d but you should be root.)\n"
+ msgstr ""
+
+-#: ../netstat.c:434
++#: ../netstat.c:438
++#, c-format
+ msgid ""
+ "(Not all processes could be identified, non-owned process info\n"
+ " will not be shown, you would have to be root to see it all.)\n"
+ msgstr ""
+
+-#: ../netstat.c:441 ../netstat.c:1176 ../netstat.c:1253
++#: ../netstat.c:445 ../netstat.c:1189 ../netstat.c:1266
+ msgid "LISTENING"
+ msgstr ""
+
+-#: ../netstat.c:442
++#: ../netstat.c:446
+ msgid "CONN SENT"
+ msgstr ""
+
+-#: ../netstat.c:443 ../netstat.c:1255
++#: ../netstat.c:447 ../netstat.c:1268
+ msgid "DISC SENT"
+ msgstr ""
+
+-#: ../netstat.c:444 ../netstat.c:511 ../netstat.c:894 ../netstat.c:1256
++#: ../netstat.c:448 ../netstat.c:515 ../netstat.c:904 ../netstat.c:1269
+ msgid "ESTABLISHED"
+ msgstr ""
+
+-#: ../netstat.c:466
++#: ../netstat.c:470
++#, c-format
+ msgid "Active NET/ROM sockets\n"
+ msgstr ""
+
+-#: ../netstat.c:467
++#: ../netstat.c:471
++#, c-format
+ msgid ""
+-"User Dest Source Device State Vr/Vs Send-Q "
+-"Recv-Q\n"
++"User Dest Source Device State Vr/Vs Send-Q Recv-"
++"Q\n"
+ msgstr ""
+
+-#: ../netstat.c:477 ../netstat.c:1295
++#: ../netstat.c:481 ../netstat.c:1308
+ #, c-format
+ msgid "Problem reading data from %s\n"
+ msgstr ""
+
+-#: ../netstat.c:512
++#: ../netstat.c:516
+ msgid "SYN_SENT"
+ msgstr ""
+
+-#: ../netstat.c:513
++#: ../netstat.c:517
+ msgid "SYN_RECV"
+ msgstr ""
+
+-#: ../netstat.c:514
++#: ../netstat.c:518
+ msgid "FIN_WAIT1"
+ msgstr ""
+
+-#: ../netstat.c:515
++#: ../netstat.c:519
+ msgid "FIN_WAIT2"
+ msgstr ""
+
+-#: ../netstat.c:516
++#: ../netstat.c:520
+ msgid "TIME_WAIT"
+ msgstr ""
+
+-#: ../netstat.c:517
++#: ../netstat.c:521
+ msgid "CLOSE"
+ msgstr ""
+
+-#: ../netstat.c:518
++#: ../netstat.c:522
+ msgid "CLOSE_WAIT"
+ msgstr ""
+
+-#: ../netstat.c:519
++#: ../netstat.c:523
+ msgid "LAST_ACK"
+ msgstr ""
+
+-#: ../netstat.c:520
++#: ../netstat.c:524
+ msgid "LISTEN"
+ msgstr ""
+
+-#: ../netstat.c:521
++#: ../netstat.c:525
+ msgid "CLOSING"
+ msgstr ""
+
+-#: ../netstat.c:592
++#: ../netstat.c:596
+ #, c-format
+ msgid "warning, got bogus igmp6 line %d.\n"
+ msgstr ""
+
+-#: ../netstat.c:597 ../netstat.c:635 ../netstat.c:756 ../netstat.c:888
+-#: ../netstat.c:1019 ../netstat.c:1024
++#: ../netstat.c:601 ../netstat.c:639 ../netstat.c:763 ../netstat.c:898
++#: ../netstat.c:1032 ../netstat.c:1037
+ #, c-format
+ msgid "netstat: unsupported address family %d !\n"
+ msgstr ""
+
+-#: ../netstat.c:610 ../netstat.c:615 ../netstat.c:623 ../netstat.c:630
++#: ../netstat.c:614 ../netstat.c:619 ../netstat.c:627 ../netstat.c:634
+ #, c-format
+ msgid "warning, got bogus igmp line %d.\n"
+ msgstr ""
+
+-#: ../netstat.c:673
++#: ../netstat.c:677
++#, c-format
+ msgid "Active X.25 sockets\n"
+ msgstr ""
+
+ #. IMHO, Vr/Vs is not very usefull --SF
+-#: ../netstat.c:675
++#: ../netstat.c:679
++#, c-format
+ msgid ""
+-"Dest Source Device LCI State Vr/Vs Send-Q "
+-"Recv-Q\n"
++"Dest Source Device LCI State Vr/Vs Send-Q Recv-"
++"Q\n"
+ msgstr ""
+
+-#: ../netstat.c:752
++#: ../netstat.c:759
++#, c-format
+ msgid "warning, got bogus tcp line.\n"
+ msgstr ""
+
+-#: ../netstat.c:793 ../netstat.c:943 ../netstat.c:1062
++#: ../netstat.c:800 ../netstat.c:953 ../netstat.c:1075
+ #, c-format
+ msgid "off (0.00/%ld/%d)"
+ msgstr ""
+
+-#: ../netstat.c:797
++#: ../netstat.c:804
+ #, c-format
+ msgid "on (%2.2f/%ld/%d)"
+ msgstr ""
+
+-#: ../netstat.c:802
++#: ../netstat.c:809
+ #, c-format
+ msgid "keepalive (%2.2f/%ld/%d)"
+ msgstr ""
+
+-#: ../netstat.c:807
++#: ../netstat.c:814
+ #, c-format
+ msgid "timewait (%2.2f/%ld/%d)"
+ msgstr ""
+
+-#: ../netstat.c:812 ../netstat.c:952 ../netstat.c:1072
++#: ../netstat.c:819 ../netstat.c:962 ../netstat.c:1085
+ #, c-format
+ msgid "unkn-%d (%2.2f/%ld/%d)"
+ msgstr ""
+
+-#: ../netstat.c:884
++#: ../netstat.c:894
++#, c-format
+ msgid "warning, got bogus udp line.\n"
+ msgstr ""
+
+-#: ../netstat.c:902 ../netstat.c:1162 ../netstat.c:1195
++#: ../netstat.c:912 ../netstat.c:1175 ../netstat.c:1208
+ msgid "UNKNOWN"
+ msgstr ""
+
+-#: ../netstat.c:948 ../netstat.c:1067
++#: ../netstat.c:958 ../netstat.c:1080
+ #, c-format
+ msgid "on%d (%2.2f/%ld/%d)"
+ msgstr ""
+
+-#: ../netstat.c:1033
++#: ../netstat.c:1046
++#, c-format
+ msgid "warning, got bogus raw line.\n"
+ msgstr ""
+
+-#: ../netstat.c:1115
++#: ../netstat.c:1128
++#, c-format
+ msgid "warning, got bogus unix line.\n"
+ msgstr ""
+
+-#: ../netstat.c:1142
++#: ../netstat.c:1155
+ msgid "STREAM"
+ msgstr ""
+
+-#: ../netstat.c:1146
++#: ../netstat.c:1159
+ msgid "DGRAM"
+ msgstr ""
+
+-#: ../netstat.c:1150
++#: ../netstat.c:1163
+ msgid "RAW"
+ msgstr ""
+
+-#: ../netstat.c:1154
++#: ../netstat.c:1167
+ msgid "RDM"
+ msgstr ""
+
+-#: ../netstat.c:1158
++#: ../netstat.c:1171
+ msgid "SEQPACKET"
+ msgstr ""
+
+-#: ../netstat.c:1167
++#: ../netstat.c:1180
+ msgid "FREE"
+ msgstr ""
+
+-#: ../netstat.c:1183
++#: ../netstat.c:1196
+ msgid "CONNECTING"
+ msgstr ""
+
+-#: ../netstat.c:1187
++#: ../netstat.c:1200
+ msgid "CONNECTED"
+ msgstr ""
+
+-#: ../netstat.c:1191
++#: ../netstat.c:1204
+ msgid "DISCONNECTING"
+ msgstr ""
+
+-#: ../netstat.c:1222
++#: ../netstat.c:1235
++#, c-format
+ msgid "Active UNIX domain sockets "
+ msgstr ""
+
+-#: ../netstat.c:1224 ../netstat.c:1735
++#: ../netstat.c:1237 ../netstat.c:1756
++#, c-format
+ msgid "(servers and established)"
+ msgstr ""
+
+-#: ../netstat.c:1227 ../netstat.c:1738
++#: ../netstat.c:1240 ../netstat.c:1759
++#, c-format
+ msgid "(only servers)"
+ msgstr ""
+
+-#: ../netstat.c:1229 ../netstat.c:1740
++#: ../netstat.c:1242 ../netstat.c:1761
++#, c-format
+ msgid "(w/o servers)"
+ msgstr ""
+
+-#: ../netstat.c:1232
++#: ../netstat.c:1245
++#, c-format
+ msgid ""
+ "\n"
+ "Proto RefCnt Flags Type State I-Node"
+ msgstr ""
+
+-#: ../netstat.c:1234
++#: ../netstat.c:1247
++#, c-format
+ msgid " Path\n"
+ msgstr ""
+
+-#: ../netstat.c:1254
++#: ../netstat.c:1267
+ msgid "SABM SENT"
+ msgstr ""
+
+-#: ../netstat.c:1257
++#: ../netstat.c:1270
+ msgid "RECOVERY"
+ msgstr ""
+
+-#: ../netstat.c:1271
++#: ../netstat.c:1284
++#, c-format
+ msgid "Active AX.25 sockets\n"
+ msgstr ""
+
+-#: ../netstat.c:1272
++#: ../netstat.c:1285
++#, c-format
+ msgid "Dest Source Device State Vr/Vs Send-Q Recv-Q\n"
+ msgstr ""
+
+-#: ../netstat.c:1315
++#: ../netstat.c:1328
+ #, c-format
+ msgid "problem reading data from %s\n"
+ msgstr ""
+
+-#: ../netstat.c:1366
++#: ../netstat.c:1379
++#, c-format
+ msgid ""
+ "Active IPX sockets\n"
+ "Proto Recv-Q Send-Q Local Address Foreign Address "
+ "State"
+ msgstr ""
+
+-#: ../netstat.c:1368
++#: ../netstat.c:1381
++#, c-format
+ msgid " User"
+ msgstr ""
+
+-#: ../netstat.c:1402
++#: ../netstat.c:1415
+ msgid "ESTAB"
+ msgstr ""
+
+-#: ../netstat.c:1410
++#: ../netstat.c:1423
+ msgid "UNK."
+ msgstr ""
+
+-#: ../netstat.c:1448
++#: ../netstat.c:1461
++#, c-format
+ msgid "Kernel Interface table\n"
+ msgstr ""
+
+-#: ../netstat.c:1452
+-msgid ""
+-"Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR "
+-"Flg\n"
+-msgstr ""
+-
+-#: ../netstat.c:1456
++#: ../netstat.c:1469
+ msgid "missing interface information"
+ msgstr ""
+
+-#: ../netstat.c:1479
++#: ../netstat.c:1492
++#, c-format
+ msgid ""
+-"usage: netstat [-veenNcCF] [<Af>] -r netstat "
+-"{-V|--version|-h|--help}\n"
++"usage: netstat [-veenNcCF] [<Af>] -r netstat {-V|--version|-h|--"
++"help}\n"
+ msgstr ""
+
+-#: ../netstat.c:1480
++#: ../netstat.c:1493
++#, c-format
+ msgid " netstat [-vnNcaeol] [<Socket> ...]\n"
+ msgstr ""
+
+-#: ../netstat.c:1481
++#: ../netstat.c:1494
++#, c-format
+ msgid ""
+ " netstat { [-veenNac] -i | [-cnNe] -M | -s }\n"
+ "\n"
+ msgstr ""
+
+-#: ../netstat.c:1483
++#: ../netstat.c:1496
++#, c-format
+ msgid " -r, --route display routing table\n"
+ msgstr ""
+
+-#: ../netstat.c:1484
++#: ../netstat.c:1497
++#, c-format
+ msgid " -i, --interfaces display interface table\n"
+ msgstr ""
+
+-#: ../netstat.c:1485
++#: ../netstat.c:1498
++#, c-format
+ msgid " -g, --groups display multicast group memberships\n"
+ msgstr ""
+
+-#: ../netstat.c:1486
++#: ../netstat.c:1499
++#, c-format
+ msgid ""
+ " -s, --statistics display networking statistics (like SNMP)\n"
+ msgstr ""
+
+-#: ../netstat.c:1488
++#: ../netstat.c:1501
++#, c-format
+ msgid ""
+ " -M, --masquerade display masqueraded connections\n"
+ "\n"
+ msgstr ""
+
+-#: ../netstat.c:1492
++#: ../netstat.c:1505
++#, c-format
+ msgid " --numeric-hosts don't resolve host names\n"
+ msgstr ""
+
+-#: ../netstat.c:1493
++#: ../netstat.c:1506
++#, c-format
+ msgid " --numeric-ports don't resolve port names\n"
+ msgstr ""
+
+-#: ../netstat.c:1494
++#: ../netstat.c:1507
++#, c-format
+ msgid " --numeric-users don't resolve user names\n"
+ msgstr ""
+
+-#: ../netstat.c:1495
++#: ../netstat.c:1508
++#, c-format
+ msgid " -N, --symbolic resolve hardware names\n"
+ msgstr ""
+
+-#: ../netstat.c:1496 ../route.c:88
++#: ../netstat.c:1509 ../route.c:88
++#, c-format
+ msgid " -e, --extend display other/more information\n"
+ msgstr ""
+
+-#: ../netstat.c:1497
++#: ../netstat.c:1510
++#, c-format
+ msgid " -p, --programs display PID/Program name for sockets\n"
+ msgstr ""
+
+-#: ../netstat.c:1498
++#: ../netstat.c:1511
++#, c-format
+ msgid ""
+ " -c, --continuous continuous listing\n"
+ "\n"
+ msgstr ""
+
+-#: ../netstat.c:1499
++#: ../netstat.c:1512
++#, c-format
+ msgid " -l, --listening display listening server sockets\n"
+ msgstr ""
+
+-#: ../netstat.c:1500
++#: ../netstat.c:1513
++#, c-format
+ msgid ""
+ " -a, --all, --listening display all sockets (default: connected)\n"
+ msgstr ""
+
+-#: ../netstat.c:1501
++#: ../netstat.c:1514
++#, c-format
+ msgid " -o, --timers display timers\n"
+ msgstr ""
+
+-#: ../netstat.c:1502 ../route.c:89
++#: ../netstat.c:1515 ../route.c:89
++#, c-format
+ msgid ""
+ " -F, --fib display Forwarding Information Base "
+ "(default)\n"
+ msgstr ""
+
+-#: ../netstat.c:1503 ../route.c:90
++#: ../netstat.c:1516 ../route.c:90
++#, c-format
+ msgid ""
+ " -C, --cache display routing cache instead of FIB\n"
+ "\n"
+ msgstr ""
+
+-#: ../netstat.c:1505
++#: ../netstat.c:1518
++#, c-format
+ msgid ""
+-" <Socket>={-t|--tcp} {-u|--udp} {-w|--raw} {-x|--unix} --ax25 --ipx "
+-"--netrom\n"
++" <Socket>={-t|--tcp} {-u|--udp} {-w|--raw} {-x|--unix} --ax25 --ipx --"
++"netrom\n"
+ msgstr ""
+
+-#: ../netstat.c:1506 ../route.c:92
++#: ../netstat.c:1519
+ #, c-format
+-msgid " <AF>=Use '-A <af>' or '--<af>'; default: %s\n"
++msgid " <AF>=Use '-6|-4' or '-A <af>' or '--<af>'; default: %s\n"
+ msgstr ""
+
+-#: ../netstat.c:1507 ../route.c:93
++#: ../netstat.c:1520 ../route.c:93
++#, c-format
+ msgid " List of possible address families (which support routing):\n"
+ msgstr ""
+
+-#: ../netstat.c:1732
++#: ../netstat.c:1753
++#, c-format
+ msgid "Active Internet connections "
+ msgstr ""
+
+-#: ../netstat.c:1742
++#: ../netstat.c:1763
++#, c-format
+ msgid ""
+ "\n"
+-"Proto Recv-Q Send-Q Local Address Foreign Address State "
+-" "
++"Proto Recv-Q Send-Q Local Address Foreign Address "
++"State "
+ msgstr ""
+
+-#: ../netstat.c:1744
++#: ../netstat.c:1765
++#, c-format
+ msgid " User Inode "
+ msgstr ""
+
+-#: ../netstat.c:1747
++#: ../netstat.c:1768
++#, c-format
+ msgid " Timer"
+ msgstr ""
+
+-#: ../netstat.c:1777
++#: ../netstat.c:1798
++#, c-format
+ msgid "IPv4 Group Memberships\n"
+ msgstr ""
+
+-#: ../netstat.c:1778
++#: ../netstat.c:1799
++#, c-format
+ msgid "Interface RefCnt Group\n"
+ msgstr ""
+
+@@ -986,23 +1166,28 @@ msgid "rarp: cannot set entry from %s:%u\n"
+ msgstr ""
+
+ #: ../rarp.c:176
++#, c-format
+ msgid "Usage: rarp -a list entries in cache.\n"
+ msgstr ""
+
+ #: ../rarp.c:177
++#, c-format
+ msgid " rarp -d <hostname> delete entry from cache.\n"
+ msgstr ""
+
+ #: ../rarp.c:178
++#, c-format
+ msgid " rarp [<HW>] -s <hostname> <hwaddr> add entry to cache.\n"
+ msgstr ""
+
+ #: ../rarp.c:179
++#, c-format
+ msgid ""
+ " rarp -f add entries from /etc/ethers.\n"
+ msgstr ""
+
+ #: ../rarp.c:180
++#, c-format
+ msgid ""
+ " rarp -V display program version.\n"
+ "\n"
+@@ -1019,38 +1204,50 @@ msgid "rarp: %s: unknown hardware type.\n"
+ msgstr ""
+
+ #: ../route.c:80
++#, c-format
+ msgid ""
+ "Usage: route [-nNvee] [-FC] [<AF>] List kernel routing tables\n"
+ msgstr ""
+
+ #: ../route.c:81
++#, c-format
+ msgid ""
+ " route [-v] [-FC] {add|del|flush} ... Modify routing table for AF.\n"
+ "\n"
+ msgstr ""
+
+ #: ../route.c:83
++#, c-format
+ msgid ""
+ " route {-h|--help} [<AF>] Detailed usage syntax for "
+ "specified AF.\n"
+ msgstr ""
+
+ #: ../route.c:84
++#, c-format
+ msgid ""
+ " route {-V|--version} Display version/author and "
+ "exit.\n"
+ "\n"
+ msgstr ""
+
++#: ../route.c:92
++#, c-format
++msgid " <AF>=Use '-A <af>' or '--<af>'; default: %s\n"
++msgstr ""
++
+ #: ../plipconfig.c:66
++#, c-format
+ msgid "Usage: plipconfig [-a] [-i] [-v] interface\n"
+ msgstr ""
+
+ #: ../plipconfig.c:67
++#, c-format
+ msgid " [nibble NN] [trigger NN]\n"
+ msgstr ""
+
+ #: ../plipconfig.c:68
++#, c-format
+ msgid " plipconfig -V | --version\n"
+ msgstr ""
+
+@@ -1060,61 +1257,75 @@ msgid "%s\tnibble %lu trigger %lu\n"
+ msgstr ""
+
+ #: ../iptunnel.c:85
++#, c-format
+ msgid "Usage: iptunnel { add | change | del | show } [ NAME ]\n"
+ msgstr ""
+
+ #: ../iptunnel.c:86
++#, c-format
+ msgid ""
+ " [ mode { ipip | gre | sit } ] [ remote ADDR ] [ local ADDR ]\n"
+ msgstr ""
+
+ #: ../iptunnel.c:87
++#, c-format
+ msgid " [ [i|o]seq ] [ [i|o]key KEY ] [ [i|o]csum ]\n"
+ msgstr ""
+
+ #: ../iptunnel.c:88
++#, c-format
+ msgid " [ ttl TTL ] [ tos TOS ] [ nopmtudisc ] [ dev PHYS_DEV ]\n"
+ msgstr ""
+
+ #: ../iptunnel.c:89
++#, c-format
+ msgid ""
+ " iptunnel -V | --version\n"
+ "\n"
+ msgstr ""
+
+ #: ../iptunnel.c:90
++#, c-format
+ msgid "Where: NAME := STRING\n"
+ msgstr ""
+
+ #: ../iptunnel.c:91
++#, c-format
+ msgid " ADDR := { IP_ADDRESS | any }\n"
+ msgstr ""
+
+ #: ../iptunnel.c:92
++#, c-format
+ msgid " TOS := { NUMBER | inherit }\n"
+ msgstr ""
+
+ #: ../iptunnel.c:93
++#, c-format
+ msgid " TTL := { 1..255 | inherit }\n"
+ msgstr ""
+
+ #: ../iptunnel.c:94
++#, c-format
+ msgid " KEY := { DOTTED_QUAD | NUMBER }\n"
+ msgstr ""
+
+ #: ../iptunnel.c:332
++#, c-format
+ msgid "Keys are not allowed with ipip and sit.\n"
+ msgstr ""
+
+ #: ../iptunnel.c:352
++#, c-format
+ msgid "Broadcast tunnel requires a source address.\n"
+ msgstr ""
+
+ #: ../iptunnel.c:367
++#, c-format
+ msgid "ttl != 0 and noptmudisc are incompatible\n"
+ msgstr ""
+
+ #: ../iptunnel.c:379
++#, c-format
+ msgid "cannot determine tunnel mode (ipip, gre or sit)\n"
+ msgstr ""
+
+@@ -1128,22 +1339,27 @@ msgid "unknown"
+ msgstr ""
+
+ #: ../iptunnel.c:453
++#, c-format
+ msgid " Drop packets out of sequence.\n"
+ msgstr ""
+
+ #: ../iptunnel.c:455
++#, c-format
+ msgid " Checksum in received packet is required.\n"
+ msgstr ""
+
+ #: ../iptunnel.c:457
++#, c-format
+ msgid " Sequence packets on output.\n"
+ msgstr ""
+
+ #: ../iptunnel.c:459
++#, c-format
+ msgid " Checksum output packets.\n"
+ msgstr ""
+
+ #: ../iptunnel.c:487
++#, c-format
+ msgid "Wrong format of /proc/net/dev. Sorry.\n"
+ msgstr ""
+
+@@ -1153,10 +1369,12 @@ msgid "Failed to get type of [%s]\n"
+ msgstr ""
+
+ #: ../iptunnel.c:516
++#, c-format
+ msgid "RX: Packets Bytes Errors CsumErrs OutOfSeq Mcasts\n"
+ msgstr ""
+
+ #: ../iptunnel.c:519
++#, c-format
+ msgid "TX: Packets Bytes Errors DeadLoop NoRoute NoBufs\n"
+ msgstr ""
+
+@@ -1323,287 +1541,487 @@ msgstr ""
+
+ #: ../statistics.c:99
+ #, c-format
+-msgid "address mask request: %u"
++msgid "address mask request: %u"
++msgstr ""
++
++#. ?
++#: ../statistics.c:100 ../statistics.c:113
++#, c-format
++msgid "address mask replies: %u"
++msgstr ""
++
++#. ?
++#: ../statistics.c:101
++#, c-format
++msgid "%u ICMP messages sent"
++msgstr ""
++
++#: ../statistics.c:102
++#, c-format
++msgid "%u ICMP messages failed"
++msgstr ""
++
++#: ../statistics.c:104
++#, c-format
++msgid "time exceeded: %u"
++msgstr ""
++
++#. ?
++#: ../statistics.c:106
++#, c-format
++msgid "source quench: %u"
++msgstr ""
++
++#: ../statistics.c:107
++#, c-format
++msgid "redirect: %u"
++msgstr ""
++
++#: ../statistics.c:108
++#, c-format
++msgid "echo request: %u"
++msgstr ""
++
++#: ../statistics.c:110
++#, c-format
++msgid "timestamp requests: %u"
++msgstr ""
++
++#: ../statistics.c:111
++#, c-format
++msgid "timestamp replies: %u"
++msgstr ""
++
++#: ../statistics.c:112
++#, c-format
++msgid "address mask requests: %u"
++msgstr ""
++
++#: ../statistics.c:118
++#, c-format
++msgid "RTO algorithm is %s"
++msgstr ""
++
++#: ../statistics.c:122
++#, c-format
++msgid "%u active connections openings"
++msgstr ""
++
++#: ../statistics.c:123
++#, c-format
++msgid "%u passive connection openings"
++msgstr ""
++
++#: ../statistics.c:124
++#, c-format
++msgid "%u failed connection attempts"
++msgstr ""
++
++#: ../statistics.c:125
++#, c-format
++msgid "%u connection resets received"
++msgstr ""
++
++#: ../statistics.c:126
++#, c-format
++msgid "%u connections established"
++msgstr ""
++
++#: ../statistics.c:127
++#, c-format
++msgid "%u segments received"
++msgstr ""
++
++#: ../statistics.c:128
++#, c-format
++msgid "%u segments send out"
++msgstr ""
++
++#: ../statistics.c:129
++#, c-format
++msgid "%u segments retransmited"
++msgstr ""
++
++#: ../statistics.c:130
++#, c-format
++msgid "%u bad segments received."
++msgstr ""
++
++#: ../statistics.c:131
++#, c-format
++msgid "%u resets sent"
++msgstr ""
++
++#: ../statistics.c:136
++#, c-format
++msgid "%u packets received"
++msgstr ""
++
++#: ../statistics.c:137
++#, c-format
++msgid "%u packets to unknown port received."
++msgstr ""
++
++#: ../statistics.c:138
++#, c-format
++msgid "%u packet receive errors"
++msgstr ""
++
++#: ../statistics.c:139
++#, c-format
++msgid "%u packets sent"
++msgstr ""
++
++#: ../statistics.c:144
++#, c-format
++msgid "%u SYN cookies sent"
++msgstr ""
++
++#: ../statistics.c:145
++#, c-format
++msgid "%u SYN cookies received"
++msgstr ""
++
++#: ../statistics.c:146
++#, c-format
++msgid "%u invalid SYN cookies received"
++msgstr ""
++
++#: ../statistics.c:148
++#, c-format
++msgid "%u resets received for embryonic SYN_RECV sockets"
++msgstr ""
++
++#: ../statistics.c:150
++#, c-format
++msgid "%u packets pruned from receive queue because of socket buffer overrun"
++msgstr ""
++
++#. obsolete: 2.2.0 doesn't do that anymore
++#: ../statistics.c:153
++#, c-format
++msgid "%u packets pruned from receive queue"
++msgstr ""
++
++#: ../statistics.c:154
++#, c-format
++msgid ""
++"%u packets dropped from out-of-order queue because of socket buffer overrun"
++msgstr ""
++
++#: ../statistics.c:156
++#, c-format
++msgid "%u ICMP packets dropped because they were out-of-window"
++msgstr ""
++
++#: ../statistics.c:158
++#, c-format
++msgid "%u ICMP packets dropped because socket was locked"
++msgstr ""
++
++#: ../statistics.c:160
++#, c-format
++msgid "%u TCP sockets finished time wait in fast timer"
++msgstr ""
++
++#: ../statistics.c:161
++#, c-format
++msgid "%u time wait sockets recycled by time stamp"
++msgstr ""
++
++#: ../statistics.c:162
++#, c-format
++msgid "%u TCP sockets finished time wait in slow timer"
++msgstr ""
++
++#: ../statistics.c:163
++#, c-format
++msgid "%u passive connections rejected because of time stamp"
++msgstr ""
++
++#: ../statistics.c:165
++#, c-format
++msgid "%u active connections rejected because of time stamp"
++msgstr ""
++
++#: ../statistics.c:167
++#, c-format
++msgid "%u packets rejects in established connections because of timestamp"
+ msgstr ""
+
+-#. ?
+-#: ../statistics.c:100 ../statistics.c:113
++#: ../statistics.c:169
+ #, c-format
+-msgid "address mask replies: %u"
++msgid "%u delayed acks sent"
+ msgstr ""
+
+-#. ?
+-#: ../statistics.c:101
++#: ../statistics.c:170
+ #, c-format
+-msgid "%u ICMP messages sent"
++msgid "%u delayed acks further delayed because of locked socket"
+ msgstr ""
+
+-#: ../statistics.c:102
++#: ../statistics.c:172
+ #, c-format
+-msgid "%u ICMP messages failed"
++msgid "Quick ack mode was activated %u times"
+ msgstr ""
+
+-#: ../statistics.c:104
++#: ../statistics.c:173
+ #, c-format
+-msgid "time exceeded: %u"
++msgid "%u times the listen queue of a socket overflowed"
+ msgstr ""
+
+-#. ?
+-#: ../statistics.c:106
++#: ../statistics.c:175
+ #, c-format
+-msgid "source quench: %u"
++msgid "%u SYNs to LISTEN sockets dropped"
+ msgstr ""
+
+-#: ../statistics.c:107
++#: ../statistics.c:176
+ #, c-format
+-msgid "redirect: %u"
++msgid "%u packets directly queued to recvmsg prequeue."
+ msgstr ""
+
+-#: ../statistics.c:108
++#: ../statistics.c:178
+ #, c-format
+-msgid "echo request: %u"
++msgid "%u bytes directly in process context from backlog"
+ msgstr ""
+
+-#: ../statistics.c:110
++#: ../statistics.c:179
+ #, c-format
+-msgid "timestamp requests: %u"
++msgid "%u bytes directly received in process context from prequeue"
+ msgstr ""
+
+-#: ../statistics.c:111
++#: ../statistics.c:181
+ #, c-format
+-msgid "timestamp replies: %u"
++msgid "%u packets dropped from prequeue"
+ msgstr ""
+
+-#: ../statistics.c:112
++#: ../statistics.c:182
+ #, c-format
+-msgid "address mask requests: %u"
++msgid "%u packet headers predicted"
+ msgstr ""
+
+-#: ../statistics.c:118
++#: ../statistics.c:183
+ #, c-format
+-msgid "RTO algorithm is %s"
++msgid "%u packets header predicted and directly queued to user"
+ msgstr ""
+
+-#: ../statistics.c:122
++#: ../statistics.c:185
+ #, c-format
+-msgid "%u active connections openings"
++msgid "Ran %u times out of system memory during packet sending"
+ msgstr ""
+
+-#: ../statistics.c:123
++#: ../statistics.c:187
+ #, c-format
+-msgid "%u passive connection openings"
++msgid "%u acknowledgments not containing data payload received"
+ msgstr ""
+
+-#: ../statistics.c:124
++#: ../statistics.c:188
+ #, c-format
+-msgid "%u failed connection attempts"
++msgid "%u predicted acknowledgments"
+ msgstr ""
+
+-#: ../statistics.c:125
++#: ../statistics.c:189
+ #, c-format
+-msgid "%u connection resets received"
++msgid "%u times recovered from packet loss due to fast retransmit"
+ msgstr ""
+
+-#: ../statistics.c:126
++#: ../statistics.c:190
+ #, c-format
+-msgid "%u connections established"
++msgid "%u times recovered from packet loss by selective acknowledgements"
+ msgstr ""
+
+-#: ../statistics.c:127
++#: ../statistics.c:191
+ #, c-format
+-msgid "%u segments received"
++msgid "%u bad SACK blocks received"
+ msgstr ""
+
+-#: ../statistics.c:128
++#: ../statistics.c:192
+ #, c-format
+-msgid "%u segments send out"
++msgid "Detected reordering %u times using FACK"
+ msgstr ""
+
+-#: ../statistics.c:129
++#: ../statistics.c:193
+ #, c-format
+-msgid "%u segments retransmited"
++msgid "Detected reordering %u times using SACK"
+ msgstr ""
+
+-#: ../statistics.c:130
++#: ../statistics.c:194
+ #, c-format
+-msgid "%u bad segments received."
++msgid "Detected reordering %u times using time stamp"
+ msgstr ""
+
+-#: ../statistics.c:131
++#: ../statistics.c:195
+ #, c-format
+-msgid "%u resets sent"
++msgid "Detected reordering %u times using reno fast retransmit"
+ msgstr ""
+
+-#: ../statistics.c:136
++#: ../statistics.c:196
+ #, c-format
+-msgid "%u packets received"
++msgid "%u congestion windows fully recovered without slow start"
+ msgstr ""
+
+-#: ../statistics.c:137
++#: ../statistics.c:197
+ #, c-format
+-msgid "%u packets to unknown port received."
++msgid "%u congestion windows partially recovered using Hoe heuristic"
+ msgstr ""
+
+-#: ../statistics.c:138
++#: ../statistics.c:198
+ #, c-format
+-msgid "%u packet receive errors"
++msgid "%u congestion window recovered without slow start using DSACK"
+ msgstr ""
+
+-#: ../statistics.c:139
++#: ../statistics.c:199
+ #, c-format
+-msgid "%u packets sent"
++msgid "%u congestion windows recovered without slow start after partial ack"
+ msgstr ""
+
+-#: ../statistics.c:144
++#: ../statistics.c:200
+ #, c-format
+-msgid "%u SYN cookies sent"
++msgid "%u retransmits lost"
+ msgstr ""
+
+-#: ../statistics.c:145
++#: ../statistics.c:201
+ #, c-format
+-msgid "%u SYN cookies received"
++msgid "%u timeouts after reno fast retransmit"
+ msgstr ""
+
+-#: ../statistics.c:146
++#: ../statistics.c:202
+ #, c-format
+-msgid "%u invalid SYN cookies received"
++msgid "%u timeouts after SACK recovery"
+ msgstr ""
+
+-#: ../statistics.c:148
++#: ../statistics.c:203
+ #, c-format
+-msgid "%u resets received for embryonic SYN_RECV sockets"
++msgid "%u timeouts in loss state"
+ msgstr ""
+
+-#: ../statistics.c:150
++#: ../statistics.c:204
+ #, c-format
+-msgid "%u packets pruned from receive queue because of socket buffer overrun"
++msgid "%u fast retransmits"
+ msgstr ""
+
+-#. obsolete: 2.2.0 doesn't do that anymore
+-#: ../statistics.c:153
++#: ../statistics.c:205
+ #, c-format
+-msgid "%u packets pruned from receive queue"
++msgid "%u forward retransmits"
+ msgstr ""
+
+-#: ../statistics.c:154
++#: ../statistics.c:206
+ #, c-format
+-msgid ""
+-"%u packets dropped from out-of-order queue because of socket buffer overrun"
++msgid "%u retransmits in slow start"
+ msgstr ""
+
+-#: ../statistics.c:156
++#: ../statistics.c:207
+ #, c-format
+-msgid "%u ICMP packets dropped because they were out-of-window"
++msgid "%u other TCP timeouts"
+ msgstr ""
+
+-#: ../statistics.c:158
++#: ../statistics.c:208
+ #, c-format
+-msgid "%u ICMP packets dropped because socket was locked"
++msgid "%u reno fast retransmits failed"
+ msgstr ""
+
+-#: ../statistics.c:160
++#: ../statistics.c:209
+ #, c-format
+-msgid "%u TCP sockets finished time wait in fast timer"
++msgid "%u SACK retransmits failed"
+ msgstr ""
+
+-#: ../statistics.c:161
++#: ../statistics.c:210
+ #, c-format
+-msgid "%u time wait sockets recycled by time stamp"
++msgid "%u times receiver scheduled too late for direct processing"
+ msgstr ""
+
+-#: ../statistics.c:162
++#: ../statistics.c:211
+ #, c-format
+-msgid "%u TCP sockets finished time wait in slow timer"
++msgid "%u packets collapsed in receive queue due to low socket buffer"
+ msgstr ""
+
+-#: ../statistics.c:163
++#: ../statistics.c:212
+ #, c-format
+-msgid "%u passive connections rejected because of time stamp"
++msgid "%u DSACKs sent for old packets"
+ msgstr ""
+
+-#: ../statistics.c:165
++#: ../statistics.c:213
+ #, c-format
+-msgid "%u active connections rejected because of time stamp"
++msgid "%u DSACKs sent for out of order packets"
+ msgstr ""
+
+-#: ../statistics.c:167
++#: ../statistics.c:214
+ #, c-format
+-msgid "%u packets rejects in established connections because of timestamp"
++msgid "%u DSACKs received"
+ msgstr ""
+
+-#: ../statistics.c:169
++#: ../statistics.c:215
+ #, c-format
+-msgid "%u delayed acks sent"
++msgid "%u DSACKs for out of order packets received"
+ msgstr ""
+
+-#: ../statistics.c:170
++#: ../statistics.c:216
+ #, c-format
+-msgid "%u delayed acks further delayed because of locked socket"
++msgid "%u connections reset due to unexpected SYN"
+ msgstr ""
+
+-#: ../statistics.c:172
++#: ../statistics.c:217
+ #, c-format
+-msgid "Quick ack mode was activated %u times"
++msgid "%u connections reset due to unexpected data"
+ msgstr ""
+
+-#: ../statistics.c:173
++#: ../statistics.c:218
+ #, c-format
+-msgid "%u times the listen queue of a socket overflowed"
++msgid "%u connections reset due to early user close"
+ msgstr ""
+
+-#: ../statistics.c:175
++#: ../statistics.c:219
+ #, c-format
+-msgid "%u SYNs to LISTEN sockets ignored"
++msgid "%u connections aborted due to memory pressure"
+ msgstr ""
+
+-#: ../statistics.c:176
++#: ../statistics.c:220
+ #, c-format
+-msgid "%u packets directly queued to recvmsg prequeue."
++msgid "%u connections aborted due to timeout"
+ msgstr ""
+
+-#: ../statistics.c:178
++#: ../statistics.c:221
+ #, c-format
+-msgid "%u packets directly received from backlog"
++msgid "%u connections aborted after user close in linger timeout"
+ msgstr ""
+
+-#: ../statistics.c:180
++#: ../statistics.c:222
+ #, c-format
+-msgid "%u packets directly received from prequeue"
++msgid "%u times unabled to send RST due to no memory"
+ msgstr ""
+
+-#: ../statistics.c:182
++#: ../statistics.c:223
+ #, c-format
+-msgid "%u packets dropped from prequeue"
++msgid "TCP ran low on memory %u times"
+ msgstr ""
+
+-#: ../statistics.c:183
++#: ../statistics.c:224
+ #, c-format
+-msgid "%u packets header predicted"
++msgid "%u TCP data loss events"
+ msgstr ""
+
+-#: ../statistics.c:184
++#: ../statistics.c:225
+ #, c-format
+-msgid "%u packets header predicted and directly queued to user"
++msgid "%u congestion windows recovered without slow start by DSACK"
+ msgstr ""
+
+-#: ../statistics.c:186
++#: ../statistics.c:227
+ #, c-format
+-msgid "Ran %u times out of system memory during packet sending"
++msgid "%u classic Reno fast retransmits failed"
+ msgstr ""
+
+-#: ../statistics.c:253
++#: ../statistics.c:294
+ msgid "enabled"
+ msgstr ""
+
+-#: ../statistics.c:253
++#: ../statistics.c:294
+ msgid "disabled"
+ msgstr ""
+
+-#: ../statistics.c:336
++#: ../statistics.c:377
+ msgid "error parsing /proc/net/snmp"
+ msgstr ""
+
+-#: ../statistics.c:349
++#: ../statistics.c:390
+ msgid "cannot open /proc/net/snmp"
+ msgstr ""
+
+@@ -1617,7 +2035,7 @@ msgstr ""
+ msgid "Cannot change line discipline to `%s'.\n"
+ msgstr ""
+
+-#: ../lib/af.c:153 ../lib/hw.c:156
++#: ../lib/af.c:153 ../lib/hw.c:161
+ msgid "UNSPEC"
+ msgstr ""
+
+@@ -1633,11 +2051,11 @@ msgstr ""
+ msgid "IPv6"
+ msgstr ""
+
+-#: ../lib/af.c:164 ../lib/hw.c:177
++#: ../lib/af.c:164 ../lib/hw.c:182
+ msgid "AMPR AX.25"
+ msgstr ""
+
+-#: ../lib/af.c:167 ../lib/hw.c:183
++#: ../lib/af.c:167 ../lib/hw.c:188
+ msgid "AMPR NET/ROM"
+ msgstr ""
+
+@@ -1649,7 +2067,7 @@ msgstr ""
+ msgid "Appletalk DDP"
+ msgstr ""
+
+-#: ../lib/af.c:176 ../lib/hw.c:218
++#: ../lib/af.c:176 ../lib/hw.c:223
+ msgid "Econet"
+ msgstr ""
+
+@@ -1657,19 +2075,21 @@ msgstr ""
+ msgid "CCITT X.25"
+ msgstr ""
+
+-#: ../lib/af.c:182 ../lib/hw.c:180
++#: ../lib/af.c:182 ../lib/hw.c:185
+ msgid "AMPR ROSE"
+ msgstr ""
+
+-#: ../lib/af.c:185 ../lib/hw.c:168
++#: ../lib/af.c:185 ../lib/hw.c:173
+ msgid "Ash"
+ msgstr ""
+
+ #: ../lib/af.c:243
++#, c-format
+ msgid "Please don't supply more than one address family.\n"
+ msgstr ""
+
+ #: ../lib/af.c:304
++#, c-format
+ msgid "Too much address family arguments.\n"
+ msgstr ""
+
+@@ -1694,11 +2114,12 @@ msgid "in_arcnet(%s): trailing junk!\n"
+ msgstr ""
+
+ #: ../lib/ash.c:81
++#, c-format
+ msgid "Malformed Ash address"
+ msgstr ""
+
+ #: ../lib/ax25.c:75 ../lib/ddp.c:50 ../lib/econet.c:52 ../lib/inet.c:244
+-#: ../lib/inet.c:259 ../lib/inet6.c:129 ../lib/ipx.c:81 ../lib/netrom.c:78
++#: ../lib/inet.c:259 ../lib/inet6.c:145 ../lib/ipx.c:81 ../lib/netrom.c:78
+ #: ../lib/rose.c:71 ../lib/unix.c:56 ../lib/unix.c:76
+ msgid "[NONE SET]"
+ msgstr ""
+@@ -1712,22 +2133,21 @@ msgid "Callsign too long"
+ msgstr ""
+
+ #: ../lib/ax25_gr.c:47
++#, c-format
+ msgid "AX.25 not configured in this system.\n"
+ msgstr ""
+
+ #: ../lib/ax25_gr.c:50
++#, c-format
+ msgid "Kernel AX.25 routing table\n"
+ msgstr ""
+
+ #. xxx
+ #: ../lib/ax25_gr.c:51 ../lib/rose_gr.c:55
++#, c-format
+ msgid "Destination Iface Use\n"
+ msgstr ""
+
+-#: ../lib/ddp_gr.c:21
+-msgid "Routing table for `ddp' not yet supported.\n"
+-msgstr ""
+-
+ #: ../lib/ether.c:74 ../lib/ether.c:91
+ #, c-format
+ msgid "in_ether(%s): invalid ether address!\n"
+@@ -1783,225 +2203,260 @@ msgstr ""
+ msgid "in_hippi(%s): trailing junk!\n"
+ msgstr ""
+
+-#: ../lib/hw.c:155
++#: ../lib/hw.c:160
+ msgid "Local Loopback"
+ msgstr ""
+
+-#: ../lib/hw.c:158
++#: ../lib/hw.c:163
+ msgid "Serial Line IP"
+ msgstr ""
+
+-#: ../lib/hw.c:159
++#: ../lib/hw.c:164
+ msgid "VJ Serial Line IP"
+ msgstr ""
+
+-#: ../lib/hw.c:160
++#: ../lib/hw.c:165
+ msgid "6-bit Serial Line IP"
+ msgstr ""
+
+-#: ../lib/hw.c:161
++#: ../lib/hw.c:166
+ msgid "VJ 6-bit Serial Line IP"
+ msgstr ""
+
+-#: ../lib/hw.c:162
++#: ../lib/hw.c:167
+ msgid "Adaptive Serial Line IP"
+ msgstr ""
+
+-#: ../lib/hw.c:165
++#: ../lib/hw.c:170
+ msgid "Ethernet"
+ msgstr ""
+
+-#: ../lib/hw.c:171
++#: ../lib/hw.c:176
+ msgid "Fiber Distributed Data Interface"
+ msgstr ""
+
+-#: ../lib/hw.c:174
++#: ../lib/hw.c:179
+ msgid "HIPPI"
+ msgstr ""
+
+-#: ../lib/hw.c:186
++#: ../lib/hw.c:191
+ msgid "generic X.25"
+ msgstr ""
+
+-#: ../lib/hw.c:189
++#: ../lib/hw.c:194
+ msgid "IPIP Tunnel"
+ msgstr ""
+
+-#: ../lib/hw.c:192
++#: ../lib/hw.c:197
+ msgid "Point-to-Point Protocol"
+ msgstr ""
+
+-#: ../lib/hw.c:195
++#: ../lib/hw.c:200
+ msgid "(Cisco)-HDLC"
+ msgstr ""
+
+-#: ../lib/hw.c:196
++#: ../lib/hw.c:201
+ msgid "LAPB"
+ msgstr ""
+
+-#: ../lib/hw.c:199
++#: ../lib/hw.c:204
+ msgid "ARCnet"
+ msgstr ""
+
+-#: ../lib/hw.c:202
++#: ../lib/hw.c:207
+ msgid "Frame Relay DLCI"
+ msgstr ""
+
+-#: ../lib/hw.c:203
++#: ../lib/hw.c:208
+ msgid "Frame Relay Access Device"
+ msgstr ""
+
+-#: ../lib/hw.c:206
++#: ../lib/hw.c:211
+ msgid "IPv6-in-IPv4"
+ msgstr ""
+
+-#: ../lib/hw.c:209
++#: ../lib/hw.c:214
+ msgid "IrLAP"
+ msgstr ""
+
+-#: ../lib/hw.c:212
++#: ../lib/hw.c:217
+ msgid "16/4 Mbps Token Ring"
+ msgstr ""
+
+-#: ../lib/hw.c:214
++#: ../lib/hw.c:219
+ msgid "16/4 Mbps Token Ring (New)"
+ msgstr ""
+
+-#: ../lib/inet.c:153 ../lib/inet6.c:79
++#: ../lib/hw.c:226
++msgid "Generic EUI-64"
++msgstr ""
++
++#: ../lib/inet.c:153 ../lib/inet6.c:94
+ #, c-format
+ msgid "rresolve: unsupport address family %d !\n"
+ msgstr ""
+
+-#: ../lib/inet6.c:131
++#: ../lib/inet6.c:147
+ msgid "[UNKNOWN]"
+ msgstr ""
+
+ #: ../lib/inet6_gr.c:71
++#, c-format
+ msgid "INET6 (IPv6) not configured in this system.\n"
+ msgstr ""
+
+-#: ../lib/inet6_gr.c:74
++#: ../lib/inet6_gr.c:76
++#, c-format
++msgid "Kernel IPv6 routing cache\n"
++msgstr ""
++
++#: ../lib/inet6_gr.c:78
++#, c-format
+ msgid "Kernel IPv6 routing table\n"
+ msgstr ""
+
+-#: ../lib/inet6_gr.c:76
++#: ../lib/inet6_gr.c:80
++#, c-format
+ msgid ""
+-"Destination Next Hop "
+-" Flags Metric Ref Use Iface\n"
++"Destination Next Hop Flag Met Ref Use "
++"If\n"
+ msgstr ""
+
+-#: ../lib/inet6_gr.c:150
++#: ../lib/inet6_gr.c:174
++#, c-format
+ msgid "Kernel IPv6 Neighbour Cache\n"
+ msgstr ""
+
+-#: ../lib/inet6_gr.c:153
++#: ../lib/inet6_gr.c:177
++#, c-format
+ msgid ""
+ "Neighbour HW Address Iface Flags "
+ "Ref State\n"
+ msgstr ""
+
+-#: ../lib/inet6_gr.c:157
++#: ../lib/inet6_gr.c:181
++#, c-format
+ msgid ""
+ "Neighbour HW Address Iface Flags "
+ "Ref State Stale(sec) Delete(sec)\n"
+ msgstr ""
+
+ #: ../lib/inet6_sr.c:46
++#, c-format
+ msgid "Usage: inet6_route [-vF] del Target\n"
+ msgstr ""
+
+ #: ../lib/inet6_sr.c:47
++#, c-format
+ msgid " inet6_route [-vF] add Target [gw Gw] [metric M] [[dev] If]\n"
+ msgstr ""
+
+ #: ../lib/inet6_sr.c:48
++#, c-format
+ msgid " inet6_route [-FC] flush NOT supported\n"
+ msgstr ""
+
+ #: ../lib/inet6_sr.c:188
++#, c-format
+ msgid "Flushing `inet6' routing table not supported\n"
+ msgstr ""
+
+ #: ../lib/inet_gr.c:50 ../lib/inet_gr.c:220
++#, c-format
+ msgid "INET (IPv4) not configured in this system.\n"
+ msgstr ""
+
+ #: ../lib/inet_gr.c:53
++#, c-format
+ msgid "Kernel IP routing table\n"
+ msgstr ""
+
+ #: ../lib/inet_gr.c:56
++#, c-format
+ msgid ""
+ "Destination Gateway Genmask Flags Metric Ref Use "
+ "Iface\n"
+ msgstr ""
+
+ #: ../lib/inet_gr.c:59
++#, c-format
+ msgid ""
+ "Destination Gateway Genmask Flags MSS Window irtt "
+ "Iface\n"
+ msgstr ""
+
+ #: ../lib/inet_gr.c:62
++#, c-format
+ msgid ""
+ "Destination Gateway Genmask Flags Metric Ref Use "
+ "Iface MSS Window irtt\n"
+ msgstr ""
+
+ #: ../lib/inet_gr.c:237
++#, c-format
+ msgid "Kernel IP routing cache\n"
+ msgstr ""
+
+ #: ../lib/inet_gr.c:258
++#, c-format
+ msgid ""
+ "Source Destination Gateway Flags Metric Ref Use "
+ "Iface\n"
+ msgstr ""
+
+ #: ../lib/inet_gr.c:261
++#, c-format
+ msgid ""
+ "Source Destination Gateway Flags MSS Window irtt "
+ "Iface\n"
+ msgstr ""
+
+ #: ../lib/inet_gr.c:266
++#, c-format
+ msgid ""
+ "Source Destination Gateway Flags Metric Ref Use "
+ "Iface MSS Window irtt HH Arp\n"
+ msgstr ""
+
+ #: ../lib/inet_gr.c:290
++#, c-format
+ msgid ""
+ "Source Destination Gateway Flags Metric Ref Use "
+ "Iface MSS Window irtt TOS HHRef HHUptod SpecDst\n"
+ msgstr ""
+
+-#: ../lib/inet_sr.c:50
++#: ../lib/inet_sr.c:51
++#, c-format
+ msgid ""
+ "Usage: inet_route [-vF] del {-host|-net} Target[/prefix] [gw Gw] [metric M] "
+ "[[dev] If]\n"
+ msgstr ""
+
+-#: ../lib/inet_sr.c:51
++#: ../lib/inet_sr.c:52
++#, c-format
+ msgid ""
+ " inet_route [-vF] add {-host|-net} Target[/prefix] [gw Gw] [metric M]\n"
+ msgstr ""
+
+-#: ../lib/inet_sr.c:52
++#: ../lib/inet_sr.c:53
++#, c-format
+ msgid ""
+ " [netmask N] [mss Mss] [window W] [irtt I]\n"
+ msgstr ""
+
+-#: ../lib/inet_sr.c:53
++#: ../lib/inet_sr.c:54
++#, c-format
+ msgid " [mod] [dyn] [reinstate] [[dev] If]\n"
+ msgstr ""
+
+-#: ../lib/inet_sr.c:54
++#: ../lib/inet_sr.c:55
++#, c-format
+ msgid ""
+ " inet_route [-vF] add {-host|-net} Target[/prefix] [metric M] reject\n"
+ msgstr ""
+
+-#: ../lib/inet_sr.c:55
++#: ../lib/inet_sr.c:56
++#, c-format
+ msgid " inet_route [-FC] flush NOT supported\n"
+ msgstr ""
+
+@@ -2011,14 +2466,17 @@ msgid "route: %s: cannot use a NETWORK as gateway!\n"
+ msgstr ""
+
+ #: ../lib/inet_sr.c:174
++#, c-format
+ msgid "route: Invalid MSS/MTU.\n"
+ msgstr ""
+
+ #: ../lib/inet_sr.c:187
++#, c-format
+ msgid "route: Invalid window.\n"
+ msgstr ""
+
+ #: ../lib/inet_sr.c:203
++#, c-format
+ msgid "route: Invalid initial rtt.\n"
+ msgstr ""
+
+@@ -2033,73 +2491,90 @@ msgid "route: bogus netmask %s\n"
+ msgstr ""
+
+ #: ../lib/inet_sr.c:270
++#, c-format
+ msgid "route: netmask doesn't match route address\n"
+ msgstr ""
+
+ #: ../lib/inet_sr.c:306
++#, c-format
+ msgid "Flushing `inet' routing table not supported\n"
+ msgstr ""
+
+ #: ../lib/inet_sr.c:310
++#, c-format
+ msgid "Modifying `inet' routing cache not supported\n"
+ msgstr ""
+
+ #: ../lib/ipx_gr.c:52
++#, c-format
+ msgid "IPX not configured in this system.\n"
+ msgstr ""
+
+ #: ../lib/ipx_gr.c:56
++#, c-format
+ msgid "Kernel IPX routing table\n"
+ msgstr ""
+
+ #. xxx
+ #: ../lib/ipx_gr.c:57
++#, c-format
+ msgid "Destination Router Net Router Node\n"
+ msgstr ""
+
+ #: ../lib/ipx_sr.c:33
++#, c-format
+ msgid "IPX: this needs to be written\n"
+ msgstr ""
+
+ #: ../lib/masq_info.c:198
++#, c-format
+ msgid "IP masquerading entries\n"
+ msgstr ""
+
+ #: ../lib/masq_info.c:201
++#, c-format
+ msgid "prot expire source destination ports\n"
+ msgstr ""
+
+ #: ../lib/masq_info.c:204
++#, c-format
+ msgid ""
+-"prot expire initseq delta prevd source destination "
+-" ports\n"
++"prot expire initseq delta prevd source "
++"destination ports\n"
+ msgstr ""
+
+ #: ../lib/netrom_gr.c:48
++#, c-format
+ msgid "NET/ROM not configured in this system.\n"
+ msgstr ""
+
+ #: ../lib/netrom_gr.c:51
++#, c-format
+ msgid "Kernel NET/ROM routing table\n"
+ msgstr ""
+
+ #: ../lib/netrom_gr.c:52
++#, c-format
+ msgid "Destination Mnemonic Quality Neighbour Iface\n"
+ msgstr ""
+
+ #: ../lib/netrom_sr.c:34
++#, c-format
+ msgid "netrom usage\n"
+ msgstr ""
+
+ #: ../lib/netrom_sr.c:44
++#, c-format
+ msgid "NET/ROM: this needs to be written\n"
+ msgstr ""
+
+ #: ../lib/ppp.c:44
++#, c-format
+ msgid "You cannot start PPP with this program.\n"
+ msgstr ""
+
+ #: ../lib/ppp_ac.c:38
++#, c-format
+ msgid "Sorry, use pppd!\n"
+ msgstr ""
+
+@@ -2108,287 +2583,314 @@ msgid "Node address must be ten digits"
+ msgstr ""
+
+ #: ../lib/rose_gr.c:51
++#, c-format
+ msgid "ROSE not configured in this system.\n"
+ msgstr ""
+
+ #: ../lib/rose_gr.c:54
++#, c-format
+ msgid "Kernel ROSE routing table\n"
+ msgstr ""
+
+-#: ../lib/tr.c:70 ../lib/tr.c:85
++#: ../lib/tr.c:86 ../lib/tr.c:101
+ #, c-format
+ msgid "in_tr(%s): invalid token ring address!\n"
+ msgstr ""
+
+-#: ../lib/tr.c:97
++#: ../lib/tr.c:113
+ #, c-format
+ msgid "in_tr(%s): trailing : ignored!\n"
+ msgstr ""
+
+-#: ../lib/tr.c:109
++#: ../lib/tr.c:125
+ #, c-format
+ msgid "in_tr(%s): trailing junk!\n"
+ msgstr ""
+
+-#: ../lib/interface.c:164
++#: ../lib/interface.c:174
+ #, c-format
+ msgid "warning: no inet socket available: %s\n"
+ msgstr ""
+
+-#: ../lib/interface.c:316
++#: ../lib/interface.c:323
+ #, c-format
+ msgid "Warning: cannot open %s (%s). Limited output.\n"
+ msgstr ""
+
+ #. Give better error message for this case.
+-#: ../lib/interface.c:556
++#: ../lib/interface.c:570
+ msgid "Device not found"
+ msgstr ""
+
+-#: ../lib/interface.c:560
++#: ../lib/interface.c:574
+ #, c-format
+ msgid "%s: error fetching interface information: %s\n"
+ msgstr ""
+
+-#: ../lib/interface.c:593
++#: ../lib/interface.c:607
+ msgid " - no statistics available -"
+ msgstr ""
+
+-#: ../lib/interface.c:597
++#: ../lib/interface.c:611
++#, c-format
+ msgid "[NO FLAGS]"
+ msgstr ""
+
+-#: ../lib/interface.c:673
++#: ../lib/interface.c:687
+ #, c-format
+ msgid "%-9.9s Link encap:%s "
+ msgstr ""
+
+-#: ../lib/interface.c:678
++#: ../lib/interface.c:692
+ #, c-format
+ msgid "HWaddr %s "
+ msgstr ""
+
+-#: ../lib/interface.c:681
++#: ../lib/interface.c:695
+ #, c-format
+ msgid "Media:%s"
+ msgstr ""
+
+-#: ../lib/interface.c:683
++#: ../lib/interface.c:697
++#, c-format
+ msgid "(auto)"
+ msgstr ""
+
+-#: ../lib/interface.c:690
++#: ../lib/interface.c:704
+ #, c-format
+ msgid " %s addr:%s "
+ msgstr ""
+
+-#: ../lib/interface.c:693
++#: ../lib/interface.c:707
+ #, c-format
+ msgid " P-t-P:%s "
+ msgstr ""
+
+-#: ../lib/interface.c:696
++#: ../lib/interface.c:710
+ #, c-format
+ msgid " Bcast:%s "
+ msgstr ""
+
+-#: ../lib/interface.c:698
++#: ../lib/interface.c:712
+ #, c-format
+ msgid " Mask:%s\n"
+ msgstr ""
+
+-#: ../lib/interface.c:715
++#: ../lib/interface.c:729
+ #, c-format
+ msgid " inet6 addr: %s/%d"
+ msgstr ""
+
+-#: ../lib/interface.c:717
++#: ../lib/interface.c:731
++#, c-format
+ msgid " Scope:"
+ msgstr ""
+
+-#: ../lib/interface.c:720
++#: ../lib/interface.c:734
++#, c-format
+ msgid "Global"
+ msgstr ""
+
+-#: ../lib/interface.c:723
++#: ../lib/interface.c:737
++#, c-format
+ msgid "Link"
+ msgstr ""
+
+-#: ../lib/interface.c:726
++#: ../lib/interface.c:740
++#, c-format
+ msgid "Site"
+ msgstr ""
+
+-#: ../lib/interface.c:729
++#: ../lib/interface.c:743
++#, c-format
+ msgid "Compat"
+ msgstr ""
+
+-#: ../lib/interface.c:732
++#: ../lib/interface.c:746
++#, c-format
+ msgid "Host"
+ msgstr ""
+
+-#: ../lib/interface.c:735
++#: ../lib/interface.c:749
++#, c-format
+ msgid "Unknown"
+ msgstr ""
+
+-#: ../lib/interface.c:750
++#: ../lib/interface.c:764
+ #, c-format
+ msgid " IPX/Ethernet II addr:%s\n"
+ msgstr ""
+
+-#: ../lib/interface.c:753
++#: ../lib/interface.c:767
+ #, c-format
+ msgid " IPX/Ethernet SNAP addr:%s\n"
+ msgstr ""
+
+-#: ../lib/interface.c:756
++#: ../lib/interface.c:770
+ #, c-format
+ msgid " IPX/Ethernet 802.2 addr:%s\n"
+ msgstr ""
+
+-#: ../lib/interface.c:759
++#: ../lib/interface.c:773
+ #, c-format
+ msgid " IPX/Ethernet 802.3 addr:%s\n"
+ msgstr ""
+
+-#: ../lib/interface.c:769
++#: ../lib/interface.c:783
+ #, c-format
+ msgid " EtherTalk Phase 2 addr:%s\n"
+ msgstr ""
+
+-#: ../lib/interface.c:778
++#: ../lib/interface.c:792
+ #, c-format
+ msgid " econet addr:%s\n"
+ msgstr ""
+
+-#: ../lib/interface.c:785
++#: ../lib/interface.c:799
++#, c-format
+ msgid "[NO FLAGS] "
+ msgstr ""
+
+-#: ../lib/interface.c:787
++#: ../lib/interface.c:801
++#, c-format
+ msgid "UP "
+ msgstr ""
+
+-#: ../lib/interface.c:789
++#: ../lib/interface.c:803
++#, c-format
+ msgid "BROADCAST "
+ msgstr ""
+
+-#: ../lib/interface.c:791
++#: ../lib/interface.c:805
++#, c-format
+ msgid "DEBUG "
+ msgstr ""
+
+-#: ../lib/interface.c:793
++#: ../lib/interface.c:807
++#, c-format
+ msgid "LOOPBACK "
+ msgstr ""
+
+-#: ../lib/interface.c:795
++#: ../lib/interface.c:809
++#, c-format
+ msgid "POINTOPOINT "
+ msgstr ""
+
+-#: ../lib/interface.c:797
++#: ../lib/interface.c:811
++#, c-format
+ msgid "NOTRAILERS "
+ msgstr ""
+
+-#: ../lib/interface.c:799
++#: ../lib/interface.c:813
++#, c-format
+ msgid "RUNNING "
+ msgstr ""
+
+-#: ../lib/interface.c:801
++#: ../lib/interface.c:815
++#, c-format
+ msgid "NOARP "
+ msgstr ""
+
+-#: ../lib/interface.c:803
++#: ../lib/interface.c:817
++#, c-format
+ msgid "PROMISC "
+ msgstr ""
+
+-#: ../lib/interface.c:805
++#: ../lib/interface.c:819
++#, c-format
+ msgid "ALLMULTI "
+ msgstr ""
+
+-#: ../lib/interface.c:807
++#: ../lib/interface.c:821
++#, c-format
+ msgid "SLAVE "
+ msgstr ""
+
+-#: ../lib/interface.c:809
++#: ../lib/interface.c:823
++#, c-format
+ msgid "MASTER "
+ msgstr ""
+
+-#: ../lib/interface.c:811
++#: ../lib/interface.c:825
++#, c-format
+ msgid "MULTICAST "
+ msgstr ""
+
+-#: ../lib/interface.c:814
++#: ../lib/interface.c:828
++#, c-format
+ msgid "DYNAMIC "
+ msgstr ""
+
+ #. DONT FORGET TO ADD THE FLAGS IN ife_print_short
+-#: ../lib/interface.c:817
++#: ../lib/interface.c:831
+ #, c-format
+ msgid " MTU:%d Metric:%d"
+ msgstr ""
+
+-#: ../lib/interface.c:821
++#: ../lib/interface.c:835
+ #, c-format
+ msgid " Outfill:%d Keepalive:%d"
+ msgstr ""
+
+-#: ../lib/interface.c:835
++#: ../lib/interface.c:849
+ #, c-format
+ msgid "RX packets:%llu errors:%lu dropped:%lu overruns:%lu frame:%lu\n"
+ msgstr ""
+
+-#: ../lib/interface.c:840
++#: ../lib/interface.c:854
+ #, c-format
+ msgid " compressed:%lu\n"
+ msgstr ""
+
+-#: ../lib/interface.c:852
++#: ../lib/interface.c:894
+ #, c-format
+ msgid "TX packets:%llu errors:%lu dropped:%lu overruns:%lu carrier:%lu\n"
+ msgstr ""
+
+-#: ../lib/interface.c:856
++#: ../lib/interface.c:898
+ #, c-format
+ msgid " collisions:%lu "
+ msgstr ""
+
+-#: ../lib/interface.c:858
++#: ../lib/interface.c:900
+ #, c-format
+ msgid "compressed:%lu "
+ msgstr ""
+
+-#: ../lib/interface.c:860
++#: ../lib/interface.c:902
+ #, c-format
+ msgid "txqueuelen:%d "
+ msgstr ""
+
+-#: ../lib/interface.c:862
++#: ../lib/interface.c:904
+ #, c-format
+ msgid "RX bytes:%llu (%lu.%lu %s) TX bytes:%llu (%lu.%lu %s)\n"
+ msgstr ""
+
+-#: ../lib/interface.c:873
++#: ../lib/interface.c:915
+ #, c-format
+ msgid "Interrupt:%d "
+ msgstr ""
+
+ #. Only print devices using it for
+ #. I/O maps
+-#: ../lib/interface.c:876
++#: ../lib/interface.c:918
+ #, c-format
+ msgid "Base address:0x%x "
+ msgstr ""
+
+-#: ../lib/interface.c:878
++#: ../lib/interface.c:920
+ #, c-format
+ msgid "Memory:%lx-%lx "
+ msgstr ""
+
+-#: ../lib/interface.c:881
++#: ../lib/interface.c:923
+ #, c-format
+ msgid "DMA chan:%x "
+ msgstr ""
+
+ #: ../lib/sockets.c:63
++#, c-format
+ msgid "No usable address families found.\n"
+ msgstr ""
+
+@@ -2413,14 +2915,17 @@ msgid "ip: argument is wrong: %s\n"
+ msgstr ""
+
+ #: ../ipmaddr.c:61
++#, c-format
+ msgid "Usage: ipmaddr [ add | del ] MULTIADDR dev STRING\n"
+ msgstr ""
+
+ #: ../ipmaddr.c:62
++#, c-format
+ msgid " ipmaddr show [ dev STRING ] [ ipv4 | ipv6 | link | all ]\n"
+ msgstr ""
+
+ #: ../ipmaddr.c:63
++#, c-format
+ msgid " ipmaddr -V | -version\n"
+ msgstr ""
+
+@@ -2449,6 +2954,7 @@ msgid "slattach: tty_lock: (%s): %s\n"
+ msgstr ""
+
+ #: ../slattach.c:192
++#, c-format
+ msgid "slattach: cannot write PID file\n"
+ msgstr ""
+
+@@ -2468,18 +2974,22 @@ msgid "slattach: tty_hangup(RAISE): %s\n"
+ msgstr ""
+
+ #: ../slattach.c:468
++#, c-format
+ msgid "slattach: tty name too long\n"
+ msgstr ""
+
+ #: ../slattach.c:498
++#, c-format
+ msgid "slattach: tty_open: cannot get current state!\n"
+ msgstr ""
+
+ #: ../slattach.c:505
++#, c-format
+ msgid "slattach: tty_open: cannot get current line disc!\n"
+ msgstr ""
+
+ #: ../slattach.c:513
++#, c-format
+ msgid "slattach: tty_open: cannot set RAW mode!\n"
+ msgstr ""
+
+@@ -2489,6 +2999,7 @@ msgid "slattach: tty_open: cannot set %s bps!\n"
+ msgstr ""
+
+ #: ../slattach.c:530
++#, c-format
+ msgid "slattach: tty_open: cannot set 8N1 mode!\n"
+ msgstr ""
+
+diff --git a/po/pt_BR.po b/po/pt_BR.po
+index 7c5dd37..17f1e5a 100644
+--- a/po/pt_BR.po
++++ b/po/pt_BR.po
+@@ -2,7 +2,7 @@
+ # Copyright (C) 2000 Free Software Foundation, Inc.
+ # Arnaldo Carvalho de Melo <acme@conectiva.com.br>, 2000.
+ #
+-# $Id: pt_BR.po,v 1.7 2000/02/13 22:28:11 ralf Exp $
++# $Id: pt_BR.po,v 1.8 2006/12/14 23:36:24 ecki Exp $
+ # Brazilian portuguese translation for net-tools 1.54
+ # Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+ # Arnaldo Carvalho de Melo <acme@conectiva.com.br>, 1998-2000
+@@ -14,7 +14,7 @@ msgstr ""
+ "PO-Revision-Date: 1999-03-01 02:38+0100\n"
+ "Last-Translator: Arnaldo Carvalho de Melo <acme@conectiva.com.br>\n"
+ "MIME-Version: 1.0\n"
+-"Content-Type: text/plain; charset=ISO8859-9\n"
++"Content-Type: text/plain; charset=iso-8859-9\n"
+ "Content-Transfer-Encoding: 8bit\n"
+
+ #: ../arp.c:110 ../arp.c:269
+@@ -64,8 +64,12 @@ msgid "arp: cannot set entry on line %u of etherfile %s !\n"
+ msgstr "arp: no foi possvel configurar a linha %u do arquivo etherfile %s!\n"
+
+ #: ../arp.c:437
+-msgid "Address\t\t\tHWtype\tHWaddress\t Flags Mask\t\t Iface\n"
+-msgstr "Endereo\t\tTipoHW\tEndereoHW\t Flags Mascara\t\t Iface\n"
++msgid ""
++"Address HWtype HWaddress Flags Mask "
++"Iface\n"
++msgstr ""
++"Endereo TipoHW EndereoHW Flags Mascara "
++"Iface\n"
+
+ #: ../arp.c:467
+ msgid "(incomplete)"
+@@ -2361,17 +2365,15 @@ msgstr "aten
+ msgid "Warning: cannot open %s (%s). Limited output.\n"
+ msgstr "Ateno: no foi possvel abrir %s (%s). Sada limitada.\n"
+
+-#. Give better error message for this case.
++#. better translation?
+ #: ../lib/interface.c:504
+ msgid "Device not found"
+-msgstr "%s: dispositivo no encontrado"
++msgstr "dispositivo no encontrado"
+
+ #: ../lib/interface.c:508
+ #, c-format
+ msgid "%s: error fetching interface information: %s\n"
+-msgstr ""
+-"%s: erro obtendo informaes da interface: %s\n"
+-"\n"
++msgstr "%s: erro obtendo informaes da interface: %s\n"
+
+ #: ../lib/sockets.c:59
+ msgid "No usable address families found.\n"
+diff --git a/rarp.c b/rarp.c
+index aab05b3..ab8f710 100644
+--- a/rarp.c
++++ b/rarp.c
+@@ -3,7 +3,7 @@
+ * that maintains the kernel's RARP cache. It is derived
+ * from Fred N. van Kempen's arp command.
+ *
+- * Version: $Id: rarp.c,v 1.6 2001/04/08 17:05:05 pb Exp $
++ * Version: $Id: rarp.c,v 1.9 2007/12/02 02:19:52 ecki Exp $
+ *
+ * Usage: rarp -d hostname Delete entry
+ * rarp -s hostname ethernet_address Add entry
+@@ -40,10 +40,11 @@
+ #include "net-support.h"
+ #include "version.h"
+ #include "pathnames.h"
++#include "proc.h"
+
+ static char no_rarp_message[] = N_("This kernel does not support RARP.\n");
+
+-static char version_string[] = RELEASE "\nrarp 1.03 (2001-04-04)\n";
++static char *Release = RELEASE;
+
+ static struct hwtype *hardware = NULL;
+
+@@ -154,7 +155,7 @@ static int rarp_file(int fd, const char *name)
+
+ static int display_cache(void)
+ {
+- FILE *fd = fopen(_PATH_PROCNET_RARP, "r");
++ FILE *fd = proc_fopen(_PATH_PROCNET_RARP);
+ char buffer[256];
+ if (fd == NULL) {
+ if (errno == ENOENT)
+@@ -225,7 +226,7 @@ int main(int argc, char **argv)
+ case 'h':
+ usage();
+ case 'V':
+- fprintf(stderr, version_string);
++ fprintf(stderr, "%s\n", Release);
+ exit(E_VERSION);
+ break;
+ case 'v':
+diff --git a/route.c b/route.c
+index f8c2bc3..4eaed49 100644
+--- a/route.c
++++ b/route.c
+@@ -2,7 +2,7 @@
+ * route This file contains an implementation of the command
+ * that manages the IP routing table in the kernel.
+ *
+- * Version: $Id: route.c,v 1.9 2001/04/15 14:41:17 pb Exp $
++ * Version: $Id: route.c,v 1.10 2002/07/30 05:24:20 ecki Exp $
+ *
+ * Maintainer: Bernd 'eckes' Eckenfels, <net-tools@lina.inka.de>
+ *
+@@ -10,7 +10,7 @@
+ * (derived from FvK's 'route.c 1.70 01/04/94')
+ *
+ * Modifications:
+- * Johannes Stille: for Net-2Debugged by
++ * Johannes Stille: for Net-2Debugged by
+ * <johannes@titan.os.open.de>
+ * Linus Torvalds: Misc Changes
+ * Alan Cox: add the new mtu/window stuff
+@@ -19,7 +19,7 @@
+ * {1.80} Bernd Eckenfels: reject, metric, irtt, 1.2.x support.
+ * {1.81} Bernd Eckenfels: reject routes need a dummy device
+ *960127 {1.82} Bernd Eckenfels: 'mod' and 'dyn' 'reinstate' added
+- *960129 {1.83} Bernd Eckenfels: resolve and getsock now in lib/,
++ *960129 {1.83} Bernd Eckenfels: resolve and getsock now in lib/,
+ * REJECT displays '-' as gatway.
+ *960202 {1.84} Bernd Eckenfels: net-features support added
+ *960203 {1.85} Bernd Eckenfels: "#ifdef' in '#if' for net-features
+@@ -60,20 +60,21 @@
+ #include "intl.h"
+ #include "pathnames.h"
+ #include "version.h"
++#include "util.h"
+
+ #define DFLT_AF "inet"
+
+ #define FEATURE_ROUTE
+ #include "lib/net-features.h" /* needs some of the system includes above! */
+
+-char *Release = RELEASE, *Version = "route 1.98 (2001-04-15)";
++static char *Release = RELEASE;
+
+-int opt_n = 0; /* numerical output flag */
+-int opt_v = 0; /* debugging output flag */
+-int opt_e = 1; /* 1,2,3=type of routetable */
+-int opt_fc = 0; /* routing cache/FIB */
+-int opt_h = 0; /* help selected */
+-struct aftype *ap; /* current address family */
++int opt_n = 0; // numerical output FLAG_NUM | FLAG_SYM
++int opt_v = 0; // debugging output flag
++int opt_e = 1; // 1,2,3=type of routetable
++int opt_fc = 0; // routing cache/FIB
++int opt_h = 0; // help selected
++struct aftype *ap; // selected address family
+
+ static void usage(void)
+ {
+@@ -89,7 +90,7 @@ static void usage(void)
+ fprintf(stderr, _(" -F, --fib display Forwarding Information Base (default)\n"));
+ fprintf(stderr, _(" -C, --cache display routing cache instead of FIB\n\n"));
+
+- fprintf(stderr, _(" <AF>=Use '-A <af>' or '--<af>'; default: %s\n"), DFLT_AF);
++ fprintf(stderr, _(" <AF>=Use -4, -6, '-A <af>' or '--<af>'; default: %s\n"), DFLT_AF);
+ fprintf(stderr, _(" List of possible address families (which support routing):\n"));
+ print_aflist(1); /* 1 = routeable */
+ exit(E_USAGE);
+@@ -98,7 +99,7 @@ static void usage(void)
+
+ static void version(void)
+ {
+- fprintf(stderr, "%s\n%s\n%s\n", Release, Version, Features);
++ fprintf(stderr, "%s\n%s\n", Release, Features);
+ exit(E_VERSION);
+ }
+
+@@ -135,14 +136,12 @@ int main(int argc, char **argv)
+
+ /* getopts and -net wont work :-/ */
+ for (tmp = argv; *tmp; tmp++) {
+- if (!strcmp(*tmp, "-net"))
+- strcpy(*tmp, "#net");
+- else if (!strcmp(*tmp, "-host"))
+- strcpy(*tmp, "#host");
++ if (!strcmp(*tmp, "-net") || !strcmp(*tmp, "-host"))
++ (*tmp)[0]='#';
+ }
+
+ /* Fetch the command-line arguments. */
+- while ((i = getopt_long(argc, argv, "A:eCFhnNVv?", longopts, &lop)) != EOF)
++ while ((i = getopt_long(argc, argv, "A:eCFhnN64Vv?", longopts, &lop)) != EOF)
+ switch (i) {
+ case -1:
+ break;
+@@ -176,6 +175,14 @@ int main(int argc, char **argv)
+ if ((i = aftrans_opt(optarg)))
+ exit(i);
+ break;
++ case '6':
++ if ((i = aftrans_opt("inet6")))
++ exit(i);
++ break;
++ case '4':
++ if ((i = aftrans_opt("inet")))
++ exit(i);
++ break;
+ case 'V':
+ version();
+ case 'h':
+diff --git a/slattach.c b/slattach.c
+index cedae1b..5c81584 100644
+--- a/slattach.c
++++ b/slattach.c
+@@ -40,7 +40,7 @@
+ #include <limits.h>
+ #include <pwd.h>
+ #include <signal.h>
+-#include <stdlib.h>
++#include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
+ #include <getopt.h>
+@@ -62,26 +62,27 @@
+ #include "util.h"
+
+ #ifndef _PATH_LOCKD
+-#define _PATH_LOCKD "/var/lock" /* lock files */
++#define _PATH_LOCKD "/var/lock" /* lock files */
+ #endif
+ #ifndef _UID_UUCP
+-#define _UID_UUCP "uucp" /* owns locks */
++#define _UID_UUCP "uucp" /* owns locks */
++#endif
++#ifndef _PATH_DEVPTMX
++#define _PATH_DEVPTMX "/dev/ptmx" /* pseudo-terminal master */
+ #endif
+
+
+ #define DEF_PROTO "cslip"
+
+
+-const char *Release = RELEASE,
+- *Version = "@(#) slattach 1.21 (1999-11-21)",
+- *Signature = "net-tools, Fred N. van Kempen et al.";
++static char *Release = RELEASE, *Signature = "Fred N. van Kempen et al.";
+
+
+ struct {
+ const char *speed;
+ int code;
+ } tty_speeds[] = { /* table of usable baud rates */
+- { "50", B50 }, { "75", B75 },
++ { "50", B50 }, { "75", B75 },
+ { "110", B110 }, { "300", B300 },
+ { "600", B600 }, { "1200", B1200 },
+ { "2400", B2400 }, { "4800", B4800 },
+@@ -108,6 +109,7 @@ struct termios tty_saved, /* saved TTY device state */
+ int tty_sdisc, /* saved TTY line discipline */
+ tty_ldisc, /* current TTY line discipline */
+ tty_fd = -1; /* TTY file descriptor */
++char * path_pts = NULL; /* slave pseudo-terminal device */
+ int opt_c = 0; /* "command" to run at exit */
+ int opt_e = 0; /* "activate only" flag */
+ int opt_h = 0; /* "hangup" on carrier loss */
+@@ -115,7 +117,7 @@ int opt_h = 0; /* "hangup" on carrier loss */
+ int opt_k = 0; /* "keepalive" value */
+ #endif
+ int opt_l = 0; /* "lock it" flag */
+-int opt_L = 0; /* clocal flag */
++int opt_L = 0; /* 3-wire mode flag */
+ int opt_m = 0; /* "set RAW mode" flag */
+ int opt_n = 0; /* "set No Mesg" flag */
+ #ifdef SIOCSOUTFILL
+@@ -149,7 +151,7 @@ tty_already_locked(char *nam)
+ /* that lock. */
+ i = fscanf(fd, "%d", &pid);
+ (void) fclose(fd);
+-
++
+ if (i != 1) /* Lock file format's wrong! Kill't */
+ return(0);
+
+@@ -195,15 +197,18 @@ tty_lock(char *path, int mode)
+ return(-1);
+ }
+
+- (void) close(fd);
+-
+ /* Make sure UUCP owns the lockfile. Required by some packages. */
+ if ((pw = getpwnam(_UID_UUCP)) == NULL) {
+ if (opt_q == 0) fprintf(stderr, _("slattach: tty_lock: UUCP user %s unknown!\n"),
+ _UID_UUCP);
++ (void) close(fd);
+ return(0); /* keep the lock anyway */
+ }
+- (void) chown(saved_path, pw->pw_uid, pw->pw_gid);
++ if (fchown(fd, pw->pw_uid, pw->pw_gid))
++ /* keep the lock anyway */;
++
++ (void) close(fd);
++
+ saved_lock = 1;
+ } else { /* unlock */
+ if (saved_lock != 1) return(0);
+@@ -294,7 +299,7 @@ tty_set_parity(struct termios *tty, char *parity)
+ switch(toupper(*parity)) {
+ case 'N':
+ tty->c_cflag &= ~(PARENB | PARODD);
+- break;
++ break;
+
+ case 'O':
+ tty->c_cflag &= ~(PARENB | PARODD);
+@@ -342,9 +347,11 @@ tty_set_raw(struct termios *tty)
+ tty->c_oflag = (0); /* output flags */
+ tty->c_lflag = (0); /* local flags */
+ speed = (tty->c_cflag & CBAUD); /* save current speed */
+- tty->c_cflag = (CRTSCTS | HUPCL | CREAD); /* UART flags */
+- if (opt_L)
++ tty->c_cflag = (HUPCL | CREAD); /* UART flags */
++ if (opt_L)
+ tty->c_cflag |= CLOCAL;
++ else
++ tty->c_cflag |= CRTSCTS;
+ tty->c_cflag |= speed; /* restore speed */
+ return(0);
+ }
+@@ -410,7 +417,7 @@ static int
+ tty_get_name(char *name)
+ {
+ if (ioctl(tty_fd, SIOCGIFNAME, name) < 0) {
+- if (opt_q == 0)
++ if (opt_q == 0)
+ perror("tty_get_name");
+ return(-errno);
+ }
+@@ -464,7 +471,7 @@ tty_open(char *name, const char *speed)
+ if (name != NULL) {
+ if (name[0] != '/') {
+ if (strlen(name + 6) > sizeof(pathbuf)) {
+- if (opt_q == 0) fprintf(stderr,
++ if (opt_q == 0) fprintf(stderr,
+ _("slattach: tty name too long\n"));
+ return (-1);
+ }
+@@ -488,7 +495,28 @@ tty_open(char *name, const char *speed)
+ return(-errno);
+ }
+ tty_fd = fd;
+- if (opt_d) printf("slattach: tty_open: %s (fd=%d) ", path_open, fd);
++ if (opt_d) printf("slattach: tty_open: %s (fd=%d)\n", path_open, fd);
++ if (!strcmp(path_open, _PATH_DEVPTMX)) {
++ if (opt_d) printf("slattach: tty_open: trying to grantpt and unlockpt\n");
++ if (grantpt(fd) < 0) {
++ if (opt_q == 0) fprintf(stderr,
++ "slattach: tty_open: grantpt: %s\n", strerror(errno));
++ return(-errno);
++ }
++ if (unlockpt(fd) < 0) {
++ if (opt_q == 0) fprintf(stderr,
++ "slattach: tty_open: unlockpt: %s\n", strerror(errno));
++ return(-errno);
++ }
++ path_pts = ptsname(fd);
++ if (path_pts == NULL) {
++ if (opt_q == 0) fprintf(stderr,
++ "slattach: tty_open: ptsname: %s\n", strerror(errno));
++ return(-errno);
++ }
++ if (opt_d) printf("slattach: tty_open: %s: slave pseudo-terminal is %s\n",
++ path_open, path_pts);
++ }
+ } else {
+ tty_fd = 0;
+ }
+@@ -504,7 +532,7 @@ tty_open(char *name, const char *speed)
+ if (tty_get_disc(&tty_sdisc) < 0) {
+ if (opt_q == 0) fprintf(stderr, _("slattach: tty_open: cannot get current line disc!\n"));
+ return(-errno);
+- }
++ }
+ tty_ldisc = tty_sdisc;
+
+ /* Put this terminal line in a 8-bit transparent mode. */
+@@ -565,15 +593,15 @@ usage(void)
+ "[-c cmd] [-s speed] [-p protocol] tty | -\n"
+ " slattach -V | --version\n";
+
+- fprintf(stderr, usage_msg);
+- exit(1);
++ fputs(usage_msg, stderr);
++ exit(E_USAGE);
+ }
+
+
+-static void
++static void
+ version(void)
+ {
+- printf("%s\n%s\n%s\n", Release, Version, Signature);
++ printf("%s\n%s\n", Release, Signature);
+ exit(E_VERSION);
+ }
+
+@@ -581,7 +609,7 @@ version(void)
+ int
+ main(int argc, char *argv[])
+ {
+- char path_buf[128];
++ char path_buf[128] = "";
+ char *path_dev;
+ char buff[128];
+ const char *speed = NULL;
+@@ -593,7 +621,6 @@ main(int argc, char *argv[])
+ { NULL, 0, NULL, 0 }
+ };
+
+- strcpy(path_buf, "");
+ path_dev = path_buf;
+
+ /* Scan command line for any arguments. */
+@@ -667,7 +694,7 @@ main(int argc, char *argv[])
+ usage();
+ /*NOTREACHED*/
+ }
+-
++
+ if (setvbuf(stdout,0,_IOLBF,0)) {
+ if (opt_q == 0) fprintf(stderr, _("slattach: setvbuf(stdout,0,_IOLBF,0) : %s\n"),
+ strerror(errno));
+@@ -703,6 +730,7 @@ main(int argc, char *argv[])
+ if (tty_get_name(buff)) { return(3); }
+ printf(_("%s started"), proto);
+ if (path_dev != NULL) printf(_(" on %s"), path_dev);
++ if (path_pts != NULL) printf(_(" ptsname %s"), path_pts);
+ printf(_(" interface %s\n"), buff);
+ }
+
+@@ -738,7 +766,7 @@ main(int argc, char *argv[])
+
+ tty_close();
+ if(extcmd) /* external command on exit */
+- system(extcmd);
++ exit(system(extcmd));
+ }
+ exit(0);
+ }
+diff --git a/statistics.c b/statistics.c
+index a878df8..fe8ee4e 100644
+--- a/statistics.c
++++ b/statistics.c
+@@ -1,9 +1,9 @@
+ /*
+- * Copyright 1997,1999,2000 Andi Kleen. Subject to the GPL.
+- * $Id: statistics.c,v 1.14 2001/02/02 18:01:23 pb Exp $
+- * 19980630 - i18n - Arnaldo Carvalho de Melo <acme@conectiva.com.br>
+- * 19981113 - i18n fixes - Arnaldo Carvalho de Melo <acme@conectiva.com.br>
+- * 19990101 - added net/netstat, -t, -u, -w supprt - Bernd Eckenfels
++ * Copyright 1997,1999,2000 Andi Kleen. Subject to the GPL.
++ * $Id: statistics.c,v 1.23 2010-10-29 19:24:36 ecki Exp $
++ * 19980630 - i18n - Arnaldo Carvalho de Melo <acme@conectiva.com.br>
++ * 19981113 - i18n fixes - Arnaldo Carvalho de Melo <acme@conectiva.com.br>
++ * 19990101 - added net/netstat, -t, -u, -w supprt - Bernd Eckenfels
+ */
+ #include <ctype.h>
+ #include <stdio.h>
+@@ -11,6 +11,7 @@
+ #include <string.h>
+ #include "config.h"
+ #include "intl.h"
++#include "proc.h"
+
+ /* #define WARN 1 */
+
+@@ -35,26 +36,26 @@ struct entry {
+ enum State type;
+ };
+
+-struct statedesc {
++struct statedesc {
+ int indent;
+- char *title;
+-};
++ char *title;
++};
+
+-struct statedesc states[] = {
++struct statedesc states[] = {
+ [number] = { 4, NULL },
+- [opt_number] = { 4, NULL },
++ [opt_number] = { 4, NULL },
+ [i_forward] = { 4, NULL },
+ [i_inp_icmp] = { 8, N_("ICMP input histogram:") },
+ [i_outp_icmp] = { 8, N_("ICMP output histogram:") },
+ [MaxState] = {0},
+-};
++};
+
+ static enum State state;
+
+ #define I_STATIC (1<<16) /* static configuration option. */
+ #define I_TITLE (1<<17)
+
+-/*
++/*
+ * XXX check against the snmp mib rfc.
+ *
+ * Don't mark the first field as translatable! It's a snmp MIB standard.
+@@ -63,54 +64,115 @@ static enum State state;
+ struct entry Iptab[] =
+ {
+ {"Forwarding", N_("Forwarding is %s"), i_forward | I_STATIC},
+- {"DefaultTTL", N_("Default TTL is %u"), number | I_STATIC},
+- {"InReceives", N_("%u total packets received"), number},
+- {"InHdrErrors", N_("%u with invalid headers"), opt_number},
+- {"InAddrErrors", N_("%u with invalid addresses"), opt_number},
+- {"ForwDatagrams", N_("%u forwarded"), number},
+- {"InUnknownProtos", N_("%u with unknown protocol"), opt_number},
+- {"InDiscards", N_("%u incoming packets discarded"), number},
+- {"InDelivers", N_("%u incoming packets delivered"), number},
+- {"OutRequests", N_("%u requests sent out"), number}, /*? */
+- {"OutDiscards", N_("%u outgoing packets dropped"), opt_number},
+- {"OutNoRoutes", N_("%u dropped because of missing route"), opt_number},
+- {"ReasmTimeout", N_("%u fragments dropped after timeout"), opt_number},
+- {"ReasmReqds", N_("%u reassemblies required"), opt_number}, /* ? */
+- {"ReasmOKs", N_("%u packets reassembled ok"), opt_number},
+- {"ReasmFails", N_("%u packet reassembles failed"), opt_number},
+- {"FragOKs", N_("%u fragments received ok"), opt_number},
+- {"FragFails", N_("%u fragments failed"), opt_number},
+- {"FragCreates", N_("%u fragments created"), opt_number}
++ {"DefaultTTL", N_("Default TTL is %llu"), number | I_STATIC},
++ {"InReceives", N_("%llu total packets received"), number},
++ {"InHdrErrors", N_("%llu with invalid headers"), opt_number},
++ {"InAddrErrors", N_("%llu with invalid addresses"), opt_number},
++ {"ForwDatagrams", N_("%llu forwarded"), number},
++ {"InUnknownProtos", N_("%llu with unknown protocol"), opt_number},
++ {"InDiscards", N_("%llu incoming packets discarded"), number},
++ {"InDelivers", N_("%llu incoming packets delivered"), number},
++ {"OutRequests", N_("%llu requests sent out"), number}, /*? */
++ {"OutDiscards", N_("%llu outgoing packets dropped"), opt_number},
++ {"OutNoRoutes", N_("%llu dropped because of missing route"), opt_number},
++ {"ReasmTimeout", N_("%llu fragments dropped after timeout"), opt_number},
++ {"ReasmReqds", N_("%llu reassemblies required"), opt_number}, /* ? */
++ {"ReasmOKs", N_("%llu packets reassembled ok"), opt_number},
++ {"ReasmFails", N_("%llu packet reassembles failed"), opt_number},
++ {"FragOKs", N_("%llu fragments received ok"), opt_number},
++ {"FragFails", N_("%llu fragments failed"), opt_number},
++ {"FragCreates", N_("%llu fragments created"), opt_number}
++};
++
++struct entry Ip6tab[] =
++{
++ {"Ip6InReceives", N_("%llu total packets received"), number},
++ {"Ip6InHdrErrors", N_("%llu with invalid headers"), opt_number},
++ {"Ip6InTooBigErrors", N_("%llu with packets too big"), opt_number},
++ {"Ip6InNoRoutes", N_("%llu incoming packets with no route"), opt_number},
++ {"Ip6InAddrErrors", N_("%llu with invalid addresses"), opt_number},
++ {"Ip6InUnknownProtos", N_("%llu with unknown protocol"), opt_number},
++ {"Ip6InTruncatedPkts", N_("%llu with truncated packets"), opt_number},
++ {"Ip6InDiscards", N_("%llu incoming packets discarded"), number},
++ {"Ip6InDelivers", N_("%llu incoming packets delivered"), number},
++ {"Ip6OutForwDatagrams", N_("%llu forwarded"), number},
++ {"Ip6OutRequests", N_("%llu requests sent out"), number}, /*? */
++ {"Ip6OutDiscards", N_("%llu outgoing packets dropped"), opt_number},
++ {"Ip6OutNoRoutes", N_("%llu dropped because of missing route"), opt_number},
++ {"Ip6ReasmTimeout", N_("%llu fragments dropped after timeout"), opt_number},
++ {"Ip6ReasmReqds", N_("%llu reassemblies required"), opt_number}, /* ? */
++ {"Ip6ReasmOKs", N_("%llu packets reassembled ok"), opt_number},
++ {"Ip6ReasmFails", N_("%llu packet reassembles failed"), opt_number},
++ {"Ip6FragOKs", N_("%llu fragments received ok"), opt_number},
++ {"Ip6FragFails", N_("%llu fragments failed"), opt_number},
++ {"Ip6FragCreates", N_("%llu fragments created"), opt_number},
++ {"Ip6InMcastPkts", N_("%llu incoming multicast packets"), opt_number},
++ {"Ip6OutMcastPkts", N_("%llu outgoing multicast packets"), opt_number}
+ };
+
+ struct entry Icmptab[] =
+ {
+- {"InMsgs", N_("%u ICMP messages received"), number},
+- {"InErrors", N_("%u input ICMP message failed."), number},
+- {"InDestUnreachs", N_("destination unreachable: %u"), i_inp_icmp | I_TITLE},
+- {"InTimeExcds", N_("timeout in transit: %u"), i_inp_icmp | I_TITLE},
+- {"InParmProbs", N_("wrong parameters: %u"), i_inp_icmp | I_TITLE}, /*? */
+- {"InSrcQuenchs", N_("source quenches: %u"), i_inp_icmp | I_TITLE},
+- {"InRedirects", N_("redirects: %u"), i_inp_icmp | I_TITLE},
+- {"InEchos", N_("echo requests: %u"), i_inp_icmp | I_TITLE},
+- {"InEchoReps", N_("echo replies: %u"), i_inp_icmp | I_TITLE},
+- {"InTimestamps", N_("timestamp request: %u"), i_inp_icmp | I_TITLE},
+- {"InTimestampReps", N_("timestamp reply: %u"), i_inp_icmp | I_TITLE},
+- {"InAddrMasks", N_("address mask request: %u"), i_inp_icmp | I_TITLE}, /*? */
+- {"InAddrMaskReps", N_("address mask replies: %u"), i_inp_icmp | I_TITLE}, /*? */
+- {"OutMsgs", N_("%u ICMP messages sent"), number},
+- {"OutErrors", N_("%u ICMP messages failed"), number},
+- {"OutDestUnreachs", N_("destination unreachable: %u"), i_outp_icmp | I_TITLE},
+- {"OutTimeExcds", N_("time exceeded: %u"), i_outp_icmp | I_TITLE},
+- {"OutParmProbs", N_("wrong parameters: %u"), i_outp_icmp | I_TITLE}, /*? */
+- {"OutSrcQuenchs", N_("source quench: %u"), i_outp_icmp | I_TITLE},
+- {"OutRedirects", N_("redirect: %u"), i_outp_icmp | I_TITLE},
+- {"OutEchos", N_("echo request: %u"), i_outp_icmp | I_TITLE},
+- {"OutEchoReps", N_("echo replies: %u"), i_outp_icmp | I_TITLE},
+- {"OutTimestamps", N_("timestamp requests: %u"), i_outp_icmp | I_TITLE},
+- {"OutTimestampReps", N_("timestamp replies: %u"), i_outp_icmp | I_TITLE},
+- {"OutAddrMasks", N_("address mask requests: %u"), i_outp_icmp | I_TITLE},
+- {"OutAddrMaskReps", N_("address mask replies: %u"), i_outp_icmp | I_TITLE},
++ {"InMsgs", N_("%llu ICMP messages received"), number},
++ {"InErrors", N_("%llu input ICMP message failed."), number},
++ {"InDestUnreachs", N_("destination unreachable: %llu"), i_inp_icmp | I_TITLE},
++ {"InTimeExcds", N_("timeout in transit: %llu"), i_inp_icmp | I_TITLE},
++ {"InParmProbs", N_("wrong parameters: %llu"), i_inp_icmp | I_TITLE}, /*? */
++ {"InSrcQuenchs", N_("source quenches: %llu"), i_inp_icmp | I_TITLE},
++ {"InRedirects", N_("redirects: %llu"), i_inp_icmp | I_TITLE},
++ {"InEchos", N_("echo requests: %llu"), i_inp_icmp | I_TITLE},
++ {"InEchoReps", N_("echo replies: %llu"), i_inp_icmp | I_TITLE},
++ {"InTimestamps", N_("timestamp request: %llu"), i_inp_icmp | I_TITLE},
++ {"InTimestampReps", N_("timestamp reply: %llu"), i_inp_icmp | I_TITLE},
++ {"InAddrMasks", N_("address mask request: %llu"), i_inp_icmp | I_TITLE}, /*? */
++ {"InAddrMaskReps", N_("address mask replies: %llu"), i_inp_icmp | I_TITLE}, /*? */
++ {"OutMsgs", N_("%llu ICMP messages sent"), number},
++ {"OutErrors", N_("%llu ICMP messages failed"), number},
++ {"OutDestUnreachs", N_("destination unreachable: %llu"), i_outp_icmp | I_TITLE},
++ {"OutTimeExcds", N_("time exceeded: %llu"), i_outp_icmp | I_TITLE},
++ {"OutParmProbs", N_("wrong parameters: %llu"), i_outp_icmp | I_TITLE}, /*? */
++ {"OutSrcQuenchs", N_("source quench: %llu"), i_outp_icmp | I_TITLE},
++ {"OutRedirects", N_("redirect: %llu"), i_outp_icmp | I_TITLE},
++ {"OutEchos", N_("echo request: %llu"), i_outp_icmp | I_TITLE},
++ {"OutEchoReps", N_("echo replies: %llu"), i_outp_icmp | I_TITLE},
++ {"OutTimestamps", N_("timestamp requests: %llu"), i_outp_icmp | I_TITLE},
++ {"OutTimestampReps", N_("timestamp replies: %llu"), i_outp_icmp | I_TITLE},
++ {"OutAddrMasks", N_("address mask requests: %llu"), i_outp_icmp | I_TITLE},
++ {"OutAddrMaskReps", N_("address mask replies: %llu"), i_outp_icmp | I_TITLE},
++};
++
++struct entry Icmp6tab[] =
++{
++ {"Icmp6InMsgs", N_("%llu ICMP messages received"), number},
++ {"Icmp6InErrors", N_("%llu input ICMP message failed."), number},
++ {"Icmp6InDestUnreachs", N_("destination unreachable: %llu"), i_inp_icmp | I_TITLE},
++ {"Icmp6InPktTooBigs", N_("packets too big: %llu"), i_inp_icmp | I_TITLE},
++ {"Icmp6InTimeExcds", N_("received ICMPv6 time exceeded: %llu"), i_inp_icmp | I_TITLE},
++ {"Icmp6InParmProblems", N_("parameter problem: %llu"), i_inp_icmp | I_TITLE},
++ {"Icmp6InEchos", N_("echo requests: %llu"), i_inp_icmp | I_TITLE},
++ {"Icmp6InEchoReplies", N_("echo replies: %llu"), i_inp_icmp | I_TITLE},
++ {"Icmp6InGroupMembQueries", N_("group member queries: %llu"), i_inp_icmp | I_TITLE},
++ {"Icmp6InGroupMembResponses", N_("group member responses: %llu"), i_inp_icmp | I_TITLE},
++ {"Icmp6InGroupMembReductions", N_("group member reductions: %llu"), i_inp_icmp | I_TITLE},
++ {"Icmp6InRouterSolicits", N_("router solicits: %llu"), i_inp_icmp | I_TITLE},
++ {"Icmp6InRouterAdvertisements", N_("router advertisement: %llu"), i_inp_icmp | I_TITLE},
++ {"Icmp6InNeighborSolicits", N_("neighbour solicits: %llu"), i_inp_icmp | I_TITLE},
++ {"Icmp6InNeighborAdvertisements", N_("neighbour advertisement: %llu"), i_inp_icmp | I_TITLE},
++ {"Icmp6InRedirects", N_("redirects: %llu"), i_inp_icmp | I_TITLE},
++ {"Icmp6OutMsgs", N_("%llu ICMP messages sent"), number},
++ {"Icmp6OutDestUnreachs", N_("destination unreachable: %llu"), i_outp_icmp | I_TITLE},
++ {"Icmp6OutPktTooBigs", N_("packets too big: %llu"), i_outp_icmp | I_TITLE},
++ {"Icmp6OutTimeExcds", N_("sent ICMPv6 time exceeded: %llu"), i_outp_icmp | I_TITLE},
++ {"Icmp6OutParmProblems", N_("parameter problem: %llu"), i_outp_icmp | I_TITLE},
++ {"Icmp6OutEchos", N_("echo requests: %llu"), i_outp_icmp | I_TITLE},
++ {"Icmp6OutEchoReplies", N_("echo replies: %llu"), i_outp_icmp | I_TITLE},
++ {"Icmp6OutGroupMembQueries", N_("group member queries: %llu"), i_outp_icmp | I_TITLE},
++ {"Icmp6OutGroupMembResponses", N_("group member responses: %llu"), i_outp_icmp | I_TITLE},
++ {"Icmp6OutGroupMembReductions", N_("group member reductions: %llu"), i_outp_icmp | I_TITLE},
++ {"Icmp6OutRouterSolicits", N_("router solicits: %llu"), i_outp_icmp | I_TITLE},
++ {"Icmp6OutRouterAdvertisements ", N_("router advertisement: %llu"), i_outp_icmp | I_TITLE},
++ {"Icmp6OutNeighborSolicits", N_("neighbor solicits: %llu"), i_outp_icmp | I_TITLE},
++ {"Icmp6OutNeighborAdvertisements", N_("neighbor advertisements: %llu"), i_outp_icmp | I_TITLE},
++ {"Icmp6OutRedirects", N_("redirects: %llu"), i_outp_icmp | I_TITLE},
+ };
+
+ struct entry Tcptab[] =
+@@ -119,79 +181,129 @@ struct entry Tcptab[] =
+ {"RtoMin", "", number},
+ {"RtoMax", "", number},
+ {"MaxConn", "", number},
+- {"ActiveOpens", N_("%u active connections openings"), number},
+- {"PassiveOpens", N_("%u passive connection openings"), number},
+- {"AttemptFails", N_("%u failed connection attempts"), number},
+- {"EstabResets", N_("%u connection resets received"), number},
+- {"CurrEstab", N_("%u connections established"), number},
+- {"InSegs", N_("%u segments received"), number},
+- {"OutSegs", N_("%u segments send out"), number},
+- {"RetransSegs", N_("%u segments retransmited"), number},
+- {"InErrs", N_("%u bad segments received."), number},
+- {"OutRsts", N_("%u resets sent"), number},
++ {"ActiveOpens", N_("%llu active connections openings"), number},
++ {"PassiveOpens", N_("%llu passive connection openings"), number},
++ {"AttemptFails", N_("%llu failed connection attempts"), number},
++ {"EstabResets", N_("%llu connection resets received"), number},
++ {"CurrEstab", N_("%llu connections established"), number},
++ {"InSegs", N_("%llu segments received"), number},
++ {"OutSegs", N_("%llu segments send out"), number},
++ {"RetransSegs", N_("%llu segments retransmited"), number},
++ {"InErrs", N_("%llu bad segments received."), number},
++ {"OutRsts", N_("%llu resets sent"), number},
+ };
+
+ struct entry Udptab[] =
+ {
+- {"InDatagrams", N_("%u packets received"), number},
+- {"NoPorts", N_("%u packets to unknown port received."), number},
+- {"InErrors", N_("%u packet receive errors"), number},
+- {"OutDatagrams", N_("%u packets sent"), number},
++ {"InDatagrams", N_("%llu packets received"), number},
++ {"NoPorts", N_("%llu packets to unknown port received."), number},
++ {"InErrors", N_("%llu packet receive errors"), number},
++ {"OutDatagrams", N_("%llu packets sent"), number},
++ {"RcvbufErrors", N_("%llu receive buffer errors"), number},
++ {"SndbufErrors", N_("%llu send buffer errors"), number},
++ };
++
++struct entry Udp6tab[] =
++{
++ {"Udp6InDatagrams", N_("%llu packets received"), number},
++ {"Udp6NoPorts", N_("%llu packets to unknown port received."), number},
++ {"Udp6InErrors", N_("%llu packet receive errors"), number},
++ {"Udp6OutDatagrams", N_("%llu packets sent"), number},
+ };
+
+ struct entry Tcpexttab[] =
+ {
+- {"SyncookiesSent", N_("%u SYN cookies sent"), opt_number},
+- {"SyncookiesRecv", N_("%u SYN cookies received"), opt_number},
+- {"SyncookiesFailed", N_("%u invalid SYN cookies received"), opt_number},
+-
+- { "EmbryonicRsts", N_("%u resets received for embryonic SYN_RECV sockets"),
+- opt_number },
+- { "PruneCalled", N_("%u packets pruned from receive queue because of socket"
+- " buffer overrun"), opt_number },
++ {"SyncookiesSent", N_("%llu SYN cookies sent"), opt_number},
++ {"SyncookiesRecv", N_("%llu SYN cookies received"), opt_number},
++ {"SyncookiesFailed", N_("%llu invalid SYN cookies received"), opt_number},
++
++ { "EmbryonicRsts", N_("%llu resets received for embryonic SYN_RECV sockets"),
++ opt_number },
++ { "PruneCalled", N_("%llu packets pruned from receive queue because of socket"
++ " buffer overrun"), opt_number },
+ /* obsolete: 2.2.0 doesn't do that anymore */
+- { "RcvPruned", N_("%u packets pruned from receive queue"), opt_number },
+- { "OfoPruned", N_("%u packets dropped from out-of-order queue because of"
+- " socket buffer overrun"), opt_number },
+- { "OutOfWindowIcmps", N_("%u ICMP packets dropped because they were "
+- "out-of-window"), opt_number },
+- { "LockDroppedIcmps", N_("%u ICMP packets dropped because"
++ { "RcvPruned", N_("%llu packets pruned from receive queue"), opt_number },
++ { "OfoPruned", N_("%llu packets dropped from out-of-order queue because of"
++ " socket buffer overrun"), opt_number },
++ { "OutOfWindowIcmps", N_("%llu ICMP packets dropped because they were "
++ "out-of-window"), opt_number },
++ { "LockDroppedIcmps", N_("%llu ICMP packets dropped because"
+ " socket was locked"), opt_number },
+- { "TW", N_("%u TCP sockets finished time wait in fast timer"), opt_number },
+- { "TWRecycled", N_("%u time wait sockets recycled by time stamp"), opt_number },
+- { "TWKilled", N_("%u TCP sockets finished time wait in slow timer"), opt_number },
+- { "PAWSPassive", N_("%u passive connections rejected because of"
++ { "TW", N_("%llu TCP sockets finished time wait in fast timer"), opt_number },
++ { "TWRecycled", N_("%llu time wait sockets recycled by time stamp"), opt_number },
++ { "TWKilled", N_("%llu TCP sockets finished time wait in slow timer"), opt_number },
++ { "PAWSPassive", N_("%llu passive connections rejected because of"
+ " time stamp"), opt_number },
+- { "PAWSActive", N_("%u active connections rejected because of "
++ { "PAWSActive", N_("%llu active connections rejected because of "
+ "time stamp"), opt_number },
+- { "PAWSEstab", N_("%u packets rejects in established connections because of"
++ { "PAWSEstab", N_("%llu packets rejects in established connections because of"
+ " timestamp"), opt_number },
+- { "DelayedACKs", N_("%u delayed acks sent"), opt_number },
+- { "DelayedACKLocked", N_("%u delayed acks further delayed because of"
++ { "DelayedACKs", N_("%llu delayed acks sent"), opt_number },
++ { "DelayedACKLocked", N_("%llu delayed acks further delayed because of"
+ " locked socket"), opt_number },
+- { "DelayedACKLost", N_("Quick ack mode was activated %u times"), opt_number },
+- { "ListenOverflows", N_("%u times the listen queue of a socket overflowed"),
++ { "DelayedACKLost", N_("Quick ack mode was activated %llu times"), opt_number },
++ { "ListenOverflows", N_("%llu times the listen queue of a socket overflowed"),
+ opt_number },
+- { "ListenDrops", N_("%u SYNs to LISTEN sockets ignored"), opt_number },
+- { "TCPPrequeued", N_("%u packets directly queued to recvmsg prequeue."),
++ { "ListenDrops", N_("%llu SYNs to LISTEN sockets dropped"), opt_number },
++ { "TCPPrequeued", N_("%llu packets directly queued to recvmsg prequeue."),
+ opt_number },
+- { "TCPDirectCopyFromBacklog", N_("%u packets directly received"
+- " from backlog"), opt_number },
+- { "TCPDirectCopyFromPrequeue", N_("%u packets directly received"
+- " from prequeue"), opt_number },
+- { "TCPPrequeueDropped", N_("%u packets dropped from prequeue"), opt_number },
+- { "TCPHPHits", N_("%u packets header predicted"), number },
+- { "TCPHPHitsToUser", N_("%u packets header predicted and "
++ { "TCPDirectCopyFromBacklog", N_("%llu bytes directly in process context from backlog"), opt_number },
++ { "TCPDirectCopyFromPrequeue", N_("%llu bytes directly received in process context from prequeue"),
++ opt_number },
++ { "TCPPrequeueDropped", N_("%llu packets dropped from prequeue"), opt_number },
++ { "TCPHPHits", N_("%llu packet headers predicted"), number },
++ { "TCPHPHitsToUser", N_("%llu packets header predicted and "
+ "directly queued to user"), opt_number },
+- { "SockMallocOOM", N_("Ran %u times out of system memory during "
+- "packet sending"), opt_number },
++ { "SockMallocOOM", N_("Ran %llu times out of system memory during "
++ "packet sending"), opt_number },
++ { "TCPPureAcks", N_("%llu acknowledgments not containing data payload received"), opt_number },
++ { "TCPHPAcks", N_("%llu predicted acknowledgments"), opt_number },
++ { "TCPRenoRecovery", N_("%llu times recovered from packet loss due to fast retransmit"), opt_number },
++ { "TCPSackRecovery", N_("%llu times recovered from packet loss by selective acknowledgements"), opt_number },
++ { "TCPSACKReneging", N_("%llu bad SACK blocks received"), opt_number },
++ { "TCPFACKReorder", N_("Detected reordering %llu times using FACK"), opt_number },
++ { "TCPSACKReorder", N_("Detected reordering %llu times using SACK"), opt_number },
++ { "TCPTSReorder", N_("Detected reordering %llu times using time stamp"), opt_number },
++ { "TCPRenoReorder", N_("Detected reordering %llu times using reno fast retransmit"), opt_number },
++ { "TCPFullUndo", N_("%llu congestion windows fully recovered without slow start"), opt_number },
++ { "TCPPartialUndo", N_("%llu congestion windows partially recovered using Hoe heuristic"), opt_number },
++ { "TCPDSackUndo", N_("%llu congestion window recovered without slow start using DSACK"), opt_number },
++ { "TCPLossUndo", N_("%llu congestion windows recovered without slow start after partial ack"), opt_number },
++ { "TCPLostRetransmits", N_("%llu retransmits lost"), opt_number },
++ { "TCPRenoFailures", N_("%llu timeouts after reno fast retransmit"), opt_number },
++ { "TCPSackFailures", N_("%llu timeouts after SACK recovery"), opt_number },
++ { "TCPLossFailures", N_("%llu timeouts in loss state"), opt_number },
++ { "TCPFastRetrans", N_("%llu fast retransmits"), opt_number },
++ { "TCPForwardRetrans", N_("%llu forward retransmits"), opt_number },
++ { "TCPSlowStartRetrans", N_("%llu retransmits in slow start"), opt_number },
++ { "TCPTimeouts", N_("%llu other TCP timeouts"), opt_number },
++ { "TCPRenoRecoveryFailed", N_("%llu reno fast retransmits failed"), opt_number },
++ { "TCPSackRecoveryFail", N_("%llu SACK retransmits failed"), opt_number },
++ { "TCPSchedulerFailed", N_("%llu times receiver scheduled too late for direct processing"), opt_number },
++ { "TCPRcvCollapsed", N_("%llu packets collapsed in receive queue due to low socket buffer"), opt_number },
++ { "TCPDSACKOldSent", N_("%llu DSACKs sent for old packets"), opt_number },
++ { "TCPDSACKOfoSent", N_("%llu DSACKs sent for out of order packets"), opt_number },
++ { "TCPDSACKRecv", N_("%llu DSACKs received"), opt_number },
++ { "TCPDSACKOfoRecv", N_("%llu DSACKs for out of order packets received"), opt_number },
++ { "TCPAbortOnSyn", N_("%llu connections reset due to unexpected SYN"), opt_number },
++ { "TCPAbortOnData", N_("%llu connections reset due to unexpected data"), opt_number },
++ { "TCPAbortOnClose", N_("%llu connections reset due to early user close"), opt_number },
++ { "TCPAbortOnMemory", N_("%llu connections aborted due to memory pressure"), opt_number },
++ { "TCPAbortOnTimeout", N_("%llu connections aborted due to timeout"), opt_number },
++ { "TCPAbortOnLinger", N_("%llu connections aborted after user close in linger timeout"), opt_number },
++ { "TCPAbortFailed", N_("%llu times unable to send RST due to no memory"), opt_number },
++ { "TCPMemoryPressures", N_("TCP ran low on memory %llu times"), opt_number },
++ { "TCPLoss", N_("%llu TCP data loss events"), opt_number },
++ { "TCPDSACKUndo", N_("%llu congestion windows recovered without slow start by DSACK"),
++ opt_number },
++ { "TCPRenoRecoveryFail", N_("%llu classic Reno fast retransmits failed"), opt_number },
+ };
+
+ struct tabtab {
+ char *title;
+ struct entry *tab;
+ size_t size;
+- int *flag;
++ int *flag;
+ };
+
+ struct tabtab snmptabs[] =
+@@ -204,6 +316,15 @@ struct tabtab snmptabs[] =
+ {NULL}
+ };
+
++struct tabtab snmp6tabs[] =
++{
++ {"Ip6", Ip6tab, sizeof(Ip6tab), &f_raw},
++ {"Icmp6", Icmp6tab, sizeof(Icmp6tab), &f_raw},
++ {"Udp6", Udp6tab, sizeof(Udp6tab), &f_udp},
++ {"Tcp6", Tcptab, sizeof(Tcptab), &f_tcp},
++ {NULL}
++};
++
+ /* XXX IGMP */
+
+ int cmpentries(const void *a, const void *b)
+@@ -211,18 +332,19 @@ int cmpentries(const void *a, const void *b)
+ return strcmp(((struct entry *) a)->title, ((struct entry *) b)->title);
+ }
+
+-void printval(struct tabtab *tab, char *title, int val)
++void printval(struct tabtab *tab, char *title, unsigned long long val)
+ {
+ struct entry *ent = NULL, key;
+ int type;
+ char buf[512];
+
+ key.title = title;
+- if (tab->tab)
++ if (tab->tab)
+ ent = bsearch(&key, tab->tab, tab->size / sizeof(struct entry),
+ sizeof(struct entry), cmpentries);
+ if (!ent) { /* try our best */
+- printf("%*s%s: %d\n", states[state].indent, "", title, val);
++ if (val)
++ printf("%*s%s: %llu\n", states[state].indent, "", title, val);
+ return;
+ }
+ type = ent->type;
+@@ -242,7 +364,7 @@ void printval(struct tabtab *tab, char *title, int val)
+ buf[0] = '\0';
+ switch (type) {
+ case opt_number:
+- if (val == 0)
++ if (val == 0)
+ break;
+ /*FALL THOUGH*/
+ case number:
+@@ -272,7 +394,7 @@ struct tabtab *newtable(struct tabtab *tabs, char *title)
+ {
+ struct tabtab *t;
+ static struct tabtab dummytab;
+-
++
+ for (t = tabs; t->title; t++) {
+ if (!strcmp(title, t->title)) {
+ if (*(t->flag))
+@@ -281,22 +403,25 @@ struct tabtab *newtable(struct tabtab *tabs, char *title)
+ return t;
+ }
+ }
+- if (!f_unknown)
+- return NULL;
++ if (!f_unknown)
++ return NULL;
+ printf("%s:\n", _(title));
+ dummytab.title = title;
+- dummytab.flag = &f_unknown;
++ dummytab.flag = &f_unknown;
+ return &dummytab;
+ }
+
+-void process_fd(FILE *f)
++int process_fd(FILE *f, int all, char *filter)
+ {
+- char buf1[1024], buf2[1024];
++ char buf1[2048], buf2[2048];
+ char *sp, *np, *p;
+ while (fgets(buf1, sizeof buf1, f)) {
+ int endflag;
+ struct tabtab *tab;
+
++ if (buf1[0] == '\n') // skip empty first line in 2.6 kernels
++ continue;
++
+ if (!fgets(buf2, sizeof buf2, f))
+ break;
+ sp = strchr(buf1, ':');
+@@ -305,6 +430,10 @@ void process_fd(FILE *f)
+ goto formaterr;
+ *sp = '\0';
+
++ if (!all)
++ if (strncmp(buf1, filter, strlen(filter)))
++ continue;
++
+ tab = newtable(snmptabs, buf1);
+ if (tab == NULL) {
+ printf("unknown %s\n", buf1);
+@@ -315,8 +444,8 @@ void process_fd(FILE *f)
+
+ endflag = 0;
+ while (!endflag) {
+- sp += strspn(sp, " \t\n");
+- np += strspn(np, " \t\n");
++ sp += strspn(sp, " \t\n");
++ np += strspn(np, " \t\n");
+ /*if (*np == '\0') goto formaterr; */
+
+ p = sp+strcspn(sp, " \t\n");
+@@ -324,51 +453,116 @@ void process_fd(FILE *f)
+ endflag = 1;
+ *p = '\0';
+
+- if (*sp != '\0' && *(tab->flag))
+- printval(tab, sp, strtoul(np, &np, 10));
++ if (*sp != '\0' && *(tab->flag))
++ printval(tab, sp, strtoull(np, &np, 10));
+
+ sp = p + 1;
+ }
+ }
+- return;
+-
++ return 0;
++
+ formaterr:
+- perror(_("error parsing /proc/net/snmp"));
+- return;
++ return -1;
+ }
+
++void cpytitle(char *original, char *new)
++{
++ char *ptr = original;
++ while(*ptr != '6' && *ptr != '\0') {
++ *new = *ptr;
++ new++;
++ ptr++;
++ }
++ *new = *ptr;
++ new++;
++ *new = '\0';
++}
++
++void process6_fd(FILE *f)
++{
++ char buf1[1024],buf2[50],buf3[1024];
++ unsigned long long val;
++ struct tabtab *tab = NULL;
++ int cpflg = 0;
++
++ while (fgets(buf1, sizeof buf1, f)) {
++ sscanf(buf1, "%s %llu", buf2, &val);
++ if(!cpflg) {
++ cpytitle(buf2, buf3);
++ tab = newtable(snmp6tabs, buf3);
++ cpflg = 1;
++ }
++ if(!strstr(buf2, buf3)) {
++ cpytitle(buf2, buf3);
++ tab = newtable(snmp6tabs, buf3);
++ }
++ if (*(tab->flag))
++ printval(tab, buf2, val);
++ }
++
++}
+
+ void parsesnmp(int flag_raw, int flag_tcp, int flag_udp)
+ {
+ FILE *f;
+
+ f_raw = flag_raw; f_tcp = flag_tcp; f_udp = flag_udp;
+-
+- f = fopen("/proc/net/snmp", "r");
++
++ f = proc_fopen("/proc/net/snmp");
+ if (!f) {
+ perror(_("cannot open /proc/net/snmp"));
+ return;
+ }
+- process_fd(f);
++
++ if (process_fd(f, 1, NULL) < 0)
++ fprintf(stderr, _("Problem while parsing /proc/net/snmp\n"));
+
+ if (ferror(f))
+ perror("/proc/net/snmp");
+
+ fclose(f);
+
+- f = fopen("/proc/net/netstat", "r");
++ f = proc_fopen("/proc/net/netstat");
+
+ if (f) {
+- process_fd(f);
++ if (process_fd(f, 1, NULL) <0)
++ fprintf(stderr, _("Problem while parsing /proc/net/netstat\n"));
+
+ if (ferror(f))
+ perror("/proc/net/netstat");
+-
++
+ fclose(f);
+ }
+ return;
+ }
+-
++
++void parsesnmp6(int flag_raw, int flag_tcp, int flag_udp)
++{
++ FILE *f;
++
++ f_raw = flag_raw; f_tcp = flag_tcp; f_udp = flag_udp;
++
++ f = fopen("/proc/net/snmp6", "r");
++ if (!f) {
++ perror(_("cannot open /proc/net/snmp6"));
++ return;
++ }
++ process6_fd(f);
++ if (ferror(f))
++ perror("/proc/net/snmp6");
++
++ fclose(f);
++ f = fopen("/proc/net/snmp", "r");
++ if (!f) {
++ perror(_("cannot open /proc/net/snmp"));
++ return;
++ }
++ process_fd(f, 0, "Tcp");
++ if (ferror(f))
++ perror("/proc/net/snmp");
++
++ fclose(f);
++}
+
+ void inittab(void)
+ {
+@@ -379,3 +573,13 @@ void inittab(void)
+ qsort(t->tab, t->size / sizeof(struct entry),
+ sizeof(struct entry), cmpentries);
+ }
++
++void inittab6(void)
++{
++ struct tabtab *t;
++
++ for (t = snmp6tabs; t->title; t++)
++ qsort(t->tab, t->size / sizeof(struct entry),
++ sizeof(struct entry), cmpentries);
++}
++
diff --git a/system/net-tools/musl-fixes.patch b/system/net-tools/musl-fixes.patch
new file mode 100644
index 000000000..4d6170ca9
--- /dev/null
+++ b/system/net-tools/musl-fixes.patch
@@ -0,0 +1,94 @@
+diff --git a/lib/inet6_gr.c b/lib/inet6_gr.c
+index 72b4a66..2361809 100644
+--- a/lib/inet6_gr.c
++++ b/lib/inet6_gr.c
+@@ -23,7 +23,7 @@
+ #include <string.h>
+ #include <stdio.h>
+ #include <unistd.h>
+-#ifndef __GLIBC__
++#ifdef HAVE_IPV6_ROUTE_H
+ #include <netinet6/ipv6_route.h> /* glibc doesn't have this */
+ #endif
+ #include "version.h"
+diff --git a/lib/inet6_sr.c b/lib/inet6_sr.c
+index 1ad9510..96dbd5f 100644
+--- a/lib/inet6_sr.c
++++ b/lib/inet6_sr.c
+@@ -23,10 +23,10 @@
+ #include <string.h>
+ #include <stdio.h>
+ #include <unistd.h>
+-#ifdef __GLIBC__
+-#include <net/route.h>
+-#else
++#ifdef HAVE_IPV6_ROUTE_H
+ #include <netinet6/ipv6_route.h> /* glibc does not have this */
++#else
++#include <net/route.h>
+ #endif
+ #include "version.h"
+ #include "net-support.h"
+diff --git a/lib/inet_sr.c b/lib/inet_sr.c
+index 1a876ae..6a26a76 100644
+--- a/lib/inet_sr.c
++++ b/lib/inet_sr.c
+@@ -26,6 +26,7 @@
+ #include <string.h>
+ #include <stdio.h>
+ #include <unistd.h>
++#include <asm-generic/param.h>
+ #include "version.h"
+ #include "net-support.h"
+ #include "pathnames.h"
+diff --git a/lib/util-ank.c b/lib/util-ank.c
+index b077f35..4ee59f6 100644
+--- a/lib/util-ank.c
++++ b/lib/util-ank.c
+@@ -14,6 +14,7 @@
+ * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses
+ */
+
++#include <limits.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
+diff --git a/mii-tool.c b/mii-tool.c
+index 1cfecc2..fbc3b34 100644
+--- a/mii-tool.c
++++ b/mii-tool.c
+@@ -46,10 +46,6 @@
+ #include <net/if.h>
+ #include <linux/sockios.h>
+
+-#ifndef __GLIBC__
+-#include <linux/if_arp.h>
+-#include <linux/if_ether.h>
+-#endif
+ #include <linux/mii.h>
+ #include <linux/sockios.h>
+ #include "version.h"
+diff --git a/netstat.c b/netstat.c
+index d0c364f..8453f18 100644
+--- a/netstat.c
++++ b/netstat.c
+@@ -88,6 +88,7 @@
+ #include <sys/stat.h>
+ #include <net/if.h>
+ #include <dirent.h>
++#include <asm-generic/param.h>
+
+ #include "net-support.h"
+ #include "pathnames.h"
+diff --git a/slattach.c b/slattach.c
+index 5c81584..3ccde28 100644
+--- a/slattach.c
++++ b/slattach.c
+@@ -44,6 +44,7 @@
+ #include <string.h>
+ #include <unistd.h>
+ #include <getopt.h>
++#include <termios.h>
+ #include <linux/if_slip.h>
+
+ #if defined(__GLIBC__)
diff --git a/system/patch/APKBUILD b/system/patch/APKBUILD
new file mode 100644
index 000000000..4c69c9273
--- /dev/null
+++ b/system/patch/APKBUILD
@@ -0,0 +1,52 @@
+# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=patch
+pkgver=2.7.6
+pkgrel=2
+pkgdesc="Utility to apply diffs to files"
+url="https://www.gnu.org/software/patch/patch.html"
+arch="all"
+license="GPL-3.0+"
+depends=""
+makedepends=""
+checkdepends="bash ed"
+install=""
+subpackages="$pkgname-doc"
+source="ftp://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.xz
+ CVE-2018-6951.patch
+ "
+builddir="$srcdir"/$pkgname-$pkgver
+
+# secfixes:
+# 2.7.6-r2:
+# - CVE-2018-6951
+
+build() {
+ cd "$builddir"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --localstatedir=/var \
+ --disable-nls
+ make
+}
+
+check() {
+ cd "$builddir"
+ make SHELL=bash check
+}
+
+package() {
+ make prefix="$pkgdir"/usr \
+ mandir="$pkgdir"/usr/share/man \
+ -C "$builddir" install
+
+ rm -f "$pkgdir"/usr/lib/charset.alias
+ rmdir -p "$pkgdir"/usr/lib 2>/dev/null || true
+}
+
+sha512sums="fcca87bdb67a88685a8a25597f9e015f5e60197b9a269fa350ae35a7991ed8da553939b4bbc7f7d3cfd863c67142af403b04165633acbce4339056a905e87fbd patch-2.7.6.tar.xz
+db51d0b791d38dd4f1b373621ee18620ae339b172f58a79420fdaa4a4b1b1d9df239cf61bbddc4e6a4896b28b8cffc7c99161eb5e2facaec8df86a1bf7755bc0 CVE-2018-6951.patch"
diff --git a/system/patch/CVE-2018-6951.patch b/system/patch/CVE-2018-6951.patch
new file mode 100644
index 000000000..002d8ffd9
--- /dev/null
+++ b/system/patch/CVE-2018-6951.patch
@@ -0,0 +1,29 @@
+From f290f48a621867084884bfff87f8093c15195e6a Mon Sep 17 00:00:00 2001
+From: Andreas Gruenbacher <agruen@gnu.org>
+Date: Mon, 12 Feb 2018 16:48:24 +0100
+Subject: Fix segfault with mangled rename patch
+
+http://savannah.gnu.org/bugs/?53132
+* src/pch.c (intuit_diff_type): Ensure that two filenames are specified
+for renames and copies (fix the existing check).
+---
+ src/pch.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/pch.c b/src/pch.c
+index ff9ed2c..bc6278c 100644
+--- a/src/pch.c
++++ b/src/pch.c
+@@ -974,7 +974,8 @@ intuit_diff_type (bool need_header, mode_t *p_file_type)
+ if ((pch_rename () || pch_copy ())
+ && ! inname
+ && ! ((i == OLD || i == NEW) &&
+- p_name[! reverse] &&
++ p_name[reverse] && p_name[! reverse] &&
++ name_is_valid (p_name[reverse]) &&
+ name_is_valid (p_name[! reverse])))
+ {
+ say ("Cannot %s file without two valid file names\n", pch_rename () ? "rename" : "copy");
+--
+cgit v1.0-41-gc330
+
diff --git a/system/pax-utils/APKBUILD b/system/pax-utils/APKBUILD
new file mode 100644
index 000000000..7670ff965
--- /dev/null
+++ b/system/pax-utils/APKBUILD
@@ -0,0 +1,42 @@
+# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=pax-utils
+pkgver=1.2.2
+pkgrel=1
+pkgdesc="ELF related utils for ELF 32/64 binaries"
+url="https://wiki.gentoo.org/wiki/Hardened/PaX_Utilities"
+arch="all"
+options="!check" # Requires unpackaged dependencies
+license="GPL-2.0"
+depends="scanelf"
+makedepends_build=""
+makedepends_host="linux-headers libcap-dev"
+makedepends="$makedepends_build $makedepends_host"
+source="http://distfiles.gentoo.org/distfiles/${pkgname}-${pkgver}.tar.xz
+ fix-eitype.patch"
+subpackages="$pkgname-doc scanelf:_scanelf"
+builddir="$srcdir"/$pkgname-$pkgver
+
+build() {
+ cd "$builddir"
+ make USE_CAP=yes
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir/" install
+
+ # Don't conflict with main/lddtree
+ rm -f "$pkgdir"/usr/bin/lddtree
+}
+
+_scanelf() {
+ pkgdesc="Scan ELF binaries for stuff"
+ depends=
+ replaces="pax-utils"
+ mkdir -p "$subpkgdir"/usr/bin
+ mv "$pkgdir"/usr/bin/scanelf "$subpkgdir"/usr/bin/
+}
+
+sha512sums="6bafe93f3b84d4595b6adfa09b46a3dd249f309fe836d90115e9aa5fcc7da37b03f743e80719dfe6bcdb739ce6ec3843170a5513e196c348721f850e19d3e38c pax-utils-1.2.2.tar.xz
+7150f162a64d9095fab4f73c4a0c531550e2286d6e09a686c62b3a692353b9e33a770ad196f647b5f26b5acafcdef05187dc9d40b40b46d508900dc3e33324a6 fix-eitype.patch"
diff --git a/system/pax-utils/fix-eitype.patch b/system/pax-utils/fix-eitype.patch
new file mode 100644
index 000000000..fe54ee887
--- /dev/null
+++ b/system/pax-utils/fix-eitype.patch
@@ -0,0 +1,28 @@
+elf->data is 'signed char' and casting it to 'int' will sign extend.
+Most non-intrusive fix is to just have get_elfeitype() take type as
+'unsigned char' to make implicit cast.
+
+diff -ru pax-utils-1.2.2.orig/paxelf.c pax-utils-1.2.2/paxelf.c
+--- pax-utils-1.2.2.orig/paxelf.c 2017-01-24 20:24:53.000000000 +0000
++++ pax-utils-1.2.2/paxelf.c 2017-09-26 07:01:00.115498082 +0000
+@@ -65,7 +65,7 @@
+ QUERY(ELFOSABI_STANDALONE),
+ { 0, 0 }
+ };
+-const char *get_elfeitype(int ei_type, int type)
++const char *get_elfeitype(int ei_type, unsigned char type)
+ {
+ switch (ei_type) {
+ case EI_CLASS: return find_pairtype(elf_ei_class, type);
+diff -ru pax-utils-1.2.2.orig/paxelf.h pax-utils-1.2.2/paxelf.h
+--- pax-utils-1.2.2.orig/paxelf.h 2017-01-24 20:24:53.000000000 +0000
++++ pax-utils-1.2.2/paxelf.h 2017-09-26 07:00:44.941879820 +0000
+@@ -56,7 +56,7 @@
+ extern elfobj *_readelf(const char *filename, int read_only);
+ #define readelf(filename) _readelf(filename, 1)
+ extern void unreadelf(elfobj *elf);
+-extern const char *get_elfeitype(int ei_type, int type);
++extern const char *get_elfeitype(int ei_type, unsigned char type);
+ extern const char *get_elfetype(elfobj *elf);
+ extern const char *get_endian(elfobj *elf);
+ extern const char *get_elfosabi(elfobj *elf);
diff --git a/system/pkgconf/APKBUILD b/system/pkgconf/APKBUILD
new file mode 100644
index 000000000..7c95955f6
--- /dev/null
+++ b/system/pkgconf/APKBUILD
@@ -0,0 +1,54 @@
+# Maintainer: William Pitcock <nenolod@dereferenced.org>
+pkgname=pkgconf
+pkgver=1.4.2
+pkgrel=0
+pkgdesc="development framework configuration tools"
+url="https://github.com/pkgconf/pkgconf"
+arch="all"
+license="ISC"
+replaces="pkgconfig"
+provides="pkgconfig=1"
+source="https://distfiles.dereferenced.org/pkgconf/pkgconf-$pkgver.tar.xz"
+subpackages="$pkgname-doc $pkgname-dev"
+checkdepends="kyua atf"
+builddir="$srcdir/$pkgname-$pkgver"
+
+build() {
+ cd "$builddir"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ --localstatedir=/var \
+ --with-pkg-config-dir=/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig \
+ || return 1
+ make || return 1
+}
+
+check() {
+ cd "$builddir"
+ make check || return 1
+}
+
+package() {
+ cd "$builddir"
+
+ make DESTDIR="$pkgdir" install || return 1
+ ln -s pkgconf "$pkgdir"/usr/bin/pkg-config
+}
+
+dev() {
+ default_dev || return 1
+
+ # Move pkg-config back to main package (default_dev implicitly moves
+ # files /usr/bin/*-config to -dev).
+ mv "$subpkgdir"/usr/bin/pkg-config "$pkgdir"/usr/bin/
+
+ mkdir -p "$pkgdir"/usr/share/aclocal/
+ mv "$subpkgdir"/usr/share/aclocal/pkg.m4 "$pkgdir"/usr/share/aclocal/
+}
+
+sha512sums="d9d3bfc7ddc3ceda65f7ad11b1a3c8a48aee0b5ac135aeb54b41091ca1ef0d9a5cda4a5c1ba2470ec12ce870a361eeddd802243eda3c2e2c0f2be3e7fe0ca236 pkgconf-1.4.2.tar.xz"
diff --git a/system/popt/APKBUILD b/system/popt/APKBUILD
new file mode 100644
index 000000000..b3b035ed4
--- /dev/null
+++ b/system/popt/APKBUILD
@@ -0,0 +1,42 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=popt
+pkgver=1.16
+pkgrel=7
+pkgdesc="A commandline option parser"
+url="http://rpm5.org"
+arch="all"
+license="custom"
+depends=
+makedepends=""
+source="http://rpm5.org/files/$pkgname/$pkgname-$pkgver.tar.gz"
+subpackages="$pkgname-doc $pkgname-dev"
+
+prepare() {
+ cd "$builddir"
+ default_prepare
+ update_config_sub
+}
+
+build() {
+ cd "$builddir"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --libdir=/lib \
+ --disable-static
+ make
+}
+
+check() {
+ cd "$builddir"
+ make check
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+ install -Dm644 COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING
+}
+
+sha512sums="bae2dd4e5d682ef023fdc77ae60c4aad01a3a576d45af9d78d22490c11e410e60edda37ede171920746d4ae0d5de3c060d15cecfd41ba75b727a811be828d694 popt-1.16.tar.gz"
diff --git a/system/postgresql/APKBUILD b/system/postgresql/APKBUILD
deleted file mode 100644
index e618eeb39..000000000
--- a/system/postgresql/APKBUILD
+++ /dev/null
@@ -1,259 +0,0 @@
-# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
-# Contributor: G.J.R. Timmer <gjr.timmer@gmail.com>
-# Contributor: Jakub Jirutka <jakub@jirutka.cz>
-pkgname=postgresql
-pkgver=10.0
-pkgrel=0
-pkgdesc="A sophisticated object-relational DBMS"
-url="http://www.postgresql.org/"
-arch="all"
-license="BSD"
-depends="postgresql-client tzdata"
-options="!checkroot"
-install="$pkgname.pre-upgrade"
-pkgusers="postgres"
-pkggroups="postgres"
-checkdepends="diffutils"
-depends_dev="openssl-dev"
-makedepends="$depends_dev libedit-dev zlib-dev libxml2-dev util-linux-dev
- openldap-dev tcl-dev perl-dev python3-dev"
-subpackages="$pkgname-contrib $pkgname-dev $pkgname-doc libpq $pkgname-libs
- $pkgname-client $pkgname-pltcl
- $pkgname-plperl $pkgname-plperl-contrib:plperl_contrib
- $pkgname-plpython3 $pkgname-plpython3-contrib:plpython3_contrib"
-source="https://ftp.postgresql.org/pub/source/v$pkgver/$pkgname-$pkgver.tar.bz2
- initdb.patch
- perl-rpath.patch
- conf-unix_socket_directories.patch
- disable-broken-tests.patch
- $pkgname.initd
- $pkgname.confd
- pg-restore.initd
- pg-restore.confd
- pltcl_create_tables.sql
- "
-builddir="$srcdir/$pkgname-$pkgver"
-options="!checkroot"
-
-# secfixes:
-# 9.6.4-r0:
-# - CVE-2017-7546
-# - CVE-2017-7547
-# - CVE-2017-7548
-# 9.6.3-r0:
-# - CVE-2017-7484
-# - CVE-2017-7485
-# - CVE-2017-7486
-
-prepare() {
- default_prepare
- cd "$builddir"
-
- local file; for file in $pkgname.initd $pkgname.confd; do
- sed "s|@VERSION@|${pkgver%.*}|" "$srcdir"/$file > $file
- done
-}
-
-build() {
- _configure
- make world
-}
-
-# Note: (...) instead of {...} is NOT a typo!
-_configure() (
- export CFLAGS="${CFLAGS/-Os/-O2}"
- export CPPFLAGS="${CPPFLAGS/-Os/-O2}"
-
- ./configure \
- --build=$CBUILD \
- --host=$CHOST \
- --prefix=/usr \
- --mandir=/usr/share/man \
- --with-system-tzdata=/usr/share/zoneinfo \
- --with-ldap \
- --with-libedit-preferred \
- --with-libxml \
- --with-openssl \
- --with-uuid=e2fs \
- --disable-rpath \
- --with-perl \
- --with-python \
- --with-tcl
-)
-
-check() {
- cd "$builddir"
-
- _run_tests src/test
- _run_tests src/pl
- _run_tests contrib
-}
-
-check() {
- cd "$builddir"
- make check
-}
-
-package() {
- cd "$builddir"
-
- make DESTDIR="$pkgdir" install install-docs
-
- cd "$pkgdir"
-
- install -d -m750 -o postgres -g postgres \
- ./var/lib/postgresql \
- ./var/log/$pkgname
-
- install -D -m755 "$builddir"/postgresql.initd ./etc/init.d/postgresql
- install -D -m644 "$builddir"/postgresql.confd ./etc/conf.d/postgresql
-
- install -D -m755 "$srcdir"/pg-restore.initd ./etc/init.d/pg-restore
- install -D -m644 "$srcdir"/pg-restore.confd ./etc/conf.d/pg-restore
-}
-
-dev() {
- default_dev
-
- _submv usr/bin/pg_config \
- usr/bin/ecpg \
- usr/lib/postgresql/pgxs
-}
-
-libpq() {
- pkgdesc="PostgreSQL libraries"
- depends=""
-
- _submv usr/lib/libpq.so.*
-}
-
-libs() {
- depends=""
- default_libs
-}
-
-client() {
- pkgdesc="PostgreSQL client"
- depends=""
-
- cd "$pkgdir"/usr/bin
- mkdir -p "$subpkgdir"/usr/bin
- mv clusterdb \
- createdb \
- createuser \
- dropdb \
- dropuser \
- pg_basebackup \
- pg_dump \
- pg_dumpall \
- pg_isready \
- pg_receivewal \
- pg_recvlogical \
- pg_restore \
- psql \
- reindexdb \
- vacuumdb \
- "$subpkgdir"/usr/bin/
-}
-
-contrib() {
- pkgdesc="Extension modules distributed with PostgreSQL"
- depends=""
-
- cd "$builddir"
-
- # Avoid installing plperl and plpython extensions, these will be
- # installed into separate subpackages.
- sed -Ei -e 's/(.*_plperl)/#\1/' \
- -e 's/(.*_plpython)/#\1/' \
- contrib/Makefile
-
- make -C contrib DESTDIR="$subpkgdir" install
-
- mv "$subpkgdir"/usr/share/doc/postgresql/extension \
- "$pkgdir"/usr/share/doc/postgresql/
- rmdir -p "$subpkgdir"/usr/share/doc/postgresql || true
-}
-
-pltcl() {
- pkgdesc="PL/Tcl procedural language for PostgreSQL"
- depends="pgtcl"
-
- _submv usr/lib/postgresql/pltcl.so \
- usr/share/postgresql/extension/pltcl*
-
- install -m 644 "$srcdir"/pltcl_create_tables.sql \
- "$subpkgdir"/usr/share/postgresql/
-}
-
-plperl() {
- pkgdesc="PL/Perl procedural language for PostgreSQL"
- depends=""
-
- _submv usr/lib/postgresql/plperl.so \
- usr/share/postgresql/extension/plperl*
-}
-
-plperl_contrib() {
- _plcontrib plperl "PL/Perl"
-
- cd "$builddir"
- make -C contrib/hstore_plperl DESTDIR="$subpkgdir" install
-}
-
-plpython3() {
- pkgdesc="PL/Python3 procedural language for PostgreSQL"
- depends="python3"
-
- cd "$builddir"
- make -C src/pl/plpython DESTDIR="$subpkgdir" install
- rm -R "$subpkgdir"/usr/include
-}
-
-plpython3_contrib() {
- _plcontrib plpython3 "PL/Python 3"
-
- cd "$builddir"
- make -C contrib/hstore_plpython DESTDIR="$subpkgdir" install
- make -C contrib/ltree_plpython DESTDIR="$subpkgdir" install
-}
-
-_plcontrib() {
- local subname="$1"
- pkgdesc="$2 extension modules distributed with PostgreSQL"
- depends="$pkgname-$subname"
- install_if="$pkgname-$subname=$pkgver-r$pkgrel $pkgname-contrib=$pkgver-r$pkgrel"
-}
-
-_run_tests() {
- local path="$1"; shift
-
- msg "Running test suite at $path..."
- # Note: some tests fail when running in parallel.
- make -k -j 1 -C "$path" $@ check MAX_CONNECTIONS=5 || {
- printf "\n%s\n\n" "Trying to find all regression.diffs files in build directory..." >&2
- find "$path" -name regression.diffs | while read file; do
- echo "=== test failure: $file ===" >&2
- cat "$file" >&2
- done
- return 1
- }
-}
-
-_submv() {
- local path; for path in "$@"; do
- mkdir -p "$subpkgdir/${path%/*}"
- mv "$pkgdir"/$path "$subpkgdir"/${path%/*}/
- done
-}
-
-sha512sums="88295af13db77a85a604c925aa627d383fdac62c1185119bba87753ce4167a13aed0f055a7a1329b3051f8757c6ba7529baed00a564ef0cfbee685720f282678 postgresql-10.0.tar.bz2
-1f8e7dc58f5b0a12427cf2fd904ffa898a34f23f3332c8382b94e0d991c007289e7913a69e04498f3d93fc5701855796c207b4b1cc4a0b366f586050124d7fcc initdb.patch
-5f9d8bb4957194069d01af8ab3abc6d4d83a7e7f8bd7ebe1caae5361d621a3e58f91b14b952958138a794e0a80bc154fbb7e3e78d211e2a95b9b7901335de854 perl-rpath.patch
-8439a6fdfdea0a4867daeb8bc23d6c825f30c00d91d4c39f48653f5ee77341f23282ce03a77aad94b5369700f11d2cb28d5aee360e59138352a9ab331a9f9d0f conf-unix_socket_directories.patch
-1966b2a3971f56fbecd8daa45965236d487683e13300e5c000e595bbadbbe9d0e1301fbbfa034f452abe8a4e4a427781f772370b9ff392bb03fc11ee43c9dee7 disable-broken-tests.patch
-224e80f9e62843fd248e625abdd0d9fe477729ff3f9a64fc5c86dd37bb7176d3504107fbed7ce578e3a1db7f60b8cf2abf5fe4862c81f76b6d026e29ca495cfc postgresql.initd
-a6d9cba5c7270484b3a22083b2b37742faefb01b6643040050c92235840c601b2e206ebda32804937b729c6cf42c79a558b921900e52fc420df2a03b5f29e1f7 postgresql.confd
-f5a1cba051e7d846c2d16703514601cb25729ed96b677c9bd0c199d64552120a8b14b238af01917fdb87106681e12dee6fff7447558155ba273e4f96be5e2892 pg-restore.initd
-c14a5684e914abb3b0ee71bbf15eed71a9264deacaa404a6e3af6bfc330d93e7598624d0ed11a94263106cc660f7f54c8ff57e759033cf606a795f69ff6c1c7c pg-restore.confd
-5c9bfd9e295dcf678298bf0aa974347a7c311d6e7c2aa76a6920fcb751d01fd1ab77abbec11f3c672f927ad9deaa88e04e370c0b5cd1b60087554c474b748731 pltcl_create_tables.sql"
diff --git a/system/postgresql/conf-unix_socket_directories.patch b/system/postgresql/conf-unix_socket_directories.patch
deleted file mode 100644
index 24c51e7b9..000000000
--- a/system/postgresql/conf-unix_socket_directories.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-Creating socket in /tmp is silly, but unfortunately it's default location,
-so many clients expect it. Thus we preconfigure PostgreSQL to create socket
-both in /run/postgresql and /tmp.
---- a/src/backend/utils/misc/postgresql.conf.sample
-+++ b/src/backend/utils/misc/postgresql.conf.sample
-@@ -63,7 +63,7 @@
- #port = 5432 # (change requires restart)
- #max_connections = 100 # (change requires restart)
- #superuser_reserved_connections = 3 # (change requires restart)
--#unix_socket_directories = '/tmp' # comma-separated list of directories
-+unix_socket_directories = '/run/postgresql,/tmp' # comma-separated list of directories
- # (change requires restart)
- #unix_socket_group = '' # (change requires restart)
- #unix_socket_permissions = 0777 # begin with 0 to use octal notation
diff --git a/system/postgresql/disable-broken-tests.patch b/system/postgresql/disable-broken-tests.patch
deleted file mode 100644
index 0bb5b03fa..000000000
--- a/system/postgresql/disable-broken-tests.patch
+++ /dev/null
@@ -1,119 +0,0 @@
-These tests fail due to some really weird linking issue like:
-
- ERROR: could not load library "<builddir>/tmp_install/usr/lib/postgresql/libpqwalreceiver.so": Error loading shared library libpq.so.5: No such file or directory (needed by <builddir>/tmp_install/usr/lib/postgresql/libpqwalreceiver.so)
-
-psql dynamically loads libpq and libpqwalreceiver libs using pg_dlopen()
-which is an alias for dlopen() on Linux. The above message comes from
-src/backend/utils/fmgr/dfmgr.c. The part "Error loading ..." is from
-pg_dlerror() which is alias for dlerror().
-
-LD_LIBRARY_PATH is set and passed correctly. However, the error
-disappeared when I've copied libpq.so* to /usr/lib...
-
-Also:
-
- $ LD_LIBRARY_PATH=$(pwd) ldd postgresql/libpqwalreceiver.so
- ldd (0x280d565e000)
- libpq.so.5 => <builddir>/tmp_install/usr/lib/libpq.so.5 (0x280d520d000)
- libc.musl-x86_64.so.1 => ldd (0x280d565e000)
- libssl.so.43 => /lib/libssl.so.43 (0x280d4fc2000)
- libcrypto.so.41 => /lib/libcrypto.so.41 (0x280d4c1c000)
- libldap_r-2.4.so.2 => /usr/lib/libldap_r-2.4.so.2 (0x280d49d6000)
- liblber-2.4.so.2 => /usr/lib/liblber-2.4.so.2 (0x280d47c9000)
- libsasl2.so.3 => /usr/lib/libsasl2.so.3 (0x280d45b0000)
- Error relocating postgresql/libpqwalreceiver.so: appendStringInfoChar: symbol not found
- Error relocating postgresql/libpqwalreceiver.so: MyLatch: symbol not found
- Error relocating postgresql/libpqwalreceiver.so: MemoryContextDelete: symbol not found
- Error relocating postgresql/libpqwalreceiver.so: errstart: symbol not found
- Error relocating postgresql/libpqwalreceiver.so: pg_atoi: symbol not found
- Error relocating postgresql/libpqwalreceiver.so: TupleDescGetAttInMetadata: symbol not found
- Error relocating postgresql/libpqwalreceiver.so: WalReceiverFunctions: symbol not found
- Error relocating postgresql/libpqwalreceiver.so: WaitLatchOrSocket: symbol not found
- Error relocating postgresql/libpqwalreceiver.so: MemoryContextReset: symbol not found
- Error relocating postgresql/libpqwalreceiver.so: pfree: symbol not found
- Error relocating postgresql/libpqwalreceiver.so: errmsg: symbol not found
- Error relocating postgresql/libpqwalreceiver.so: tuplestore_puttuple: symbol not found
- Error relocating postgresql/libpqwalreceiver.so: pchomp: symbol not found
- Error relocating postgresql/libpqwalreceiver.so: appendStringInfoString: symbol not found
- Error relocating postgresql/libpqwalreceiver.so: errfinish: symbol not found
- Error relocating postgresql/libpqwalreceiver.so: pstrdup: symbol not found
- Error relocating postgresql/libpqwalreceiver.so: palloc0: symbol not found
- Error relocating postgresql/libpqwalreceiver.so: errdetail: symbol not found
- Error relocating postgresql/libpqwalreceiver.so: ResetLatch: symbol not found
- Error relocating postgresql/libpqwalreceiver.so: work_mem: symbol not found
- Error relocating postgresql/libpqwalreceiver.so: AllocSetContextCreate: symbol not found
- Error relocating postgresql/libpqwalreceiver.so: CurrentMemoryContext: symbol not found
- Error relocating postgresql/libpqwalreceiver.so: tuplestore_begin_heap: symbol not found
- Error relocating postgresql/libpqwalreceiver.so: BuildTupleFromCStrings: symbol not found
- Error relocating postgresql/libpqwalreceiver.so: errcode: symbol not found
- Error relocating postgresql/libpqwalreceiver.so: MyDatabaseId: symbol not found
- Error relocating postgresql/libpqwalreceiver.so: GetDatabaseEncodingName: symbol not found
- Error relocating postgresql/libpqwalreceiver.so: palloc: symbol not found
- Error relocating postgresql/libpqwalreceiver.so: pg_lsn_in: symbol not found
- Error relocating postgresql/libpqwalreceiver.so: ProcessInterrupts: symbol not found
- Error relocating postgresql/libpqwalreceiver.so: elog_start: symbol not found
- Error relocating postgresql/libpqwalreceiver.so: DirectFunctionCall1Coll: symbol not found
- Error relocating postgresql/libpqwalreceiver.so: elog_finish: symbol not found
- Error relocating postgresql/libpqwalreceiver.so: CreateTemplateTupleDesc: symbol not found
- Error relocating postgresql/libpqwalreceiver.so: InterruptPending: symbol not found
- Error relocating postgresql/libpqwalreceiver.so: TupleDescInitEntry: symbol not found
- Error relocating postgresql/libpqwalreceiver.so: initStringInfo: symbol not found w
-
-These symbols are really not provided by libpq.
-
-I wasted one day trying to figure out what's going on here, but still
-have no idea. :(
-
---- a/src/test/regress/parallel_schedule
-+++ b/src/test/regress/parallel_schedule
-@@ -84,7 +84,7 @@
- # ----------
- # Another group of parallel tests
- # ----------
--test: brin gin gist spgist privileges init_privs security_label collate matview lock replica_identity rowsecurity object_address tablesample groupingsets drop_operator password
-+test: brin gin gist spgist privileges init_privs security_label collate matview lock replica_identity rowsecurity tablesample groupingsets drop_operator password
-
- # ----------
- # Another group of parallel tests
-@@ -98,7 +98,7 @@
- test: select_parallel
-
- # no relation related tests can be put in this group
--test: publication subscription
-+test: publication
-
- # ----------
- # Another group of parallel tests
---- a/src/test/modules/dummy_seclabel/Makefile
-+++ b/src/test/modules/dummy_seclabel/Makefile
-@@ -6,7 +6,7 @@
- EXTENSION = dummy_seclabel
- DATA = dummy_seclabel--1.0.sql
-
--REGRESS = dummy_seclabel
-+#REGRESS = dummy_seclabel
-
- ifdef USE_PGXS
- PG_CONFIG = pg_config
---- a/contrib/postgres_fdw/Makefile
-+++ b/contrib/postgres_fdw/Makefile
-@@ -10,7 +10,7 @@
- EXTENSION = postgres_fdw
- DATA = postgres_fdw--1.0.sql
-
--REGRESS = postgres_fdw
-+#REGRESS = postgres_fdw
-
- ifdef USE_PGXS
- PG_CONFIG = pg_config
---- a/contrib/dblink/Makefile
-+++ b/contrib/dblink/Makefile
-@@ -10,7 +10,7 @@
- dblink--unpackaged--1.0.sql
- PGFILEDESC = "dblink - connect to other PostgreSQL databases"
-
--REGRESS = paths dblink
-+#REGRESS = paths dblink
- REGRESS_OPTS = --dlpath=$(top_builddir)/src/test/regress
- EXTRA_CLEAN = sql/paths.sql expected/paths.out
-
diff --git a/system/postgresql/initdb.patch b/system/postgresql/initdb.patch
deleted file mode 100644
index 59a872a49..000000000
--- a/system/postgresql/initdb.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
---- a/src/bin/initdb/initdb.c
-+++ b/src/bin/initdb/initdb.c
-@@ -3259,9 +3259,7 @@
- /* translator: This is a placeholder in a shell command. */
- appendPQExpBuffer(start_db_cmd, " -l %s start", _("logfile"));
-
-- printf(_("\nSuccess. You can now start the database server using:\n\n"
-- " %s\n\n"),
-- start_db_cmd->data);
-+ printf(_("\nSuccess.\n\n"));
-
- destroyPQExpBuffer(start_db_cmd);
-
diff --git a/system/postgresql/perl-rpath.patch b/system/postgresql/perl-rpath.patch
deleted file mode 100644
index a2505acf7..000000000
--- a/system/postgresql/perl-rpath.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-We configure Postgres with --disable-rpath because for the most part we
-want to leave it to ldconfig to determine where libraries are. However,
-for some reason the Perl package puts libperl.so in a nonstandard place
-and doesn't add that place to the ldconfig search path. I think this
-is a Perl packaging bug, myself, but apparently it's not going to change.
-So work around it by adding an rpath spec to plperl.so (only).
-
-Alpine notes:
-This patch is copied from Fedora.
-
---- a/src/pl/plperl/GNUmakefile
-+++ b/src/pl/plperl/GNUmakefile
-@@ -43,6 +43,9 @@
-
- SHLIB_LINK = $(perl_embed_ldflags)
-
-+# Force rpath to be used even though we disable it everywhere else
-+SHLIB_LINK += $(rpath)
-+
- REGRESS_OPTS = --dbname=$(PL_TESTDB) --load-extension=plperl --load-extension=plperlu
- REGRESS = plperl plperl_lc plperl_trigger plperl_shared plperl_elog plperl_util plperl_init plperlu plperl_array
- # if Perl can support two interpreters in one backend,
diff --git a/system/postgresql/pg-restore.confd b/system/postgresql/pg-restore.confd
deleted file mode 100644
index 84a179f6c..000000000
--- a/system/postgresql/pg-restore.confd
+++ /dev/null
@@ -1,16 +0,0 @@
-
-# Enable this to dump databases on shutdown and restore on boot
-#
-#PGDUMP="/var/lib/postgresql/backup/databases.pgdump"
-
-# The dump file will be deleted once restored unless KEEP_DUMP is set.
-# This is to avoid accidental restoring of running database. If you know what
-# you are doing and want keep the dump, then enable the KEEP_DUMP option
-# below.
-#
-#KEEP_DUMP=yes
-
-# If you enable KEEP_DUMP above you probably also want the --clean option
-# the the pg_dumpall command.
-#PG_DUMPALL_OPTS="--clean"
-
diff --git a/system/postgresql/pg-restore.initd b/system/postgresql/pg-restore.initd
deleted file mode 100644
index e9fe65c19..000000000
--- a/system/postgresql/pg-restore.initd
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/sbin/openrc-run
-
-extra_commands="${opts} dump restore purge"
-
-depend() {
- need postgresql
-}
-
-restore() {
- yesno "$PGDUMP" && return 0
- ebegin "Restoring PostgreSQL $PGDUMP"
- psql -U ${PG_USER:-postgres} ${PSQL_OPTS} -f "$PGDUMP" >/dev/null 2>/dev/null
- local res=$?
- yesno "$KEEP_DUMP" || rm -f "$PGDUMP"
- eend $res
- /etc/init.d/postgresql reload
-}
-
-dump() {
- yesno "$PGDUMP" && return 0
- mkdir -p "$( dirname "$PGDUMP" )"
- ebegin "Saving PostgreSQL databases to $PGDUMP"
- pg_dumpall -U ${PG_USER:-postgres} ${PG_DUMPALL_OPTS} -f "$PGDUMP"
- eend $?
-}
-
-purge() {
- yesno "$PGDUMP" && return 0
- ebegin "Removing temporary $PGDUMP PostgreSQL backup"
- rm -f "$PGDUMP"
- eend $?
-}
-
-start() {
- restore
-}
diff --git a/system/postgresql/pltcl_create_tables.sql b/system/postgresql/pltcl_create_tables.sql
deleted file mode 100644
index 76c7a954a..000000000
--- a/system/postgresql/pltcl_create_tables.sql
+++ /dev/null
@@ -1,13 +0,0 @@
--- Create tables needed for PL/Tcl autoloading. This script should be run by
--- the database administrator only.
---
--- Statements in this script are extracted from pltcl_loadmod script.
---
--- Author: G.J.R. Timmer
--- Date: 2017-01-28
-
-create table pltcl_modules (modname name, modseq int2, modsrc text);
-create index pltcl_modules_i on pltcl_modules using btree (modname name_ops);
-
-create table pltcl_modfuncs (funcname name, modname name);
-create index pltcl_modfuncs_i on pltcl_modfuncs using hash (funcname name_ops);
diff --git a/system/postgresql/postgresql.confd b/system/postgresql/postgresql.confd
deleted file mode 100644
index 6a25cc381..000000000
--- a/system/postgresql/postgresql.confd
+++ /dev/null
@@ -1,59 +0,0 @@
-# Which port and socket to bind PostgreSQL.
-# This may be overriden in postgresql.conf.
-#port="5432"
-
-# How long to wait for server to start in seconds.
-#start_timeout=10
-
-# Number of seconds to wait for clients to disconnect from the server before
-# shutting down. Set to zero to disable this timeout.
-#nice_timeout=60
-
-# Timeout in seconds for rude quit - forecfully disconnect clients from server
-# and shut down. This is performed after nice_timeout exceeded. Terminated
-# client connections have their open transactions rolled back.
-# Set "rude_quit=no" to disable.
-#rude_quit="yes"
-#rude_timeout=30
-
-# Timeout in seconds for force quit - if the server still fails to shutdown,
-# you can force it to quit and a recover-run will execute on the next startup.
-# Set "force_quit=yes" to enable.
-#force_quit="no"
-#force_timeout="2"
-
-# Extra options to run postmaster with, e.g.:
-# -N is the maximal number of client connections
-# -B is the number of shared buffers (has to be at least 2x the value for -N)
-# Please read man postgres(1) for more options. Many of these options can be
-# set directly in the configuration file.
-#pg_opts="-N 512 -B 1024"
-
-# Pass extra environment variables. If you have to export environment variables
-# for the database process, this can be done here.
-# Don't forget to escape quotes.
-#env_vars="PGPASSFILE=\"/path/to/.pgpass\""
-
-# Location of postmaster.log. Default is $data_dir/postmaster.log.
-logfile="/var/log/postgresql/postmaster.log"
-
-# Automatically set up a new database if missing on startup.
-#auto_setup="yes"
-
-
-##############################################################################
-#
-# The following values should NOT be arbitrarily changed!
-#
-# The initscript uses these variables to inform PostgreSQL where to find
-# its data directory and configuration files.
-
-# Where the data directory is located/to be created.
-#data_dir="/var/lib/postgresql/@VERSION@/data"
-
-# Location of configuration files. Default is $data_dir.
-conf_dir="/etc/postgresql"
-
-# Additional options to pass to initdb.
-# See man initdb(1) for available options.
-#initdb_opts="--locale=en_US.UTF-8"
diff --git a/system/postgresql/postgresql.initd b/system/postgresql/postgresql.initd
deleted file mode 100644
index 846229a40..000000000
--- a/system/postgresql/postgresql.initd
+++ /dev/null
@@ -1,220 +0,0 @@
-#!/sbin/openrc-run
-
-extra_started_commands="reload"
-description_reload="Reload configuration"
-
-extra_stopped_commands="setup"
-description_setup="Initialize a new PostgreSQL cluster"
-
-# Note: Uppercase variables are here for backward compatibility.
-
-: ${user:=${PGUSER:-"postgres"}}
-: ${group:=${PGGROUP:-"postgres"}}
-
-: ${auto_setup:=${AUTO_SETUP:-"yes"}}
-: ${start_timeout:=${START_TIMEOUT:-10}}
-: ${nice_timeout:=${NICE_TIMEOUT:-60}}
-: ${rude_quit:=${RUDE_QUIT:-"yes"}}
-: ${rude_timeout:=${RUDE_TIMEOUT:-30}}
-: ${force_quit:=${FORCE_QUIT:-"no"}}
-: ${force_timeout:=${FORCE_TIMEOUT:-2}}
-
-: ${data_dir:=${PGDATA:-"/var/lib/postgresql/@VERSION@/data"}}
-: ${conf_dir:=$data_dir}
-: ${env_vars:=${PG_EXTRA_ENV:-}}
-: ${initdb_opts:=${PG_INITDB_OPTS:-}}
-: ${logfile:="$data_dir/postmaster.log"}
-: ${pg_opts:=${PGOPTS:-}}
-: ${port:=${PGPORT:-5432}}
-
-command="/usr/bin/postgres"
-
-conffile="$conf_dir/postgresql.conf"
-pidfile="$data_dir/postmaster.pid"
-start_stop_daemon_args="
- --user $user
- --group $group
- --pidfile $pidfile
- --wait 100"
-
-depend() {
- use net
- after firewall
-
- if [ "$(get_config log_destination)" = "syslog" ]; then
- use logger
- fi
-}
-
-start_pre() {
- check_deprecated_var WAIT_FOR_START start_timeout
- check_deprecated_var WAIT_FOR_DISCONNECT nice_timeout
- check_deprecated_var WAIT_FOR_CLEANUP rude_timeout
- check_deprecated_var WAIT_FOR_QUIT force_timeout
-
- if [ ! -d "$data_dir/base" ]; then
- if yesno "$auto_setup"; then
- setup || return 1
- else
- eerror "Database not found at: $data_dir"
- eerror "Please make sure that 'data_dir' points to the right path."
- eerror "You can run '/etc/init.d/postgresql setup' to setup a new database cluster."
- return 1
- fi
- fi
-
- local socket_dirs=$(get_config "unix_socket_directories" "/run/postgresql")
- local port=$(get_config "port" "$port")
-
- start_stop_daemon_args="$start_stop_daemon_args --env PGPORT=$port"
-
- (
- # Set the proper permission for the socket paths and create them if
- # then don't exist.
- set -f; IFS=","
- for dir in $socket_dirs; do
- if [ -e "${dir%/}/.s.PGSQL.$port" ]; then
- eerror "Socket conflict. A server is already listening on:"
- eerror " ${dir%/}/.s.PGSQL.$port"
- eerror "Hint: Change 'port' to listen on a different socket."
- return 1
- elif [ "${dir%/}" != "/tmp" ]; then
- checkpath -d -m 1775 -o $user:$group "$dir"
- fi
- done
- )
-}
-
-start() {
- local retval
-
- ebegin "Starting PostgreSQL"
-
- local var; for var in $env_vars; do
- start_stop_daemon_args="$start_stop_daemon_args --env $var"
- done
-
- rm -f "$pidfile"
- start-stop-daemon --start \
- $start_stop_daemon_args \
- --exec /usr/bin/pg_ctl \
- -- start \
- --silent \
- -w --timeout="$start_timeout" \
- --log="$logfile" \
- --pgdata="$conf_dir" \
- -o "--data-directory=$data_dir $pg_opts"
- retval=$?
-
- if [ $retval -ne 0 ]; then
- eerror "Check the log for a possible explanation of the above error:"
- eerror " $logfile"
- fi
- eend $retval
-}
-
-stop() {
- local retry="SIGTERM/$nice_timeout"
-
- yesno "$rude_quit" \
- && retry="$retry/SIGINT/$rude_timeout" \
- || rude_timeout=0
-
- yesno "$force_quit" \
- && retry="$retry/SIGQUIT/$force_timeout" \
- || force_timeout=0
-
- local seconds=$(( $nice_timeout + $rude_timeout + $force_timeout ))
-
- ebegin "Stopping PostgreSQL (this can take up to $seconds seconds)"
-
- start-stop-daemon --stop \
- --exec "$command" \
- --retry "$retry" \
- --progress \
- --pidfile "$pidfile"
- eend $?
-}
-
-reload() {
- ebegin "Reloading PostgreSQL configuration"
-
- start-stop-daemon --signal HUP --pidfile "$pidfile"
- eend $?
-}
-
-setup() {
- local bkpdir
-
- ebegin "Creating a new PostgreSQL database cluster"
-
- if [ -d "$data_dir/base" ]; then
- eend 1 "$data_dir/base already exists!"; return 1
- fi
-
- # If data_dir exists, backup configs.
- if [ -d "$data_dir" ]; then
- bkpdir="$(mktemp -d)"
- find "$data_dir" -type f -name "*.conf" -maxdepth 1 \
- -exec mv -v {} "$bkpdir"/ \;
- rm -rf "$data_dir"/*
- fi
-
- install -d -m 0700 -o $user -g $group "$data_dir"
- install -d -m 0750 -o $user -g $group "$conf_dir"
-
- cd "$data_dir" # to avoid the: could not change directory to "/root"
- su $user -c "/usr/bin/initdb $initdb_opts --pgdata $data_dir"
- local retval=$?
-
- if [ -d "$bkpdir" ]; then
- # Move backuped configs back.
- mv -v "$bkpdir"/* "$data_dir"/
- rm -rf "$bkpdir"
- fi
-
- if [ "${data_dir%/}" != "${conf_dir%/}" ]; then
- # Move configs from data_dir to conf_dir and symlink them to data_dir.
- local name newname
- for name in postgresql.conf pg_hba.conf pg_ident.conf; do
- newname="$name"
- [ ! -e "$conf_dir"/$name ] || newname="$name.new"
-
- mv "$data_dir"/$name "$conf_dir"/$newname
- ln -s "$conf_dir"/$name "$data_dir"/$name
- done
- fi
-
- eend $retval
-}
-
-
-get_config() {
- local name="$1"
- local default="${2:-}"
-
- if [ ! -f "$conffile" ]; then
- printf '%s\n' "$default"
- return 1
- fi
- sed -En "/^\s*${name}\b/{ # find line starting with the name
- s/^\s*${name}\s*=?\s*([^#]+).*/\1/; # capture the value
- s/\s*$//; # trim trailing whitespaces
- s/^['\"](.*)['\"]$/\1/; # remove delimiting quotes
- p
- }" "$conffile" \
- | grep . || printf '%s\n' "$default"
-}
-
-check_deprecated_var() {
- local old_name="$1"
- local new_name="$2"
-
- if [ -n "$(getval "$old_name")" ]; then
- ewarn "Variable '$old_name' has been removed, please use '$new_name' instead."
- fi
-}
-
-getval() {
- eval "printf '%s\n' \"\$$1\""
-}
diff --git a/system/postgresql/postgresql.pre-upgrade b/system/postgresql/postgresql.pre-upgrade
deleted file mode 100644
index 6116252c1..000000000
--- a/system/postgresql/postgresql.pre-upgrade
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/sh
-
-new="$1"
-old="$2"
-
-pgver=${new%.*}
-compare=$(apk version -t "$old" $pgver)
-
-# check if we upgrade from earlier than $pgver and if it is running
-if [ "$compare" != "<" ] || ! /etc/init.d/postgresql --quiet status; then
- exit 0
-fi
-
-if [ -f /etc/conf.d/postgresql ]; then
- . /etc/conf.d/postgresql
-fi
-
-cat <<EOF
-* You are upgrading to postgres $pgver wich is not compatible with the running
-* See: http://www.postgresql.org/docs/$pgver/static/upgrading.html
-*
-* The corresponding steps for Alpine Linux is:
-*
-* pg_dumpall -U ${PGUSER:-postgres} > dumpfile
-* /etc/init.d/postgresql stop
-* apk add -u postgresql
-* /etc/init.d/postgresql setup
-* /etc/init.d/postgresql start
-* psql -U ${PGUSER:-postgres} -f dumpfile
-*
-EOF
-exit 1
diff --git a/system/psmisc/APKBUILD b/system/psmisc/APKBUILD
new file mode 100644
index 000000000..01aa02009
--- /dev/null
+++ b/system/psmisc/APKBUILD
@@ -0,0 +1,63 @@
+# Contributor: A. Wilcox <awilfox@adelielinux.org>
+# Maintainer: A. Wilcox <awilfox@adelielinux.org>
+
+pkgname=psmisc
+pkgver=23.0
+pkgrel=0
+pkgdesc="Miscellaneous utilities that use the proc filesystem"
+url="https://gitlab.com/psmisc/psmisc"
+arch="all"
+license="GPLv2+"
+makedepends_build="autoconf>=2.69 automake gettext-dev"
+makedepends_host="ncurses-dev gettext-dev"
+checkdepends="dejagnu"
+subpackages="$pkgname-doc"
+[ "$CBUILD" != "$CHOST" ] || subpackages="$subpackages $pkgname-lang"
+source="$pkgname-$pkgver.tar.bz2::https://gitlab.com/$pkgname/$pkgname/repository/archive.tar.bz2?ref=v$pkgver
+ dont-underlink-peekfd.patch
+ fix-peekfd-on-ppc.patch
+ musl_ptregs.patch
+ "
+options="!strip"
+builddir="$srcdir/$pkgname-$pkgver"
+
+prepare() {
+ ln -fs $pkgname-v$pkgver-* "$builddir"
+
+ default_prepare
+
+ cd "$builddir"
+ sh autogen.sh
+}
+
+build() {
+ cd "$builddir"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --localstatedir=/var \
+ --enable-harden-flags \
+ --enable-ipv6 \
+ --disable-selinux \
+ ac_cv_func_malloc_0_nonnull=yes \
+ ac_cv_func_realloc_0_nonnull=yes
+ make
+}
+
+check() {
+ cd "$builddir"
+ make check
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+}
+
+sha512sums="d4f1d90fb92f83b7583cd82a3c1027de0e53fbee85253d796878878d03a52fc220bd25beaec34c651a1ed547fc13919c5c014a522124308a7421d3f64238a70f psmisc-23.0.tar.bz2
+a68c75eb3c66a9df0d4e574a9439eeed0cd2dc97b3cad3fcd8b945619c2ec238b73bf479d1b55ddd4821471cd8934ee1fbc7871c92de7ef72c3d3f989ab62c9f dont-underlink-peekfd.patch
+b16139606e1ccaebd94b7b7a14f49f530b180f1fd24338008e4c4d48761b57953458c46e57b0f7ec191353514f68126f79c281875c4cd56ed2f1220ace131ce1 fix-peekfd-on-ppc.patch
+73dec9791e8cdb85cd3d9ef9be4d16e0fef481c6edc334ed9e954829444b1a92b87f7a3a2e6c1d09ac207bed828f214f5f2a95caa66540a7f2a6c58a6b8f6f2c musl_ptregs.patch"
diff --git a/system/psmisc/dont-underlink-peekfd.patch b/system/psmisc/dont-underlink-peekfd.patch
new file mode 100644
index 000000000..e1623f193
--- /dev/null
+++ b/system/psmisc/dont-underlink-peekfd.patch
@@ -0,0 +1,10 @@
+--- psmisc-23.0/Makefile.am.old 2017-06-12 00:29:46.000000000 +0000
++++ psmisc-23.0/Makefile.am 2017-06-28 10:21:04.148955051 +0000
+@@ -65,6 +65,7 @@
+ src_killall_SOURCES = src/killall.c src/comm.h src/signals.c src/signals.h src/i18n.h
+ src_killall_LDADD = @LIBINTL@ @SELINUX_LIB@
+ src_peekfd_SOURCES = src/peekfd.c
++src_peekfd_LDADD = @LIBINTL@
+ src_pslog_SOURCES = src/pslog.c
+ src_pstree_SOURCES = src/pstree.c src/comm.h src/i18n.h
+ src_pstree_LDADD = @LIBINTL@ @TERMCAP_LIB@ @SELINUX_LIB@
diff --git a/system/psmisc/fix-peekfd-on-ppc.patch b/system/psmisc/fix-peekfd-on-ppc.patch
new file mode 100644
index 000000000..d9fc1d5f1
--- /dev/null
+++ b/system/psmisc/fix-peekfd-on-ppc.patch
@@ -0,0 +1,19 @@
+--- psmisc-23.0/src/peekfd.c.old 2017-06-12 00:29:46.000000000 +0000
++++ psmisc-23.0/src/peekfd.c 2017-06-28 10:15:18.635344983 +0000
+@@ -233,11 +233,11 @@
+ if (WIFSTOPPED(status)) {
+ #ifdef PPC
+ struct pt_regs regs;
+- regs.gpr[0] = ptrace(PTRACE_PEEKUSER, pid, __WORDSIZE/8 * PT_R0, 0);
+- regs.gpr[3] = ptrace(PTRACE_PEEKUSER, pid, __WORDSIZE/8 * PT_R3, 0);
+- regs.gpr[4] = ptrace(PTRACE_PEEKUSER, pid, __WORDSIZE/8 * PT_R4, 0);
+- regs.gpr[5] = ptrace(PTRACE_PEEKUSER, pid, __WORDSIZE/8 * PT_R5, 0);
+- regs.orig_gpr3 = ptrace(PTRACE_PEEKUSER, pid, __WORDSIZE/8 * PT_ORIG_R3, 0);
++ regs.gpr[0] = ptrace(PTRACE_PEEKUSER, pid, sizeof(void *) * PT_R0, 0);
++ regs.gpr[3] = ptrace(PTRACE_PEEKUSER, pid, sizeof(void *) * PT_R3, 0);
++ regs.gpr[4] = ptrace(PTRACE_PEEKUSER, pid, sizeof(void *) * PT_R4, 0);
++ regs.gpr[5] = ptrace(PTRACE_PEEKUSER, pid, sizeof(void *) * PT_R5, 0);
++ regs.orig_gpr3 = ptrace(PTRACE_PEEKUSER, pid, sizeof(void *) * PT_ORIG_R3, 0);
+ #elif defined(ARM)
+ struct pt_regs regs;
+ ptrace(PTRACE_GETREGS, pid, 0, &regs);
diff --git a/system/psmisc/musl_ptregs.patch b/system/psmisc/musl_ptregs.patch
new file mode 100644
index 000000000..29fee6a2a
--- /dev/null
+++ b/system/psmisc/musl_ptregs.patch
@@ -0,0 +1,20 @@
+Author: Breno Leitao <brenohl@br.ibm.com>
+Date: Thu Apr 6 14:03:00 2017 -0300
+
+ peekfd: Avoid pt_regs clash
+
+Index: psmisc-22.21/src/peekfd.c
+===================================================================
+--- a/src/peekfd.c.old
++++ b/src/peekfd.c
+@@ -27,7 +27,9 @@
+ #include <sys/types.h>
+ #include <sys/wait.h>
+ #include <sys/syscall.h>
++#define pt_regs uapi_pt_regs
+ #include <asm/ptrace.h>
++#undef pt_regs
+ #include <byteswap.h>
+ #include <endian.h>
+ #include <sys/user.h>
+
diff --git a/system/readline/APKBUILD b/system/readline/APKBUILD
new file mode 100644
index 000000000..d825c0c42
--- /dev/null
+++ b/system/readline/APKBUILD
@@ -0,0 +1,71 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=readline
+pkgver=7.0.003
+pkgrel=0
+_myver=${pkgver%.*}
+pkgdesc="GNU readline library"
+url="https://cnswww.cns.cwru.edu/php/chet/readline/rltop.html"
+arch="all"
+options="!check"
+license="GPL"
+depends=
+makedepends_host="ncurses-dev"
+subpackages="$pkgname-dev $pkgname-doc libhistory"
+source="http://ftp.gnu.org/gnu/$pkgname/$pkgname-$_myver.tar.gz
+ fix-ncurses-underlinking.patch
+ "
+
+for _patch in $(seq -w 001 ${pkgver##*.}); do
+ _name=$pkgname${_myver//./}-$_patch
+ source="$source $_name.diff::http://ftp.gnu.org/gnu/$pkgname/$pkgname-$_myver-patches/$_name"
+done
+
+builddir="$srcdir/$pkgname-$_myver"
+
+prepare() {
+ local i
+ cd "$builddir"
+ for i in $source; do
+ case ${i%::*} in
+ *.diff) msg ${i#*::}; patch -p0 -i "$srcdir"/${i%::*} || return 1;;
+ esac
+ done
+ default_prepare || return 1
+ update_config_sub
+}
+
+build() {
+ cd "$builddir"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ --enable-static \
+ --enable-shared \
+ || return 1
+ make || return 1
+}
+
+package() {
+ make -C "$builddir" DESTDIR="$pkgdir" install || return 1
+ # verfy that its not underlinked as upstream designed it
+ if ! readelf -d "$pkgdir"/usr/lib/libreadline.so | grep 'NEEDED.*ncurses'; then
+ error "readline needs to be linked against ncurses"
+ return 1
+ fi
+ rmdir "$pkgdir"/usr/bin
+}
+
+libhistory() {
+ pkgdesc="GNU History Library"
+ mkdir -p "$subpkgdir"/usr/lib || return 1
+ mv "$pkgdir"/usr/lib/$subpkgname.* "$subpkgdir"/usr/lib || return 1
+}
+
+sha512sums="18243189d39bf0d4c8a76cddcce75243c1bae8824c686e9b6ba352667607e5b10c5feb79372a1093c1c388d821841670702e940df12eae94bcebdeed90047870 readline-7.0.tar.gz
+325dcf74e9f463a74fb116cb6f3ff8d9708dbec24b423a778eeda3a5ac4fe6df131e0e99d034053ad356b01502894ecc8facc09160d4c29b2291bd95cff6b635 fix-ncurses-underlinking.patch
+4402186905af8cd42c609d640c2e13b9ad61c7778e5a3fd2c2d9da301f0deab05b04d7836f31527262f44f406517823dbb18cb07f2c73931186c806b494699ec readline70-001.diff
+13d1489578508d4d2c3a1618024198a709dbce74a6bbf0f6d7ec67d2419c55bfec9f0ca9de0ed93f129d21d5c3a94307ccdc49408455bbb301c5e3a772b03185 readline70-002.diff
+eaf962a1480eb3870519017b81ecc5cef171e4c41fcf8c17da61ccbfd0379ed6bca85c17b03e2207ae4d51509f33fd010294c75f4bd0433a52118015d4160385 readline70-003.diff"
diff --git a/system/readline/fix-ncurses-underlinking.patch b/system/readline/fix-ncurses-underlinking.patch
new file mode 100644
index 000000000..2c3c823d3
--- /dev/null
+++ b/system/readline/fix-ncurses-underlinking.patch
@@ -0,0 +1,11 @@
+--- ./shlib/Makefile.in.orig
++++ ./shlib/Makefile.in
+@@ -86,7 +86,7 @@
+ SHOBJ_LIBS = @SHOBJ_LIBS@
+
+ SHLIB_XLDFLAGS = @LDFLAGS@ @SHLIB_XLDFLAGS@
+-SHLIB_LIBS = @SHLIB_LIBS@
++SHLIB_LIBS = @SHLIB_LIBS@ -lncursesw
+
+ SHLIB_DOT = @SHLIB_DOT@
+ SHLIB_LIBPREF = @SHLIB_LIBPREF@
diff --git a/system/shadow/APKBUILD b/system/shadow/APKBUILD
new file mode 100644
index 000000000..13dc98d7a
--- /dev/null
+++ b/system/shadow/APKBUILD
@@ -0,0 +1,110 @@
+# Contributor: William Pitcock <nenolod@dereferenced.org>
+# Contributor: Jakub Jirutka <jakub@jirutka.cz>
+# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
+pkgname=shadow
+pkgver=4.5
+pkgrel=0
+pkgdesc="PAM-using login and passwd utilities (usermod, useradd, ...)"
+url="http://pkg-shadow.alioth.debian.org/"
+arch="all"
+license="GPL"
+depends=""
+makedepends="linux-pam-dev"
+subpackages="$pkgname-doc $pkgname-dbg $pkgname-uidmap"
+source="https://github.com/shadow-maint/shadow/releases/download/$pkgver/shadow-$pkgver.tar.xz
+ login.pamd
+ dots-in-usernames.patch
+ useradd-usergroups.patch
+ pam-useradd.patch
+ "
+# secfixes:
+# 4.5-r0:
+# - CVE-2017-12424
+# 4.2.1-r11:
+# - CVE-2017-2616
+# 4.2.1-r7:
+# - CVE-2016-6252
+
+options="suid"
+builddir="$srcdir/shadow-$pkgver"
+
+build() {
+ cd "$builddir"
+
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --target=$CTARGET \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ --localstatedir=/var \
+ --disable-nls \
+ --with-libpam \
+ --without-audit \
+ --without-selinux \
+ --without-acl \
+ --without-attr \
+ --without-tcb \
+ --without-nscd \
+ --without-group-name-max-length \
+ || return 1
+ make || return 1
+}
+
+check() {
+ cd "$builddir"
+ make check
+}
+
+package() {
+ cd "$builddir"
+
+ make DESTDIR="$pkgdir" install || return 1
+
+ # Do not install these pam.d files they are broken and outdated.
+ rm "$pkgdir"/etc/pam.d/* || return 1
+
+ # install some pam.d files based on a patched useradd
+ for pamf in groupadd groupdel groupmems groupmod \
+ useradd userdel usermod
+ do
+ install -m0644 etc/pam.d/useradd \
+ "$pkgdir/etc/pam.d/$pamf" || return 1
+ done
+ # nologin is provided by util-linux.
+ rm "$pkgdir"/sbin/nologin || return 1
+
+ # However, install our own for login.
+ cp "$srcdir"/login.pamd "$pkgdir"/etc/pam.d/login || return 1
+
+ # /etc/login.defs is not very useful - replace it with an *almost* blank file.
+ rm "$pkgdir"/etc/login.defs
+ echo "USERGROUPS_ENAB yes" > "$pkgdir"/etc/login.defs
+
+ # Avoid conflict with man-pages.
+ rm "$pkgdir"/usr/share/man/man3/getspnam.3* \
+ "$pkgdir"/usr/share/man/man5/passwd.5* || return 1
+}
+
+uidmap() {
+ pkgdesc="Utilities for using subordinate UIDs and GIDs"
+
+ mkdir -p "$subpkgdir"
+ cd "$subpkgdir"
+
+ mkdir -p usr/bin
+ mv "$pkgdir"/usr/bin/new*idmap usr/bin/ || return 1
+ chmod 4711 usr/bin/new*idmap || return 1
+
+ # Used e.g. for unprivileged LXC containers.
+ mkdir etc
+ touch etc/subuid etc/subgid
+}
+
+sha512sums="e57f8db54df23301c229d4be30d4cbb67efa1d1809cffcff79adc480b6019fb2b5fd09e112e82a3f00ad5a6b2994592adac93f70a631cf666b6f4723b61c87b5 shadow-4.5.tar.xz
+46a6f83f3698e101b58b8682852da749619412f75dfa85cecad03d0847f6c3dc452d984510db7094220e4570a0565b83b0556e16198ad894a3ec84b3e513d58d login.pamd
+745eea04c054226feba165b635dbb8570b8a04537d41e914400a4c54633c3a9cf350da0aabfec754fb8cf3e58fc1c8cf597b895506312f19469071760c11f31d dots-in-usernames.patch
+49f1d5ded82d2d479805c77d7cc6274c30233596e375b28306b31a33f8fbfc3611dbc77d606081b8300247908c267297dbb6c5d1a30d56095dda53c6a636fb56 useradd-usergroups.patch
+0b4587e263cb6be12fa5ae6bc3b3fc4d3696dae355bc67d085dc58c52ff96edb4d163b95db2092b8c2f3310839430cac03c7af356641b42e24ee4aa6410f5cf1 pam-useradd.patch"
diff --git a/system/shadow/dots-in-usernames.patch b/system/shadow/dots-in-usernames.patch
new file mode 100644
index 000000000..b684c9d02
--- /dev/null
+++ b/system/shadow/dots-in-usernames.patch
@@ -0,0 +1,11 @@
+--- shadow-4.1.3/libmisc/chkname.c
++++ shadow-4.1.3/libmisc/chkname.c
+@@ -66,6 +66,7 @@
+ ( ('0' <= *name) && ('9' >= *name) ) ||
+ ('_' == *name) ||
+ ('-' == *name) ||
++ ('.' == *name) ||
+ ( ('$' == *name) && ('\0' == *(name + 1)) )
+ )) {
+ return false;
+
diff --git a/system/shadow/login.pamd b/system/shadow/login.pamd
new file mode 100644
index 000000000..ad4555809
--- /dev/null
+++ b/system/shadow/login.pamd
@@ -0,0 +1,6 @@
+# /bin/login opens an interactive session.
+
+auth include base-auth
+account include base-account
+password include base-password
+session include base-session
diff --git a/system/shadow/pam-useradd.patch b/system/shadow/pam-useradd.patch
new file mode 100644
index 000000000..71a1bcd25
--- /dev/null
+++ b/system/shadow/pam-useradd.patch
@@ -0,0 +1,9 @@
+--- a/etc/pam.d/useradd
++++ b/etc/pam.d/useradd
+@@ -1,4 +1,4 @@
+ #%PAM-1.0
+ auth sufficient pam_rootok.so
+-account required pam_permit.so
+-password include system-auth
++account include base-account
++password include base-password
diff --git a/system/shadow/useradd-usergroups.patch b/system/shadow/useradd-usergroups.patch
new file mode 100644
index 000000000..adf297231
--- /dev/null
+++ b/system/shadow/useradd-usergroups.patch
@@ -0,0 +1,8 @@
+--- a/etc/useradd
++++ b/etc/useradd
+@@ -1,5 +1,4 @@
+ # useradd defaults file
+-GROUP=1000
+ HOME=/home
+ INACTIVE=-1
+ EXPIRE=
diff --git a/system/sharutils/APKBUILD b/system/sharutils/APKBUILD
new file mode 100644
index 000000000..5aa36a130
--- /dev/null
+++ b/system/sharutils/APKBUILD
@@ -0,0 +1,41 @@
+# Contributor: A. Wilcox <awilfox@adelielinux.org>
+# Maintainer: A. Wilcox <awilfox@adelielinux.org>
+
+pkgname=sharutils
+pkgver=4.15.2
+pkgrel=0
+pkgdesc="Utilities for manipulating shell archives"
+url="https://www.gnu.org/software/sharutils/"
+arch="all"
+license="GPL-3.0+"
+depends="bzip2"
+makedepends_build="texinfo"
+makedepends_host="gettext-dev"
+subpackages="$pkgname-lang $pkgname-doc"
+source="https://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.xz"
+
+build() {
+ cd "$builddir"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ --localstatedir=/var
+ make
+}
+
+check() {
+ cd "$builddir"
+ make check
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install || return 1
+ rm "$pkgdir"/usr/lib/charset.alias
+}
+
+sha512sums="80d0b804a0617e11e5c23dc0d59b218bbf93e40aaf5e9a5401a18ef9cb700390aab711e2b2e2f26c8fd5b8ef99a91d3405e01d02cadabcba7639979314e59f8d sharutils-4.15.2.tar.xz"
diff --git a/system/sysklogd/APKBUILD b/system/sysklogd/APKBUILD
new file mode 100644
index 000000000..3e15a8444
--- /dev/null
+++ b/system/sysklogd/APKBUILD
@@ -0,0 +1,60 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=sysklogd
+pkgver=1.5.1
+pkgrel=1
+pkgdesc="System and kernel log daemons"
+url="http://www.infodrom.org/projects/sysklogd/"
+arch="all"
+license="GPL BSD"
+subpackages="$pkgname-doc"
+depends=""
+makedepends="linux-headers"
+options="!check" # requires kernel sources to build oops.ko
+source="http://www.infodrom.org/projects/$pkgname/download/$pkgname-$pkgver.tar.gz
+ sysklogd.logrotate
+ sysklogd.daily
+ sysklogd.initd
+ sysklogd.confd
+ sysklogd-1.4.2-caen-owl-klogd-drop-root.patch
+ sysklogd-1.4.2-caen-owl-syslogd-bind.patch
+ sysklogd-1.4.2-caen-owl-syslogd-drop-root.patch
+ sysklogd-1.5-build.patch
+ ksym-fclose-fix.patch
+ fix-includes.patch
+ syslog.conf
+ LICENSE"
+
+builddir="$srcdir"/$pkgname-$pkgver
+build() {
+ cd "$builddir"
+ make CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE"
+}
+
+package() {
+ cd "$builddir"
+ make INSTALL="install -D" prefix="$pkgdir" install
+
+ install -D -m644 "$srcdir"/sysklogd.logrotate \
+ "$pkgdir"/etc/logrotate.d/sysklogd
+ install -D -m755 "$srcdir"/sysklogd.daily \
+ "$pkgdir"/etc/periodic/daily/sysklogd
+ install -D -m755 "$srcdir"/sysklogd.initd "$pkgdir"/etc/init.d/sysklogd
+ install -D -m644 "$srcdir"/sysklogd.confd "$pkgdir"/etc/conf.d/sysklogd
+ install -D -m644 "$srcdir"/syslog.conf "$pkgdir"/etc/syslog.conf
+ install -D -m644 "$srcdir"/LICENSE \
+ "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
+}
+
+sha512sums="a72196a1a172d25be1c4791ef6256fe71fa2ba8c1383d230e646e93f8a65c3a57c535189726325da4c792fdb2e9cb119bba43c878816a8e78e78189fd32b12b7 sysklogd-1.5.1.tar.gz
+d82caedfa61bfefc0162e5c416ff75a5cd8f60abe1cf8a3c5c4e7775aeb7bb64e712c783031659d3793378c8753578adf73ef79aac6a0e7cfbc5bbba5a74bd81 sysklogd.logrotate
+87a95d612b9841a022c91a219ff4f69f57badb7f84178f06fc8abec242df948540582f27146b34c6ce730a451ddfc5195b24237cd70c70896ef040148789dd20 sysklogd.daily
+eb4c2c411d75315e113efe40c8445dd2eb7aa88e3318ce3d7624916005ec82325a877c83f5816231fc25d5103ac5be1fc58a4d9593b99fea24c87805abd03039 sysklogd.initd
+4553d85e93fb07e7d4a6ed0b47a3ea2044a5605adaac05223724c32a60bb8ae96d99ca95965c3931640beef234e976c1141b83f603aa8c6e8aca1dec20ca807c sysklogd.confd
+1a5cf4a5dec3ecaa8258110820b64d6a8e1e768e841a3f0ade8d7827b91e73c2d8a49a9d8b74566373133627af88dd46d14e83ae1940a0b2e6cd6fe8710a7e7a sysklogd-1.4.2-caen-owl-klogd-drop-root.patch
+995c240fc54681445f68f7681173e1e1860aaab309edc8ac3531881c63c8889f009a7fd622d37145e80fe187410b80c28554140d6a6660134ca87a1c8d13570d sysklogd-1.4.2-caen-owl-syslogd-bind.patch
+87865e069f9c78990660cf29a37ba1ded7cc078ea8f05af63fc6068c470d1881181387477dccb830d96af05f352959181619380d61afccf3a11d213372e68852 sysklogd-1.4.2-caen-owl-syslogd-drop-root.patch
+ab979b36f091c62ada916246723cd75a71319a6c3687c034167b9caafc53807e6d224e0d6c836bc4b81b61c1d02ec21a1cb19477396a416c62f097d4b9ccc678 sysklogd-1.5-build.patch
+ceb1f7cb70f526dd285fc8bad5511cdef603fc1296f69cc0e7ec4901f11685fae083d028687765b233ca074dfbe0cdafa921de6c80a5cbced94de1059d9761ee ksym-fclose-fix.patch
+0208662a0158ecb6b0a387bd1bf467c866105dac02767209aeaaaeb02762d6c2b814a2707315f8f6cd40f46c4b7744b74653e30973c31354998c27cd7c966dbd fix-includes.patch
+49f73b8a16b92d0cda56db9cfc16d5322e797590dfc998282a62560d54205042af953837f5f94b45a3de403fdf5f63efe65d72e9908c7185a2cd5941275abf33 syslog.conf
+7b3de1d38b50df14ceaada900f2e8f23b0d5035278c9eacb06d2578ccdcf64ffc44bbb76ed6a10d80f4b883bf36a3ecd2bf60897321e4eae7aed7d8a5a36d86c LICENSE"
diff --git a/system/sysklogd/LICENSE b/system/sysklogd/LICENSE
new file mode 100644
index 000000000..7e9b5d59c
--- /dev/null
+++ b/system/sysklogd/LICENSE
@@ -0,0 +1,16 @@
+/*
+ * Copyright (c) 1983, 1988 Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that the above copyright notice and this paragraph are
+ * duplicated in all such forms and that any documentation,
+ * advertising materials, and other materials related to such
+ * distribution and use acknowledge that the software was developed
+ * by the University of California, Berkeley. The name of the
+ * University may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ */
diff --git a/system/sysklogd/fix-includes.patch b/system/sysklogd/fix-includes.patch
new file mode 100644
index 000000000..d15baf5c3
--- /dev/null
+++ b/system/sysklogd/fix-includes.patch
@@ -0,0 +1,122 @@
+--- sysklogd-1.5.orig/klogd.c
++++ sysklogd-1.5/klogd.c
+@@ -260,11 +260,8 @@
+ #include <unistd.h>
+ #include <signal.h>
+ #include <errno.h>
+-#include <sys/fcntl.h>
++#include <fcntl.h>
+ #include <sys/stat.h>
+-#if !defined(__GLIBC__)
+-#include <linux/time.h>
+-#endif /* __GLIBC__ */
+ #include <stdarg.h>
+ #include <paths.h>
+ #include <stdlib.h>
+@@ -279,13 +276,8 @@
+
+ #define __LIBRARY__
+ #include <linux/unistd.h>
+-#if !defined(__GLIBC__)
+-# define __NR_ksyslog __NR_syslog
+-_syscall3(int,ksyslog,int, type, char *, buf, int, len);
+-#else
+ #include <sys/klog.h>
+ #define ksyslog klogctl
+-#endif
+
+ #define LOG_BUFFER_SIZE 4096
+ #define LOG_LINE_LENGTH 1000
+--- sysklogd-1.5.orig/ksym_mod.c
++++ sysklogd-1.5/ksym_mod.c
+@@ -113,12 +113,9 @@
+ #include <unistd.h>
+ #include <signal.h>
+ #include <errno.h>
+-#include <sys/fcntl.h>
++#include <fcntl.h>
+ #include <sys/stat.h>
+ #include "module.h"
+-#if !defined(__GLIBC__)
+-#include <linux/time.h>
+-#endif /* __GLIBC__ */
+ #include <stdarg.h>
+ #include <paths.h>
+ #include <linux/version.h>
+--- sysklogd-1.5.orig/pidfile.c
++++ sysklogd-1.5/pidfile.c
+@@ -25,6 +25,7 @@
+ */
+
+ #include <stdio.h>
++#include <fcntl.h>
+ #include <unistd.h>
+ #include <sys/stat.h>
+ #include <sys/file.h>
+--- sysklogd-1.5.orig/syslog.c
++++ sysklogd-1.5/syslog.c
+@@ -55,7 +55,6 @@
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <sys/file.h>
+-#include <sys/signal.h>
+ #include <sys/syslog.h>
+ #if 0
+ #include "syslog.h"
+@@ -64,6 +63,8 @@
+
+ #include <sys/uio.h>
+ #include <sys/wait.h>
++#include <signal.h>
++#include <fcntl.h>
+ #include <netdb.h>
+ #include <string.h>
+ #include <time.h>
+--- sysklogd-1.5.orig/syslogd.c
++++ sysklogd-1.5/syslogd.c
+@@ -519,9 +519,9 @@
+ #include <time.h>
+
+ #define SYSLOG_NAMES
++#include <errno.h>
+ #include <sys/syslog.h>
+ #include <sys/param.h>
+-#include <sys/errno.h>
+ #include <sys/ioctl.h>
+ #include <sys/stat.h>
+ #include <sys/wait.h>
+@@ -823,9 +823,7 @@
+ void init();
+ void cfline(char *line, register struct filed *f);
+ int decode(char *name, struct code *codetab);
+-#if defined(__GLIBC__)
+ #define dprintf mydprintf
+-#endif /* __GLIBC__ */
+ static void dprintf(char *, ...);
+ static void allocate_log(void);
+ void sighup_handler();
+@@ -860,15 +858,9 @@
+ register char *p;
+ #ifndef TESTING
+ ssize_t msglen;
+-#endif
+-#if !defined(__GLIBC__)
+- int len, num_fds;
+-#else /* __GLIBC__ */
+-#ifndef TESTING
+ socklen_t len;
+ #endif
+ int num_fds;
+-#endif /* __GLIBC__ */
+ /*
+ * It took me quite some time to figure out how this is
+ * supposed to work so I guess I should better write it down.
+@@ -2126,7 +2118,7 @@
+ (void) signal(SIGCHLD, reapchild); /* reset signal handler -ASP */
+ wait ((int *)0);
+ #else
+- union wait status;
++ int status;
+
+ while (wait3(&status, WNOHANG, (struct rusage *) NULL) > 0)
+ ;
diff --git a/system/sysklogd/ksym-fclose-fix.patch b/system/sysklogd/ksym-fclose-fix.patch
new file mode 100644
index 000000000..a1b3401e2
--- /dev/null
+++ b/system/sysklogd/ksym-fclose-fix.patch
@@ -0,0 +1,12 @@
+Index: sysklogd-1.5/ksym_mod.c
+===================================================================
+--- sysklogd-1.5.orig/ksym_mod.c 2009-08-04 09:47:53.000000000 +0300
++++ sysklogd-1.5/ksym_mod.c 2009-08-04 09:48:05.000000000 +0300
+@@ -189,7 +189,6 @@
+ else
+ Syslog(LOG_ERR, "Error loading kernel symbols " \
+ "- %s\n", strerror(errno));
+- fclose(ksyms);
+ return(0);
+ }
+
diff --git a/system/sysklogd/sysklogd-1.4.2-caen-owl-klogd-drop-root.patch b/system/sysklogd/sysklogd-1.4.2-caen-owl-klogd-drop-root.patch
new file mode 100644
index 000000000..40b8817d4
--- /dev/null
+++ b/system/sysklogd/sysklogd-1.4.2-caen-owl-klogd-drop-root.patch
@@ -0,0 +1,162 @@
+http://cvsweb.openwall.com/cgi/cvsweb.cgi/~checkout~/Owl/packages/sysklogd/sysklogd-1.4.2-caen-owl-klogd-drop-root.diff?rev=1.2;content-type=text%2Fplain
+diff -upk.orig sysklogd-1.4.2.orig/klogd.8 sysklogd-1.4.2/klogd.8
+--- sysklogd-1.4.2.orig/klogd.8 2005-03-11 16:12:09 +0000
++++ sysklogd-1.4.2/klogd.8 2005-08-18 14:37:47 +0000
+@@ -18,6 +19,12 @@ klogd \- Kernel Log Daemon
+ .RB [ " \-f "
+ .I fname
+ ]
++.RB [ " \-u "
++.I username
++]
++.RB [ " \-j "
++.I chroot_dir
++]
+ .RB [ " \-iI " ]
+ .RB [ " \-n " ]
+ .RB [ " \-o " ]
+@@ -53,6 +60,20 @@ stderr.
+ .BI "\-f " file
+ Log messages to the specified filename rather than to the syslog facility.
+ .TP
++.BI "\-u " username
++Tells klogd to become the specified user and drop root privileges before
++starting logging.
++.TP
++.BI "\-j " chroot_dir
++Tells klogd to
++.BR chroot (2)
++into this directory after initializing.
++This option is only valid if the \-u option is also used to run klogd
++without root privileges.
++Note that the use of this option will prevent \-i and \-I from working
++unless you set up the chroot directory in such a way that klogd can still
++read the kernel module symbols.
++.TP
+ .BI "\-i \-I"
+ Signal the currently executing klogd daemon. Both of these switches control
+ the loading/reloading of symbol information. The \-i switch signals the
+diff -upk.orig sysklogd-1.4.2.orig/klogd.c sysklogd-1.4.2/klogd.c
+--- sysklogd-1.4.2.orig/klogd.c 2005-08-18 12:29:52 +0000
++++ sysklogd-1.4.2/klogd.c 2005-08-18 14:37:47 +0000
+@@ -261,6 +261,8 @@
+ #include <stdarg.h>
+ #include <paths.h>
+ #include <stdlib.h>
++#include <pwd.h>
++#include <grp.h>
+ #include "klogd.h"
+ #include "ksyms.h"
+ #ifndef TESTING
+@@ -315,6 +317,9 @@ static enum LOGSRC {none, proc, kernel}
+ int debugging = 0;
+ int symbols_twice = 0;
+
++char *server_user = NULL;
++char *chroot_dir = NULL;
++int log_flags = 0;
+
+ /* Function prototypes. */
+ extern int ksyslog(int type, char *buf, int len);
+@@ -535,8 +540,9 @@ static enum LOGSRC GetKernelLogSrc(void)
+ * First do a stat to determine whether or not the proc based
+ * file system is available to get kernel messages from.
+ */
+- if ( use_syscall ||
+- ((stat(_PATH_KLOG, &sb) < 0) && (errno == ENOENT)) )
++ if (!server_user &&
++ (use_syscall ||
++ ((stat(_PATH_KLOG, &sb) < 0) && (errno == ENOENT))))
+ {
+ /* Initialize kernel logging. */
+ ksyslog(1, NULL, 0);
+@@ -983,6 +989,27 @@ static void LogProcLine(void)
+ }
+
+
++static int drop_root(void)
++{
++ struct passwd *pw;
++
++ if (!(pw = getpwnam(server_user))) return -1;
++
++ if (!pw->pw_uid) return -1;
++
++ if (chroot_dir) {
++ if (chdir(chroot_dir)) return -1;
++ if (chroot(".")) return -1;
++ }
++
++ if (setgroups(0, NULL)) return -1;
++ if (setgid(pw->pw_gid)) return -1;
++ if (setuid(pw->pw_uid)) return -1;
++
++ return 0;
++}
++
++
+ int main(argc, argv)
+
+ int argc;
+@@ -1000,7 +1027,7 @@ int main(argc, argv)
+ chdir ("/");
+ #endif
+ /* Parse the command-line. */
+- while ((ch = getopt(argc, argv, "c:df:iIk:nopsvx2")) != EOF)
++ while ((ch = getopt(argc, argv, "c:df:u:j:iIk:nopsvx2")) != EOF)
+ switch((char)ch)
+ {
+ case '2': /* Print lines with symbols twice. */
+@@ -1022,6 +1049,10 @@ int main(argc, argv)
+ case 'I':
+ SignalDaemon(SIGUSR2);
+ return(0);
++ case 'j': /* chroot 'j'ail */
++ chroot_dir = optarg;
++ log_flags |= LOG_NDELAY;
++ break;
+ case 'k': /* Kernel symbol file. */
+ symfile = optarg;
+ break;
+@@ -1037,6 +1068,9 @@ int main(argc, argv)
+ case 's': /* Use syscall interface. */
+ use_syscall = 1;
+ break;
++ case 'u': /* Run as this user */
++ server_user = optarg;
++ break;
+ case 'v':
+ printf("klogd %s.%s\n", VERSION, PATCHLEVEL);
+ exit (1);
+@@ -1045,6 +1079,10 @@ int main(argc, argv)
+ break;
+ }
+
++ if (chroot_dir && !server_user) {
++ fputs("'-j' is only valid with '-u'\n", stderr);
++ exit(1);
++ }
+
+ /* Set console logging level. */
+ if ( log_level != (char *) 0 )
+@@ -1158,7 +1196,7 @@ int main(argc, argv)
+ }
+ }
+ else
+- openlog("kernel", 0, LOG_KERN);
++ openlog("kernel", log_flags, LOG_KERN);
+
+
+ /* Handle one-shot logging. */
+@@ -1191,6 +1229,11 @@ int main(argc, argv)
+ }
+ }
+
++ if (server_user && drop_root()) {
++ syslog(LOG_ALERT, "klogd: failed to drop root");
++ Terminate();
++ }
++
+ /* The main loop. */
+ while (1)
+ {
diff --git a/system/sysklogd/sysklogd-1.4.2-caen-owl-syslogd-bind.patch b/system/sysklogd/sysklogd-1.4.2-caen-owl-syslogd-bind.patch
new file mode 100644
index 000000000..ad311a512
--- /dev/null
+++ b/system/sysklogd/sysklogd-1.4.2-caen-owl-syslogd-bind.patch
@@ -0,0 +1,103 @@
+http://cvsweb.openwall.com/cgi/cvsweb.cgi/~checkout~/Owl/packages/sysklogd/sysklogd-1.4.2-caen-owl-syslogd-bind.diff?rev=1.1;content-type=text%2Fplain
+diff -upk.orig sysklogd-1.4.2.orig/sysklogd.8 sysklogd-1.4.2/sysklogd.8
+--- sysklogd-1.4.2.orig/sysklogd.8 2004-07-09 17:33:32 +0000
++++ sysklogd-1.4.2/sysklogd.8 2005-08-18 14:40:25 +0000
+@@ -15,6 +15,9 @@ sysklogd \- Linux system logging utiliti
+ .I config file
+ ]
+ .RB [ " \-h " ]
++.RB [ " \-i "
++.I IP address
++]
+ .RB [ " \-l "
+ .I hostlist
+ ]
+@@ -104,6 +107,13 @@ Specifying this switch on the command li
+ This can cause syslog loops that fill up hard disks quite fast and
+ thus needs to be used with caution.
+ .TP
++.BI "\-i " "IP address"
++If
++.B syslogd
++is configured to accept log input from a UDP port, specify an IP address
++to bind to, rather than the default of INADDR_ANY. The address must be in
++dotted quad notation, DNS host names are not allowed.
++.TP
+ .BI "\-l " "hostlist"
+ Specify a hostname that should be logged only with its simple hostname
+ and not the fqdn. Multiple hosts may be specified using the colon
+diff -upk.orig sysklogd-1.4.2.orig/syslogd.c sysklogd-1.4.2/syslogd.c
+--- sysklogd-1.4.2.orig/syslogd.c 2005-08-18 14:33:22 +0000
++++ sysklogd-1.4.2/syslogd.c 2005-08-18 14:40:25 +0000
+@@ -774,6 +774,8 @@ char **LocalHosts = NULL; /* these hosts
+ int NoHops = 1; /* Can we bounce syslog messages through an
+ intermediate host. */
+
++char *bind_addr = NULL; /* bind UDP port to this interface only */
++
+ extern int errno;
+
+ /* Function prototypes. */
+@@ -878,7 +880,7 @@ int main(argc, argv)
+ funix[i] = -1;
+ }
+
+- while ((ch = getopt(argc, argv, "a:dhf:l:m:np:rs:v")) != EOF)
++ while ((ch = getopt(argc, argv, "a:dhf:i:l:m:np:rs:v")) != EOF)
+ switch((char)ch) {
+ case 'a':
+ if (nfunix < MAXFUNIX)
+@@ -895,9 +897,17 @@ int main(argc, argv)
+ case 'h':
+ NoHops = 0;
+ break;
++ case 'i':
++ if (bind_addr) {
++ fprintf(stderr, "Only one -i argument allowed, "
++ "the first one is taken.\n");
++ break;
++ }
++ bind_addr = optarg;
++ break;
+ case 'l':
+ if (LocalHosts) {
+- fprintf (stderr, "Only one -l argument allowed," \
++ fprintf(stderr, "Only one -l argument allowed, "
+ "the first one is taken.\n");
+ break;
+ }
+@@ -1244,7 +1254,7 @@ int main(argc, argv)
+ int usage()
+ {
+ fprintf(stderr, "usage: syslogd [-drvh] [-l hostlist] [-m markinterval] [-n] [-p path]\n" \
+- " [-s domainlist] [-f conffile]\n");
++ " [-s domainlist] [-f conffile] [-i IP address]\n");
+ exit(1);
+ }
+
+@@ -1286,15 +1296,22 @@ static int create_inet_socket()
+ int fd, on = 1;
+ struct sockaddr_in sin;
+
++ memset(&sin, 0, sizeof(sin));
++ sin.sin_family = AF_INET;
++ sin.sin_port = LogPort;
++ if (bind_addr) {
++ if (!inet_aton(bind_addr, &sin.sin_addr)) {
++ logerror("syslog: not a valid IP address to bind to.");
++ return -1;
++ }
++ }
++
+ fd = socket(AF_INET, SOCK_DGRAM, 0);
+ if (fd < 0) {
+ logerror("syslog: Unknown protocol, suspending inet service.");
+ return fd;
+ }
+
+- memset(&sin, 0, sizeof(sin));
+- sin.sin_family = AF_INET;
+- sin.sin_port = LogPort;
+ if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, \
+ (char *) &on, sizeof(on)) < 0 ) {
+ logerror("setsockopt(REUSEADDR), suspending inet");
diff --git a/system/sysklogd/sysklogd-1.4.2-caen-owl-syslogd-drop-root.patch b/system/sysklogd/sysklogd-1.4.2-caen-owl-syslogd-drop-root.patch
new file mode 100644
index 000000000..8c3f571f3
--- /dev/null
+++ b/system/sysklogd/sysklogd-1.4.2-caen-owl-syslogd-drop-root.patch
@@ -0,0 +1,118 @@
+http://cvsweb.openwall.com/cgi/cvsweb.cgi/~checkout~/Owl/packages/sysklogd/sysklogd-1.4.2-caen-owl-syslogd-drop-root.diff?rev=1.1;content-type=text%2Fplain
+diff -upk.orig sysklogd-1.4.2.orig/sysklogd.8 sysklogd-1.4.2/sysklogd.8
+--- sysklogd-1.4.2.orig/sysklogd.8 2005-08-18 14:40:25 +0000
++++ sysklogd-1.4.2/sysklogd.8 2005-08-18 14:41:26 +0000
+@@ -32,6 +32,9 @@ sysklogd \- Linux system logging utiliti
+ .RB [ " \-s "
+ .I domainlist
+ ]
++.RB [ " \-u"
++.IB username
++]
+ .RB [ " \-v " ]
+ .LP
+ .SH DESCRIPTION
+@@ -161,6 +164,19 @@ is specified and the host logging resolv
+ no domain would be cut, you will have to specify two domains like:
+ .BR "\-s north.de:infodrom.north.de" .
+ .TP
++.BI "\-u " "username"
++This causes the
++.B syslogd
++daemon to become the named user before starting up logging.
++
++Note that when this option is in use,
++.B syslogd
++will open all log files as root when the daemon is first started;
++however, after a
++.B SIGHUP
++the files will be reopened as the non-privileged user. You should
++take this into account when deciding the ownership of the log files.
++.TP
+ .B "\-v"
+ Print version and exit.
+ .LP
+diff -upk.orig sysklogd-1.4.2.orig/syslogd.c sysklogd-1.4.2/syslogd.c
+--- sysklogd-1.4.2.orig/syslogd.c 2005-08-18 14:40:25 +0000
++++ sysklogd-1.4.2/syslogd.c 2005-08-18 14:41:26 +0000
+@@ -524,6 +524,10 @@ static char sccsid[] = "@(#)syslogd.c 5.
+ #include <arpa/nameser.h>
+ #include <arpa/inet.h>
+ #include <resolv.h>
++
++#include <pwd.h>
++#include <grp.h>
++
+ #ifndef TESTING
+ #include "pidfile.h"
+ #endif
+@@ -775,6 +779,7 @@ int NoHops = 1; /* Can we bounce syslog
+ intermediate host. */
+
+ char *bind_addr = NULL; /* bind UDP port to this interface only */
++char *server_user = NULL; /* user name to run server as */
+
+ extern int errno;
+
+@@ -827,6 +832,21 @@ static int set_nonblock_flag(int desc)
+ return fcntl(desc, F_SETFL, flags | O_NONBLOCK);
+ }
+
++static int drop_root(void)
++{
++ struct passwd *pw;
++
++ if (!(pw = getpwnam(server_user))) return -1;
++
++ if (!pw->pw_uid) return -1;
++
++ if (initgroups(server_user, pw->pw_gid)) return -1;
++ if (setgid(pw->pw_gid)) return -1;
++ if (setuid(pw->pw_uid)) return -1;
++
++ return 0;
++}
++
+ int main(argc, argv)
+ int argc;
+ char **argv;
+@@ -880,7 +900,7 @@ int main(argc, argv)
+ funix[i] = -1;
+ }
+
+- while ((ch = getopt(argc, argv, "a:dhf:i:l:m:np:rs:v")) != EOF)
++ while ((ch = getopt(argc, argv, "a:dhf:i:l:m:np:rs:u:v")) != EOF)
+ switch((char)ch) {
+ case 'a':
+ if (nfunix < MAXFUNIX)
+@@ -933,6 +953,9 @@ int main(argc, argv)
+ }
+ StripDomains = crunch_list(optarg);
+ break;
++ case 'u':
++ server_user = optarg;
++ break;
+ case 'v':
+ printf("syslogd %s.%s\n", VERSION, PATCHLEVEL);
+ exit (0);
+@@ -1100,6 +1123,11 @@ int main(argc, argv)
+ kill (ppid, SIGTERM);
+ #endif
+
++ if (server_user && drop_root()) {
++ dprintf("syslogd: failed to drop root\n");
++ exit(1);
++ }
++
+ /* Main loop begins here. */
+ for (;;) {
+ int nfds;
+@@ -1254,7 +1282,7 @@ int main(argc, argv)
+ int usage()
+ {
+ fprintf(stderr, "usage: syslogd [-drvh] [-l hostlist] [-m markinterval] [-n] [-p path]\n" \
+- " [-s domainlist] [-f conffile] [-i IP address]\n");
++ " [-s domainlist] [-f conffile] [-i IP address] [-u username]\n");
+ exit(1);
+ }
+
diff --git a/system/sysklogd/sysklogd-1.5-build.patch b/system/sysklogd/sysklogd-1.5-build.patch
new file mode 100644
index 000000000..6175cdfe7
--- /dev/null
+++ b/system/sysklogd/sysklogd-1.5-build.patch
@@ -0,0 +1,20 @@
+respect env CC/CFLAGS/CPPFLAGS/LDFLAGS
+
+--- a/Makefile
++++ b/Makefile
+@@ -17,14 +17,12 @@
+ # along with this program; if not, write to the Free Software
+ # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+-CC= gcc
+ #SKFLAGS= -g -DSYSV -Wall
+ #LDFLAGS= -g
+-SKFLAGS= $(RPM_OPT_FLAGS) -O3 -DSYSV -fomit-frame-pointer -Wall -fno-strength-reduce
++SKFLAGS= $(CFLAGS) $(CPPFLAGS) -DSYSV -Wall -fno-strength-reduce
+ # -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
+ # -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
+ # $(shell getconf LFS_SKFLAGS)
+-LDFLAGS= -s
+
+ # Look where your install program is.
+ INSTALL = /usr/bin/install
diff --git a/system/sysklogd/sysklogd.confd b/system/sysklogd/sysklogd.confd
new file mode 100644
index 000000000..c97357391
--- /dev/null
+++ b/system/sysklogd/sysklogd.confd
@@ -0,0 +1,6 @@
+# Config file for /etc/init.d/sysklogd
+
+SYSLOGD="-m 0"
+# send warnings and above to the console
+KLOGD="-c 3 -2"
+
diff --git a/system/sysklogd/sysklogd.daily b/system/sysklogd/sysklogd.daily
new file mode 100755
index 000000000..725c33e31
--- /dev/null
+++ b/system/sysklogd/sysklogd.daily
@@ -0,0 +1,91 @@
+#!/bin/sh
+# This is a shell script replacement for the sysklogd's logrotate cron script
+# and syslogd-listfiles perl script.
+# Copyright (C) 2008-2015 N. Angelacos for the Alpine Linux project - GPL2
+
+
+CONF="/etc/syslog.conf"
+
+
+syslogd_listfiles() {
+ # List the target files from syslog.conf
+
+ local skip=
+ [ "$1" = "--auth" ] && skip="!"
+
+ # the while loop joins lines that end in "\"
+ # the sed (in order)-
+ # strips comments;
+ # remove empty lines;
+ # collapses spaces/tabs to 1 space;
+ # deletes the "-" in front of the filename;
+ # deletes whitespace before ';'
+ # deletes lines that have/dont have the "auth" facility
+ # deletes the facility (leaving just the filename)
+ # deletes lines that are not filenames with leading "/"
+ # print it
+ while read a ; do echo "$a"; done < $CONF |\
+ sed -nE -e "s/\#.*//" \
+ -e "/^[[:space:]]*$/D" \
+ -e "s/[[:space:]]+/ /g" \
+ -e "s: -/: /:g" \
+ -e "s/ *; */;/" \
+ -e "/^.*(auth)[^ ]* /${skip}D" \
+ -e "s:^.* /:/:" \
+ -e "/^[^\\/]/D" \
+ -e "P" \
+ | sort | uniq
+}
+
+# dumb little savelog - no error checking here
+savelog () {
+ local group="adm"
+ local mode="644"
+ local user="root"
+ local cycle=2
+ local logfile=""
+
+ # parse args
+ while getopts "g:u:m:c:" opt; do
+ case $opt in
+ g) group=$OPTARG ;;
+ u) user=$OPTARG ;;
+ m) mode=$OPTARG ;;
+ c) cycle=$OPTARG ;;
+ *) echo "unknown option: $opt" >&2 && return 1;;
+ esac
+ done
+ shift $(( $OPTIND - 1 ))
+ logfile=$1
+
+ # Cycle the logs
+ while [ $cycle -ne 0 ]; do
+ p=$cycle
+ cycle=$(( $cycle - 1 ))
+ a=$logfile.$cycle*
+ b=$( echo $a | sed "s/\.$cycle/\.$p/")
+ [ -f $a ] && mv $a $b
+ done
+
+ # compress .1 and let .0 be uncompressed
+ [ -f $logfile.1 ] && gzip $logfile.1
+ [ -f $logfile ] && mv $logfile $logfile.0
+
+ # set permissions
+ chown $user:$group $logfile.* 2>/dev/null
+ chmod $mode $logfile.* 2>/dev/null
+}
+
+
+# Main script
+
+for LOG in $( syslogd_listfiles ); do
+ [ -f $LOG ] && savelog -g adm -m 640 -u root -c 7 $LOG
+done
+
+for LOG in $(syslogd_listfiles --auth); do
+ [ -f $LOG ] && savelog -g adm -m 640 -u root -c 7 $LOG
+done
+
+killall -HUP syslogd
+
diff --git a/system/sysklogd/sysklogd.initd b/system/sysklogd/sysklogd.initd
new file mode 100644
index 000000000..c2355f484
--- /dev/null
+++ b/system/sysklogd/sysklogd.initd
@@ -0,0 +1,76 @@
+#!/sbin/openrc-run
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Header: /var/cvsroot/gentoo-x86/app-admin/sysklogd/files/sysklogd.rc7,v 1.1 2011/09/14 22:22:57 polynomial-c Exp $
+
+extra_started_commands="reload"
+
+depend() {
+ need clock hostname localmount
+ before net
+ provide logger
+}
+
+start_daemon() {
+ local retval=0
+ local daemon="$1"
+ local options="$2"
+
+ [ -z "${daemon}" ] && return 1
+
+ ebegin "sysklogd -> start: ${daemon}"
+ start-stop-daemon --start --exec /usr/sbin/"${daemon}" \
+ --pidfile /var/run/"${daemon}".pid -- ${options}
+ retval=$?
+ eend ${retval} "Failed to start ${daemon}"
+
+ return ${retval}
+}
+
+stop_daemon() {
+ local retval=0
+ local daemon="$1"
+
+ [ -z "${daemon}" ] && return 1
+
+ ebegin "sysklogd -> stop: ${daemon}"
+ # syslogd can be stubborn some times (--retry 15)...
+ start-stop-daemon --stop --retry 15 --quiet --pidfile /var/run/"${daemon}".pid
+ retval=$?
+ eend ${retval} "Failed to stop ${daemon}"
+
+ return ${retval}
+}
+
+start() {
+ start_daemon "syslogd" "${SYSLOGD}" || return 1
+
+ # klogd do not always start proper if started too early
+ sleep 1
+
+ if ! start_daemon "klogd" "${KLOGD}" ; then
+ stop_daemon "syslogd"
+ return 1
+ fi
+
+ return 0
+}
+
+stop() {
+ stop_daemon "klogd" || return 1
+ stop_daemon "syslogd" || return 1
+ return 0
+}
+
+reload() {
+ local ret=0
+
+ ebegin "Reloading configuration"
+
+ start-stop-daemon --signal HUP --pidfile /var/run/syslogd.pid
+ ret=$((${ret} + $?))
+ start-stop-daemon --signal USR1 --pidfile /var/run/klogd.pid
+ ret=$((${ret} + $?))
+
+ eend ${ret}
+}
diff --git a/system/sysklogd/sysklogd.logrotate b/system/sysklogd/sysklogd.logrotate
new file mode 100644
index 000000000..0fd0be2ff
--- /dev/null
+++ b/system/sysklogd/sysklogd.logrotate
@@ -0,0 +1,6 @@
+# we do logrotatation in a separate cron script that parses syslog.conf
+# and rotates whatever user have configured.
+#
+# That is better than having users to maunally update this logrotate config
+# whenever they touch syslog.conf
+#
diff --git a/system/sysklogd/syslog.conf b/system/sysklogd/syslog.conf
new file mode 100644
index 000000000..aead955cc
--- /dev/null
+++ b/system/sysklogd/syslog.conf
@@ -0,0 +1,48 @@
+# /etc/syslog.conf Configuration file for syslogd.
+#
+# For more information see syslog.conf(5)
+# manpage.
+
+# First some standard logfiles. Log by facility.
+#
+
+auth,authpriv.* /var/log/auth.log
+*.*;auth,authpriv.none -/var/log/syslog
+cron.* /var/log/cron.log
+daemon.* -/var/log/daemon.log
+kern.* -/var/log/kern.log
+lpr.* -/var/log/lpr.log
+mail.* -/var/log/mail.log
+user.* -/var/log/user.log
+
+# Logging for the mail system. Split it up so that
+# it is easy to write scripts to parse these files.
+#
+#mail.info -/var/log/mail.info
+#mail.warning -/var/log/mail.warn
+#mail.err /var/log/mail.err
+
+# Some `catch-all' logfiles.
+#
+*.=debug;\
+ auth,authpriv.none;\
+ news.none;mail.none -/var/log/debug
+*.=info;*.=notice;*.=warning;\
+ auth,authpriv.none;\
+ cron,daemon.none;\
+ mail,news.none -/var/log/messages
+
+#
+# Emergencies are sent to everybody logged in.
+#
+*.emerg *
+
+#
+# I like to have messages displayed on the console, but only on a virtual
+# console I usually leave idle.
+#
+#daemon,mail.*;\
+# news.=crit;news.=err;news.=notice;\
+# *.=debug;*.=info;\
+# *.=notice;*.=warning /dev/tty8
+
diff --git a/system/unzip/10-unzip-handle-pkware-verify.patch b/system/unzip/10-unzip-handle-pkware-verify.patch
new file mode 100644
index 000000000..b373ce07d
--- /dev/null
+++ b/system/unzip/10-unzip-handle-pkware-verify.patch
@@ -0,0 +1,21 @@
+From: Steven Schweda
+Subject: Handle the PKWare verification bit of internal attributes
+Bug-Debian: http://bugs.debian.org/630078
+X-Debian-version: 6.0-5
+
+--- a/process.c
++++ b/process.c
+@@ -1729,6 +1729,13 @@
+ else if (uO.L_flag > 1) /* let -LL force lower case for all names */
+ G.pInfo->lcflag = 1;
+
++ /* Handle the PKWare verification bit, bit 2 (0x0004) of internal
++ attributes. If this is set, then a verification checksum is in the
++ first 3 bytes of the external attributes. In this case all we can use
++ for setting file attributes is the last external attributes byte. */
++ if (G.crec.internal_file_attributes & 0x0004)
++ G.crec.external_file_attributes &= (ulg)0xff;
++
+ /* do Amigas (AMIGA_) also have volume labels? */
+ if (IS_VOLID(G.crec.external_file_attributes) &&
+ (G.pInfo->hostnum == FS_FAT_ || G.pInfo->hostnum == FS_HPFS_ ||
diff --git a/system/unzip/20-unzip-uidgid-fix.patch b/system/unzip/20-unzip-uidgid-fix.patch
new file mode 100644
index 000000000..3a308990e
--- /dev/null
+++ b/system/unzip/20-unzip-uidgid-fix.patch
@@ -0,0 +1,29 @@
+From: sms
+Subject: Restore uid and gid information when requested
+Bug-Debian: http://bugs.debian.org/689212
+X-Debian-version: 6.0-8
+
+--- a/process.c
++++ b/process.c
+@@ -2904,7 +2904,7 @@
+ #ifdef IZ_HAVE_UXUIDGID
+ if (eb_len >= EB_UX3_MINLEN
+ && z_uidgid != NULL
+- && (*((EB_HEADSIZE + 0) + ef_buf) == 1)
++ && (*((EB_HEADSIZE + 0) + ef_buf) == 1))
+ /* only know about version 1 */
+ {
+ uch uid_size;
+@@ -2916,10 +2916,10 @@
+ flags &= ~0x0ff; /* ignore any previous UNIX field */
+
+ if ( read_ux3_value((EB_HEADSIZE + 2) + ef_buf,
+- uid_size, z_uidgid[0])
++ uid_size, &z_uidgid[0])
+ &&
+ read_ux3_value((EB_HEADSIZE + uid_size + 3) + ef_buf,
+- gid_size, z_uidgid[1]) )
++ gid_size, &z_uidgid[1]) )
+ {
+ flags |= EB_UX2_VALID; /* signal success */
+ }
diff --git a/system/unzip/APKBUILD b/system/unzip/APKBUILD
new file mode 100644
index 000000000..07e303361
--- /dev/null
+++ b/system/unzip/APKBUILD
@@ -0,0 +1,43 @@
+# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
+# Maintainer: Timo Teräs <timo.teras@iki.fi>
+pkgname=unzip
+pkgver=6.0
+_pkgver=${pkgver//./}
+pkgrel=2
+pkgdesc="Extract PKZIP-compatible .zip files"
+url="http://www.info-zip.org/UnZip.html"
+arch="all"
+license="custom"
+subpackages="$pkgname-doc"
+options="!check"
+# normally ftp://ftp.info-zip.org/pub/infozip/src/$pkgname$_pkgver.zip
+source="https://dev.alpinelinux.org/archive/unzip/$pkgname$_pkgver.tgz
+ 10-unzip-handle-pkware-verify.patch
+ 20-unzip-uidgid-fix.patch
+ unzip-6.0-heap-overflow-infloop.patch
+ "
+builddir="$srcdir/$pkgname$_pkgver"
+
+build() {
+ cd "$builddir"
+
+ make -f unix/Makefile \
+ CC="${CHOST}-gcc" \
+ LOCAL_ZIP="${CFLAGS} ${CPPFLAGS}" \
+ prefix=/usr generic
+}
+
+package() {
+ cd "$builddir"
+
+ make -f unix/Makefile \
+ MANDIR=${pkgdir}/usr/share/man/man1/ \
+ prefix=${pkgdir}/usr install
+ install -Dm644 LICENSE \
+ "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
+}
+
+sha512sums="0694e403ebc57b37218e00ec1a406cae5cc9c5b52b6798e0d4590840b6cdbf9ddc0d9471f67af783e960f8fa2e620394d51384257dca23d06bcd90224a80ce5d unzip60.tgz
+9d2914f22fb0075a2b6f72825c235f46eafd8d47b6fb6fcc8303fc69336e256b15923c002d2615bb6af733344c2315e4a8504d77bae301e10c11d4736faa2c81 10-unzip-handle-pkware-verify.patch
+57699582e9056af0817dcb67f8db67e6a1ff8208c137fbebcf559429e5f12b471b75d7e1ef938e5bbb5416074a51ac7342e4ce8057f4bbdcb0bf079b8d7832af 20-unzip-uidgid-fix.patch
+b1e3fac6a787828efaaef8ec7cc52e1573aea27a6f29830af37ec4ba8bcd2a6488c953ab10eee0561c78e82c7401833ef172bebee793405d93632ce788756301 unzip-6.0-heap-overflow-infloop.patch"
diff --git a/system/unzip/unzip-6.0-heap-overflow-infloop.patch b/system/unzip/unzip-6.0-heap-overflow-infloop.patch
new file mode 100644
index 000000000..160c512f9
--- /dev/null
+++ b/system/unzip/unzip-6.0-heap-overflow-infloop.patch
@@ -0,0 +1,104 @@
+From bdd4a0cecd745cb4825e4508b5bdf2579731086a Mon Sep 17 00:00:00 2001
+From: Petr Stodulka <pstodulk@redhat.com>
+Date: Mon, 14 Sep 2015 18:23:17 +0200
+Subject: [PATCH 1/3] upstream fix for heap overflow
+
+https://bugzilla.redhat.com/attachment.cgi?id=1073002
+---
+ crypt.c | 12 +++++++++++-
+ 1 file changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/crypt.c b/crypt.c
+index 784e411..a8975f2 100644
+--- a/crypt.c
++++ b/crypt.c
+@@ -465,7 +465,17 @@ int decrypt(__G__ passwrd)
+ GLOBAL(pInfo->encrypted) = FALSE;
+ defer_leftover_input(__G);
+ for (n = 0; n < RAND_HEAD_LEN; n++) {
+- b = NEXTBYTE;
++ /* 2012-11-23 SMS. (OUSPG report.)
++ * Quit early if compressed size < HEAD_LEN. The resulting
++ * error message ("unable to get password") could be improved,
++ * but it's better than trying to read nonexistent data, and
++ * then continuing with a negative G.csize. (See
++ * fileio.c:readbyte()).
++ */
++ if ((b = NEXTBYTE) == (ush)EOF)
++ {
++ return PK_ERR;
++ }
+ h[n] = (uch)b;
+ Trace((stdout, " (%02x)", h[n]));
+ }
+--
+2.4.6
+
+
+From 4b48844661ff9569f2ecf582a387d46a5775b5d8 Mon Sep 17 00:00:00 2001
+From: Kamil Dudka <kdudka@redhat.com>
+Date: Mon, 14 Sep 2015 18:24:56 +0200
+Subject: [PATCH 2/3] fix infinite loop when extracting empty bzip2 data
+
+Bug: https://sourceforge.net/p/infozip/patches/23/
+---
+ extract.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/extract.c b/extract.c
+index 7134bfe..29db027 100644
+--- a/extract.c
++++ b/extract.c
+@@ -2733,6 +2733,12 @@ __GDEF
+ int repeated_buf_err;
+ bz_stream bstrm;
+
++ if (G.incnt <= 0 && G.csize <= 0L) {
++ /* avoid an infinite loop */
++ Trace((stderr, "UZbunzip2() got empty input\n"));
++ return 2;
++ }
++
+ #if (defined(DLL) && !defined(NO_SLIDE_REDIR))
+ if (G.redirect_slide)
+ wsize = G.redirect_size, redirSlide = G.redirect_buffer;
+--
+2.4.6
+
+
+From bd150334fb4084f5555a6be26b015a0671cb5b74 Mon Sep 17 00:00:00 2001
+From: Kamil Dudka <kdudka@redhat.com>
+Date: Tue, 22 Sep 2015 18:52:23 +0200
+Subject: [PATCH 3/3] extract: prevent unsigned overflow on invalid input
+
+Suggested-by: Stefan Cornelius
+---
+ extract.c | 11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/extract.c b/extract.c
+index 29db027..b9ae667 100644
+--- a/extract.c
++++ b/extract.c
+@@ -1257,8 +1257,17 @@ static int extract_or_test_entrylist(__G__ numchunk,
+ if (G.lrec.compression_method == STORED) {
+ zusz_t csiz_decrypted = G.lrec.csize;
+
+- if (G.pInfo->encrypted)
++ if (G.pInfo->encrypted) {
++ if (csiz_decrypted <= 12) {
++ /* handle the error now to prevent unsigned overflow */
++ Info(slide, 0x401, ((char *)slide,
++ LoadFarStringSmall(ErrUnzipNoFile),
++ LoadFarString(InvalidComprData),
++ LoadFarStringSmall2(Inflate)));
++ return PK_ERR;
++ }
+ csiz_decrypted -= 12;
++ }
+ if (G.lrec.ucsize != csiz_decrypted) {
+ Info(slide, 0x401, ((char *)slide,
+ LoadFarStringSmall2(WrnStorUCSizCSizDiff),
+--
+2.5.2
+
diff --git a/system/util-linux/APKBUILD b/system/util-linux/APKBUILD
new file mode 100644
index 000000000..e46543d97
--- /dev/null
+++ b/system/util-linux/APKBUILD
@@ -0,0 +1,169 @@
+# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
+# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=util-linux
+pkgver=2.31
+
+case $pkgver in
+ *.*.*) _v=${pkgver%.*};;
+ *.*) _v=$pkgver;;
+esac
+
+pkgrel=0
+pkgdesc="Random collection of Linux utilities"
+url="http://git.kernel.org/cgit/utils/util-linux/util-linux.git"
+arch="all"
+license="GPL-2.0 GPL-2.0-or-later LGPL-2.0-or-later BSD Public-Domain"
+depends="findmnt"
+makedepends_build="autoconf automake libtool"
+makedepends_host="zlib-dev ncurses-dev linux-headers libcap-ng-dev"
+options="!check suid"
+source="http://www.kernel.org/pub/linux/utils/$pkgname/v${_v}/$pkgname-$pkgver.tar.xz
+ ttydefaults.h
+ "
+subpackages="$pkgname-doc $pkgname-dev $pkgname-bash-completion:bashcomp:noarch
+ libuuid libblkid libmount libsmartcols libfdisk sfdisk cfdisk
+ findmnt:_findmnt mcookie blkid setpriv"
+_bootstrap_config="--without-python"
+makedepends="$makedepends_build $makedepends_host"
+replaces="e2fsprogs util-linux-ng"
+
+builddir="$srcdir/$pkgname-$pkgver"
+prepare() {
+ default_prepare
+
+ cd "$builddir"
+ cp "$srcdir"/ttydefaults.h include/
+ libtoolize --force && aclocal -I m4 && autoconf \
+ && automake --add-missing
+}
+
+build() {
+ cd "$builddir"
+
+ # login utils are provided by shadow (with PAM) or busybox (no PAM) --nenolod
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --with-sysroot=$CBUILDROOT \
+ --prefix=/usr \
+ --enable-raw \
+ --disable-uuidd \
+ --disable-nls \
+ --disable-tls \
+ --disable-kill \
+ --disable-login \
+ --disable-last \
+ --disable-sulogin \
+ --disable-su \
+ $_bootstrap_config
+ make
+}
+
+package() {
+ make -j1 DESTDIR="$pkgdir" -C "$builddir" install
+ # use pkg-config
+}
+
+dev() {
+ default_dev
+ replaces="e2fsprogs-dev util-linux-ng-dev"
+}
+
+bashcomp() {
+ pkgdesc="Bash completions for $pkgname"
+ depends=""
+ install_if="$pkgname=$pkgver-r$pkgrel bash-completion"
+
+ mkdir -p "$subpkgdir"/usr/share/
+ mv "$pkgdir"/usr/share/bash-completion \
+ "$subpkgdir"/usr/share/
+}
+
+blkid() {
+ pkgdesc="block device identification tool"
+ depends=""
+ replaces="util-linux-ng"
+ mkdir -p "$subpkgdir"/sbin
+ mv "$pkgdir"/sbin/blkid "$subpkgdir"/sbin/
+}
+
+libuuid() {
+ pkgdesc="DCE compatible Universally Unique Identifier library"
+ depends=""
+ mkdir -p "$subpkgdir"/lib
+ mv "$pkgdir"/lib/libuuid* "$subpkgdir"/lib/
+}
+
+libblkid() {
+ pkgdesc="Block device identification library from util-linux"
+ depends=""
+ mkdir -p "$subpkgdir"/lib
+ mv "$pkgdir"/lib/libblkid* "$subpkgdir"/lib/
+}
+
+libmount() {
+ pkgdesc="Block device identification library from util-linux"
+ depends=""
+ mkdir -p "$subpkgdir"/lib
+ mv "$pkgdir"/lib/libmount.so.* "$subpkgdir"/lib/
+}
+
+libsmartcols() {
+ pkgdesc="Formatting library for ls-like programs."
+ depends=""
+ mkdir -p "$subpkgdir"/lib
+ mv "$pkgdir"/lib/libsmartcols.so.* "$subpkgdir"/lib/
+}
+
+libfdisk() {
+ pkgdesc="Partitioning library for fdisk-like programs"
+ depends=""
+ mkdir -p "$subpkgdir"/lib
+ mv "$pkgdir"/lib/libfdisk.so.* "$subpkgdir"/lib/
+}
+
+sfdisk() {
+ pkgdesc="Partition table manipulator from util-linux"
+ depends=""
+ mkdir -p "$subpkgdir"/sbin
+ mv "$pkgdir"/sbin/sfdisk "$subpkgdir"/sbin/
+}
+
+cfdisk() {
+ pkgdesc="Curses based partition table manipulator from util-linux"
+ depends=""
+ mkdir -p "$subpkgdir"/sbin
+ mv "$pkgdir"/sbin/cfdisk "$subpkgdir"/sbin/
+}
+
+mcookie() {
+ pkgdesc="mcookie from util-linux"
+ replaces="util-linux-ng"
+ mkdir -p "$subpkgdir"/usr/bin
+ mv "$pkgdir"/usr/bin/mcookie "$subpkgdir"/usr/bin/
+}
+
+setpriv() {
+ pkgdesc="Run a program with different Linux privilege settings"
+ replaces="util-linux-ng"
+ mkdir -p "$subpkgdir"/usr/bin
+ mv "$pkgdir"/usr/bin/setpriv "$subpkgdir"/usr/bin/
+}
+
+_findmnt() {
+ pkgdesc="findmnt from util-linux"
+ depends=""
+ replaces=""
+ mkdir -p "$subpkgdir"/bin
+ mv "$pkgdir"/bin/findmnt "$subpkgdir"/bin
+}
+
+_py() {
+ pkgdesc="python bindings to libmount"
+ mkdir -p "$subpkgdir"/usr/lib
+ mv "$pkgdir"/usr/lib/python* "$subpkgdir"/usr/lib/
+}
+
+sha512sums="48b668526e96a132736b882090d0e33c20b4b3a0e1760502d83118ed98ccc9423d310848a2bb73f82f85e9c19f6191075ae2c5269b007e76be1fbd7b6b88fbf5 util-linux-2.31.tar.xz
+876bb9041eca1b2cca1e9aac898f282db576f7860aba690a95c0ac629d7c5b2cdeccba504dda87ff55c2a10b67165985ce16ca41a0694a267507e1e0cafd46d9 ttydefaults.h"
diff --git a/system/util-linux/ttydefaults.h b/system/util-linux/ttydefaults.h
new file mode 100644
index 000000000..0004b66a8
--- /dev/null
+++ b/system/util-linux/ttydefaults.h
@@ -0,0 +1,39 @@
+#ifndef _SYS_TTYDEFAULTS_H_
+#define _SYS_TTYDEFAULTS_H_
+#define TTYDEF_IFLAG (BRKINT | ISTRIP | ICRNL | IMAXBEL | IXON | IXANY)
+#define TTYDEF_OFLAG (OPOST | ONLCR | XTABS)
+#define TTYDEF_LFLAG (ECHO | ICANON | ISIG | IEXTEN | ECHOE|ECHOKE|ECHOCTL)
+#define TTYDEF_CFLAG (CREAD | CS7 | PARENB | HUPCL)
+#define TTYDEF_SPEED (B9600)
+#define CTRL(x) (x&037)
+#define CEOF CTRL('d')
+#ifdef _POSIX_VDISABLE
+# define CEOL _POSIX_VDISABLE
+#else
+# define CEOL '\0'
+#endif
+#define CERASE 0177
+#define CINTR CTRL('c')
+#ifdef _POSIX_VDISABLE
+# define CSTATUS _POSIX_VDISABLE
+#else
+# define CSTATUS '\0'
+#endif
+#define CKILL CTRL('u')
+#define CMIN 1
+#define CQUIT 034
+#define CSUSP CTRL('z')
+#define CTIME 0
+#define CDSUSP CTRL('y')
+#define CSTART CTRL('q')
+#define CSTOP CTRL('s')
+#define CLNEXT CTRL('v')
+#define CDISCARD CTRL('o')
+#define CWERASE CTRL('w')
+#define CREPRINT CTRL('r')
+#define CEOT CEOF
+#define CBRK CEOL
+#define CRPRNT CREPRINT
+#define CFLUSH CDISCARD
+#endif
+
diff --git a/system/xz/APKBUILD b/system/xz/APKBUILD
new file mode 100644
index 000000000..a4a8b47df
--- /dev/null
+++ b/system/xz/APKBUILD
@@ -0,0 +1,49 @@
+# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=xz
+pkgver=5.2.3
+pkgrel=1
+pkgdesc="Library and command line tools for XZ and LZMA compressed files"
+url="https://tukaani.org/xz/"
+arch="all"
+license="custom"
+depends=""
+makedepends=""
+subpackages="$pkgname-dev $pkgname-doc $pkgname-libs"
+source="https://tukaani.org/xz/xz-$pkgver.tar.gz"
+
+build() {
+ cd "$builddir"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ --localstatedir=/var \
+ --disable-rpath \
+ --disable-werror
+
+ sed 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \
+ -i libtool
+ sed 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' \
+ -i libtool
+
+ make
+}
+
+check() {
+ cd "$builddir"
+ make check
+}
+
+package() {
+ make -C "$builddir" DESTDIR="$pkgdir" install
+ install -Dm644 "$builddir"/COPYING \
+ "$pkgdir"/usr/share/licenses/$pkgname
+}
+
+md5sums="ef68674fb47a8b8e741b34e429d86e9d xz-5.2.3.tar.gz"
+sha256sums="71928b357d0a09a12a4b4c5fafca8c31c19b0e7d3b8ebb19622e96f26dbf28cb xz-5.2.3.tar.gz"
+sha512sums="a5eb4f707cf31579d166a6f95dbac45cf7ea181036d1632b4f123a4072f502f8d57cd6e7d0588f0bf831a07b8fc4065d26589a25c399b95ddcf5f73435163da6 xz-5.2.3.tar.gz"
diff --git a/system/zlib/APKBUILD b/system/zlib/APKBUILD
new file mode 100644
index 000000000..54b50ccfb
--- /dev/null
+++ b/system/zlib/APKBUILD
@@ -0,0 +1,40 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=zlib
+pkgver=1.2.11
+pkgrel=1
+pkgdesc="A compression/decompression Library"
+arch="all"
+license="zlib"
+url="http://zlib.net"
+depends=""
+subpackages="$pkgname-dev $pkgname-doc"
+source="http://zlib.net/$pkgname-$pkgver.tar.gz"
+
+builddir="$srcdir/$pkgname-$pkgver"
+
+build() {
+ cd "$builddir"
+ # we trade size for a little more speed.
+ export CFLAGS="$CFLAGS -O2"
+ CHOST="${CHOST}" ./configure \
+ --prefix=/usr \
+ --libdir=/lib \
+ --shared
+ make
+}
+
+check() {
+ cd "$builddir"
+ make check
+}
+
+package() {
+ cd "$builddir"
+ make install \
+ pkgconfigdir="/usr/lib/pkgconfig" \
+ DESTDIR="$pkgdir"
+}
+
+md5sums="1c9f62f0778697a09d36121ead88e08e zlib-1.2.11.tar.gz"
+sha256sums="c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1 zlib-1.2.11.tar.gz"
+sha512sums="73fd3fff4adeccd4894084c15ddac89890cd10ef105dd5e1835e1e9bbb6a49ff229713bd197d203edfa17c2727700fce65a2a235f07568212d820dca88b528ae zlib-1.2.11.tar.gz"