reaver: moved to github
reaver: moved to github

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>


git-svn-id: svn://svn.openwrt.org/openwrt/packages@47521 3c298f89-4303-0410-b956-a3cf2f4a3e73

--- a/devel/dmalloc/Makefile
+++ b/devel/dmalloc/Makefile
@@ -30,7 +30,7 @@
 define Package/libdmalloc
   $(call Package/dmalloc/Default)
   TITLE+= (library)
-  DEPENDS:=@USE_EGLIBC
+  DEPENDS:=@USE_GLIBC
 endef
 
 define Package/dmalloc-utils

--- a/devel/electric-fence/Makefile
+++ b/devel/electric-fence/Makefile
@@ -22,7 +22,7 @@
   CATEGORY:=Development
   TITLE:=electric-fence
   URL:=http://perens.com/FreeSoftware/ElectricFence/
-  DEPENDS:=@USE_EGLIBC
+  DEPENDS:=@USE_GLIBC
   MAINTAINER:=Mirko Vogt <mirko@openwrt.org>
 endef
 

--- a/lang/php5-pecl-bcompiler/Makefile
+++ /dev/null
@@ -1,30 +1,1 @@
-#
-# Copyright (C) 2012 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
-include $(TOPDIR)/rules.mk
-
-PECL_NAME:=bcompiler
-PECL_LONGNAME:=PHP bytecode Compiler
-
-PKG_VERSION:=1.0.2
-PKG_RELEASE:=1
-PKG_MD5SUM:=99f76a5ef536d43180b41036a6a13e43
-
-PKG_NAME:=php5-pecl-$(PECL_NAME)
-PKG_SOURCE:=$(PECL_NAME)-$(PKG_VERSION).tgz
-PKG_SOURCE_URL:=http://pecl.php.net/get/
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PECL_NAME)-$(PKG_VERSION)
-PKG_BUILD_PARALLEL:=1
-
-include $(INCLUDE_DIR)/package.mk
-include $(INCLUDE_DIR)/nls.mk
-include ../php5/pecl.mk
-
-$(eval $(call PECLPackage,$(PECL_NAME),$(PECL_LONGNAME),@BROKEN))
-$(eval $(call BuildPackage,$(PKG_NAME)))
-

--- a/lang/php5-pecl-dio/Makefile
+++ /dev/null
@@ -1,30 +1,1 @@
-#
-# Copyright (C) 2012 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
-include $(TOPDIR)/rules.mk
-
-PECL_NAME:=dio
-PECL_LONGNAME:=Direct I/O functions
-
-PKG_VERSION:=0.0.6
-PKG_RELEASE:=1
-PKG_MD5SUM:=95bde93a41def9c2d97532eeb0c83bd3
-
-PKG_NAME:=php5-pecl-$(PECL_NAME)
-PKG_SOURCE:=$(PECL_NAME)-$(PKG_VERSION).tgz
-PKG_SOURCE_URL:=http://pecl.php.net/get/
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PECL_NAME)-$(PKG_VERSION)
-PKG_BUILD_PARALLEL:=1
-
-include $(INCLUDE_DIR)/package.mk
-include $(INCLUDE_DIR)/nls.mk
-include ../php5/pecl.mk
-
-$(eval $(call PECLPackage,$(PECL_NAME),$(PECL_LONGNAME)))
-$(eval $(call BuildPackage,$(PKG_NAME)))
-

--- a/lang/php5-pecl-dio/patches/010-additional-baudrates.patch
+++ /dev/null
@@ -1,30 +1,1 @@
---- a/dio.c
-+++ b/dio.c
-@@ -442,6 +442,26 @@ PHP_FUNCTION(dio_tcsetattr)
- 
- 	/* assign to correct values... */
- 	switch (Baud_Rate)  {
-+#ifdef B460800
-+		case 460800:
-+			BAUD = B460800;
-+			break;
-+#endif
-+#ifdef B230400
-+		case 230400:
-+			BAUD = B230400;
-+			break;
-+#endif
-+#ifdef B115200
-+		case 115200:
-+			BAUD = B115200;
-+			break;
-+#endif
-+#ifdef B57600
-+		case 57600:
-+			BAUD = B57600;
-+			break;
-+#endif
- 		case 38400:
- 			BAUD = B38400;
- 			break;
 

--- a/lang/php5-pecl-libevent/Makefile
+++ /dev/null
@@ -1,32 +1,1 @@
-#
-# Copyright (C) 2012-2013 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
-include $(TOPDIR)/rules.mk
-
-PECL_NAME:=libevent
-PECL_LONGNAME:=Libevent - event notification
-
-PKG_VERSION:=0.1.0
-PKG_RELEASE:=1
-PKG_MD5SUM:=e091371a9e714098a4c04a6e3daeb56a
-
-PKG_NAME:=php5-pecl-$(PECL_NAME)
-PKG_SOURCE:=$(PECL_NAME)-$(PKG_VERSION).tgz
-PKG_SOURCE_URL:=http://pecl.php.net/get/
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PECL_NAME)-$(PKG_VERSION)
-PKG_BUILD_PARALLEL:=1
-
-include $(INCLUDE_DIR)/package.mk
-include $(INCLUDE_DIR)/nls.mk
-include ../php5/pecl.mk
-
-CONFIGURE_ARGS+= --with-libevent=shared,"$(STAGING_DIR)/usr"
-
-$(eval $(call PECLPackage,$(PECL_NAME),$(PECL_LONGNAME),+libevent2))
-$(eval $(call BuildPackage,$(PKG_NAME)))
-

file:a/lang/pymysql/Makefile (deleted)
--- a/lang/pymysql/Makefile
+++ /dev/null
@@ -1,52 +1,1 @@
-#
-# Copyright (C) 2007-2008 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=MySQL-python
-PKG_VERSION:=1.2.2
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=@SF/mysql-python
-PKG_MD5SUM:=532268f02870bea18c1d465e88afff30
-
-PKG_BUILD_DEPENDS:=python
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/python-mysql
-  SUBMENU:=Python
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=MySQL database adapter for Python
-  URL:=http://mysql-python.sourceforge.net/
-  DEPENDS:=+python +libmysqlclient
-endef
-
-define Package/python-mysql/description
- MySQLdb is an thread-compatible interface to the popular MySQL database
- server that provides the Python database API.
-endef
-
-define PyPackage/python-mysql/filespec
-+|$(PYTHON_PKG_DIR)/_mysql.so
-+|$(PYTHON_PKG_DIR)/_mysql_exceptions.py*
-+|$(PYTHON_PKG_DIR)/MySQLdb
-endef
-
-define Build/Compile
-	$(if $(Build/Compile/PyMod),,@echo Python packaging code not found.; false)
-	$(call Build/Compile/PyMod,., \
-		install --prefix="$(PKG_INSTALL_DIR)/usr", \
-	)
-endef
-
-$(eval $(call PyPackage,python-mysql))
-$(eval $(call BuildPackage,python-mysql))
-

--- a/lang/pymysql/patches/000-setup.patch
+++ /dev/null
@@ -1,13 +1,1 @@
---- MySQL-python-1.2.2/setup.py	2007-02-25 04:37:12.000000000 +0100
-+++ MySQL-python-1.2.2/setup.py	2007-08-15 12:23:18.000000000 +0200
-@@ -2,8 +2,7 @@
- 
- import os
- import sys
--import ez_setup; ez_setup.use_setuptools()
--from setuptools import setup, Extension
-+from distutils.core import setup, Extension
- 
- if sys.version_info < (2, 3):
-     raise Error, "Python-2.3 or newer is required"
 

--- a/lang/pymysql/patches/010-threadsafe.patch
+++ /dev/null
@@ -1,12 +1,1 @@
---- MySQL-python-1.2.2/site_orig.cfg	2007-08-15 12:58:40.000000000 +0200
-+++ MySQL-python-1.2.2/site.cfg	2007-08-15 12:58:49.000000000 +0200
-@@ -4,7 +4,7 @@
- # static: link against a static library (probably required for embedded)
- 
- embedded = False
--threadsafe = True
-+threadsafe = False
- static = False
- 
- # The path to mysql_config.
 

file:a/lang/pyyaml/Makefile (deleted)
--- a/lang/pyyaml/Makefile
+++ /dev/null
@@ -1,48 +1,1 @@
-#
-# Copyright (C) 2008 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=PyYAML
-PKG_VERSION:=3.11
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://pyyaml.org/download/pyyaml/
-PKG_MD5SUM:=f50e08ef0fe55178479d3a618efe21db
-
-PKG_BUILD_DEPENDS:=python
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/pyyaml
-  SUBMENU:=Python
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=pyyaml
-  URL:=http://pyyaml.org
-  DEPENDS:=+python +libyaml
-endef
-
-define Package/pyyaml/description
-  yaml python bindings
-endef
-
-define Build/Compile
-	$(call Build/Compile/PyMod,,--with-libyaml install --prefix="$(PKG_INSTALL_DIR)/usr")
-endef
-
-define Package/pyyaml/install
-	$(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
-	$(CP) \
-	    $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
-	    $(1)$(PYTHON_PKG_DIR)
-endef
-
-$(eval $(call BuildPackage,pyyaml))
-

file:a/libs/fftw3/Makefile (deleted)
--- a/libs/fftw3/Makefile
+++ /dev/null
@@ -1,119 +1,1 @@
-#
-# Copyright (C) 2007-2010 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=fftw3
-PKG_VERSION:=3.2.2
-PKG_RELEASE:=2
-
-PKG_SOURCE:=fftw-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://www.fftw.org
-PKG_MD5SUM:=b616e5c91218cc778b5aa735fefb61ae
-
-PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/fftw-$(PKG_VERSION)
-PKG_FIXUP:=autoreconf
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/fftw3
-  SECTION:=libs
-  CATEGORY:=Libraries
-  DEPENDS:=@!avr32 +libpthread
-  VARIANT:=double
-  TITLE:=Fast Fourier transform library
-  URL:=http://www.fftw.org/
-endef
-
-define Package/fftw3f
-  $(call Package/fftw3)
-  VARIANT:=single
-  TITLE+= (single precision)
-endef
-
-define Package/fftw3l
-  $(call Package/fftw3)
-  DEPENDS:=@BROKEN
-  VARIANT:=long-double
-  TITLE+= (long-double precision)
-endef
-
-define Package/fftw3/description
-	FFTW is a collection of fast C routines for computing the
-	Discrete Fourier Transform in one or more dimensions. It
-	includes complex, real, and parallel transforms, and can
-	handle arbitrary array sizes efficiently.
-endef
-
-define Package/fftw3f/description
-  $(call Package/fftw3/description)
-
-  This package contains the single precision library.
-endef
-
-define Package/fftw3l/description
-  $(call Package/fftw3/description)
-
-  This package contains the long-double precision library.
-endef
-
-TARGET_CFLAGS += $(FPIC)
-
-CONFIGURE_ARGS += \
-	--prefix=/usr \
-	--without-libiconv-prefix \
-	--without-libintl-prefix \
-	--disable-nls \
-	--enable-shared \
-	--enable-threads \
-	--enable-type-prefix \
-	--disable-debug \
-	--disable-fortran
-
-ifeq ($(BUILD_VARIANT), single)
-CONFIGURE_ARGS += \
-	--enable-single
-endif
-
-ifeq ($(BUILD_VARIANT), long-double)
-CONFIGURE_ARGS += \
-	--enable-long-double
-endif
-
-define Build/Compile
-	$(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" install
-endef
-
-define Build/InstallDev
-	$(INSTALL_DIR) $(1)/usr/include
-	$(CP) $(PKG_INSTALL_DIR)/usr/include/fftw3.h $(1)/usr/include
-	$(INSTALL_DIR) $(1)/usr/lib
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libfftw3*.{a,la} $(1)/usr/lib
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libfftw3*.so* $(1)/usr/lib
-	$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
-endef
-
-define Package/fftw3/install
-	$(INSTALL_DIR) $(1)/usr/lib
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libfftw3.so* $(1)/usr/lib/
-endef
-
-define Package/fftw3f/install
-	$(INSTALL_DIR) $(1)/usr/lib
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libfftw3f.so* $(1)/usr/lib/
-endef
-
-define Package/fftw3l/install
-	$(INSTALL_DIR) $(1)/usr/lib
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libfftw3l.so* $(1)/usr/lib/
-endef
-
-$(eval $(call BuildPackage,fftw3))
-$(eval $(call BuildPackage,fftw3f))
-$(eval $(call BuildPackage,fftw3l))
-

--- a/libs/fftw3/patches/001-makefile.patch
+++ /dev/null
@@ -1,21 +1,1 @@
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -110,7 +110,7 @@ RECURSIVE_CLEAN_TARGETS = mostlyclean-re
- ETAGS = etags
- CTAGS = ctags
- DIST_SUBDIRS = support genfft kernel simd dft rdft reodft api threads \
--	cell libbench2 . tests doc tools m4
-+	cell libbench2 . doc tools m4
- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
- distdir = $(PACKAGE)-$(VERSION)
- top_distdir = $(distdir)
-@@ -278,7 +278,7 @@ lib_LTLIBRARIES = libfftw3@PREC_SUFFIX@.
- @MAINTAINER_MODE_TRUE@GENFFT = genfft
- ACLOCAL_AMFLAGS = -I m4
- SUBDIRS = support $(GENFFT) kernel simd dft rdft reodft api threads \
--cell libbench2 . tests doc tools m4
-+cell libbench2 . m4
- 
- EXTRA_DIST = COPYRIGHT bootstrap.sh CONVENTIONS fftw.pc.in README.Cell
- @HAVE_SIMD_TRUE@SIMD_LIBS = \
 

file:a/libs/giflib/Makefile (deleted)
--- a/libs/giflib/Makefile
+++ /dev/null
@@ -1,60 +1,1 @@
-#
-# Copyright (C) 2006-2014 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=giflib
-PKG_VERSION:=5.1.0
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=@SF/giflib
-PKG_MD5SUM:=c7e9f1c10b755ab955156d4c1ac7fc5d
-
-PKG_LICENSE:=MIT
-PKG_LICENSE_FILES:=COPYING
-
-PKG_FIXUP:=autoreconf
-PKG_REMOVE_FILES:=autogen.sh aclocal.m4
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/giflib
-  SECTION:=libs
-  CATEGORY:=Libraries
-  TITLE:=GIF libraries
-  URL:=http://sourceforge.net/projects/giflib
-endef
-
-define Package/giflib/description
-  giflib is a library for reading and writing gif images.
-  It is API and ABI compatible with libungif which was in wide use while
-  the LZW compression algorithm was patented.
-endef
-
-TARGET_CFLAGS += $(FPIC)
-CONFIGURE_ARGS += --enable-x11=no
-
-define Build/Compile
-	$(MAKE) -C $(PKG_BUILD_DIR)
-endef
-
-define Build/InstallDev
-	$(INSTALL_DIR) $(1)/usr/{lib,include}
-	$(CP) $(PKG_BUILD_DIR)/lib/.libs/lib*so* $(1)/usr/lib
-	$(CP) $(PKG_BUILD_DIR)/lib/.libs/libgif.a $(1)/usr/lib
-	$(CP) $(PKG_BUILD_DIR)/lib/libgif.la $(1)/usr/lib
-	$(CP) $(PKG_BUILD_DIR)/lib/*.h $(1)/usr/include/
-endef
-
-define Package/giflib/install
-	$(INSTALL_DIR) $(1)/usr/lib
-	$(CP) $(PKG_BUILD_DIR)/lib/.libs/lib*so* $(1)/usr/lib/
-endef
-
-$(eval $(call BuildPackage,giflib))
-

file:a/libs/ldns/Makefile (deleted)
--- a/libs/ldns/Makefile
+++ /dev/null
@@ -1,81 +1,1 @@
-#
-# Copyright (C) 2011-2014 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=ldns
-PKG_VERSION:=1.6.17
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://www.nlnetlabs.nl/downloads/ldns
-PKG_MD5SUM:=a79423bcc4129e6d59b616b1cae11e5e
-
-PKG_FIXUP:=autoreconf
-PKG_INSTALL:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/libldns/Default
-  URL:=http://www.nlnetlabs.nl/projects/ldns/
-  DEPENDS:=+libopenssl
-endef
-
-define Package/libldns
-  $(call Package/libldns/Default)
-  SECTION:=libs
-  CATEGORY:=Libraries
-  TITLE:=A library to simplify DNS programming
-endef
-
-define Package/libldns/description
-  The goal of ldns is to simplify DNS programming, it supports recent RFCs like
-  the DNSSEC documents, and allows developers to easily create software
-  conforming to current RFCs, and experimental software for current Internet
-  Drafts.
-endef
-
-define Package/drill
-  $(call Package/libldns/Default)
-  SECTION:=net
-  CATEGORY:=Network
-  SUBMENU:=IP Addresses and Names
-  TITLE:=DNS(SEC) information tool
-  DEPENDS+= +libldns
-endef
-
-define Package/drill/description
-  drill is a tool to designed to get all sorts of information out of the DNS. It
-  is specificly designed to be used with DNSSEC.
-endef
-
-CONFIGURE_ARGS += \
-	--disable-ecdsa \
-	--disable-gost \
-	--with-drill \
-	--with-ssl="$(STAGING_DIR)/usr"
-
-define Build/InstallDev
-	$(INSTALL_DIR) $(1)/usr/include
-	$(CP) $(PKG_INSTALL_DIR)/usr/include/ldns $(1)/usr/include/
-	$(INSTALL_DIR) $(1)/usr/lib
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libldns.{a,so*} $(1)/usr/lib/
-endef
-
-define Package/libldns/install
-	$(INSTALL_DIR) $(1)/usr/lib
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libldns.so.* $(1)/usr/lib/
-endef
-
-define Package/drill/install
-	$(INSTALL_DIR) $(1)/usr/bin
-	$(CP) $(PKG_INSTALL_DIR)/usr/bin/drill $(1)/usr/bin/
-endef
-
-$(eval $(call BuildPackage,libldns))
-$(eval $(call BuildPackage,drill))
-

--- a/libs/libmicrohttpd/Makefile
+++ /dev/null
@@ -1,54 +1,1 @@
-#
-# Copyright (C) 2011-2012 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=libmicrohttpd
-PKG_VERSION:=0.9.19
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=@GNU/libmicrohttpd
-PKG_MD5SUM:=0f4c55ba224ce75b3b993b558e072a6b
-
-PKG_FIXUP:=autoreconf
-PKG_INSTALL:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/libmicrohttpd
-  SECTION:=libs
-  CATEGORY:=Libraries
-  TITLE:=Microhttpd
-  URL:=http://www.gnu.org/software/libmicrohttpd
-  DEPENDS:=+libpthread
-endef
-
-define Package/libmicrohttpd/description
- GNU libmicrohttpd is a small C library that is supposed to make it easy to run an HTTP server as part of another application.
-endef
-
-CONFIGURE_ARGS+= \
-	--disable-curl \
-	--disable-https \
-
-define Build/InstallDev
-	$(INSTALL_DIR) $(1)/usr/include
-	$(CP) $(PKG_INSTALL_DIR)/usr/include/microhttpd.h $(1)/usr/include/
-	$(INSTALL_DIR) $(1)/usr/lib
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libmicrohttpd.{a,so*} $(1)/usr/lib/
-	$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libmicrohttpd.pc $(1)/usr/lib/pkgconfig/
-endef
-
-define Package/libmicrohttpd/install
-	$(INSTALL_DIR) $(1)/usr/lib
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libmicrohttpd.so* $(1)/usr/lib/
-endef
-
-$(eval $(call BuildPackage,libmicrohttpd))
-

--- a/libs/libmicroxml/Makefile
+++ /dev/null
@@ -1,54 +1,1 @@
-#
-# Copyright (C) 2012 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=libmicroxml
-PKG_VERSION:=2012-06-11
-PKG_RELEASE=$(PKG_SOURCE_VERSION)
-
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=git://dev.freecwmp.org/microxml
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=72965423184f24cc0b963d91c2d1863cdb01b6aa
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
-
-PKG_FIXUP:=autoreconf
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/libmicroxml
-  SECTION:=libs
-  CATEGORY:=Libraries
-  TITLE:=XML library
-endef
-
-define Package/libmicroxml/description
- A micro sized XML library
-endef
-
-CONFIGURE_ARGS += \
-	--disable-threads \
-	--enable-static \
-	--enable-shared
-
-define Build/InstallDev
-	$(INSTALL_DIR) $(1)/usr/include
-	$(CP) $(PKG_BUILD_DIR)/microxml.h $(1)/usr/include
-	$(INSTALL_DIR) $(1)/usr/lib
-	$(CP) $(PKG_BUILD_DIR)/libmicroxml.so* $(1)/usr/lib
-	$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
-	$(CP) $(PKG_BUILD_DIR)/microxml.pc $(1)/usr/lib/pkgconfig
-endef
-
-define Package/libmicroxml/install
-	$(INSTALL_DIR) $(1)/usr/lib
-	$(CP) $(PKG_BUILD_DIR)/libmicroxml.so* $(1)/usr/lib
-endef
-
-$(eval $(call BuildPackage,libmicroxml))
-

file:a/libs/libshout/Makefile (deleted)
--- a/libs/libshout/Makefile
+++ /dev/null
@@ -1,67 +1,1 @@
-#
-# Copyright (C) 2008-2010 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=libshout
-PKG_VERSION:=2.3.1
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://downloads.us.xiph.org/releases/libshout/
-PKG_MD5SUM:=11765b2592e7ea623ccd93d3f8df172c
-
-PKG_FIXUP:=autoreconf
-PKG_INSTALL:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-TARGET_CFLAGS += $(FPIC) -Wl,-rpath-link=$(STAGING_DIR)/usr/lib
-
-define Package/libshout
-  SECTION:=libs
-  DEPENDS:= +libspeex +libtheora +libvorbis +libvorbisidec +libpthread
-  CATEGORY:=Libraries
-  TITLE:=Library which can be used to write a source client like ices
-  URL:=http://www.icecast.org/download.php
-endef
-
-define Package/libshout/description
-	libshout allows applications to easily communicate and broadcast
-	to an Icecast streaming media server. It handles the socket connections,
-	metadata communication, and data streaming for the calling application,
-	and lets developers focus on feature sets instead of implementation
-	details.
-endef
-
-define Build/Configure
-	$(call Build/Configure/Default, \
-		VORBIS_CFLAGS="-I$(STAGING_DIR)/usr/include/tremor/" \
-		VORBIS_LIBS="$(TARGET_LDFLAGS) -lvorbis -lvorbisidec" \
-		--enable-shared \
-		--enable-static \
-	)
-endef
-
-define Build/InstallDev
-	$(INSTALL_DIR) $(1)/usr/include/shout
-	$(CP) $(PKG_INSTALL_DIR)/usr/include/shout/shout.h $(1)/usr/include/shout
-	$(INSTALL_DIR) $(1)/usr/lib
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libshout.{a,so*} $(1)/usr/lib/
-	$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
-	$(SED) 's|/usr/include|$(STAGING_DIR)/usr/include|' \
-		$(PKG_INSTALL_DIR)/usr/lib/pkgconfig/shout.pc
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/shout.pc $(1)/usr/lib/pkgconfig/		
-endef
-
-define Package/libshout/install
-	$(INSTALL_DIR) $(1)/usr/lib
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libshout.so.* $(1)/usr/lib/
-endef
-
-$(eval $(call BuildPackage,libshout))
-

--- a/libs/libshout/patches/120-vorbis-c.patch
+++ /dev/null
@@ -1,12 +1,1 @@
---- a/src/vorbis.c
-+++ b/src/vorbis.c
-@@ -28,7 +28,7 @@
- #endif
- #include <stdlib.h>
- 
--#include <vorbis/codec.h>
-+#include <tremor/ivorbiscodec.h>
- 
- #include "shout_private.h"
- #include "shout_ogg.h"
 

--- a/libs/libshout/patches/140-no_example_doc_win32.patch
+++ /dev/null
@@ -1,18 +1,1 @@
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -288,12 +288,12 @@ top_builddir = @top_builddir@
- top_srcdir = @top_srcdir@
- AUTOMAKE_OPTIONS = 1.6 foreign
- ACLOCAL_AMFLAGS = -I m4
--SUBDIRS = include src examples debian doc win32
-+SUBDIRS = include src debian
- EXTRA_DIST = INSTALL m4/shout.m4 m4/acx_pthread.m4 \
- 	m4/ogg.m4 m4/vorbis.m4 m4/xiph_compiler.m4 m4/xiph_net.m4 \
- 	m4/xiph_types.m4
- 
--doc_DATA = COPYING NEWS README examples/example.c examples/nonblocking.c
-+doc_DATA = COPYING NEWS README
- m4datadir = $(datadir)/aclocal
- m4data_DATA = m4/shout.m4
- @HAVE_PKGCONFIG_TRUE@pkgconfigdir = $(libdir)/pkgconfig
 

file:a/libs/libyaml/Makefile (deleted)
--- a/libs/libyaml/Makefile
+++ /dev/null
@@ -1,49 +1,1 @@
-#
-# Copyright (C) 2008-2010 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=yaml
-PKG_VERSION:=0.1.6
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://pyyaml.org/download/libyaml/
-PKG_MD5SUM:=5fe00cda18ca5daeb43762b80c38e06e
-
-PKG_FIXUP:=autoreconf
-PKG_INSTALL:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-TARGET_CFLAGS += $(FPIC)
-
-define Package/libyaml
-  SUBMENU:=Python
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=libyaml
-  URL:=http://pyyaml.org/wiki/LibYAML
-endef
-
-define Package/libyaml/description
-  yaml library written in c
-endef
-
-define Package/libyaml/install
-	$(INSTALL_DIR) $(1)/usr/lib
-	$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libyaml.so $(1)/usr/lib/
-endef
-
-define Build/InstallDev
-	$(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib
-	$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
-	$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libyaml.{a,la} $(1)/usr/lib/
-endef
-
-$(eval $(call BuildPackage,libyaml))
-

file:a/libs/qrencode/Makefile (deleted)
--- a/libs/qrencode/Makefile
+++ /dev/null
@@ -1,68 +1,1 @@
-#
-# Copyright (C) 2006-2012 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=qrencode
-PKG_VERSION:=3.4.3
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://fukuchi.org/works/qrencode/
-PKG_MD5SUM:=2bb7fb7c7bd1a4042d4910b29609319e
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/libqrencode
-  SECTION:=libs
-  CATEGORY:=Libraries
-  TITLE:=Library for encoding data in a QR Code symbol
-  URL:=http://fukuchi.org/works/qrencode/
-endef
-
-define Package/libqrencode/description
-Libqrencode is a C library for encoding data in a QR Code symbol,
-a kind of 2D symbology that can be scanned by handy terminals such
-as a mobile phone with CCD. The capacity of QR Code is up to 7000
-digits or 4000 characters, and is highly robust.
-
-
-endef
-
-CONFIGURE_ARGS+= \
-	--enable-shared \
-	--enable-static \
-	--disable-rpath \
-	--disable-sdltest \
-	--without-tools \
-	--without-tests
-
-TARGET_LDFLAGS+= -s
-
-define Build/Compile
-	$(MAKE) -C $(PKG_BUILD_DIR) \
-		$(TARGET_CONFIGURE_OPTS) \
-		CFLAGS="$(TARGET_CFLAGS)" \
-		LDFLAGS="$(TARGET_LDFLAGS)" \
-		DESTDIR="$(PKG_INSTALL_DIR)" \
-		all install
-endef
-
-define Build/InstallDev
-	$(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib $(1)/usr/lib/pkgconfig
-	$(CP) $(PKG_INSTALL_DIR)/usr/include/qrencode.h $(1)/usr/include/
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libqrencode.{a,so*} $(1)/usr/lib/
-	$(CP) $(PKG_BUILD_DIR)/libqrencode.pc $(1)/usr/lib/pkgconfig/
-endef
-
-define Package/libqrencode/install
-	$(INSTALL_DIR) $(1)/usr/lib
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libqrencode.so* $(1)/usr/lib/
-endef
-
-$(eval $(call BuildPackage,libqrencode))
-

file:a/libs/sctp/Makefile (deleted)
--- a/libs/sctp/Makefile
+++ /dev/null
@@ -1,61 +1,1 @@
-#
-# Copyright (C) 2010 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=lksctp-tools
-PKG_VERSION:=1.0.11
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=@SF/lksctp/
-PKG_MD5SUM:=e9cf6c57402c9d4f1173a9529466e16d
-
-PKG_FIXUP:=autoreconf
-PKG_INSTALL:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-#####
-## lksctp library: provides sctp_* functions in user space
-#####
-
-define Package/sctp
-  SECTION:=libs
-  CATEGORY:=Network
-  TITLE:=SCTP user-land library
-  URL:=http://lksctp.sourceforge.net
-  DEPENDS:=+kmod-sctp
-endef
-
-define Package/sctp/description
- SCTP user-land library for sctp_* functions (when socket API is too limited).
-endef
-
-TARGET_LDFLAGS := -L$(STAGING_DIR)/usr/lib $(TARGET_LDFLAGS)
-
-define Package/sctp/install
-	# Install the library in the router
-	$(INSTALL_DIR) $(1)/usr/lib
-	$(CP) \
-		$(PKG_INSTALL_DIR)/usr/lib/libsctp.so* \
-		$(1)/usr/lib/
-	# And also in staging for dependent packages
-	$(INSTALL_DIR) $(STAGING_DIR)/usr/include/netinet
-	$(CP) \
-		$(PKG_INSTALL_DIR)/usr/include/netinet/* \
-		$(STAGING_DIR)/usr/include/netinet/
-	$(INSTALL_DIR) $(STAGING_DIR)/usr/lib
-	$(CP) \
-		$(PKG_INSTALL_DIR)/usr/lib/libsctp.so* \
-		$(STAGING_DIR)/usr/lib/
-
-endef
-
-$(eval $(call BuildPackage,sctp))
-
-

--- a/multimedia/tvheadend/Config.in
+++ /dev/null
@@ -1,22 +1,1 @@
-config TVHEADEND_CWC_SUPPORT
-	bool "NewCamD support"
-	default n
 
-config TVHEADEND_V4L_SUPPORT
-	bool "Video4Linux v2 support"
-	default n
-
-config TVHEADEND_LINUXDVB_SUPPORT
-	bool "Linux DVB support"
-	default n
-
-config TVHEADEND_DVBSCAN_SUPPORT
-	bool "Fetch DVB-scan data"
-	depends on TVHEADEND_LINUXDVB_SUPPORT
-	default TVHEADEND_LINUXDVB_SUPPORT
-
-config TVHEADEND_AVAHI_SUPPORT
-	bool "Avahi client support"
-	select PACKAGE_libavahi-client
-	default n
-

--- a/multimedia/tvheadend/Makefile
+++ /dev/null
@@ -1,80 +1,1 @@
-#
-# Copyright (C) 2012 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=tvheadend
-PKG_VERSION:=3.4patch1
-PKG_RELEASE:=0.1
-
-PKG_SOURCE:=$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://github.com/tvheadend/tvheadend/archive/
-PKG_MD5SUM:=86d1be0ad6e02bd2aecd3d529a026797
-
-PKG_USE_MIPS16:=0
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/tvheadend
-  SECTION:=multimedia
-  CATEGORY:=Multimedia
-  TITLE:=Tvheadend is a TV streaming server for Linux
-  DEPENDS:=+libcurl +libopenssl +librt +zlib +TVHEADEND_AVAHI_SUPPORT:libavahi-client
-  URL:=https://tvheadend.org/
-endef
-
-define Package/tvheadend/description
-  Tvheadend is a TV streaming server for Linux supporting DVB, ATSC, IPTV,
-  and Analog video (V4L) as input sources.
-  Can be used as a backend to Showtime, XBMC and various other clients.
-endef
-
-define Package/tvheadend/config
-  menu "Configuration"
-  depends on PACKAGE_tvheadend
-  source "$(SOURCE)/Config.in"
-  endmenu
-endef
-
-ifeq ($(CONFIG_TVHEADEND_CWC_SUPPORT),)
-  CONFIGURE_ARGS += --disable-cwc
-endif
-
-ifeq ($(CONFIG_TVHEADEND_V4L_SUPPORT),)
-  CONFIGURE_ARGS += --disable-v4l
-endif
-
-ifeq ($(CONFIG_TVHEADEND_LINUXDVB_SUPPORT),)
-  CONFIGURE_ARGS += --disable-linuxdvb
-endif
-
-ifeq ($(CONFIG_TVHEADEND_DVBSCAN_SUPPORT),)
-  CONFIGURE_ARGS += --disable-dvbscan
-endif
-
-ifeq ($(CONFIG_TVHEADEND_AVAHI_SUPPORT),)
-  CONFIGURE_ARGS += --disable-avahi
-else
-  CONFIGURE_ARGS += --enable-avahi
-endif
-
-CONFIGURE_ARGS += \
-	--release \
-	--enable-bundle
-
-define Package/tvheadend/install
-	$(INSTALL_DIR) $(1)/etc/tvheadend
-	$(INSTALL_DIR) $(1)/etc/init.d
-	$(INSTALL_BIN) ./files/tvheadend.init $(1)/etc/init.d/tvheadend
-	$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
-	$(INSTALL_DATA) ./files/tvheadend.upgrade $(1)/lib/upgrade/keep.d/tvheadend
-	$(INSTALL_DIR) $(1)/usr/bin
-	$(INSTALL_BIN) $(PKG_BUILD_DIR)/build.linux/tvheadend $(1)/usr/bin/
-endef
-
-$(eval $(call BuildPackage,tvheadend))
-

--- a/multimedia/tvheadend/files/tvheadend.init
+++ /dev/null
@@ -1,16 +1,1 @@
-#!/bin/sh /etc/rc.common
-# Copyright (C) 2012 OpenWrt.org
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
-START=80
-
-start() {
-	service_start /usr/bin/tvheadend -f -c /etc/tvheadend
-}
-
-stop() {
-	service_stop /usr/bin/tvheadend
-}
-

--- a/multimedia/tvheadend/files/tvheadend.upgrade
+++ /dev/null
@@ -1,2 +1,1 @@
-/etc/tvheadend
 

--- a/multimedia/tvheadend/patches/001-fix_Makefile_VFP_CFLAGS.patch
+++ /dev/null
@@ -1,12 +1,1 @@
---- a/Makefile
-+++ b/Makefile
-@@ -282,7 +282,7 @@ include support/${OSENV}.mk
- # Bundle files
- $(BUILDDIR)/bundle.o: $(BUILDDIR)/bundle.c
- 	@mkdir -p $(dir $@)
--	$(CC) -I${CURDIR}/src -c -o $@ $<
-+	$(CC) $(CFLAGS) -I${CURDIR}/src -c -o $@ $<
- 
- $(BUILDDIR)/bundle.c:
- 	@mkdir -p $(dir $@)
 

file:a/net/apcupsd/Makefile (deleted)
--- a/net/apcupsd/Makefile
+++ /dev/null
@@ -1,75 +1,1 @@
-#
-# Copyright (C) 2006-2011 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=apcupsd
-PKG_VERSION:=3.14.7
-PKG_RELEASE:=2
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=@SF/apcupsd
-PKG_MD5SUM:=bb2f8e4fc6b2f5d7b3e236eb57b81640
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/apcupsd
-  SECTION:=utils
-  CATEGORY:=Utilities
-  DEPENDS:=+libpthread +libusb-compat
-  TITLE:=UPS control software
-  URL:=http://www.apcupsd.org/
-endef
-
-define Build/Configure
-	$(CP) $(SCRIPT_DIR)/config.* $(PKG_BUILD_DIR)/autoconf/
-	$(call Build/Configure/Default, \
-		--with-distname=unknown \
-		--sysconfdir=/etc/apcupsd \
-		--enable-usb \
-		--without-x \
-	)
-endef
-
-define Build/Compile
-	$(MAKE) -C $(PKG_BUILD_DIR) \
-		DESTDIR="$(PKG_INSTALL_DIR)" \
-		LD="$(TARGET_CC)" \
-		all install
-endef
-
-define Package/apcupsd/install
-	$(INSTALL_DIR) $(1)/usr/sbin
-	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/apcupsd $(1)/usr/sbin/
-	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/smtp $(1)/usr/sbin/
-	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/apctest $(1)/usr/sbin/
-	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/apcaccess $(1)/usr/sbin/
-	$(INSTALL_DIR) $(1)/etc/apcupsd
-	$(INSTALL_CONF) ./files/apcupsd.conf $(1)/etc/apcupsd/
-	$(INSTALL_CONF) ./files/apcupsd_mail.conf $(1)/etc/apcupsd/
-	$(INSTALL_BIN) ./files/changeme $(1)/etc/apcupsd/
-	$(INSTALL_BIN) ./files/commfailure $(1)/etc/apcupsd/
-	$(INSTALL_BIN) ./files/commok $(1)/etc/apcupsd/
-	$(INSTALL_BIN) ./files/offbattery $(1)/etc/apcupsd/
-	$(INSTALL_BIN) ./files/onbattery $(1)/etc/apcupsd/
-	$(INSTALL_BIN) ./files/apccontrol $(1)/etc/apcupsd/
-	$(INSTALL_DIR) $(1)/etc/init.d
-	$(INSTALL_BIN)	./files/apcupsd.init $(1)/etc/init.d/apcupsd
-endef
-
-define Package/apcupsd/conffiles
-/etc/apcupsd/apcupsd.conf
-/etc/apcupsd/apcupsd_mail.conf
-/etc/apcupsd/changeme
-/etc/apcupsd/commfailure
-/etc/apcupsd/commok
-/etc/apcupsd/offbattery
-/etc/apcupsd/onbattery
-endef
-
-$(eval $(call BuildPackage,apcupsd))
-

--- a/net/apcupsd/files/apccontrol
+++ /dev/null
@@ -1,147 +1,1 @@
-#!/bin/sh
-#
-# Copyright (C) 1999-2002 Riccardo Facchetti <riccardo@master.oasi.gpa.it>
-#
-#  for apcupsd release 3.14.1 (04 May 2007) - unknown
-#
-# platforms/apccontrol.  Generated from apccontrol.in by configure.
-#
-#  Note, this is a generic file that can be used by most
-#   systems. If a particular system needs to have something
-#   special, start with this file, and put a copy in the
-#   platform subdirectory.
-#
 
-#
-# These variables are needed for set up the autoconf other variables.
-#
-prefix=/usr
-exec_prefix=/usr
-
-APCPID=/var/run/apcupsd.pid
-APCUPSD=/usr/sbin/apcupsd
-SHUTDOWN=/sbin/shutdown
-SCRIPTSHELL=/bin/sh
-SCRIPTDIR=/etc/apcupsd
-WALL=true
-
-#
-# Concatenate all output from this script to the events file
-#  Note, the following kills the script in a power fail situation
-#   where the disks are mounted read-only.
-# exec >>/var/log/apcupsd.events 2>&1
-
-#
-# This piece is to substitute the default behaviour with your own script,
-# perl, or C program.
-# You can customize every single command creating an executable file (may be a
-# script or a compiled program) and calling it the same as the $1 parameter
-# passed by apcupsd to this script.
-#
-# After executing your script, apccontrol continues with the default action.
-# If you do not want apccontrol to continue, exit your script with exit 
-# code 99. E.g. "exit 99".
-#
-# WARNING: the apccontrol file will be overwritten every time you update your
-# apcupsd, doing `make install'. Your own customized scripts will _not_ be
-# overwritten. If you wish to make changes to this file (discouraged), you
-# should change apccontrol.sh.in and then rerun the configure process.
-#
-if [ -f ${SCRIPTDIR}/${1} -a -x ${SCRIPTDIR}/${1} ]
-then
-    ${SCRIPTDIR}/${1} ${2} ${3} ${4}
-    # exit code 99 means he does not want us to do default action
-    if [ $? = 99 ] ; then
-	exit 0
-    fi
-fi
-
-case "$1" in
-    killpower)
-	echo "Apccontrol doing: ${APCUPSD} --killpower on UPS ${2}"
-	sleep 10
-	${APCUPSD} --killpower
-	echo "Apccontrol has done: ${APCUPSD} --killpower on UPS ${2}" | ${WALL}
-    ;;
-    commfailure)
-	echo "Warning communications lost with UPS ${2}" | ${WALL}
-    ;;
-    commok)
-	echo "Communications restored with UPS ${2}" | ${WALL}
-    ;;
-#
-# powerout, onbattery, offbattery, mainsback events occur
-#   in that order.
-#
-    powerout)
-	echo "Warning power loss detected on UPS ${2}" | ${WALL}
-    ;;
-    onbattery)
-	echo "Power failure on UPS ${2}. Running on batteries." | ${WALL}
-    ;;
-    offbattery)
-    ;;
-    mainsback)
-	echo "Power has returned on UPS ${2}..." | ${WALL}
-	if [ -f /etc/powerfail ] ; then
-	   printf "Continuing with shutdown."  | ${WALL}
-	fi
-    ;;
-    failing)
-	echo "Battery power exhaused on UPS ${2}. Doing shutdown." | ${WALL}
-    ;;
-    timeout)
-	echo "Battery time limit exceeded on UPS ${2}. Doing shutdown." | ${WALL}
-    ;;
-    loadlimit)
-	echo "Remaining battery charge below limit on UPS ${2}. Doing shutdown." | ${WALL}
-    ;;
-    runlimit)
-	echo "Remaining battery runtime below limit on UPS ${2}. Doing shutdown." | ${WALL}
-    ;;
-    doreboot)
-	echo "UPS ${2} initiating Reboot Sequence" | ${WALL}
-	${SHUTDOWN} -r now "apcupsd UPS ${2} initiated reboot"
-    ;;
-    doshutdown)
-	echo "UPS ${2} initiated Shutdown Sequence" | ${WALL}
-	${SHUTDOWN} -h now "apcupsd UPS ${2} initiated shutdown"
-    ;;
-    annoyme)
-	echo "Power problems with UPS ${2}. Please logoff." | ${WALL}
-    ;;
-    emergency)
-	echo "Emergency Shutdown. Possible battery failure on UPS ${2}." | ${WALL}
-    ;;
-    changeme)
-	echo "Emergency! Batteries have failed on UPS ${2}. Change them NOW" | ${WALL}
-    ;;
-    remotedown)
-	echo "Remote Shutdown. Beginning Shutdown Sequence." | ${WALL}
-    ;;
-    restartme)
-	echo -n "Restarting APCUPSD Power Management: "
-	THEPID=`cat ${APCPID}`
-	kill ${THEPID}
-	rm -f ${APCPID}
-	rm -f /etc/powerfail
-	rm -f /etc/nologin
-	sleep 5
-	`${APCUPSD}`
-	echo "apcupsd"
-    ;;
-    startselftest)
-    ;;
-    endselftest)
-    ;;
-    battdetach)
-    ;;
-    battattach)
-    ;;
-    *)	echo "Usage: ${0##*/} command"
-	echo "	     warning: this script is intended to be launched by"
-	echo "	     apcupsd and should never be launched by users."
-	exit 1
-    ;;
-esac
-

--- a/net/apcupsd/files/apcupsd.conf
+++ /dev/null
@@ -1,323 +1,1 @@
-## apcupsd.conf v1.1 ##
-# 
-#  for apcupsd release 3.14.1 (04 May 2007) - unknown
-#
-# "apcupsd" POSIX config file
 
-#
-# ========= General configuration parameters ============
-#
-
-# UPSNAME xxx
-#   Use this to give your UPS a name in log files and such. This
-#   is particulary useful if you have multiple UPSes. This does not
-#   set the EEPROM. It should be 8 characters or less.
-UPSNAME ups1
-
-# UPSCABLE <cable>
-#   Defines the type of cable connecting the UPS to your computer.
-#
-#   Possible generic choices for <cable> are:
-#     simple, smart, ether, usb
-#
-#   Or a specific cable model number may be used:
-#     940-0119A, 940-0127A, 940-0128A, 940-0020B,
-#     940-0020C, 940-0023A, 940-0024B, 940-0024C,
-#     940-1524C, 940-0024G, 940-0095A, 940-0095B,
-#     940-0095C, M-04-02-2000
-#
-UPSCABLE smart
-
-# To get apcupsd to work, in addition to defining the cable
-# above, you must also define a UPSTYPE, which corresponds to
-# the type of UPS you have (see the Description for more details).
-# You must also specify a DEVICE, sometimes referred to as a port.
-# For USB UPSes, please leave the DEVICE directive blank. For
-# other UPS types, you must specify an appropriate port or address.
-#
-# UPSTYPE   DEVICE           Description
-# apcsmart  /dev/tty**       Newer serial character device,
-#                            appropriate for SmartUPS models using
-#                            a serial cable (not USB).
-#
-# usb       <BLANK>          Most new UPSes are USB. A blank DEVICE
-#                            setting enables autodetection, which is
-#                            the best choice for most installations.
-#
-# net       hostname:port    Network link to a master apcupsd
-#                            through apcupsd's Network Information
-#                            Server. This is used if you don't have
-#                            a UPS directly connected to your computer.
-#
-# snmp      hostname:port:vendor:community
-#                            SNMP Network link to an SNMP-enabled
-#                            UPS device. Vendor is the MIB used by
-#                            the UPS device: can be "APC", "APC_NOTRAP"
-#                            or "RFC" where APC is the powernet MIB,
-#                            "APC_NOTRAP" is powernet with SNMP trap
-#                            catching disabled, and RFC is the IETF's 
-#                            rfc1628 UPS-MIB. You usually want "APC".
-#                            Port is usually 161. Community is usually
-#                            "private".
-#
-# dumb      /dev/tty**       Old serial character device for use 
-#                            with simple-signaling UPSes.
-#
-# pcnet    ipaddr:username:passphrase
-#                            PowerChute Network Shutdown protocol
-#                            which can be used as an alternative to SNMP
-#                            with AP9617 family of smart slot cards.
-#                            ipaddr is the IP address of the UPS mgmt
-#                            card. username and passphrase are the
-#                            credentials for which the card has been
-#                            configured.
-#
-UPSTYPE apcsmart
-DEVICE /dev/ttyS0
-
-
-# LOCKFILE <path to lockfile>
-#   Path for device lock file. Not used on Win32.
-LOCKFILE /var/lock
-
-# SCRIPTDIR <path to script directory>
-#   Directory in which apccontrol and event scripts are located.
-SCRIPTDIR /etc/apcupsd
-
-# PWRFAILDIR <path to powerfail directory>
-#   Directory in which to write the powerfail flag file. This file
-#   is created when apcupsd initiates a system shutdown and is
-#   checked in the OS halt scripts to determine if a killpower
-#   (turning off UPS output power) is required.
-PWRFAILDIR /etc
-
-# NOLOGINDIR <path to nologin directory>
-#   Directory in which to write the nologin file. The existence
-#   of this flag file tells the OS to disallow new logins.
-NOLOGINDIR /etc
-
-
-#
-# ======== Configuration parameters used during power failures ==========
-#
-
-# The ONBATTERYDELAY is the time in seconds from when a power failure
-#   is detected until we react to it with an onbattery event.
-#
-#   This means that, apccontrol will be called with the powerout argument
-#   immediately when a power failure is detected.  However, the
-#   onbattery argument is passed to apccontrol only after the 
-#   ONBATTERYDELAY time.  If you don't want to be annoyed by short
-#   powerfailures, make sure that apccontrol powerout does nothing
-#   i.e. comment out the wall.
-#ONBATTERYDELAY 6
-
-# 
-# Note: BATTERYLEVEL, MINUTES, and TIMEOUT work in conjunction, so
-# the first that occurs will cause the initation of a shutdown.
-#
-
-# If during a power failure, the remaining battery percentage
-# (as reported by the UPS) is below or equal to BATTERYLEVEL, 
-# apcupsd will initiate a system shutdown.
-BATTERYLEVEL 5
-
-# If during a power failure, the remaining runtime in minutes 
-# (as calculated internally by the UPS) is below or equal to MINUTES,
-# apcupsd, will initiate a system shutdown.
-MINUTES 3
-
-# If during a power failure, the UPS has run on batteries for TIMEOUT
-# many seconds or longer, apcupsd will initiate a system shutdown.
-# A value of 0 disables this timer.
-#
-#  Note, if you have a Smart UPS, you will most likely want to disable
-#    this timer by setting it to zero. That way, you UPS will continue
-#    on batteries until either the % charge remaing drops to or below BATTERYLEVEL,
-#    or the remaining battery runtime drops to or below MINUTES.  Of course,
-#    if you are testing, setting this to 60 causes a quick system shutdown
-#    if you pull the power plug.   
-#  If you have an older dumb UPS, you will want to set this to less than
-#    the time you know you can run on batteries.
-TIMEOUT 0
-
-#  Time in seconds between annoying users to signoff prior to
-#  system shutdown. 0 disables.
-ANNOY 300
-
-# Initial delay after power failure before warning users to get
-# off the system.
-ANNOYDELAY 60
-
-# The condition which determines when users are prevented from
-# logging in during a power failure.
-# NOLOGON <string> [ disable | timeout | percent | minutes | always ]
-NOLOGON disable
-
-# If KILLDELAY is non-zero, apcupsd will continue running after a
-# shutdown has been requested, and after the specified time in
-# seconds attempt to kill the power. This is for use on systems
-# where apcupsd cannot regain control after a shutdown.
-# KILLDELAY <seconds>  0 disables
-KILLDELAY 0
-
-#
-# ==== Configuration statements for Network Information Server ====
-#
-
-# NETSERVER [ on | off ] on enables, off disables the network
-#  information server. If netstatus is on, a network information
-#  server process will be started for serving the STATUS and
-#  EVENT data over the network (used by CGI programs).
-NETSERVER on
-
-# NISIP <dotted notation ip address>
-#  IP address on which NIS server will listen for incoming connections.
-#  This is useful if your server is multi-homed (has more than one
-#  network interface and IP address). Default value is 0.0.0.0 which
-#  means any incoming request will be serviced. Alternatively, you can
-#  configure this setting to any specific IP address of your server and 
-#  NIS will listen for connections only on that interface. Use the
-#  loopback address (127.0.0.1) to accept connections only from the
-#  local machine.
-NISIP 0.0.0.0
-
-# NISPORT <port> default is 3551 as registered with the IANA
-#  port to use for sending STATUS and EVENTS data over the network.
-#  It is not used unless NETSERVER is on. If you change this port,
-#  you will need to change the corresponding value in the cgi directory
-#  and rebuild the cgi programs.
-NISPORT 3551
-
-# If you want the last few EVENTS to be available over the network
-# by the network information server, you must define an EVENTSFILE.
-EVENTSFILE /var/log/apcupsd.events
-
-# EVENTSFILEMAX <kilobytes>
-#  By default, the size of the EVENTSFILE will be not be allowed to exceed
-#  10 kilobytes.  When the file grows beyond this limit, older EVENTS will
-#  be removed from the beginning of the file (first in first out).  The
-#  parameter EVENTSFILEMAX can be set to a different kilobyte value, or set
-#  to zero to allow the EVENTSFILE to grow without limit.
-EVENTSFILEMAX 10
-
-#
-# ========== Configuration statements used if sharing =============
-#            a UPS with more than one machine
-
-# NETTIME <int>
-#   Interval (in seconds) at which the NIS client polls the server.
-#   Used only when this apcupsd is a network client (UPSTYPE net).
-#NETTIME 60
-
-#
-# Remaining items are for ShareUPS (APC expansion card) ONLY
-#
-
-# UPSCLASS [ standalone | shareslave | sharemaster ]
-#   Normally standalone unless you share an UPS using an APC ShareUPS
-#   card.
-UPSCLASS standalone
-
-# UPSMODE [ disable | share ]
-#   Normally disable unless you share an UPS using an APC ShareUPS card.
-UPSMODE disable
-
-#
-# ===== Configuration statements to control apcupsd system logging ========
-#
-
-# Time interval in seconds between writing the STATUS file; 0 disables
-STATTIME 0
-
-# Location of STATUS file (written to only if STATTIME is non-zero)
-STATFILE /var/log/apcupsd.status
-
-# LOGSTATS [ on | off ] on enables, off disables
-# Note! This generates a lot of output, so if         
-#       you turn this on, be sure that the
-#       file defined in syslog.conf for LOG_NOTICE is a named pipe.
-#  You probably do not want this on.
-LOGSTATS off
-
-# Time interval in seconds between writing the DATA records to
-#   the log file. 0 disables.
-DATATIME 0
-
-# FACILITY defines the logging facility (class) for logging to syslog. 
-#          If not specified, it defaults to "daemon". This is useful 
-#          if you want to separate the data logged by apcupsd from other
-#          programs.
-#FACILITY DAEMON
-
-#
-# ========== Configuration statements used in updating the UPS EPROM =========
-#
-
-#
-# These statements are used only by apctest when choosing "Set EEPROM with conf
-# file values" from the EEPROM menu. THESE STATEMENTS HAVE NO EFFECT ON APCUPSD.
-#
-
-# UPS name, max 8 characters 
-#UPSNAME UPS_IDEN
-
-# Battery date - 8 characters
-#BATTDATE mm/dd/yy
-
-# Sensitivity to line voltage quality (H cause faster transfer to batteries)  
-# SENSITIVITY H M L        (default = H)
-#SENSITIVITY H
-
-# UPS delay after power return (seconds)
-# WAKEUP 000 060 180 300   (default = 0)
-#WAKEUP 60
-
-# UPS Grace period after request to power off (seconds)
-# SLEEP 020 180 300 600    (default = 20)
-#SLEEP 180
-
-# Low line voltage causing transfer to batteries
-# The permitted values depend on your model as defined by last letter 
-#  of FIRMWARE or APCMODEL. Some representative values are:
-#    D 106 103 100 097
-#    M 177 172 168 182
-#    A 092 090 088 086
-#    I 208 204 200 196     (default = 0 => not valid)
-#LOTRANSFER  208
-
-# High line voltage causing transfer to batteries
-# The permitted values depend on your model as defined by last letter 
-#  of FIRMWARE or APCMODEL. Some representative values are:
-#    D 127 130 133 136
-#    M 229 234 239 224
-#    A 108 110 112 114
-#    I 253 257 261 265     (default = 0 => not valid)
-#HITRANSFER 253
-
-# Battery charge needed to restore power
-# RETURNCHARGE 00 15 50 90 (default = 15)
-#RETURNCHARGE 15
-
-# Alarm delay 
-# 0 = zero delay after pwr fail, T = power fail + 30 sec, L = low battery, N = never
-# BEEPSTATE 0 T L N        (default = 0)
-#BEEPSTATE T
-
-# Low battery warning delay in minutes
-# LOWBATT 02 05 07 10      (default = 02)
-#LOWBATT 2
-
-# UPS Output voltage when running on batteries
-# The permitted values depend on your model as defined by last letter 
-#  of FIRMWARE or APCMODEL. Some representative values are:
-#    D 115
-#    M 208
-#    A 100
-#    I 230 240 220 225     (default = 0 => not valid)
-#OUTPUTVOLTS 230
-
-# Self test interval in hours 336=2 weeks, 168=1 week, ON=at power on
-# SELFTEST 336 168 ON OFF  (default = 336)
-#SELFTEST 336
-

--- a/net/apcupsd/files/apcupsd.init
+++ /dev/null
@@ -1,13 +1,1 @@
-#!/bin/sh /etc/rc.common
-# Copyright (C) 2006 OpenWrt.org
-START=50
-STOP=50
 
-start() {
-	/usr/sbin/apcupsd -f /etc/apcupsd/apcupsd.conf
-}
-
-stop() {
-	kill $(cat /var/run/apcupsd.pid)
-}
-

--- a/net/apcupsd/files/apcupsd_mail.conf
+++ /dev/null
@@ -1,7 +1,1 @@
-#!/bin/sh
 
-MAILPROG="/usr/sbin/smtp"
-MAILHOST="mail:25"
-FROM="OpenWrt"
-TO="apcups@example.com"
-HOSTNAME="OpenWrt"

--- a/net/apcupsd/files/changeme
+++ /dev/null
@@ -1,18 +1,1 @@
-#!/bin/sh
-#
-# This shell script if placed in /etc/apcupsd
-# will be called by /etc/apcupsd/apccontrol when apcupsd
-# detects that the battery should be replaced.
-# We send an email message to root to notify him.
-#
-. /etc/apcupsd/apcupsd_mail.conf
 
-MSG="$HOSTNAME UPS battery needs changing NOW."
-#
-(
-   echo "$MSG"
-   echo " "
-   /usr/sbin/apcaccess status
-) | $MAILPROG -h $MAILHOST -f $FROM -s "$MSG" $TO
-exit 0
-

--- a/net/apcupsd/files/commfailure
+++ /dev/null
@@ -1,18 +1,1 @@
-#!/bin/sh
-#
-# This shell script if placed in /etc/apcupsd
-# will be called by /etc/apcupsd/apccontrol when apcupsd
-# loses contact with the UPS (i.e. the serial connection is not responding).
-# We send an email message to root to notify him.
-#
-. /etc/apcupsd/apcupsd_mail.conf
 
-MSG="$HOSTNAME Communications with UPS lost"
-#
-(
-   echo "$MSG"
-   echo " "
-   /usr/sbin/apcaccess status
-) | $MAILPROG -h $MAILHOST -f $FROM -s "$MSG" $TO
-exit 0
-

--- a/net/apcupsd/files/commok
+++ /dev/null
@@ -1,18 +1,1 @@
-#!/bin/sh
-#
-# This shell script if placed in /etc/apcupsd
-# will be called by /etc/apcupsd/apccontrol when apcupsd
-# restores contact with the UPS (i.e. the serial connection is restored).
-# We send an email message to root to notify him.
-#
-. /etc/apcupsd/apcupsd_mail.conf
 
-MSG="$HOSTNAME Communications with UPS restored"
-#
-(
-   echo "$MSG"
-   echo " "
-   /usr/sbin/apcaccess status
-) | $MAILPROG -h $MAILHOST -f $FROM -s "$MSG" $TO
-exit 0
-

--- a/net/apcupsd/files/offbattery
+++ /dev/null
@@ -1,18 +1,1 @@
-#!/bin/sh
-#
-# This shell script if placed in /etc/apcupsd
-# will be called by /etc/apcupsd/apccontrol when the    
-# UPS goes back on to the mains after a power failure.
-# We send an email message to root to notify him.
-#
-. /etc/apcupsd/apcupsd_mail.conf
 
-MSG="$HOSTNAME Power has returned"
-#
-(
-   echo "$MSG"
-   echo " "
-   /usr/sbin/apcaccess status
-) | $MAILPROG -h $MAILHOST -f $FROM -s "$MSG" $TO
-exit 0
-

--- a/net/apcupsd/files/onbattery
+++ /dev/null
@@ -1,18 +1,1 @@
-#!/bin/sh
-#
-# This shell script if placed in /etc/apcupsd
-# will be called by /etc/apcupsd/apccontrol when the UPS
-# goes on batteries.
-# We send an email message to root to notify him.
-#
-. /etc/apcupsd/apcupsd_mail.conf
 
-MSG="$HOSTNAME Power Failure !!!"
-#
-(
-   echo "$MSG"
-   echo " "
-   /usr/sbin/apcaccess status
-) | $MAILPROG -h $MAILHOST -f $FROM -s "$MSG" $TO
-exit 0
-

--- a/net/apcupsd/patches/010-fix-include-paths.patch
+++ /dev/null
@@ -1,14 +1,1 @@
-diff --git a/autoconf/variables.mak.in b/autoconf/variables.mak.in
-index b67e467..6022434 100644
---- a/autoconf/variables.mak.in
-+++ b/autoconf/variables.mak.in
-@@ -65,7 +65,7 @@ DRVLIBS = @PTHREAD_LFLAGS@ @DRVLIBS@
- X_LIBS = @X_LIBS@
- X_EXTRA_LIBS = @X_EXTRA_LIBS@
- 
--CPPFLAGS = @CPPFLAGS@ -I$(topdir)/include $(EXTRAINCS)
-+CPPFLAGS = -I$(topdir)/include @CPPFLAGS@ $(EXTRAINCS)
- CFLAGS = $(CPPFLAGS) @CFLAGS@ @PTHREAD_CFLAGS@
- CXXFLAGS = $(CPPFLAGS) @CXXFLAGS@ @PTHREAD_CFLAGS@
- LDFLAGS = @LDFLAGS@
 

--- a/net/atftp/Makefile
+++ b/net/atftp/Makefile
@@ -43,7 +43,7 @@
 CONFIGURE_VARS += \
 	LDFLAGS="$(TARGET_LDFLAGS) $(TARGET_CFLAGS)"
 
-ifdef CONFIG_USE_EGLIBC
+ifdef CONFIG_USE_GLIBC
   TARGET_CFLAGS += -DHAVE_ARGZ=1
 
   define Build/Prepare

--- a/net/bridge-utils/Makefile
+++ /dev/null
@@ -1,52 +1,1 @@
-#
-# Copyright (C) 2006-2013 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
-include $(TOPDIR)/rules.mk
-include $(INCLUDE_DIR)/kernel.mk
-
-PKG_NAME:=bridge-utils
-PKG_RELEASE:=2
-PKG_SOURCE_URL:=@SF/bridge
-PKG_VERSION:=1.5
-PKG_MD5SUM:=ec7b381160b340648dede58c31bb2238
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/bridge
-  SECTION:=net
-  CATEGORY:=Base system
-  TITLE:=Ethernet bridging configuration utility
-  URL:=http://bridge.sourceforge.net/
-endef
-
-define Package/bridge/description
- Manage ethernet bridging: a way to connect networks together to
- form a larger network.
-endef
-
-CONFIGURE_ARGS += \
-	--with-linux-headers="$(LINUX_DIR)" \
-
-define Build/Prepare
-$(call Build/Prepare/Default)
-	( cd $(PKG_BUILD_DIR) ; \
-		[ -f ./configure ] || { \
-			ln -sf configure.in configure.ac ; \
-			autoconf ; \
-		} \
-	)
-endef
-
-define Package/bridge/install
-	$(INSTALL_DIR) $(1)/usr/sbin
-	$(INSTALL_BIN) $(PKG_BUILD_DIR)/brctl/brctl $(1)/usr/sbin
-endef
-
-$(eval $(call BuildPackage,bridge))
-

--- a/net/bridge-utils/patches/001-libbridge_cflags.patch
+++ /dev/null
@@ -1,12 +1,1 @@
---- a/libbridge/Makefile.in
-+++ b/libbridge/Makefile.in
-@@ -5,7 +5,7 @@ AR=ar
- RANLIB=@RANLIB@
- 
- CC=@CC@
--CFLAGS = -Wall -g $(KERNEL_HEADERS)
-+CFLAGS = -Wall -g @CFLAGS@ $(KERNEL_HEADERS)
- 
- prefix=@prefix@
- exec_prefix=@exec_prefix@
 

--- a/net/bridge-utils/patches/010-fix_struct_in6_addr_usage.patch
+++ /dev/null
@@ -1,11 +1,1 @@
---- a/libbridge/libbridge.h
-+++ b/libbridge/libbridge.h
-@@ -20,6 +20,7 @@
- #define _LIBBRIDGE_H
- 
- #include <sys/socket.h>
-+#include <netinet/in.h>
- #include <linux/if.h>
- #include <linux/if_bridge.h>
- 
 

--- a/net/cups/Makefile
+++ b/net/cups/Makefile
@@ -398,6 +398,7 @@
 		--enable-shared \
 		--enable-image \
 		--enable-libusb \
+		--disable-acl \
 		--disable-dbus \
 		--disable-dnssd \
 		--disable-launchd \

file:a/net/fakeidentd/Makefile (deleted)
--- a/net/fakeidentd/Makefile
+++ /dev/null
@@ -1,47 +1,1 @@
-#
-# Copyright (C) 2006-2012 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=fakeidentd
-PKG_VERSION:=2.6
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).c
-PKG_SOURCE_URL:=http://distfiles.gentoo.org/distfiles/
-PKG_MD5SUM:=d26693c1a7c883d1432e05fb6f7ead6e
-UNPACK_CMD=$(CP) $(DL_DIR)/$(PKG_SOURCE) $(1)/
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/fakeidentd
-  SECTION:=net
-  CATEGORY:=Network
-  TITLE:=A static, secure identd.
-  URL:=http://www.guru-group.fi/~too/sw/releases/
-endef
-
-define Package/fakeidentd/description
-	A static secure identd, only one source file.
-endef
-
-define Build/Compile
-	$(SHELL) "$(PKG_BUILD_DIR)/$(MAKE_PATH)/$(PKG_SOURCE)" \
-	CC="$(TARGET_CC)" TRG="$(PKG_BUILD_DIR)/$(MAKE_PATH)/$(PKG_NAME)" \
-	$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS) \
-	$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS) -DUSE_UNIX_OS
-endef
-
-define Package/fakeidentd/install
-	$(INSTALL_DIR) $(1)/usr/sbin
-	$(CP) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/sbin/
-	$(INSTALL_DIR) $(1)/etc/init.d
-	$(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME)
-endef
-
-$(eval $(call BuildPackage,fakeidentd))
-

--- a/net/fakeidentd/files/fakeidentd.init
+++ /dev/null
@@ -1,13 +1,1 @@
-#!/bin/sh /etc/rc.common
-# Copyright (C) 2006-2012 OpenWrt.org
 
-START=85
-
-start() {
-	service_start /usr/sbin/fakeidentd -r
-}
-
-stop() {
-	service_stop /usr/sbin/fakeidentd
-}
-

--- a/net/l7-protocols/Makefile
+++ /dev/null
@@ -1,79 +1,1 @@
-include $(TOPDIR)/rules.mk
 
-PKG_NAME:=l7-protocols
-PKG_VERSION:=2009-05-28
-PKG_RELEASE:=2
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=@SF/l7-filter
-PKG_MD5SUM:=91be154d12134dcdbc560cc7aa7fe4ce
-
-include $(INCLUDE_DIR)/uclibc++.mk
-include $(INCLUDE_DIR)/package.mk
-
-define Package/l7-protocols
-  SECTION:=net
-  CATEGORY:=Network
-  TITLE:=Protocols for layer7 filtering
-  URL:=http://l7-filter.sourceforge.net/
-  SUBMENU:=Firewall
-  DEPENDS:=iptables-mod-filter
-endef
-
-define Package/l7-protocols/description
-       l7-filter classifies packets based on patterns in application
-       layer data. This allows correct classification of P2P traffic that
-       uses unpredictable ports as well as standard protocols running on
-       non-standard ports.
-endef
-
-define Package/l7-protocols-testing
-	$(call Package/l7-protocols)
-	TITLE:=testing utilities for layer7
-	DEPENDS+=l7-protocols $(CXX_DEPENDS)
-endef
-
-define Package/l7-protocols-testing/description
-	testing utilities for layer 7 patterns
-endef
-
-define Build/Configure
-endef
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_l7-protocols-testing),)
-  define Build/Compile
-	cd $(PKG_BUILD_DIR)/testing && $(MAKE) $(CONFIGURE_VARS)
-  endef
-else
-  define Build/Compile
-  endef
-endif
-
-define Package/l7-protocols/install
-	$(INSTALL_DIR) $(1)/etc/l7-protocols
-	$(CP) $(PKG_BUILD_DIR)/example_traffic \
-		$(PKG_BUILD_DIR)/extra \
-		$(PKG_BUILD_DIR)/file_types \
-		$(PKG_BUILD_DIR)/groups.sh \
-		$(PKG_BUILD_DIR)/malware \
-		$(PKG_BUILD_DIR)/protocols \
-		$(1)/etc/l7-protocols
-endef
-
-define Package/l7-protocols-testing/install
-	$(INSTALL_DIR) $(1)/etc/l7-protocols/testing
-	$(CP) $(PKG_BUILD_DIR)/testing/data \
-		$(1)/etc/l7-protocols/testing
-	$(INSTALL_BIN) \
-		$(PKG_BUILD_DIR)/testing/rand{chars,printable} \
-		$(PKG_BUILD_DIR)/testing/test_speed-{kernel,userspace} \
-		$(PKG_BUILD_DIR)/testing/match_kernel \
-		$(PKG_BUILD_DIR)/testing/doallspeeds.sh \
-		$(PKG_BUILD_DIR)/testing/test_match.sh \
-		$(PKG_BUILD_DIR)/testing/timeit.sh \
-		$(1)/etc/l7-protocols/testing
-endef
-
-$(eval $(call BuildPackage,l7-protocols))
-$(eval $(call BuildPackage,l7-protocols-testing))
-

--- a/net/l7-protocols/patches/100-testing_crosscompile.patch
+++ /dev/null
@@ -1,28 +1,1 @@
---- a/testing/Makefile
-+++ b/testing/Makefile
-@@ -1,19 +1,19 @@
- all: randchars randprintable test_speed-kernel test_speed-userspace match_kernel
- 
- randchars: randchars.c
--	gcc -O2 -o randchars randchars.c
-+	$(CC) $(CFLAGS) -o randchars randchars.c
- 
- randprintable: randprintable.c
--	gcc -O2 -o randprintable randprintable.c
-+	$(CC) $(CFLAGS) -o randprintable randprintable.c
- 
- test_speed-kernel: test_speed-kernel.c
--	gcc -o test_speed-kernel test_speed-kernel.c
-+	$(CC) $(CFLAGS) -o test_speed-kernel test_speed-kernel.c
- 
- test_speed-userspace: test_speed-userspace.cpp l7-parse-patterns.cpp l7-parse-patterns.h
--	g++ -Wall -o test_speed-userspace test_speed-userspace.cpp l7-parse-patterns.cpp
-+	$(CXX) $(CXXFLAGS) -Wall -o test_speed-userspace test_speed-userspace.cpp l7-parse-patterns.cpp
- 
- match_kernel: match-kernel.c
--	gcc -O2 -o match_kernel match-kernel.c
-+	$(CC) $(CFLAGS) -o match_kernel match-kernel.c
- 
- clean:
- 	rm -f randprintable randchars test_speed-kernel test_speed-userspace match_kernel
 

--- a/net/l7-protocols/patches/101-testing-timeit.patch
+++ /dev/null
@@ -1,103 +1,1 @@
---- a/testing/timeit.sh
-+++ b/testing/timeit.sh
-@@ -1,11 +1,8 @@
- #!/bin/bash
- 
--# "man 1 time" for details
--export TIME="%U seconds"
--
- add()
- {
--	if ! dc -e ""; then
-+	if ! dc p >/dev/null 2>&1; then
- 	        echo you do not have dc, so I cannot add these numbers...
- 	        exit 1
- 	fi
-@@ -14,7 +11,7 @@ add()
- 	tot=0
- 
- 	while read n; do
--	        tot=`dc -e "$n $tot + pop" 2> /dev/null`
-+	        tot=`dc $n $tot + p 2> /dev/null`
- 	done
- 
- 	echo $tot seconds
-@@ -34,7 +31,7 @@ extract()
- 
- if [ ! $3 ] || [ $2 == "-h" ] || [ $2 == "--help" ]; then
- 	echo
--	echo Syntax: ./timeit.sh patternfile kernel\|userspace all\|print\|real [data_files]
-+	echo Syntax: .//usr/bin/timeit.sh patternfile kernel\|userspace all\|print\|real [data_files]
- 	echo
- 	echo \"kernel\" uses the kernel pattern and library
- 	echo \"userspace\" uses userspace pattern and library
-@@ -72,12 +69,12 @@ echo Timing $1
- if [ $3 == "all" ]; then
- 	echo Using all characters
- 	if [ $2 == "kernel" ]; then
--		if ! ./randchars | time $speedprog "`extract $1`" verbose; then
-+		if ! ./randchars | /usr/bin/time $speedprog "`extract $1`" verbose 2>&1 >/dev/null | grep user | cut -d\  -f2; then
- 			echo $speedprog failed. > /dev/stderr
- 			exit 1
- 		fi
- 	else
--		if ! ./randchars | time $speedprog -f "$1" -v; then
-+		if ! ./randchars | /usr/bin/time $speedprog -f "$1" -v 2>&1 >/dev/null | grep user | cut -d\  -f2; then
- 			echo $speedprog failed. > /dev/stderr
- 			exit 1
- 		fi
-@@ -85,12 +82,12 @@ if [ $3 == "all" ]; then
- elif [ $3 == "print" ]; then
- 	echo Using only printable characters
- 	if [ $2 == "kernel" ]; then
--		if ! ./randprintable | time $speedprog "`extract $1`" verbose; then
-+		if ! ./randprintable | /usr/bin/time $speedprog "`extract $1`" verbose 2>&1 >/dev/null | grep user | cut -d\  -f2; then
- 			echo $speedprog failed. > /dev/stderr
- 			exit 1
- 		fi
- 	else
--		if ! ./randprintable | time $speedprog -f "$1" -v; then
-+		if ! ./randprintable | /usr/bin/time $speedprog -f "$1" -v 2>&1 >/dev/null | grep user | cut -d\  -f2; then
- 			echo $speedprog failed. > /dev/stderr
- 			exit 1
- 		fi
-@@ -107,12 +104,12 @@ elif [ $3 == "real" ]; then
- 				printf $f\\t
- 				#echo `extract $1`
- 				if [ $2 == "kernel" ]; then
--					if ! cat $f | time $speedprog "`extract $1`" 2> /dev/stdout | tee -a tmp.$$; then
-+					if ! cat $f | /usr/bin/time $speedprog "`extract $1`" 2>&1 >/dev/null | grep user | cut -d\  -f2 | tee -a tmp.$$; then
- 						echo $speedprog failed. > /dev/stderr
- 						exit 1
- 					fi
- 				else
--					if ! cat $f | time $speedprog -f "$1" 2> /dev/stdout | tee -a tmp.$$; then
-+					if ! cat $f | /usr/bin/time $speedprog -f "$1" 2>&1 >/dev/null | grep user | cut -d\  -f2 | tee -a tmp.$$; then
- 						echo $speedprog failed. > /dev/stderr
- 						exit 1
- 					fi
-@@ -123,12 +120,12 @@ elif [ $3 == "real" ]; then
- 		for f in data/*; do
- 			printf $f\\t
- 			if [ $2 == "kernel" ]; then
--				if ! cat $f | time $speedprog "`extract $1`" 2> /dev/stdout | tee -a tmp.$$; then
-+				if ! cat $f | /usr/bin/time $speedprog "`extract $1`" 2>&1 >/dev/null | grep user | cut -d\  -f2 | tee -a tmp.$$; then
- 					echo $speedprog failed. > /dev/stderr
- 					exit 1
- 				fi
- 			else
--				if ! cat $f | time $speedprog -f "$1" 2> /dev/stdout | tee -a tmp.$$; then
-+				if ! cat $f | /usr/bin/time $speedprog -f "$1" 2>&1 >/dev/null | grep user | cut -d\  -f2 | tee -a tmp.$$; then
- 					echo $speedprog failed. > /dev/stderr
- 					exit 1
- 				fi
-@@ -137,7 +134,7 @@ elif [ $3 == "real" ]; then
- 	fi
- 
- 	printf Total:\ 
--	cat tmp.$$ | cut -d\  -f 2 | add
-+	cat tmp.$$ | cut -ds -f 1| add
- 
- 	rm tmp.$$
- else
 

--- a/net/l7-protocols/patches/102-testing-doallspeeds.patch
+++ /dev/null
@@ -1,17 +1,1 @@
---- a/testing/doallspeeds.sh
-+++ b/testing/doallspeeds.sh
-@@ -25,11 +25,11 @@ for f in ../*/*.pat; do 
- 	printf `basename $f .pat`
- 
- 	if [ $userspace ]; then 
--		gtime=`./timeit.sh $f userspace   real | grep Total | cut -d\  -f 2`
-+		gtime=`./timeit.sh $f userspace   real | grep Total | cut -d\  -f 2 | awk '{print $1}'`
- 		printf \\t$gtime
- 	fi
- 	if [ $kernel ]; then 
--		htime=`./timeit.sh $f kernel real | grep Total | cut -d\  -f 2`
-+		htime=`./timeit.sh $f kernel real | grep Total | cut -d\  -f 2 | awk '{print $1}'`
- 		printf \\t$htime
- 	fi
- 	printf \\n
 

--- a/net/netdiscover/Makefile
+++ /dev/null
@@ -1,42 +1,1 @@
-#
-# Copyright (C) 2009-2010 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=netdiscover
-PKG_VERSION:=0.3-beta6
-PKG_RELEASE:=3
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://nixgeneration.com/~jaime/netdiscover/releases/
-PKG_MD5SUM:=0919227a91ecaeeb2443cff249417be2
-
-PKG_FIXUP:=autoreconf
-PKG_INSTALL:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/netdiscover
-  SECTION:=net
-  CATEGORY:=Network
-  DEPENDS:=+libpcap +libnet1 +libpthread
-  TITLE:=An active/passive address reconnaissance tool
-  URL:=http://nixgeneration.com/~jaime/netdiscover/
-  MAINTAINER:=Daniel Dickinson <openwrt@cshore.neomailbox.net>
-endef
-
-CONFIGURE_VARS+= \
-	CPPFLAGS="$(TARGET_CPPFLAGS) -I$(STAGING_DIR)/usr/lib/libnet-1.1.x/include" \
-	LDFLAGS="$(TARGET_LDFLAGS) -L$(STAGING_DIR)/usr/lib/libnet-1.1.x/lib" \
-
-define Package/netdiscover/install
-	$(INSTALL_DIR) $(1)/usr/sbin
-	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/netdiscover $(1)/usr/sbin/
-endef
-
-$(eval $(call BuildPackage,netdiscover))
-

--- a/net/netdiscover/patches/00-add-machine-ouput.patch
+++ /dev/null
@@ -1,468 +1,1 @@
-diff -Naur netdiscover-0.3-beta6.orig/src/ifaces.c netdiscover-0.3-beta6/src/ifaces.c
---- netdiscover-0.3-beta6.orig/src/ifaces.c	2009-06-24 18:21:11.000000000 -0400
-+++ netdiscover-0.3-beta6/src/ifaces.c	2009-06-24 21:44:05.000000000 -0400
-@@ -127,6 +127,7 @@
-       memcpy(type, packet + 20, 2); 		/* ARP Opcode */
-       new_arprep_l->header = new_header;	/* Add header */
-       new_arprep_l->count = 1;				/* Count      */
-+      new_arprep_l->printed = 0;
-       new_arprep_l->next = NULL;
-       
-       /* Source IP */
-diff -Naur netdiscover-0.3-beta6.orig/src/main.c netdiscover-0.3-beta6/src/main.c
---- netdiscover-0.3-beta6.orig/src/main.c	2009-06-24 18:21:11.000000000 -0400
-+++ netdiscover-0.3-beta6/src/main.c	2009-06-24 21:34:59.000000000 -0400
-@@ -30,6 +30,7 @@
- #include <unistd.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <signal.h>
- #include "ifaces.h"
- #include "screen.h"
- 
-@@ -39,8 +40,17 @@
- 	char *disp;
- 	char *sip;
- 	int autos;
-+	int machine;
- };
- 
-+/* Injection Thread data structure */
-+struct t_inject {
-+  struct t_data *datos;
-+  pthread_t *sniffer;
-+  pthread_t *screen;
-+  pthread_t *keys;
-+  int scan_secs;
-+};
- 
- void *inject_arp(void *arg);
- void *screen_refresh(void *arg);
-@@ -77,7 +87,7 @@
- 
- 
- pthread_t injection, sniffer, screen, keys;
--int fastmode, pcount, node, ssleep;
-+int fastmode, pcount, node, ssleep, nokeywait;
- long sleept;
- 
- 
-@@ -86,7 +96,9 @@
- {
-     while ( 1 == 1 )
-     {
--        read_key();
-+	struct t_data *datos;
-+	datos = (struct t_data *)arg;
-+        read_key(datos->machine);
-     }
- }
- 
-@@ -97,20 +109,24 @@
- 	int c;
- 	int esniff = 0;
- 	int erange = 0;
-+	int scan_secs = 0;
- 	struct t_data datos;
--	
-+	struct t_inject injectdata;
-+
- 	datos.sip = NULL;
- 	datos.disp = NULL;
-+	datos.machine = 0;
- 	datos.autos = 0;
- 	sleept = 99;
- 	node = 67;
- 	pcount = 1;
-+	nokeywait = 0;
- 	
- 	current_network = (char *) malloc ((sizeof(char)) * 16);
- 	sprintf(current_network,"Starting.");
- 	
- 	/* Fetch parameters */
--	while ((c = getopt(argc, argv, "i:s:r:n:c:pSfh")) != EOF)
-+	while ((c = getopt(argc, argv, "i:s:r:n:c:t:pSfhkm")) != EOF)
- 	{
- 		switch (c)
- 		{
-@@ -138,12 +154,20 @@
- 			case  'n':
- 				node = atoi(optarg);
- 				break;
-+
-+            		case 't':
-+		                scan_secs = atoi(optarg);
-+                                break;
- 			
- 			case  'r':
- 				datos.sip = (char *) malloc (sizeof(char) * strlen(optarg));
- 				sprintf(datos.sip, "%s", optarg);
- 				erange = 1;
- 				break;
-+
-+			case 'm':
-+			       datos.machine = 1;
-+			       break;
- 			
- 			case  'f':
- 				fastmode = 1;
-@@ -153,6 +177,10 @@
- 				usage(argv[0]);
- 				exit(1);
- 				break;
-+
-+               		case 'k':
-+			        nokeywait = 1;
-+			        break;
- 			
- 			default:
- 				break;
-@@ -181,7 +209,7 @@
- 	/* Init some stuff */
- 	lnet_init(datos.disp);
- 	init_lists();
--	system("clear");
-+	if (!datos.machine) system("clear");
- 	
- 	/* If no mode was selected, enable auto scan */
- 	if ((erange != 1) && (esniff != 1))
-@@ -189,9 +217,15 @@
- 		datos.autos = 1;
- 	}
- 	
-+	
- 	/* Start the execution */
--	pthread_create(&screen, NULL, screen_refresh, (void *)NULL);
--	pthread_create(&keys, NULL, keys_thread, (void *)NULL);
-+	pthread_create(&screen, NULL, screen_refresh, (void *)&datos);
-+	if (!nokeywait) {
-+	  pthread_create(&keys, NULL, keys_thread, (void *)&datos);
-+	  injectdata.keys = &keys;
-+	} else {
-+	  injectdata.keys = NULL;
-+	}
- 	pthread_create(&sniffer, NULL, start_sniffer, (void *)&datos);
- 	
- 	if (esniff == 1)
-@@ -201,10 +235,19 @@
- 	}
- 	else
- 	{
--		if (pthread_create(&injection, NULL, inject_arp, (void *)&datos))
-+                injectdata.datos = &datos;
-+                injectdata.sniffer = &sniffer;
-+                injectdata.screen = &screen;
-+                injectdata.scan_secs = scan_secs;
-+
-+		if (pthread_create(&injection, NULL, inject_arp, (void *)&injectdata))
- 			perror("Could not create injection thread");
- 		
--		pthread_join(sniffer,NULL);
-+		if (scan_secs > 0) {
-+		  pthread_join(injection,NULL);
-+		} else {
-+		  pthread_join(sniffer,NULL);
-+		}
- 	}
- 	
- 	
-@@ -215,10 +258,11 @@
- /* Refresh screen function called by screen thread */
- void *screen_refresh(void *arg)
- {
--	
-+	struct t_data *datos;
-+	datos = (struct t_data *)arg;
- 	while (1==1)
- 	{
--		print_screen();
-+		print_screen(datos->machine);
- 		sleep(1);
- 	}
- 	
-@@ -228,9 +272,11 @@
- /* Inject ARP Replys to the network */
- void *inject_arp(void *arg)
- {	
-+        struct t_inject *inject;
- 	struct t_data *datos;
- 		
--	datos = (struct t_data *)arg;
-+	inject = (struct t_inject *)arg;
-+	datos = inject->datos;
- 	sleep(2);
- 	
- 	if ( datos->autos != 1 )
-@@ -251,6 +297,12 @@
- 	
- 	sprintf(current_network,"Finished!");
- 	lnet_destroy();
-+	if (inject->scan_secs > 0) {
-+ 		sleep(inject->scan_secs);  
-+		pthread_kill(*(inject->sniffer), SIGKILL);
-+		pthread_kill(*(inject->screen), SIGKILL);
-+		pthread_kill(*(inject->keys), SIGKILL);
-+	}
- 	
- 	return NULL;
- }
-@@ -400,6 +452,9 @@
- 		"  -n node: last ip octet used for scanning (from 2 to 253)\n"
- 		"  -S enable sleep time supression betwen each request (hardcore mode)\n"
- 		"  -f enable fastmode scan, saves a lot of time, recommended for auto\n\n"
-+	        "  -k nokeywait: Don't wait for keypress\n"
-+		"  -t time: maximum time to listen after last arp request sent (seconds)\n"
-+	        "  -m don't clear and format screen, just output replies\n"
- 		"If -p or -r arent enabled, netdiscover will scan for common lan addresses\n",
- 		VERSION, comando);
- }
-diff -Naur netdiscover-0.3-beta6.orig/src/screen.c netdiscover-0.3-beta6/src/screen.c
---- netdiscover-0.3-beta6.orig/src/screen.c	2009-06-24 18:21:11.000000000 -0400
-+++ netdiscover-0.3-beta6/src/screen.c	2009-06-25 19:15:24.000000000 -0400
-@@ -114,7 +114,7 @@
- 
- 
- /* Read input keys */
--void read_key()
-+void read_key(int machine)
- {
-     int ch;
-     ch = getchar();
-@@ -162,12 +162,12 @@
-        smode = 2;
-     }
- 	 
--	 print_screen();
-+	 print_screen(machine);
- }
- 
- 
- /* Clear and fill the screen */
--void print_screen()
-+void print_screen(int machine)
- {
- 	/* Get Console Size */
-    if (ioctl(0, TIOCGWINSZ, &win_sz) < 0)
-@@ -177,16 +177,16 @@
-    }
- 	 
- 	/* Flush and print screen */
--	fprintf( stderr, "\33[1;1H" );
--	fill_screen();
--	fprintf( stderr, "\33[J" );
-+        if (!machine) fprintf( stderr, "\33[1;1H" );
-+	fill_screen(machine);
-+	if (!machine) fprintf( stderr, "\33[J" );
- 	fflush(stdout);
- }
- 
- 
- /* Fills the screen using white spaces to avoid refresh problems  *
-  * not a very smart way, but it works :)                          */
--void fill_screen()
-+void fill_screen(int machine)
- {
-    int x, j;
-    struct arp_rep_l *arprep_l;
-@@ -196,40 +196,42 @@
-    
-    pthread_mutex_lock(listm);	
- 	
--   sprintf(line, " Currently scanning: %s   |   Our Mac is: %s - %i", 
--           current_network, ourmac, scroll);
--   printf("%s", line);
--	
--   /* Fill with spaces */
--   for (j=strlen(line); j<win_sz.ws_col - 1; j++)
--         printf(" ");
--   printf("\n");
--	
--	/* Print blank line with spaces */
--   for (j=0; j<win_sz.ws_col - 1; j++)
--         printf(" ");
--   printf("\n");
--
--
--   sprintf(line, " %d Captured ARP Req/Rep packets, from %d hosts.   Total size: %d", 
--           arprep_count->count, arprep_count->hosts, arprep_count->length);
--   printf("%s", line);
--	
--   /* Fill with spaces */
--   for (j=strlen(line); j<win_sz.ws_col - 1; j++)
--         printf(" ");
--   printf("\n");
--	
--	
--   /* Print Header and counters */
--   printf(" _____________________________________________________________________________\n");
--   if (smode == 0 || (oldmode == 0 && smode == 2))
--   	printf("   IP            At MAC Address      Count  Len   MAC Vendor                   \n");
--   else if (smode == 1 || (oldmode == 1 && smode == 2))
--   	printf("   IP            At MAC Address      Requests IP     Count                     \n");
--   printf(" ----------------------------------------------------------------------------- \n");
--
--
-+   
-+   if (!machine) {
-+     sprintf(line, " Currently scanning: %s   |   Our Mac is: %s - %i", 
-+	     current_network, ourmac, scroll);
-+     printf("%s", line);
-+	
-+     /* Fill with spaces */
-+     for (j=strlen(line); j<win_sz.ws_col - 1; j++)
-+       printf(" ");
-+     printf("\n");
-+     
-+     /* Print blank line with spaces */
-+     for (j=0; j<win_sz.ws_col - 1; j++)
-+       printf(" ");
-+     printf("\n");
-+     
-+
-+     sprintf(line, " %d Captured ARP Req/Rep packets, from %d hosts.   Total size: %d", 
-+	     arprep_count->count, arprep_count->hosts, arprep_count->length);
-+     printf("%s", line);
-+     
-+     /* Fill with spaces */
-+     for (j=strlen(line); j<win_sz.ws_col - 1; j++)
-+       printf(" ");
-+     printf("\n");
-+	
-+     
-+     /* Print Header and counters */
-+     printf(" _____________________________________________________________________________\n");
-+     if (smode == 0 || (oldmode == 0 && smode == 2))
-+       printf("   IP            At MAC Address      Count  Len   MAC Vendor                   \n");
-+     else if (smode == 1 || (oldmode == 1 && smode == 2))
-+       printf("   IP            At MAC Address      Requests IP     Count                     \n");
-+     printf(" ----------------------------------------------------------------------------- \n");
-+   }
-+   
-    /* Print each found station trough arp reply */
-    if (smode == 0)
-    {
-@@ -243,12 +245,12 @@
-             sprintf(tline, " ");
-             
-             /* Set IP */
--            sprintf(tline, "%s ", arprep_l->sip);
-+            sprintf(tline, "%s ", arprep_l->sip);	    
-             strcat(line, tline);
--            
--            /* Fill with spaces */
--            for (j=strlen(line); j<17; j++)
--               strcat(line, blank);
-+   
-+	    /* Fill with spaces */
-+	    for (j=strlen(line); j<17; j++)
-+	      strcat(line, blank);
-             
-             /* IP & MAC */
-             sprintf(tline, "%02x:%02x:%02x:%02x:%02x:%02x    ",
-@@ -260,21 +262,29 @@
-             /* Count, Length & Vendor */
-             sprintf(tline, "%02d    %03d   %s", arprep_l->count, 
-                     arprep_l->header->length, arprep_l->vendor );
--            strcat(line, tline);
--            
--            /* Fill again with spaces */
--            for (j=strlen(line); j<win_sz.ws_col - 1; j++)
--               strcat(line, blank);
-+	    strcat(line, tline);
-             
--            printf("%s\n", line);
-+	    /* Fill again with spaces */
-+	    for (j=strlen(line); j<win_sz.ws_col - 1; j++)
-+	      strcat(line, blank);
-+
-+	    if (!arprep_l->printed) {
-+	      printf("%s\n", line);	    
-+	      arprep_l->printed = 1;
-+	      if (!machine) {
-+		arprep_l->printed = 0;
-+	      }
-+	    }
-          }
-          
-          arprep_l = arprep_l->next;
-          x += 1;
--      
--         /* Check if end of screen was reached */
--         if (x >= ( (win_sz.ws_row + scroll) - 7))
--            break;
-+
-+	 if (!machine) {
-+	   /* Check if end of screen was reached */
-+	   if (x >= ( (win_sz.ws_row + scroll) - 7))
-+	     break;
-+	 }
-       }
-       
-    } /* Print only arp request */
-@@ -292,10 +302,10 @@
-             /* Get source IP */
-             sprintf(tline, "%s ", arprep_l->sip);
-             strcat(line, tline);
--            
--            /* Fill with spaces */
--            for (j=strlen(line); j<17; j++)
--               strcat(line, blank);
-+
-+	    /* Fill with spaces */
-+	    for (j=strlen(line); j<17; j++)
-+	      strcat(line, blank);
-             
-             /* Get source MAC */
-             sprintf(tline, "%02x:%02x:%02x:%02x:%02x:%02x   ",
-@@ -308,27 +318,29 @@
-             sprintf(tline, "%s", arprep_l->dip);
-             strcat(line, tline);
-             
--            /* Fill with spaces */
--            for (j=strlen(line); j<54; j++)
--               strcat(line, blank);
-+	    /* Fill with spaces */
-+	    for (j=strlen(line); j<54; j++)
-+	      strcat(line, blank);
-             
-             /* Count, Length & Vendor */
-             sprintf(tline, "%02d", arprep_l->count);
-             strcat(line, tline);
-             
--            /* Fill again with spaces */
--            for (j=strlen(line); j<win_sz.ws_col - 1; j++)
--               strcat(line, blank);
-+	    /* Fill again with spaces */
-+	    for (j=strlen(line); j<win_sz.ws_col - 1; j++)
-+	      strcat(line, blank);
-             
-             printf("%s\n", line);
-          }
-          
-          arprep_l = arprep_l->next;
-          x += 1;
--      
--         /* Check if end of screen was reached */
--         if (x >= ( (win_sz.ws_row + scroll) - 7))
--            break;
-+
-+	 if (!machine) {
-+	   /* Check if end of screen was reached */
-+	   if (x >= ( (win_sz.ws_row + scroll) - 7))
-+	     break;
-+	 }
-       }
-    }
-    else if(smode == 2)
-diff -Naur netdiscover-0.3-beta6.orig/src/screen.h netdiscover-0.3-beta6/src/screen.h
---- netdiscover-0.3-beta6.orig/src/screen.h	2009-06-24 18:21:11.000000000 -0400
-+++ netdiscover-0.3-beta6/src/screen.h	2009-06-24 21:42:13.000000000 -0400
-@@ -60,6 +60,7 @@
- 	char *vendor;
- 	short type;
- 	unsigned int count;
-+        int printed;
- 	struct arp_rep_l *next;
- };
- 
 

--- a/net/netdiscover/patches/01-initfix+end-fix.patch
+++ /dev/null
@@ -1,35 +1,1 @@
-diff -Naur netdiscover-0.3-beta6.01machine/src/main.c netdiscover-0.3-beta6/src/main.c
---- netdiscover-0.3-beta6.01machine/src/main.c	2009-06-25 18:19:18.000000000 -0400
-+++ netdiscover-0.3-beta6/src/main.c	2009-07-16 06:37:43.000000000 -0400
-@@ -121,6 +121,8 @@
- 	node = 67;
- 	pcount = 1;
- 	nokeywait = 0;
-+	fastmode = 0;
-+	ssleep = 0;
- 	
- 	current_network = (char *) malloc ((sizeof(char)) * 16);
- 	sprintf(current_network,"Starting.");
-@@ -250,7 +252,6 @@
- 		}
- 	}
- 	
--	
- 	return 0;
- }
- 
-@@ -299,9 +300,10 @@
- 	lnet_destroy();
- 	if (inject->scan_secs > 0) {
-  		sleep(inject->scan_secs);  
--		pthread_kill(*(inject->sniffer), SIGKILL);
--		pthread_kill(*(inject->screen), SIGKILL);
--		pthread_kill(*(inject->keys), SIGKILL);
-+		pthread_kill(*(inject->sniffer), SIGTERM);
-+		pthread_kill(*(inject->screen), SIGTERM);
-+		pthread_kill(*(inject->keys), SIGTERM);
-+		sighandler(SIGTERM);
- 	}
- 	
- 	return NULL;
 

file:a/net/netperf/Makefile (deleted)
--- a/net/netperf/Makefile
+++ /dev/null
@@ -1,48 +1,1 @@
-#
-# Copyright (C) 2006-2011 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=netperf
-PKG_VERSION:=2.6.0
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=ftp://ftp.netperf.org/netperf/
-PKG_MD5SUM:=9654ffdfd4c4f2c93ce3733cd9ed9236
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/netperf
-  SECTION:=net
-  CATEGORY:=Network
-  TITLE:=Network performance measurement tool
-  URL:=http://www.netperf.org/
-endef
-
-CONFIGURE_ARGS += --enable-demo
-
-define Package/netperf/install
-	$(INSTALL_DIR) $(1)/etc/init.d
-	$(INSTALL_BIN) ./files/netserver.init $(1)/etc/init.d/netserver
-	$(INSTALL_DIR) $(1)/usr/bin
-	$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/netperf $(1)/usr/bin/
-	$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/netserver $(1)/usr/bin/
-	$(INSTALL_DIR) $(1)/lib/netperf
-	$(INSTALL_BIN) $(PKG_BUILD_DIR)/doc/examples/arr_script $(1)/lib/netperf
-	$(INSTALL_BIN) $(PKG_BUILD_DIR)/doc/examples/packet_byte_script $(1)/lib/netperf
-	$(INSTALL_BIN) $(PKG_BUILD_DIR)/doc/examples/sctp_stream_script $(1)/lib/netperf
-	$(INSTALL_BIN) $(PKG_BUILD_DIR)/doc/examples/snapshot_script $(1)/lib/netperf
-	$(INSTALL_BIN) $(PKG_BUILD_DIR)/doc/examples/tcp_range_script $(1)/lib/netperf
-	$(INSTALL_BIN) $(PKG_BUILD_DIR)/doc/examples/tcp_rr_script $(1)/lib/netperf
-	$(INSTALL_BIN) $(PKG_BUILD_DIR)/doc/examples/tcp_stream_script $(1)/lib/netperf
-	$(INSTALL_BIN) $(PKG_BUILD_DIR)/doc/examples/udp_rr_script $(1)/lib/netperf
-	$(INSTALL_BIN) $(PKG_BUILD_DIR)/doc/examples/udp_stream_script $(1)/lib/netperf
-endef
-
-$(eval $(call BuildPackage,netperf))
-

--- a/net/netperf/files/netserver.init
+++ /dev/null
@@ -1,13 +1,1 @@
-#!/bin/sh /etc/rc.common
-# Copyright (C) 2006-2011 OpenWrt.org
 
-START=50
-
-start() {
-	service_start /usr/bin/netserver
-}
-
-stop() {
-	service_stop /usr/bin/netserver
-}
-

file:a/net/ngircd/Makefile (deleted)
--- a/net/ngircd/Makefile
+++ /dev/null
@@ -1,94 +1,1 @@
-#
-# Copyright (C) 2008-2012 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=ngircd
-PKG_VERSION:=18
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:= \
-        http://ngircd.barton.de/pub/ngircd/ \
-        ftp://ftp.berlios.de/pub/ngircd/
-PKG_MD5SUM:=4958c8b2d128cf3e9888af3f782892a1
-
-PKG_INSTALL:=1
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/ngircd/Default
-  SECTION:=net
-  CATEGORY:=Network
-  SUBMENU:=Instant Messaging
-  DEPENDS:=+zlib
-  TITLE:=Next Generation IRC Server
-  URL:=http://ngircd.barton.de
-endef
-
-define Package/ngircd/Default/description
-  ngIRCd is an Open Source server for the Internet Relay Chat (IRC), which
-  is developed and published under the terms of the GNU General Public Licence.
-  ngIRCd means "next generation IRC daemon", it's written from scratch and
-  not deduced from the "grandfather of IRC daemons", the daemon of the IRCNet.
-endef
-
-define Package/ngircd
-  $(call Package/ngircd/Default)
-  TITLE+= (with OpenSSL support)
-  DEPENDS+= +libopenssl
-  VARIANT:=ssl
-endef
-
-define Package/ngircd/conffiles
-/etc/ngircd.conf
-endef
-
-define Package/ngircd/description
-  $(call Package/ngircd/Default/description)
-  This package is built with OpenSSL support.
-endef
-
-define Package/ngircd-nossl
-$(call Package/ngircd/Default)
-  TITLE+= (without OpenSSL support)
-  VARIANT:=nossl
-endef
-
-Package/ngircd-nossl/conffiles = $(Package/ngircd/conffiles)
-
-define Package/ngircd-nossl/description
-  $(call Package/ngircd/Default/description)
-  This package is built without OpenSSL support.
-endef
-
-ifeq ($(BUILD_VARIANT),ssl)
-	CONFIGURE_ARGS += \
-		--with-openssl="$(STAGING_DIR)/usr"
-endif
-
-ifeq ($(BUILD_VARIANT),nossl)
-	CONFIGURE_ARGS += \
-		--without-openssl
-endif
-
-define Package/ngircd/install
-	$(INSTALL_DIR) $(1)/usr/sbin
-	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ngircd $(1)/usr/sbin/
-	$(INSTALL_DIR) $(1)/etc
-	$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/ngircd.conf $(1)/etc/
-	$(INSTALL_DIR) $(1)/etc/init.d
-	$(INSTALL_BIN) ./files/ngircd.init $(1)/etc/init.d/ngircd
-endef
-
-Package/ngircd-nossl/install = $(Package/ngircd/install)
-
-$(eval $(call BuildPackage,ngircd))
-$(eval $(call BuildPackage,ngircd-nossl))
-

--- a/net/ngircd/files/ngircd.init
+++ /dev/null
@@ -1,12 +1,1 @@
-#!/bin/sh /etc/rc.common
 
-START=65
-
-start() {
-	service_start /usr/sbin/ngircd
-}
-
-stop() {
-	service_stop /usr/sbin/ngircd
-}
-

file:a/net/pptpd/Makefile (deleted)
--- a/net/pptpd/Makefile
+++ /dev/null
@@ -1,67 +1,1 @@
-#
-# Copyright (C) 2006-2014 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=pptpd
-PKG_VERSION:=1.4.0
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=@SF/poptop
-PKG_MD5SUM:=36f9f45c6ffa92bc3b6e24ae2d053505
-
-PKG_INSTALL:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/pptpd
-  SECTION:=net
-  CATEGORY:=Network
-  DEPENDS:=+kmod-ppp +kmod-gre +kmod-mppe +ppp
-  TITLE:=PopTop pptp server
-  URL:=http://www.poptop.org/
-  SUBMENU:=VPN
-endef
-
-CONFIGURE_ARGS += \
-	--enable-bcrelay \
-
-CONFIGURE_VARS += \
-	ac_cv_header_libintl_h=no \
-
-MAKE_FLAGS += \
-	COPTS="$(TARGET_CFLAGS)" \
-	INSTALL="install" \
-
-define Package/pptpd/conffiles
-/etc/pptpd.conf
-/etc/ppp/options.pptpd
-/etc/config/pptpd
-endef
-
-define Package/pptpd/install
-	$(INSTALL_DIR) $(1)/usr/sbin
-	$(CP) \
-		$(PKG_INSTALL_DIR)/usr/sbin/bcrelay \
-		$(PKG_INSTALL_DIR)/usr/sbin/pptpctrl \
-		$(PKG_INSTALL_DIR)/usr/sbin/pptpd \
-		$(1)/usr/sbin/
-	$(INSTALL_DIR) $(1)/usr/lib/pptpd
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/pptpd/* $(1)/usr/lib/pptpd/
-	$(INSTALL_DIR) $(1)/etc
-	$(INSTALL_DATA) ./files/pptpd.conf $(1)/etc/
-	$(INSTALL_DIR) $(1)/etc/init.d
-	$(INSTALL_BIN) ./files/pptpd.init $(1)/etc/init.d/pptpd
-	$(INSTALL_DIR) $(1)/etc/ppp
-	$(INSTALL_DATA) ./files/options.pptpd $(1)/etc/ppp/
-	$(INSTALL_DIR) $(1)/etc/config
-	$(INSTALL_DATA) ./files/pptpd.config $(1)/etc/config/pptpd
-endef
-
-$(eval $(call BuildPackage,pptpd))
-

--- a/net/pptpd/files/options.pptpd
+++ /dev/null
@@ -1,23 +1,1 @@
-#debug
-#logfile /tmp/pptp-server.log
-auth
-name "pptp-server"
-lcp-echo-failure 3
-lcp-echo-interval 60
-default-asyncmap
-mtu 1482
-mru 1482
-nobsdcomp
-nodeflate
-#noproxyarp
-#nomppc
-mppe required,no40,no56,stateless
-require-mschap-v2
-refuse-chap
-refuse-mschap
-refuse-eap
-refuse-pap
-#ms-dns 172.16.1.1
-#plugin radius.so
-#radius-config-file /etc/radius.conf
 

--- a/net/pptpd/files/pptpd.conf
+++ /dev/null
@@ -1,6 +1,1 @@
-#debug
-option /etc/ppp/options.pptpd
-speed 115200
-stimeout 10
-#localip & remoteip are not needed, ip management is done by pppd
 

--- a/net/pptpd/files/pptpd.config
+++ /dev/null
@@ -1,9 +1,1 @@
-config service 'pptpd'
-	option 'enabled' '0'
-	option 'localip' '192.168.0.1'
-	option 'remoteip' '192.168.0.20-30'
 
-config 'login'
-	option 'username' 'youruser'
-	option 'password' 'yourpass'
-

--- a/net/pptpd/files/pptpd.init
+++ /dev/null
@@ -1,59 +1,1 @@
-#!/bin/sh /etc/rc.common
-# Copyright (C) 2006 OpenWrt.org
 
-START=60
-BIN=/usr/sbin/pptpd
-DEFAULT=/etc/default/$BIN
-RUN_D=/var/run
-PID_F=$RUN_D/$BIN.pid
-CONFIG=/var/etc/pptpd.conf
-CHAP_SECRETS=/var/etc/chap-secrets
-
-setup_login() {
-	local section="$1"
-
-	config_get username "$section" username
-	config_get password "$section" password
-	[ -n "$username" ] || return 0
-	[ -n "$password" ] || return 0
-
-	echo "$username pptp-server $password *" >> $CHAP_SECRETS
-}
-
-setup_config() {
-	local section="$1"
-
-	config_get enabled "$section" enabled
-	[ "$enabled" -eq 0 ] && return 1
-
-	mkdir -p /var/etc
-	cp /etc/pptpd.conf $CONFIG
-
-	config_get localip "$section" localip
-	config_get remoteip "$section" remoteip
-	[ -n "$localip" ] && echo "localip  $localip" >> $CONFIG
-	[ -n "$remoteip" ] && echo "remoteip  $remoteip" >> $CONFIG
-	return 0
-}
-
-start_pptpd() {
-	[ -f $DEFAULT ] && . $DEFAULT
-	mkdir -p $RUN_D
-	for m in arc4 sha1_generic slhc crc-ccitt ppp_generic ppp_async ppp_mppe; do
-		insmod $m >/dev/null 2>&1
-	done
-	ln -sfn $CHAP_SECRETS /etc/ppp/chap-secrets
-	service_start $BIN $OPTIONS -c $CONFIG
-}
-
-start() {
-	config_load pptpd
-	setup_config pptpd || return
-	config_foreach setup_login login
-	start_pptpd
-}
-
-stop() {
-	service_stop $BIN
-}
-

--- a/net/pptpd/patches/001-bad_pqueue_debug.patch
+++ /dev/null
@@ -1,19 +1,1 @@
---- a/pqueue.c
-+++ b/pqueue.c
-@@ -7,13 +7,11 @@
- #include "pqueue.h"
- 
- #ifdef DEBUG_PQUEUE
--#define DEBUG_ON 1
-+#define DEBUG_CMD(_a) { _a }
- #else
--#define DEBUG_ON 0
-+#define DEBUG_CMD(_a)
- #endif
- 
--#define DEBUG_CMD(_a) if (DEBUG_ON) { _a }
--
- #define MIN_CAPACITY 128 /* min allocated buffer for a packet */
- 
- static int pqueue_alloc (int seq, unsigned char *packet, int packlen, pqueue_t **new);
 

--- a/net/pptpd/patches/002-makefile_fix.patch
+++ /dev/null
@@ -1,12 +1,1 @@
---- a/plugins/Makefile
-+++ b/plugins/Makefile
-@@ -18,7 +18,7 @@ all:	$(PLUGINS)
- %.so: %.c
- 	$(CC) -o $@ $(LDFLAGS) $(CFLAGS) $^ $(LDADD)
- 
--LIBDIR	?= $(DESTDIR)$(prefix)/lib/pptpd
-+LIBDIR	= $(DESTDIR)$(prefix)/lib/pptpd
- 
- install: $(PLUGINS)
- 	$(INSTALL) -d $(LIBDIR)
 

--- a/net/pptpd/patches/003-opt_flags.patch
+++ /dev/null
@@ -1,12 +1,1 @@
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -153,7 +153,7 @@ AUTOMAKE = @AUTOMAKE@
- AWK = @AWK@
- CC = @CC@
- CCDEPMODE = @CCDEPMODE@
--CFLAGS = -O2 -fno-builtin -Wall -DSBINDIR='"$(sbindir)"'
-+CFLAGS = $(COPTS) -fno-builtin -Wall -DSBINDIR='"$(sbindir)"'
- CPP = @CPP@
- CPPFLAGS = @CPPFLAGS@
- CYGPATH_W = @CYGPATH_W@
 

file:a/net/reaver/Makefile (deleted)
--- a/net/reaver/Makefile
+++ /dev/null
@@ -1,54 +1,1 @@
-#
-# Copyright (C) 2012 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=reaver
-PKG_REV:=113
-PKG_VERSION:=r$(PKG_REV)
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://reaver-wps.googlecode.com/svn/trunk
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=$(PKG_REV)
-PKG_SOURCE_PROTO:=svn
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/reaver
-  SECTION:=net
-  CATEGORY:=Network
-  SUBMENU:=wireless
-  TITLE:=Efficient brute force attack against Wifi Protected Setup
-  URL:=https://code.google.com/p/reaver-wps/
-  DEPENDS:=+libpcap +libsqlite3
-endef
-
-define Package/reaver/description
-  Reaver targets the external registrar functionality mandated by the WiFi
-  Protected Setup specification.
-  Access points will provide authenticated registrars with their current
-  wireless configuration (including the WPA PSK), and also accept a new
-  configuration from the registrar.
-endef
-
-CONFIGURE_PATH:=src
-
-MAKE_PATH:=src
-
-TARGET_CFLAGS+=$(TARGET_CPPFLAGS)
-
-define Package/reaver/install
-	$(INSTALL_DIR) $(1)/usr/bin
-	$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/{reaver,wash} $(1)/usr/bin/
-	$(INSTALL_DIR) $(1)/etc/reaver
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/src/reaver.db $(1)/etc/reaver/
-endef
-
-$(eval $(call BuildPackage,reaver))
-

--- a/net/reaver/patches/0001-wpscrack-big-endian-fixes.patch
+++ /dev/null
@@ -1,566 +1,1 @@
-From 4e7af9f022996cb0a03b30f6af265b757807dfa2 Mon Sep 17 00:00:00 2001
-From: Paul Fertser <fercerpav@gmail.com>
-Date: Wed, 27 Jun 2012 17:44:55 +0400
-Subject: [PATCH 1/3] wpscrack: big-endian fixes
 
-This should fix access to the radiotap, 802.11, LLC/SNAP and WFA
-headers' fields. Run-time tested on an ar71xx BE system.
-
-Signed-off-by: Paul Fertser <fercerpav@gmail.com>
----
- src/80211.c    |   65 +++++++++++++++++++------------
- src/builder.c  |   23 +++++------
- src/defs.h     |  116 +++++++++++++++++++++++++++++++++++++++-----------------
- src/exchange.c |   23 ++++++-----
- src/wpsmon.c   |   13 ++++--
- 5 files changed, 151 insertions(+), 89 deletions(-)
-
-diff --git a/src/80211.c b/src/80211.c
-index c2aff59..19f1e92 100644
---- a/src/80211.c
-+++ b/src/80211.c
-@@ -90,17 +90,19 @@ void read_ap_beacon()
-                 if(header.len >= MIN_BEACON_SIZE)
-                 {
-                         rt_header = (struct radio_tap_header *) radio_header(packet, header.len);
--                        frame_header = (struct dot11_frame_header *) (packet + rt_header->len);
--
-+			size_t rt_header_len = __le16_to_cpu(rt_header->len);
-+			frame_header = (struct dot11_frame_header *) (packet + rt_header_len);
-+			
- 			if(is_target(frame_header))
- 			{
--                                if(frame_header->fc.type == MANAGEMENT_FRAME && frame_header->fc.sub_type == SUBTYPE_BEACON)
-+                                if((frame_header->fc & __cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
-+				   __cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_BEACON))
-                                 {
--                                       	beacon = (struct beacon_management_frame *) (packet + rt_header->len + sizeof(struct dot11_frame_header));
-+                                       	beacon = (struct beacon_management_frame *) (packet + rt_header_len + sizeof(struct dot11_frame_header));
-                                        	set_ap_capability(beacon->capability);
- 
- 					/* Obtain the SSID and channel number from the beacon packet */
--					tag_offset = rt_header->len + sizeof(struct dot11_frame_header) + sizeof(struct beacon_management_frame);
-+					tag_offset = rt_header_len + sizeof(struct dot11_frame_header) + sizeof(struct beacon_management_frame);
- 					channel = parse_beacon_tags(packet, header.len);
- 					
- 					/* If no channel was manually specified, switch to the AP's current channel */
-@@ -135,29 +137,31 @@ int8_t signal_strength(const u_char *packet, size_t len)
- 	{
- 		header = (struct radio_tap_header *) packet;
- 
--		if((header->flags & SSI_FLAG) == SSI_FLAG)
-+		uint32_t flags = __le32_to_cpu(header->flags);
-+		
-+		if((flags & SSI_FLAG) == SSI_FLAG)
- 		{
--			if((header->flags & TSFT_FLAG) == TSFT_FLAG)
-+			if((flags & TSFT_FLAG) == TSFT_FLAG)
- 			{
- 				offset += TSFT_SIZE;
- 			}
- 
--			if((header->flags & FLAGS_FLAG) == FLAGS_FLAG)
-+			if((flags & FLAGS_FLAG) == FLAGS_FLAG)
- 			{
- 				offset += FLAGS_SIZE;
- 			}
- 	
--			if((header->flags & RATE_FLAG) == RATE_FLAG)
-+			if((flags & RATE_FLAG) == RATE_FLAG)
- 			{
- 				offset += RATE_SIZE;
- 			}
- 
--			if((header->flags & CHANNEL_FLAG) == CHANNEL_FLAG)
-+			if((flags & CHANNEL_FLAG) == CHANNEL_FLAG)
- 			{
- 				offset += CHANNEL_SIZE;
- 			}
- 
--			if((header->flags & FHSS_FLAG) == FHSS_FLAG)
-+			if((flags & FHSS_FLAG) == FHSS_FLAG)
- 			{
- 				offset += FHSS_FLAG;
- 			}
-@@ -196,11 +200,13 @@ int is_wps_locked()
- 		if(header.len >= MIN_BEACON_SIZE)
- 		{
- 			rt_header = (struct radio_tap_header *) radio_header(packet, header.len);
--			frame_header = (struct dot11_frame_header *) (packet + rt_header->len);
-+			size_t rt_header_len = __le16_to_cpu(rt_header->len);
-+			frame_header = (struct dot11_frame_header *) (packet + rt_header_len);
- 
- 			if(memcmp(frame_header->addr3, get_bssid(), MAC_ADDR_LEN) == 0)
- 			{
--				if(frame_header->fc.type == MANAGEMENT_FRAME && frame_header->fc.sub_type == SUBTYPE_BEACON)
-+                                if((frame_header->fc & __cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
-+				   __cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_BEACON))
- 				{
- 					if(parse_wps_parameters(packet, header.len, &wps))
- 					{
-@@ -411,24 +417,30 @@ int associate_recv_loop()
-                 if(header.len >= MIN_AUTH_SIZE)
-                 {
- 			rt_header = (struct radio_tap_header *) radio_header(packet, header.len);
--                        dot11_frame = (struct dot11_frame_header *) (packet + rt_header->len);
-+			size_t rt_header_len = __le16_to_cpu(rt_header->len);
-+			dot11_frame = (struct dot11_frame_header *) (packet + rt_header_len);
- 
-                         if((memcmp(dot11_frame->addr3, get_bssid(), MAC_ADDR_LEN) == 0) &&
-                            (memcmp(dot11_frame->addr1, get_mac(), MAC_ADDR_LEN) == 0))
-                         {
--				if(dot11_frame->fc.type == MANAGEMENT_FRAME)
-+                                if((dot11_frame->fc & __cpu_to_le16(IEEE80211_FCTL_FTYPE)) ==
-+				   __cpu_to_le16(IEEE80211_FTYPE_MGMT))
- 				{
--                                	auth_frame = (struct authentication_management_frame *) (packet + sizeof(struct dot11_frame_header) + rt_header->len);
--                                	assoc_frame = (struct association_response_management_frame *) (packet + sizeof(struct dot11_frame_header) + rt_header->len);
-+                                	auth_frame = (struct authentication_management_frame *) (packet + sizeof(struct dot11_frame_header) + rt_header_len);
-+                                	assoc_frame = (struct association_response_management_frame *) (packet + sizeof(struct dot11_frame_header) + rt_header_len);
- 
- 					/* Did we get an authentication packet with a successful status? */
--					if((dot11_frame->fc.sub_type == SUBTYPE_AUTHENTICATION) && (auth_frame->status == AUTHENTICATION_SUCCESS))
-+					if((dot11_frame->fc & __cpu_to_le16(IEEE80211_FCTL_STYPE)) ==
-+					   __cpu_to_le16(IEEE80211_STYPE_AUTH)
-+					   && (auth_frame->status == __cpu_to_le16(AUTHENTICATION_SUCCESS)))
-                                		{
-                                	        	ret_val = AUTH_OK;
-                                	        	break;
-                                		}
- 					/* Did we get an association packet with a successful status? */
--                               		else if((dot11_frame->fc.sub_type == SUBTYPE_ASSOCIATION) && (assoc_frame->status == ASSOCIATION_SUCCESS))
-+                               		else if((dot11_frame->fc & __cpu_to_le16(IEEE80211_FCTL_STYPE)) ==
-+						__cpu_to_le16(IEEE80211_STYPE_ASSOC_RESP)
-+						&& (assoc_frame->status == __cpu_to_le16(ASSOCIATION_SUCCESS)))
- 					{
- 						ret_val = ASSOCIATE_OK;
- 						break;
-@@ -455,13 +467,14 @@ enum encryption_type supported_encryption(const u_char *packet, size_t len)
- 	if(len > MIN_BEACON_SIZE)
- 	{
- 		rt_header = (struct radio_tap_header *) radio_header(packet, len);
--		beacon = (struct beacon_management_frame *) (packet + rt_header->len + sizeof(struct dot11_frame_header));
--		offset = tag_offset = rt_header->len + sizeof(struct dot11_frame_header) + sizeof(struct beacon_management_frame);
-+		size_t rt_header_len = __le16_to_cpu(rt_header->len);
-+		beacon = (struct beacon_management_frame *) (packet + rt_header_len + sizeof(struct dot11_frame_header));
-+		offset = tag_offset = rt_header_len + sizeof(struct dot11_frame_header) + sizeof(struct beacon_management_frame);
- 		
- 		tag_len = len - tag_offset;
- 		tag_data = (const u_char *) (packet + tag_offset);
- 
--		if((beacon->capability & CAPABILITY_WEP) == CAPABILITY_WEP)
-+		if((__le16_to_cpu(beacon->capability) & CAPABILITY_WEP) == CAPABILITY_WEP)
- 		{
- 			enc = WEP;
- 
-@@ -509,7 +522,7 @@ int parse_beacon_tags(const u_char *packet, size_t len)
- 	struct radio_tap_header *rt_header = NULL;
- 
- 	rt_header = (struct radio_tap_header *) radio_header(packet, len);
--	tag_offset = rt_header->len + sizeof(struct dot11_frame_header) + sizeof(struct beacon_management_frame);
-+	tag_offset = __le16_to_cpu(rt_header->len) + sizeof(struct dot11_frame_header) + sizeof(struct beacon_management_frame);
- 
- 	if(tag_offset < len)
- 	{
-@@ -548,7 +561,7 @@ int parse_beacon_tags(const u_char *packet, size_t len)
- 		{
- 			if(ie_len  == 1)
- 			{
--				memcpy((int *) &channel, channel_data, ie_len);
-+				channel = *(uint8_t*)channel_data;
- 			}
- 			free(channel_data);
- 		}
-@@ -603,13 +616,13 @@ int check_fcs(const u_char *packet, size_t len)
- 	if(len > 4)
- 	{
- 		/* Get the packet's reported FCS (last 4 bytes of the packet) */
--		memcpy((uint32_t *) &fcs, (packet + (len-4)), 4);
-+		fcs = __le32_to_cpu(*(uint32_t*)(packet + (len-4)));
- 
- 		/* FCS is not calculated over the radio tap header */
- 		if(has_rt_header())
- 		{
- 			rt_header = (struct radio_tap_header *) packet;
--			offset += rt_header->len;
-+			offset += __le16_to_cpu(rt_header->len);
- 		}
- 
- 		if(len > offset)
-diff --git a/src/builder.c b/src/builder.c
-index 37f2de7..6bf89e7 100644
---- a/src/builder.c
-+++ b/src/builder.c
-@@ -44,9 +44,8 @@ const void *build_radio_tap_header(size_t *len)
- 		memset((void *) buf, 0, sizeof(struct radio_tap_header));
- 		rt_header = (struct radio_tap_header *) buf;
- 
--		rt_header->len = sizeof(struct radio_tap_header);
--	
--		*len = rt_header->len;
-+		*len = sizeof(struct radio_tap_header);
-+		rt_header->len = __cpu_to_le16(*len);
- 	}
- 	
- 	return buf;
-@@ -67,9 +66,9 @@ const void *build_dot11_frame_header(uint16_t fc, size_t *len)
- 	
- 		frag_seq += SEQ_MASK;
- 
--		header->duration = DEFAULT_DURATION;
--		memcpy((void *) &header->fc, (void *) &fc, sizeof(struct frame_control));
--		header->frag_seq = frag_seq;
-+		header->duration = __cpu_to_le16(DEFAULT_DURATION);
-+		header->fc = __cpu_to_le16(fc);
-+		header->frag_seq = __cpu_to_le16(frag_seq);
- 
- 		memcpy((void *) header->addr1, get_bssid(), MAC_ADDR_LEN);
- 		memcpy((void *) header->addr2, get_mac(), MAC_ADDR_LEN);
-@@ -91,8 +90,8 @@ const void *build_authentication_management_frame(size_t *len)
- 		memset((void *) buf, 0, *len);
- 		frame = (struct authentication_management_frame *) buf;
- 
--		frame->algorithm = OPEN_SYSTEM;
--		frame->sequence = 1;
-+		frame->algorithm = __cpu_to_le16(OPEN_SYSTEM);
-+		frame->sequence = __cpu_to_le16(1);
- 		frame->status = 0;
- 	}
- 	
-@@ -111,8 +110,8 @@ const void *build_association_management_frame(size_t *len)
- 		memset((void *) buf, 0, *len);
- 		frame = (struct association_request_management_frame *) buf;
- 
--		frame->capability = get_ap_capability();
--		frame->listen_interval = LISTEN_INTERVAL;
-+		frame->capability = __cpu_to_le16(get_ap_capability());
-+		frame->listen_interval = __cpu_to_le16(LISTEN_INTERVAL);
- 	}
- 
- 	return buf;
-@@ -133,7 +132,7 @@ const void *build_llc_header(size_t *len)
- 		header->dsap = LLC_SNAP;
- 		header->ssap = LLC_SNAP;
- 		header->control_field = UNNUMBERED_FRAME;
--		header->type = DOT1X_AUTHENTICATION;
-+		header->type = __cpu_to_be16(DOT1X_AUTHENTICATION);
- 
- 	}
- 
-@@ -279,7 +278,7 @@ const void *build_wfa_header(uint8_t op_code, size_t *len)
- 		header = (struct wfa_expanded_header *) buf;
- 	
- 		memcpy(header->id, WFA_VENDOR_ID, sizeof(header->id));
--		header->type = SIMPLE_CONFIG;
-+		header->type = __cpu_to_be32(SIMPLE_CONFIG);
- 		header->opcode = op_code;
- 	}
- 	
-diff --git a/src/defs.h b/src/defs.h
-index b2f45ea..0c628e7 100644
---- a/src/defs.h
-+++ b/src/defs.h
-@@ -41,6 +41,7 @@
- #include <string.h>
- #include <time.h>
- #include <pcap.h>
-+#include <asm/byteorder.h>
- 
- #include "wps.h"
- 
-@@ -65,10 +66,10 @@
- #define MANAGEMENT_FRAME	0x00
- #define SUBTYPE_BEACON		0x08
- 
--#define DOT1X_AUTHENTICATION	0x8E88
-+#define DOT1X_AUTHENTICATION	0x888E
- #define DOT1X_EAP_PACKET	0x00
- 
--#define SIMPLE_CONFIG		0x01000000
-+#define SIMPLE_CONFIG		0x00000001
- 
- #define P1_SIZE			10000
- #define P2_SIZE			1000
-@@ -282,66 +283,111 @@ enum wfa_elements
- 	WEP_TRANSMIT_KEY = 0x10064
- };
- 
-+#define IEEE80211_FCTL_VERS		0x0003
-+#define IEEE80211_FCTL_FTYPE		0x000c
-+#define IEEE80211_FCTL_STYPE		0x00f0
-+#define IEEE80211_FCTL_TODS		0x0100
-+#define IEEE80211_FCTL_FROMDS		0x0200
-+#define IEEE80211_FCTL_MOREFRAGS	0x0400
-+#define IEEE80211_FCTL_RETRY		0x0800
-+#define IEEE80211_FCTL_PM		0x1000
-+#define IEEE80211_FCTL_MOREDATA		0x2000
-+#define IEEE80211_FCTL_PROTECTED	0x4000
-+#define IEEE80211_FCTL_ORDER		0x8000
-+
-+#define IEEE80211_SCTL_FRAG		0x000F
-+#define IEEE80211_SCTL_SEQ		0xFFF0
-+
-+#define IEEE80211_FTYPE_MGMT		0x0000
-+#define IEEE80211_FTYPE_CTL		0x0004
-+#define IEEE80211_FTYPE_DATA		0x0008
-+
-+/* management */
-+#define IEEE80211_STYPE_ASSOC_REQ	0x0000
-+#define IEEE80211_STYPE_ASSOC_RESP	0x0010
-+#define IEEE80211_STYPE_REASSOC_REQ	0x0020
-+#define IEEE80211_STYPE_REASSOC_RESP	0x0030
-+#define IEEE80211_STYPE_PROBE_REQ	0x0040
-+#define IEEE80211_STYPE_PROBE_RESP	0x0050
-+#define IEEE80211_STYPE_BEACON		0x0080
-+#define IEEE80211_STYPE_ATIM		0x0090
-+#define IEEE80211_STYPE_DISASSOC	0x00A0
-+#define IEEE80211_STYPE_AUTH		0x00B0
-+#define IEEE80211_STYPE_DEAUTH		0x00C0
-+#define IEEE80211_STYPE_ACTION		0x00D0
-+
-+/* control */
-+#define IEEE80211_STYPE_BACK_REQ	0x0080
-+#define IEEE80211_STYPE_BACK		0x0090
-+#define IEEE80211_STYPE_PSPOLL		0x00A0
-+#define IEEE80211_STYPE_RTS		0x00B0
-+#define IEEE80211_STYPE_CTS		0x00C0
-+#define IEEE80211_STYPE_ACK		0x00D0
-+#define IEEE80211_STYPE_CFEND		0x00E0
-+#define IEEE80211_STYPE_CFENDACK	0x00F0
-+
-+/* data */
-+#define IEEE80211_STYPE_DATA			0x0000
-+#define IEEE80211_STYPE_DATA_CFACK		0x0010
-+#define IEEE80211_STYPE_DATA_CFPOLL		0x0020
-+#define IEEE80211_STYPE_DATA_CFACKPOLL		0x0030
-+#define IEEE80211_STYPE_NULLFUNC		0x0040
-+#define IEEE80211_STYPE_CFACK			0x0050
-+#define IEEE80211_STYPE_CFPOLL			0x0060
-+#define IEEE80211_STYPE_CFACKPOLL		0x0070
-+#define IEEE80211_STYPE_QOS_DATA		0x0080
-+#define IEEE80211_STYPE_QOS_DATA_CFACK		0x0090
-+#define IEEE80211_STYPE_QOS_DATA_CFPOLL		0x00A0
-+#define IEEE80211_STYPE_QOS_DATA_CFACKPOLL	0x00B0
-+#define IEEE80211_STYPE_QOS_NULLFUNC		0x00C0
-+#define IEEE80211_STYPE_QOS_CFACK		0x00D0
-+#define IEEE80211_STYPE_QOS_CFPOLL		0x00E0
-+#define IEEE80211_STYPE_QOS_CFACKPOLL		0x00F0
-+
- #pragma pack(1)
- struct radio_tap_header
- {
- 	uint8_t revision;	
- 	uint8_t pad;
--	uint16_t len;
--	uint32_t flags;
--};
--
--struct frame_control
--{
--        unsigned version : 2;
--        unsigned type : 2;
--        unsigned sub_type : 4;
--
--        unsigned to_ds : 1;
--        unsigned from_ds : 1;
--        unsigned more_frag : 1;
--        unsigned retry : 1;
--        unsigned pwr_mgt : 1;
--        unsigned more_data : 1;
--        unsigned protected_frame : 1;
--        unsigned order : 1;
-+	__le16 len;
-+	__le32 flags;
- };
- 
- struct dot11_frame_header
- {
--	struct frame_control fc;
--        uint16_t duration;
-+	__le16 fc;
-+	__le16 duration;
- 	unsigned char addr1[MAC_ADDR_LEN];
- 	unsigned char addr2[MAC_ADDR_LEN];
- 	unsigned char addr3[MAC_ADDR_LEN];
--	uint16_t frag_seq;
-+	__le16 frag_seq;
- };
- 
- struct authentication_management_frame
- {
--	uint16_t algorithm;
--	uint16_t sequence;
--	uint16_t status;
-+	__le16 algorithm;
-+	__le16 sequence;
-+	__le16 status;
- };
- 
- struct association_request_management_frame
- {
--	uint16_t capability;
--	uint16_t listen_interval;
-+	__le16 capability;
-+	__le16 listen_interval;
- };
- 
- struct association_response_management_frame
- {
--	uint16_t capability;
--	uint16_t status;
--	uint16_t id;
-+	__le16 capability;
-+	__le16 status;
-+	__le16 id;
- };
- 
- struct beacon_management_frame
- {
- 	unsigned char timestamp[TIMESTAMP_LEN];
--	uint16_t beacon_interval;
--	uint16_t capability;
-+	__le16 beacon_interval;
-+	__le16 capability;
- };
- 
- struct llc_header
-@@ -350,7 +396,7 @@ struct llc_header
- 	uint8_t ssap;
- 	uint8_t control_field;
- 	unsigned char org_code[3];
--	uint16_t type;
-+	__be16 type;
- };
- 
- struct dot1X_header
-@@ -371,7 +417,7 @@ struct eap_header
- struct wfa_expanded_header
- {
- 	unsigned char id[3];
--	uint32_t type;
-+	__be32 type;
- 	uint8_t opcode;
- 	uint8_t flags;
- };
-diff --git a/src/exchange.c b/src/exchange.c
-index 23c87e9..4f9a82b 100644
---- a/src/exchange.c
-+++ b/src/exchange.c
-@@ -306,26 +306,27 @@ enum wps_type process_packet(const u_char *packet, struct pcap_pkthdr *header)
- 
- 	/* Cast the radio tap and 802.11 frame headers and parse out the Frame Control field */
- 	rt_header = (struct radio_tap_header *) packet;
--	frame_header = (struct dot11_frame_header *) (packet+rt_header->len);
-+	size_t rt_header_len = __le16_to_cpu(rt_header->len);
-+	frame_header = (struct dot11_frame_header *) (packet+rt_header_len);
- 
- 	/* Does the BSSID/source address match our target BSSID? */
- 	if(memcmp(frame_header->addr3, get_bssid(), MAC_ADDR_LEN) == 0)
- 	{
- 		/* Is this a data packet sent to our MAC address? */
--		if(frame_header->fc.type == DATA_FRAME && 
--			frame_header->fc.sub_type == SUBTYPE_DATA && 
--			(memcmp(frame_header->addr1, get_mac(), MAC_ADDR_LEN) == 0)) 
-+		if (((frame_header->fc & __cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
-+		     __cpu_to_le16(IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA)) &&
-+		    (memcmp(frame_header->addr1, get_mac(), MAC_ADDR_LEN) == 0)) 
- 		{
- 			llc = (struct llc_header *) (packet +
--							rt_header->len +
-+							rt_header_len +
- 							sizeof(struct dot11_frame_header)
- 			);
- 
- 			/* All packets in our exchanges will be 802.1x */
--			if(llc->type == DOT1X_AUTHENTICATION)
-+			if(llc->type == __cpu_to_be16(DOT1X_AUTHENTICATION))
- 			{
- 				dot1x = (struct dot1X_header *) (packet +
--								rt_header->len +
-+								rt_header_len +
- 								sizeof(struct dot11_frame_header) +
- 								sizeof(struct llc_header)
- 				);
-@@ -334,7 +335,7 @@ enum wps_type process_packet(const u_char *packet, struct pcap_pkthdr *header)
- 				if(dot1x->type == DOT1X_EAP_PACKET && (header->len >= EAP_PACKET_SIZE))
- 				{
- 					eap = (struct eap_header *) (packet +
--									rt_header->len +
-+									rt_header_len +
- 									sizeof(struct dot11_frame_header) +
- 									sizeof(struct llc_header) +
- 									sizeof(struct dot1X_header)
-@@ -366,7 +367,7 @@ enum wps_type process_packet(const u_char *packet, struct pcap_pkthdr *header)
- 						else if((eap->type == EAP_EXPANDED) && (header->len > WFA_PACKET_SIZE))
- 						{
- 							wfa = (struct wfa_expanded_header *) (packet +
--											rt_header->len +
-+											rt_header_len +
- 											sizeof(struct dot11_frame_header) +
- 											sizeof(struct llc_header) +
- 											sizeof(struct dot1X_header) +
-@@ -374,14 +375,14 @@ enum wps_type process_packet(const u_char *packet, struct pcap_pkthdr *header)
- 							);
- 						
- 							/* Verify that this is a WPS message */
--							if(wfa->type == SIMPLE_CONFIG)
-+							if(wfa->type == __cpu_to_be32(SIMPLE_CONFIG))
- 							{
- 								wps_msg_len = 	(size_t) ntohs(eap->len) - 
- 										sizeof(struct eap_header) - 
- 										sizeof(struct wfa_expanded_header);
- 
- 								wps_msg = (const void *) (packet +
--											rt_header->len +
-+											rt_header_len +
-                                                                        	                sizeof(struct dot11_frame_header) +
-                                                                                	        sizeof(struct llc_header) +
-                                                                                        	sizeof(struct dot1X_header) +
-diff --git a/src/wpsmon.c b/src/wpsmon.c
-index d976924..22a394f 100644
---- a/src/wpsmon.c
-+++ b/src/wpsmon.c
-@@ -295,7 +295,8 @@ void parse_wps_settings(const u_char *packet, struct pcap_pkthdr *header, char *
-         }
- 
- 	rt_header = (struct radio_tap_header *) radio_header(packet, header->len);
--	frame_header = (struct dot11_frame_header *) (packet + rt_header->len);
-+	size_t rt_header_len = __le16_to_cpu(rt_header->len);
-+	frame_header = (struct dot11_frame_header *) (packet + rt_header_len);
- 
- 	/* If a specific BSSID was specified, only parse packets from that BSSID */
- 	if(!is_target(frame_header))
-@@ -323,15 +324,17 @@ void parse_wps_settings(const u_char *packet, struct pcap_pkthdr *header, char *
- 				channel_changed = 1;
- 			}
- 
--			if(frame_header->fc.sub_type == PROBE_RESPONSE ||
--                                   frame_header->fc.sub_type == SUBTYPE_BEACON)
-+			unsigned fsub_type = frame_header->fc & __cpu_to_le16(IEEE80211_FCTL_STYPE);
-+
-+			if(fsub_type == __cpu_to_le16(IEEE80211_STYPE_PROBE_RESP) ||
-+			   fsub_type == __cpu_to_le16(IEEE80211_STYPE_BEACON))
- 			{
- 				wps_parsed = parse_wps_parameters(packet, header->len, wps);
- 			}
- 	
- 			if(!is_done(bssid) && (get_channel() == channel || source == PCAP_FILE))
- 			{
--				if(frame_header->fc.sub_type == SUBTYPE_BEACON && 
-+				if(fsub_type == __cpu_to_le16(IEEE80211_STYPE_BEACON) && 
- 				   mode == SCAN && 
- 				   !passive && 
- 				   should_probe(bssid))
-@@ -369,7 +372,7 @@ void parse_wps_settings(const u_char *packet, struct pcap_pkthdr *header, char *
- 				 * If there was no WPS information, then the AP does not support WPS and we should ignore it from here on.
- 				 * If this was a probe response, then we've gotten all WPS info we can get from this AP and should ignore it from here on.
- 				 */
--				if(!wps_parsed || frame_header->fc.sub_type == PROBE_RESPONSE)
-+				if(!wps_parsed || fsub_type == __cpu_to_le16(IEEE80211_STYPE_PROBE_RESP))
- 				{
- 					mark_ap_complete(bssid);
- 				}
--- 
-1.7.7
-
-

--- a/net/reaver/patches/0002-Use-the-current-directory-for-storing-and-loading-se.patch
+++ /dev/null
@@ -1,54 +1,1 @@
-From cd444949f3176790101b8bdc9656831a03d8c01d Mon Sep 17 00:00:00 2001
-From: Paul Fertser <fercerpav@gmail.com>
-Date: Tue, 10 Jul 2012 11:13:29 +0400
-Subject: [PATCH 2/3] Use the current directory for storing and loading
- sessions
 
-This allows the user to always explicitely choose (by changing the
-current directory before launching the program) where the session
-files should go. Useful e.g. to avoid hogging the precious space on
-embedded devices, just cd /tmp before starting the app.
-
-Signed-off-by: Paul Fertser <fercerpav@gmail.com>
----
- src/session.c |   16 +++-------------
- 1 files changed, 3 insertions(+), 13 deletions(-)
-
-diff --git a/src/session.c b/src/session.c
-index d3af0c3..308f213 100644
---- a/src/session.c
-+++ b/src/session.c
-@@ -62,7 +62,7 @@ int restore_session()
- 		memset(file, 0, FILENAME_MAX);
- 
- 		bssid = mac2str(get_bssid(), '\0');
--		snprintf(file, FILENAME_MAX, "%s/%s.%s", CONF_DIR, bssid, CONF_EXT);
-+		snprintf(file, FILENAME_MAX, "%s.%s", bssid, CONF_EXT);
- 		free(bssid);
- 	}
- 
-@@ -199,18 +199,8 @@ int save_session()
- 		}
- 		else
- 		{	
--			/* 
--			 * If the configuration directory exists, save the session file there; else, save it to the 
--			 * current working directory.
--			 */
--			if(configuration_directory_exists())
--			{
--        			snprintf((char *) &file_name, FILENAME_MAX, "%s/%s.%s", CONF_DIR, bssid, CONF_EXT);
--			}
--			else
--			{
--				snprintf((char *) &file_name, FILENAME_MAX, "%s.%s", bssid, CONF_EXT);
--			}
-+			/* save session to the current directory */
-+			snprintf((char *) &file_name, FILENAME_MAX, "%s.%s", bssid, CONF_EXT);
- 		}
- 
- 		/* Don't bother saving anything if nothing has been done */
--- 
-1.7.7
-
-

--- a/net/reaver/patches/0003-wash-wpsmon-use-less-useless-spaces-in-output-to-fit.patch
+++ /dev/null
@@ -1,39 +1,1 @@
-From 638bb8d70d6c7e5dc99975e0bf57d8ce0455e2cc Mon Sep 17 00:00:00 2001
-From: Paul Fertser <fercerpav@gmail.com>
-Date: Tue, 10 Jul 2012 11:25:00 +0400
-Subject: [PATCH 3/3] wash/wpsmon: use less useless spaces in output to fit
- narrow terminals
 
-Signed-off-by: Paul Fertser <fercerpav@gmail.com>
----
- src/wpsmon.c |    6 +++---
- 1 files changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/src/wpsmon.c b/src/wpsmon.c
-index 22a394f..e0948b3 100644
---- a/src/wpsmon.c
-+++ b/src/wpsmon.c
-@@ -262,8 +262,8 @@ void monitor(char *bssid, int passive, int source, int channel, int mode)
- 
- 	if(!header_printed)
- 	{
--		cprintf(INFO, "BSSID                  Channel       RSSI       WPS Version       WPS Locked        ESSID\n");
--		cprintf(INFO, "---------------------------------------------------------------------------------------------------------------\n");
-+		cprintf(INFO, "BSSID              Channel  RSSI  WPS Version  WPS Locked  ESSID\n");
-+		cprintf(INFO, "--------------------------------------------------------------------------------------\n");
- 		header_printed = 1;
- 	}
- 
-@@ -360,7 +360,7 @@ void parse_wps_settings(const u_char *packet, struct pcap_pkthdr *header, char *
- 							break;
- 					}
- 
--					cprintf(INFO, "%17s      %2d            %.2d        %d.%d               %s               %s\n", bssid, channel, rssi, (wps->version >> 4), (wps->version & 0x0F), lock_display, ssid);
-+					cprintf(INFO, "%17s    %2d       %.2d   %d.%d          %s         %s\n", bssid, channel, rssi, (wps->version >> 4), (wps->version & 0x0F), lock_display, ssid);
- 				}
- 
- 				if(probe_sent)
--- 
-1.7.7
-
-

file:a/net/redsocks/Makefile (deleted)
--- a/net/redsocks/Makefile
+++ /dev/null
@@ -1,53 +1,1 @@
-#
-# Copyright (C) 2012 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-include $(TOPDIR)/rules.mk
 
-PKG_NAME:=redsocks
-PKG_VERSION:=0.4
-PKG_RELEASE=$(PKG_SOURCE_VERSION)
-
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=https://github.com/darkk/redsocks.git
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=a9cfd090119385a1ef973baf94342a2db20595b9
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/redsocks
-  SECTION:=net
-  CATEGORY:=Network
-  SUBMENU:=Web Servers/Proxies
-  DEPENDS:=+libevent2
-  TITLE:=Redirect any TCP connection to a SOCKS or HTTPS proxy server
-endef
-
-define Package/redsocks/description
-  Redsocks is a daemon running on the local system, that will transparently
-  tunnel any TCP connection via a remote SOCKS4, SOCKS5 or HTTP proxy server. It
-  uses the system firewall's redirection facility to intercept TCP connections,
-  thus the redirection is system-wide, with fine-grained control, and does
-  not depend on LD_PRELOAD libraries.
-
-  Redsocks supports tunneling TCP connections and UDP packets. It has
-  authentication support for both, SOCKS and HTTP proxies.
-
-  Also included is a small DNS server returning answers with the "truncated" flag
-  set for any UDP query, forcing the resolver to use TCP.
-endef
-
-define Package/redsocks/install
-	$(INSTALL_DIR) $(1)/usr/sbin
-	$(INSTALL_BIN) $(PKG_BUILD_DIR)/redsocks $(1)/usr/sbin/
-	$(INSTALL_DIR) $(1)/etc/init.d
-	$(INSTALL_BIN) ./files/redsocks.init $(1)/etc/init.d/redsocks
-	$(INSTALL_DIR) $(1)/etc
-	$(INSTALL_CONF) $(PKG_BUILD_DIR)/redsocks.conf.example $(1)/etc/redsocks.conf
-endef
-
-$(eval $(call BuildPackage,redsocks))
-

--- a/net/redsocks/files/redsocks.init
+++ /dev/null
@@ -1,15 +1,1 @@
-#!/bin/sh /etc/rc.common
 
-START=80
-APP=redsocks
-PID_FILE=/var/run/$APP.pid
-
-start() {
-        start-stop-daemon -S -x $APP -p $PID_FILE -m -b -- -c /etc/redsocks.conf
-}
-
-stop() {
-        start-stop-daemon -K -n $APP -p $PID_FILE -s TERM
-        rm -rf $PID_FILE
-}
-

--- a/net/redsocks/patches/010-fix-undeclared.diff
+++ /dev/null
@@ -1,29 +1,1 @@
-diff -ur redsocks-0.4.orig/redudp.c redsocks-0.4/redudp.c
---- redsocks-0.4.orig/redudp.c 2012-07-27 20:30:40.283988208 +0200
-+++ redsocks-0.4/redudp.c      2012-07-27 20:31:35.759985938 +0200
-@@ -33,6 +33,10 @@
- #include "redsocks.h"
- #include "redudp.h"
- 
-+#define IP_ORIGDSTADDR 20
-+#define IP_TRANSPARENT 19
-+#define IP_RECVORIGDSTADDR IP_ORIGDSTADDR
-+
- #define redudp_log_error(client, prio, msg...) \
-       redsocks_log_write_plain(__FILE__, __LINE__, __func__, 0, &(client)->clientaddr, get_destaddr(client), prio, ## msg)
- #define redudp_log_errno(client, prio, msg...) \
-diff -ur redsocks-0.4.orig/utils.c redsocks-0.4/utils.c
---- redsocks-0.4.orig/utils.c  2012-07-27 20:30:40.283988208 +0200
-+++ redsocks-0.4/utils.c       2012-07-27 20:31:20.075986580 +0200
-@@ -26,6 +26,10 @@
- #include "utils.h"
- #include "redsocks.h" // for redsocks_close
- 
-+#define IP_ORIGDSTADDR 20
-+#define IP_TRANSPARENT 19
-+#define IP_RECVORIGDSTADDR IP_ORIGDSTADDR
-+
- int red_recv_udp_pkt(int fd, char *buf, size_t buflen, struct sockaddr_in *inaddr, struct sockaddr_in *toaddr)
- {
-       socklen_t addrlen = sizeof(*inaddr);
 

file:a/net/siit/Makefile (deleted)
--- a/net/siit/Makefile
+++ /dev/null
@@ -1,41 +1,1 @@
-#
-# Copyright (C) 2006-2010 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
-include $(TOPDIR)/rules.mk
-include $(INCLUDE_DIR)/kernel.mk
-
-PKG_NAME:=siit
-PKG_VERSION:=1.1
-PKG_RELEASE:=2
-
-include $(INCLUDE_DIR)/package.mk
-
-define KernelPackage/siit
-  SUBMENU:=Network Devices
-  TITLE:=Stateless IP ICMP Translation Algorithm
-  DEPENDS:= @(!(TARGET_ps3||TARGET_pxcab)||BROKEN)
-  FILES:=$(PKG_BUILD_DIR)/siit.ko
-  AUTOLOAD:=$(call AutoLoad,50,siit)
-endef
-
-include $(INCLUDE_DIR)/kernel-defaults.mk
-
-define KernelPackage/siit/description
- Stateless IP ICMP Translation Algorithm
-endef
-
-define Build/Prepare
-	mkdir -p $(PKG_BUILD_DIR)
-	cp src/Makefile src/siit.h src/siit.c $(PKG_BUILD_DIR)/
-endef
-
-define Build/Compile
-	$(MAKE) $(KERNEL_MAKEOPTS) SUBDIRS="$(PKG_BUILD_DIR)" modules
-endef
-
-$(eval $(call KernelPackage,siit))
-

file:a/net/siit/src/Makefile (deleted)
--- a/net/siit/src/Makefile
+++ /dev/null
@@ -1,6 +1,1 @@
-obj-m   := siit.o
-ifeq ($(MAKING_MODULES),1)
--include $(TOPDIR)/Rules.make
-endif
 
-

file:a/net/siit/src/siit.c (deleted)
--- a/net/siit/src/siit.c
+++ /dev/null
@@ -1,1426 +1,1 @@
-/*
- * siit.c: the Stateless IP/ICMP Translator (SIIT) module for Linux.
- *
- *
- */
 
-#include <linux/version.h>
-#include <linux/module.h>
-#include <linux/sched.h>
-#include <linux/kernel.h>       /* printk() */
-#include <linux/slab.h>
-
-#include <linux/errno.h>        /* error codes */
-#include <linux/types.h>        /* size_t */
-#include <linux/interrupt.h>    /* mark_bh */
-#include <linux/random.h>
-#include <linux/in.h>
-#include <linux/netdevice.h>    /* struct device, and other headers */
-#include <linux/etherdevice.h>  /* eth_type_trans */
-#include <net/ip.h>             /* struct iphdr */
-#include <net/icmp.h>           /* struct icmphdr */
-#include <net/ipv6.h>
-#include <net/udp.h>
-#include <linux/skbuff.h>
-#include <linux/in6.h>
-#include <linux/init.h>
-#include <asm/uaccess.h>
-#include <asm/checksum.h>
-#include <net/ip6_checksum.h>
-#include <linux/in6.h>
-#include "siit.h"
-
-MODULE_AUTHOR("Dmitriy Moscalev, Grigory Klyuchnikov, Felix Fietkau");
-
-/*
- * If tos_ignore_flag != 0, we don't copy TOS and Traffic Class
- * from origin paket and set it to 0
- */
-int tos_ignore_flag = 0;
-
-#define siit_stats(_dev) (&(_dev)->stats)
-
-/*
- * The Utility  stuff
- */
-
-#ifdef SIIT_DEBUG
-/* print dump bytes (data point data area sizeof len and message
- * before dump.
- */
-static int siit_print_dump(char *data, int len, char *message)
-{
-	int i;
-	int j = 0, k = 1;
-
-	len = len > BUFF_SIZE ? BUFF_SIZE : len;
-	printk("%s:\n", message);
-	for (i=0; i < len; i++, k++) {
-		if( i == len-1 || k == 16) {
-			printk("%02x\n", (~(~0 << 8) & *(data+i)));
-			j = 0;
-			k = 0;
-		}
-		else if (j) {
-			printk("%02x ", (~(~0 << 8) & *(data+i)));
-			j--;
-		}
-		else {
-			printk("%02x", (~(~0 << 8) & *(data+i)));
-			j++;
-		}
-	}
-	return 0;
-}
-#endif
-
-/*
- * Open and close
- */
-static int siit_open(struct net_device *dev)
-{
-	netif_start_queue(dev);
-	return 0;
-}
-
-
-static int siit_release(struct net_device *dev)
-{
-	netif_stop_queue(dev); /* can't transmit any more */
-	return 0;
-}
-
-/*
- * Translation IPv4 to IPv6 stuff
- *
- * ip4_ip6 (src, len, dst, include_flag)
- *
- * where
- * src - buffer with original IPv4 packet,
- * len - size of original packet,
- * dst - new buffer for IPv6 packet,
- * include_flag - if = 1, dst point to IPv4 packet that is ICMP error
- *                included IP packet, else = 0
- */
-
-static int ip4_ip6(char *src, int len, char *dst, int include_flag)
-{
-	struct iphdr *ih4 = (struct iphdr *) src; /* point to current IPv4 header struct */
-	struct icmphdr *icmp_hdr;   /* point to current ICMPv4 header struct */
-	struct udphdr *udp_hdr;     /* point to current IPv4 UDP header struct */
-
-	struct ipv6hdr *ih6 = (struct ipv6hdr *) dst; /* point to current IPv6 header struct */
-	struct frag_hdr *ih6_frag = (struct frag_hdr *)(dst+sizeof(struct ipv6hdr));
-										      /* point to current IPv6 fragment header struct */
-	struct icmp6hdr *icmp6_hdr; /* point to current ICMPv6 header */
-
-	int hdr_len = (int)(ih4->ihl * 4); /* IPv4 header length */
-	int icmp_len;               /* ICMPv4 packet length */
-	int plen;                   /* payload length */
-
-	unsigned int csum;          /* need to calculate ICMPv6 and UDP checksum */
-	int fl_csum = 0;            /* flag to calculate UDP checksum */
-	int icmperr = 1;            /* flag to indicate ICMP error message and to need
-								   translate ICMP included IP packet */
-	int fr_flag = 0;            /* fragment flag, if = 0 - don't add
-								   fragment header */
-	__u16 new_tot_len;          /* need to calculate IPv6 total length */
-	__u8 new_nexthdr;           /* next header code */
-	__u16 icmp_ptr = 0;         /* Pointer field in ICMP_PARAMETERPROB */
-
-#ifdef SIIT_DEBUG              /* print IPv4 header dump */
-	siit_print_dump(src, hdr_len, "siit: ip4_ip6() (in) ip4 header dump");
-#endif
-
-	/* If DF == 1 && MF == 0 && Fragment Offset == 0
-	 * or this packet is ICMP included IP packet
-	 * we don't need fragment header */
-	if (ntohs(ih4->frag_off) == IP_DF || include_flag ) {
-		/* not fragment and we need not to add Fragment
-		 * Header to IPv6 packet. */
-		/* total length = total length from IPv4 packet */
-		new_tot_len = ntohs(ih4->tot_len);
-
-		if (ih4->protocol == IPPROTO_ICMP)
-			new_nexthdr = NEXTHDR_ICMP;
-		else
-			new_nexthdr = ih4->protocol;
-	}
-	else {
-		/* need to add Fragment Header */
-		fr_flag = 1;
-		/* total length = total length from IPv4 packet +
-		   length of Fragment Header */
-		new_tot_len = ntohs(ih4->tot_len) + sizeof(struct frag_hdr);
-		/* IPv6 Header NextHeader = NEXTHDR_FRAGMENT */
-		new_nexthdr = NEXTHDR_FRAGMENT;
-		/* Fragment Header NextHeader copy from IPv4 packet */
-		if (ih4->protocol == IPPROTO_ICMP)
-			ih6_frag->nexthdr = NEXTHDR_ICMP;
-		else
-			ih6_frag->nexthdr = ih4->protocol;
-
-		/* copy frag offset from IPv4 packet */
-		ih6_frag->frag_off = htons((ntohs(ih4->frag_off) & IP_OFFSET) << 3);
-		/* copy MF flag from IPv4 packet */
-		ih6_frag->frag_off = htons((ntohs(ih6_frag->frag_off) |
-									((ntohs(ih4->frag_off) & IP_MF) >> 13)));
-		/* copy Identification field from IPv4 packet */
-		ih6_frag->identification = htonl(ntohs(ih4->id));
-		/* reserved field initialized to zero */
-		ih6_frag->reserved = 0;
-	}
-
-	/* Form rest IPv6 fields */
-
-	/*
-	 * At this point we need to add checking of unxpired source
-	 * route optin and if it is, send ICMPv4 "destination
-	 * unreacheble/source route failes" Type 3/Code 5 and
-	 * drop packet. (NOT RELEASED YET)
-	 */
-
-	/* IP version = 6 */
-	ih6->version = 6;
-
-	if (tos_ignore_flag) {
-		ih6->priority = 0;
-		ih6->flow_lbl[0] = 0;
-	} else {
-		ih6->priority = (ih4->tos & 0xf0) >> 4;
-		ih6->flow_lbl[0] = (ih4->tos & 0x0f) << 4;
-	}
-	ih6->flow_lbl[1] = 0;
-	ih6->flow_lbl[2] = 0;
-
-	/* Hop Limit = IPv4 TTL */
-	ih6->hop_limit = ih4->ttl;
-
-	/* Translate source destination addresses,
-	   for IPv6 host it's IPv4-translated IPv6 address,
-	   for IPv4 host it's IPv4-mapped IPv6 address
-
-	   !!WARNING!! Instead IPv4-mapped IPv6 addresses we use addreesses
-	   with unused prefix ::ffff:ffff:0:0/96, because KAME implementation
-	   doesn't support IPv4-mapped addresses in IPv6 packets and discard them.
-
-	*/
-
-	if (include_flag) {
-		/*
-		   It's ICMP included IP packet and there is a diffirence
-		   in src/dst addresses then src/dst in normal direction
-		 */
-
-		/*
-		   Source address
-		   is IPv4-translated IPv6 address because packet traveled
-		   from IPv6 to IPv4 area
-		*/
-		ih6->saddr.in6_u.u6_addr32[0] = 0;
-		ih6->saddr.in6_u.u6_addr32[1] = 0;
-		ih6->saddr.in6_u.u6_addr32[2] = htonl(TRANSLATED_PREFIX); /* to network order bytes */
-		ih6->saddr.in6_u.u6_addr32[3] = ih4->saddr;
-
-		/*
-		   Destination address
-		   is IPv4-mapped address (but it's not IPv4- mapped, we use
-		   prefix ::ffff:ffff:0:0/96
-		 */
-		ih6->daddr.in6_u.u6_addr32[0] = 0;
-		ih6->daddr.in6_u.u6_addr32[1] = 0;
-		ih6->daddr.in6_u.u6_addr32[2] = htonl(MAPPED_PREFIX); /* to network order bytes */
-		ih6->daddr.in6_u.u6_addr32[3] = ih4->daddr;
-	}
-	else {
-
-		/*
-		   This is normal case (packet isn't included IP packet)
-
-		   Source address
-		   is IPv4-mapped address (but it's not IPv4- mapped, we use
-		   prefix ::ffff:ffff:0:0/96)
-		*/
-		ih6->saddr.in6_u.u6_addr32[0] = 0;
-		ih6->saddr.in6_u.u6_addr32[1] = 0;
-		ih6->saddr.in6_u.u6_addr32[2] = htonl(MAPPED_PREFIX); /* to network order bytes */
-		ih6->saddr.in6_u.u6_addr32[3] = ih4->saddr;
-
-		/* Destination address
-		   is is IPv4-translated IPv6 address
-		 */
-		ih6->daddr.in6_u.u6_addr32[0] = 0;
-		ih6->daddr.in6_u.u6_addr32[1] = 0;
-		ih6->daddr.in6_u.u6_addr32[2] = htonl(TRANSLATED_PREFIX); /* to network order bytes */
-		ih6->daddr.in6_u.u6_addr32[3] = ih4->daddr;
-	}
-
-	/* Payload Length */
-	plen = new_tot_len - hdr_len; /* Payload length = IPv4 total len - IPv4 header len */
-	ih6->payload_len = htons(plen);
-
-	/* Next Header */
-	ih6->nexthdr = new_nexthdr; /* Next Header */
-
-	/* Process ICMP protocols data */
-
-	switch (ih4->protocol) {
-	case IPPROTO_ICMP:
-		if ( (ntohs(ih4->frag_off) & IP_OFFSET) != 0 || (ntohs(ih4->frag_off) & IP_MF) != 0 ) {
-			PDEBUG("ip4_ip6(): don't translate ICMPv4 fragments - packet dropped.\n");
-			return -1;
-		}
-
-		icmp_hdr = (struct icmphdr *) (src+hdr_len); /* point to ICMPv4 header */
-		csum = 0;
-		icmp_len =  ntohs(ih4->tot_len) - hdr_len; /* ICMPv4 packet length */
-		icmp6_hdr = (struct icmp6hdr *)(dst+sizeof(struct ipv6hdr)
-									    +fr_flag*sizeof(struct frag_hdr)); /* point to ICMPv6 header */
-
-		if (include_flag) {
-			/* ICMPv4 packet cannot be included in ICMPv4 Error message */
-			/* !!! May be it's WRONG !!! ICMPv4 QUERY packet can be included
-			   in ICMPv4 Error message */
-			PDEBUG("ip4_ip6(): It's included ICMPv4 in ICMPv4 Error message - packet dropped.\n");
-			return -1;
-		}
-
-		/* Check ICMPv4 Type field */
-		switch (icmp_hdr->type) {
-		/* ICMP Error messages */
-		/* Destination Unreachable (Type 3) */
-		case ICMP_DEST_UNREACH:
-			icmp6_hdr->icmp6_type = ICMPV6_DEST_UNREACH; /* to Type 1 */
-			icmp6_hdr->icmp6_unused = 0;
-			switch (icmp_hdr->code)
-			{
-			case ICMP_NET_UNREACH: /* Code 0 */
-			case ICMP_HOST_UNREACH: /* Code 1 */
-			case ICMP_SR_FAILED: /* Code 5 */
-			case ICMP_NET_UNKNOWN: /* Code 6 */
-			case ICMP_HOST_UNKNOWN: /* Code 7 */
-			case ICMP_HOST_ISOLATED: /* Code 8 */
-			case ICMP_NET_UNR_TOS: /* Code 11 */
-			case ICMP_HOST_UNR_TOS: /* Code 12 */
-				icmp6_hdr->icmp6_code = ICMPV6_NOROUTE; /* to Code 0 */
-				break;
-			case ICMP_PROT_UNREACH: /* Code 2 */
-				icmp6_hdr->icmp6_type = ICMPV6_PARAMPROB; /* to Type 4 */
-				icmp6_hdr->icmp6_code = ICMPV6_UNK_NEXTHDR; /* to Code 1 */
-				/* Set pointer filed to 6, it's octet offset IPv6 Next Header field */
-				icmp6_hdr->icmp6_pointer = htonl(6);
-				break;
-			case ICMP_PORT_UNREACH: /* Code 3 */
-				icmp6_hdr->icmp6_code = ICMPV6_PORT_UNREACH; /* to Code 4 */
-				break;
-			case ICMP_FRAG_NEEDED: /* Code 4 */
-				icmp6_hdr->icmp6_type = ICMPV6_PKT_TOOBIG; /* to Type 2 */
-				icmp6_hdr->icmp6_code = 0;
-				/* Correct MTU  */
-				if (icmp_hdr->un.frag.mtu == 0)
-					/* we use minimum MTU for IPv4 PMTUv4 RFC1191, section 5;
-					   IPv6 implementation wouldn't accept Path MTU < 1280,
-					   but it records info correctly to always include
-					   a fragment header */
-					icmp6_hdr->icmp6_mtu = htonl(576);
-				else
-					/* needs to adjusted for difference between IPv4/IPv6 headers
-					 * SIIT RFC2765, section 3.3,
-					 * we assume that difference is 20 bytes */
-					icmp6_hdr->icmp6_mtu = htonl(ntohs(icmp_hdr->un.frag.mtu)+IP4_IP6_HDR_DIFF);
-
-				break;
-			case ICMP_NET_ANO: /* Code 9 */
-			case ICMP_HOST_ANO: /* Code 10 */
-				icmp6_hdr->icmp6_code = ICMPV6_ADM_PROHIBITED; /* to Code 1 */
-				break;
-			default: /* discard any other Code */
-				PDEBUG("ip4_ip6(): Unknown ICMPv4 Type %d Code %d - packet dropped.\n",
-					   ICMP_DEST_UNREACH, icmp_hdr->code);
-				return -1;
-			}
-			break;
-			/* Time Exceeded (Type 11) */
-		case ICMP_TIME_EXCEEDED:
-			icmp6_hdr->icmp6_type = ICMPV6_TIME_EXCEED;
-			icmp6_hdr->icmp6_code = icmp_hdr->code;
-			break;
-			/* Parameter Problem (Type 12) */
-		case ICMP_PARAMETERPROB:
-			icmp6_hdr->icmp6_type = ICMPV6_PARAMPROB;
-			icmp6_hdr->icmp6_code = icmp_hdr->code;
-
-			icmp_ptr = ntohs(icmp_hdr->un.echo.id) >> 8;
-			switch (icmp_ptr) {
-			case 0:
-				icmp6_hdr->icmp6_pointer = 0; /* IPv4 Version -> IPv6 Version */
-				break;
-			case 2:
-				icmp6_hdr->icmp6_pointer = __constant_htonl(4); /* IPv4 length -> IPv6 Payload Length */
-				break;
-			case 8:
-				icmp6_hdr->icmp6_pointer = __constant_htonl(7); /* IPv4 TTL -> IPv6 Hop Limit */
-				break;
-			case 9:
-				icmp6_hdr->icmp6_pointer = __constant_htonl(6); /* IPv4 Protocol -> IPv6 Next Header */
-				break;
-			case 12:
-				icmp6_hdr->icmp6_pointer = __constant_htonl(8); /* IPv4 Src Addr -> IPv6 Src Addr */
-				break;
-			case 16:
-				icmp6_hdr->icmp6_pointer = __constant_htonl(24); /* IPv4 Dst Addr -> IPv6 Dst Addr */
-				break;
-			default:
-				icmp6_hdr->icmp6_pointer = 0xffffffff; /* set to all ones in any other cases */
-				break;
-			}
-			break;
-		case ICMP_ECHO:
-			icmperr = 0;
-			icmp6_hdr->icmp6_type = ICMPV6_ECHO_REQUEST;
-			icmp6_hdr->icmp6_code = 0;
-			/* Copy rest ICMP data to new IPv6 packet without changing */
-			memcpy(((char *)icmp6_hdr)+4, ((char *)icmp_hdr)+4, len - hdr_len - 4);
-			break;
-
-		case ICMP_ECHOREPLY:
-			icmperr = 0;
-			icmp6_hdr->icmp6_type = ICMPV6_ECHO_REPLY;
-			icmp6_hdr->icmp6_code = 0;
-			/* Copy rest ICMP data to new IPv6 packet without changing */
-			memcpy(((char *)icmp6_hdr)+4, ((char *)icmp_hdr)+4, len - hdr_len - 4);
-			break;
-
-			/* Discard any other ICMP messages */
-		default:
-			PDEBUG("ip4_ip6(): Unknown ICMPv4 packet Type %x - packet dropped.\n", icmp_hdr->type);
-			return -1;
-		}
-
-		/* Now if it's ICMPv4 Error message we must translate included IP packet */
-
-		if (icmperr) {
-			/* Call our ip4_ip6() to translate included IP packet */
-			if (ip4_ip6(src+hdr_len+sizeof(struct icmphdr), len - hdr_len - sizeof(struct icmphdr),
-						dst+sizeof(struct ipv6hdr)+fr_flag*sizeof(struct frag_hdr)
-						+sizeof(struct icmp6hdr), 1) == -1) {
-				PDEBUG("ip4_ip6(): Uncorrect translation of ICMPv4 Error message - packet dropped.\n");
-				return -1;
-			}
-			/* correct ICMPv6 packet length for diffirence between IPv4 and IPv6 headers
-			   in included IP packet
-			   */
-			icmp_len += 20;
-			/* and correct Payload length for diffirence between IPv4 and IPv6 headers */
-			plen += 20;
-			ih6->payload_len = htons(plen);
-		}
-
-		/* Calculate ICMPv6 checksum */
-
-		icmp6_hdr->icmp6_cksum = 0;
-		csum = 0;
-
-		csum = csum_partial((u_char *)icmp6_hdr, icmp_len, csum);
-		icmp6_hdr->icmp6_cksum = csum_ipv6_magic(&ih6->saddr, &ih6->daddr, icmp_len,
-									         IPPROTO_ICMPV6, csum);
-		break;
-
-	/* Process TCP protocols data */
-	case IPPROTO_TCP:
-		/* Copy TCP data to new IPv6 packet without changing */
-		memcpy(dst+sizeof(struct ipv6hdr)+fr_flag*sizeof(struct frag_hdr),
-				   src+hdr_len, len - hdr_len);
-		break;
-
-	/* Process UDP protocols data */
-	case IPPROTO_UDP:
-		udp_hdr = (struct udphdr *)(src+hdr_len);
-		if ((ntohs(ih4->frag_off) & IP_OFFSET) == 0) {
-			if ((ntohs(ih4->frag_off) & IP_MF) != 0) {
-				/* It's a first fragment */
-				if (udp_hdr->check == 0) {
-					/* System management event */
-					printk("siit: First fragment of UDP with zero checksum - packet droped\n");
-					printk("siit: addr: %x src port: %d dst port: %d\n",
-						   htonl(ih4->saddr), htons(udp_hdr->source), htons(udp_hdr->dest));
-					return -1;
-				}
-			}
-			else if (udp_hdr->check == 0)
-				fl_csum = 1;
-		}
-
-		/* Copy UDP data to new IPv6 packet */
-		udp_hdr = (struct udphdr *)(dst+sizeof(struct ipv6hdr)
-									+ fr_flag*sizeof(struct frag_hdr));
-		memcpy((char *)udp_hdr, src+hdr_len, len - hdr_len);
-
-		/* Calculate UDP checksum if UDP checksum in IPv4 packet was ZERO
-		   and if it isn't included IP packet
-		 */
-		if (fl_csum && (!include_flag)) {
-			udp_hdr->check = 0;
-			csum = 0;
-			csum = csum_partial((unsigned char *)udp_hdr, plen - fr_flag*sizeof(struct frag_hdr), csum);
-			udp_hdr->check = csum_ipv6_magic(&ih6->saddr, &ih6->daddr, plen -
-										     fr_flag*sizeof(struct frag_hdr), IPPROTO_UDP, csum);
-		}
-		break;
-
-	/* Discard packets with any other protocol */
-	default:
-		PDEBUG("ip4_ip6(): Unknown upper protocol - packet dropped.\n");
-		return -1;
-	}
-
-#ifdef SIIT_DEBUG
-	siit_print_dump(dst, sizeof(struct ipv6hdr), "siit: ip4_ip6(): (out) ipv6 header dump");
-#endif
-
-	return 0;
-}
-
-/*
- * Translation IPv6 to IPv4 stuff
- *
- * ip6_ip4(src, len, dst, include_flag)
- *
- * where
- * src - buffer with original IPv6 packet,
- * len - size of original packet,
- * dst - new buffer for IPv4 packet,
- * include_flag - if = 1, dst point to IPv6 packet that is ICMP error
- *                included IP packet, else = 0
- *
- */
-
-static int ip6_ip4(char *src, int len, char *dst, int include_flag)
-{
-	struct ipv6hdr *ip6_hdr;    /* point to current IPv6 header struct */
-	struct iphdr *ip_hdr;       /* point to current IPv4 header struct */
-	int opts_len = 0;           /* to sum Option Headers length */
-	int icmperr = 1;            /* if = 1, indicate that packet is ICMP Error message, else = 0 */
-	int ntot_len = 0;           /* to calculate IPv6 Total Length field */
-	int real_len;
-	int len_delta;
-	int ip6_payload_len;
-	int inc_opts_len = 0;       /* to sum Option Headers length in ICMP included IP packet */
-	__u8 next_hdr;              /* Next Header */
-
-#ifdef SIIT_DEBUG
-	siit_print_dump(src, sizeof(struct ipv6hdr), "siit: ip6_ip4(): (in) ipv6 header dump");
-#endif
-
-	if ( (len_delta = len - sizeof(struct ipv6hdr)) >= 0)
-	{
-		ip6_hdr = (struct ipv6hdr *)src;
-		ip_hdr = (struct iphdr *)dst;
-
-		real_len = sizeof(struct iphdr);
-
-		/* Check validation of Saddr & Daddr? is a packet to fall under our translation? */
-		if (include_flag) { /* It's ICMP included IP packet,
-							   about process include_flag see comment in ip4_ip6() */
-			if (ip6_hdr->saddr.s6_addr32[2] != htonl(MAPPED_PREFIX)) {
-				PDEBUG("ip6_ip4(): Included IP packet Src addr isn't mapped addr: %x%x%x%x, packet dropped.\n",
-					   ip6_hdr->saddr.s6_addr32[0], ip6_hdr->saddr.s6_addr32[1],
-					   ip6_hdr->saddr.s6_addr32[2], ip6_hdr->saddr.s6_addr32[3]);
-				return -1;
-			}
-			if ( ip6_hdr->daddr.s6_addr32[2] != htonl(TRANSLATED_PREFIX)) {
-				PDEBUG("ip6_ip4(): Included IP packet Dst addr isn't translated addr: %x%x%x%x, packet dropped.\n",
-					   ip6_hdr->daddr.s6_addr32[0], ip6_hdr->daddr.s6_addr32[1],
-					   ip6_hdr->daddr.s6_addr32[2], ip6_hdr->daddr.s6_addr32[3]);
-				return -1;
-			}
-		}
-		else { /* It's normal IP packet (not included in ICMP) */
-			if (ip6_hdr->saddr.s6_addr32[2] != htonl(TRANSLATED_PREFIX)) {
-				PDEBUG("ip6_ip4(): Src addr isn't translated addr: %x%x%x%x, packet dropped.\n",
-					   ip6_hdr->saddr.s6_addr32[0], ip6_hdr->saddr.s6_addr32[1],
-					   ip6_hdr->saddr.s6_addr32[2], ip6_hdr->saddr.s6_addr32[3]);
-				return -1;
-			}
-			if ( ip6_hdr->daddr.s6_addr32[2] != htonl(MAPPED_PREFIX)) {
-				PDEBUG("ip6_ip4(): Dst addr isn't mapped addr: %x%x%x%x, packet dropped.\n",
-					   ip6_hdr->daddr.s6_addr32[0], ip6_hdr->daddr.s6_addr32[1],
-					   ip6_hdr->daddr.s6_addr32[2], ip6_hdr->daddr.s6_addr32[3]);
-				return -1;
-			}
-		}
-
-		/* Set IPv4 Fragment Offset and ID to 0
-		   before process any Option Headers */
-		ip_hdr->frag_off = 0;
-		ip_hdr->id = 0;
-
-		/*
-		 * We process only Fragment Header. Any other options headers
-		 * are ignored, i.e. there is no attempt to translate them.
-		 * However, the Total Length field and the Protocol field would
-		 * have to be adjusted to "skip" these extension headers.
-		 */
-
-		next_hdr = ip6_hdr->nexthdr;
-
-		/* Hop_by_Hop options header (ip6_hdr->nexthdr = 0). It must
-		 * appear only in IPv6 header's Next Header field.
-		 */
-		if (next_hdr == NEXTHDR_HOP) {
-			if ( (len_delta - sizeof(struct ipv6_opt_hdr)) >= 0)
-			{
-				struct ipv6_opt_hdr *ip6h =
-					(struct ipv6_opt_hdr *)(src+sizeof(struct ipv6hdr) + opts_len);
-				if ( (len_delta -= ip6h->hdrlen*8 + 8) >= 0)
-				{
-					opts_len += ip6h->hdrlen*8 + 8;  /* See  RFC 2460 page 11:
-							Hdr Ext Len  8-bit unsigned integer.  Length of the Hop-by-
-										 Hop Options header in 8-octet units, not
-										 including the first 8 octets.
-							*/
-					next_hdr = ip6h->nexthdr;
-				}
-				else
-				{
-					PDEBUG("ip6_ip4(): hop_by_hop header error, packet droped");
-					/* Generate ICMP Parameter Problem */
-					return -1;
-				}
-			}
-		}
-
-		if (len_delta > 0)
-		{
-			while(next_hdr != NEXTHDR_ICMP && next_hdr != NEXTHDR_TCP
-				  && next_hdr != NEXTHDR_UDP)
-			{
-				/* Destination options header */
-				if (next_hdr == NEXTHDR_DEST)
-				{
-					if ( (len_delta - sizeof(struct ipv6_opt_hdr)) >= 0)
-					{
-						struct ipv6_opt_hdr *ip6d =
-							(struct ipv6_opt_hdr *)(src + sizeof(struct ipv6hdr) + opts_len);
-						if ( (len_delta -= ip6d->hdrlen*8 + 8) >= 0)
-						{
-							opts_len += ip6d->hdrlen*8 + 8;
-							next_hdr = ip6d->nexthdr;
-						}
-					}
-					else
-					{
-						PDEBUG("ip6_ip4(): destination header error, packet droped");
-						/* Generate ICMP Parameter Problem */
-						return -1;
-					}
-				}
-				/* Routing options header */
-				else if (next_hdr == NEXTHDR_ROUTING)
-				{
-					if ( (len_delta - sizeof(struct ipv6_rt_hdr)) >= 0)
-					{
-						struct ipv6_rt_hdr *ip6rt =
-							(struct ipv6_rt_hdr *)(src+sizeof(struct ipv6hdr) + opts_len);
-						/* RFC 2765 SIIT, 4.1:
-						   If a routing header with a non-zero Segments Left field is present
-						   then the packet MUST NOT be translated, and an ICMPv6 "parameter
-						   problem/ erroneous header field encountered" (Type 4/Code 0) error
-						   message, with the Pointer field indicating the first byte of the
-						   Segments Left field, SHOULD be returned to the sender.
-						   */
-						if (ip6rt->segments_left != 0) {
-							/* Build ICMPv6 "Parameter Problem/Erroneous Header
-							   Field Encountered" & drop the packet */
-							/* !!! We don't send ICMPv6 "Parameter Problem" !!! */
-							PDEBUG("ip6_ip4(): routing header type != 0\n");
-							return -1;
-						}
-						if ( (len_delta -= ip6rt->hdrlen*8 + 8) >= 0)
-						{
-							opts_len += ip6rt->hdrlen*8 + 8;
-							next_hdr = ip6rt->nexthdr;
-						}
-						else
-						{
-							PDEBUG("ip6_ip4(): routing header error, packet droped");
-							/* Generate ICMP Parameter Problem */
-							return -1;
-						}
-					}
-				}
-				/* Fragment options header */
-				else if (next_hdr == NEXTHDR_FRAGMENT)
-				{
-					if ( (len_delta -= sizeof(struct frag_hdr)) >= 0)
-					{
-						struct frag_hdr *ip6f =
-							(struct frag_hdr *)(src+sizeof(struct ipv6hdr)+opts_len);
-
-						opts_len += sizeof(struct frag_hdr);      /* Frag Header Length = 8 */
-						ip_hdr->id = htons(ntohl(ip6f->identification)); /* ID field */
-						ip_hdr->frag_off = htons((ntohs(ip6f->frag_off) & IP6F_OFF_MASK) >> 3);
-										                                   /* fragment offset */
-						ip_hdr->frag_off = htons(ntohs(ip_hdr->frag_off) |
-										         ((ntohs(ip6f->frag_off) & IP6F_MORE_FRAG) << 13));
-										                                  /* more fragments flag */
-						next_hdr = ip6f->nexthdr;
-					}
-					else
-					{
-						PDEBUG("ip6_ip4(): fragment header error, packet droped");
-						/* Generate ICMP Parameter Problem */
-						return -1;
-					}
-				}
-				/* No Next Header */
-				else if (next_hdr == NEXTHDR_NONE)
-				{
-					/* RFC 2460 IPv6 Specification, 4.7
-					   4.7 No Next Header
-
-					   The value 59 in the Next Header field of an IPv6 header or any
-					   extension header indicates that there is nothing following that
-					   header.  If the Payload Length field of the IPv6 header indicates the
-					   presence of octets past the end of a header whose Next Header field
-					   contains 59, those octets must be ignored, and passed on unchanged if
-					   the packet is forwarded.
-					   */
-					break;
-				}
-				else if (next_hdr == NEXTHDR_ESP || next_hdr == NEXTHDR_AUTH)
-				{
-					PDEBUG("ip6_ip4(): cannot translate AUTH or ESP extention header, packet dropped\n");
-					return -1;
-				}
-				else if (next_hdr == NEXTHDR_IPV6)
-				{
-					PDEBUG("ip6_ip4(): cannot translate IPv6-IPv6 packet, packet dropped\n");
-					return -1;
-				}
-				else if (next_hdr == 0)
-				{
-					/* As say RFC 2460 (IPv6 Spec) we should discard the packet and send an
-					   ICMP Parameter Problem message to the source of the packet, with an
-					   ICMP Code value of 1 ("unrecognized Next Header type encountered")
-					   and the ICMP Pointer field containing the offset of the unrecognized
-					   value within the original packet
-					   */
-					/* NOT IMPLEMENTED */
-					PDEBUG("ip6_ip4(): NEXTHDR in extention header = 0, packet dropped\n");
-					return -1;
-				}
-				else
-				{
-					PDEBUG("ip6_ip4(): cannot translate extention header = %d, packet dropped\n", next_hdr);
-					return -1;
-				}
-			}
-		}
-	}
-	else
-	{
-	   PDEBUG("ip6_ip4(): error packet len, packet dropped.\n");
-	   return -1;
-	}
-
-	/* Building ipv4 packet */
-
-	ip_hdr->version = IPVERSION;
-	ip_hdr->ihl = 5;
-
-	/* TOS see comment about TOS in ip4_ip6() */
-	if (tos_ignore_flag)
-		ip_hdr->tos = 0;
-	else {
-		ip_hdr->tos = ip6_hdr->priority << 4;
-		ip_hdr->tos = ip_hdr->tos | (ip6_hdr->flow_lbl[0] >> 4);
-	}
-
-	/* IPv4 Total Len = IPv6 Payload Len +
-	   IPv4 Header Len (without options) - Options Headers Len */
-	ip6_payload_len = ntohs(ip6_hdr->payload_len);
-
-	if (ip6_payload_len == 0)
-		ntot_len = 0;
-	else
-		ntot_len = ip6_payload_len + IP4_IP6_HDR_DIFF - opts_len;
-
-	ip_hdr->tot_len = htons(ntot_len);
-
-	/* IPv4 TTL = IPv6 Hop Limit */
-	ip_hdr->ttl = ip6_hdr->hop_limit;
-
-	/* IPv4 Protocol = Next Header that will point to upper layer protocol */
-	ip_hdr->protocol = next_hdr;
-
-	/* IPv4 Src addr = last 4 bytes from IPv6 Src addr */
-	ip_hdr->saddr = ip6_hdr->saddr.s6_addr32[3];
-	/* IPv4 Dst addr = last 4 bytes from IPv6 Dst addr */
-	ip_hdr->daddr = ip6_hdr->daddr.s6_addr32[3];
-
-	/* Calculate IPv4 header checksum */
-	ip_hdr->check = 0;
-	ip_hdr->check = ip_fast_csum((unsigned char *)ip_hdr, ip_hdr->ihl);
-
-	if (len_delta > 0)
-	{
-		/* PROCESS ICMP */
-
-		if (next_hdr == NEXTHDR_ICMP)
-		{
-			struct icmp6hdr *icmp6_hdr;
-			struct icmphdr *icmp_hdr;
-
-			if ((len_delta -= sizeof(struct icmp6hdr)) >= 0)
-			{
-				icmp6_hdr = (struct icmp6hdr *)(src + sizeof(struct ipv6hdr) + opts_len);
-				icmp_hdr = (struct icmphdr *)(dst + sizeof(struct iphdr));
-
-				real_len += len_delta + sizeof(struct icmphdr);
-
-				/* There is diffirent between ICMPv4/ICMPv6 protocol codes
-				   IPPROTO_ICMP = 1
-				   IPPROTO_ICMPV6 = 58        */
-				ip_hdr->protocol = IPPROTO_ICMP;
-
-				if (include_flag) {
-					/* !!! Warnig !!! We discard ICMP packets with any ICMP as included
-					   in ICMP Error. But ICMP Error messages can include ICMP Query message
-					   */
-					if (icmp6_hdr->icmp6_type != ICMPV6_ECHO_REQUEST)
-					{
-						PDEBUG("ip6_ip4(): included ICMPv6 in ICMPv6 Error message, packet dropped\n");
-						return -1;
-					}
-				}
-
-			/* Translate ICMPv6 to ICMPv4 */
-				switch (icmp6_hdr->icmp6_type)
-				{
-/* ICMP Error messages */
-			/* Destination Unreachable (Type 1) */
-				case ICMPV6_DEST_UNREACH: /* Type 1 */
-					icmp_hdr->type = ICMP_DEST_UNREACH; /* to Type 3 */
-					icmp_hdr->un.echo.id = 0;
-					icmp_hdr->un.echo.sequence = 0;
-					switch (icmp6_hdr->icmp6_code)
-					{
-					case ICMPV6_NOROUTE: /* Code 0 */
-					case ICMPV6_NOT_NEIGHBOUR: /* Code 2 */
-					case ICMPV6_ADDR_UNREACH: /* Code 3  */
-						icmp_hdr->code = ICMP_HOST_UNREACH; /* To Code 1 */
-						break;
-					case ICMPV6_ADM_PROHIBITED: /* Code 1 */
-						icmp_hdr->code = ICMP_HOST_ANO; /* To Code 10 */
-						break;
-					case ICMPV6_PORT_UNREACH: /* Code 4 */
-						icmp_hdr->code = ICMP_PORT_UNREACH; /* To Code 3 */
-
-						break;
-					default:            /* discard any other codes */
-						PDEBUG("ip6_ip4(): Unknown ICMPv6 Type %d Code %d - packet dropped.\n",
-							   ICMPV6_DEST_UNREACH, icmp6_hdr->icmp6_code);
-						return -1;
-					}
-					break;
-			/* Packet Too Big (Type 2) */
-				case ICMPV6_PKT_TOOBIG: /* Type 2 */
-					icmp_hdr->type = ICMP_DEST_UNREACH; /* to Type 3  */
-					icmp_hdr->code = ICMP_FRAG_NEEDED; /*  to Code 4 */
-					/* Change MTU, RFC 2765 (SIIT), 4.2:
-					   The MTU field needs to be adjusted for the difference between
-					   the IPv4 and IPv6 header sizes taking into account whether or
-					   not the packet in error includes a Fragment header.
-					   */
-					/* !!! Don't implement !!! */
-					icmp_hdr->un.frag.mtu = (__u16) icmp6_hdr->icmp6_mtu;
-					break;
-			/* Time Exceeded (Type 3) */
-				case ICMPV6_TIME_EXCEED:
-					icmp_hdr->type = ICMP_TIME_EXCEEDED; /* to Type 11 */
-					icmp_hdr->code = icmp6_hdr->icmp6_code; /* Code unchanged */
-					break;
-			/* Parameter Problem (Type 4) */
-				case ICMPV6_PARAMPROB:
-					switch (icmp6_hdr->icmp6_code) {
-					case ICMPV6_UNK_NEXTHDR: /* Code 1 */
-						icmp_hdr->type = ICMP_DEST_UNREACH; /* to Type 3 */
-						icmp_hdr->code = ICMP_PROT_UNREACH; /* to Code 2 */
-						break;
-					default: /* if Code != 1 */
-						icmp_hdr->type = ICMP_PARAMETERPROB; /* to Type 12 */
-						icmp_hdr->code = 0; /* to Code 0 */
-						/* Update Pointer field
-						   RFC 2765 (SIIT), 4.2:
-						   The Pointer needs to be updated to point to the corresponding
-						   field in the translated include IP header.
-						   */
-						switch (ntohl(icmp6_hdr->icmp6_pointer))
-						{
-						case 0: /* IPv6 Version -> IPv4 Version */
-							icmp_hdr->un.echo.id = 0;
-							break;
-						case 4: /* IPv6 PayloadLength -> IPv4 Total Length */
-							icmp_hdr->un.echo.id = 0x0002; /* 2 */
-							break;
-						case 6: /* IPv6 Next Header-> IPv4 Protocol */
-							icmp_hdr->un.echo.id = 0x0009; /* 9 */
-							break;
-						case 7: /* IPv6 Hop Limit -> IPv4 TTL */
-							icmp_hdr->un.echo.id = 0x0008; /* 8 */
-							break;
-						case 8: /* IPv6 Src addr -> IPv4 Src addr */
-							icmp_hdr->un.echo.id = 0x000c; /* 12 */
-							break;
-						case 24: /* IPv6 Dst addr -> IPv4 Dst addr*/
-							icmp_hdr->un.echo.id = 0x0010; /* 16 */
-							break;
-						default: /* set all ones in other cases */
-							icmp_hdr->un.echo.id = 0xff;
-							break;
-						}
-						break;
-					}
-					break;
-
-/* End of ICMP Error messages */
-
-			/* Echo Request and Echo Reply (Type 128 and 129)  */
-				case ICMPV6_ECHO_REQUEST:
-					icmperr = 0;        /* not error ICMP message */
-					icmp_hdr->type = ICMP_ECHO; /* to Type 8 */
-					icmp_hdr->code = 0; /* to Code 0 */
-					icmp_hdr->un.echo.id = icmp6_hdr->icmp6_identifier;
-					icmp_hdr->un.echo.sequence = icmp6_hdr->icmp6_sequence;
-					/* copy rest of ICMP data to result packet */
-					if (len_delta > 0)
-						memcpy(((char *)icmp_hdr) + sizeof(struct icmphdr),
-							   ((char *)icmp6_hdr) + sizeof(struct icmp6hdr), len_delta);
-					break;
-				case ICMPV6_ECHO_REPLY:
-					icmperr = 0;        /* not error ICMP message */
-					icmp_hdr->type = ICMP_ECHOREPLY; /* to Type 0 */
-					icmp_hdr->code = 0; /* to Code 0 */
-					icmp_hdr->un.echo.id = icmp6_hdr->icmp6_identifier;
-					icmp_hdr->un.echo.sequence = icmp6_hdr->icmp6_sequence;
-					/* copy rest of ICMP data */
-					if (len_delta > 0)
-						memcpy(((char *)icmp_hdr) + sizeof(struct icmphdr),
-							   ((char *)icmp6_hdr) + sizeof(struct icmp6hdr), len_delta);
-					break;
-				default:
-					/* Unknown error messages. Silently drop. */
-					PDEBUG("ip6_ip4(): unknown ICMPv6 Type %d, packet dropped.\n", icmp6_hdr->icmp6_type);
-					return -1;
-				}
-
-				if (icmperr)
-				{
-					/* If ICMP Error message, we translate IP included packet*/
-					if (len_delta >= sizeof(struct ipv6hdr))
-					{
-						if((inc_opts_len = ip6_ip4((char *)icmp6_hdr + sizeof(struct icmp6hdr), len_delta,
-										           (char *)icmp_hdr + sizeof(struct icmphdr), 1)) == -1) {
-							PDEBUG("ip6_ip4(): incorrect translation of ICMPv6 Error message, packet dropped\n");
-							return -1;
-						}
-						/* correct IPv4 Total Len that = old Total Len
-						   - Options Headers Len in included IP packet
-						   - diffirence between IPv6 Header Len and IPv4 Header Len
-						   */
-						if (ntot_len != 0)
-							ip_hdr->tot_len = htons(ntot_len - inc_opts_len - IP4_IP6_HDR_DIFF);
-						real_len = real_len - inc_opts_len - IP4_IP6_HDR_DIFF;
-					}
-					else if (len_delta > 0)
-					{
-						/* May be it need set 0x0 to rest area in result IPv4 packet,
-						 * but we copy rest data unchanged
-						 */
-						memcpy(((char *)icmp_hdr) + sizeof(struct icmphdr),
-							   ((char *)icmp6_hdr) + sizeof(struct icmp6hdr), len_delta);
-					}
-				}
-
-				/* Calculate IPv4 Header checksum */
-				ip_hdr->check = 0;
-				ip_hdr->check = ip_fast_csum((unsigned char *)ip_hdr, ip_hdr->ihl);
-
-				/* Calculate ICMPv4 checksum */
-				if (ntot_len != 0)
-				{
-					icmp_hdr->checksum = 0;
-					icmp_hdr->checksum = ip_compute_csum((unsigned char *)icmp_hdr, ntohs(ip_hdr->tot_len)
-										             - sizeof(struct iphdr));
-				}
-			}
-			else
-			{
-				PDEBUG("ip6_ip4(): error length ICMP packet, packet dropped.\n");
-				return -1;
-			}
-
-		}
-		/* PROCESS TCP and UDP (and rest data) */
-
-		else {
-			real_len += len_delta;
-			/* we copy rest data to IPv4 packet without changing */
-			memcpy(dst+sizeof(struct iphdr), src + sizeof(struct ipv6hdr) + opts_len, len_delta);
-		}
-	}
-
-	if (include_flag)           /* if it's included IP packet */
-		return opts_len;        /* return options headers length */
-	else
-		return real_len; /* result packet len */
-}
-
-/*
- * ip4_fragment(skb, len, hdr_len, dev, eth_h)
- * to fragment original IPv4 packet if result IPv6 packet will be > 1280
- */
-
-static int ip4_fragment(struct sk_buff *skb, int len, int hdr_len, struct net_device *dev, struct ethhdr *eth_h)
-{
-	struct sk_buff *skb2 = NULL;       /* pointer to new struct sk_buff for transleded packet */
-	char buff[FRAG_BUFF_SIZE+hdr_len]; /* buffer to form new fragment packet */
-	char *cur_ptr = skb->data+hdr_len; /* pointter to current packet data with len = frag_len */
-	struct iphdr *ih4 = (struct iphdr *) skb->data;
-	struct iphdr *new_ih4 = (struct iphdr *) buff; /* point to new IPv4 hdr */
-	struct ethhdr *new_eth_h;   /* point to ether hdr, need to set hard header data in fragment */
-	int data_len = len - hdr_len; /* origin packet data len */
-	int rest_len = data_len;    /* rest data to fragment */
-	int frag_len = 0;           /* current fragment len */
-	int last_frag = 0;          /* last fragment flag, if = 1, it's last fragment */
-	int flag_last_mf = 0;
-	__u16 new_id = 0;           /* to generate identification field */
-	__u16 frag_offset = 0;      /* fragment offset */
-	unsigned int csum;
-	unsigned short udp_len;
-
-#ifdef SIIT_DEBUG
-	printk("siit: it's DF == 0 and result IPv6 packet will be > 1280\n");
-	siit_print_dump(skb->data, hdr_len, "siit: (orig) ipv4_hdr dump");
-#endif
-
-	if ((ntohs(ih4->frag_off) & IP_MF) == 0 )
-		/* it's a case we'll clear MF flag in our last packet */
-		flag_last_mf = 1;
-
-	if (ih4->protocol == IPPROTO_UDP) {
-		if ( (ntohs(ih4->frag_off) & IP_OFFSET) == 0) {
-			struct udphdr *udp_hdr = (struct udphdr *)((char *)ih4 + hdr_len);
-			if (!flag_last_mf) {
-				if (udp_hdr->check == 0) {
-					/* it's a first fragment with ZERO checksum and we drop packet */
-					printk("siit: First fragment of UDP with zero checksum - packet droped\n");
-					printk("siit: addr: %x src port: %d dst port: %d\n",
-						   htonl(ih4->saddr), htons(udp_hdr->source), htons(udp_hdr->dest));
-					return -1;
-				}
-			}
-			else if (udp_hdr->check == 0) {
-				/* Calculate UDP checksum only if it's not fragment */
-				udp_len = ntohs(udp_hdr->len);
-				csum = 0;
-				csum = csum_partial((unsigned char *)udp_hdr, udp_len, csum);
-				udp_hdr->check = csum_tcpudp_magic(ih4->saddr, ih4->daddr, udp_len, IPPROTO_UDP, csum);
-			}
-		}
-	}
-
-	frag_offset = ntohs(ih4->frag_off) & IP_OFFSET;
-
-	new_id = ih4->id;
-
-	while(1) {
-		if (rest_len <= FRAG_BUFF_SIZE) {
-			/* it's last fragmen */
-			frag_len = rest_len; /* rest data */
-			last_frag = 1;
-		}
-		else
-			frag_len = FRAG_BUFF_SIZE;
-
-		/* copy IP header to buffer */
-		memcpy(buff, skb->data, hdr_len);
-		/* copy data to buffer with len = frag_len */
-		memcpy(buff + hdr_len, cur_ptr, frag_len);
-
-		/* set id field in new IPv4 header*/
-		new_ih4->id = new_id;
-
-		/* is it last fragmet */
-		if(last_frag && flag_last_mf)
-			/* clear MF flag */
-			new_ih4->frag_off = htons(frag_offset & (~IP_MF));
-		else
-			/* set MF flag */
-			new_ih4->frag_off = htons(frag_offset | IP_MF);
-
-		/* change packet total length */
-		new_ih4->tot_len = htons(frag_len+hdr_len);
-
-		/* rebuild the header checksum (IP needs it) */
-		new_ih4->check = 0;
-		new_ih4->check = ip_fast_csum((unsigned char *)new_ih4,new_ih4->ihl);
-
-		/* Allocate new sk_buff to compose translated packet */
-		skb2 = dev_alloc_skb(frag_len+hdr_len+dev->hard_header_len+IP4_IP6_HDR_DIFF+IP6_FRAGMENT_SIZE);
-		if (!skb2) {
-			printk(KERN_DEBUG "%s: alloc_skb failure - packet dropped.\n", dev->name);
-			dev_kfree_skb(skb2);
-			return -1;
-		}
-		/* allocate skb->data portion for IP header len, fragment data len and ether header len
-		 * and copy to head ether header from origin skb
-		 */
-		memcpy(skb_put(skb2, frag_len+hdr_len+dev->hard_header_len+IP4_IP6_HDR_DIFF+IP6_FRAGMENT_SIZE), (char *) eth_h,
-			   dev->hard_header_len);
-		/* correct ether header data, ether protocol field to ETH_P_IPV6 */
-		new_eth_h = (struct ethhdr *)skb2->data;
-		new_eth_h->h_proto = htons(ETH_P_IPV6);
-
-		/* reset the mac header */
-		skb_reset_mac_header(skb2);
-
-		/* pull ether header from new skb->data */
-		skb_pull(skb2, dev->hard_header_len);
-		/* set skb protocol to IPV6 */
-		skb2->protocol = htons(ETH_P_IPV6);
-
-		/* call translation function */
-		if ( ip4_ip6(buff, frag_len+hdr_len, skb2->data, 0) == -1) {
-			dev_kfree_skb(skb2);
-			return -1;
-		}
-
-		/*
-		 * Set needed fields in new sk_buff
-		 */
-		skb2->dev = dev;
-		skb2->ip_summed = CHECKSUM_UNNECESSARY;
-		skb2->pkt_type = PACKET_HOST;
-
-		/* Add transmit statistic */
-		siit_stats(dev)->tx_packets++;
-		siit_stats(dev)->tx_bytes += skb2->len;
-
-		/* send packet to upper layer */
-		netif_rx(skb2);
-
-		/* exit if it was last fragment */
-		if (last_frag)
-			break;
-
-		/* correct current data pointer */
-		cur_ptr += frag_len;
-		/* rest data len */
-		rest_len -= frag_len;
-		/* current fragment offset */
-		frag_offset = (frag_offset*8 + frag_len)/8;
-	}
-
-	return 0;
-}
-/*
- * Transmit a packet (called by the kernel)
- *
- * siit_xmit(skb, dev)
- *
- * where
- * skb - pointer to struct sk_buff with incomed packet
- * dev - pointer to struct device on which packet revieved
- *
- * Statistic:
- * for all incoming packes:
- *            stats.rx_bytes+=skb->len
- *            stats.rx_packets++
- * for packets we can't transle:
- *            stats.tx_errors++
- * device busy:
- *            stats.tx_errors++
- * for packets we can't allocate sk_buff:
- *            stats.tx_dropped++
- * for outgoing packes:
- *            stats.tx_packets++
- *            stats.tx_bytes+=skb2->len !!! But we don't set skb2->len !!!
- */
-
-static int siit_xmit(struct sk_buff *skb, struct net_device *dev)
-{
-	struct sk_buff *skb2 = NULL;/* pointer to new struct sk_buff for transleded packet */
-	struct ethhdr *eth_h;       /* pointer to incoming Ether header */
-	int len;                    /* original packets length */
-	int new_packet_len;
-	int skb_delta = 0;          /* delta size for allocate new skb */
-	char new_packet_buff[2048];
-
-	/* Check pointer to sk_buff and device structs */
-	if (skb == NULL || dev == NULL)
-		return -EINVAL;
-
-	/* Add receive statistic */
-	siit_stats(dev)->rx_bytes += skb->len;
-	siit_stats(dev)->rx_packets++;
-
-	dev->trans_start = jiffies;
-
-	/* Upper layer (IP) protocol forms sk_buff for outgoing packet
-	 * and sets IP header + Ether header too. IP layer sets outgoing
-	 * device in sk_buff->dev.
-	 * In function (from linux/net/core/dev.c) ther is a call to
-	 * device transmit function (dev->hard_start_xmit):
-	 *
-	 *    dev_queue_xmit(struct sk_buff *skb)
-	 *    {
-	 *    ...
-	 *          device *dev = skb->dev;
-	 *    ...
-	 *          dev->hard_start_xmit(skb, dev);
-	 *    ...
-	 *    }
-	 * We save pointer to ether header in eth_h and skb_pull ether header
-	 * from data field of skb_buff
-	 */
-
-	eth_h = (struct ethhdr *)skb->data; /* point to incoming packet Ether Header */
-
-#ifdef SIIT_DEBUG
-	siit_print_dump(skb->data, ETH_HLEN, "siit: eth_hdr dump");
-#endif
-
-	/* Remove hardware header from origin sk_buff */
-	skb_pull(skb,dev->hard_header_len);
-
-	/*
-	 * Process IPv4 paket
-	 */
-	if (ntohs(skb->protocol) == ETH_P_IP) {
-		int hdr_len;            /* IPv4 header length */
-		int data_len;           /* IPv4 data length */
-		struct iphdr *ih4;      /* pointer to IPv4 header */
-		struct icmphdr *icmp_hdr;   /* point to current ICMPv4 header struct */
-
-		ih4 = (struct iphdr *)skb->data; /* point to incoming packet's IPv4 header */
-
-		/* Check IPv4 Total Length */
-		if (skb->len != ntohs(ih4->tot_len)) {
-			PDEBUG("siit_xmit(): Different skb_len %x and ip4 tot_len %x - packet dropped.\n",
-				   skb->len, ih4->tot_len);
-			siit_stats(dev)->tx_errors++;
-			dev_kfree_skb(skb);
-			return 0;
-		}
-
-		len = skb->len;     /* packet's total len */
-		hdr_len = (int)(ih4->ihl * 4); /* packet's header len */
-		data_len = len - hdr_len; /* packet's data len */
-
-		/* If DF == 0 */
-		if ( (ntohs(ih4->frag_off) & IP_DF) == 0 ) {
-			/* If result IPv6 packet will be > 1280
-			   we need to fragment original IPv4 packet
-			*/
-			if ( data_len > FRAG_BUFF_SIZE ) {
-				/* call function that fragment packet and translate to IPv6 each fragment
-				 * and send to upper layer
-				 */
-				if ( ip4_fragment(skb, len, hdr_len, dev, eth_h) == -1) {
-					siit_stats(dev)->tx_errors++;
-				}
-				/* Free incoming skb */
-				dev_kfree_skb(skb);
-				/* Device can accept a new packet */
-
-				return 0;
-
-			}
-		}
-		/* If DF == 1 && MF == 0 && Fragment Offset == 0
-		 * we don't include fragment header
-		 */
-		if ( ntohs(ih4->frag_off) == IP_DF )
-			skb_delta = IP4_IP6_HDR_DIFF; /* delta is +20 */
-		else
-			skb_delta = IP4_IP6_HDR_DIFF + IP6_FRAGMENT_SIZE; /* delta is +20 and +8 */
-
-		/* If it's ICMP, check is it included IP packet in it */
-		if ( ih4->protocol == IPPROTO_ICMP) {
-			icmp_hdr = (struct icmphdr *) (skb->data+hdr_len); /* point to ICMPv4 header */
-			if ( icmp_hdr->type != ICMP_ECHO && icmp_hdr->type != ICMP_ECHOREPLY) {
-				/*
-				 * It's ICMP Error that has included IP packet
-				 * we'll add only +20 because we don't include Fragment Header
-				 * into translated included IP packet
-				 */
-				skb_delta += IP4_IP6_HDR_DIFF;
-			}
-		}
-
-		/* Allocate new sk_buff to compose translated packet */
-		skb2 = dev_alloc_skb(len+dev->hard_header_len+skb_delta);
-		if (!skb2) {
-			printk(KERN_DEBUG "%s: alloc_skb failure - packet dropped.\n", dev->name);
-			dev_kfree_skb(skb);
-			siit_stats(dev)->rx_dropped++;
-
-			return 0;
-		}
-		/* allocate skb->data portion = IPv4 packet len + ether header len
-		 * + skb_delta (max = two times (diffirence between IPv4 header and
-		 * IPv6 header + Frag Header), second for included packet,
-		 * and copy to head of skb->data ether header from origin skb
-		 */
-		memcpy(skb_put(skb2, len+dev->hard_header_len+skb_delta), (char *)eth_h, dev->hard_header_len);
-		/* correct ether header data, ether protocol field to ETH_P_IPV6 */
-		eth_h = (struct ethhdr *)skb2->data;
-		eth_h->h_proto = htons(ETH_P_IPV6);
-		skb_reset_mac_header(skb2);
-		/* remove ether header from new skb->data,
-		 * NOTE! data will rest, pointer to data and data len will change
-		 */
-		skb_pull(skb2,dev->hard_header_len);
-		/* set skb protocol to IPV6 */
-		skb2->protocol = htons(ETH_P_IPV6);
-
-		/* call translation function */
-		if (ip4_ip6(skb->data, len, skb2->data, 0) == -1 ) {
-			dev_kfree_skb(skb);
-			dev_kfree_skb(skb2);
-			siit_stats(dev)->rx_errors++;
-
-			return 0;
-		}
-	}
-	/*
-	 * IPv6 paket
-	 */
-	else if (ntohs(skb->protocol) == ETH_P_IPV6) {
-
-#ifdef SIIT_DEBUG
-		siit_print_dump(skb->data, sizeof(struct ipv6hdr), "siit: (in) ip6_hdr dump");
-#endif
-		/* packet len = skb->data len*/
-		len = skb->len;
-
-		/* call translation function */
-		if ((new_packet_len = ip6_ip4(skb->data, len, new_packet_buff, 0)) == -1 )
-		{
-			PDEBUG("siit_xmit(): error translation ipv6->ipv4, packet dropped.\n");
-			siit_stats(dev)->rx_dropped++;
-			goto end;
-		}
-
-		/* Allocate new sk_buff to compose translated packet */
-		skb2 = dev_alloc_skb(new_packet_len + dev->hard_header_len);
-		if (!skb2) {
-			printk(KERN_DEBUG "%s: alloc_skb failure, packet dropped.\n", dev->name);
-			siit_stats(dev)->rx_dropped++;
-			goto end;
-		}
-		memcpy(skb_put(skb2, new_packet_len + dev->hard_header_len), (char *)eth_h, dev->hard_header_len);
-		eth_h = (struct ethhdr *)skb2->data;
-		eth_h->h_proto = htons(ETH_P_IP);
-		skb_reset_mac_header(skb2);
-		skb_pull(skb2, dev->hard_header_len);
-		memcpy(skb2->data, new_packet_buff, new_packet_len);
-		skb2->protocol = htons(ETH_P_IP);
-	}
-	else {
-		PDEBUG("siit_xmit(): unsupported protocol family %x, packet dropped.\n", skb->protocol);
-		goto end;
-	}
-
-	/*
-	 * Set needed fields in new sk_buff
-	 */
-	skb2->pkt_type = PACKET_HOST;
-	skb2->dev = dev;
-	skb2->ip_summed = CHECKSUM_UNNECESSARY;
-
-	/* Add transmit statistic */
-	siit_stats(dev)->tx_packets++;
-	siit_stats(dev)->tx_bytes += skb2->len;
-
-	/* Send packet to upper layer protocol */
-	netif_rx(skb2);
-
-end:
-	dev_kfree_skb(skb);
-
-	return 0;
-}
-
-static bool header_ops_init = false;
-static struct header_ops siit_header_ops ____cacheline_aligned;
-
-static const struct net_device_ops siit_netdev_ops = {
-	.ndo_open		= siit_open,
-	.ndo_stop		= siit_release,
-	.ndo_start_xmit		= siit_xmit,
-};
-
-/*
- * The init function initialize of the SIIT device..
- * It is invoked by register_netdev()
- */
-
-static void
-siit_init(struct net_device *dev)
-{
-	ether_setup(dev);    /* assign some of the fields */
-	random_ether_addr(dev->dev_addr);
-
-	/*
-	 * Assign device function.
-	 */
-	dev->netdev_ops = &siit_netdev_ops;
-	dev->flags           |= IFF_NOARP;     /* ARP not used */
-	dev->tx_queue_len = 10;
-
-	if (!header_ops_init) {
-		memcpy(&siit_header_ops, dev->header_ops, sizeof(struct header_ops));
-		siit_header_ops.cache = NULL;
-	}
-	dev->header_ops = &siit_header_ops;
-}
-
-/*
- * Finally, the module stuff
- */
-static struct net_device *siit_dev = NULL;
-
-int init_module(void)
-{
-	int res = -ENOMEM;
-	int priv_size;
-
-	priv_size = sizeof(struct header_ops);
-	siit_dev = alloc_netdev(priv_size, "siit%d", siit_init);
-	if (!siit_dev)
-		goto err_alloc;
-
-	res = register_netdev(siit_dev);
-	if (res)
-		goto err_register;
-
-	return 0;
-
-err_register:
-	free_netdev(siit_dev);
-err_alloc:
-	printk(KERN_ERR "Error creating siit device: %d\n", res);
-	return res;
-}
-
-void cleanup_module(void)
-{
-	unregister_netdev(siit_dev);
-	free_netdev(siit_dev);
-}
-
-MODULE_LICENSE("GPL");
-

file:a/net/siit/src/siit.h (deleted)
--- a/net/siit/src/siit.h
+++ /dev/null
@@ -1,62 +1,1 @@
-/*
- * siit.h -- definitions for the SIIT module
- *
- *
- */
 
-/*
- * Constants
- */
-
-/* SIIT_ETH control the name of SIIT interface:
- * 0 - interface name is siit0,
- * 1 - interface name is ethX.
- */
-#define SIIT_ETH 0
-
-#define BUFF_SIZE 4096
-#define FRAG_BUFF_SIZE 1232     /* IPv6 max fragment size without IPv6 header 
-                                 * to fragmanet IPv4 if result IPv6 packet will be > 1280
-                                 */
-
-#define TRANSLATED_PREFIX 0x0000ffff /* third byte in IPv4-translated addr prefix */
-#define MAPPED_PREFIX 0x0000ffff     /* third byte in IPv4-mapped addr prefix */
-
-#define IP4_IP6_HDR_DIFF 20     /* diffirence between IPv4 and IPv6 headers */
-#define IP6_FRAGMENT_SIZE 8     /* size of Fragment Header */
-
-/* IPv6 header fields masks */
-#define IP6F_OFF_MASK       0xfff8  /* mask out offset from frag_off */
-#define IP6F_RESERVED_MASK  0x0006  /* reserved bits in frag_off */
-#define IP6F_MORE_FRAG      0x0001  /* more-fragments flag */
-
-
-
-/*
- * Macros to help debugging
- */
-
-#undef PDEBUG             /* undef it, just in case */
-#ifdef SIIT_DEBUG
-#  ifdef __KERNEL__
-     /* This one if debugging is on, and kernel space */
-#    define PDEBUG(fmt, args...) printk(KERN_DEBUG "siit: " fmt, ## args)
-#  else
-     /* This one for user space */
-#    define PDEBUG(fmt, args...) fprintf(stderr, fmt, ## args)
-#  endif
-#else
-#  define PDEBUG(fmt, args...) /* not debugging: nothing */
-#endif
-
-#undef PDEBUGG
-#define PDEBUGG(fmt, args...)
-
-
-
-
-
-
-
-
-

file:a/net/spawn-fcgi/Makefile (deleted)
--- a/net/spawn-fcgi/Makefile
+++ /dev/null
@@ -1,40 +1,1 @@
-#
-# Copyright (C) 2006-2009 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=spawn-fcgi
-PKG_VERSION:=1.6.3
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=http://www.lighttpd.net/download/
-PKG_MD5SUM:=787ed2f88d2204bf1fe4fbd6e509d1d7
-
-PKG_INSTALL = 1
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/spawn-fcgi
-  SUBMENU:=Web Servers/Proxies
-  SECTION:=net
-  CATEGORY:=Network
-  TITLE:=Tool to spawn fastcgi applications
-  URL:=http://redmine.lighttpd.net/projects/spawn-fcgi
-endef
-
-define Package/spawn-fcgi/description
-	spawn-fcgi is used to spawn fastcgi applications
-endef
-
-define Package/spawn-fcgi/install
-	$(INSTALL_DIR) $(1)/usr/bin
-	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/spawn-fcgi $(1)/usr/bin/
-endef
-
-$(eval $(call BuildPackage,spawn-fcgi))
-

file:a/net/stunnel/Makefile (deleted)
--- a/net/stunnel/Makefile
+++ /dev/null
@@ -1,66 +1,1 @@
-#
-# Copyright (C) 2006-2010 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=stunnel
-PKG_VERSION:=4.33
-PKG_RELEASE:=1
-
-PKG_SOURCE_URL:=http://www.stunnel.org/download/stunnel/src/
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=559a864066d8cc4afd8a97682c90d41c
-
-PKG_FIXUP:=autoreconf
-PKG_INSTALL:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/stunnel
-  SECTION:=net
-  CATEGORY:=Network
-  DEPENDS:=+libopenssl +libwrap
-  TITLE:=SSL TCP Wrapper
-  URL:=http://www.stunnel.org/
-endef
-
-define Package/stunnel/description
-	Stunnel is a program that allows you to encrypt arbitrary TCP
-	connections inside SSL (Secure Sockets Layer) available on both Unix
-	and Windows. Stunnel can allow you to secure non-SSL aware daemons and
-	protocols (like POP, IMAP, LDAP, etc) by having Stunnel provide the
-	encryption, requiring no changes to the daemon's code.
-endef
-
-define Package/stunnel/conffiles
-/etc/stunnel/stunnel.conf
-endef
-
-CONFIGURE_ARGS+= \
-	--with-random=/dev/urandom \
-	--with-threads=fork \
-	--with-ssl=$(STAGING_DIR)/usr \
-
-define Build/Compile
-	mkdir -p $(PKG_INSTALL_DIR)/etc/stunnel
-	echo '#dummy' > $(PKG_INSTALL_DIR)/etc/stunnel/stunnel.pem
-	$(call Build/Compile/Default)
-endef
-
-define Package/stunnel/install
-	$(INSTALL_DIR) $(1)/usr/bin
-	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/stunnel $(1)/usr/bin/
-	$(INSTALL_DIR) $(1)/usr/lib/stunnel
-	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/stunnel/libstunnel.so $(1)/usr/lib/stunnel/
-	$(INSTALL_DIR) $(1)/etc/stunnel
-	$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/stunnel/stunnel.conf-sample $(1)/etc/stunnel/stunnel.conf
-	$(INSTALL_DIR) $(1)/etc/init.d
-	$(INSTALL_BIN) ./files/stunnel.init $(1)/etc/init.d/stunnel
-endef
-
-$(eval $(call BuildPackage,stunnel))
-

--- a/net/stunnel/files/stunnel.init
+++ /dev/null
@@ -1,35 +1,1 @@
-#!/bin/sh /etc/rc.common
-# Copyright (C) 2006-2008 OpenWrt.org
 
-START=90
-RUN_D=/var
-PID_F=$RUN_D/stunnel.pid
-
-start() {
-	if [ -s "/etc/stunnel/stunnel.pem" ]; then
-		chmod og-rwx /etc/stunnel/stunnel.pem
-		[ ! -f $PID_F ] && stunnel
-	else
-		[ -e /etc/stunnel/config ] && \
-		. /etc/stunnel/config
-
-		X509_CN=${X509_CN:-"router"}
-		X509_O=${X509_O:-"openwrt.org"}
-		X509_OU=${X509_OU:-"open-source firmware"}
-
-		[ -x /sbin/keygen ] && {
-		(keygen "$X509_CN" "$X509_O" "$X509_OU" > /etc/stunnel/stunnel.pem;
-			chmod og-rwx /etc/stunnel/stunnel.pem;
-			stunnel) &
-		}
-	fi
-}
-
-stop() {
-	[ -f $PID_F ] && {
-		kill $(cat $PID_F)
-		kill -9 $(cat $PID_F)
-		rm -f $PID_F
-	}
-}
-

--- a/net/stunnel/patches/100-cross-compile.patch
+++ /dev/null
@@ -1,127 +1,1 @@
---- a/configure
-+++ b/configure
-@@ -21552,56 +21552,56 @@ _ACEOF
- fi
- rm -f conftest*
- 
--
--{ echo "$as_me:$LINENO: **************************************** PTY device files" >&5
--echo "$as_me: **************************************** PTY device files" >&6;}
--{ echo "$as_me:$LINENO: checking for \"/dev/ptmx\"" >&5
--echo $ECHO_N "checking for \"/dev/ptmx\"... $ECHO_C" >&6; }
--if test "${ac_cv_file___dev_ptmx_+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
--else
--  test "$cross_compiling" = yes &&
--  { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5
--echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}
--   { (exit 1); exit 1; }; }
--if test -r ""/dev/ptmx""; then
--  ac_cv_file___dev_ptmx_=yes
--else
--  ac_cv_file___dev_ptmx_=no
--fi
--fi
--{ echo "$as_me:$LINENO: result: $ac_cv_file___dev_ptmx_" >&5
--echo "${ECHO_T}$ac_cv_file___dev_ptmx_" >&6; }
--if test $ac_cv_file___dev_ptmx_ = yes; then
-+#
-+#{ echo "$as_me:$LINENO: **************************************** PTY device files" >&5
-+#echo "$as_me: **************************************** PTY device files" >&6;}
-+#{ echo "$as_me:$LINENO: checking for \"/dev/ptmx\"" >&5
-+#echo $ECHO_N "checking for \"/dev/ptmx\"... $ECHO_C" >&6; }
-+#if test "${ac_cv_file___dev_ptmx_+set}" = set; then
-+#  echo $ECHO_N "(cached) $ECHO_C" >&6
-+#else
-+#  test "$cross_compiling" = yes &&
-+#  { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5
-+#echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}
-+#   { (exit 1); exit 1; }; }
-+#if test -r ""/dev/ptmx""; then
-+#  ac_cv_file___dev_ptmx_=yes
-+#else
-+#  ac_cv_file___dev_ptmx_=no
-+#fi
-+#fi
-+#{ echo "$as_me:$LINENO: result: $ac_cv_file___dev_ptmx_" >&5
-+#echo "${ECHO_T}$ac_cv_file___dev_ptmx_" >&6; }
-+#if test $ac_cv_file___dev_ptmx_ = yes; then
-   cat >>confdefs.h <<\_ACEOF
--#define HAVE_DEV_PTMX 1
-+#define HAVE_DEV_PTMX 0
- _ACEOF
- 
--fi
-+#fi
- 
--{ echo "$as_me:$LINENO: checking for \"/dev/ptc\"" >&5
--echo $ECHO_N "checking for \"/dev/ptc\"... $ECHO_C" >&6; }
--if test "${ac_cv_file___dev_ptc_+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
--else
--  test "$cross_compiling" = yes &&
--  { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5
--echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}
--   { (exit 1); exit 1; }; }
--if test -r ""/dev/ptc""; then
--  ac_cv_file___dev_ptc_=yes
--else
--  ac_cv_file___dev_ptc_=no
--fi
--fi
--{ echo "$as_me:$LINENO: result: $ac_cv_file___dev_ptc_" >&5
--echo "${ECHO_T}$ac_cv_file___dev_ptc_" >&6; }
--if test $ac_cv_file___dev_ptc_ = yes; then
-+#{ echo "$as_me:$LINENO: checking for \"/dev/ptc\"" >&5
-+#echo $ECHO_N "checking for \"/dev/ptc\"... $ECHO_C" >&6; }
-+#if test "${ac_cv_file___dev_ptc_+set}" = set; then
-+#  echo $ECHO_N "(cached) $ECHO_C" >&6
-+#else
-+#  test "$cross_compiling" = yes &&
-+#  { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5
-+#echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}
-+#   { (exit 1); exit 1; }; }
-+#if test -r ""/dev/ptc""; then
-+#  ac_cv_file___dev_ptc_=yes
-+#else
-+#  ac_cv_file___dev_ptc_=no
-+#fi
-+#fi
-+#{ echo "$as_me:$LINENO: result: $ac_cv_file___dev_ptc_" >&5
-+#echo "${ECHO_T}$ac_cv_file___dev_ptc_" >&6; }
-+#if test $ac_cv_file___dev_ptc_ = yes; then
-   cat >>confdefs.h <<\_ACEOF
--#define HAVE_DEV_PTS_AND_PTC 1
-+#define HAVE_DEV_PTS_AND_PTC 0
- _ACEOF
- 
--fi
-+#fi
- 
- 
- { echo "$as_me:$LINENO: **************************************** entropy" >&5
-@@ -24049,8 +24049,8 @@ _ACEOF
- 
- 
- # Add SSL includes and libraries
--CFLAGS="$CFLAGS -I$ssldir/include"
--LIBS="$LIBS -L$ssldir/lib -lssl -lcrypto"
-+CFLAGS="$CFLAGS"
-+LIBS="$LIBS -lssl -lcrypto"
- 
- # Check for obsolete RSAref library
- { echo "$as_me:$LINENO: checking for obsolete RSAref library" >&5
---- a/configure.ac
-+++ b/configure.ac
-@@ -44,10 +44,6 @@ AC_EGREP_HEADER(socklen_t, sys/socket.h,
-     AC_MSG_RESULT([no (defined as int)])
-     AC_DEFINE(socklen_t, int))
- 
--AC_MSG_NOTICE([**************************************** PTY device files])
--AC_CHECK_FILE("/dev/ptmx", AC_DEFINE(HAVE_DEV_PTMX))
--AC_CHECK_FILE("/dev/ptc", AC_DEFINE(HAVE_DEV_PTS_AND_PTC))
--
- AC_MSG_NOTICE([**************************************** entropy])
- 
- AC_ARG_WITH(egd-socket,
 

--- a/net/stunnel/patches/101-no-comp.patch
+++ /dev/null
@@ -1,29 +1,1 @@
---- a/src/ssl.c
-+++ b/src/ssl.c
-@@ -72,14 +72,17 @@ int ssl_configure(void) { /* configure g
-     s_log(LOG_NOTICE, "FIPS mode %s",
-         global_options.option.fips ? "enabled" : "disabled");
- #endif /* USE_FIPS */
-+#ifndef OPENSSL_NO_COMP   
-     if(global_options.compression!=COMP_NONE && !init_compression())
-         return 0;
-+#endif
-     if(!init_prng())
-         return 0;
-     s_log(LOG_DEBUG, "PRNG seeded successfully");
-     return 1; /* SUCCESS */
- }
- 
-+#ifndef OPENSSL_NO_COMP
- static int init_compression(void) {
-     int id=0;
-     COMP_METHOD *cm=NULL;
-@@ -111,6 +114,7 @@ static int init_compression(void) {
-     s_log(LOG_INFO, "Compression enabled using %s method", name);
-     return 1;
- }
-+#endif
- 
- static int init_prng(void) {
-     int totbytes=0;
 

--- a/net/stunnel/patches/102-no-ssl2.patch
+++ /dev/null
@@ -1,14 +1,1 @@
---- a/src/options.c
-+++ b/src/options.c
-@@ -1234,8 +1234,10 @@ static char *parse_service_option(CMD cm
-             section->client_method=(SSL_METHOD *)SSLv23_client_method();
-             section->server_method=(SSL_METHOD *)SSLv23_server_method();
-         } else if(!strcasecmp(arg, "SSLv2")) {
-+#ifndef OPENSSL_NO_SSL2
-             section->client_method=(SSL_METHOD *)SSLv2_client_method();
-             section->server_method=(SSL_METHOD *)SSLv2_server_method();
-+#endif
-         } else if(!strcasecmp(arg, "SSLv3")) {
-             section->client_method=(SSL_METHOD *)SSLv3_client_method();
-             section->server_method=(SSL_METHOD *)SSLv3_server_method();
 

--- a/net/stunnel/patches/103-no-zlib-link.patch
+++ /dev/null
@@ -1,13 +1,1 @@
-Avoid linking with zlib, which is a dependency of openssl, not ours.
---- a/configure
-+++ b/configure
-@@ -23017,7 +23017,7 @@ if test $ac_cv_lib_z_inflateEnd = yes; t
- #define HAVE_LIBZ 1
- _ACEOF
- 
--  LIBS="-lz $LIBS"
-+#  LIBS="-lz $LIBS"
- 
- fi
- 
 

--- a/net/stunnel/patches/104-fix-paths.patch
+++ /dev/null
@@ -1,43 +1,1 @@
-## Do several path fixups, removing unneeded @prefix@s
---- a/tools/stunnel.conf-sample.in
-+++ b/tools/stunnel.conf-sample.in
-@@ -4,15 +4,15 @@
- ; please read the manual and make sure you understand them
- 
- ; certificate/key is needed in server mode and optional in client mode
--cert = @prefix@/etc/stunnel/mail.pem
--;key = @prefix@/etc/stunnel/mail.pem
-+cert = @sysconfdir@/stunnel/stunnel.pem
-+;key = @sysconfdir@/stunnel/stunnel.pem
- 
- ; protocol version (all, SSLv2, SSLv3, TLSv1)
- sslVersion = SSLv3
- 
- ; security enhancements for UNIX systems - comment them out on Win32
- ; for chroot a copy of some devices and files is needed within the jail
--chroot = @prefix@/var/lib/stunnel/
-+chroot = @localstatedir@
- setuid = nobody
- setgid = @DEFAULT_GROUP@
- ; PID is created inside the chroot jail
-@@ -33,16 +33,16 @@ socket = r:TCP_NODELAY=1
- ; CApath is located inside chroot jail
- ;CApath = /certs
- ; it's often easier to use CAfile
--;CAfile = @prefix@/etc/stunnel/certs.pem
-+;CAfile = @sysconfdir@/stunnel/certs.pem
- ; don't forget to c_rehash CRLpath
- ; CRLpath is located inside chroot jail
- ;CRLpath = /crls
- ; alternatively CRLfile can be used
--;CRLfile = @prefix@/etc/stunnel/crls.pem
-+;CRLfile = @sysconfdir@/stunnel/crls.pem
- 
- ; debugging stuff (may useful for troubleshooting)
- ;debug = 7
--;output = stunnel.log
-+;output = @localstatedir@/log/stunnel.log
- 
- ; SSL client mode
- ;client = yes
 

--- a/net/stunnel/patches/105-stunnel-conf.patch
+++ /dev/null
@@ -1,55 +1,1 @@
---- a/tools/stunnel.conf-sample.in
-+++ b/tools/stunnel.conf-sample.in
-@@ -8,7 +8,7 @@ cert = @sysconfdir@/stunnel/stunnel.pem
- ;key = @sysconfdir@/stunnel/stunnel.pem
- 
- ; protocol version (all, SSLv2, SSLv3, TLSv1)
--sslVersion = SSLv3
-+sslVersion = all
- 
- ; security enhancements for UNIX systems - comment them out on Win32
- ; for chroot a copy of some devices and files is needed within the jail
-@@ -49,21 +49,26 @@ socket = r:TCP_NODELAY=1
- 
- ; service-level configuration
- 
--[pop3s]
--accept  = 995
--connect = 110
--
--[imaps]
--accept  = 993
--connect = 143
--
--[ssmtp]
--accept  = 465
--connect = 25
--
--;[https]
--;accept  = 443
--;connect = 80
--;TIMEOUTclose = 0
-+;[pop3s]
-+;accept  = 995
-+;connect = 110
-+
-+;[imaps]
-+;accept  = 993
-+;connect = 143
-+
-+;[ssmtp]
-+;accept  = 465
-+;connect = 25
-+
-+[https]
-+accept  = 443
-+connect = 80
-+TIMEOUTclose = 0
-+
-+[chilli]
-+accept  = 3443
-+connect = 3442
-+TIMEOUTclose = 0
- 
- ; vim:ft=dosini
 

--- a/net/stunnel/patches/106-stunnel-xforwardedfor.patch
+++ /dev/null
@@ -1,249 +1,1 @@
---- a/doc/stunnel.8
-+++ b/doc/stunnel.8
-@@ -504,7 +504,10 @@ time to keep an idle connection
- .IP "\fBtransparent\fR = yes | no (Unix only)" 4
- .IX Item "transparent = yes | no (Unix only)"
- transparent proxy mode
--.Sp
-+.IP "\fBxforwardedfor\fR = yes | no" 4
-+.IX Item "xforwardedfor = yes | no"
-+append an 'X-Forwarded-For:' HTTP request header providing the
-+client's IP address to the server.
- Re-write address to appear as if wrapped daemon is connecting
- from the \s-1SSL\s0 client machine instead of the machine running \fBstunnel\fR.
- .Sp
---- a/doc/stunnel.fr.8
-+++ b/doc/stunnel.fr.8
-@@ -445,6 +445,10 @@ Cette option permet de relier une adress

- .Sp

-+.IP "\fBxforwardedfor\fR = yes | no" 4
-+.IX Item "xforwardedfor = yes | no"

-+au serveur l'adresse IP du client.
- .IP "\fBpty\fR = yes | no (Unix seulement)" 4
- .IX Item "pty = yes | no (Unix seulement)"

---- a/src/client.c
-+++ b/src/client.c
-@@ -86,6 +86,12 @@ CLI *alloc_client_session(SERVICE_OPTION
-         return NULL;
-     }
-     c->opt=opt;
-+    /* some options need space to add some information */
-+    if (c->opt->option.xforwardedfor)
-+        c->buffsize = BUFFSIZE - BUFF_RESERVED;
-+    else
-+        c->buffsize = BUFFSIZE;
-+    c->crlf_seen=0;
-     c->local_rfd.fd=rfd;
-     c->local_wfd.fd=wfd;
-     return c;
-@@ -376,6 +382,29 @@ static void init_ssl(CLI *c) {
-     }
- }
- 
-+/* Moves all data from the buffer <buffer> between positions <start> and <stop>
-+ * to insert <string> of length <len>. <start> and <stop> are updated to their
-+ * new respective values, and the number of characters inserted is returned.
-+ * If <len> is too long, nothing is done and -1 is returned.
-+ * Note that neither <string> nor <buffer> can be NULL.
-+*/
-+static int buffer_insert_with_len(char *buffer, int *start, int *stop, int limit, char *string, int len) {
-+    if (len > limit - *stop)
-+	return -1;
-+    if (*start > *stop)
-+	return -1;
-+    memmove(buffer + *start + len, buffer + *start, *stop - *start);
-+    memcpy(buffer + *start, string, len);
-+    *start += len;
-+    *stop += len;
-+    return len;
-+}
-+
-+static int buffer_insert(char *buffer, int *start, int *stop, int limit, char *string) {
-+    return buffer_insert_with_len(buffer, start, stop, limit, string, strlen(string));
-+}
-+
-+
- /****************************** some defines for transfer() */
- /* is socket/SSL open for read/write? */
- #define sock_rd (c->sock_rfd->rd)
-@@ -410,13 +439,16 @@ static void transfer(CLI *c) {
-         check_SSL_pending=0;
- 
-         SSL_read_wants_read=
--            ssl_rd && c->ssl_ptr<BUFFSIZE && !SSL_read_wants_write;
-+            //ssl_rd && c->ssl_ptr<BUFFSIZE && !SSL_read_wants_write;
-+            ssl_rd && c->ssl_ptr<c->buffsize && !SSL_read_wants_write;
-+            
-         SSL_write_wants_write=
-             ssl_wr && c->sock_ptr && !SSL_write_wants_read;
- 
-         /****************************** setup c->fds structure */
-         s_poll_init(&c->fds); /* initialize the structure */
--        if(sock_rd && c->sock_ptr<BUFFSIZE)
-+        //if(sock_rd && c->sock_ptr<BUFFSIZE)
-+        if(sock_rd && c->sock_ptr<c->buffsize)
-             s_poll_add(&c->fds, c->sock_rfd->fd, 1, 0);
-         if(SSL_read_wants_read ||
-                 SSL_write_wants_read ||
-@@ -515,7 +547,8 @@ static void transfer(CLI *c) {
-                 break;
-             default:
-                 memmove(c->ssl_buff, c->ssl_buff+num, c->ssl_ptr-num);
--                if(c->ssl_ptr==BUFFSIZE) /* buffer was previously full */
-+                //if(c->ssl_ptr==BUFFSIZE) /* buffer was previously full */
-+                if(c->ssl_ptr>=c->buffsize) /* buffer was previously full */
-                     check_SSL_pending=1; /* check for data buffered by SSL */
-                 c->ssl_ptr-=num;
-                 c->sock_bytes+=num;
-@@ -577,7 +610,8 @@ static void transfer(CLI *c) {
-         /****************************** read from socket */
-         if(sock_rd && sock_can_rd) {
-             num=readsocket(c->sock_rfd->fd,
--                c->sock_buff+c->sock_ptr, BUFFSIZE-c->sock_ptr);
-+                //c->sock_buff+c->sock_ptr, BUFFSIZE-c->sock_ptr);
-+                c->sock_buff+c->sock_ptr, c->buffsize-c->sock_ptr);
-             switch(num) {
-             case -1:
-                 parse_socket_error(c, "readsocket");
-@@ -597,10 +631,73 @@ static void transfer(CLI *c) {
-                 (SSL_read_wants_write && ssl_can_wr) ||
-                 (check_SSL_pending && SSL_pending(c->ssl))) {
-             SSL_read_wants_write=0;
--            num=SSL_read(c->ssl, c->ssl_buff+c->ssl_ptr, BUFFSIZE-c->ssl_ptr);
-+            //num=SSL_read(c->ssl, c->ssl_buff+c->ssl_ptr, BUFFSIZE-c->ssl_ptr);
-+            num=SSL_read(c->ssl, c->ssl_buff+c->ssl_ptr, c->buffsize-c->ssl_ptr);
-             switch(err=SSL_get_error(c->ssl, num)) {
-             case SSL_ERROR_NONE:
-+                //c->ssl_ptr+=num;
-+                if (c->buffsize != BUFFSIZE && c->opt->option.xforwardedfor) { /* some work left to do */
-+                    int last = c->ssl_ptr;
-+                    c->ssl_ptr += num;
-+             
-+                    /* Look for end of HTTP headers between last and ssl_ptr.
-+                     * To achieve this reliably, we have to count the number of
-+                     * successive [CR]LF and to memorize it in case it's spread
-+                     * over multiple segments. --WT.
-+                     */
-+                    while (last < c->ssl_ptr) {
-+                  if (c->ssl_buff[last] == '\n') {
-+                      if (++c->crlf_seen == 2)
-+                    break;
-+                  } else if (last < c->ssl_ptr - 1 &&
-+                             c->ssl_buff[last] == '\r' &&
-+                       c->ssl_buff[last+1] == '\n') {
-+                      if (++c->crlf_seen == 2)
-+                    break;
-+                      last++;
-+                  } else if (c->ssl_buff[last] != '\r')
-+                      /* don't refuse '\r' because we may get a '\n' on next read */
-+                      c->crlf_seen = 0;
-+                  last++;
-+                    }
-+                    if (c->crlf_seen >= 2) {
-+                  /* We have all the HTTP headers now. We don't need to
-+                   * reserve any space anymore. <ssl_ptr> points to the
-+                   * first byte of unread data, and <last> points to the
-+                   * exact location where we want to insert our headers,
-+                   * which is right before the empty line.
-+                   */
-+                  c->buffsize = BUFFSIZE;
-+             
-+                  if (c->opt->option.xforwardedfor) {
-+                      /* X-Forwarded-For: xxxx \r\n\0 */
-+                      char xforw[17 + IPLEN + 3];
-+             
-+                      /* We will insert our X-Forwarded-For: header here.
-+                       * We need to write the IP address, but if we use
-+                       * sprintf, it will pad with the terminating 0.
-+                       * So we will pass via a temporary buffer allocated
-+                       * on the stack.
-+                       */
-+                      memcpy(xforw, "X-Forwarded-For: ", 17);
-+                      if (getnameinfo(&c->peer_addr.addr[0].sa,
-+                          addr_len(c->peer_addr.addr[0]),
-+                          xforw + 17, IPLEN, NULL, 0,
-+                          NI_NUMERICHOST) == 0) {
-+                    strcat(xforw + 17, "\r\n");
-+                    buffer_insert(c->ssl_buff, &last, &c->ssl_ptr,
-+                            c->buffsize, xforw);
-+                      }
-+                      /* last still points to the \r\n and ssl_ptr to the
-+                       * end of the buffer, so we may add as many headers
-+                       * as wee need to.
-+                       */
-+                  }			
-+                    }
-+                }
-+                else
-                 c->ssl_ptr+=num;
-+
-                 watchdog=0; /* reset watchdog */
-                 break;
-             case SSL_ERROR_WANT_WRITE:
---- a/src/common.h
-+++ b/src/common.h
-@@ -53,6 +53,9 @@
- /* I/O buffer size */
- #define BUFFSIZE 16384
- 
-+/* maximum space reserved for header insertion in BUFFSIZE */
-+#define BUFF_RESERVED  1024
-+
- /* length of strings (including the terminating '\0' character) */
- /* it can't be lower than 256 bytes or NTLM authentication will break */
- #define STRLEN 256
---- a/src/options.c
-+++ b/src/options.c
-@@ -792,6 +792,28 @@ static char *parse_service_option(CMD cm
-     }
- #endif
- 
-+    /* xforwardedfor */
-+    switch(cmd) {
-+    case CMD_INIT:
-+        section->option.xforwardedfor=0;
-+        break;
-+    case CMD_EXEC:
-+        if(strcasecmp(opt, "xforwardedfor"))
-+            break;
-+        if(!strcasecmp(arg, "yes"))
-+            section->option.xforwardedfor=1;
-+        else if(!strcasecmp(arg, "no"))
-+            section->option.xforwardedfor=0;
-+        else
-+            return "argument should be either 'yes' or 'no'";
-+        return NULL; /* OK */
-+    case CMD_DEFAULT:
-+        break;
-+    case CMD_HELP:
-+        s_log("%-15s = yes|no append an HTTP X-Forwarded-For header","xforwardedfor");
-+        break;
-+    }
-+
-     /* exec */
-     switch(cmd) {
-     case CMD_INIT:
---- a/src/prototypes.h
-+++ b/src/prototypes.h
-@@ -177,6 +177,7 @@ typedef struct service_options_struct {
-         unsigned int remote:1;
-         unsigned int retry:1; /* loop remote+program */
-         unsigned int sessiond:1;
-+        unsigned int xforwardedfor:1;
-         unsigned int program:1;
- #ifndef USE_WIN32
-         unsigned int pty:1;
-@@ -351,6 +352,8 @@ typedef struct {
-     FD *ssl_rfd, *ssl_wfd; /* read and write SSL descriptors */
-     int sock_bytes, ssl_bytes; /* bytes written to socket and ssl */
-     s_poll_set fds; /* file descriptors */
-+    int buffsize;  /* current buffer size, may be lower than BUFFSIZE */
-+    int crlf_seen; /* the number of successive CRLF seen */
- } CLI;
- 
- extern int max_fds, max_clients;
 

file:a/net/tor-alpha/Makefile (deleted)
--- a/net/tor-alpha/Makefile
+++ /dev/null
@@ -1,123 +1,1 @@
-#
-# Copyright (C) 2008-2014 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=tor-alpha
-PKG_VERSION:=0.2.5.4
-PKG_RELEASE:=1
-
-PKG_SOURCE:=tor-$(PKG_VERSION)-alpha.tar.gz
-PKG_SOURCE_URL:=https://www.torproject.org/dist \
-	https://archive.torproject.org/tor-package-archive \
-	http://tor.mirror.tn/dist
-PKG_MD5SUM:=c913735a3527fec3e9bacf3a1e1a70bf
-
-PKG_BUILD_DEPENDS:=libminiupnpc libnatpmp
-PKG_BUILD_DIR:=$(BUILD_DIR)/tor-$(PKG_VERSION)-alpha
-PKG_INSTALL:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/tor-alpha/Default
-  SECTION:=net
-  CATEGORY:=Network
-  URL:=https://www.torproject.org/
-endef
-
-define Package/tor-alpha/Default/description
- Tor is a toolset for a wide range of organizations and people that want to
- improve their safety and security on the Internet. Using Tor can help you
- anonymize web browsing and publishing, instant messaging, IRC, SSH, and
- more. Tor also provides a platform on which software developers can build
- new applications with built-in anonymity, safety, and privacy features.
-endef
-
-define Package/tor-alpha
-$(call Package/tor-alpha/Default)
-  TITLE:=An anonymous Internet communication system
-  DEPENDS:=+libevent2 +libopenssl +libpthread +librt +SSP_SUPPORT:libssp
-endef
-
-define Package/tor-alpha/description
-$(call Package/tor-alpha/Default/description)
- This package contains the tor daemon.
-endef
-
-define Package/tor-alpha-fw-helper
-$(call Package/tor-alpha/Default)
-  TITLE:=Firewall helper for tor
-  DEPENDS:=+tor-alpha +libminiupnpc +libnatpmp
-endef
-
-define Package/tor-alpha-fw-helper/description
-$(call Package/tor-alpha/Default/description)
- This package contains a helper for automatically configuring port forwarding.
-endef
-
-define Package/tor-alpha-geoip
-$(call Package/tor-alpha/Default)
-  TITLE:=GeoIP db for tor
-  DEPENDS:=+tor-alpha
-endef
-
-define Package/tor-alpha-geoip/description
-$(call Package/tor-alpha/Default/description)
- This package contains a GeoIP database mapping IP addresses to countries.
-endef
-
-define Package/tor-alpha/conffiles
-/etc/tor/torrc
-endef
-
-CONFIGURE_ARGS += \
-	--with-libevent-dir="$(STAGING_DIR)/usr" \
-	--with-ssl-dir="$(STAGING_DIR)/usr" \
-	--enable-upnp \
-	--with-libminiupnpc-dir="$(STAGING_DIR)/usr" \
-	--enable-nat-pmp \
-	--with-libnatpmp-dir="$(STAGING_DIR)/usr" \
-	--disable-asciidoc \
-	--disable-threads
-
-ifneq ($(CONFIG_SSP_SUPPORT),y)
-	CONFIGURE_ARGS += \
-		--disable-gcc-hardening
-	MAKE_FLAGS += \
-		CFLAGS="$(TARGET_CFLAGS)"
-else
-	MAKE_FLAGS += \
-		CFLAGS="$(TARGET_CFLAGS) -fPIC"
-
-endif
-
-CONFIGURE_VARS += \
-	CROSS_COMPILE="yes"
-
-define Package/tor-alpha/install
-	$(INSTALL_DIR) $(1)/usr/sbin
-	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor $(1)/usr/sbin/
-	$(INSTALL_DIR) $(1)/etc/init.d
-	$(INSTALL_BIN) ./files/tor.init $(1)/etc/init.d/tor
-	$(INSTALL_DIR) $(1)/etc/tor
-	$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/tor/torrc.sample $(1)/etc/tor/torrc
-endef
-
-define Package/tor-alpha-fw-helper/install
-	$(INSTALL_DIR) $(1)/usr/bin
-	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor-fw-helper $(1)/usr/bin/
-endef
-
-define Package/tor-alpha-geoip/install
-	$(INSTALL_DIR) $(1)/usr/share/tor
-	$(CP) $(PKG_INSTALL_DIR)/usr/share/tor/geoip $(1)/usr/share/tor/
-endef
-
-$(eval $(call BuildPackage,tor-alpha))
-$(eval $(call BuildPackage,tor-alpha-fw-helper))
-$(eval $(call BuildPackage,tor-alpha-geoip))
-

--- a/net/tor-alpha/files/tor.init
+++ /dev/null
@@ -1,31 +1,1 @@
-#!/bin/sh /etc/rc.common
-# Copyright (C) 2006-2011 OpenWrt.org
 
-START=50
-STOP=50
-
-SERVICE_USE_PID=1
-
-start() {
-	user_exists tor 52 || user_add tor 52 52 /var/lib/tor
-	group_exists tor 52 || group_add tor 52
-	[ -f /var/run/tor.pid ] || {
-		touch /var/run/tor.pid
-		chown tor:tor /var/run/tor.pid
-	}
-	[ -d /var/lib/tor ] || {
-		mkdir -m 0755 -p /var/lib/tor
-		chmod 0700 /var/lib/tor
-		chown tor:tor /var/lib/tor
-	}
-	[ -d /var/log/tor ] || {
-		mkdir -m 0755 -p /var/log/tor
-		chown tor:tor /var/log/tor
-	}
-	service_start /usr/sbin/tor --PidFile /var/run/tor.pid
-}
-
-stop() {
-	service_stop /usr/sbin/tor
-}
-

--- a/net/tor-alpha/patches/001-torrc.patch
+++ /dev/null
@@ -1,22 +1,1 @@
---- a/src/config/torrc.sample.in
-+++ b/src/config/torrc.sample.in
-@@ -45,11 +45,11 @@
- ## Uncomment this to start the process in the background... or use
- ## --runasdaemon 1 on the command line. This is ignored on Windows;
- ## see the FAQ entry if you want Tor to run as an NT service.
--#RunAsDaemon 1
-+RunAsDaemon 1
- 
- ## The directory for keeping all the keys/etc. By default, we store
- ## things in $HOME/.tor on Unix, and in Application Data\tor on Windows.
--#DataDirectory @LOCALSTATEDIR@/lib/tor
-+DataDirectory @LOCALSTATEDIR@/lib/tor
- 
- ## The port on which Tor will listen for local connections from Tor
- ## controller applications, as documented in control-spec.txt.
-@@ -190,3 +190,4 @@
- ## address manually to your friends, uncomment this line:
- #PublishServerDescriptor 0
- 
-+User tor
 

--- a/net/uhub/Makefile
+++ b/net/uhub/Makefile
@@ -35,7 +35,7 @@
 TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include/libevent
 TARGET_LDFLAGS = -L$(STAGING_DIR)/usr/lib/libevent -L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib
 
-ifdef CONFIG_USE_EGLIBC
+ifdef CONFIG_USE_GLIBC
 TARGET_LDFLAGS += -lrt
 endif
 

file:a/net/usbip/Makefile (deleted)
--- a/net/usbip/Makefile
+++ /dev/null
@@ -1,108 +1,1 @@
-#
-# Copyright (C) 2010-2014 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
-include $(TOPDIR)/rules.mk
-include $(INCLUDE_DIR)/kernel.mk
-
-PKG_NAME:=usbip
-PKG_RELEASE:=3
-
-# Since kernel 2.6.39.1 userspace tools are inside the kernel tree
-# Package Automatic match version in kernel
-# MD5SUM is not useful kernel package already check it
-PKG_VERSION:=$(shell  sed -n -e '/^AC_INIT/s/.*\[\([[:digit:]\.]*\)\].*/\1/gp' $(LINUX_DIR)/drivers/staging/usbip/userspace/configure.ac)
-PKG_SOURCE:=
-PKG_SOURCE_URL:=
-PKG_MD5SUM:=unknown
-
-PKG_MAINTAINER:=Nuno Goncalves <nunojpg@gmail.com>
-
-PATCH_DIR:=./patches-$(PKG_VERSION)
-
-define prepare_source_directory
-	rm -rf $(PKG_BUILD_DIR)
-	$(CP) $(LINUX_DIR)/drivers/staging/usbip/userspace $(PKG_BUILD_DIR)
-endef
-Hooks/Prepare/Pre += prepare_source_directory
-
-PKG_BUILD_DEPENDS:=glib2 sysfsutils
-PKG_FIXUP:=autoreconf
-PKG_INSTALL:=1
-
-include $(INCLUDE_DIR)/package.mk
-include $(INCLUDE_DIR)/nls.mk
-
-define Package/usbip/Common
-  TITLE:=USB-over-IP
-  URL:=http://usbip.sourceforge.net/
-  DEPENDS:=@USB_SUPPORT
-endef
-
-define Package/usbip/Default
-  $(call Package/usbip/Common)
-  SECTION:=net
-  CATEGORY:=Network
-endef
-
-define Package/usbip
-  $(call Package/usbip/Default)
-  TITLE+= (common)
-  DEPENDS+= +libsysfs +libwrap +kmod-usbip
-endef
-
-define Package/usbip-client
-  $(call Package/usbip/Default)
-  TITLE+= (client)
-  DEPENDS+= usbip +glib2 +kmod-usbip-client
-endef
-
-define Package/usbip-server
-  $(call Package/usbip/Default)
-  TITLE+= (server)
-  DEPENDS+= usbip +glib2 +kmod-usbip-server
-endef
-
-CONFIGURE_PATH:=.
-MAKE_PATH:=.
-LIBTOOL_PATHS:=.
-MAKE_FLAGS+=CFLAGS="-Wno-implicit-function-declaration"
-
-define Build/Configure
-	(cd $(PKG_BUILD_DIR); ./autogen.sh );
-	$(call Build/Configure/Default)
-endef
-
-CFLAGS+="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include"
-
-define Download/usb.ids
-  URL:=http://www.linux-usb.org/
-  FILE:=usb.ids
-  MD5SUM:=
-endef
-
-define Package/usbip/install
-	$(INSTALL_DIR) $(1)/usr/lib
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libusbip.so.* $(1)/usr/lib/
-	$(INSTALL_DIR) $(1)/usr/share/hwdata
-	$(CP) $(DL_DIR)/usb.ids $(1)/usr/share/hwdata/
-endef
-
-define Package/usbip-client/install
-	$(INSTALL_DIR) $(1)/usr/sbin
-	$(CP) $(PKG_INSTALL_DIR)/usr/sbin/usbip $(1)/usr/sbin/
-endef
-
-define Package/usbip-server/install
-	$(INSTALL_DIR) $(1)/usr/sbin
-	$(CP) $(PKG_INSTALL_DIR)/usr/sbin/usbipd $(1)/usr/sbin/
-endef
-
-$(eval $(call Download,usb.ids))
-$(eval $(call BuildPackage,usbip))
-$(eval $(call BuildPackage,usbip-client))
-$(eval $(call BuildPackage,usbip-server))
-

--- a/net/usbip/patches/001-upstream_svn_r99.diff
+++ /dev/null
@@ -1,12 +1,1 @@
-Index: trunk/src/cmd/Makefile.am
-===================================================================
---- trunk/src/cmd/Makefile.am	(revision 98)
-+++ trunk/src/cmd/Makefile.am	(revision 99)
-@@ -17,5 +17,5 @@
- INCLUDES = -I$(top_srcdir)/lib
- LDADD = ../lib/libusbip.la @PACKAGE_LIBS@
- EXTRA_CFLAGS = @EXTRA_CFLAGS@
--AM_CFLAGS = -Wall -W -Wstrict-prototypes -std=gnu99 $(EXTRA_CFLAGS) @PACKAGE_CFLAGS@
-+AM_CFLAGS = -Wall -W -Wstrict-prototypes -std=gnu99 $(EXTRA_CFLAGS) @PACKAGE_CFLAGS@ -DUSBIDS_FILE='"@USBIDS_DIR@/usb.ids"'
- 
 

--- a/net/usbip/patches/002-upstream_svn_r152.patch
+++ /dev/null
@@ -1,230 +1,1 @@
---- a/drivers/head/stub_dev.c
-+++ b/drivers/head/stub_dev.c
-@@ -398,7 +398,11 @@ static int stub_probe(struct usb_interfa
- {
- 	struct usb_device *udev = interface_to_usbdev(interface);
- 	struct stub_device *sdev = NULL;
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
- 	char *udev_busid = interface->dev.parent->bus_id;
-+#else
-+	char *udev_busid = dev_name(interface->dev.parent);
-+#endif
- 	int err = 0;
- 
- 	udbg("Enter\n");
---- a/drivers/head/stub_main.c
-+++ b/drivers/head/stub_main.c
-@@ -252,18 +252,17 @@ static int __init usb_stub_init(void)
- 		return -ENOMEM;
- 	}
- 
-+	info(DRIVER_DESC "" DRIVER_VERSION);
-+
-+	memset(busid_table, 0, sizeof(busid_table));
-+	spin_lock_init(&busid_table_lock);
-+
- 	ret = usb_register(&stub_driver);
- 	if (ret) {
- 		uerr("usb_register failed %d\n", ret);
- 		return ret;
- 	}
- 
--
--	info(DRIVER_DESC "" DRIVER_VERSION);
--
--	memset(busid_table, 0, sizeof(busid_table));
--	spin_lock_init(&busid_table_lock);
--
- 	ret = driver_create_file(&stub_driver.drvwrap.driver, &driver_attr_match_busid);
- 
- 	if (ret) {
---- a/drivers/head/stub_rx.c
-+++ b/drivers/head/stub_rx.c
-@@ -159,7 +159,11 @@ static int tweak_set_configuration_cmd(s
- 	 * A user may need to set a special configuration value before
- 	 * exporting the device.
- 	 */
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
- 	uinfo("set_configuration (%d) to %s\n", config, urb->dev->dev.bus_id);
-+#else
-+	uinfo("set_configuration (%d) to %s\n", config, dev_name(&urb->dev->dev));
-+#endif
- 	uinfo("but, skip!\n");
- 
- 	return 0;
-@@ -177,7 +181,11 @@ static int tweak_reset_device_cmd(struct
- 	value = le16_to_cpu(req->wValue);
- 	index = le16_to_cpu(req->wIndex);
- 
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
- 	uinfo("reset_device (port %d) to %s\n", index, urb->dev->dev.bus_id);
-+#else
-+	uinfo("reset_device (port %d) to %s\n", index, dev_name(&urb->dev->dev));
-+#endif
- 
- 	/* all interfaces should be owned by usbip driver, so just reset it. */
- 	ret = usb_lock_device_for_reset(urb->dev, NULL);
-@@ -187,7 +195,11 @@ static int tweak_reset_device_cmd(struct
- 	}
- 
- 	/* try to reset the device */
--	ret = usb_reset_composite_device(urb->dev, NULL);
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
-+    ret = usb_reset_composite_device(urb->dev, NULL);
-+#else
-+	ret = usb_reset_device(urb->dev);
-+#endif
- 	if (ret < 0)
- 		uerr("device reset\n");
- 
---- a/drivers/head/usbip_common.c
-+++ b/drivers/head/usbip_common.c
-@@ -55,10 +55,7 @@ static ssize_t show_flag(struct device *
- static ssize_t store_flag(struct device *dev, struct device_attribute *attr,
- 		const char *buf, size_t count)
- {
--	unsigned long flag;
--
--	sscanf(buf, "%lx", &flag);
--	usbip_debug_flag = flag;
-+	sscanf(buf, "%lx", &usbip_debug_flag);
- 
- 	return count;
- }
-@@ -390,7 +387,7 @@ int usbip_thread(void *param)
- 	unlock_kernel();
- 
- 	/* srv.rb must wait for rx_thread starting */
--	complete(&ut->thread_done);
-+	complete(&ut->thread_started);
- 
- 	/* start of while loop */
- 	ut->loop_ops(ut);
-@@ -403,15 +400,21 @@ int usbip_thread(void *param)
- 
- void usbip_start_threads(struct usbip_device *ud)
- {
-+
- 	/*
- 	 * threads are invoked per one device (per one connection).
- 	 */
-+    INIT_COMPLETION(ud->tcp_rx.thread_started);
-+    INIT_COMPLETION(ud->tcp_tx.thread_started);
-+    INIT_COMPLETION(ud->tcp_rx.thread_done);
-+    INIT_COMPLETION(ud->tcp_tx.thread_done);
-+
- 	kernel_thread((int(*)(void *))usbip_thread, (void *)&ud->tcp_rx, 0);
- 	kernel_thread((int(*)(void *))usbip_thread, (void *)&ud->tcp_tx, 0);
- 
- 	/* confirm threads are starting */
--	wait_for_completion(&ud->tcp_rx.thread_done);
--	wait_for_completion(&ud->tcp_tx.thread_done);
-+	wait_for_completion(&ud->tcp_rx.thread_started);
-+	wait_for_completion(&ud->tcp_tx.thread_started);
- }
- EXPORT_SYMBOL(usbip_start_threads);
- 
-@@ -436,6 +439,7 @@ void usbip_task_init(struct usbip_task *
- 		void (*loop_ops)(struct usbip_task *))
- {
- 	ut->thread = NULL;
-+	init_completion(&ut->thread_started);
- 	init_completion(&ut->thread_done);
- 	ut->name = name;
- 	ut->loop_ops = loop_ops;
---- a/drivers/head/usbip_event.c
-+++ b/drivers/head/usbip_event.c
-@@ -38,7 +38,7 @@ void usbip_start_eh(struct usbip_device
- 
- 	kernel_thread((int(*)(void *)) usbip_thread, (void *) eh, 0);
- 
--	wait_for_completion(&eh->thread_done);
-+	wait_for_completion(&eh->thread_started);
- }
- EXPORT_SYMBOL(usbip_start_eh);
- 
---- a/drivers/head/vhci_hcd.c
-+++ b/drivers/head/vhci_hcd.c
-@@ -58,7 +58,7 @@ static void vhci_stop(struct usb_hcd *hc
- static int vhci_get_frame_number(struct usb_hcd *hcd);
- 
- static const char driver_name[] = "vhci_hcd";
--static const char driver_desc[] = "USB/IP Virtual Host Contoroller";
-+static const char driver_desc[] = "USB/IP Virtual Host Controller";
- 
- 
- 
-@@ -416,14 +416,6 @@ static int vhci_hub_control(struct usb_h
- 				case USB_PORT_FEAT_SUSPEND:
- 					dbg_vhci_rh(" SetPortFeature: USB_PORT_FEAT_SUSPEND\n");
- 					uerr(" not yet\n");
--#if 0
--					dum->port_status[rhport] |= (1 << USB_PORT_FEAT_SUSPEND);
--					if (dum->driver->suspend) {
--						spin_unlock (&dum->lock);
--						dum->driver->suspend (&dum->gadget);
--						spin_lock (&dum->lock);
--					}
--#endif
- 					break;
- 				case USB_PORT_FEAT_RESET:
- 					dbg_vhci_rh(" SetPortFeature: USB_PORT_FEAT_RESET\n");
-@@ -432,12 +424,6 @@ static int vhci_hub_control(struct usb_h
- 						dum->port_status[rhport] &= ~(USB_PORT_STAT_ENABLE
- 								| USB_PORT_STAT_LOW_SPEED
- 								| USB_PORT_STAT_HIGH_SPEED);
--#if 0
--						if (dum->driver) {
--							dev_dbg (hardware, "disconnect\n");
--							stop_activity (dum, dum->driver);
--						}
--#endif
- 
- 						/* FIXME test that code path! */
- 					}
-@@ -1060,7 +1046,7 @@ static int vhci_hcd_probe(struct platfor
- 	struct usb_hcd		*hcd;
- 	int			ret;
- 
--	uinfo("proving...\n");
-+	uinfo("probing...\n");
- 
- 	dbg_vhci_hc("name %s id %d\n", pdev->name, pdev->id);
- 
-@@ -1076,7 +1062,11 @@ static int vhci_hcd_probe(struct platfor
- 	 * Allocate and initialize hcd.
- 	 * Our private data is also allocated automatically.
- 	 */
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
- 	hcd = usb_create_hcd(&vhci_hc_driver, &pdev->dev, pdev->dev.bus_id);
-+#else
-+	hcd = usb_create_hcd(&vhci_hc_driver, &pdev->dev, dev_name(&pdev->dev));
-+#endif
- 	if (!hcd) {
- 		uerr("create hcd failed\n");
- 		return -ENOMEM;
---- a/drivers/head/vhci_sysfs.c
-+++ b/drivers/head/vhci_sysfs.c
-@@ -123,7 +123,11 @@ static ssize_t show_status(struct device
- 			out += sprintf(out, "%03u %08x ",
- 					vdev->speed, vdev->devid);
- 			out += sprintf(out, "%16p ", vdev->ud.tcp_socket);
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
- 			out += sprintf(out, "%s", vdev->udev->dev.bus_id);
-+#else
-+			out += sprintf(out, "%s", dev_name(&vdev->udev->dev));
-+#endif
- 
- 		} else
- 			out += sprintf(out, "000 000 000 0000000000000000 0-0");
---- a/drivers/head/usbip_common.h
-+++ b/drivers/head/usbip_common.h
-@@ -300,6 +300,7 @@ struct usbip_device;
- 
- struct usbip_task {
- 	struct task_struct *thread;
-+	struct completion thread_started;
- 	struct completion thread_done;
- 	char *name;
- 	void (*loop_ops)(struct usbip_task *);
 

file:a/net/wifidog/Makefile (deleted)
--- a/net/wifidog/Makefile
+++ /dev/null
@@ -1,60 +1,1 @@
-#
-# Copyright (C) 2006,2013 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=wifidog
-PKG_VERSION:=20130917
-PKG_RELEASE=$(PKG_SOURCE_VERSION)
-
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=git://github.com/wifidog/wifidog-gateway.git
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=440445db60b0c3aff528ea703a828b0567293387
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
-
-PKG_FIXUP:=autoreconf
-PKG_INSTALL:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/wifidog
-  SUBMENU:=Captive Portals
-  SECTION:=net
-  CATEGORY:=Network
-  DEPENDS:=+iptables-mod-extra +iptables-mod-ipopt +iptables-mod-nat-extra +libpthread
-  TITLE:=A wireless captive portal solution
-  URL:=http://www.wifidog.org
-endef
-
-define Package/wifidog/description
-	The Wifidog project is a complete and embeddable captive
-	portal solution for wireless community groups or individuals
-	who wish to open a free Hotspot while still preventing abuse
-	of their Internet connection.
-endef
-
-define Package/wifidog/conffiles
-/etc/wifidog.conf
-endef
-
-define Package/wifidog/install
-	$(INSTALL_DIR) $(1)/usr/bin
-	$(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/init.d/wifidog $(1)/usr/bin/wifidog-init
-	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/wifidog $(1)/usr/bin/
-	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/wdctl $(1)/usr/bin/
-	$(INSTALL_DIR) $(1)/usr/lib
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libhttpd.so* $(1)/usr/lib/
-	$(INSTALL_DIR) $(1)/etc
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/wifidog.conf $(1)/etc/
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/wifidog-msg.html $(1)/etc/
-	$(INSTALL_DIR) $(1)/etc/init.d
-	$(INSTALL_BIN) ./files/wifidog.init $(1)/etc/init.d/wifidog
-endef
-
-$(eval $(call BuildPackage,wifidog))
-

--- a/net/wifidog/files/wifidog.init
+++ /dev/null
@@ -1,17 +1,1 @@
-#!/bin/sh /etc/rc.common
-# Copyright (C) 2006 OpenWrt.org
-START=65
-EXTRA_COMMANDS="status"
-EXTRA_HELP="        status Print the status of the service"
 
-start() {
-	/usr/bin/wifidog-init start
-}
-
-stop() {
-	/usr/bin/wifidog-init stop
-}
-
-status() {
-	/usr/bin/wifidog-init status
-}

--- a/net/yaddns/Makefile
+++ b/net/yaddns/Makefile
@@ -22,7 +22,7 @@
 define Package/yaddns
   SECTION:=net
   CATEGORY:=Network
-  DEPENDS:=+USE_EGLIBC:librt
+  DEPENDS:=+USE_GLIBC:librt
   SUBMENU:=IP Addresses and Names
   TITLE:=Yet Another DDNS client
   URL:=http://patatrac.info/yaddns

file:a/sound/ices/Makefile (deleted)
--- a/sound/ices/Makefile
+++ /dev/null
@@ -1,60 +1,1 @@
-#
-# Copyright (C) 2009 Freifunk Leipzig
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=ices
-PKG_VERSION:=2.0.1
-PKG_RELEASE:=2
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://downloads.xiph.org/releases/ices/
-PKG_MD5SUM:=0d95ac34d59fed337028d5e7771076d8
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
-
-PKG_FIXUP:=autoreconf
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/ices
-  SECTION:=sound
-  CATEGORY:=Sound
-  TITLE:=ices client for Icecast media streaming servers
-  URL:=http://xiph.org/
-  DEPENDS:=+libshout +libxml2 +zlib +libogg +libvorbis +alsa-lib
-endef
-
-define Package/ices/description
-  ices is a command line source client for Icecast media streaming servers.
-  It began as the successor of the old "shout" utility, and has since gained a
-  lot of useful features.
-endef
-
-define Package/ices/install
-	$(INSTALL_DIR) $(1)/usr/bin
-	$(CP) $(PKG_BUILD_DIR)/src/$(PKG_NAME) $(1)/usr/bin/
-endef
-
-CONFIGURE_ARGS+= \
-    --with-ogg="$(STAGING_DIR)/usr/include" \
-    --with-vorbis="$(STAGING_DIR)/usr/include" \
-
-define Build/Configure
-    $(call Build/Configure/Default, \
-      LDFLAGS="$(TARGET_LDFLAGS) -lz -lm" \
-    )
-endef
-
-define Build/Compile
-	$(MAKE) -C $(PKG_BUILD_DIR) \
-	  $(TARGET_CONFIGURE_OPTS) \
-	  CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" \
-	  LDFLAGS="$(TARGET_LDFLAGS) -lz -lm"
-endef
-
-$(eval $(call BuildPackage,ices))
-

file:a/utils/acpid/Makefile (deleted)
--- a/utils/acpid/Makefile
+++ /dev/null
@@ -1,66 +1,1 @@
-#
-# Copyright (C) 2012 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=acpid
-PKG_VERSION:=2.0.10
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://tedfelix.com/linux/
-PKG_MD5SUM:=d5dd88bcfaa4a0bf51905e95115da6df
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/acpid
-  SECTION:=utils
-  CATEGORY:=Utilities
-  TITLE:=The ACPI Daemon (acpid) With Netlink Support
-  URL:=http://tedfelix.com/linux/acpid-netlink.html
-  DEPENDS:=+kmod-input-evdev +kmod-acpi-button
-endef
-
-define Package/acpid/description
-  The ACPI Daemon (acpid) With Netlink Support
-endef
-
-define Build/Compile
-	$(MAKE) -C $(PKG_BUILD_DIR) \
-		CC="$(TARGET_CC)" \
-		LD="$(TARGET_CC)" \
-		LDFLAGS="$(TARGET_LDFLAGS)" \
-		all
-endef
-
-define Package/acpid/install
-	$(INSTALL_DIR) $(1)/usr/sbin
-	$(INSTALL_BIN) $(PKG_BUILD_DIR)/acpid $(1)/usr/sbin/
-	$(INSTALL_BIN) $(PKG_BUILD_DIR)/acpi_listen $(1)/usr/sbin/
-	$(INSTALL_DIR) $(1)/etc/acpi/events
-	$(INSTALL_CONF) ./files/default $(1)/etc/acpi/events/default
-	$(INSTALL_DIR) $(1)/etc/init.d
-	$(INSTALL_CONF) ./files/acpid.init $(1)/etc/init.d/acpid
-	chmod 0750 $(1)/etc/init.d/acpid
-	$(INSTALL_DIR) $(1)/etc/hotplug.d/input/
-	$(INSTALL_CONF) ./files/acpid.hotplug $(1)/etc/hotplug.d/input/
-endef
-
-define Package/acpid/postinst
-#!/bin/sh
-[ -n "$${IPKG_INSTROOT}" ] || {
-	echo "waiting for input devices to come up"
-	/etc/init.d/acpid enable
-	sleep 5
-	/etc/init.d/acpid start
-	echo "please try the power button"
-	exit 0
-}
-endef
-
-$(eval $(call BuildPackage,acpid))
-

--- a/utils/acpid/files/acpid.hotplug
+++ /dev/null
@@ -1,8 +1,1 @@
-#!/bin/sh
 
-. /lib/functions.sh
-
-if [ "$ACTION" = add ] && [ "$DEVICENAME" = event0 ]; then
-        ( /etc/init.d/acpid/stop; sleep 3; /usr/sbin/acpid )&
-fi
-

--- a/utils/acpid/files/acpid.init
+++ /dev/null
@@ -1,26 +1,1 @@
-#!/bin/ash /etc/rc.common
-# Copyright (C) 2009-2010 OpenWrt.org
 
-START=99
-STOP=80
-
-ACPID_BIN="/usr/sbin/acpid"
-ACPID_PID="/var/run/acpid.pid"
-
-start() {
-    [ -x "$ACPID_BIN" ] || return 1
-    start-stop-daemon -S -x $ACPID_BIN -p $ACPID_PID
-}
-
-boot() {
-	# Do nothing on boot
-    	[ -x "$ACPID_BIN" ] || return 1
-	start-stop-daemon -S -x $ACPID_BIN -p $ACPID_PID
-	exit 0
-}
-
-stop() {
-	service_kill ${ACPID_BIN##*/} $ACPID_PID
-	rm -f $ACPID_PID
-}
-

--- a/utils/acpid/files/default
+++ /dev/null
@@ -1,6 +1,1 @@
-# This is a sample ACPID configuration
 
-event=button/power.*
-action=/sbin/poweroff 
-
-

file:a/utils/at/Makefile (deleted)
--- a/utils/at/Makefile
+++ /dev/null
@@ -1,57 +1,1 @@
-#
-# Copyright (C) 2008-2014 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=at
-PKG_VERSION:=3.1.13
-PKG_RELEASE:=2
-
-PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz
-PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/a/at
-PKG_MD5SUM:=1da61af6c29e323abaaf13ee1a8dad79
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/at
-  SECTION:=utils
-  CATEGORY:=Utilities
-  DEPENDS:=+libelf1
-  TITLE:=Delayed job execution and batch processing
-  URL:=http://packages.debian.org/stable/at
-  MAINTAINER:=Luka Perkov <openwrt@lukaperkov.net>
-endef
-
-define Package/at/description
- At and batch read shell commands from standard input storing them as a job to
- be scheduled for execution in the future.
-endef
-
-export SENDMAIL=/bin/true
-EXTRA_CFLAGS:=-DNEED_YYWRAP -I$(PKG_BUILD_DIR) \
-	$(TARGET_LDFLAGS)
-
-CONFIGURE_ARGS+=--prefix=/usr \
-		--with-daemon_username=nobody \
-		--with-daemon_groupname=nogroup \
-		--with-jobdir=/var/spool/cron/atjobs \
-		--with-atspool=/var/spool/cron/atspool
-
-CONFIGURE_VARS += \
-	ac_cv_header_security_pam_appl_h=no
-
-define Package/at/install
-	$(INSTALL_DIR) $(1)/usr/bin $(1)/usr/sbin $(1)/etc/init.d/
-	$(INSTALL_BIN) ./files/atd.init $(1)/etc/init.d/atd
-	$(INSTALL_BIN) $(PKG_BUILD_DIR)/at $(1)/usr/bin
-	ln -sf at $(1)/usr/bin/atq
-	ln -sf at $(1)/usr/bin/atrm
-	$(INSTALL_BIN) $(PKG_BUILD_DIR)/atd $(1)/usr/sbin
-endef
-
-$(eval $(call BuildPackage,at))
-

file:a/utils/at/files/atd.init (deleted)
--- a/utils/at/files/atd.init
+++ /dev/null
@@ -1,24 +1,1 @@
-#!/bin/sh /etc/rc.common
-# Copyright (C) 2011 OpenWrt.org
 
-START=50
-
-SERVICE_USE_PID=1
-
-start() {
-	[ -d /var/spool/cron/atjobs ] || {
-		mkdir -m 0755 -p /var/spool/cron/atjobs
-		touch /var/spool/cron/atjobs/.SEQ
-		chown -R nobody:nogroup /var/spool/cron/atjobs
-	}
-	[ -d /var/spool/cron/atspool ] || {
-		mkdir -m 0755 -p /var/spool/cron/atspool
-		chown -R nobody:nogroup /var/spool/cron/atspool
-	}
-	service_start /usr/sbin/atd
-}
-
-stop() {
-	service_stop /usr/sbin/atd
-}
-

--- a/utils/at/patches/100-cross-compile.patch
+++ /dev/null
@@ -1,31 +1,1 @@
---- a/configure
-+++ b/configure
-@@ -3458,27 +3458,6 @@ $as_echo "yes" >&6; }
- $as_echo "no" >&6; }
-     ;;
- esac
--{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Trying to compile a trivial ANSI C program" >&5
--$as_echo_n "checking Trying to compile a trivial ANSI C program... " >&6; }
--if test "$cross_compiling" = yes; then :
--  as_fn_error $? "Could not compile and run even a trivial ANSI C program - check CC." "$LINENO" 5
--else
--  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
--/* end confdefs.h.  */
-- main(int ac, char **av) { return 0; }
--_ACEOF
--if ac_fn_c_try_run "$LINENO"; then :
--  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
--$as_echo "yes" >&6; }
--else
--  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
--$as_echo "no" >&6; }
--    as_fn_error $? "Could not compile and run even a trivial ANSI C program - check CC." "$LINENO" 5
--fi
--rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
--  conftest.$ac_objext conftest.beam conftest.$ac_ext
--fi
--
- 
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking __attribute__((noreturn))" >&5
- $as_echo_n "checking __attribute__((noreturn))... " >&6; }
 

--- a/utils/at/patches/110-getloadavg.patch
+++ /dev/null
@@ -1,15 +1,1 @@
---- a/getloadavg.c
-+++ b/getloadavg.c
-@@ -69,8 +69,9 @@ Boston, MA  02110-1301  USA */
- #include <config.h>
- #endif
- 
--#include "lisp.h"
--#include "sysfile.h" /* for encapsulated open, close, read, write */
-+#include <sys/types.h>
-+#include <sys/stat.h>
-+#include <fcntl.h>
- 
- #ifndef HAVE_GETLOADAVG
- 
 

file:a/utils/avrdude/Makefile (deleted)
--- a/utils/avrdude/Makefile
+++ /dev/null
@@ -1,62 +1,1 @@
-#
-# Copyright (C) 2008 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=avrdude
-PKG_VERSION:=6.0.1
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://download.savannah.gnu.org/releases/avrdude
-PKG_MD5SUM:=346ec2e46393a54ac152b95abf1d9850
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/avrdude
-  SECTION:=utils
-  CATEGORY:=Utilities
-  TITLE:=AVR Downloader/UploaDEr
-  URL:=http://www.bsdhome.com/avrdude/
-  DEPENDS:=+libncurses +libreadline +libusb-compat +libftdi
-endef
-
-define Package/avrdude/description
- AVRDUDE is a full featured program for programming Atmel's AVR CPU's.
-endef
-
-define Build/Prepare
-	$(call Build/Prepare/Default)
-	chmod -R u+w $(PKG_BUILD_DIR)
-endef
-
-CONFIGURE_ARGS+= \
-	--disable-doc \
-	--disable-parport \
-
-CONFIGURE_VARS += \
-	ac_cv_lib_elf_elf_begin=no \
-
-define Build/Compile
-	$(MAKE) -C $(PKG_BUILD_DIR) \
-		DESTDIR="$(PKG_INSTALL_DIR)" \
-		install-exec
-endef
-
-define Package/avrdude/conffiles
-/etc/avrdude.conf
-endef
-
-define Package/avrdude/install
-	$(INSTALL_DIR) $(1)/etc
-	$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/avrdude.conf $(1)/etc/
-	$(INSTALL_DIR) $(1)/usr/bin
-	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/avrdude $(1)/usr/bin/
-endef
-
-$(eval $(call BuildPackage,avrdude))
-

--- a/utils/bandwidthd/Makefile
+++ /dev/null
@@ -1,61 +1,1 @@
-#
-# Copyright (C) 2006-2011 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=bandwidthd
-PKG_VERSION:=2.0.1
-PKG_RELEASE:=4
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
-PKG_SOURCE_URL:=@SF/bandwidthd
-PKG_MD5SUM:=aa79aad7bd489fd2cae1f7dc086ca8b6
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/bandwidthd
-  SECTION:=utils
-  CATEGORY:=Utilities
-  TITLE:=Bandwidthd
-  URL:=http://bandwidthd.sourceforge.net/
-  DEPENDS:=+libgd +libpcap
-endef
-
-define Package/bandwidthd/daemon
- This package contains bandwidthd a bandwith tracking utility.
-endef
-
-CONFIGURE_ARGS += \
-	ac_cv_file__sw_lib=no \
-	ac_cv_file__sw_include=no \
-	ac_cv_file__usr_pkg_lib=no \
-	ac_cv_file__usr_pkg_include=no \
-	ac_cv_file__usr_local_pgsql_lib=no \
-	ac_cv_file__usr_local_pgsql_include=no \
-	ac_cv_lib_pq_PQconnectdb=no \
-
-EXTRA_CFLAGS+= $(TARGET_CPPFLAGS)
-EXTRA_LDFLAGS+= $(TARGET_LDFLAGS) -Wl,-rpath-link,$(STAGING_DIR)/usr/lib
-
-define Package/bandwidthd/install
-	$(INSTALL_DIR) $(1)/usr/sbin
-	$(INSTALL_BIN) $(PKG_BUILD_DIR)/bandwidthd $(1)/usr/sbin/
-	$(INSTALL_DIR) $(1)/etc/config
-	$(INSTALL_DATA) ./files/bandwidthd.config $(1)/etc/config/bandwidthd
-	$(INSTALL_DIR) $(1)/etc/init.d
-	$(INSTALL_BIN) ./files/bandwidthd.init $(1)/etc/init.d/bandwidthd
-	$(INSTALL_DIR) $(1)/www
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/htdocs/legend.gif $(1)/www/
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/htdocs/logo.gif $(1)/www/
-endef
-
-define Package/bandwidthd/conffiles
-/etc/config/bandwidthd
-endef
-
-$(eval $(call BuildPackage,bandwidthd))
-

--- a/utils/bandwidthd/files/bandwidthd.config
+++ /dev/null
@@ -1,12 +1,1 @@
-config bandwidthd
-	option dev	br-lan
-	option subnets		"192.168.0.0/16 10.0.0.0/8 172.16.0.0/12"
-	option skip_intervals	0
-	option graph_cutoff	1024
-	option promiscuous	true
-	option output_cdf	false
-	option recover_cdf	false
-	option filter		ip
-	option graph		true
-	option meta_refresh	150
 

--- a/utils/bandwidthd/files/bandwidthd.init
+++ /dev/null
@@ -1,89 +1,1 @@
-#!/bin/sh /etc/rc.common
-# Copyright (C) 2008-2011 OpenWrt.org
 
-START=99
-
-config_cb() {
-	local cfg_type="$1"
-	local cfg_name="$2"
-
-	case "$cfg_type" in
-	        bandwidthd)
-	                append cfgs "$cfg_name"
-	        ;;
-	esac
-}
-
-export_bool() {
-	local option="$1"
-	local section="$2"
-	local _loctmp
-	config_get_bool _loctmp "$section" "$option"
-	if [ -n "$_loctmp" ]; then
-		conffile="${conffile}$option "
-		if [ 1 -eq "$_loctmp" ]; then
-			conffile="${conffile}true"
-		else
-			conffile="${conffile}false"
-		fi
-		conffile="${conffile}\n"
-	fi
-}
-
-export_number() {
-	local option="$1"
-	local section="$2"
-	local _loctmp
-	config_get _loctmp "$section" "$option"
-	if [ -n "$_loctmp" ]; then
-		conffile="${conffile}$option ${_loctmp}\n"
-	fi
-}
-
-export_string() {
-	local option="$1"
-	local section="$2"
-	local _loctmp
-	config_get _loctmp "$section" "$option"
-	if [ -n "$_loctmp" ]; then
-		conffile="${conffile}$option \"${_loctmp}\"\n"
-	fi
-}
-
-start() {
-	local subnet conffile
-
-	[ -d /tmp/bandwidthd ] || mkdir -p /tmp/bandwidthd && cp /www/legend.gif /www/logo.gif /tmp/bandwidthd/
-	[ -e /htdocs ] || ln -s /tmp/bandwidthd /htdocs
-	[ -e /www/bandwidthd ] || ln -s /tmp/bandwidthd /www/bandwidthd
-	rm -f /tmp/bandwidthd.conf
-	touch /tmp/bandwidthd.conf
-	[ -e /etc/bandwidthd.conf ] || ln -s /tmp/bandwidthd.conf /etc/bandwidthd.conf
-	
-	
-	config_load bandwidthd
-	for cfg in $cfgs; do
-		config_get subnets $cfg subnets
-			for subnet in $subnets; do
-				conffile="${conffile}subnet ${subnet}\n"
-			done
-		export_string dev $cfg
-		export_number skip_intervals $cfg
-		export_number graph_cutoff $cfg
-		export_bool promiscuous $cfg
-		export_bool output_cdf $cfg
-		export_bool recover_cdf $cfg
-		export_string filter $cfg
-		export_bool graph $cfg
-		export_number meta_refresh $cfg
-		[ -n "$conffile" ] && echo -e "$conffile" >>/tmp/bandwidthd.conf
-		unset conffile
-	done
-	cd /
-	service_start /usr/sbin/bandwidthd
-}
-
-stop() {
-	service_stop /usr/sbin/bandwidthd
-}
-

 Binary files a/utils/bandwidthd/files/logo.gif and /dev/null differ
--- a/utils/bandwidthd/patches/010-dont-add-host-paths.patch
+++ /dev/null
@@ -1,37 +1,1 @@
-diff --git a/configure b/configure
-index 4c2546e..e516137 100755
---- a/configure
-+++ b/configure
-@@ -2439,11 +2439,6 @@ if test -n "$x_libraries" && test "x$x_libraries" != xNONE ; then
- 	LDFLAGS="$LDFLAGS -L$x_libraries"
- fi
- 
--# May be equired for BSD
--LDFLAGS="$LDFLAGS -L/usr/local/lib"
--
--CPPFLAGS="$CPPFLAGS -I/usr/local/include"
--
- #Check for Darwin sw directory
- echo "$as_me:2448: checking for /sw/lib" >&5
- echo $ECHO_N "checking for /sw/lib... $ECHO_C" >&6
-@@ -2505,9 +2500,6 @@ fi
- fi
- echo "$as_me:2506: result: $ac_cv_file__usr_pkg_lib" >&5
- echo "${ECHO_T}$ac_cv_file__usr_pkg_lib" >&6
--if test $ac_cv_file__usr_pkg_lib = yes; then
--  LDFLAGS="$LDFLAGS -L/usr/pkg/lib"
--fi
- 
- echo "$as_me:2512: checking for /usr/pkg/include" >&5
- echo $ECHO_N "checking for /usr/pkg/include... $ECHO_C" >&6
-@@ -3092,9 +3084,6 @@ fi
- fi
- echo "$as_me:3093: result: $ac_cv_file__usr_local_pgsql_lib" >&5
- echo "${ECHO_T}$ac_cv_file__usr_local_pgsql_lib" >&6
--if test $ac_cv_file__usr_local_pgsql_lib = yes; then
--  LDFLAGS="$LDFLAGS -L/usr/local/pgsql/lib"
--fi
- 
- echo "$as_me:3099: checking for /usr/local/pgsql/include" >&5
- echo $ECHO_N "checking for /usr/local/pgsql/include... $ECHO_C" >&6
 

--- a/utils/bandwidthd/patches/100-fix_config_file_location
+++ /dev/null
@@ -1,32 +1,1 @@
---- bandwidthd-2.0.1/bandwidthd.c.orig	2008-05-09 10:06:37.000000000 -0500
-+++ bandwidthd-2.0.1/bandwidthd.c	2008-05-09 10:32:54.000000000 -0500
-@@ -255,22 +255,22 @@
- 
- 	openlog("bandwidthd", LOG_CONS, LOG_DAEMON);
- 
--	if (stat("./etc/bandwidthd.conf", &StatBuf))
-+	if (stat("/etc/bandwidthd.conf", &StatBuf))
- 		{
- 		chdir(INSTALL_DIR);
--		if (stat("./etc/bandwidthd.conf", &StatBuf))
-+		if (stat("/etc/bandwidthd.conf", &StatBuf))
- 			{
--			printf("Cannot find ./etc/bandwidthd.conf or %s/etc/bandwidthd.conf\n", INSTALL_DIR);
--			syslog(LOG_ERR, "Cannot find ./etc/bandwidthd.conf or %s/etc/bandwidthd.conf", INSTALL_DIR);
-+			printf("Cannot find /etc/bandwidthd.conf or %s/etc/bandwidthd.conf\n", INSTALL_DIR);
-+			syslog(LOG_ERR, "Cannot find /etc/bandwidthd.conf or %s/etc/bandwidthd.conf", INSTALL_DIR);
- 			exit(1);
- 			}
- 		}
- 
--	bdconfig_in = fopen("./etc/bandwidthd.conf", "rt");
-+	bdconfig_in = fopen("/etc/bandwidthd.conf", "rt");
- 	if (!bdconfig_in)
- 		{
- 		syslog(LOG_ERR, "Cannot open bandwidthd.conf");
--		printf("Cannot open ./etc/bandwidthd.conf\n");
-+		printf("Cannot open /etc/bandwidthd.conf\n");
- 		exit(1);
- 		}
- 	bdconfig_parse();
 

file:a/utils/bc/Makefile (deleted)
--- a/utils/bc/Makefile
+++ /dev/null
@@ -1,62 +1,1 @@
-#
-# Copyright (C) 2006-2010 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=bc
-PKG_VERSION:=1.06.95
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz
-PKG_SOURCE_URL:=ftp://ftp.debian.org/debian/pool/main/b/bc
-PKG_MD5SUM:=24d0831812d8262b6cac8316b0bac483
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/bc/Default
-  SECTION:=utils
-  CATEGORY:=Utilities
-  URL:=http://packages.debian.org/bc
-endef
-
-define Package/bc
-  $(call Package/bc/Default)
-  TITLE:=Arbitrary precision calculator language
-  DEPENDS:=+libreadline +libncurses
-endef
-
-define Package/bc/description
- bc is a language that supports arbitrary precision numbers with
- interactive execution of statements.
-endef
-
-define Package/dc
-  $(call Package/bc/Default)
-  TITLE:=Arbitrary precision reverse-polish calculator
-  DEPENDS:=bc
-endef
-
-define Package/dc/description
- dc is a reverse-polish desk calculator which supports unlimited
- precision arithmetic.
-endef
-
-CONFIGURE_ARGS += --with-readline
-
-define Package/bc/install
-	$(INSTALL_DIR) $(1)/usr/bin
-	$(INSTALL_BIN) $(PKG_BUILD_DIR)/bc/bc $(1)/usr/bin/
-endef
-
-define Package/dc/install
-	$(INSTALL_DIR) $(1)/usr/bin
-	$(INSTALL_BIN) $(PKG_BUILD_DIR)/dc/dc $(1)/usr/bin/
-endef
-
-$(eval $(call BuildPackage,bc))
-$(eval $(call BuildPackage,dc))
-

--- a/utils/bc/patches/001-disable-doc.patch
+++ /dev/null
@@ -1,22 +1,1 @@
---- bc-1.06.95/Makefile.in	2010-07-03 10:48:13.422725147 +0000
-+++ bc-1.06.95/Makefile.in	2010-07-03 10:50:09.714725197 +0000
-@@ -149,7 +149,7 @@
- sharedstatedir = @sharedstatedir@
- sysconfdir = @sysconfdir@
- target_alias = @target_alias@
--SUBDIRS = lib bc dc doc
-+SUBDIRS = lib bc dc
- MAINTAINERCLEANFILES = aclocal.m4 config.h.in configure Makefile.in \
- 			stamp-h $(distdir).tar.gz h/number.h depcomp missing
- 
---- bc-1.06.95/Makefile.am	2010-07-03 10:48:32.522725037 +0000
-+++ bc-1.06.95/Makefile.am	2010-07-03 10:48:38.114725024 +0000
-@@ -1,6 +1,6 @@
- ## Process this file with automake to produce Makefile.in
- 
--SUBDIRS = lib bc dc doc
-+SUBDIRS = lib bc dc
- 
- MAINTAINERCLEANFILES =  aclocal.m4 config.h.in configure Makefile.in \
- 			stamp-h $(distdir).tar.gz h/number.h depcomp missing
 

file:a/utils/canutils/Makefile (deleted)
--- a/utils/canutils/Makefile
+++ /dev/null
@@ -1,117 +1,1 @@
-#
-# Copyright (C) 2013 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=canutils
-PKG_VERSION:=2014-02-27
-PKG_RELEASE=$(PKG_SOURCE_VERSION)
-
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=git://gitorious.org/linux-can/can-utils.git
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=67a2bdcd336e6becfa5784742e18c88dbeddc973
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
-
-include $(INCLUDE_DIR)/package.mk
-
-FILES:=	canbusload can-calc-bit-timing candump \
-	cangen cangw canplayer cansniffer cansend
-
-
-define Package/canutils-log-conversion
-  TITLE:=canutils log conversion
-  SECTION:=utils
-  CATEGORY:=Utilities
-  DEPENDS:=canutils
-endef
-
-define PartGen
-define Package/canutils-$(1)
-  TITLE:=$(1) package from canutils
-  SECTION:=utils
-  CATEGORY:=Utilities
-  DEPENDS:=canutils
-endef
-endef
-
-define Package/canutils
-  SECTION:=utils
-  CATEGORY:=Utilities
-  URL=https://gitorious.org/linux-can
-  TITLE:=CAN userspace utilities and tools
-  MENU:=1
-endef
-
-define Build/Configure
-	( cd "$(PKG_BUILD_DIR)"; ./autogen.sh )
-	$(call Build/Configure/Default)
-endef
-
-$(foreach file,$(FILES),$(eval $(call PartGen,$(file))))
-
-define Package/canutils/install
-	true
-endef
-
-define Package/canutils-log-conversion/install
-	$(INSTALL_DIR) $(1)/usr/bin
-	$(INSTALL_BIN) $(PKG_BUILD_DIR)/asc2log $(1)/usr/bin/
-	$(INSTALL_BIN) $(PKG_BUILD_DIR)/log2asc $(1)/usr/bin/
-	$(INSTALL_BIN) $(PKG_BUILD_DIR)/log2long $(1)/usr/bin/
-endef
-
-define PartInstall
-define Package/canutils-$(1)/install
-	$(INSTALL_DIR) $$(1)/usr/bin
-	$(INSTALL_BIN) \
-		$(PKG_BUILD_DIR)/$(1) \
-		$$(1)/usr/bin/
-endef
-endef
-
-define Package/canutils-log-conversion/description
-asc2log - convert ASC logfile to compact CAN frame logfile.
-log2asc - convert compact CAN frame logfile to ASC logfile.
-log2long - convert compact CAN frame representation into user readable.
-endef
-
-define Package/canutils-canbusload/description
-canbusload - display the load percentage of can buses.
-endef
-
-define Package/canutils-can-calc-bit-timing/description
-can-calc-bit-timing - calculate hw bittiming for supported can chips.
-endef
-
-define Package/canutils-candump/description
-candump - dumps can frames to terminal, logfile or another can device,
-with optional filtering.
-endef
-
-define Package/canutils-cangen/description
-cangen - CAN frames generator for testing purposes.
-endef
-
-define Package/canutils-cangw/description
-cangw - manage PF_CAN netlink gateway.
-endef
-
-define Package/canutils-canplayer/description
-canplayer - replay a compact CAN frame logfile to CAN devices.
-endef
-
-define Package/canutils-cansend/description
-cansend - simple command line tool to send CAN-frames via CAN_RAW sockets.
-endef
-
-$(foreach file,$(FILES),$(eval $(call PartInstall,$(file))))
-
-$(eval $(call BuildPackage,canutils))
-$(eval $(call BuildPackage,canutils-log-conversion))
-$(foreach file,$(FILES),$(eval $(call BuildPackage,canutils-$(file))))
-

--- a/utils/dosfstools/Makefile
+++ /dev/null
@@ -1,97 +1,1 @@
-#
-# Copyright (C) 2006-2012 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=dosfstools
-PKG_VERSION:=3.0.12
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://fossies.org/linux/misc
-PKG_MD5SUM:=4c1f1e72b82371704f93ebdd3c7b6259
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/dosfstools/Default
-  SECTION:=utils
-  CATEGORY:=Utilities
-  URL:=http://www.daniel-baumann.ch/software/dosfstools/
-  SUBMENU:=Filesystem
-endef
-
-define Package/dosfsck
-  $(call Package/dosfstools/Default)
-  TITLE:=dosfsck
-endef
-
-define Package/dosfslabel
-  $(call Package/dosfstools/Default)
-  TITLE:=dosfslabel
-endef
-
-define Package/mkdosfs
-  $(call Package/dosfstools/Default)
-  TITLE:=mkdosfs
-endef
-
-define Package/dosfsck/description
-	Utilities to create and check MS-DOS FAT filesystems.
-	(fsck.vfat and fsck.msdos for checking integrity of FAT volumes)
-endef
-
-define Package/dosfslabel/description
-	Utilities to create and check MS-DOS FAT filesystems.
-	(dosfslabel for reading and writing labels of FAT volumes)
-endef
-
-define Package/mkdosfs/description
-	Utilities to create and check MS-DOS FAT filesystems.
-	(mkfs.vfat and mkfs.msdos for creating FAT volumes)
-endef
-
-define Build/Configure
-endef
-
-define Build/Compile
-	$(MAKE) -C $(PKG_BUILD_DIR) \
-		$(TARGET_CONFIGURE_OPTS) \
-		OPTFLAGS="$(TARGET_CFLAGS) -D_FILE_OFFSET_BITS=64" \
-		PREFIX="/usr" \
-		SBINDIR="/usr/sbin" \
-		all
-	$(MAKE) -C $(PKG_BUILD_DIR) \
-		$(TARGET_CONFIGURE_OPTS) \
-		OPTFLAGS="$(TARGET_CFLAGS) -D_FILE_OFFSET_BITS=64" \
-		PREFIX="$(PKG_INSTALL_DIR)/usr" \
-		SBINDIR="$(PKG_INSTALL_DIR)/usr/sbin" \
-		install-bin
-endef
-
-define Package/dosfsck/install
-	$(INSTALL_DIR) $(1)/lib/functions/fsck
-	$(INSTALL_DATA) ./files/dosfsck.sh $(1)/lib/functions/fsck/
-	$(INSTALL_DIR) $(1)/usr/sbin
-	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dosfsck $(1)/usr/sbin/
-	(cd $(1)/usr/sbin; ln -sf dosfsck fsck.msdos; ln -sf dosfsck fsck.vfat)
-endef
-
-define Package/dosfslabel/install
-	$(INSTALL_DIR) $(1)/usr/sbin
-	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dosfslabel $(1)/usr/sbin/
-endef
-
-define Package/mkdosfs/install
-	$(INSTALL_DIR) $(1)/usr/sbin
-	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/mkdosfs $(1)/usr/sbin/
-	(cd $(1)/usr/sbin; ln -sf mkdosfs mkfs.msdos; ln -sf mkdosfs mkfs.vfat)
-endef
-
-$(eval $(call BuildPackage,dosfsck))
-$(eval $(call BuildPackage,dosfslabel))
-$(eval $(call BuildPackage,mkdosfs))
-

--- a/utils/dosfstools/files/dosfsck.sh
+++ /dev/null
@@ -1,31 +1,1 @@
-#!/bin/sh
-# Copyright 2010 Vertical Communications
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
-fsck_dosfsck() {
-	dosfsck -p "$device" 2>&1 | logger -t "fstab: dosfsck ($device)"
-	local status="$?"
-	case "$status" in
-		0|1) ;; #success
-		2) reboot;;
-		4) echo "dosfsck ($device): Warning! Uncorrected errors."| logger -t fstab
-			return 1
-			;;
-		*) echo "dosfsck ($device): Error $status. Check not complete."| logger -t fstab;;
-	esac
-	return 0
-}
-
-fsck_dos() {
-	fsck_dosfsck "$@"
-}
-
-fsck_vfat() {
-	fsck_dosfsck "$@"
-}
-
-append libmount_known_fsck "dos"
-append libmount_known_fsck "vfat"
-

--- a/utils/dosfstools/patches/002-linux_26_headers.patch
+++ /dev/null
@@ -1,55 +1,1 @@
---- a/src/common.h
-+++ b/src/common.h
-@@ -19,7 +19,7 @@
-    can be found in /usr/share/common-licenses/GPL-3 file.
- */
- 
--#include <asm/types.h>
-+#include <linux/types.h>
- 
- #ifndef _COMMON_H
- #define _COMMON_H
---- a/src/dosfsck.h
-+++ b/src/dosfsck.h
-@@ -31,7 +31,7 @@
- #define _LINUX_STRING_H_	/* hack to avoid inclusion of <linux/string.h> */
- #define _LINUX_FS_H		/* hack to avoid inclusion of <linux/fs.h> */
- 
--#include <asm/types.h>
-+#include <linux/types.h>
- #include <asm/byteorder.h>
- 
- #include <linux/msdos_fs.h>
---- a/src/file.c
-+++ b/src/file.c
-@@ -33,7 +33,7 @@
- #define _LINUX_STRING_H_	/* hack to avoid inclusion of <linux/string.h> */
- #define _LINUX_FS_H		/* hack to avoid inclusion of <linux/fs.h> */
- 
--#include <asm/types.h>
-+#include <linux/types.h>
- 
- #include <linux/msdos_fs.h>
- 
---- a/src/io.c
-+++ b/src/io.c
-@@ -39,6 +39,7 @@
- #include <sys/ioctl.h>
- #include <errno.h>
- #include <fcntl.h>
-+#include <linux/types.h>
- #include <linux/fd.h>
- 
- #include "dosfsck.h"
---- a/src/mkdosfs.c
-+++ b/src/mkdosfs.c
-@@ -63,7 +63,7 @@
- #include <time.h>
- #include <errno.h>
- 
--#include <asm/types.h>
-+#include <linux/types.h>
- 
- #if __BYTE_ORDER == __BIG_ENDIAN
- 
 

--- a/utils/i2c-tools/Makefile
+++ /dev/null
@@ -1,111 +1,1 @@
-#
-# Copyright (C) 2007-2013 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=i2c-tools
-PKG_VERSION:=2013-12-15
-PKG_RELEASE:=1
-
-PKG_SOURCE_PROTO:=svn
-PKG_SOURCE_URL:=http://lm-sensors.org/svn/i2c-tools/trunk
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=r6204
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
-
-PKG_BUILD_PARALLEL:=1
-PKG_BUILD_DEPENDS:=PACKAGE_python-smbus:python
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/i2c/Default
-  URL:=http://lm-sensors.org/wiki/I2CTools
-  TITLE:=I2C
-endef
-
-define Package/libi2c
-  $(call Package/i2c/Default)
-  SECTION:=libs
-  CATEGORY:=Libraries
-  TITLE+=library
-endef
-
-define Package/i2c-tools
-  $(call Package/i2c/Default)
-  SECTION:=utils
-  CATEGORY:=Utilities
-  TITLE+=tools for Linux
-  DEPENDS:=+libi2c
-endef
-
-define Package/python-smbus
-  $(call Package/i2c/Default)
-  SUBMENU:=Python
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=Python bindings for the SMBUS
-  DEPENDS:=+PACKAGE_python-smbus:python-mini +i2c-tools
-endef
-
-define Package/i2c-tools/description
- This package contains an heterogeneous set of I2C tools for Linux. These tools
- were originally part of the lm-sensors package.
-endef
-
-define Package/python-smbus/description
- This package contain the python bindings for Linux SMBus access through i2c-dev.
-endef
-
-TARGET_CPPFLAGS += -I$(PKG_BUILD_DIR)/include
-
-ifdef CONFIG_PACKAGE_python-smbus
-  define Build/Compile/python-smbus
-	$(if $(Build/Compile/PyMod),,@echo Python packaging code not found.; false)
-	$(call Build/Compile/PyMod,./py-smbus/, \
-		install --prefix="$(PKG_INSTALL_DIR)/usr", \
-	)
-  endef
-endif
-
-define Build/Compile
-	$(MAKE) -C $(PKG_BUILD_DIR) \
-		LINUX="$(LINUX_DIR)" \
-		CC="$(TARGET_CC)" \
-		STAGING_DIR="$(STAGING_DIR)" \
-		LDFLAGS="$(TARGET_LDFLAGS)" \
-		CFLAGS="$(TARGET_CFLAGS)"
-	$(Build/Compile/python-smbus)
-endef
-
-define Build/InstallDev
-	$(INSTALL_DIR) $(1)/usr/lib
-	$(CP) $(PKG_BUILD_DIR)/lib/libi2c.so* $(1)/usr/lib/
-endef
-
-define Package/libi2c/install
-	$(INSTALL_DIR) $(1)/usr/lib
-	$(CP) $(PKG_BUILD_DIR)/lib/libi2c.so* $(1)/usr/lib/
-endef
-
-define Package/i2c-tools/install
-	$(INSTALL_DIR) $(1)/usr/sbin
-	$(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/i2cdetect $(1)/usr/sbin/
-	$(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/i2cdump $(1)/usr/sbin/
-	$(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/i2cset $(1)/usr/sbin/
-	$(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/i2cget $(1)/usr/sbin/
-endef
-
-define PyPackage/python-smbus/filespec
-+|$(PYTHON_PKG_DIR)/smbus.so
-endef
-
-$(eval $(call BuildPackage,libi2c))
-$(eval $(call BuildPackage,i2c-tools))
-$(eval $(call PyPackage,python-smbus))
-$(eval $(call BuildPackage,python-smbus))
-

--- a/utils/lcd4linux/Config.in
+++ /dev/null
@@ -1,502 +1,1 @@
-if PACKAGE_lcd4linux-custom
 
-config LCD4LINUX_CUSTOM_NEEDS_libdbus
-	bool
-
-config LCD4LINUX_CUSTOM_NEEDS_libdpf
-	bool
-
-#config LCD4LINUX_CUSTOM_NEEDS_libftdi
-#	bool
-
-config LCD4LINUX_CUSTOM_NEEDS_libgd
-	bool
-
-config LCD4LINUX_CUSTOM_NEEDS_libiconv
-	bool
-
-config LCD4LINUX_CUSTOM_NEEDS_libjpeg
-	bool
-
-config LCD4LINUX_CUSTOM_NEEDS_libmpdclient
-	bool
-
-config LCD4LINUX_CUSTOM_NEEDS_libmysqlclient
-	bool
-
-config LCD4LINUX_CUSTOM_NEEDS_libncurses
-	bool
-
-config LCD4LINUX_CUSTOM_NEEDS_libnmeap
-	bool
-
-config LCD4LINUX_CUSTOM_NEEDS_libsqlite3
-	bool
-
-config LCD4LINUX_CUSTOM_NEEDS_libusb
-	bool
-
-config LCD4LINUX_CUSTOM_NEEDS_libvncserver
-	bool
-
-#config LCD4LINUX_CUSTOM_NEEDS_libX11
-#	bool
-
-config LCD4LINUX_CUSTOM_NEEDS_ppp
-	bool
-
-config LCD4LINUX_CUSTOM_NEEDS_python
-	bool
-
-config LCD4LINUX_CUSTOM_NEEDS_serdisplib
-	bool
-
-config LCD4LINUX_CUSTOM_NEEDS_st2205tool
-	bool
-
-
-comment "Drivers ---"
-
-config LCD4LINUX_CUSTOM_DRIVER_ASTUSB
-	bool
-	prompt "ASTUSB"
-
-config LCD4LINUX_CUSTOM_DRIVER_BeckmannEgle
-	bool
-	prompt "BeckmannEgle"
-
-config LCD4LINUX_CUSTOM_DRIVER_BWCT
-	bool
-	prompt "BWCT"
-	select LCD4LINUX_CUSTOM_NEEDS_libusb
-
-config LCD4LINUX_CUSTOM_DRIVER_CrystalFontz
-	bool
-	prompt "CrystalFontz"
-
-config LCD4LINUX_CUSTOM_DRIVER_Curses
-	bool
-	prompt "Curses"
-	select LCD4LINUX_CUSTOM_NEEDS_libncurses
-
-config LCD4LINUX_CUSTOM_DRIVER_Cwlinux
-	bool
-	prompt "Cwlinux"
-
-config LCD4LINUX_CUSTOM_DRIVER_D4D
-	bool
-	prompt "D4D"
-	select LCD4LINUX_CUSTOM_NEEDS_libgd
-
-config LCD4LINUX_CUSTOM_DRIVER_dpf
-	bool
-	prompt "dpf"
-	select LCD4LINUX_CUSTOM_NEEDS_libdpf
-
-config LCD4LINUX_CUSTOM_DRIVER_EA232graphic
-	bool
-	prompt "EA232graphic"
-	select LCD4LINUX_CUSTOM_NEEDS_libgd
-
-config LCD4LINUX_CUSTOM_DRIVER_EFN
-	bool
-	prompt "EFN"
-
-config LCD4LINUX_CUSTOM_DRIVER_FutabaVFD
-	bool
-	prompt "FutabaVFD"
-
-config LCD4LINUX_CUSTOM_DRIVER_FW8888
-	bool
-	prompt "FW8888"
-
-config LCD4LINUX_CUSTOM_DRIVER_G15
-	bool
-	prompt "G15"
-	select LCD4LINUX_CUSTOM_NEEDS_libgd
-	select LCD4LINUX_CUSTOM_NEEDS_libusb
-
-config LCD4LINUX_CUSTOM_DRIVER_GLCD2USB
-	bool
-	prompt "GLCD2USB"
-	select LCD4LINUX_CUSTOM_NEEDS_libgd
-	select LCD4LINUX_CUSTOM_NEEDS_libusb
-
-config LCD4LINUX_CUSTOM_DRIVER_HD44780
-	bool
-	prompt "HD44780"
-	depends on BROKEN
-
-config LCD4LINUX_CUSTOM_DRIVER_HD44780-I2C
-	bool
-	prompt "HD44780-I2C"
-	depends on BROKEN
-
-config LCD4LINUX_CUSTOM_DRIVER_IRLCD
-	bool
-	prompt "IRLCD"
-	select LCD4LINUX_CUSTOM_NEEDS_libusb
-
-config LCD4LINUX_CUSTOM_DRIVER_LCD2USB
-	bool
-	prompt "LCD2USB"
-	select LCD4LINUX_CUSTOM_NEEDS_libgd
-	select LCD4LINUX_CUSTOM_NEEDS_libusb
-
-config LCD4LINUX_CUSTOM_DRIVER_LCDLinux
-	bool
-	prompt "LCDLinux"
-	depends on BROKEN
-
-config LCD4LINUX_CUSTOM_DRIVER_LCDTerm
-	bool
-	prompt "LCDTerm"
-
-config LCD4LINUX_CUSTOM_DRIVER_LEDMatrix
-	bool
-	prompt "LEDMatrix"
-	select LCD4LINUX_CUSTOM_NEEDS_libgd
-
-config LCD4LINUX_CUSTOM_DRIVER_LPH7508
-	bool
-	prompt "LPH7508"
-	select LCD4LINUX_CUSTOM_NEEDS_libgd
-
-config LCD4LINUX_CUSTOM_DRIVER_LUIse
-	bool
-	prompt "LUIse"
-	select LCD4LINUX_CUSTOM_NEEDS_libgd
-	#select LCD4LINUX_CUSTOM_NEEDS_libluise
-	depends on BROKEN
-
-config LCD4LINUX_CUSTOM_DRIVER_LW_ABP
-	bool
-	prompt "LW_ABP"
-
-config LCD4LINUX_CUSTOM_DRIVER_M50530
-	bool
-	prompt "M50530"
-
-config LCD4LINUX_CUSTOM_DRIVER_MatrixOrbital
-	bool
-	prompt "MatrixOrbital"
-
-config LCD4LINUX_CUSTOM_DRIVER_MatrixOrbitalGX
-	bool
-	prompt "MatrixOrbitalGX"
-	select LCD4LINUX_CUSTOM_NEEDS_libgd
-	select LCD4LINUX_CUSTOM_NEEDS_libusb
-
-config LCD4LINUX_CUSTOM_DRIVER_mdm166a
-	bool
-	prompt "mdm166a"
-	select LCD4LINUX_CUSTOM_NEEDS_libgd
-
-config LCD4LINUX_CUSTOM_DRIVER_MilfordInstruments
-	bool
-	prompt "MilfordInstruments"
-
-config LCD4LINUX_CUSTOM_DRIVER_Newhaven
-	bool
-	prompt "Newhaven"
-
-config LCD4LINUX_CUSTOM_DRIVER_Noritake
-	bool
-	prompt "Noritake"
-	select LCD4LINUX_CUSTOM_NEEDS_libgd
-
-config LCD4LINUX_CUSTOM_DRIVER_NULL
-	bool
-	prompt "NULL"
-	default y
-
-config LCD4LINUX_CUSTOM_DRIVER_Pertelian
-	bool
-	prompt "Pertelian"
-
-config LCD4LINUX_CUSTOM_DRIVER_PHAnderson
-	bool
-	prompt "PHAnderson"
-
-config LCD4LINUX_CUSTOM_DRIVER_PICGraphic
-	bool
-	prompt "PICGraphic"
-	select LCD4LINUX_CUSTOM_NEEDS_libgd
-
-config LCD4LINUX_CUSTOM_DRIVER_picoLCD
-	bool
-	prompt "picoLCD"
-	select LCD4LINUX_CUSTOM_NEEDS_libusb
-
-config LCD4LINUX_CUSTOM_DRIVER_picoLCDGraphic
-	bool
-	prompt "picoLCDGraphic"
-	select LCD4LINUX_CUSTOM_NEEDS_libgd
-	select LCD4LINUX_CUSTOM_NEEDS_libusb
-
-config LCD4LINUX_CUSTOM_DRIVER_PNG
-	bool
-	prompt "PNG"
-	select LCD4LINUX_CUSTOM_NEEDS_libgd
-
-config LCD4LINUX_CUSTOM_DRIVER_PPM
-	bool
-	prompt "PPM"
-	select LCD4LINUX_CUSTOM_NEEDS_libgd
-
-config LCD4LINUX_CUSTOM_DRIVER_RouterBoard
-	bool
-	prompt "RouterBoard"
-	depends on TARGET_rb532
-
-config LCD4LINUX_CUSTOM_DRIVER_SamsungSPF
-	bool
-	prompt "SamsungSPF"
-	select LCD4LINUX_CUSTOM_NEEDS_libgd
-	select LCD4LINUX_CUSTOM_NEEDS_libjpeg
-
-config LCD4LINUX_CUSTOM_DRIVER_serdisplib
-	bool
-	prompt "serdisplib"
-	select LCD4LINUX_CUSTOM_NEEDS_libgd
-	select LCD4LINUX_CUSTOM_NEEDS_serdisplib
-
-config LCD4LINUX_CUSTOM_DRIVER_ShuttleVFD
-	bool
-	prompt "ShuttleVFD"
-	select LCD4LINUX_CUSTOM_NEEDS_libusb
-
-config LCD4LINUX_CUSTOM_DRIVER_SimpleLCD
-	bool
-	prompt "SimpleLCD"
-
-config LCD4LINUX_CUSTOM_DRIVER_st2205
-	bool
-	prompt "st2205"
-	select LCD4LINUX_CUSTOM_NEEDS_libgd
-	select LCD4LINUX_CUSTOM_NEEDS_st2205tool
-
-config LCD4LINUX_CUSTOM_DRIVER_T6963
-	bool
-	prompt "T6963"
-	select LCD4LINUX_CUSTOM_NEEDS_libgd
-
-config LCD4LINUX_CUSTOM_DRIVER_TeakLCM
-	bool
-	prompt "TeakLCM"
-
-config LCD4LINUX_CUSTOM_DRIVER_TEW673GRU
-	bool
-	select LCD4LINUX_CUSTOM_NEEDS_libgd
-	depends on TARGET_ar71xx
-	default TARGET_ar71xx
-
-config LCD4LINUX_CUSTOM_DRIVER_Trefon
-	bool
-	prompt "Trefon"
-	select LCD4LINUX_CUSTOM_NEEDS_libusb
-
-#config LCD4LINUX_CUSTOM_DRIVER_ULA200
-#	bool
-#	prompt "ULA200"
-#	select LCD4LINUX_CUSTOM_NEEDS_libftdi
-#	select LCD4LINUX_CUSTOM_NEEDS_libusb
-
-config LCD4LINUX_CUSTOM_DRIVER_USBHUB
-	bool
-	prompt "USBHUB"
-	select LCD4LINUX_CUSTOM_NEEDS_libusb
-
-config LCD4LINUX_CUSTOM_DRIVER_USBLCD
-	bool
-	prompt "USBLCD"
-	select LCD4LINUX_CUSTOM_NEEDS_libusb
-
-config LCD4LINUX_CUSTOM_DRIVER_VNC
-	bool
-	prompt "VNC"
-	select LCD4LINUX_CUSTOM_NEEDS_libgd
-	select LCD4LINUX_CUSTOM_NEEDS_libvncserver
-
-config LCD4LINUX_CUSTOM_DRIVER_WincorNixdorf
-	bool
-	prompt "WincorNixdorf"
-
-#config LCD4LINUX_CUSTOM_DRIVER_X11
-#	bool
-#	prompt "X11"
-#	select LCD4LINUX_CUSTOM_NEEDS_libgd
-#	select LCD4LINUX_CUSTOM_NEEDS_libX11
-
-
-comment "Plugins ---"
-
-config LCD4LINUX_CUSTOM_PLUGIN_apm
-	bool
-	prompt "apm"
-
-config LCD4LINUX_CUSTOM_PLUGIN_asterisk
-	bool
-	prompt "asterisk"
-
-config LCD4LINUX_CUSTOM_PLUGIN_button_exec
-	bool
-	prompt "button_exec"
-
-config LCD4LINUX_CUSTOM_PLUGIN_cpuinfo
-	bool
-	prompt "cpuinfo"
-	default y
-
-config LCD4LINUX_CUSTOM_PLUGIN_dbus
-	bool
-	prompt "dbus"
-	select LCD4LINUX_CUSTOM_NEEDS_libdbus
-
-config LCD4LINUX_CUSTOM_PLUGIN_diskstats
-	bool
-	prompt "diskstats"
-
-config LCD4LINUX_CUSTOM_PLUGIN_dvb
-	bool
-	prompt "dvb"
-
-config LCD4LINUX_CUSTOM_PLUGIN_event
-	bool
-	prompt "event"
-
-config LCD4LINUX_CUSTOM_PLUGIN_exec
-	bool
-	prompt "exec"
-
-config LCD4LINUX_CUSTOM_PLUGIN_fifo
-	bool
-	prompt "fifo"
-
-config LCD4LINUX_CUSTOM_PLUGIN_file
-	bool
-	prompt "file"
-
-config LCD4LINUX_CUSTOM_PLUGIN_gps
-	bool
-	prompt "gps"
-	select LCD4LINUX_CUSTOM_NEEDS_libnmeap
-
-config LCD4LINUX_CUSTOM_PLUGIN_hddtemp
-	bool
-	prompt "hddtemp"
-
-config LCD4LINUX_CUSTOM_PLUGIN_huawei
-	bool
-	prompt "huawei"
-
-config LCD4LINUX_CUSTOM_PLUGIN_i2c_sensors
-	bool
-	prompt "i2c_sensors"
-
-config LCD4LINUX_CUSTOM_PLUGIN_iconv
-	bool
-	prompt "iconv"
-	select LCD4LINUX_CUSTOM_NEEDS_libiconv
-
-config LCD4LINUX_CUSTOM_PLUGIN_imon
-	bool
-	prompt "imon"
-
-config LCD4LINUX_CUSTOM_PLUGIN_isdn
-	bool
-	prompt "isdn"
-
-config LCD4LINUX_CUSTOM_PLUGIN_kvv
-	bool
-	prompt "kvv"
-
-config LCD4LINUX_CUSTOM_PLUGIN_loadavg
-	bool
-	prompt "loadavg"
-	default y
-
-config LCD4LINUX_CUSTOM_PLUGIN_meminfo
-	bool
-	prompt "meminfo"
-	default y
-
-config LCD4LINUX_CUSTOM_PLUGIN_mpd
-	bool
-	prompt "mpd"
-	select LCD4LINUX_CUSTOM_NEEDS_libmpdclient
-
-config LCD4LINUX_CUSTOM_PLUGIN_mpris_dbus
-	bool
-	prompt "mpris_dbus"
-	select LCD4LINUX_CUSTOM_NEEDS_libdbus
-
-config LCD4LINUX_CUSTOM_PLUGIN_mysql
-	bool
-	prompt "mysql"
-	select LCD4LINUX_CUSTOM_NEEDS_libmysqlclient
-
-config LCD4LINUX_CUSTOM_PLUGIN_netdev
-	bool
-	prompt "netdev"
-
-config LCD4LINUX_CUSTOM_PLUGIN_netinfo
-	bool
-	prompt "netinfo"
-
-config LCD4LINUX_CUSTOM_PLUGIN_pop3
-	bool
-	prompt "pop3"
-
-config LCD4LINUX_CUSTOM_PLUGIN_ppp
-	bool
-	prompt "ppp"
-	select LCD4LINUX_CUSTOM_NEEDS_ppp
-
-config LCD4LINUX_CUSTOM_PLUGIN_proc_stat
-	bool
-	prompt "proc_stat"
-	default y
-
-#config LCD4LINUX_CUSTOM_PLUGIN_python
-#	bool
-#	prompt "python"
-#	select LCD4LINUX_CUSTOM_NEEDS_python
-
-config LCD4LINUX_CUSTOM_PLUGIN_qnaplog
-	bool
-	prompt "qnaplog"
-	select LCD4LINUX_CUSTOM_NEEDS_libsqlite3
-
-config LCD4LINUX_CUSTOM_PLUGIN_seti
-	bool
-	prompt "seti"
-
-config LCD4LINUX_CUSTOM_PLUGIN_statfs
-	bool
-	prompt "statfs"
-
-config LCD4LINUX_CUSTOM_PLUGIN_uname
-	bool
-	prompt "uname"
-
-config LCD4LINUX_CUSTOM_PLUGIN_uptime
-	bool
-	prompt "uptime"
-	default y
-
-config LCD4LINUX_CUSTOM_PLUGIN_w1retap
-	bool
-	prompt "w1retap"
-
-config LCD4LINUX_CUSTOM_PLUGIN_wireless
-	bool
-	prompt "wireless"
-	depends on BROKEN
-
-config LCD4LINUX_CUSTOM_PLUGIN_xmms
-	bool
-	prompt "xmms"
-
-endif
-

--- a/utils/lcd4linux/Makefile
+++ /dev/null
@@ -1,322 +1,1 @@
-#
-# Copyright (C) 2007-2012 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=lcd4linux
-PKG_REV:=1187
-PKG_VERSION:=r$(PKG_REV)
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=https://ssl.bulix.org/svn/lcd4linux/trunk/
-PKG_SOURCE_SUBDIR:=lcd4linux-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=$(PKG_REV)
-PKG_SOURCE_PROTO:=svn
-
-LCD4LINUX_DRIVERS:= \
-	ASTUSB \
-	BeckmannEgle \
-	BWCT \
-	CrystalFontz \
-	Curses \
-	Cwlinux \
-	D4D \
-	DPF \
-	EA232graphic \
-	EFN \
-	FutabaVFD \
-	FW8888 \
-	G15 \
-	GLCD2USB \
-	IRLCD \
-	$(if $(CONFIG_BROKEN),HD44780) \
-	$(if $(CONFIG_BROKEN),HD44780-I2C) \
-	LCD2USB \
-	$(if $(CONFIG_BROKEN),LCDLinux) \
-	LCDTerm \
-	LEDMatrix \
-	LPH7508 \
-	$(if $(CONFIG_BROKEN),LUIse) \
-	LW_ABP \
-	M50530 \
-	MatrixOrbital \
-	MatrixOrbitalGX \
-	MilfordInstruments \
-	Newhaven \
-	Noritake \
-	NULL \
-	Pertelian \
-	PHAnderson \
-	PICGraphic \
-	picoLCD \
-	picoLCDGraphic \
-	PNG \
-	PPM \
-	$(if $(CONFIG_TARGET_rb532),RouterBoard) \
-	$(if $(CONFIG_BROKEN),SamsungSPF) \
-	serdisplib \
-	ShuttleVFD \
-	SimpleLCD \
-	st2205 \
-	T6963 \
-	TeakLCM \
-	$(if $(CONFIG_TARGET_ar71xx),TEW673GRU) \
-	Trefon \
-	USBHUB \
-	USBLCD \
-	VNC \
-	WincorNixdorf \
-#	ULA200 \
-#	X11 \
-
-LCD4LINUX_PLUGINS:= \
-	apm \
-	asterisk \
-	button_exec \
-	cpuinfo \
-	dbus \
-	diskstats \
-	dvb \
-	event \
-	exec \
-	fifo \
-	file \
-	gps \
-	hddtemp \
-	huawei \
-	i2c_sensors \
-	iconv \
-	imon \
-	isdn \
-	kvv \
-	loadavg \
-	netdev \
-	netinfo \
-	meminfo \
-	mpd \
-	mpris_dbus \
-	mysql \
-	netdev \
-	pop3 \
-	ppp \
-	proc_stat \
-	qnaplog \
-	seti \
-	statfs \
-	uname \
-	uptime \
-	w1retap \
-	$(if $(CONFIG_BROKEN),wireless) \
-	xmms \
-#	python \
-
-PKG_FIXUP:=autoreconf
-PKG_INSTALL:=1
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
-
-PKG_BUILD_DEPENDS:= \
-	libdbus \
-	libgd \
-	libmpdclient \
-	libmysqlclient \
-	libncurses \
-	libnmeap \
-	libsqlite3 \
-	libvncserver \
-	ppp \
-	serdisplib \
-	st2205tool \
-#	libftdi \
-#	libX11 \
-#	python \
-
-PKG_CONFIG_DEPENDS:= \
-	$(patsubst %,CONFIG_LCD4LINUX_CUSTOM_DRIVER_%,$(LCD4LINUX_DRIVERS)) \
-	$(patsubst %,CONFIG_LCD4LINUX_CUSTOM_PLUGIN_%,$(LCD4LINUX_PLUGINS)) \
-
-include $(INCLUDE_DIR)/package.mk
-include $(INCLUDE_DIR)/nls.mk
-
-define Package/lcd4linux/Default
-  SECTION:=utils
-  CATEGORY:=Utilities
-  MAINTAINER:=Jonathan McCrohan <jmccrohan@gmail.com>
-  TITLE:=LCD display utility
-  URL:=http://lcd4linux.bulix.org/
-endef
-
-define Package/lcd4linux/Default/description
- LCD4Linux is a small program that grabs information from the kernel and
- some subsystems and displays it on an external liquid crystal display.
-endef
-
-
-define Package/lcd4linux-custom
-$(call Package/lcd4linux/Default)
-  DEPENDS:= \
-	+LCD4LINUX_CUSTOM_NEEDS_libdbus:libdbus \
-	+LCD4LINUX_CUSTOM_NEEDS_libdpf:libdpf \
-	+LCD4LINUX_CUSTOM_NEEDS_libgd:libgd \
-	$(if $(ICONV_FULL),+LCD4LINUX_CUSTOM_NEEDS_libiconv:libiconv-full) \
-	+LCD4LINUX_CUSTOM_NEEDS_libjpeg:libjpeg \
-	+LCD4LINUX_CUSTOM_NEEDS_libmpdclient:libmpdclient \
-	+LCD4LINUX_CUSTOM_NEEDS_libmysqlclient:libmysqlclient \
-	+LCD4LINUX_CUSTOM_NEEDS_libncurses:libncurses \
-	+LCD4LINUX_CUSTOM_NEEDS_libsqlite3:libsqlite3 \
-	+LCD4LINUX_CUSTOM_NEEDS_libusb:libusb-compat \
-	+LCD4LINUX_CUSTOM_NEEDS_libvncserver:libvncserver \
-	+LCD4LINUX_CUSTOM_NEEDS_serdisplib:serdisplib \
-	+LCD4LINUX_CUSTOM_NEEDS_st2205tool:st2205tool \
-#	+LCD4LINUX_CUSTOM_NEEDS_libftdi:libftdi \
-#	+LCD4LINUX_CUSTOM_NEEDS_libX11:libX11 \
-#	+LCD4LINUX_CUSTOM_NEEDS_python:python
-  MENU:=1
-  PROVIDES:=lcd4linux
-  VARIANT=custom
-endef
-
-define Package/lcd4linux-custom/config
-	source "$(SOURCE)/Config.in"
-endef
-
-define Package/lcd4linux-custom/description
-$(call Package/lcd4linux/Default/description)
- .
- This package contains a customized version of LCD4Linux.
-endef
-
-
-define Package/lcd4linux-full
-$(call Package/lcd4linux/Default)
-  DEPENDS:= @DEVEL \
-	+libdbus \
-	+libdpf \
-	+libgd \
-	$(if $(ICONV_FULL),+libiconv-full) \
-	+libmpdclient \
-	+libmysqlclient \
-	+libncurses \
-	+libsqlite3 \
-	+libusb-compat \
-	+libvncserver \
-	+serdisplib \
-	+st2205tool \
-#	+libftdi \
-#	+libX11 \
-#	+python
-  PROVIDES:=lcd4linux
-  VARIANT=full
-endef
-
-define Package/lcd4linux-full/description
-$(call Package/lcd4linux/Default/description)
- .
- This package contains a version of LCD4Linux built with all supported
- drivers and plugins.
-endef
-
-
-CONFIGURE_ARGS+= \
-	--disable-rpath \
-
-EXTRA_LDFLAGS+= -Wl,-rpath-link,$(STAGING_DIR)/usr/lib
-
-ifeq ($(BUILD_VARIANT),custom)
-
-  LCD4LINUX_CUSTOM_DRIVERS:= $(strip $(foreach c, $(LCD4LINUX_DRIVERS), \
-    $(if $(CONFIG_LCD4LINUX_CUSTOM_DRIVER_$(c)),$(c),) \
- ))
-  ifeq ($(LCD4LINUX_CUSTOM_DRIVERS),)
-    LCD4LINUX_CUSTOM_DRIVERS:=Sample
-  endif
-
-  LCD4LINUX_CUSTOM_PLUGINS:= $(strip $(foreach c, $(LCD4LINUX_PLUGINS), \
-    $(if $(CONFIG_LCD4LINUX_CUSTOM_PLUGIN_$(c)),$(c)) \
-  ))
-  ifeq ($(LCD4LINUX_CUSTOM_PLUGINS),)
-    LCD4LINUX_CUSTOM_PLUGINS:=sample
-  endif
-
-  CONFIGURE_ARGS+= \
-	--with-drivers="$(LCD4LINUX_CUSTOM_DRIVERS)" \
-	--with-plugins="$(LCD4LINUX_CUSTOM_PLUGINS)" \
-
-  ifneq ($(CONFIG_LCD4LINUX_CUSTOM_NEEDS_libiconv),)
-    CONFIGURE_ARGS+= --with-libiconv-prefix="$(ICONV_PREFIX)"
-  else
-    CONFIGURE_ARGS+= --without-libiconv-prefix
-  endif
-
-  ifneq ($(CONFIG_LCD4LINUX_CUSTOM_NEEDS_libmysqlclient),)
-    EXTRA_LDFLAGS+= -L$(STAGING_DIR)/usr/lib/mysql
-  endif
-
-#  ifneq ($(CONFIG_LCD4LINUX_CUSTOM_NEEDS_python),)
-#    CONFIGURE_ARGS+= --with-python
-#  else
-    CONFIGURE_ARGS+= --without-python
-#  endif
-
-#  ifneq ($(CONFIG_LCD4LINUX_CUSTOM_NEEDS_libX11),)
-#    CONFIGURE_ARGS+= --with-x
-#  else
-    CONFIGURE_ARGS+= --without-x
-#  endif
-
-endif
-
-ifeq ($(BUILD_VARIANT),full)
-
-  LCD4LINUX_FULL_DRIVERS:= $(strip $(foreach c, $(LCD4LINUX_DRIVERS), \
-    $(c) \
-  ))
-
-  LCD4LINUX_FULL_PLUGINS:= $(strip $(foreach c, $(LCD4LINUX_PLUGINS), \
-    $(c) \
-  ))
-
-  CONFIGURE_ARGS+= \
-	--with-drivers="$(LCD4LINUX_FULL_DRIVERS)" \
-	--with-plugins="$(LCD4LINUX_FULL_PLUGINS)" \
-	--with-libiconv-prefix="$(ICONV_PREFIX)" \
-	--without-python \
-	--without-x \
-
-  EXTRA_LDFLAGS+= -L$(STAGING_DIR)/usr/lib/mysql
-
-endif
-
-
-define Package/lcd4linux/conffiles
-/etc/lcd4linux.conf
-endef
-
-define Package/lcd4linux/install
-	$(INSTALL_DIR) $(1)/usr/bin
-	$(CP) $(PKG_INSTALL_DIR)/usr/bin/lcd4linux $(1)/usr/bin/
-	$(INSTALL_DIR) $(1)/etc
-	$(INSTALL_CONF) $(PKG_BUILD_DIR)/lcd4linux.conf.sample $(1)/etc/lcd4linux.conf
-	$(INSTALL_DIR) $(1)/etc/init.d
-	$(INSTALL_BIN) ./files/lcd4linux.init $(1)/etc/init.d/lcd4linux
-	$(SED) "s|^\(Display 'GLCD2USB'\)|#\1|g" \
-	    -e "s|^\(Layout 'TestLayer'\)|#\1|g" \
-	    -e "s|^#\(Display 'Image'\)|\1|g" \
-	    -e "s|^#\(Layout 'Default'\)|\1|g" \
-	     $(1)/etc/lcd4linux.conf
-endef
-
-Package/lcd4linux-custom/conffiles = $(Package/lcd4linux/conffiles)
-Package/lcd4linux-custom/install = $(Package/lcd4linux/install)
-
-Package/lcd4linux-full/conffiles = $(Package/lcd4linux/conffiles)
-Package/lcd4linux-full/install = $(Package/lcd4linux/install)
-
-$(eval $(call BuildPackage,lcd4linux-custom))
-$(eval $(call BuildPackage,lcd4linux-full))
-

--- a/utils/lcd4linux/files/lcd4linux.init
+++ /dev/null
@@ -1,16 +1,1 @@
-#!/bin/sh /etc/rc.common
-# Copyright (C) 2007-2011 OpenWrt.org
 
-START=98
-
-SERVICE_USE_PID=1
-
-start() {
-	service_start /usr/bin/lcd4linux -o /tmp/lcd4linux.png -q
-}
-
-stop() {
-	service_stop /usr/bin/lcd4linux
-}
-
-

--- a/utils/lcd4linux/patches/100-drv_RouterBoard.patch
+++ /dev/null
@@ -1,12 +1,1 @@
---- a/drv_RouterBoard.c
-+++ b/drv_RouterBoard.c
-@@ -106,7 +106,7 @@
- #include <string.h>
- #include <errno.h>
- #include <unistd.h>
--#include <sys/io.h>
-+#include <asm/io.h>
- 
- #include "debug.h"
- #include "cfg.h"
 

--- a/utils/lcd4linux/patches/110-uclibc-logarithm-fix.patch
+++ /dev/null
@@ -1,12 +1,1 @@
---- a/plugin_netinfo.c
-+++ b/plugin_netinfo.c
-@@ -264,7 +264,7 @@ static void my_netmask_short(RESULT * re
-     sin = get_netmask(arg1);
-     if (NULL != sin) {
- 	logval = (long double) (get_netmask(arg1)->sin_addr.s_addr);
--	netlen = (int) rint(log2l(logval) / log2l(2.0));
-+	netlen = (int) rint(log2f(logval) / log2f(2.0));
- 	qprintf(value, sizeof(value), "/%d", netlen);
-     } else {
- 	qprintf(value, sizeof(value), "/?");
 

--- a/utils/lcd4linux/patches/120-remove-as-needed-linker-option.patch
+++ /dev/null
@@ -1,12 +1,1 @@
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -18,7 +18,7 @@ ACLOCAL_AMFLAGS=-I m4
- # use this for lots of warnings
- #AM_CFLAGS = -D_GNU_SOURCE -std=c99 -m64 -Wall -W -pedantic -Wno-variadic-macros -fno-strict-aliasing
- 
--lcd4linux_LDFLAGS ="-Wl,--as-needed"
-+lcd4linux_LDFLAGS = 
- lcd4linux_LDADD   = @DRIVERS@ @PLUGINS@ @DRVLIBS@ @PLUGINLIBS@
- lcd4linux_DEPENDENCIES = @DRIVERS@ @PLUGINS@
- 
 

--- a/utils/lcd4linux/patches/140-no_repnop_T6963.patch
+++ /dev/null
@@ -1,23 +1,1 @@
---- a/drv_T6963.c
-+++ b/drv_T6963.c
-@@ -114,7 +114,9 @@ static void drv_T6_status1(void)
-     /* wait for STA0=1 and STA1=1 */
-     n = 0;
-     do {
-+#if 0
- 	rep_nop();
-+#endif
- 	if (++n > 1000) {
- 	    debug("hang in status1");
- 	    bug = 1;
-@@ -150,7 +152,9 @@ static void drv_T6_status2(void)
-     /* wait for STA3=1 */
-     n = 0;
-     do {
-+#if 0
- 	rep_nop();
-+#endif
- 	if (++n > 1000) {
- 	    debug("hang in status2");
- 	    bug = 1;
 

--- a/utils/lcd4linux/patches/150-addlibmpdclient.patch
+++ /dev/null
@@ -1,2625 +1,1 @@
---- /dev/null
-+++ b/libmpdclient.c
-@@ -0,0 +1,1957 @@
-+/* libmpdclient
-+   (c)2003-2006 by Warren Dukes (warren.dukes@gmail.com)
-+   This project's homepage is: http://www.musicpd.org
-+
-+   Redistribution and use in source and binary forms, with or without
-+   modification, are permitted provided that the following conditions
-+   are met:
-+
-+   - Redistributions of source code must retain the above copyright
-+   notice, this list of conditions and the following disclaimer.
-+
-+   - Redistributions in binary form must reproduce the above copyright
-+   notice, this list of conditions and the following disclaimer in the
-+   documentation and/or other materials provided with the distribution.
-+
-+   - Neither the name of the Music Player Daemon nor the names of its
-+   contributors may be used to endorse or promote products derived from
-+   this software without specific prior written permission.
-+
-+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-+   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-+   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-+   A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR
-+   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-+   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-+   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-+   PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-+   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-+   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-+   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-+*/
-+
-+#include "libmpdclient.h"
-+
-+#include <errno.h>
-+#include <ctype.h>
-+#include <sys/types.h>
-+#include <stdio.h>
-+#include <sys/param.h>
-+#include <string.h>
-+#include <unistd.h>
-+#include <stdlib.h>
-+#include <fcntl.h>
-+#include <limits.h>
-+
-+#ifdef WIN32
-+#  include <ws2tcpip.h>
-+#  include <winsock.h>
-+#else
-+#  include <netinet/in.h>
-+#  include <arpa/inet.h>
-+#  include <sys/socket.h>
-+#  include <netdb.h>
-+#endif
-+
-+/* (bits+1)/3 (plus the sign character) */
-+#define INTLEN      ((sizeof(int)       * CHAR_BIT + 1) / 3 + 1)
-+#define LONGLONGLEN ((sizeof(long long) * CHAR_BIT + 1) / 3 + 1)
-+
-+#define COMMAND_LIST    1
-+#define COMMAND_LIST_OK 2
-+
-+#ifndef MPD_NO_GAI
-+#  ifdef AI_ADDRCONFIG
-+#    define MPD_HAVE_GAI
-+#  endif
-+#endif
-+
-+#ifndef MSG_DONTWAIT
-+#  define MSG_DONTWAIT 0
-+#endif
-+
-+#ifdef WIN32
-+#  define SELECT_ERRNO_IGNORE   (errno == WSAEINTR || errno == WSAEINPROGRESS)
-+#  define SENDRECV_ERRNO_IGNORE SELECT_ERRNO_IGNORE
-+#else
-+#  define SELECT_ERRNO_IGNORE   (errno == EINTR)
-+#  define SENDRECV_ERRNO_IGNORE (errno == EINTR || errno == EAGAIN)
-+#  define winsock_dll_error(c)  0
-+#  define closesocket(s)        close(s)
-+#  define WSACleanup()          do { /* nothing */ } while (0)
-+#endif
-+
-+#ifdef WIN32
-+static int winsock_dll_error(mpd_Connection * connection)
-+{
-+    WSADATA wsaData;
-+    if ((WSAStartup(MAKEWORD(2, 2), &wsaData)) != 0 || LOBYTE(wsaData.wVersion) != 2 || HIBYTE(wsaData.wVersion) != 2) {
-+	strcpy(connection->errorStr, "Could not find usable WinSock DLL.");
-+	connection->error = MPD_ERROR_SYSTEM;
-+	return 1;
-+    }
-+    return 0;
-+}
-+
-+static int do_connect_fail(mpd_Connection * connection, const struct sockaddr *serv_addr, int addrlen)
-+{
-+    int iMode = 1;		/* 0 = blocking, else non-blocking */
-+    ioctlsocket(connection->sock, FIONBIO, (u_long FAR *) & iMode);
-+    return (connect(connection->sock, serv_addr, addrlen) == SOCKET_ERROR && WSAGetLastError() != WSAEWOULDBLOCK);
-+}
-+#else				/* !WIN32 (sane operating systems) */
-+static int do_connect_fail(mpd_Connection * connection, const struct sockaddr *serv_addr, int addrlen)
-+{
-+    int flags = fcntl(connection->sock, F_GETFL, 0);
-+    fcntl(connection->sock, F_SETFL, flags | O_NONBLOCK);
-+    return (connect(connection->sock, serv_addr, addrlen) < 0 && errno != EINPROGRESS);
-+}
-+#endif				/* !WIN32 */
-+
-+#ifdef MPD_HAVE_GAI
-+static int mpd_connect(mpd_Connection * connection, const char *host, int port, float timeout)
-+{
-+    int error;
-+    char service[INTLEN + 1];
-+    struct addrinfo hints;
-+    struct addrinfo *res = NULL;
-+    struct addrinfo *addrinfo = NULL;
-+
-+	/**
-+	 * Setup hints
-+	 */
-+    hints.ai_flags = AI_ADDRCONFIG;
-+    hints.ai_family = PF_UNSPEC;
-+    hints.ai_socktype = SOCK_STREAM;
-+    hints.ai_protocol = IPPROTO_TCP;
-+    hints.ai_addrlen = 0;
-+    hints.ai_addr = NULL;
-+    hints.ai_canonname = NULL;
-+    hints.ai_next = NULL;
-+
-+    snprintf(service, sizeof(service), "%i", port);
-+
-+    error = getaddrinfo(host, service, &hints, &addrinfo);
-+
-+    if (error) {
-+	snprintf(connection->errorStr, MPD_ERRORSTR_MAX_LENGTH, "host \"%s\" not found: %s", host, gai_strerror(error));
-+	connection->error = MPD_ERROR_UNKHOST;
-+	return -1;
-+    }
-+
-+    for (res = addrinfo; res; res = res->ai_next) {
-+	/* create socket */
-+	connection->sock = socket(res->ai_family, SOCK_STREAM, res->ai_protocol);
-+	if (connection->sock < 0) {
-+	    snprintf(connection->errorStr, MPD_ERRORSTR_MAX_LENGTH, "problems creating socket: %s", strerror(errno));
-+	    connection->error = MPD_ERROR_SYSTEM;
-+	    freeaddrinfo(addrinfo);
-+	    return -1;
-+	}
-+
-+	mpd_setConnectionTimeout(connection, timeout);
-+
-+	/* connect stuff */
-+	if (do_connect_fail(connection, res->ai_addr, res->ai_addrlen)) {
-+	    /* try the next address family */
-+	    closesocket(connection->sock);
-+	    connection->sock = -1;
-+	    continue;
-+	}
-+    }
-+
-+    freeaddrinfo(addrinfo);
-+
-+    if (connection->sock < 0) {
-+	snprintf(connection->errorStr, MPD_ERRORSTR_MAX_LENGTH,
-+		 "problems connecting to \"%s\" on port %i: %s", host, port, strerror(errno));
-+	connection->error = MPD_ERROR_CONNPORT;
-+
-+	return -1;
-+    }
-+
-+    return 0;
-+}
-+#else				/* !MPD_HAVE_GAI */
-+static int mpd_connect(mpd_Connection * connection, const char *host, int port, float timeout)
-+{
-+    struct hostent *he;
-+    struct sockaddr *dest;
-+    int destlen;
-+    struct sockaddr_in sin;
-+
-+    if (!(he = gethostbyname(host))) {
-+	snprintf(connection->errorStr, MPD_ERRORSTR_MAX_LENGTH, "host \"%s\" not found", host);
-+	connection->error = MPD_ERROR_UNKHOST;
-+	return -1;
-+    }
-+
-+    memset(&sin, 0, sizeof(struct sockaddr_in));
-+    /*dest.sin_family = he->h_addrtype; */
-+    sin.sin_family = AF_INET;
-+    sin.sin_port = htons(port);
-+
-+    switch (he->h_addrtype) {
-+    case AF_INET:
-+	memcpy((char *) &sin.sin_addr.s_addr, (char *) he->h_addr, he->h_length);
-+	dest = (struct sockaddr *) &sin;
-+	destlen = sizeof(struct sockaddr_in);
-+	break;
-+    default:
-+	strcpy(connection->errorStr, "address type is not IPv4");
-+	connection->error = MPD_ERROR_SYSTEM;
-+	return -1;
-+	break;
-+    }
-+
-+    if ((connection->sock = socket(dest->sa_family, SOCK_STREAM, 0)) < 0) {
-+	strcpy(connection->errorStr, "problems creating socket");
-+	connection->error = MPD_ERROR_SYSTEM;
-+	return -1;
-+    }
-+
-+    mpd_setConnectionTimeout(connection, timeout);
-+
-+    /* connect stuff */
-+    if (do_connect_fail(connection, dest, destlen)) {
-+	snprintf(connection->errorStr, MPD_ERRORSTR_MAX_LENGTH,
-+		 "problems connecting to \"%s\" on port" " %i", host, port);
-+	connection->error = MPD_ERROR_CONNPORT;
-+	return -1;
-+    }
-+
-+    return 0;
-+}
-+#endif				/* !MPD_HAVE_GAI */
-+
-+char *mpdTagItemKeys[MPD_TAG_NUM_OF_ITEM_TYPES] = {
-+    "Artist",
-+    "Album",
-+    "Title",
-+    "Track",
-+    "Name",
-+    "Genre",
-+    "Date",
-+    "Composer",
-+    "Performer",
-+    "Comment",
-+    "Disc",
-+    "Filename",
-+    "Any"
-+};
-+
-+static char *mpd_sanitizeArg(const char *arg)
-+{
-+    size_t i;
-+    char *ret;
-+    register const char *c;
-+    register char *rc;
-+
-+    /* instead of counting in that loop above, just
-+     * use a bit more memory and half running time
-+     */
-+    ret = malloc(strlen(arg) * 2 + 1);
-+
-+    c = arg;
-+    rc = ret;
-+    for (i = strlen(arg) + 1; i != 0; --i) {
-+	if (*c == '"' || *c == '\\')
-+	    *rc++ = '\\';
-+	*(rc++) = *(c++);
-+    }
-+
-+    return ret;
-+}
-+
-+static mpd_ReturnElement *mpd_newReturnElement(const char *name, const char *value)
-+{
-+    mpd_ReturnElement *ret = malloc(sizeof(mpd_ReturnElement));
-+
-+    ret->name = strdup(name);
-+    ret->value = strdup(value);
-+
-+    return ret;
-+}
-+
-+static void mpd_freeReturnElement(mpd_ReturnElement * re)
-+{
-+    free(re->name);
-+    free(re->value);
-+    free(re);
-+}
-+
-+void mpd_setConnectionTimeout(mpd_Connection * connection, float timeout)
-+{
-+    connection->timeout.tv_sec = (int) timeout;
-+    connection->timeout.tv_usec = (int) (timeout * 1e6 - connection->timeout.tv_sec * 1000000 + 0.5);
-+}
-+
-+static int mpd_parseWelcome(mpd_Connection * connection, const char *host, int port, char *rt, char *output)
-+{
-+    char *tmp;
-+    char *test;
-+    int i;
-+
-+    if (strncmp(output, MPD_WELCOME_MESSAGE, strlen(MPD_WELCOME_MESSAGE))) {
-+	snprintf(connection->errorStr, MPD_ERRORSTR_MAX_LENGTH,
-+		 "mpd not running on port %i on host \"%s\"", port, host);
-+	connection->error = MPD_ERROR_NOTMPD;
-+	return 1;
-+    }
-+
-+    tmp = &output[strlen(MPD_WELCOME_MESSAGE)];
-+
-+    for (i = 0; i < 3; i++) {
-+	if (tmp)
-+	    connection->version[i] = strtol(tmp, &test, 10);
-+
-+	if (!tmp || (test[0] != '.' && test[0] != '\0')) {
-+	    snprintf(connection->errorStr,
-+		     MPD_ERRORSTR_MAX_LENGTH,
-+		     "error parsing version number at " "\"%s\"", &output[strlen(MPD_WELCOME_MESSAGE)]);
-+	    connection->error = MPD_ERROR_NOTMPD;
-+	    return 1;
-+	}
-+	tmp = ++test;
-+    }
-+
-+    return 0;
-+}
-+
-+mpd_Connection *mpd_newConnection(const char *host, int port, float timeout)
-+{
-+    int err;
-+    char *rt;
-+    char *output = NULL;
-+    mpd_Connection *connection = malloc(sizeof(mpd_Connection));
-+    struct timeval tv;
-+    fd_set fds;
-+    strcpy(connection->buffer, "");
-+    connection->buflen = 0;
-+    connection->bufstart = 0;
-+    strcpy(connection->errorStr, "");
-+    connection->error = 0;
-+    connection->doneProcessing = 0;
-+    connection->commandList = 0;
-+    connection->listOks = 0;
-+    connection->doneListOk = 0;
-+    connection->returnElement = NULL;
-+    connection->request = NULL;
-+
-+    if (winsock_dll_error(connection))
-+	return connection;
-+
-+    if (mpd_connect(connection, host, port, timeout) < 0)
-+	return connection;
-+
-+    while (!(rt = strstr(connection->buffer, "\n"))) {
-+	tv.tv_sec = connection->timeout.tv_sec;
-+	tv.tv_usec = connection->timeout.tv_usec;
-+	FD_ZERO(&fds);
-+	FD_SET(connection->sock, &fds);
-+	if ((err = select(connection->sock + 1, &fds, NULL, NULL, &tv)) == 1) {
-+	    int readed;
-+	    readed = recv(connection->sock,
-+			  &(connection->buffer[connection->buflen]), MPD_BUFFER_MAX_LENGTH - connection->buflen, 0);
-+	    if (readed <= 0) {
-+		snprintf(connection->errorStr, MPD_ERRORSTR_MAX_LENGTH,
-+			 "problems getting a response from" " \"%s\" on port %i : %s", host, port, strerror(errno));
-+		connection->error = MPD_ERROR_NORESPONSE;
-+		return connection;
-+	    }
-+	    connection->buflen += readed;
-+	    connection->buffer[connection->buflen] = '\0';
-+	} else if (err < 0) {
-+	    if (SELECT_ERRNO_IGNORE)
-+		continue;
-+	    snprintf(connection->errorStr,
-+		     MPD_ERRORSTR_MAX_LENGTH, "problems connecting to \"%s\" on port" " %i", host, port);
-+	    connection->error = MPD_ERROR_CONNPORT;
-+	    return connection;
-+	} else {
-+	    snprintf(connection->errorStr, MPD_ERRORSTR_MAX_LENGTH,
-+		     "timeout in attempting to get a response from" " \"%s\" on port %i", host, port);
-+	    connection->error = MPD_ERROR_NORESPONSE;
-+	    return connection;
-+	}
-+    }
-+
-+    *rt = '\0';
-+    output = strdup(connection->buffer);
-+    strcpy(connection->buffer, rt + 1);
-+    connection->buflen = strlen(connection->buffer);
-+
-+    if (mpd_parseWelcome(connection, host, port, rt, output) == 0)
-+	connection->doneProcessing = 1;
-+
-+    free(output);
-+
-+    return connection;
-+}
-+
-+void mpd_clearError(mpd_Connection * connection)
-+{
-+    connection->error = 0;
-+    connection->errorStr[0] = '\0';
-+}
-+
-+void mpd_closeConnection(mpd_Connection * connection)
-+{
-+    closesocket(connection->sock);
-+    if (connection->returnElement)
-+	free(connection->returnElement);
-+    if (connection->request)
-+	free(connection->request);
-+    free(connection);
-+    WSACleanup();
-+}
-+
-+static void mpd_executeCommand(mpd_Connection * connection, char *command)
-+{
-+    int ret;
-+    struct timeval tv;
-+    fd_set fds;
-+    char *commandPtr = command;
-+    int commandLen = strlen(command);
-+
-+    if (!connection->doneProcessing && !connection->commandList) {
-+	strcpy(connection->errorStr, "not done processing current command");
-+	connection->error = 1;
-+	return;
-+    }
-+
-+    mpd_clearError(connection);
-+
-+    FD_ZERO(&fds);
-+    FD_SET(connection->sock, &fds);
-+    tv.tv_sec = connection->timeout.tv_sec;
-+    tv.tv_usec = connection->timeout.tv_usec;
-+
-+    while ((ret = select(connection->sock + 1, NULL, &fds, NULL, &tv) == 1) || (ret == -1 && SELECT_ERRNO_IGNORE)) {
-+	ret = send(connection->sock, commandPtr, commandLen, MSG_DONTWAIT);
-+	if (ret <= 0) {
-+	    if (SENDRECV_ERRNO_IGNORE)
-+		continue;
-+	    snprintf(connection->errorStr, MPD_ERRORSTR_MAX_LENGTH, "problems giving command \"%s\"", command);
-+	    connection->error = MPD_ERROR_SENDING;
-+	    return;
-+	} else {
-+	    commandPtr += ret;
-+	    commandLen -= ret;
-+	}
-+
-+	if (commandLen <= 0)
-+	    break;
-+    }
-+
-+    if (commandLen > 0) {
-+	perror("");
-+	snprintf(connection->errorStr, MPD_ERRORSTR_MAX_LENGTH, "timeout sending command \"%s\"", command);
-+	connection->error = MPD_ERROR_TIMEOUT;
-+	return;
-+    }
-+
-+    if (!connection->commandList)
-+	connection->doneProcessing = 0;
-+    else if (connection->commandList == COMMAND_LIST_OK) {
-+	connection->listOks++;
-+    }
-+}
-+
-+static void mpd_getNextReturnElement(mpd_Connection * connection)
-+{
-+    char *output = NULL;
-+    char *rt = NULL;
-+    char *name = NULL;
-+    char *value = NULL;
-+    fd_set fds;
-+    struct timeval tv;
-+    char *tok = NULL;
-+    int readed;
-+    char *bufferCheck = NULL;
-+    int err;
-+    int pos;
-+
-+    if (connection->returnElement)
-+	mpd_freeReturnElement(connection->returnElement);
-+    connection->returnElement = NULL;
-+
-+    if (connection->doneProcessing || (connection->listOks && connection->doneListOk)) {
-+	strcpy(connection->errorStr, "already done processing current command");
-+	connection->error = 1;
-+	return;
-+    }
-+
-+    bufferCheck = connection->buffer + connection->bufstart;
-+    while (connection->bufstart >= connection->buflen || !(rt = strchr(bufferCheck, '\n'))) {
-+	if (connection->buflen >= MPD_BUFFER_MAX_LENGTH) {
-+	    memmove(connection->buffer,
-+		    connection->buffer + connection->bufstart, connection->buflen - connection->bufstart + 1);
-+	    connection->buflen -= connection->bufstart;
-+	    connection->bufstart = 0;
-+	}
-+	if (connection->buflen >= MPD_BUFFER_MAX_LENGTH) {
-+	    strcpy(connection->errorStr, "buffer overrun");
-+	    connection->error = MPD_ERROR_BUFFEROVERRUN;
-+	    connection->doneProcessing = 1;
-+	    connection->doneListOk = 0;
-+	    return;
-+	}
-+	bufferCheck = connection->buffer + connection->buflen;
-+	tv.tv_sec = connection->timeout.tv_sec;
-+	tv.tv_usec = connection->timeout.tv_usec;
-+	FD_ZERO(&fds);
-+	FD_SET(connection->sock, &fds);
-+	if ((err = select(connection->sock + 1, &fds, NULL, NULL, &tv) == 1)) {
-+	    readed = recv(connection->sock,
-+			  connection->buffer + connection->buflen,
-+			  MPD_BUFFER_MAX_LENGTH - connection->buflen, MSG_DONTWAIT);
-+	    if (readed < 0 && SENDRECV_ERRNO_IGNORE) {
-+		continue;
-+	    }
-+	    if (readed <= 0) {
-+		strcpy(connection->errorStr, "connection" " closed");
-+		connection->error = MPD_ERROR_CONNCLOSED;
-+		connection->doneProcessing = 1;
-+		connection->doneListOk = 0;
-+		return;
-+	    }
-+	    connection->buflen += readed;
-+	    connection->buffer[connection->buflen] = '\0';
-+	} else if (err < 0 && SELECT_ERRNO_IGNORE)
-+	    continue;
-+	else {
-+	    strcpy(connection->errorStr, "connection timeout");
-+	    connection->error = MPD_ERROR_TIMEOUT;
-+	    connection->doneProcessing = 1;
-+	    connection->doneListOk = 0;
-+	    return;
-+	}
-+    }
-+
-+    *rt = '\0';
-+    output = connection->buffer + connection->bufstart;
-+    connection->bufstart = rt - connection->buffer + 1;
-+
-+    if (strcmp(output, "OK") == 0) {
-+	if (connection->listOks > 0) {
-+	    strcpy(connection->errorStr, "expected more list_OK's");
-+	    connection->error = 1;
-+	}
-+	connection->listOks = 0;
-+	connection->doneProcessing = 1;
-+	connection->doneListOk = 0;
-+	return;
-+    }
-+
-+    if (strcmp(output, "list_OK") == 0) {
-+	if (!connection->listOks) {
-+	    strcpy(connection->errorStr, "got an unexpected list_OK");
-+	    connection->error = 1;
-+	} else {
-+	    connection->doneListOk = 1;
-+	    connection->listOks--;
-+	}
-+	return;
-+    }
-+
-+    if (strncmp(output, "ACK", strlen("ACK")) == 0) {
-+	char *test;
-+	char *needle;
-+	int val;
-+
-+	strcpy(connection->errorStr, output);
-+	connection->error = MPD_ERROR_ACK;
-+	connection->errorCode = MPD_ACK_ERROR_UNK;
-+	connection->errorAt = MPD_ERROR_AT_UNK;
-+	connection->doneProcessing = 1;
-+	connection->doneListOk = 0;
-+
-+	needle = strchr(output, '[');
-+	if (!needle)
-+	    return;
-+	val = strtol(needle + 1, &test, 10);
-+	if (*test != '@')
-+	    return;
-+	connection->errorCode = val;
-+	val = strtol(test + 1, &test, 10);
-+	if (*test != ']')
-+	    return;
-+	connection->errorAt = val;
-+	return;
-+    }
-+
-+    tok = strchr(output, ':');
-+    if (!tok)
-+	return;
-+    pos = tok - output;
-+    value = ++tok;
-+    name = output;
-+    name[pos] = '\0';
-+
-+    if (value[0] == ' ') {
-+	connection->returnElement = mpd_newReturnElement(name, &(value[1]));
-+    } else {
-+	snprintf(connection->errorStr, MPD_ERRORSTR_MAX_LENGTH, "error parsing: %s:%s", name, value);
-+	connection->error = 1;
-+    }
-+}
-+
-+void mpd_finishCommand(mpd_Connection * connection)
-+{
-+    while (!connection->doneProcessing) {
-+	if (connection->doneListOk)
-+	    connection->doneListOk = 0;
-+	mpd_getNextReturnElement(connection);
-+    }
-+}
-+
-+static void mpd_finishListOkCommand(mpd_Connection * connection)
-+{
-+    while (!connection->doneProcessing && connection->listOks && !connection->doneListOk) {
-+	mpd_getNextReturnElement(connection);
-+    }
-+}
-+
-+int mpd_nextListOkCommand(mpd_Connection * connection)
-+{
-+    mpd_finishListOkCommand(connection);
-+    if (!connection->doneProcessing)
-+	connection->doneListOk = 0;
-+    if (connection->listOks == 0 || connection->doneProcessing)
-+	return -1;
-+    return 0;
-+}
-+
-+void mpd_sendStatusCommand(mpd_Connection * connection)
-+{
-+    mpd_executeCommand(connection, "status\n");
-+}
-+
-+mpd_Status *mpd_getStatus(mpd_Connection * connection)
-+{
-+    mpd_Status *status;
-+
-+    /*mpd_executeCommand(connection,"status\n");
-+
-+       if(connection->error) return NULL; */
-+
-+    if (connection->doneProcessing || (connection->listOks && connection->doneListOk)) {
-+	return NULL;
-+    }
-+
-+    if (!connection->returnElement)
-+	mpd_getNextReturnElement(connection);
-+
-+    status = malloc(sizeof(mpd_Status));
-+    status->volume = -1;
-+    status->repeat = 0;
-+    status->random = 0;
-+    status->playlist = -1;
-+    status->playlistLength = -1;
-+    status->state = -1;
-+    status->song = 0;
-+    status->songid = 0;
-+    status->elapsedTime = 0;
-+    status->totalTime = 0;
-+    status->bitRate = 0;
-+    status->sampleRate = 0;
-+    status->bits = 0;
-+    status->channels = 0;
-+    status->crossfade = -1;
-+    status->error = NULL;
-+    status->updatingDb = 0;
-+
-+    if (connection->error) {
-+	free(status);
-+	return NULL;
-+    }
-+    while (connection->returnElement) {
-+	mpd_ReturnElement *re = connection->returnElement;
-+	if (strcmp(re->name, "volume") == 0) {
-+	    status->volume = atoi(re->value);
-+	} else if (strcmp(re->name, "repeat") == 0) {
-+	    status->repeat = atoi(re->value);
-+	} else if (strcmp(re->name, "random") == 0) {
-+	    status->random = atoi(re->value);
-+	} else if (strcmp(re->name, "playlist") == 0) {
-+	    status->playlist = strtol(re->value, NULL, 10);
-+	} else if (strcmp(re->name, "playlistlength") == 0) {
-+	    status->playlistLength = atoi(re->value);
-+	} else if (strcmp(re->name, "bitrate") == 0) {
-+	    status->bitRate = atoi(re->value);
-+	} else if (strcmp(re->name, "state") == 0) {
-+	    if (strcmp(re->value, "play") == 0) {
-+		status->state = MPD_STATUS_STATE_PLAY;
-+	    } else if (strcmp(re->value, "stop") == 0) {
-+		status->state = MPD_STATUS_STATE_STOP;
-+	    } else if (strcmp(re->value, "pause") == 0) {
-+		status->state = MPD_STATUS_STATE_PAUSE;
-+	    } else {
-+		status->state = MPD_STATUS_STATE_UNKNOWN;
-+	    }
-+	} else if (strcmp(re->name, "song") == 0) {
-+	    status->song = atoi(re->value);
-+	} else if (strcmp(re->name, "songid") == 0) {
-+	    status->songid = atoi(re->value);
-+	} else if (strcmp(re->name, "time") == 0) {
-+	    char *tok = strchr(re->value, ':');
-+	    /* the second strchr below is a safety check */
-+	    if (tok && (strchr(tok, 0) > (tok + 1))) {
-+		/* atoi stops at the first non-[0-9] char: */
-+		status->elapsedTime = atoi(re->value);
-+		status->totalTime = atoi(tok + 1);
-+	    }
-+	} else if (strcmp(re->name, "error") == 0) {
-+	    status->error = strdup(re->value);
-+	} else if (strcmp(re->name, "xfade") == 0) {
-+	    status->crossfade = atoi(re->value);
-+	} else if (strcmp(re->name, "updating_db") == 0) {
-+	    status->updatingDb = atoi(re->value);
-+	} else if (strcmp(re->name, "audio") == 0) {
-+	    char *tok = strchr(re->value, ':');
-+	    if (tok && (strchr(tok, 0) > (tok + 1))) {
-+		status->sampleRate = atoi(re->value);
-+		status->bits = atoi(++tok);
-+		tok = strchr(tok, ':');
-+		if (tok && (strchr(tok, 0) > (tok + 1)))
-+		    status->channels = atoi(tok + 1);
-+	    }
-+	}
-+
-+	mpd_getNextReturnElement(connection);
-+	if (connection->error) {
-+	    free(status);
-+	    return NULL;
-+	}
-+    }
-+
-+    if (connection->error) {
-+	free(status);
-+	return NULL;
-+    } else if (status->state < 0) {
-+	strcpy(connection->errorStr, "state not found");
-+	connection->error = 1;
-+	free(status);
-+	return NULL;
-+    }
-+
-+    return status;
-+}
-+
-+void mpd_freeStatus(mpd_Status * status)
-+{
-+    if (status->error)
-+	free(status->error);
-+    free(status);
-+}
-+
-+void mpd_sendStatsCommand(mpd_Connection * connection)
-+{
-+    mpd_executeCommand(connection, "stats\n");
-+}
-+
-+mpd_Stats *mpd_getStats(mpd_Connection * connection)
-+{
-+    mpd_Stats *stats;
-+
-+    /*mpd_executeCommand(connection,"stats\n");
-+
-+       if(connection->error) return NULL; */
-+
-+    if (connection->doneProcessing || (connection->listOks && connection->doneListOk)) {
-+	return NULL;
-+    }
-+
-+    if (!connection->returnElement)
-+	mpd_getNextReturnElement(connection);
-+
-+    stats = malloc(sizeof(mpd_Stats));
-+    stats->numberOfArtists = 0;
-+    stats->numberOfAlbums = 0;
-+    stats->numberOfSongs = 0;
-+    stats->uptime = 0;
-+    stats->dbUpdateTime = 0;
-+    stats->playTime = 0;
-+    stats->dbPlayTime = 0;
-+
-+    if (connection->error) {
-+	free(stats);
-+	return NULL;
-+    }
-+    while (connection->returnElement) {
-+	mpd_ReturnElement *re = connection->returnElement;
-+	if (strcmp(re->name, "artists") == 0) {
-+	    stats->numberOfArtists = atoi(re->value);
-+	} else if (strcmp(re->name, "albums") == 0) {
-+	    stats->numberOfAlbums = atoi(re->value);
-+	} else if (strcmp(re->name, "songs") == 0) {
-+	    stats->numberOfSongs = atoi(re->value);
-+	} else if (strcmp(re->name, "uptime") == 0) {
-+	    stats->uptime = strtol(re->value, NULL, 10);
-+	} else if (strcmp(re->name, "db_update") == 0) {
-+	    stats->dbUpdateTime = strtol(re->value, NULL, 10);
-+	} else if (strcmp(re->name, "playtime") == 0) {
-+	    stats->playTime = strtol(re->value, NULL, 10);
-+	} else if (strcmp(re->name, "db_playtime") == 0) {
-+	    stats->dbPlayTime = strtol(re->value, NULL, 10);
-+	}
-+
-+	mpd_getNextReturnElement(connection);
-+	if (connection->error) {
-+	    free(stats);
-+	    return NULL;
-+	}
-+    }
-+
-+    if (connection->error) {
-+	free(stats);
-+	return NULL;
-+    }
-+
-+    return stats;
-+}
-+
-+void mpd_freeStats(mpd_Stats * stats)
-+{
-+    free(stats);
-+}
-+
-+mpd_SearchStats *mpd_getSearchStats(mpd_Connection * connection)
-+{
-+    mpd_SearchStats *stats;
-+    mpd_ReturnElement *re;
-+
-+    if (connection->doneProcessing || (connection->listOks && connection->doneListOk)) {
-+	return NULL;
-+    }
-+
-+    if (!connection->returnElement)
-+	mpd_getNextReturnElement(connection);
-+
-+    if (connection->error)
-+	return NULL;
-+
-+    stats = malloc(sizeof(mpd_SearchStats));
-+    stats->numberOfSongs = 0;
-+    stats->playTime = 0;
-+
-+    while (connection->returnElement) {
-+	re = connection->returnElement;
-+
-+	if (strcmp(re->name, "songs") == 0) {
-+	    stats->numberOfSongs = atoi(re->value);
-+	} else if (strcmp(re->name, "playtime") == 0) {
-+	    stats->playTime = strtol(re->value, NULL, 10);
-+	}
-+
-+	mpd_getNextReturnElement(connection);
-+	if (connection->error) {
-+	    free(stats);
-+	    return NULL;
-+	}
-+    }
-+
-+    if (connection->error) {
-+	free(stats);
-+	return NULL;
-+    }
-+
-+    return stats;
-+}
-+
-+void mpd_freeSearchStats(mpd_SearchStats * stats)
-+{
-+    free(stats);
-+}
-+
-+static void mpd_initSong(mpd_Song * song)
-+{
-+    song->file = NULL;
-+    song->artist = NULL;
-+    song->album = NULL;
-+    song->track = NULL;
-+    song->title = NULL;
-+    song->name = NULL;
-+    song->date = NULL;
-+    /* added by Qball */
-+    song->genre = NULL;
-+    song->composer = NULL;
-+    song->performer = NULL;
-+    song->disc = NULL;
-+    song->comment = NULL;
-+
-+    song->time = MPD_SONG_NO_TIME;
-+    song->pos = MPD_SONG_NO_NUM;
-+    song->id = MPD_SONG_NO_ID;
-+}
-+
-+static void mpd_finishSong(mpd_Song * song)
-+{
-+    if (song->file)
-+	free(song->file);
-+    if (song->artist)
-+	free(song->artist);
-+    if (song->album)
-+	free(song->album);
-+    if (song->title)
-+	free(song->title);
-+    if (song->track)
-+	free(song->track);
-+    if (song->name)
-+	free(song->name);
-+    if (song->date)
-+	free(song->date);
-+    if (song->genre)
-+	free(song->genre);
-+    if (song->composer)
-+	free(song->composer);
-+    if (song->disc)
-+	free(song->disc);
-+    if (song->comment)
-+	free(song->comment);
-+}
-+
-+mpd_Song *mpd_newSong(void)
-+{
-+    mpd_Song *ret = malloc(sizeof(mpd_Song));
-+
-+    mpd_initSong(ret);
-+
-+    return ret;
-+}
-+
-+void mpd_freeSong(mpd_Song * song)
-+{
-+    mpd_finishSong(song);
-+    free(song);
-+}
-+
-+mpd_Song *mpd_songDup(mpd_Song * song)
-+{
-+    mpd_Song *ret = mpd_newSong();
-+
-+    if (song->file)
-+	ret->file = strdup(song->file);
-+    if (song->artist)
-+	ret->artist = strdup(song->artist);
-+    if (song->album)
-+	ret->album = strdup(song->album);
-+    if (song->title)
-+	ret->title = strdup(song->title);
-+    if (song->track)
-+	ret->track = strdup(song->track);
-+    if (song->name)
-+	ret->name = strdup(song->name);
-+    if (song->date)
-+	ret->date = strdup(song->date);
-+    if (song->genre)
-+	ret->genre = strdup(song->genre);
-+    if (song->composer)
-+	ret->composer = strdup(song->composer);
-+    if (song->disc)
-+	ret->disc = strdup(song->disc);
-+    if (song->comment)
-+	ret->comment = strdup(song->comment);
-+    ret->time = song->time;
-+    ret->pos = song->pos;
-+    ret->id = song->id;
-+
-+    return ret;
-+}
-+
-+static void mpd_initDirectory(mpd_Directory * directory)
-+{
-+    directory->path = NULL;
-+}
-+
-+static void mpd_finishDirectory(mpd_Directory * directory)
-+{
-+    if (directory->path)
-+	free(directory->path);
-+}
-+
-+mpd_Directory *mpd_newDirectory(void)
-+{
-+    mpd_Directory *directory = malloc(sizeof(mpd_Directory));;
-+
-+    mpd_initDirectory(directory);
-+
-+    return directory;
-+}
-+
-+void mpd_freeDirectory(mpd_Directory * directory)
-+{
-+    mpd_finishDirectory(directory);
-+
-+    free(directory);
-+}
-+
-+mpd_Directory *mpd_directoryDup(mpd_Directory * directory)
-+{
-+    mpd_Directory *ret = mpd_newDirectory();
-+
-+    if (directory->path)
-+	ret->path = strdup(directory->path);
-+
-+    return ret;
-+}
-+
-+static void mpd_initPlaylistFile(mpd_PlaylistFile * playlist)
-+{
-+    playlist->path = NULL;
-+}
-+
-+static void mpd_finishPlaylistFile(mpd_PlaylistFile * playlist)
-+{
-+    if (playlist->path)
-+	free(playlist->path);
-+}
-+
-+mpd_PlaylistFile *mpd_newPlaylistFile(void)
-+{
-+    mpd_PlaylistFile *playlist = malloc(sizeof(mpd_PlaylistFile));
-+
-+    mpd_initPlaylistFile(playlist);
-+
-+    return playlist;
-+}
-+
-+void mpd_freePlaylistFile(mpd_PlaylistFile * playlist)
-+{
-+    mpd_finishPlaylistFile(playlist);
-+    free(playlist);
-+}
-+
-+mpd_PlaylistFile *mpd_playlistFileDup(mpd_PlaylistFile * playlist)
-+{
-+    mpd_PlaylistFile *ret = mpd_newPlaylistFile();
-+
-+    if (playlist->path)
-+	ret->path = strdup(playlist->path);
-+
-+    return ret;
-+}
-+
-+static void mpd_initInfoEntity(mpd_InfoEntity * entity)
-+{
-+    entity->info.directory = NULL;
-+}
-+
-+static void mpd_finishInfoEntity(mpd_InfoEntity * entity)
-+{
-+    if (entity->info.directory) {
-+	if (entity->type == MPD_INFO_ENTITY_TYPE_DIRECTORY) {
-+	    mpd_freeDirectory(entity->info.directory);
-+	} else if (entity->type == MPD_INFO_ENTITY_TYPE_SONG) {
-+	    mpd_freeSong(entity->info.song);
-+	} else if (entity->type == MPD_INFO_ENTITY_TYPE_PLAYLISTFILE) {
-+	    mpd_freePlaylistFile(entity->info.playlistFile);
-+	}
-+    }
-+}
-+
-+mpd_InfoEntity *mpd_newInfoEntity(void)
-+{
-+    mpd_InfoEntity *entity = malloc(sizeof(mpd_InfoEntity));
-+
-+    mpd_initInfoEntity(entity);
-+
-+    return entity;
-+}
-+
-+void mpd_freeInfoEntity(mpd_InfoEntity * entity)
-+{
-+    mpd_finishInfoEntity(entity);
-+    free(entity);
-+}
-+
-+static void mpd_sendInfoCommand(mpd_Connection * connection, char *command)
-+{
-+    mpd_executeCommand(connection, command);
-+}
-+
-+mpd_InfoEntity *mpd_getNextInfoEntity(mpd_Connection * connection)
-+{
-+    mpd_InfoEntity *entity = NULL;
-+
-+    if (connection->doneProcessing || (connection->listOks && connection->doneListOk)) {
-+	return NULL;
-+    }
-+
-+    if (!connection->returnElement)
-+	mpd_getNextReturnElement(connection);
-+
-+    if (connection->returnElement) {
-+	if (strcmp(connection->returnElement->name, "file") == 0) {
-+	    entity = mpd_newInfoEntity();
-+	    entity->type = MPD_INFO_ENTITY_TYPE_SONG;
-+	    entity->info.song = mpd_newSong();
-+	    entity->info.song->file = strdup(connection->returnElement->value);
-+	} else if (strcmp(connection->returnElement->name, "directory") == 0) {
-+	    entity = mpd_newInfoEntity();
-+	    entity->type = MPD_INFO_ENTITY_TYPE_DIRECTORY;
-+	    entity->info.directory = mpd_newDirectory();
-+	    entity->info.directory->path = strdup(connection->returnElement->value);
-+	} else if (strcmp(connection->returnElement->name, "playlist") == 0) {
-+	    entity = mpd_newInfoEntity();
-+	    entity->type = MPD_INFO_ENTITY_TYPE_PLAYLISTFILE;
-+	    entity->info.playlistFile = mpd_newPlaylistFile();
-+	    entity->info.playlistFile->path = strdup(connection->returnElement->value);
-+	} else if (strcmp(connection->returnElement->name, "cpos") == 0) {
-+	    entity = mpd_newInfoEntity();
-+	    entity->type = MPD_INFO_ENTITY_TYPE_SONG;
-+	    entity->info.song = mpd_newSong();
-+	    entity->info.song->pos = atoi(connection->returnElement->value);
-+	} else {
-+	    connection->error = 1;
-+	    strcpy(connection->errorStr, "problem parsing song info");
-+	    return NULL;
-+	}
-+    } else
-+	return NULL;
-+
-+    mpd_getNextReturnElement(connection);
-+    while (connection->returnElement) {
-+	mpd_ReturnElement *re = connection->returnElement;
-+
-+	if (strcmp(re->name, "file") == 0)
-+	    return entity;
-+	else if (strcmp(re->name, "directory") == 0)
-+	    return entity;
-+	else if (strcmp(re->name, "playlist") == 0)
-+	    return entity;
-+	else if (strcmp(re->name, "cpos") == 0)
-+	    return entity;
-+
-+	if (entity->type == MPD_INFO_ENTITY_TYPE_SONG && strlen(re->value)) {
-+	    if (!entity->info.song->artist && strcmp(re->name, "Artist") == 0) {
-+		entity->info.song->artist = strdup(re->value);
-+	    } else if (!entity->info.song->album && strcmp(re->name, "Album") == 0) {
-+		entity->info.song->album = strdup(re->value);
-+	    } else if (!entity->info.song->title && strcmp(re->name, "Title") == 0) {
-+		entity->info.song->title = strdup(re->value);
-+	    } else if (!entity->info.song->track && strcmp(re->name, "Track") == 0) {
-+		entity->info.song->track = strdup(re->value);
-+	    } else if (!entity->info.song->name && strcmp(re->name, "Name") == 0) {
-+		entity->info.song->name = strdup(re->value);
-+	    } else if (entity->info.song->time == MPD_SONG_NO_TIME && strcmp(re->name, "Time") == 0) {
-+		entity->info.song->time = atoi(re->value);
-+	    } else if (entity->info.song->pos == MPD_SONG_NO_NUM && strcmp(re->name, "Pos") == 0) {
-+		entity->info.song->pos = atoi(re->value);
-+	    } else if (entity->info.song->id == MPD_SONG_NO_ID && strcmp(re->name, "Id") == 0) {
-+		entity->info.song->id = atoi(re->value);
-+	    } else if (!entity->info.song->date && strcmp(re->name, "Date") == 0) {
-+		entity->info.song->date = strdup(re->value);
-+	    } else if (!entity->info.song->genre && strcmp(re->name, "Genre") == 0) {
-+		entity->info.song->genre = strdup(re->value);
-+	    } else if (!entity->info.song->composer && strcmp(re->name, "Composer") == 0) {
-+		entity->info.song->composer = strdup(re->value);
-+	    } else if (!entity->info.song->performer && strcmp(re->name, "Performer") == 0) {
-+		entity->info.song->performer = strdup(re->value);
-+	    } else if (!entity->info.song->disc && strcmp(re->name, "Disc") == 0) {
-+		entity->info.song->disc = strdup(re->value);
-+	    } else if (!entity->info.song->comment && strcmp(re->name, "Comment") == 0) {
-+		entity->info.song->comment = strdup(re->value);
-+	    }
-+	} else if (entity->type == MPD_INFO_ENTITY_TYPE_DIRECTORY) {
-+	} else if (entity->type == MPD_INFO_ENTITY_TYPE_PLAYLISTFILE) {
-+	}
-+
-+	mpd_getNextReturnElement(connection);
-+    }
-+
-+    return entity;
-+}
-+
-+static char *mpd_getNextReturnElementNamed(mpd_Connection * connection, const char *name)
-+{
-+    if (connection->doneProcessing || (connection->listOks && connection->doneListOk)) {
-+	return NULL;
-+    }
-+
-+    mpd_getNextReturnElement(connection);
-+    while (connection->returnElement) {
-+	mpd_ReturnElement *re = connection->returnElement;
-+
-+	if (strcmp(re->name, name) == 0)
-+	    return strdup(re->value);
-+	mpd_getNextReturnElement(connection);
-+    }
-+
-+    return NULL;
-+}
-+
-+char *mpd_getNextTag(mpd_Connection * connection, int type)
-+{
-+    if (type < 0 || type >= MPD_TAG_NUM_OF_ITEM_TYPES || type == MPD_TAG_ITEM_ANY)
-+	return NULL;
-+    if (type == MPD_TAG_ITEM_FILENAME)
-+	return mpd_getNextReturnElementNamed(connection, "file");
-+    return mpd_getNextReturnElementNamed(connection, mpdTagItemKeys[type]);
-+}
-+
-+char *mpd_getNextArtist(mpd_Connection * connection)
-+{
-+    return mpd_getNextReturnElementNamed(connection, "Artist");
-+}
-+
-+char *mpd_getNextAlbum(mpd_Connection * connection)
-+{
-+    return mpd_getNextReturnElementNamed(connection, "Album");
-+}
-+
-+void mpd_sendPlaylistInfoCommand(mpd_Connection * connection, int songPos)
-+{
-+    int len = strlen("playlistinfo") + 2 + INTLEN + 3;
-+    char *string = malloc(len);
-+    snprintf(string, len, "playlistinfo \"%i\"\n", songPos);
-+    mpd_sendInfoCommand(connection, string);
-+    free(string);
-+}
-+
-+void mpd_sendPlaylistIdCommand(mpd_Connection * connection, int id)
-+{
-+    int len = strlen("playlistid") + 2 + INTLEN + 3;
-+    char *string = malloc(len);
-+    snprintf(string, len, "playlistid \"%i\"\n", id);
-+    mpd_sendInfoCommand(connection, string);
-+    free(string);
-+}
-+
-+void mpd_sendPlChangesCommand(mpd_Connection * connection, long long playlist)
-+{
-+    int len = strlen("plchanges") + 2 + LONGLONGLEN + 3;
-+    char *string = malloc(len);
-+    snprintf(string, len, "plchanges \"%lld\"\n", playlist);
-+    mpd_sendInfoCommand(connection, string);
-+    free(string);
-+}
-+
-+void mpd_sendPlChangesPosIdCommand(mpd_Connection * connection, long long playlist)
-+{
-+    int len = strlen("plchangesposid") + 2 + LONGLONGLEN + 3;
-+    char *string = malloc(len);
-+    snprintf(string, len, "plchangesposid \"%lld\"\n", playlist);
-+    mpd_sendInfoCommand(connection, string);
-+    free(string);
-+}
-+
-+void mpd_sendListallCommand(mpd_Connection * connection, const char *dir)
-+{
-+    char *sDir = mpd_sanitizeArg(dir);
-+    int len = strlen("listall") + 2 + strlen(sDir) + 3;
-+    char *string = malloc(len);
-+    snprintf(string, len, "listall \"%s\"\n", sDir);
-+    mpd_sendInfoCommand(connection, string);
-+    free(string);
-+    free(sDir);
-+}
-+
-+void mpd_sendListallInfoCommand(mpd_Connection * connection, const char *dir)
-+{
-+    char *sDir = mpd_sanitizeArg(dir);
-+    int len = strlen("listallinfo") + 2 + strlen(sDir) + 3;
-+    char *string = malloc(len);
-+    snprintf(string, len, "listallinfo \"%s\"\n", sDir);
-+    mpd_sendInfoCommand(connection, string);
-+    free(string);
-+    free(sDir);
-+}
-+
-+void mpd_sendLsInfoCommand(mpd_Connection * connection, const char *dir)
-+{
-+    char *sDir = mpd_sanitizeArg(dir);
-+    int len = strlen("lsinfo") + 2 + strlen(sDir) + 3;
-+    char *string = malloc(len);
-+    snprintf(string, len, "lsinfo \"%s\"\n", sDir);
-+    mpd_sendInfoCommand(connection, string);
-+    free(string);
-+    free(sDir);
-+}
-+
-+void mpd_sendCurrentSongCommand(mpd_Connection * connection)
-+{
-+    mpd_executeCommand(connection, "currentsong\n");
-+}
-+
-+void mpd_sendSearchCommand(mpd_Connection * connection, int table, const char *str)
-+{
-+    mpd_startSearch(connection, 0);
-+    mpd_addConstraintSearch(connection, table, str);
-+    mpd_commitSearch(connection);
-+}
-+
-+void mpd_sendFindCommand(mpd_Connection * connection, int table, const char *str)
-+{
-+    mpd_startSearch(connection, 1);
-+    mpd_addConstraintSearch(connection, table, str);
-+    mpd_commitSearch(connection);
-+}
-+
-+void mpd_sendListCommand(mpd_Connection * connection, int table, const char *arg1)
-+{
-+    char st[10];
-+    int len;
-+    char *string;
-+    if (table == MPD_TABLE_ARTIST)
-+	strcpy(st, "artist");
-+    else if (table == MPD_TABLE_ALBUM)
-+	strcpy(st, "album");
-+    else {
-+	connection->error = 1;
-+	strcpy(connection->errorStr, "unknown table for list");
-+	return;
-+    }
-+    if (arg1) {
-+	char *sanitArg1 = mpd_sanitizeArg(arg1);
-+	len = strlen("list") + 1 + strlen(sanitArg1) + 2 + strlen(st) + 3;
-+	string = malloc(len);
-+	snprintf(string, len, "list %s \"%s\"\n", st, sanitArg1);
-+	free(sanitArg1);
-+    } else {
-+	len = strlen("list") + 1 + strlen(st) + 2;
-+	string = malloc(len);
-+	snprintf(string, len, "list %s\n", st);
-+    }
-+    mpd_sendInfoCommand(connection, string);
-+    free(string);
-+}
-+
-+void mpd_sendAddCommand(mpd_Connection * connection, const char *file)
-+{
-+    char *sFile = mpd_sanitizeArg(file);
-+    int len = strlen("add") + 2 + strlen(sFile) + 3;
-+    char *string = malloc(len);
-+    snprintf(string, len, "add \"%s\"\n", sFile);
-+    mpd_executeCommand(connection, string);
-+    free(string);
-+    free(sFile);
-+}
-+
-+int mpd_sendAddIdCommand(mpd_Connection * connection, const char *file)
-+{
-+    int retval = -1;
-+    char *sFile = mpd_sanitizeArg(file);
-+    int len = strlen("addid") + 2 + strlen(sFile) + 3;
-+    char *string = malloc(len);
-+
-+    snprintf(string, len, "addid \"%s\"\n", sFile);
-+    mpd_sendInfoCommand(connection, string);
-+    free(string);
-+    free(sFile);
-+
-+    string = mpd_getNextReturnElementNamed(connection, "Id");
-+    if (string) {
-+	retval = atoi(string);
-+	free(string);
-+    }
-+
-+    return retval;
-+}
-+
-+void mpd_sendDeleteCommand(mpd_Connection * connection, int songPos)
-+{
-+    int len = strlen("delete") + 2 + INTLEN + 3;
-+    char *string = malloc(len);
-+    snprintf(string, len, "delete \"%i\"\n", songPos);
-+    mpd_sendInfoCommand(connection, string);
-+    free(string);
-+}
-+
-+void mpd_sendDeleteIdCommand(mpd_Connection * connection, int id)
-+{
-+    int len = strlen("deleteid") + 2 + INTLEN + 3;
-+    char *string = malloc(len);
-+    snprintf(string, len, "deleteid \"%i\"\n", id);
-+    mpd_sendInfoCommand(connection, string);
-+    free(string);
-+}
-+
-+void mpd_sendSaveCommand(mpd_Connection * connection, const char *name)
-+{
-+    char *sName = mpd_sanitizeArg(name);
-+    int len = strlen("save") + 2 + strlen(sName) + 3;
-+    char *string = malloc(len);
-+    snprintf(string, len, "save \"%s\"\n", sName);
-+    mpd_executeCommand(connection, string);
-+    free(string);
-+    free(sName);
-+}
-+
-+void mpd_sendLoadCommand(mpd_Connection * connection, const char *name)
-+{
-+    char *sName = mpd_sanitizeArg(name);
-+    int len = strlen("load") + 2 + strlen(sName) + 3;
-+    char *string = malloc(len);
-+    snprintf(string, len, "load \"%s\"\n", sName);
-+    mpd_executeCommand(connection, string);
-+    free(string);
-+    free(sName);
-+}
-+
-+void mpd_sendRmCommand(mpd_Connection * connection, const char *name)
-+{
-+    char *sName = mpd_sanitizeArg(name);
-+    int len = strlen("rm") + 2 + strlen(sName) + 3;
-+    char *string = malloc(len);
-+    snprintf(string, len, "rm \"%s\"\n", sName);
-+    mpd_executeCommand(connection, string);
-+    free(string);
-+    free(sName);
-+}
-+
-+void mpd_sendRenameCommand(mpd_Connection * connection, const char *from, const char *to)
-+{
-+    char *sFrom = mpd_sanitizeArg(from);
-+    char *sTo = mpd_sanitizeArg(to);
-+    int len = strlen("rename") + 2 + strlen(sFrom) + 3 + strlen(sTo) + 3;
-+    char *string = malloc(len);
-+    snprintf(string, len, "rename \"%s\" \"%s\"\n", sFrom, sTo);
-+    mpd_executeCommand(connection, string);
-+    free(string);
-+    free(sFrom);
-+    free(sTo);
-+}
-+
-+void mpd_sendShuffleCommand(mpd_Connection * connection)
-+{
-+    mpd_executeCommand(connection, "shuffle\n");
-+}
-+
-+void mpd_sendClearCommand(mpd_Connection * connection)
-+{
-+    mpd_executeCommand(connection, "clear\n");
-+}
-+
-+void mpd_sendPlayCommand(mpd_Connection * connection, int songPos)
-+{
-+    int len = strlen("play") + 2 + INTLEN + 3;
-+    char *string = malloc(len);
-+    snprintf(string, len, "play \"%i\"\n", songPos);
-+    mpd_sendInfoCommand(connection, string);
-+    free(string);
-+}
-+
-+void mpd_sendPlayIdCommand(mpd_Connection * connection, int id)
-+{
-+    int len = strlen("playid") + 2 + INTLEN + 3;
-+    char *string = malloc(len);
-+    snprintf(string, len, "playid \"%i\"\n", id);
-+    mpd_sendInfoCommand(connection, string);
-+    free(string);
-+}
-+
-+void mpd_sendStopCommand(mpd_Connection * connection)
-+{
-+    mpd_executeCommand(connection, "stop\n");
-+}
-+
-+void mpd_sendPauseCommand(mpd_Connection * connection, int pauseMode)
-+{
-+    int len = strlen("pause") + 2 + INTLEN + 3;
-+    char *string = malloc(len);
-+    snprintf(string, len, "pause \"%i\"\n", pauseMode);
-+    mpd_executeCommand(connection, string);
-+    free(string);
-+}
-+
-+void mpd_sendNextCommand(mpd_Connection * connection)
-+{
-+    mpd_executeCommand(connection, "next\n");
-+}
-+
-+void mpd_sendMoveCommand(mpd_Connection * connection, int from, int to)
-+{
-+    int len = strlen("move") + 2 + INTLEN + 3 + INTLEN + 3;
-+    char *string = malloc(len);
-+    snprintf(string, len, "move \"%i\" \"%i\"\n", from, to);
-+    mpd_sendInfoCommand(connection, string);
-+    free(string);
-+}
-+
-+void mpd_sendMoveIdCommand(mpd_Connection * connection, int id, int to)
-+{
-+    int len = strlen("moveid") + 2 + INTLEN + 3 + INTLEN + 3;
-+    char *string = malloc(len);
-+    snprintf(string, len, "moveid \"%i\" \"%i\"\n", id, to);
-+    mpd_sendInfoCommand(connection, string);
-+    free(string);
-+}
-+
-+void mpd_sendSwapCommand(mpd_Connection * connection, int song1, int song2)
-+{
-+    int len = strlen("swap") + 2 + INTLEN + 3 + INTLEN + 3;
-+    char *string = malloc(len);
-+    snprintf(string, len, "swap \"%i\" \"%i\"\n", song1, song2);
-+    mpd_sendInfoCommand(connection, string);
-+    free(string);
-+}
-+
-+void mpd_sendSwapIdCommand(mpd_Connection * connection, int id1, int id2)
-+{
-+    int len = strlen("swapid") + 2 + INTLEN + 3 + INTLEN + 3;
-+    char *string = malloc(len);
-+    snprintf(string, len, "swapid \"%i\" \"%i\"\n", id1, id2);
-+    mpd_sendInfoCommand(connection, string);
-+    free(string);
-+}
-+
-+void mpd_sendSeekCommand(mpd_Connection * connection, int song, int time)
-+{
-+    int len = strlen("seek") + 2 + INTLEN + 3 + INTLEN + 3;
-+    char *string = malloc(len);
-+    snprintf(string, len, "seek \"%i\" \"%i\"\n", song, time);
-+    mpd_sendInfoCommand(connection, string);
-+    free(string);
-+}
-+
-+void mpd_sendSeekIdCommand(mpd_Connection * connection, int id, int time)
-+{
-+    int len = strlen("seekid") + 2 + INTLEN + 3 + INTLEN + 3;
-+    char *string = malloc(len);
-+    snprintf(string, len, "seekid \"%i\" \"%i\"\n", id, time);
-+    mpd_sendInfoCommand(connection, string);
-+    free(string);
-+}
-+
-+void mpd_sendUpdateCommand(mpd_Connection * connection, char *path)
-+{
-+    char *sPath = mpd_sanitizeArg(path);
-+    int len = strlen("update") + 2 + strlen(sPath) + 3;
-+    char *string = malloc(len);
-+    snprintf(string, len, "update \"%s\"\n", sPath);
-+    mpd_sendInfoCommand(connection, string);
-+    free(string);
-+    free(sPath);
-+}
-+
-+int mpd_getUpdateId(mpd_Connection * connection)
-+{
-+    char *jobid;
-+    int ret = 0;
-+
-+    jobid = mpd_getNextReturnElementNamed(connection, "updating_db");
-+    if (jobid) {
-+	ret = atoi(jobid);
-+	free(jobid);
-+    }
-+
-+    return ret;
-+}
-+
-+void mpd_sendPrevCommand(mpd_Connection * connection)
-+{
-+    mpd_executeCommand(connection, "previous\n");
-+}
-+
-+void mpd_sendRepeatCommand(mpd_Connection * connection, int repeatMode)
-+{
-+    int len = strlen("repeat") + 2 + INTLEN + 3;
-+    char *string = malloc(len);
-+    snprintf(string, len, "repeat \"%i\"\n", repeatMode);
-+    mpd_executeCommand(connection, string);
-+    free(string);
-+}
-+
-+void mpd_sendRandomCommand(mpd_Connection * connection, int randomMode)
-+{
-+    int len = strlen("random") + 2 + INTLEN + 3;
-+    char *string = malloc(len);
-+    snprintf(string, len, "random \"%i\"\n", randomMode);
-+    mpd_executeCommand(connection, string);
-+    free(string);
-+}
-+
-+void mpd_sendSetvolCommand(mpd_Connection * connection, int volumeChange)
-+{
-+    int len = strlen("setvol") + 2 + INTLEN + 3;
-+    char *string = malloc(len);
-+    snprintf(string, len, "setvol \"%i\"\n", volumeChange);
-+    mpd_executeCommand(connection, string);
-+    free(string);
-+}
-+
-+void mpd_sendVolumeCommand(mpd_Connection * connection, int volumeChange)
-+{
-+    int len = strlen("volume") + 2 + INTLEN + 3;
-+    char *string = malloc(len);
-+    snprintf(string, len, "volume \"%i\"\n", volumeChange);
-+    mpd_executeCommand(connection, string);
-+    free(string);
-+}
-+
-+void mpd_sendCrossfadeCommand(mpd_Connection * connection, int seconds)
-+{
-+    int len = strlen("crossfade") + 2 + INTLEN + 3;
-+    char *string = malloc(len);
-+    snprintf(string, len, "crossfade \"%i\"\n", seconds);
-+    mpd_executeCommand(connection, string);
-+    free(string);
-+}
-+
-+void mpd_sendPasswordCommand(mpd_Connection * connection, const char *pass)
-+{
-+    char *sPass = mpd_sanitizeArg(pass);
-+    int len = strlen("password") + 2 + strlen(sPass) + 3;
-+    char *string = malloc(len);
-+    snprintf(string, len, "password \"%s\"\n", sPass);
-+    mpd_executeCommand(connection, string);
-+    free(string);
-+    free(sPass);
-+}
-+
-+void mpd_sendCommandListBegin(mpd_Connection * connection)
-+{
-+    if (connection->commandList) {
-+	strcpy(connection->errorStr, "already in command list mode");
-+	connection->error = 1;
-+	return;
-+    }
-+    connection->commandList = COMMAND_LIST;
-+    mpd_executeCommand(connection, "command_list_begin\n");
-+}
-+
-+void mpd_sendCommandListOkBegin(mpd_Connection * connection)
-+{
-+    if (connection->commandList) {
-+	strcpy(connection->errorStr, "already in command list mode");
-+	connection->error = 1;
-+	return;
-+    }
-+    connection->commandList = COMMAND_LIST_OK;
-+    mpd_executeCommand(connection, "command_list_ok_begin\n");
-+    connection->listOks = 0;
-+}
-+
-+void mpd_sendCommandListEnd(mpd_Connection * connection)
-+{
-+    if (!connection->commandList) {
-+	strcpy(connection->errorStr, "not in command list mode");
-+	connection->error = 1;
-+	return;
-+    }
-+    connection->commandList = 0;
-+    mpd_executeCommand(connection, "command_list_end\n");
-+}
-+
-+void mpd_sendOutputsCommand(mpd_Connection * connection)
-+{
-+    mpd_executeCommand(connection, "outputs\n");
-+}
-+
-+mpd_OutputEntity *mpd_getNextOutput(mpd_Connection * connection)
-+{
-+    mpd_OutputEntity *output = NULL;
-+
-+    if (connection->doneProcessing || (connection->listOks && connection->doneListOk)) {
-+	return NULL;
-+    }
-+
-+    if (connection->error)
-+	return NULL;
-+
-+    output = malloc(sizeof(mpd_OutputEntity));
-+    output->id = -10;
-+    output->name = NULL;
-+    output->enabled = 0;
-+
-+    if (!connection->returnElement)
-+	mpd_getNextReturnElement(connection);
-+
-+    while (connection->returnElement) {
-+	mpd_ReturnElement *re = connection->returnElement;
-+	if (strcmp(re->name, "outputid") == 0) {
-+	    if (output != NULL && output->id >= 0)
-+		return output;
-+	    output->id = atoi(re->value);
-+	} else if (strcmp(re->name, "outputname") == 0) {
-+	    output->name = strdup(re->value);
-+	} else if (strcmp(re->name, "outputenabled") == 0) {
-+	    output->enabled = atoi(re->value);
-+	}
-+
-+	mpd_getNextReturnElement(connection);
-+	if (connection->error) {
-+	    free(output);
-+	    return NULL;
-+	}
-+
-+    }
-+
-+    return output;
-+}
-+
-+void mpd_sendEnableOutputCommand(mpd_Connection * connection, int outputId)
-+{
-+    int len = strlen("enableoutput") + 2 + INTLEN + 3;
-+    char *string = malloc(len);
-+    snprintf(string, len, "enableoutput \"%i\"\n", outputId);
-+    mpd_executeCommand(connection, string);
-+    free(string);
-+}
-+
-+void mpd_sendDisableOutputCommand(mpd_Connection * connection, int outputId)
-+{
-+    int len = strlen("disableoutput") + 2 + INTLEN + 3;
-+    char *string = malloc(len);
-+    snprintf(string, len, "disableoutput \"%i\"\n", outputId);
-+    mpd_executeCommand(connection, string);
-+    free(string);
-+}
-+
-+void mpd_freeOutputElement(mpd_OutputEntity * output)
-+{
-+    free(output->name);
-+    free(output);
-+}
-+
-+/**
-+ * mpd_sendNotCommandsCommand
-+ * odd naming, but it gets the not allowed commands
-+ */
-+
-+void mpd_sendNotCommandsCommand(mpd_Connection * connection)
-+{
-+    mpd_executeCommand(connection, "notcommands\n");
-+}
-+
-+/**
-+ * mpd_sendCommandsCommand
-+ * odd naming, but it gets the allowed commands
-+ */
-+void mpd_sendCommandsCommand(mpd_Connection * connection)
-+{
-+    mpd_executeCommand(connection, "commands\n");
-+}
-+
-+/**
-+ * Get the next returned command
-+ */
-+char *mpd_getNextCommand(mpd_Connection * connection)
-+{
-+    return mpd_getNextReturnElementNamed(connection, "command");
-+}
-+
-+void mpd_sendUrlHandlersCommand(mpd_Connection * connection)
-+{
-+    mpd_executeCommand(connection, "urlhandlers\n");
-+}
-+
-+char *mpd_getNextHandler(mpd_Connection * connection)
-+{
-+    return mpd_getNextReturnElementNamed(connection, "handler");
-+}
-+
-+void mpd_sendTagTypesCommand(mpd_Connection * connection)
-+{
-+    mpd_executeCommand(connection, "tagtypes\n");
-+}
-+
-+char *mpd_getNextTagType(mpd_Connection * connection)
-+{
-+    return mpd_getNextReturnElementNamed(connection, "tagtype");
-+}
-+
-+void mpd_startSearch(mpd_Connection * connection, int exact)
-+{
-+    if (connection->request) {
-+	strcpy(connection->errorStr, "search already in progress");
-+	connection->error = 1;
-+	return;
-+    }
-+
-+    if (exact)
-+	connection->request = strdup("find");
-+    else
-+	connection->request = strdup("search");
-+}
-+
-+void mpd_startStatsSearch(mpd_Connection * connection)
-+{
-+    if (connection->request) {
-+	strcpy(connection->errorStr, "search already in progress");
-+	connection->error = 1;
-+	return;
-+    }
-+
-+    connection->request = strdup("count");
-+}
-+
-+void mpd_startPlaylistSearch(mpd_Connection * connection, int exact)
-+{
-+    if (connection->request) {
-+	strcpy(connection->errorStr, "search already in progress");
-+	connection->error = 1;
-+	return;
-+    }
-+
-+    if (exact)
-+	connection->request = strdup("playlistfind");
-+    else
-+	connection->request = strdup("playlistsearch");
-+}
-+
-+void mpd_startFieldSearch(mpd_Connection * connection, int type)
-+{
-+    char *strtype;
-+    int len;
-+
-+    if (connection->request) {
-+	strcpy(connection->errorStr, "search already in progress");
-+	connection->error = 1;
-+	return;
-+    }
-+
-+    if (type < 0 || type >= MPD_TAG_NUM_OF_ITEM_TYPES) {
-+	strcpy(connection->errorStr, "invalid type specified");
-+	connection->error = 1;
-+	return;
-+    }
-+
-+    strtype = mpdTagItemKeys[type];
-+
-+    len = 5 + strlen(strtype) + 1;
-+    connection->request = malloc(len);
-+
-+    snprintf(connection->request, len, "list %c%s", tolower(strtype[0]), strtype + 1);
-+}
-+
-+void mpd_addConstraintSearch(mpd_Connection * connection, int type, const char *name)
-+{
-+    char *strtype;
-+    char *arg;
-+    int len;
-+    char *string;
-+
-+    if (!connection->request) {
-+	strcpy(connection->errorStr, "no search in progress");
-+	connection->error = 1;
-+	return;
-+    }
-+
-+    if (type < 0 || type >= MPD_TAG_NUM_OF_ITEM_TYPES) {
-+	strcpy(connection->errorStr, "invalid type specified");
-+	connection->error = 1;
-+	return;
-+    }
-+
-+    if (name == NULL) {
-+	strcpy(connection->errorStr, "no name specified");
-+	connection->error = 1;
-+	return;
-+    }
-+
-+    string = strdup(connection->request);
-+    strtype = mpdTagItemKeys[type];
-+    arg = mpd_sanitizeArg(name);
-+
-+    len = strlen(string) + 1 + strlen(strtype) + 2 + strlen(arg) + 2;
-+    connection->request = realloc(connection->request, len);
-+    snprintf(connection->request, len, "%s %c%s \"%s\"", string, tolower(strtype[0]), strtype + 1, arg);
-+
-+    free(string);
-+    free(arg);
-+}
-+
-+void mpd_commitSearch(mpd_Connection * connection)
-+{
-+    int len;
-+
-+    if (!connection->request) {
-+	strcpy(connection->errorStr, "no search in progress");
-+	connection->error = 1;
-+	return;
-+    }
-+
-+    len = strlen(connection->request) + 2;
-+    connection->request = realloc(connection->request, len);
-+    connection->request[len - 2] = '\n';
-+    connection->request[len - 1] = '\0';
-+    mpd_sendInfoCommand(connection, connection->request);
-+
-+    free(connection->request);
-+    connection->request = NULL;
-+}
-+
-+/**
-+ * @param connection a MpdConnection
-+ * @param path	the path to the playlist.
-+ *
-+ * List the content, with full metadata, of a stored playlist.
-+ *
-+ */
-+void mpd_sendListPlaylistInfoCommand(mpd_Connection * connection, char *path)
-+{
-+    char *arg = mpd_sanitizeArg(path);
-+    int len = strlen("listplaylistinfo") + 2 + strlen(arg) + 3;
-+    char *query = malloc(len);
-+    snprintf(query, len, "listplaylistinfo \"%s\"\n", arg);
-+    mpd_sendInfoCommand(connection, query);
-+    free(arg);
-+    free(query);
-+}
-+
-+/**
-+ * @param connection a MpdConnection
-+ * @param path	the path to the playlist.
-+ *
-+ * List the content of a stored playlist.
-+ *
-+ */
-+void mpd_sendListPlaylistCommand(mpd_Connection * connection, char *path)
-+{
-+    char *arg = mpd_sanitizeArg(path);
-+    int len = strlen("listplaylist") + 2 + strlen(arg) + 3;
-+    char *query = malloc(len);
-+    snprintf(query, len, "listplaylist \"%s\"\n", arg);
-+    mpd_sendInfoCommand(connection, query);
-+    free(arg);
-+    free(query);
-+}
-+
-+void mpd_sendPlaylistClearCommand(mpd_Connection * connection, char *path)
-+{
-+    char *sPath = mpd_sanitizeArg(path);
-+    int len = strlen("playlistclear") + 2 + strlen(sPath) + 3;
-+    char *string = malloc(len);
-+    snprintf(string, len, "playlistclear \"%s\"\n", sPath);
-+    mpd_executeCommand(connection, string);
-+    free(sPath);
-+    free(string);
-+}
-+
-+void mpd_sendPlaylistAddCommand(mpd_Connection * connection, char *playlist, char *path)
-+{
-+    char *sPlaylist = mpd_sanitizeArg(playlist);
-+    char *sPath = mpd_sanitizeArg(path);
-+    int len = strlen("playlistadd") + 2 + strlen(sPlaylist) + 3 + strlen(sPath) + 3;
-+    char *string = malloc(len);
-+    snprintf(string, len, "playlistadd \"%s\" \"%s\"\n", sPlaylist, sPath);
-+    mpd_executeCommand(connection, string);
-+    free(sPlaylist);
-+    free(sPath);
-+    free(string);
-+}
-+
-+void mpd_sendPlaylistMoveCommand(mpd_Connection * connection, char *playlist, int from, int to)
-+{
-+    char *sPlaylist = mpd_sanitizeArg(playlist);
-+    int len = strlen("playlistmove") + 2 + strlen(sPlaylist) + 3 + INTLEN + 3 + INTLEN + 3;
-+    char *string = malloc(len);
-+    snprintf(string, len, "playlistmove \"%s\" \"%i\" \"%i\"\n", sPlaylist, from, to);
-+    mpd_executeCommand(connection, string);
-+    free(sPlaylist);
-+    free(string);
-+}
-+
-+void mpd_sendPlaylistDeleteCommand(mpd_Connection * connection, char *playlist, int pos)
-+{
-+    char *sPlaylist = mpd_sanitizeArg(playlist);
-+    int len = strlen("playlistdelete") + 2 + strlen(sPlaylist) + 3 + INTLEN + 3;
-+    char *string = malloc(len);
-+    snprintf(string, len, "playlistdelete \"%s\" \"%i\"\n", sPlaylist, pos);
-+    mpd_executeCommand(connection, string);
-+    free(sPlaylist);
-+    free(string);
-+}
---- /dev/null
-+++ b/libmpdclient.h
-@@ -0,0 +1,661 @@
-+/* libmpdclient
-+   (c)2003-2006 by Warren Dukes (warren.dukes@gmail.com)
-+   This project's homepage is: http://www.musicpd.org
-+
-+   Redistribution and use in source and binary forms, with or without
-+   modification, are permitted provided that the following conditions
-+   are met:
-+
-+   - Redistributions of source code must retain the above copyright
-+   notice, this list of conditions and the following disclaimer.
-+
-+   - Redistributions in binary form must reproduce the above copyright
-+   notice, this list of conditions and the following disclaimer in the
-+   documentation and/or other materials provided with the distribution.
-+
-+   - Neither the name of the Music Player Daemon nor the names of its
-+   contributors may be used to endorse or promote products derived from
-+   this software without specific prior written permission.
-+
-+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-+   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-+   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-+   A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR
-+   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-+   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-+   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-+   PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-+   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-+   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-+   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-+*/
-+
-+#ifndef LIBMPDCLIENT_H
-+#define LIBMPDCLIENT_H
-+
-+#ifdef WIN32
-+#  define __W32API_USE_DLLIMPORT__ 1
-+#endif
-+
-+#include <sys/time.h>
-+#include <stdarg.h>
-+#define MPD_BUFFER_MAX_LENGTH	50000
-+#define MPD_ERRORSTR_MAX_LENGTH	1000
-+#define MPD_WELCOME_MESSAGE	"OK MPD "
-+
-+#define MPD_ERROR_TIMEOUT	10	/* timeout trying to talk to mpd */
-+#define MPD_ERROR_SYSTEM	11	/* system error */
-+#define MPD_ERROR_UNKHOST	12	/* unknown host */
-+#define MPD_ERROR_CONNPORT	13	/* problems connecting to port on host */
-+#define MPD_ERROR_NOTMPD	14	/* mpd not running on port at host */
-+#define MPD_ERROR_NORESPONSE	15	/* no response on attempting to connect */
-+#define MPD_ERROR_SENDING	16	/* error sending command */
-+#define MPD_ERROR_CONNCLOSED	17	/* connection closed by mpd */
-+#define MPD_ERROR_ACK		18	/* ACK returned! */
-+#define MPD_ERROR_BUFFEROVERRUN	19	/* Buffer was overrun! */
-+
-+#define MPD_ACK_ERROR_UNK	-1
-+#define MPD_ERROR_AT_UNK	-1
-+
-+#define MPD_ACK_ERROR_NOT_LIST			1
-+#define MPD_ACK_ERROR_ARG			2
-+#define MPD_ACK_ERROR_PASSWORD			3
-+#define MPD_ACK_ERROR_PERMISSION		4
-+#define MPD_ACK_ERROR_UNKNOWN_CMD		5
-+
-+#define MPD_ACK_ERROR_NO_EXIST			50
-+#define MPD_ACK_ERROR_PLAYLIST_MAX		51
-+#define MPD_ACK_ERROR_SYSTEM			52
-+#define MPD_ACK_ERROR_PLAYLIST_LOAD		53
-+#define MPD_ACK_ERROR_UPDATE_ALREADY		54
-+#define MPD_ACK_ERROR_PLAYER_SYNC		55
-+#define MPD_ACK_ERROR_EXIST			56
-+
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-+
-+    typedef enum mpd_TagItems {
-+	MPD_TAG_ITEM_ARTIST,
-+	MPD_TAG_ITEM_ALBUM,
-+	MPD_TAG_ITEM_TITLE,
-+	MPD_TAG_ITEM_TRACK,
-+	MPD_TAG_ITEM_NAME,
-+	MPD_TAG_ITEM_GENRE,
-+	MPD_TAG_ITEM_DATE,
-+	MPD_TAG_ITEM_COMPOSER,
-+	MPD_TAG_ITEM_PERFORMER,
-+	MPD_TAG_ITEM_COMMENT,
-+	MPD_TAG_ITEM_DISC,
-+	MPD_TAG_ITEM_FILENAME,
-+	MPD_TAG_ITEM_ANY,
-+	MPD_TAG_NUM_OF_ITEM_TYPES
-+    } mpd_TagItems;
-+
-+    extern char *mpdTagItemKeys[MPD_TAG_NUM_OF_ITEM_TYPES];
-+
-+/* internal stuff don't touch this struct */
-+    typedef struct _mpd_ReturnElement {
-+	char *name;
-+	char *value;
-+    } mpd_ReturnElement;
-+
-+/* mpd_Connection
-+ * holds info about connection to mpd
-+ * use error, and errorStr to detect errors
-+ */
-+    typedef struct _mpd_Connection {
-+	/* use this to check the version of mpd */
-+	int version[3];
-+	/* IMPORTANT, you want to get the error messages from here */
-+	char errorStr[MPD_ERRORSTR_MAX_LENGTH + 1];
-+	int errorCode;
-+	int errorAt;
-+	/* this will be set to MPD_ERROR_* if there is an error, 0 if not */
-+	int error;
-+	/* DON'T TOUCH any of the rest of this stuff */
-+	int sock;
-+	char buffer[MPD_BUFFER_MAX_LENGTH + 1];
-+	int buflen;
-+	int bufstart;
-+	int doneProcessing;
-+	int listOks;
-+	int doneListOk;
-+	int commandList;
-+	mpd_ReturnElement *returnElement;
-+	struct timeval timeout;
-+	char *request;
-+    } mpd_Connection;
-+
-+/* mpd_newConnection
-+ * use this to open a new connection
-+ * you should use mpd_closeConnection, when your done with the connection,
-+ * even if an error has occurred
-+ * _timeout_ is the connection timeout period in seconds
-+ */
-+    mpd_Connection *mpd_newConnection(const char *host, int port, float timeout);
-+
-+    void mpd_setConnectionTimeout(mpd_Connection * connection, float timeout);
-+
-+/* mpd_closeConnection
-+ * use this to close a connection and free'ing subsequent memory
-+ */
-+    void mpd_closeConnection(mpd_Connection * connection);
-+
-+/* mpd_clearError
-+ * clears error
-+ */
-+    void mpd_clearError(mpd_Connection * connection);
-+
-+/* STATUS STUFF */
-+
-+/* use these with status.state to determine what state the player is in */
-+#define MPD_STATUS_STATE_UNKNOWN	0
-+#define MPD_STATUS_STATE_STOP		1
-+#define MPD_STATUS_STATE_PLAY		2
-+#define MPD_STATUS_STATE_PAUSE		3
-+
-+/* us this with status.volume to determine if mpd has volume support */
-+#define MPD_STATUS_NO_VOLUME		-1
-+
-+/* mpd_Status
-+ * holds info return from status command
-+ */
-+    typedef struct mpd_Status {
-+	/* 0-100, or MPD_STATUS_NO_VOLUME when there is no volume support */
-+	int volume;
-+	/* 1 if repeat is on, 0 otherwise */
-+	int repeat;
-+	/* 1 if random is on, 0 otherwise */
-+	int random;
-+	/* playlist length */
-+	int playlistLength;
-+	/* playlist, use this to determine when the playlist has changed */
-+	long long playlist;
-+	/* use with MPD_STATUS_STATE_* to determine state of player */
-+	int state;
-+	/* crossfade setting in seconds */
-+	int crossfade;
-+	/* if a song is currently selected (always the case when state is
-+	 * PLAY or PAUSE), this is the position of the currently
-+	 * playing song in the playlist, beginning with 0
-+	 */
-+	int song;
-+	/* Song ID of the currently selected song */
-+	int songid;
-+	/* time in seconds that have elapsed in the currently playing/paused
-+	 * song
-+	 */
-+	int elapsedTime;
-+	/* length in seconds of the currently playing/paused song */
-+	int totalTime;
-+	/* current bit rate in kbs */
-+	int bitRate;
-+	/* audio sample rate */
-+	unsigned int sampleRate;
-+	/* audio bits */
-+	int bits;
-+	/* audio channels */
-+	int channels;
-+	/* 1 if mpd is updating, 0 otherwise */
-+	int updatingDb;
-+	/* error */
-+	char *error;
-+    } mpd_Status;
-+
-+    void mpd_sendStatusCommand(mpd_Connection * connection);
-+
-+/* mpd_getStatus
-+ * returns status info, be sure to free it with mpd_freeStatus()
-+ * call this after mpd_sendStatusCommand()
-+ */
-+    mpd_Status *mpd_getStatus(mpd_Connection * connection);
-+
-+/* mpd_freeStatus
-+ * free's status info malloc'd and returned by mpd_getStatus
-+ */
-+    void mpd_freeStatus(mpd_Status * status);
-+
-+    typedef struct _mpd_Stats {
-+	int numberOfArtists;
-+	int numberOfAlbums;
-+	int numberOfSongs;
-+	unsigned long uptime;
-+	unsigned long dbUpdateTime;
-+	unsigned long playTime;
-+	unsigned long dbPlayTime;
-+    } mpd_Stats;
-+
-+    typedef struct _mpd_SearchStats {
-+	int numberOfSongs;
-+	unsigned long playTime;
-+    } mpd_SearchStats;
-+
-+    void mpd_sendStatsCommand(mpd_Connection * connection);
-+
-+    mpd_Stats *mpd_getStats(mpd_Connection * connection);
-+
-+    void mpd_freeStats(mpd_Stats * stats);
-+
-+    mpd_SearchStats *mpd_getSearchStats(mpd_Connection * connection);
-+
-+    void mpd_freeSearchStats(mpd_SearchStats * stats);
-+
-+/* SONG STUFF */
-+
-+#define MPD_SONG_NO_TIME	-1
-+#define MPD_SONG_NO_NUM		-1
-+#define MPD_SONG_NO_ID		-1
-+
-+/* mpd_Song
-+ * for storing song info returned by mpd
-+ */
-+    typedef struct _mpd_Song {
-+	/* filename of song */
-+	char *file;
-+	/* artist, maybe NULL if there is no tag */
-+	char *artist;
-+	/* title, maybe NULL if there is no tag */
-+	char *title;
-+	/* album, maybe NULL if there is no tag */
-+	char *album;
-+	/* track, maybe NULL if there is no tag */
-+	char *track;
-+	/* name, maybe NULL if there is no tag; it's the name of the current
-+	 * song, f.e. the icyName of the stream */
-+	char *name;
-+	/* date */
-+	char *date;
-+
-+	/* added by qball */
-+	/* Genre */
-+	char *genre;
-+	/* Composer */
-+	char *composer;
-+	/* Performer */
-+	char *performer;
-+	/* Disc */
-+	char *disc;
-+	/* Comment */
-+	char *comment;
-+
-+	/* length of song in seconds, check that it is not MPD_SONG_NO_TIME  */
-+	int time;
-+	/* if plchanges/playlistinfo/playlistid used, is the position of the
-+	 * song in the playlist */
-+	int pos;
-+	/* song id for a song in the playlist */
-+	int id;
-+    } mpd_Song;
-+
-+/* mpd_newSong
-+ * use to allocate memory for a new mpd_Song
-+ * file, artist, etc all initialized to NULL
-+ * if your going to assign values to file, artist, etc
-+ * be sure to malloc or strdup the memory
-+ * use mpd_freeSong to free the memory for the mpd_Song, it will also
-+ * free memory for file, artist, etc, so don't do it yourself
-+ */
-+    mpd_Song *mpd_newSong(void);
-+
-+/* mpd_freeSong
-+ * use to free memory allocated by mpd_newSong
-+ * also it will free memory pointed to by file, artist, etc, so be careful
-+ */
-+    void mpd_freeSong(mpd_Song * song);
-+
-+/* mpd_songDup
-+ * works like strDup, but for a mpd_Song
-+ */
-+    mpd_Song *mpd_songDup(mpd_Song * song);
-+
-+/* DIRECTORY STUFF */
-+
-+/* mpd_Directory
-+ * used to store info fro directory (right now that just the path)
-+ */
-+    typedef struct _mpd_Directory {
-+	char *path;
-+    } mpd_Directory;
-+
-+/* mpd_newDirectory
-+ * allocates memory for a new directory
-+ * use mpd_freeDirectory to free this memory
-+ */
-+    mpd_Directory *mpd_newDirectory(void);
-+
-+/* mpd_freeDirectory
-+ * used to free memory allocated with mpd_newDirectory, and it frees
-+ * path of mpd_Directory, so be careful
-+ */
-+    void mpd_freeDirectory(mpd_Directory * directory);
-+
-+/* mpd_directoryDup
-+ * works like strdup, but for mpd_Directory
-+ */
-+    mpd_Directory *mpd_directoryDup(mpd_Directory * directory);
-+
-+/* PLAYLISTFILE STUFF */
-+
-+/* mpd_PlaylistFile
-+ * stores info about playlist file returned by lsinfo
-+ */
-+    typedef struct _mpd_PlaylistFile {
-+	char *path;
-+    } mpd_PlaylistFile;
-+
-+/* mpd_newPlaylistFile
-+ * allocates memory for new mpd_PlaylistFile, path is set to NULL
-+ * free this memory with mpd_freePlaylistFile
-+ */
-+    mpd_PlaylistFile *mpd_newPlaylistFile(void);
-+
-+/* mpd_freePlaylist
-+ * free memory allocated for freePlaylistFile, will also free
-+ * path, so be careful
-+ */
-+    void mpd_freePlaylistFile(mpd_PlaylistFile * playlist);
-+
-+/* mpd_playlistFileDup
-+ * works like strdup, but for mpd_PlaylistFile
-+ */
-+    mpd_PlaylistFile *mpd_playlistFileDup(mpd_PlaylistFile * playlist);
-+
-+/* INFO ENTITY STUFF */
-+
-+/* the type of entity returned from one of the commands that generates info
-+ * use in conjunction with mpd_InfoEntity.type
-+ */
-+#define MPD_INFO_ENTITY_TYPE_DIRECTORY		0
-+#define MPD_INFO_ENTITY_TYPE_SONG		1
-+#define MPD_INFO_ENTITY_TYPE_PLAYLISTFILE	2
-+
-+/* mpd_InfoEntity
-+ * stores info on stuff returned info commands
-+ */
-+    typedef struct mpd_InfoEntity {
-+	/* the type of entity, use with MPD_INFO_ENTITY_TYPE_* to determine
-+	 * what this entity is (song, directory, etc...)
-+	 */
-+	int type;
-+	/* the actual data you want, mpd_Song, mpd_Directory, etc */
-+	union {
-+	    mpd_Directory *directory;
-+	    mpd_Song *song;
-+	    mpd_PlaylistFile *playlistFile;
-+	} info;
-+    } mpd_InfoEntity;
-+
-+    mpd_InfoEntity *mpd_newInfoEntity(void);
-+
-+    void mpd_freeInfoEntity(mpd_InfoEntity * entity);
-+
-+/* INFO COMMANDS AND STUFF */
-+
-+/* use this function to loop over after calling Info/Listall functions */
-+    mpd_InfoEntity *mpd_getNextInfoEntity(mpd_Connection * connection);
-+
-+/* fetches the currently seeletect song (the song referenced by status->song
-+ * and status->songid*/
-+    void mpd_sendCurrentSongCommand(mpd_Connection * connection);
-+
-+/* songNum of -1, means to display the whole list */
-+    void mpd_sendPlaylistInfoCommand(mpd_Connection * connection, int songNum);
-+
-+/* songId of -1, means to display the whole list */
-+    void mpd_sendPlaylistIdCommand(mpd_Connection * connection, int songId);
-+
-+/* use this to get the changes in the playlist since version _playlist_ */
-+    void mpd_sendPlChangesCommand(mpd_Connection * connection, long long playlist);
-+
-+/**
-+ * @param connection: A valid and connected mpd_Connection.
-+ * @param playlist: The playlist version you want the diff with.
-+ * A more bandwidth efficient version of the mpd_sendPlChangesCommand.
-+ * It only returns the pos+id of the changes song.
-+ */
-+    void mpd_sendPlChangesPosIdCommand(mpd_Connection * connection, long long playlist);
-+
-+/* recursivel fetches all songs/dir/playlists in "dir* (no metadata is
-+ * returned) */
-+    void mpd_sendListallCommand(mpd_Connection * connection, const char *dir);
-+
-+/* same as sendListallCommand, but also metadata is returned */
-+    void mpd_sendListallInfoCommand(mpd_Connection * connection, const char *dir);
-+
-+/* non-recursive version of ListallInfo */
-+    void mpd_sendLsInfoCommand(mpd_Connection * connection, const char *dir);
-+
-+#define MPD_TABLE_ARTIST	MPD_TAG_ITEM_ARTIST
-+#define MPD_TABLE_ALBUM		MPD_TAG_ITEM_ALBUM
-+#define MPD_TABLE_TITLE		MPD_TAG_ITEM_TITLE
-+#define MPD_TABLE_FILENAME	MPD_TAG_ITEM_FILENAME
-+
-+    void mpd_sendSearchCommand(mpd_Connection * connection, int table, const char *str);
-+
-+    void mpd_sendFindCommand(mpd_Connection * connection, int table, const char *str);
-+
-+/* LIST TAG COMMANDS */
-+
-+/* use this function fetch next artist entry, be sure to free the returned
-+ * string.  NULL means there are no more.  Best used with sendListArtists
-+ */
-+    char *mpd_getNextArtist(mpd_Connection * connection);
-+
-+    char *mpd_getNextAlbum(mpd_Connection * connection);
-+
-+    char *mpd_getNextTag(mpd_Connection * connection, int type);
-+
-+/* list artist or albums by artist, arg1 should be set to the artist if
-+ * listing albums by a artist, otherwise NULL for listing all artists or albums
-+ */
-+    void mpd_sendListCommand(mpd_Connection * connection, int table, const char *arg1);
-+
-+/* SIMPLE COMMANDS */
-+
-+    void mpd_sendAddCommand(mpd_Connection * connection, const char *file);
-+
-+    int mpd_sendAddIdCommand(mpd_Connection * connection, const char *file);
-+
-+    void mpd_sendDeleteCommand(mpd_Connection * connection, int songNum);
-+
-+    void mpd_sendDeleteIdCommand(mpd_Connection * connection, int songNum);
-+
-+    void mpd_sendSaveCommand(mpd_Connection * connection, const char *name);
-+
-+    void mpd_sendLoadCommand(mpd_Connection * connection, const char *name);
-+
-+    void mpd_sendRmCommand(mpd_Connection * connection, const char *name);
-+
-+    void mpd_sendRenameCommand(mpd_Connection * connection, const char *from, const char *to);
-+
-+    void mpd_sendShuffleCommand(mpd_Connection * connection);
-+
-+    void mpd_sendClearCommand(mpd_Connection * connection);
-+
-+/* use this to start playing at the beginning, useful when in random mode */
-+#define MPD_PLAY_AT_BEGINNING	-1
-+
-+    void mpd_sendPlayCommand(mpd_Connection * connection, int songNum);
-+
-+    void mpd_sendPlayIdCommand(mpd_Connection * connection, int songNum);
-+
-+    void mpd_sendStopCommand(mpd_Connection * connection);
-+
-+    void mpd_sendPauseCommand(mpd_Connection * connection, int pauseMode);
-+
-+    void mpd_sendNextCommand(mpd_Connection * connection);
-+
-+    void mpd_sendPrevCommand(mpd_Connection * connection);
-+
-+    void mpd_sendMoveCommand(mpd_Connection * connection, int from, int to);
-+
-+    void mpd_sendMoveIdCommand(mpd_Connection * connection, int from, int to);
-+
-+    void mpd_sendSwapCommand(mpd_Connection * connection, int song1, int song2);
-+
-+    void mpd_sendSwapIdCommand(mpd_Connection * connection, int song1, int song2);
-+
-+    void mpd_sendSeekCommand(mpd_Connection * connection, int song, int time);
-+
-+    void mpd_sendSeekIdCommand(mpd_Connection * connection, int song, int time);
-+
-+    void mpd_sendRepeatCommand(mpd_Connection * connection, int repeatMode);
-+
-+    void mpd_sendRandomCommand(mpd_Connection * connection, int randomMode);
-+
-+    void mpd_sendSetvolCommand(mpd_Connection * connection, int volumeChange);
-+
-+/* WARNING: don't use volume command, its depreacted */
-+    void mpd_sendVolumeCommand(mpd_Connection * connection, int volumeChange);
-+
-+    void mpd_sendCrossfadeCommand(mpd_Connection * connection, int seconds);
-+
-+    void mpd_sendUpdateCommand(mpd_Connection * connection, char *path);
-+
-+/* returns the update job id, call this after a update command*/
-+    int mpd_getUpdateId(mpd_Connection * connection);
-+
-+    void mpd_sendPasswordCommand(mpd_Connection * connection, const char *pass);
-+
-+/* after executing a command, when your done with it to get its status
-+ * (you want to check connection->error for an error)
-+ */
-+    void mpd_finishCommand(mpd_Connection * connection);
-+
-+/* command list stuff, use this to do things like add files very quickly */
-+    void mpd_sendCommandListBegin(mpd_Connection * connection);
-+
-+    void mpd_sendCommandListOkBegin(mpd_Connection * connection);
-+
-+    void mpd_sendCommandListEnd(mpd_Connection * connection);
-+
-+/* advance to the next listOk
-+ * returns 0 if advanced to the next list_OK,
-+ * returns -1 if it advanced to an OK or ACK */
-+    int mpd_nextListOkCommand(mpd_Connection * connection);
-+
-+    typedef struct _mpd_OutputEntity {
-+	int id;
-+	char *name;
-+	int enabled;
-+    } mpd_OutputEntity;
-+
-+    void mpd_sendOutputsCommand(mpd_Connection * connection);
-+
-+    mpd_OutputEntity *mpd_getNextOutput(mpd_Connection * connection);
-+
-+    void mpd_sendEnableOutputCommand(mpd_Connection * connection, int outputId);
-+
-+    void mpd_sendDisableOutputCommand(mpd_Connection * connection, int outputId);
-+
-+    void mpd_freeOutputElement(mpd_OutputEntity * output);
-+
-+/**
-+ * @param connection a #mpd_Connection
-+ *
-+ * Queries mpd for the allowed commands
-+ */
-+    void mpd_sendCommandsCommand(mpd_Connection * connection);
-+
-+/**
-+ * @param connection a #mpd_Connection
-+ *
-+ * Queries mpd for the not allowed commands
-+ */
-+    void mpd_sendNotCommandsCommand(mpd_Connection * connection);
-+
-+/**
-+ * @param connection a #mpd_Connection
-+ *
-+ * returns the next supported command.
-+ *
-+ * @returns a string, needs to be free'ed
-+ */
-+    char *mpd_getNextCommand(mpd_Connection * connection);
-+
-+    void mpd_sendUrlHandlersCommand(mpd_Connection * connection);
-+
-+    char *mpd_getNextHandler(mpd_Connection * connection);
-+
-+    void mpd_sendTagTypesCommand(mpd_Connection * connection);
-+
-+    char *mpd_getNextTagType(mpd_Connection * connection);
-+
-+/**
-+ * @param connection a MpdConnection
-+ * @param path	the path to the playlist.
-+ *
-+ * List the content, with full metadata, of a stored playlist.
-+ *
-+ */
-+    void mpd_sendListPlaylistInfoCommand(mpd_Connection * connection, char *path);
-+
-+/**
-+ * @param connection a MpdConnection
-+ * @param path	the path to the playlist.
-+ *
-+ * List the content of a stored playlist.
-+ *
-+ */
-+    void mpd_sendListPlaylistCommand(mpd_Connection * connection, char *path);
-+
-+/**
-+ * @param connection a #mpd_Connection
-+ * @param exact if to match exact
-+ *
-+ * starts a search, use mpd_addConstraintSearch to add
-+ * a constraint to the search, and mpd_commitSearch to do the actual search
-+ */
-+    void mpd_startSearch(mpd_Connection * connection, int exact);
-+
-+/**
-+ * @param connection a #mpd_Connection
-+ * @param type
-+ * @param name
-+ */
-+    void mpd_addConstraintSearch(mpd_Connection * connection, int type, const char *name);
-+
-+/**
-+ * @param connection a #mpd_Connection
-+ */
-+    void mpd_commitSearch(mpd_Connection * connection);
-+
-+/**
-+ * @param connection a #mpd_Connection
-+ * @param type The type to search for
-+ *
-+ * starts a search for fields... f.e. get a list of artists would be:
-+ * @code
-+ * mpd_startFieldSearch(connection, MPD_TAG_ITEM_ARTIST);
-+ * mpd_commitSearch(connection);
-+ * @endcode
-+ *
-+ * or get a list of artist in genre "jazz" would be:
-+ * @code
-+ * mpd_startFieldSearch(connection, MPD_TAG_ITEM_ARTIST);
-+ * mpd_addConstraintSearch(connection, MPD_TAG_ITEM_GENRE, "jazz")
-+ * mpd_commitSearch(connection);
-+ * @endcode
-+ *
-+ * mpd_startSearch will return  a list of songs (and you need mpd_getNextInfoEntity)
-+ * this one will return a list of only one field (the one specified with type) and you need
-+ * mpd_getNextTag to get the results
-+ */
-+    void mpd_startFieldSearch(mpd_Connection * connection, int type);
-+
-+    void mpd_startPlaylistSearch(mpd_Connection * connection, int exact);
-+
-+    void mpd_startStatsSearch(mpd_Connection * connection);
-+
-+    void mpd_sendPlaylistClearCommand(mpd_Connection * connection, char *path);
-+
-+    void mpd_sendPlaylistAddCommand(mpd_Connection * connection, char *playlist, char *path);
-+
-+    void mpd_sendPlaylistMoveCommand(mpd_Connection * connection, char *playlist, int from, int to);
-+
-+    void mpd_sendPlaylistDeleteCommand(mpd_Connection * connection, char *playlist, int pos);
-+#ifdef __cplusplus
-+}
-+#endif
-+#endif
 

--- a/utils/lcd4linux/patches/160-uinput_defs.patch
+++ /dev/null
@@ -1,25 +1,1 @@
---- a/drv_G15.c
-+++ b/drv_G15.c
-@@ -42,6 +42,7 @@
- 
- #include <usb.h>
- #include <fcntl.h>
-+#include <linux/version.h>
- #include <linux/input.h>
- #include <linux/uinput.h>
- 
-@@ -269,8 +270,13 @@ void drv_G15_initKeyHandling(char *devic
-     }
-     memset(&device, 0, sizeof(device));
-     strncpy(device.name, "G15 Keys", UINPUT_MAX_NAME_SIZE);
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-     device.id.bustype = BUS_USB;
-     device.id.version = 4;
-+#else
-+    device.idbus = BUS_USB;
-+    device.idversion = 4;
-+#endif
- 
-     ioctl(uinput_fd, UI_SET_EVBIT, EV_KEY);
- 
 

--- a/utils/lcd4linux/patches/170-add-generic-spidev-driver.patch
+++ /dev/null
@@ -1,196 +1,1 @@
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -71,6 +71,8 @@ drv_generic_i2c.c             \
- drv_generic_i2c.h             \
- drv_generic_keypad.c          \
- drv_generic_keypad.h          \
-+drv_generic_spidev.c          \
-+drv_generic_spidev.h          \
- drv_ASTUSB.c                  \
- drv_BeckmannEgle.c            \
- drv_BWCT.c                    \
---- /dev/null
-+++ b/drv_generic_spidev.c
-@@ -0,0 +1,89 @@
-+/* $Id$
-+ * $URL$
-+ *
-+ * generic driver helper for displays connected via SPI bus
-+ *
-+ * Copyright (C) 2012 Gabor Juhos <juhosg@openwrt.org>
-+ *
-+ * This file is part of LCD4Linux.
-+ *
-+ * LCD4Linux is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; either version 2, or (at your option)
-+ * any later version.
-+ *
-+ * LCD4Linux is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-+ *
-+ */
-+
-+#include "config.h"
-+
-+#include <stdlib.h>
-+#include <stdio.h>
-+#include <string.h>
-+#include <errno.h>
-+#include <unistd.h>
-+#include <fcntl.h>
-+#include <sys/types.h>
-+#include <sys/ioctl.h>
-+
-+#include "debug.h"
-+#include "qprintf.h"
-+#include "cfg.h"
-+#include "drv_generic_spidev.h"
-+
-+static char *generic_spidev_section = "";
-+static char *generic_spidev_driver = "";
-+static int generic_spidev_fd;
-+
-+int drv_generic_spidev_open(const char *section, const char *driver)
-+{
-+    char *spidev;
-+
-+    udelay_init();
-+
-+    generic_spidev_section = (char *) section;
-+    generic_spidev_driver = (char *) driver;
-+
-+    spidev = cfg_get(generic_spidev_section, "Port", NULL);
-+
-+    info("%s: initializing SPI device %s", generic_spidev_driver, spidev);
-+    generic_spidev_fd = open(spidev, O_WRONLY);
-+    if (generic_spidev_fd < 0) {
-+	error("%s: unable to open SPI device %s!\n", generic_spidev_driver, spidev);
-+	goto exit_error;
-+    }
-+
-+    return 0;
-+
-+  exit_error:
-+    free(spidev);
-+    return -1;
-+}
-+
-+int drv_generic_spidev_close(void)
-+{
-+    close(generic_spidev_fd);
-+    return 0;
-+}
-+
-+int drv_generic_spidev_transfer(const int count, struct spi_ioc_transfer *tr)
-+{
-+    int ret;
-+
-+    ret = ioctl(generic_spidev_fd, SPI_IOC_MESSAGE(count), tr);
-+    if (ret < count) {
-+	error("%s: can't send SPI message! (%s)\n",
-+		generic_spidev_driver, strerror(errno));
-+	return -1;
-+    }
-+
-+    return 0;
-+}
---- /dev/null
-+++ b/drv_generic_spidev.h
-@@ -0,0 +1,54 @@
-+/* $Id$
-+ * $URL$
-+ *
-+ * generic driver helper for displays connected via SPI bus
-+ *
-+ * Copyright (C) 2012 Gabor Juhos <juhosg@openwrt.org>
-+ * Copyright (C) 2012 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net>
-+ *
-+ * This file is part of LCD4Linux.
-+ *
-+ * LCD4Linux is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; either version 2, or (at your option)
-+ * any later version.
-+ *
-+ * LCD4Linux is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-+ *
-+ */
-+
-+/*
-+ *
-+ * exported fuctions:
-+ *
-+ * int drv_generic_spidev_open (const char *section, const char *driver)
-+ *   reads 'Port' entry from config and opens
-+ *   the SPI device
-+ *   returns 0 if ok, -1 on failure
-+ *
-+ * int drv_generic_spidev_close (void)
-+ *   closes SPI device
-+ *   returns 0 if ok, -1 on failure
-+ *
-+ * void drv_generic_spidev_transfer (int count, struct spi_ioc_transfer *tr)
-+ *   transfer data to/from the SPI device
-+ *
-+ */
-+
-+#ifndef _DRV_GENERIC_SPIDEV_H_
-+#define _DRV_GENERIC_SPIDEV_H_
-+
-+#include <linux/spi/spidev.h>
-+
-+int drv_generic_spidev_open(const char *section, const char *driver);
-+int drv_generic_spidev_close(void);
-+int drv_generic_spidev_transfer(const int count, struct spi_ioc_transfer *tr);
-+
-+#endif /* _DRV_GENERIC_SPIDEV_H_ */
---- a/drivers.m4
-+++ b/drivers.m4
-@@ -301,6 +301,7 @@ PARPORT="no"
- SERIAL="no"
- I2C="no"
- KEYPAD="no"
-+SPIDEV="no"
- 
- # generic libraries
- LIBUSB="no"
-@@ -940,6 +941,12 @@ if test "$LIBJPEG" = "yes"; then
-    DRVLIBS="$DRVLIBS -ljpeg"
- fi
- 
-+# generic spidev driver
-+if test "$SPIDEV" = "yes"; then
-+   DRIVERS="$DRIVERS drv_generic_spidev.o"
-+   AC_DEFINE(WITH_SPIDEV, 1, [SPIDEV driver])
-+fi
-+
- # libusb
- if test "$LIBUSB" = "yes"; then
-    DRVLIBS="$DRVLIBS -lusb"
---- a/configure.in
-+++ b/configure.in
-@@ -118,6 +118,9 @@ AC_ARG_WITH(outb,
- 
- AC_CHECK_HEADERS([asm/io.h] [linux/parport.h linux/ppdev.h], [has_parport="true"], [has_parport="false"])
- 
-+# check for spidev
-+AC_CHECK_HEADERS([linux/spi/spidev.h], [has_spidev="true"], [has_spidev="false"])
-+
- # drivers
- sinclude(drivers.m4)
- 
 

--- a/utils/lcd4linux/patches/171-allow-to-specify-drv_generic_graphic_real_clear.patch
+++ /dev/null
@@ -1,46 +1,1 @@
---- a/drv_generic_graphic.c
-+++ b/drv_generic_graphic.c
-@@ -24,7 +24,7 @@
-  *
-  */
- 
--/* 
-+/*
-  *
-  * exported functions:
-  *
-@@ -98,6 +98,9 @@ static int INVERTED = 0;
- /* must be implemented by the real driver */
- void (*drv_generic_graphic_real_blit) () = NULL;
- 
-+/* can be implemented by the real driver */
-+void (*drv_generic_graphic_real_clear) () = NULL;
-+
- 
- /****************************************/
- /*** generic Framebuffer stuff        ***/
-@@ -691,7 +694,10 @@ int drv_generic_graphic_clear(void)
- 	for (i = 0; i < LCOLS * LROWS; i++)
- 	    drv_generic_graphic_FB[l][i] = NO_COL;
- 
--    drv_generic_graphic_blit(0, 0, LROWS, LCOLS);
-+    if (drv_generic_graphic_real_clear)
-+	drv_generic_graphic_real_clear(NO_COL);
-+    else
-+	drv_generic_graphic_blit(0, 0, LROWS, LCOLS);
- 
-     return 0;
- }
---- a/drv_generic_graphic.h
-+++ b/drv_generic_graphic.h
-@@ -40,6 +40,9 @@ extern RGBA NO_COL;		/* no color (comple
- /* these functions must be implemented by the real driver */
- extern void (*drv_generic_graphic_real_blit) (const int row, const int col, const int height, const int width);
- 
-+/* these functions can be implemented by the real driver */
-+void (*drv_generic_graphic_real_clear) (const RGBA rgba);
-+
- /* helper function to get pixel color or gray value */
- extern RGBA drv_generic_graphic_rgb(const int row, const int col);
- extern unsigned char drv_generic_graphic_gray(const int row, const int col);
 

--- a/utils/lcd4linux/patches/172-add-TEW673GRU-driver.patch
+++ /dev/null
@@ -1,553 +1,1 @@
---- a/drivers.m4
-+++ b/drivers.m4
-@@ -39,7 +39,7 @@ AC_ARG_WITH(
-   [                        Newhaven, Noritake, NULL, Pertelian, PHAnderson,]
-   [                        PICGraphic, picoLCD, picoLCDGraphic, PNG, PPM, RouterBoard,]
-   [                        Sample, SamsungSPF, serdisplib, ShuttleVFD, SimpleLCD, st2205, T6963,]
--  [                        TeakLCM, Trefon, ULA200, USBHUB, USBLCD, VNC, WincorNixdorf, X11],
-+  [                        TeakLCM, TEW673GRU, Trefon, ULA200, USBHUB, USBLCD, VNC, WincorNixdorf, X11],
-   drivers=$withval,
-   drivers=all
- )
-@@ -107,6 +107,7 @@ for driver in $drivers; do
- 	 SHUTTLEVFD="yes"
-          SIMPLELCD="yes"
-          T6963="yes"
-+         TEW673GRU="yes"
-          TeakLCM="yes"
-          Trefon="yes"
-          ULA200="yes"
-@@ -260,6 +261,9 @@ for driver in $drivers; do
-       TeakLCM)
-          TeakLCM=$val
-          ;;
-+      TEW673GRU)
-+         TEW673GRU=$val
-+         ;;
-       Trefon)
-          Trefon=$val
-          ;;
-@@ -801,6 +805,18 @@ if test "$TeakLCM" = "yes"; then
-    AC_DEFINE(WITH_TEAK_LCM,1,[TeakLCM driver])
- fi
- 
-+if test "$TEW673GRU" = "yes"; then
-+   if test "$has_spidev" = "true"; then
-+      GRAPHIC="yes"
-+      TEXT="yes"
-+      SPIDEV="yes"
-+      DRIVERS="$DRIVERS drv_TEW673GRU.o"
-+      AC_DEFINE(WITH_TEW673GRU,1,[TEW673GRU driver])
-+   else
-+      AC_MSG_WARN(linux/spi/spidev.h not found: TEW673GRU driver disabled)
-+   fi
-+fi
-+
- if test "$Trefon" = "yes"; then
-    if test "$has_usb" = "true"; then
-       TEXT="yes"
---- a/drv.c
-+++ b/drv.c
-@@ -92,6 +92,7 @@ extern DRIVER drv_serdisplib;
- extern DRIVER drv_ShuttleVFD;
- extern DRIVER drv_SimpleLCD;
- extern DRIVER drv_T6963;
-+extern DRIVER drv_TEW673GRU;
- extern DRIVER drv_TeakLCM;
- extern DRIVER drv_Trefon;
- extern DRIVER drv_ula200;
-@@ -248,6 +249,9 @@ DRIVER *Driver[] = {
- #ifdef WITH_TEAK_LCM
-     &drv_TeakLCM,
- #endif
-+#ifdef WITH_TEW673GRU
-+    &drv_TEW673GRU,
-+#endif
- #ifdef WITH_TREFON
-     &drv_Trefon,
- #endif
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -119,6 +119,7 @@ drv_ShuttleVFD.c              \
- drv_SimpleLCD.c               \
- drv_T6963.c                   \
- drv_TeakLCM.c                 \
-+drv_TEW673GRU.c               \
- drv_Trefon.c                  \
- drv_ula200.c                  \
- drv_USBHUB.c                  \
---- /dev/null
-+++ b/drv_TEW673GRU.c
-@@ -0,0 +1,457 @@
-+/* $Id$
-+ * $URL$
-+ *
-+ * TRENDnet TEW673GRU LCD4linux driver
-+ *
-+ * Copyright (C) 2012 Gabor Juhos <juhosg@openwrt.org>
-+ *
-+ * based on the Sample driver which is:
-+ * Copyright (C) 2005 Michael Reinelt <michael@reinelt.co.at>
-+ * Copyright (C) 2005, 2006, 2007 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net>
-+ *
-+ * This file is part of LCD4Linux.
-+ *
-+ * LCD4Linux is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; either version 2, or (at your option)
-+ * any later version.
-+ *
-+ * LCD4Linux is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-+ *
-+ */
-+
-+/*
-+ * exported fuctions:
-+ *
-+ * struct DRIVER drv_TEW673GRU
-+ */
-+
-+#include "config.h"
-+
-+#include <stdlib.h>
-+#include <stdio.h>
-+#include <unistd.h>
-+#include <string.h>
-+#include <errno.h>
-+
-+#include "debug.h"
-+#include "cfg.h"
-+#include "qprintf.h"
-+#include "udelay.h"
-+#include "plugin.h"
-+#include "widget.h"
-+#include "widget_text.h"
-+#include "widget_icon.h"
-+#include "widget_bar.h"
-+#include "drv.h"
-+
-+#include "drv_generic_text.h"
-+#include "drv_generic_graphic.h"
-+#include "drv_generic_spidev.h"
-+
-+#ifdef WITH_DMALLOC
-+#include <dmalloc.h>
-+#endif
-+
-+#define TEW673GRU_NUM_COLS	220
-+#define TEW673GRU_NUM_ROWS	176
-+#define TEW673GRU_BPP		2	/* bytes per pixel */
-+
-+#define TEW673GRU_CMD_SIZE	9
-+#define TEW673GRU_NUM_ROW_BYTES (TEW673GRU_NUM_COLS * TEW673GRU_BPP)
-+
-+enum {
-+	CMD_SHOW_STRING		= 49,
-+	CMD_SHOW_IMAGE_DIR	= 52,
-+	CMD_SCREEN_COLOR	= 54,
-+};
-+
-+static char Name[] = "TEW673GRU";
-+
-+static char *drv_TEW673GRU_FB;
-+static long FB_SIZE;
-+static int MODE;
-+
-+static unsigned int RGBAto16(RGBA rgb)
-+{
-+    return (((rgb.R >> 3) << 11) | ((rgb.G >> 2) << 5) | (rgb.B >> 3));
-+}
-+
-+static unsigned char color_msb(unsigned int color)
-+{
-+    return color >> 8;
-+}
-+
-+static unsigned char color_lsb(unsigned int color)
-+{
-+    return color & 0xff;
-+}
-+
-+static void drv_TEW673GRU_hw_clear(const unsigned int color)
-+{
-+    unsigned char cmd[TEW673GRU_CMD_SIZE];
-+    struct spi_ioc_transfer tr[1];
-+
-+    memset(tr, '\0', sizeof(tr));
-+    memset(cmd, '\0', sizeof(cmd));
-+
-+    cmd[0] = CMD_SCREEN_COLOR;
-+    cmd[7] = color_msb(color);
-+    cmd[8] = color_lsb(color);
-+
-+    tr[0].tx_buf = (unsigned long) cmd;
-+    tr[0].len = sizeof(cmd);
-+
-+    drv_generic_spidev_transfer(1, tr);
-+}
-+
-+static void drv_TEW673GRU_hw_send_row(const int row, const int col, const char *data, const int width)
-+{
-+    unsigned char cmd[TEW673GRU_CMD_SIZE];
-+    struct spi_ioc_transfer tr[2];
-+    int datasize;
-+
-+    memset(tr, '\0', sizeof(tr));
-+    memset(cmd, '\0', sizeof(cmd));
-+
-+    datasize =  width * TEW673GRU_BPP;
-+
-+    cmd[0] = CMD_SHOW_IMAGE_DIR;
-+    cmd[1] = col;
-+    cmd[2] = col + width;
-+    cmd[3] = row;
-+    cmd[4] = row;
-+    cmd[5] = datasize >> 8;
-+    cmd[6] = datasize & 0xff;
-+
-+    tr[0].tx_buf = (unsigned long) cmd;
-+    tr[0].len = sizeof(cmd);
-+    tr[1].tx_buf = (unsigned long) data;
-+    tr[1].len = datasize;
-+
-+    drv_generic_spidev_transfer(2, tr);
-+}
-+
-+static void drv_TEW673GRU_hw_write_string(const int row, const int col, const char *data, const int datasize)
-+{
-+    unsigned char cmd[TEW673GRU_CMD_SIZE];
-+    struct spi_ioc_transfer tr[2];
-+    unsigned char len;
-+
-+    memset(tr, '\0', sizeof(tr));
-+    memset(cmd, '\0', sizeof(cmd));
-+
-+    len = datasize & 0xff;
-+    cmd[0] = CMD_SHOW_STRING;
-+    cmd[1] = col;
-+    cmd[2] = col + (XRES * len);
-+    cmd[3] = row;
-+    cmd[4] = row + YRES;
-+    cmd[7] = 0;
-+    cmd[8] = len;
-+
-+    tr[0].tx_buf = (unsigned long) cmd;
-+    tr[0].len = sizeof(cmd);
-+    tr[1].tx_buf = (unsigned long) data;
-+    tr[1].len = datasize;
-+
-+    drv_generic_spidev_transfer(2, tr);
-+}
-+
-+static void drv_TEW673GRU_FB_set_pixel(const int col, const unsigned int color)
-+{
-+    int pos;
-+
-+    pos = col * TEW673GRU_BPP;
-+    drv_TEW673GRU_FB[pos] = color_msb(color);
-+    drv_TEW673GRU_FB[pos + 1] = color_lsb(color);
-+}
-+
-+static void drv_TEW673GRU_blit(const int row, const int col, const int height, const int width)
-+{
-+    int r, c;
-+
-+    debug("%s: update area r:%d c:%d w:%d h:%d", Name, row, col, height, width);
-+
-+    for (r = row; r < row + height; r++) {
-+	for (c = col; c < col + width; c++) {
-+	    unsigned int color;
-+	    RGBA rgb;
-+
-+	    rgb = drv_generic_graphic_rgb(r, c);
-+	    color = RGBAto16(rgb);
-+            drv_TEW673GRU_FB_set_pixel(c, color);
-+	}
-+
-+	if (width) {
-+	    char *data;
-+
-+	    data = &drv_TEW673GRU_FB[col * TEW673GRU_BPP];
-+	    drv_TEW673GRU_hw_send_row(r, col, data, width);
-+	    udelay(100 + width * 50);
-+	}
-+    }
-+}
-+
-+static void drv_TEW673GRU_clear(RGBA rgba)
-+{
-+    unsigned int color;
-+
-+    color = RGBAto16(rgba);
-+    drv_TEW673GRU_hw_clear(color);
-+}
-+
-+static void drv_TEW673GRU_write(const int row, const int col, const char *data, const int len)
-+{
-+    int i;
-+
-+    for (i = 0; i < len; i++) {
-+	drv_TEW673GRU_hw_write_string(row * YRES, (col + i) * XRES, " ", 1);
-+	udelay(10000);
-+	drv_TEW673GRU_hw_write_string(row * YRES, 2 + (col + i) * XRES, " ", 1);
-+	udelay(10000);
-+	drv_TEW673GRU_hw_write_string(row * YRES, (col + i) * XRES, &data[i], 1);
-+	udelay(10000);
-+    }
-+}
-+
-+static int drv_TEW673GRU_open(const char *section)
-+{
-+    int err;
-+
-+    err = drv_generic_spidev_open(section, Name);
-+    if (err < 0)
-+	return err;
-+
-+    return 0;
-+}
-+
-+static int drv_TEW673GRU_close(void)
-+{
-+    drv_generic_spidev_close();
-+    return 0;
-+}
-+
-+static void drv_TEW673GRU_clear_screen(void)
-+{
-+    if (MODE) {
-+	drv_generic_graphic_clear();
-+    } else {
-+	memset(drv_TEW673GRU_FB, ' ', FB_SIZE);
-+	drv_TEW673GRU_hw_clear(0x0000);
-+    }
-+}
-+
-+static int drv_TEW673GRU_init_font(const char *section)
-+{
-+    char *font;
-+    int ret = -1;
-+
-+    font = cfg_get(section, "Font", "6x8");
-+    if (font == NULL) {
-+	error("%s: no '%s.Font' entry from %s", Name, section, cfg_source());
-+	goto out;
-+    }
-+
-+    if (*font == '\0') {
-+	error("%s: invalid '%s.Font' entry in %s", Name, section, cfg_source());
-+	goto out_free;
-+    }
-+
-+    XRES = -1;
-+    YRES = -1;
-+    if (sscanf(font, "%dx%d", &XRES, &YRES) != 2 ||
-+	XRES < 1 ||
-+	YRES < 1) {
-+	error("%s: bad Font '%s' from %s", Name, font, cfg_source());
-+	goto out_free;
-+    }
-+
-+    if (XRES != 6 && YRES != 8) {
-+	error("%s: bad Font '%s' from %s (only 6x8 at the moment)",
-+	      Name, font, cfg_source());
-+	goto out_free;
-+    }
-+
-+    error("%s: font '%s' selected", Name, font);
-+
-+    ret = 0;
-+
-+out_free:
-+    free(font);
-+out:
-+    return ret;
-+}
-+
-+static int drv_TEW673GRU_start(const char *section)
-+{
-+    int ret;
-+
-+    DCOLS = TEW673GRU_NUM_COLS;
-+    DROWS = TEW673GRU_NUM_ROWS;
-+
-+    if (MODE) {
-+	ret = drv_TEW673GRU_init_font(section);
-+	if (ret)
-+	    goto err;
-+
-+	FB_SIZE = DCOLS * TEW673GRU_BPP;
-+    } else {
-+	XRES = 10;
-+	YRES = 16;
-+	DCOLS = DCOLS / XRES;
-+	DROWS = DROWS / YRES;
-+
-+	FB_SIZE = DCOLS * DROWS;
-+    }
-+
-+    if (FB_SIZE) {
-+	drv_TEW673GRU_FB = malloc(FB_SIZE);
-+	if (drv_TEW673GRU_FB == NULL) {
-+	    error("%s: framebuffer could not be allocated", Name);
-+	    goto err;
-+	}
-+    }
-+
-+    ret = drv_TEW673GRU_open(section);
-+    if (ret < 0)
-+        goto err_free;
-+
-+    if (MODE == 0)
-+    	drv_TEW673GRU_clear_screen();
-+
-+    return 0;
-+
-+ err_free:
-+    if (drv_TEW673GRU_FB)
-+	free(drv_TEW673GRU_FB);
-+ err:
-+    return -1;
-+}
-+
-+static int drv_TEW673GRU_greet(const char *msg1, const char *msg2)
-+{
-+    if (MODE)
-+	return drv_generic_graphic_greet(msg1, msg2);
-+
-+    return drv_generic_text_greet(msg1, msg2);
-+}
-+
-+
-+/****************************************/
-+/***        widget callbacks          ***/
-+/****************************************/
-+
-+
-+/* using drv_generic_text_draw(W) */
-+/* using drv_generic_text_icon_draw(W) */
-+/* using drv_generic_text_bar_draw(W) */
-+/* using drv_generic_gpio_draw(W) */
-+
-+
-+/****************************************/
-+/***        exported functions        ***/
-+/****************************************/
-+
-+int drv_TEW673GRU_list(void)
-+{
-+    printf("TEW673GRU driver");
-+    return 0;
-+}
-+
-+int drv_TEW673GRU_init(const char *section, const int quiet)
-+{
-+    WIDGET_CLASS wc;
-+    int ret;
-+
-+    cfg_number(section, "Mode", 0, 0, 1, &MODE);
-+
-+    if (MODE) {
-+	drv_generic_graphic_real_blit = drv_TEW673GRU_blit;
-+	drv_generic_graphic_real_clear = drv_TEW673GRU_clear;
-+    } else {
-+	drv_generic_text_real_write = drv_TEW673GRU_write;
-+    }
-+
-+    ret = drv_TEW673GRU_start(section);
-+    if (ret)
-+	return ret;
-+
-+    if (MODE) {
-+	ret = drv_generic_graphic_init(section, Name);
-+	if (ret)
-+	    return ret;
-+    } else {
-+	ret = drv_generic_text_init(section, Name);
-+	if (ret)
-+	    return ret;
-+
-+	ret = drv_generic_text_icon_init();
-+	if (ret != 0)
-+	    return ret;
-+
-+	ret = drv_generic_text_bar_init(1);
-+	if (ret != 0)
-+	    return ret;
-+
-+	drv_generic_text_bar_add_segment(0, 0, 255, ' ');
-+	drv_generic_text_bar_add_segment(255, 255, 255, '#');
-+
-+	wc = Widget_Text;
-+	wc.draw = drv_generic_text_draw;
-+	widget_register(&wc);
-+
-+	wc = Widget_Icon;
-+	wc.draw = drv_generic_text_icon_draw;
-+	widget_register(&wc);
-+
-+	wc = Widget_Bar;
-+	wc.draw = drv_generic_text_bar_draw;
-+	widget_register(&wc);
-+    }
-+
-+    if (!quiet) {
-+	char buffer[40];
-+	qprintf(buffer, sizeof(buffer), "%s %dx%d", Name, DCOLS, DROWS);
-+	drv_TEW673GRU_greet(buffer, "www.openwrt.org");
-+	sleep(3);
-+	drv_TEW673GRU_clear_screen();
-+    }
-+
-+    return 0;
-+}
-+
-+int drv_TEW673GRU_quit(const int quiet)
-+{
-+
-+    info("%s: shutting down.", Name);
-+
-+    drv_TEW673GRU_clear_screen();
-+
-+    if (!quiet)
-+	drv_TEW673GRU_greet("goodbye!", NULL);
-+
-+    if (MODE)
-+	drv_generic_graphic_quit();
-+    else
-+	drv_generic_text_quit();
-+
-+    debug("closing connection");
-+    drv_TEW673GRU_close();
-+
-+    return (0);
-+}
-+
-+DRIVER drv_TEW673GRU = {
-+    .name = Name,
-+    .list = drv_TEW673GRU_list,
-+    .init = drv_TEW673GRU_init,
-+    .quit = drv_TEW673GRU_quit,
-+};
---- a/lcd4linux.conf.sample
-+++ b/lcd4linux.conf.sample
-@@ -571,6 +571,11 @@ Display FutabaVFD {
-     }
- }
- 
-+Display TEW673GRU {
-+    Driver       'TEW673GRU'
-+    Font         '6x8'
-+    Port         '/dev/spidev1.0'
-+}
- 
- #Plugin KVV {
- #    StationID '12_701'
 

file:a/utils/less/Makefile (deleted)
--- a/utils/less/Makefile
+++ /dev/null
@@ -1,89 +1,1 @@
-#
-# Copyright (C) 2010-2012 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=less
-PKG_VERSION:=458
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://www.greenwoodsoftware.com/less
-PKG_MD5SUM:=935b38aa2e73c888c210dedf8fd94f49
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
-PKG_INSTALL:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/less/Default
-  SECTION:=utils
-  CATEGORY:=Utilities
-  TITLE:=Pager program similar to more
-  URL:=http://www.greenwoodsoftware.com/less/
-endef
-
-define Package/less/Default/description
-  Full version of GNU less utility
-endef
-
-define Package/less
-  $(call Package/less/Default)
-  DEPENDS:=+libncurses
-  VARIANT:=narrow
-endef
-
-define Package/less/description
-  $(call Package/less/Default/description)
-endef
-
-define Package/less-wide
-  $(call Package/less/Default)
-  TITLE+= (Unicode)
-  DEPENDS:=+libncursesw
-  VARIANT:=wide
-endef
-
-define Package/less-wide/description
-  $(call Package/less/Default/description)
-  This package contains the Unicode enabled version of less.
-endef
-
-ifeq ($(BUILD_VARIANT),narrow)
-	CONFIGURE_VARS += \
-		ac_cv_lib_ncursesw_initscr=no		
-endif
-
-ifeq ($(BUILD_VARIANT),wide)
-	CONFIGURE_VARS += \
-		ac_cv_lib_ncursesw_initscr=yes
-endif
-
-define Package/less/install
-	$(INSTALL_DIR) $(1)/bin
-	$(CP) $(PKG_INSTALL_DIR)/usr/bin/less $(1)/bin/less
-endef
-
-define Package/less/postinst
-#!/bin/sh
-[ -L "$${IPKG_INSTROOT}/usr/bin/less" ] && rm -f "$${IPKG_INSTROOT}/usr/bin/less"
-exit 0
-endef
-
-define Package/less/postrm
-#!/bin/sh
-/bin/busybox less -h 2>&1 | grep -q BusyBox && ln -sf ../../bin/busybox /usr/bin/less
-exit 0
-endef
-
-Package/less-wide/install = $(Package/less/install)
-Package/less-wide/postinst = $(Package/less/postinst)
-Package/less-wide/postrm = $(Package/less/postrm)
-
-$(eval $(call BuildPackage,less))
-$(eval $(call BuildPackage,less-wide))
-

--- a/utils/sane-backends/Makefile
+++ /dev/null
@@ -1,125 +1,1 @@
-#
-# Copyright (C) 2006-2014 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=sane-backends
-PKG_VERSION:=1.0.24
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://fossies.org/linux/misc \
-	https://alioth.debian.org/frs/download.php/3958
-PKG_MD5SUM:=1ca68e536cd7c1852322822f5f6ac3a4
-
-PKG_FIXUP:=autoreconf
-PKG_REMOVE_FILES:=aclocal.m4
-
-PKG_INSTALL:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/sane-backends/Default
-  TITLE:=Scanner Access Now Easy
-  URL:=http://www.sane-project.org/
-endef
-
-define Package/sane-backends/Default/description
- SANE (Scanner Access Now Easy) is a universal scanner interface.
-endef
-
-define Package/sane-backends
-$(call Package/sane-backends/Default)
-  SECTION:=utils
-  CATEGORY:=Utilities
-  DEPENDS:=+sane-libs
-  TITLE+= (backends)
-endef
-
-define Package/sane-backends/description
-$(call Package/sane-backends/Default/description)
- This package contains the SANE daemon.
-endef
-
-define Package/sane-libs
-  $(call Package/sane-backends/Default)
-  SECTION:=libs
-  CATEGORY:=Libraries
-  DEPENDS:=+libjpeg +libtiff +libusb-compat +libv4l +cups
-  TITLE+= (libraries)
-endef
-
-define Package/sane-libs/description
-$(call Package/sane-backends/Default/description)
- This package contains the SANE shared libraries.
-endef
-
-define Package/sane-frontends
-  $(call Package/sane-backends/Default)
-  SECTION:=utils
-  CATEGORY:=Utilities
-  DEPENDS:=+sane-backends
-  TITLE+= (frontends)
-endef
-
-define Package/sane-frontends/description
-$(call Package/sane-backends/Default/description)
- This package contains the SANE frontends.
-endef
-
-TARGET_LDFLAGS += \
-	-Wl,-rpath-link $(STAGING_DIR)/usr/lib \
-	-Wl,-rpath-link $(PKG_BUILD_DIR)/backend/.libs
-
-CONFIGURE_ARGS+= \
-	--enable-shared \
-	--enable-static \
-	--disable-translations \
-	--disable-latex \
-	--without-gphoto2 \
-	--disable-debug \
-	--without-snmp
-
-define Build/Configure
-	mkdir -p $(PKG_BUILD_DIR)/backend/.libs
-	$(Build/Configure/Default)
-endef
-
-define Package/sane-backends/conffiles
-/etc/sane.d/saned.conf
-endef
-
-define Package/sane-backends/install
-	$(INSTALL_DIR) $(1)/etc/sane.d
-	$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/sane.d/*.conf $(1)/etc/sane.d/
-	$(INSTALL_DIR) $(1)/usr/sbin
-	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin/
-endef
-
-define Package/sane-libs/install
-	$(INSTALL_DIR) $(1)/usr/lib
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libsane.so.* $(1)/usr/lib/
-	$(INSTALL_DIR) $(1)/usr/lib/sane
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/sane/libsane-*.so.* $(1)/usr/lib/sane/
-endef
-
-define Package/sane-frontends/install
-	$(INSTALL_DIR) $(1)/usr/bin
-	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
-endef
-
-define Build/InstallDev
-	$(INSTALL_DIR) $(1)/usr/include
-	$(CP) $(PKG_INSTALL_DIR)/usr/include/sane $(1)/usr/include/
-	$(INSTALL_DIR) $(1)/usr/lib
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libsane.{a,so*} $(1)/usr/lib/
-endef
-
-$(eval $(call BuildPackage,sane-backends))
-$(eval $(call BuildPackage,sane-libs))
-$(eval $(call BuildPackage,sane-frontends))
-

--- a/utils/sane-backends/patches/002-remove-uneeded.patch
+++ /dev/null
@@ -1,12 +1,1 @@
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -396,7 +396,7 @@ target_alias = @target_alias@
- top_build_prefix = @top_build_prefix@
- top_builddir = @top_builddir@
- top_srcdir = @top_srcdir@
--SUBDIRS = include lib sanei backend frontend tools doc po testsuite
-+SUBDIRS = include lib sanei backend frontend
- DIST_SUBDIRS = include lib sanei backend frontend tools doc po japi testsuite
- dist_doc_DATA = AUTHORS ChangeLog COPYING LICENSE NEWS PROBLEMS PROJECTS \
-  README README.aix README.beos README.darwin README.djpeg README.freebsd \
 

--- a/utils/sane-backends/patches/010-dont-add-host-include-path.patch
+++ /dev/null
@@ -1,56 +1,1 @@
---- a/configure.in
-+++ b/configure.in
-@@ -82,8 +82,6 @@ AM_CONDITIONAL(CROSS_COMPILING, test x$c
- dnl ***********************************************************************
- dnl set compiler/linker flags
- dnl ***********************************************************************
--INCLUDES="${INCLUDES} -I/usr/local/include"
--AC_SUBST(INCLUDES)
- SANE_SET_CFLAGS([$is_release])
- SANE_SET_LDFLAGS
- SANE_LINKER_RPATH
-@@ -332,30 +330,22 @@ if test -c /dev/urandom ; then
-     AC_DEFINE(HAVE_DEV_URANDOM, 1, [Is /dev/urandom available?])
- fi
- 
--dnl added by PN 3/2/12 to detect cups
--$as_echo "checking for cups"
--if test -e /usr/include/cups/cups.h ; then
--    AC_DEFINE(HAVE_CUPS, 1, [Is /usr/include/cups/cups.h available?])
--	with_cups="yes"
--	LIBS="-lcups  $LIBS"
--else
--	$as_echo "cups.h not found, you may want to install a cups development package"
--	$as_echo "in order to autodetect network scanners in kodakaio."
--	with_cups="no"
-+AC_CHECK_HEADERS([cups/cups.h], [with_cups=yes], [with_cups=no])
-+if test "x${with_cups}" = "xyes"; then
-+  AC_DEFINE(HAVE_CUPS,[1],[Is cups/cups.h available?])
-+  AC_PATH_PROG(CUPS_CONFIG, cups-config)
-+  if test "x${CUPS_CONFIG}" != "x"; then
-+    LIBS="$LIBS `$CUPS_CONFIG --libs`"
-+  fi
- fi
- 
--dnl added by llagendijk 12/7/2012 to detect systemd for saned
--$as_echo_n "Checking for systemd..."
--if test -e /usr/include/systemd/sd-daemon.h ; then
--    AC_DEFINE(HAVE_SYSTEMD, 1, [Is /usr/include/systemd/sd-daemon.h available?])
--    with_systemd="yes"
--    SYSTEMD_LIBS=" -lsystemd-daemon"
--    AC_SUBST(SYSTEMD_LIBS)
--    $as_echo "yes"
--else
--    with_systemd="no"
--    $as_echo "no"
-+AC_CHECK_HEADERS([systemd/sd-daemon.h])
-+PKG_CHECK_MODULES([HAVE_SYSTEMD], [libsystemd-daemon], [with_systemd=yes], [with_systemd=no])
-+if test "x${with_systemd}" = "xyes"; then
-+    AC_DEFINE(HAVE_SYSTEMD,[1],[Is systemd/sd-daemon.h available?])
-+    SYSTEMD_LIBS="-lsystemd-daemon"
- fi
-+AC_SUBST(SYSTEMD_LIBS)
- 
- dnl ***********
- dnl USB Support
 

--- a/utils/sane-backends/patches/020-non-i386-qcam.patch
+++ /dev/null
@@ -1,21 +1,1 @@
---- a/backend/qcam.c
-+++ b/backend/qcam.c
-@@ -105,6 +105,17 @@
- 
- #include "qcam.h"
- 
-+#if !defined( __i386__) && !defined(__arm__)
-+static inline unsigned char inb(unsigned int port)
-+{
-+	return 0;
-+}
-+
-+static inline void outb(unsigned char value, unsigned int port)
-+{
-+}
-+#endif
-+
- /* status bits */
- #define NeedRamTable		(1 << 1)
- #define BlackBalanceInProgress	(1 << 6)
 

file:a/utils/sysstat/Makefile (deleted)
--- a/utils/sysstat/Makefile
+++ /dev/null
@@ -1,60 +1,1 @@
-#
-# Copyright (C) 2008-2010 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=sysstat
-PKG_VERSION:=9.0.6
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=http://pagesperso-orange.fr/sebastien.godard
-PKG_MD5SUM:=e069daf192d259de905d7f8cdd85dc4e
-
-PKG_INSTALL:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/sysstat
-  SECTION:=utils
-  CATEGORY:=Utilities
-  TITLE:=Sysstat performance monitoring tools
-  URL:=http://pagesperso-orange.fr/sebastien.godard/index.html
-endef
-
-define Package/sysstat/description
-  The sysstat utilities are a collection of performance monitoring tools for
-  Linux. These include sar, sadf, mpstat, iostat, pidstat and sa tools.
-endef
-
-define Package/sysstat/conffiles
-/etc/sysstat/sysstat.ioconf
-/etc/sysstat/config
-endef
-
-CONFIGURE_VARS+= \
-	sa_lib_dir="/usr/lib/sysstat" \
-	sa_dir="/var/log/sysstat" \
-	conf_dir="/etc/sysstat" \
-
-CONFIGURE_ARGS+= \
-	--disable-documentation \
-
-define Package/sysstat/install
-	$(INSTALL_DIR) $(1)/usr/lib/sysstat
-	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/sysstat/{sadc,sa1,sa2} $(1)/usr/lib/sysstat/
-	$(INSTALL_DIR) $(1)/usr/bin
-	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/{sar,sadf,iostat,mpstat,pidstat} $(1)/usr/bin/
-	$(INSTALL_DIR) $(1)/etc/sysstat
-	$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/sysstat/sysstat.ioconf $(1)/etc/sysstat/
-	$(INSTALL_CONF) ./files/config $(1)/etc/sysstat/config
-	$(INSTALL_DIR) $(1)/etc/init.d
-	$(INSTALL_BIN) ./files/sysstat.init $(1)/etc/init.d/sysstat
-endef
-
-$(eval $(call BuildPackage,sysstat))
-

--- a/utils/sysstat/files/config
+++ /dev/null
@@ -1,5 +1,1 @@
-# How long to keep log files (days), maximum is a month
-# Used by sa2(8) script
-HISTORY=3
 
-

--- a/utils/sysstat/files/sysstat.init
+++ /dev/null
@@ -1,13 +1,1 @@
-#!/bin/sh /etc/rc.common
 
-# The init file runs the sadc command in order to write
-# the "LINUX RESTART" mark to the daily data file
-
-START=99
-
-start() {
-	mkdir -p /var/log/sysstat
-	/usr/lib/sysstat/sadc -S DISK -F -L -
-}
-
-

file:a/utils/tar/Makefile (deleted)
--- a/utils/tar/Makefile
+++ /dev/null
@@ -1,61 +1,1 @@
-#
-# Copyright (C) 2008-2010 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=tar
-PKG_VERSION:=1.23
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
-PKG_MD5SUM:=41e2ca4b924ec7860e51b43ad06cdb7e
-
-PKG_INSTALL:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/tar
-  SECTION:=utils
-  CATEGORY:=Utilities
-  DEPENDS:=+bzip2
-  TITLE:=GNU tar
-  URL:=http://www.gnu.org/software/tar/
-endef
-
-define Package/tar/description
-	Tar is a program for packaging a set of files as a
-	single archive in tar format.
-endef
-
-define Package/tar/postinst
-#!/bin/sh
-if [ -e $${IPKG_INSTROOT}/bin/tar ]; then
-  rm -r $${IPKG_INSTROOT}/bin/tar;
-fi
-ln -sf /usr/bin/tar $${IPKG_INSTROOT}/bin/tar
-endef
-
-define Package/tar/postrm
-#!/bin/sh
-rm $${IPKG_INSTROOT}/bin/tar
-ln -s busybox $${IPKG_INSTROOT}/bin/tar
-$${IPKG_INSTROOT}/bin/tar 2>&1 | grep 'applet not found' > /dev/null 2>&1 && rm $${IPKG_INSTROOT}/bin/tar
-exit 0
-endef
-
-MAKE_FLAGS += \
-	CFLAGS="$(TARGET_CFLAGS)" \
-	LDFLAGS="$(TARGET_LDLAGS)"
-
-define Package/tar/install
-	$(INSTALL_DIR) $(1)/usr/bin/
-	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/bin/
-endef
-
-$(eval $(call BuildPackage,tar))
-

file:a/utils/watchcat/Makefile (deleted)
--- a/utils/watchcat/Makefile
+++ /dev/null
@@ -1,45 +1,1 @@
-#
-# Copyright (C) 2010 segal.di.ubi.pt
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=watchcat
-PKG_VERSION:=1
-PKG_RELEASE:=5
-
-PKG_MAINTAINER:=Nuno Goncalves <nunojpg@gmail.com>
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/watchcat
-  SECTION:=utils
-  CATEGORY:=Utilities
-  TITLE:=Enable the configuration of programed reboots
-endef
-
-define Package/watchcat/description
-Allows to configure a periodically reboot, or after loosing internet connectivity. Configured trough UCI /etc/config/system.
-endef
-
-define Package/watchcat/conffiles
-/etc/config/system
-endef
-
-define Build/Compile
-endef
-
-define Package/watchcat/install
-	$(INSTALL_DIR) $(1)/etc/init.d
-	$(INSTALL_BIN) ./files/initd_watchcat $(1)/etc/init.d/watchcat
-	$(INSTALL_DIR) $(1)/usr/bin
-	$(INSTALL_BIN) ./files/watchcat.sh $(1)/usr/bin/watchcat.sh
-	$(INSTALL_DIR) $(1)/etc/uci-defaults
-	$(INSTALL_BIN) ./files/uci_defaults_watchcat $(1)/etc/uci-defaults/50-watchcat
-endef
-
-$(eval $(call BuildPackage,watchcat))
-

--- a/utils/watchcat/files/initd_watchcat
+++ /dev/null
@@ -1,109 +1,1 @@
-#!/bin/sh /etc/rc.common
 
-START=97
-
-PIDFILE="/tmp/run/watchcat"
-
-append_string() {
-	local varname="$1"; local add="$2"; local separator="${3:- }"; local actual
-	eval "actual=\$$varname"
-
-	new="${actual:+$actual$separator}$add"
-	eval "$varname=\$new"
-}
-
-timetoseconds() {
-	local time=$1
-	unset seconds
-
-	{ [ "$time" -ge 1 ] 2> /dev/null && seconds="$time"; } || \
-	{ [ "${time%s}" -ge 1 ] 2> /dev/null && seconds="${time%s}"; } || \
-	{ [ "${time%m}" -ge 1 ] 2> /dev/null && seconds=$((${time%m}*60)); } || \
-	{ [ "${time%h}" -ge 1 ] 2> /dev/null && seconds=$((${time%h}*3600)); } || \
-	{ [ "${time%d}" -ge 1 ] 2> /dev/null && seconds=$((${time%d}*86400)); }
-}
-
-load_watchcat() {
-	config_get period	$1 period
-	config_get mode		$1 mode		"allways"
-	config_get pinghosts	$1 pinghosts	"8.8.8.8"
-	config_get pingperiod	$1 pingperiod
-	config_get forcedelay	$1 forcedelay	"0"
-
-	error=""
-
-	timetoseconds "$period"
-	period="$seconds"
-	[ "$period" -ge 1 ] \
-		|| append_string "error" 'period is not a valid time value (ex: "30"; "4m"; "6h"; "2d")' "; "
-	[ "$mode" = "allways" -o "$mode" = "ping" ] \
-		|| append_string "error" "mode must be 'allways' or 'ping'" "; "
-	[ -n "$pinghosts" -o "$mode" = "allways" ] \
-		|| append_string "error" "pinghosts must be set when in 'ping' mode" "; "
-	[ "$mode" = "ping" ] && {
-		if [ -n "$pingperiod" ]
-		then
-			timetoseconds "$pingperiod"
-			pingperiod="$seconds"
-			if [ "$pingperiod" -ge 0 ]
-			then
-				[ "$pingperiod" -le "$period" ] \
-					|| append_string "error" "pingperiod must be less than period" "; "
-			else
-				append_string "error" 'pingperiod is not a valid time value (ex: "30"; "4m"; "6h"; "2d")' "; "
-			fi
-		else
-			pingperiod="$((period/20))"
-		fi
-	}
-	[ "$pingperiod" -lt "$period" -o "$mode" = "allways" ] \
-		|| append_string "error" "pingperiod is not recognized" "; "
-	[ "$forcedelay" -ge 0 ] \
-		|| append_string "error" "forcedelay must be a integer greater or equal than 0, where 0 means disabled" "; "
-
-	[ -n "$error" ] && { logger -p user.err -t "watchcat" "reboot program $1 not started - $error"; return; }
-
-	if [ "$mode" = "allways" ]
-	then
-		/usr/bin/watchcat.sh "allways" "$period" "$forcedelay" &
-		logger -p user.info -t "wathchat" "started task (mode=$mode;period=$period;forcedelay=$forcedelay)" 
-	else
-		/usr/bin/watchcat.sh "period" "$period" "$forcedelay" "$pinghosts" "$pingperiod" &
-		logger -p user.info -t "wathchat" "started task (mode=$mode;period=$period;pinghosts=$pinghosts;pingperiod=$pingperiod;forcedelay=$forcedelay)" 
-	fi
-
-	echo $! >> "${PIDFILE}.pids"
-}
-
-stop() {
-	if [ -f "${PIDFILE}.pids" ]
-	then
-		logger -p user.info -t "watchcat" "stopping all tasks"
-
-		while read pid
-		do
-			kill "$pid"
-		done < "${PIDFILE}.pids"
-
-		rm "${PIDFILE}.pids"
-
-		logger -p user.info -t "watchcat" "all tasks stopped"
-	else
-		logger -p user.info -t "watchcat" "no tasks running"
-	fi
-}
-
-start() {
-	[ -f "${PIDFILE}.pids" ] && stop
-
-	config_load system
-	if [ -n "$(uci show system.@watchcat[0])" ] # at least one watchcat section exists
-	then
-		logger -p user.info -t "watchcat" "starting all tasks"
-		config_foreach load_watchcat watchcat
-		logger -p user.info -t "watchcat" "all tasks started"
-	else
-		logger -p user.info -t "watchcat" "no tasks defined"
-	fi
-}
-

--- a/utils/watchcat/files/uci_defaults_watchcat
+++ /dev/null
@@ -1,11 +1,1 @@
-#!/bin/sh
 
-uci -q show system.@watchcat[0] || {
-	uci add system watchcat
-	uci set system.@watchcat[0].period=6h
-	uci set system.@watchcat[0].mode=ping
-	uci set system.@watchcat[0].pinghosts=8.8.8.8
-	uci set system.@watchcat[0].forcedelay=30
-	uci commit
-}
-

--- a/utils/watchcat/files/watchcat.sh
+++ /dev/null
@@ -1,70 +1,1 @@
-#!/bin/sh 
 
-mode="$1"
-
-shutdown_now() {
-	local forcedelay="$1"
-
-	reboot &
-
-	[ "$forcedelay" -ge 1 ] && {
-		sleep "$forcedelay"
-
-		echo b > /proc/sysrq-trigger # Will immediately reboot the system without syncing or unmounting your disks.
-	}
-}
-
-watchcat_allways() {
-	local period="$1"; local forcedelay="$2"
-
-	sleep "$period" && shutdown_now "$forcedelay"
-}
-
-watchcat_ping() {
-	local period="$1"; local forcedelay="$2"; local pinghosts="$3"; local pingperiod="$4"
-
-	time_now="$(cat /proc/uptime)"
-	time_now="${time_now%%.*}"
-	time_lastcheck="$time_now"
-	time_lastcheck_withinternet="$time_now"
-
-	while true
-	do
-		# account for the time ping took to return. With a ping time of 5s, ping might take more than that, so it is important to avoid even more delay.
-		time_now="$(cat /proc/uptime)"
-		time_now="${time_now%%.*}"
-		time_diff="$((time_now-time_lastcheck))"
-
-		[ "$time_diff" -lt "$pingperiod" ] && {
-			sleep_time="$((pingperiod-time_diff))"
-			sleep "$sleep_time"
-		}
-
-		time_now="$(cat /proc/uptime)"
-		time_now="${time_now%%.*}"
-		time_lastcheck="$time_now"
-
-		for host in "$pinghosts"
-		do
-			if ping -c 1 "$host" &> /dev/null 
-			then 
-				time_lastcheck_withinternet="$time_now"
-			else
-				time_diff="$((time_now-time_lastcheck_withinternet))"
-				logger -p daemon.info -t "watchcat[$$]" "no internet connectivity for $time_diff seconds. Reseting when reaching $period"       
-			fi
-		done
-
-		time_diff="$((time_now-time_lastcheck_withinternet))"
-		[ "$time_diff" -ge "$period" ] && shutdown_now "$forcedelay"
-
-	done
-}
-
-	if [ "$mode" = "allways" ]
-	then
-		watchcat_allways "$2" "$3"
-	else
-		watchcat_ping "$2" "$3" "$4" "$5"
-	fi
-

file:a/utils/xz/Makefile (deleted)
--- a/utils/xz/Makefile
+++ /dev/null
@@ -1,135 +1,1 @@
-#
-# Copyright (C) 2013 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=xz
-PKG_VERSION:=5.0.4
-PKG_RELEASE:=2
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=http://tukaani.org/xz
-PKG_MD5SUM:=741cd3a5f64b23b7bac56ec5b2258715
-
-PKG_FIXUP:=autoreconf
-PKG_INSTALL:=1
-
-PKG_BUILD_PARALLEL:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-XZ_UTILS := \
-	lzcat lzcmp lzdiff lzegrep lzfgrep lzgrep lzless lzma lzmadec lzmainfo \
-	lzmore unlzma unxz xz xzcat xzcmp xzdec xzdiff xzegrep xzfgrep xzgrep \
-	xzless xzmore
-
-DEPENDS_lzmadec = +libpthread +liblzma
-DEPENDS_lzmainfo = +libpthread +liblzma
-DEPENDS_xz = +libpthread +liblzma
-DEPENDS_xzdec = +libpthread +liblzma
-
-XZ_DEPENDS_lzcat = xz
-XZ_DEPENDS_lzcmp = xzdiff
-XZ_DEPENDS_lzcat = xz
-XZ_DEPENDS_lzcmp = xzdiff
-XZ_DEPENDS_lzdiff = xzdiff
-XZ_DEPENDS_lzegrep = xzgrep
-XZ_DEPENDS_lzfgrep = xzgrep
-XZ_DEPENDS_lzgrep = xzgrep
-XZ_DEPENDS_lzless = xzless
-XZ_DEPENDS_lzma = xz
-XZ_DEPENDS_lzmore = xzmore
-XZ_DEPENDS_unlzma = xz
-XZ_DEPENDS_unxz = xz
-XZ_DEPENDS_xzcat = xz
-XZ_DEPENDS_xzcmp = xzdiff
-XZ_DEPENDS_xzegrep = xzgrep
-XZ_DEPENDS_xzfgrep = xzgrep
-
-define Package/xz/Default
-  SECTION:=utils
-  CATEGORY:=Utilities
-endef
-
-define Package/xz
-  $(call Package/xz/Default)
-  TITLE:=XZ Utils
-  MENU:=1
-endef
-
-define Package/liblzma
-  SECTION:=libs
-  CATEGORY:=Libraries
-  DEPENDS:=+libpthread
-  TITLE:=liblzma library from XZ Utils
-endef
-
-define GenPlugin
- define Package/$(1)
-   $(call Package/xz/Default)
-   DEPENDS:=xz +$(DEPENDS_$(2)) $(if $(XZ_DEPENDS_$(2)),+xz-$(XZ_DEPENDS_$(2)))
-   TITLE:=$(2) utility from XZ Utils
- endef
-endef
-
-$(foreach i,$(XZ_UTILS),$(eval $(call GenPlugin,xz-$(i),$(i))))
-
-CONFIGURE_ARGS += \
-	--enable-small \
-	--enable-assume-ram=4 \
-	--disable-assembler \
-	--disable-werror
-
-define Build/InstallDev
-	$(INSTALL_DIR) $(1)/usr/include/lzma
-	$(CP) \
-		$(PKG_INSTALL_DIR)/usr/include/lzma.h \
-		$(1)/usr/include/
-	$(CP) \
-		$(PKG_INSTALL_DIR)/usr/include/lzma/*.h \
-		$(1)/usr/include/lzma/
-	$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
-	$(CP) \
-		$(PKG_INSTALL_DIR)/usr/lib/pkgconfig/liblzma.pc \
-		$(1)/usr/lib/pkgconfig/
-	$(CP) \
-		$(PKG_INSTALL_DIR)/usr/lib/liblzma.* \
-		$(1)/usr/lib/
-endef
-
-define Package/xz/install
-	true
-endef
-
-define BuildPlugin
-  define Package/$(1)/install
-	$(INSTALL_DIR) $$(1)/usr/bin
-ifneq ($(XZ_DEPENDS_$(2)),)
-	$(CP) \
-		$(PKG_INSTALL_DIR)/usr/bin/$(2) \
-		$$(1)/usr/bin/
-else
-	$(INSTALL_BIN) \
-		$(PKG_INSTALL_DIR)/usr/bin/$(2) \
-		$$(1)/usr/bin/
-endif
-  endef
-
-  $$(eval $$(call BuildPackage,$(1)))
-endef
-
-define Package/liblzma/install
-	$(INSTALL_DIR) $(1)/usr/lib
-	$(CP) \
-		$(PKG_INSTALL_DIR)/usr/lib/liblzma.so* \
-		$(1)/usr/lib/
-endef
-
-$(eval $(call BuildPackage,xz))
-$(eval $(call BuildPackage,liblzma))
-$(foreach i,$(XZ_UTILS),$(eval $(call BuildPlugin,xz-$(i),$(i))))
-

--- a/utils/xz/patches/010-compile.patch
+++ /dev/null
@@ -1,80 +1,1 @@
---- a/src/lzmainfo/Makefile.am
-+++ b/src/lzmainfo/Makefile.am
-@@ -20,7 +20,8 @@ lzmainfo_CPPFLAGS = \
- 	-DLOCALEDIR=\"$(localedir)\" \
- 	-I$(top_srcdir)/src/common \
- 	-I$(top_srcdir)/src/liblzma/api \
--	-I$(top_builddir)/lib
-+	-I$(top_builddir)/lib \
-+	-std=gnu99
- 
- lzmainfo_LDADD = $(top_builddir)/src/liblzma/liblzma.la
- 
---- a/src/liblzma/common/common.h
-+++ b/src/liblzma/common/common.h
-@@ -89,9 +89,9 @@ typedef lzma_ret (*lzma_init_function)(
- /// function prototype.
- typedef lzma_ret (*lzma_code_function)(
- 		lzma_coder *coder, lzma_allocator *allocator,
--		const uint8_t *restrict in, size_t *restrict in_pos,
--		size_t in_size, uint8_t *restrict out,
--		size_t *restrict out_pos, size_t out_size,
-+		const uint8_t *in, size_t *in_pos,
-+		size_t in_size, uint8_t *out,
-+		size_t *out_pos, size_t out_size,
- 		lzma_action action);
- 
- /// Type of a function to free the memory allocated for the coder
-@@ -235,9 +235,9 @@ extern void lzma_next_end(lzma_next_code
- 
- /// Copy as much data as possible from in[] to out[] and update *in_pos
- /// and *out_pos accordingly. Returns the number of bytes copied.
--extern size_t lzma_bufcpy(const uint8_t *restrict in, size_t *restrict in_pos,
--		size_t in_size, uint8_t *restrict out,
--		size_t *restrict out_pos, size_t out_size);
-+extern size_t lzma_bufcpy(const uint8_t *in, size_t *in_pos,
-+		size_t in_size, uint8_t *out,
-+		size_t *out_pos, size_t out_size);
- 
- 
- /// \brief      Return if expression doesn't evaluate to LZMA_OK
---- a/src/liblzma/common/common.c
-+++ b/src/liblzma/common/common.c
-@@ -70,9 +70,9 @@ lzma_free(void *ptr, lzma_allocator *all
- //////////
- 
- extern size_t
--lzma_bufcpy(const uint8_t *restrict in, size_t *restrict in_pos,
--		size_t in_size, uint8_t *restrict out,
--		size_t *restrict out_pos, size_t out_size)
-+lzma_bufcpy(const uint8_t *in, size_t *in_pos,
-+		size_t in_size, uint8_t *out,
-+		size_t *out_pos, size_t out_size)
- {
- 	const size_t in_avail = in_size - *in_pos;
- 	const size_t out_avail = out_size - *out_pos;
---- a/src/liblzma/Makefile.am
-+++ b/src/liblzma/Makefile.am
-@@ -23,7 +23,8 @@ liblzma_la_CPPFLAGS = \
- 	-I$(top_srcdir)/src/liblzma/delta \
- 	-I$(top_srcdir)/src/liblzma/simple \
- 	-I$(top_srcdir)/src/common \
--	-DTUKLIB_SYMBOL_PREFIX=lzma_
-+	-DTUKLIB_SYMBOL_PREFIX=lzma_ \
-+	-std=gnu99
- liblzma_la_LDFLAGS = -no-undefined -version-info 5:4:0
- 
- include $(srcdir)/common/Makefile.inc
---- a/src/xz/Makefile.am
-+++ b/src/xz/Makefile.am
-@@ -46,7 +46,8 @@ xz_CPPFLAGS = \
- 	-DLOCALEDIR=\"$(localedir)\" \
- 	-I$(top_srcdir)/src/common \
- 	-I$(top_srcdir)/src/liblzma/api \
--	-I$(top_builddir)/lib
-+	-I$(top_builddir)/lib \
-+	-std=gnu99
- 
- xz_LDADD = $(top_builddir)/src/liblzma/liblzma.la
- 
 

comments