# we have to download additional stuff before patching
(cd $(PKG_BUILD_DIR) && ./contrib/download_prerequisites)
$(Build/Patch)
+# poor man's fix for `none-openwrt-linux' not recognized when building with musl
+ cp $(PKG_BUILD_DIR)/config.sub $(PKG_BUILD_DIR)/mpfr/
+ cp $(PKG_BUILD_DIR)/config.sub $(PKG_BUILD_DIR)/gmp/
+ cp $(PKG_BUILD_DIR)/config.sub $(PKG_BUILD_DIR)/mpc/
endef
include $(TOPDIR)/rules.mk
PKG_NAME:=perl-http-message
-PKG_VERSION:=6.06
+PKG_VERSION:=6.10
PKG_RELEASE:=1
-PKG_SOURCE_URL:=http://www.cpan.org/authors/id/G/GA/GAAS
+PKG_SOURCE_URL:=http://www.cpan.org/authors/id/E/ET/ETHER
PKG_SOURCE:=HTTP-Message-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=e563ac516e28d33f65bc0f295f625f85
+PKG_MD5SUM:=b8a68ce1898691c536714eeae3f963d4
PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
include $(TOPDIR)/rules.mk
PKG_NAME:=perl-uri
-PKG_VERSION:=1.68
+PKG_VERSION:=1.69
PKG_RELEASE:=1
PKG_SOURCE_URL:=http://www.cpan.org/authors/id/E/ET/ETHER/
PKG_SOURCE:=URI-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=4a954ab8d79f831616ca817ba4b26cb9
+PKG_MD5SUM:=3c56aee0300bce5a440ccbd558277ea0
PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
include $(TOPDIR)/rules.mk
PKG_NAME:=python-pip
-PKG_VERSION:=1.5.6
+PKG_VERSION:=7.1.0
PKG_RELEASE:=1
PKG_SOURCE:=pip-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://pypi.python.org/packages/source/p/pip/
-PKG_MD5SUM:=01026f87978932060cc86c1dc527903e
+PKG_MD5SUM:=d935ee9146074b1d3f26c5f0acfd120e
PKG_BUILD_DIR:=$(BUILD_DIR)/pip-$(PKG_VERSION)
PKG_USE_MIPS16:=0
include $(TOPDIR)/rules.mk
PKG_NAME:=python-setuptools
-PKG_VERSION:=7.0
+PKG_VERSION:=18.0.1
PKG_RELEASE:=1
PKG_SOURCE:=setuptools-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://pypi.python.org/packages/source/s/setuptools/
-PKG_MD5SUM:=6245d6752e2ef803c365f560f7f2f940
+PKG_MD5SUM:=cecd172c9ff7fd5f2e16b2fcc88bba51
PKG_BUILD_DIR:=$(BUILD_DIR)/setuptools-$(PKG_VERSION)
--without-cxx-main \
--without-pymalloc \
--with-threads \
+ --with-system-expat=$(STAGING_DIR_HOST) \
--prefix=$(STAGING_DIR_HOST) \
--with-ensurepip=upgrade \
CONFIG_SITE= \
#
-# Copyright (C) 2006-2014 OpenWrt.org
+# Copyright (C) 2006-2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=alsa-lib
-PKG_VERSION:=1.0.28
+PKG_VERSION:=1.0.29
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=ftp://ftp.alsa-project.org/pub/lib/ \
http://alsa.cybermirror.org/lib/
-PKG_MD5SUM:=c9e21b88a2b3e6e12ea7ba0f3b271fc3
+PKG_MD5SUM:=de67e0eca72474d6b1121037dafe1024
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
PKG_LICENSE:=LGPLv2.1 GPLv2
--- /dev/null
+--- a/src/seq/seq.c
++++ b/src/seq/seq.c
+@@ -777,7 +777,7 @@ void event_filter(snd_seq_t *seq, snd_se
+
+ */
+
+-#include <sys/poll.h>
++#include <poll.h>
+ #include "seq_local.h"
+
+ /****************************************************************************
+--- a/aserver/aserver.c
++++ b/aserver/aserver.c
+@@ -20,7 +20,7 @@
+
+ #include <sys/shm.h>
+ #include <sys/socket.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <sys/un.h>
+ #include <sys/uio.h>
+ #include <stdio.h>
+--- a/include/asoundlib-head.h
++++ b/include/asoundlib-head.h
+@@ -35,6 +35,6 @@
+ #include <string.h>
+ #include <fcntl.h>
+ #include <assert.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <errno.h>
+ #include <stdarg.h>
+--- a/include/asoundlib.h
++++ b/include/asoundlib.h
+@@ -35,7 +35,7 @@
+ #include <string.h>
+ #include <fcntl.h>
+ #include <assert.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <errno.h>
+ #include <stdarg.h>
+ #include <endian.h>
+--- a/include/local.h
++++ b/include/local.h
+@@ -47,7 +47,7 @@
+ #error Header defining endianness not defined
+ #endif
+ #include <stdarg.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <sys/types.h>
+ #include <errno.h>
+ #include <linux/types.h>
+--- a/src/control/control.c
++++ b/src/control/control.c
+@@ -48,7 +48,7 @@ and IEC958 structure.
+ #include <string.h>
+ #include <fcntl.h>
+ #include <signal.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include "control_local.h"
+
+ /**
+--- a/src/control/control_shm.c
++++ b/src/control/control_shm.c
+@@ -27,7 +27,7 @@
+ #include <fcntl.h>
+ #include <sys/shm.h>
+ #include <sys/socket.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <sys/un.h>
+ #include <sys/uio.h>
+ #include <sys/mman.h>
+--- a/src/pcm/pcm.c
++++ b/src/pcm/pcm.c
+@@ -634,7 +634,7 @@ playback devices.
+ #include <stdarg.h>
+ #include <signal.h>
+ #include <ctype.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <sys/shm.h>
+ #include <sys/mman.h>
+ #include <limits.h>
+--- a/src/pcm/pcm_direct.c
++++ b/src/pcm/pcm_direct.c
+@@ -30,7 +30,7 @@
+ #include <grp.h>
+ #include <sys/ioctl.h>
+ #include <sys/mman.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <sys/shm.h>
+ #include <sys/sem.h>
+ #include <sys/wait.h>
+--- a/src/pcm/pcm_mmap.c
++++ b/src/pcm/pcm_mmap.c
+@@ -21,7 +21,7 @@
+ #include <stdio.h>
+ #include <malloc.h>
+ #include <string.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <sys/mman.h>
+ #include <sys/shm.h>
+ #include "pcm_local.h"
+--- a/src/pcm/pcm_share.c
++++ b/src/pcm/pcm_share.c
+@@ -34,7 +34,7 @@
+ #include <signal.h>
+ #include <math.h>
+ #include <sys/socket.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <sys/shm.h>
+ #include <pthread.h>
+ #include "pcm_local.h"
+--- a/src/pcm/pcm_shm.c
++++ b/src/pcm/pcm_shm.c
+@@ -36,7 +36,7 @@
+ #include <sys/ioctl.h>
+ #include <sys/shm.h>
+ #include <sys/socket.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <sys/un.h>
+ #include <sys/mman.h>
+ #include <netinet/in.h>
+--- a/src/shmarea.c
++++ b/src/shmarea.c
+@@ -22,7 +22,7 @@
+ #include <malloc.h>
+ #include <string.h>
+ #include <errno.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <sys/mman.h>
+ #include <sys/shm.h>
+ #include "list.h"
PKG_NAME:=boost
PKG_VERSION:=1_58_0
-PKG_RELEASE:=5
+PKG_RELEASE:=6
PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/boost
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/host-build.mk
-
+# For now, the combination TARGET_mpc85xx&&USE_UCLIBC disables boost due to incompatibility
define Package/boost/Default
SECTION:=libs
CATEGORY:=Libraries
TITLE:=Boost C++ source library
URL:=http://www.boost.org
- DEPENDS:=+libstdcpp +libpthread +librt
+ DEPENDS:=@(!(TARGET_mpc85xx&&USE_UCLIBC)) +libstdcpp +libpthread +librt
endef
define Package/boost/description/Default
true
endef
+# For now, the combination TARGET_mpc85xx&&USE_UCLIBC disables boost due to incompatibility
define Package/boost
$(call Package/boost/Default)
TITLE+= packages
- DEPENDS:=+ALL:boost-libs +ALL:boost-test
+ DEPENDS:=@(!(TARGET_mpc85xx&&USE_UCLIBC)) +ALL:boost-libs +ALL:boost-test
endef
define Package/boost/config
define Package/boost-test
$(call Package/boost/Default)
TITLE+= (test)
- HIDDEN:=1
+ HIDDEN:=1
endef
define Build/Configure
$(eval $(call DefineBoostLibrary,graph,regex,))
#$(eval $(call DefineBoostLibrary,graph_parallel,,))
$(eval $(call DefineBoostLibrary,iostreams,,+zlib))
-$(eval $(call DefineBoostLibrary,locale,system,$(ICONV_DEPENDS)))
+$(eval $(call DefineBoostLibrary,locale,system,$(ICONV_DEPENDS) +@BUILD_NLS))
$(eval $(call DefineBoostLibrary,log,system chrono date_time thread filesystem regex,))
$(eval $(call DefineBoostLibrary,math,,))
#$(eval $(call DefineBoostLibrary,mpi,,))
PKG_NAME:=check
PKG_VERSION:=0.9.14
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/check
endef
TARGET_CFLAGS += $(FPIC)
+CONFIGURE_VARS += \
+ hw_cv_func_snprintf_c99=yes \
+ hw_cv_func_vsnprintf_c99=yes \
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
include $(TOPDIR)/rules.mk
PKG_NAME:=gnutls
-PKG_VERSION:=3.4.2
+PKG_VERSION:=3.4.3
PKG_RELEASE:=1
PKG_USE_MIPS16:=0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=ftp://ftp.gnutls.org/gcrypt/gnutls/v3.4
-PKG_MD5SUM:=4fb4a6253e09aa070e6c467cbb51ba33
+PKG_MD5SUM:=8a119d7830b81a44faa721a6fde2a295
#PKG_FIXUP:=autoreconf gettext-version
PKG_MAINTAINER:=Nikos Mavrogiannopoulos <nmav@gnutls.org>
PKG_LICENSE:=LGPLv2.1+
endef
-define Package/libgnutls-openssl
-$(call Package/gnutls/Default)
- TITLE+= (OpenSSL compat library)
- DEPENDS+= +libgnutls
-endef
-
-define Package/libgnutls-openssl/description
-$(call Package/gnutls/Default/description)
- This package contains the GnuTLS OpenSSL compatibility layer shared library.
-endef
-
CONFIGURE_ARGS+= \
--enable-shared \
--enable-static \
--enable-local-libopts \
--disable-doc \
--disable-tests \
- --enable-openssl-compatibility \
--with-default-trust-store-dir=/etc/ssl/certs/ \
--disable-crywrap \
--with-librt-prefix="$(LIBRT_ROOT_DIR)/"
endef
-define Package/libgnutls-openssl/install
- $(INSTALL_DIR) $(1)/usr/lib
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls-openssl.so.* $(1)/usr/lib/
-endef
-
-
$(eval $(call BuildPackage,certtool))
$(eval $(call BuildPackage,gnutls-utils))
$(eval $(call BuildPackage,libgnutls))
-$(eval $(call BuildPackage,libgnutls-openssl))
include $(TOPDIR)/rules.mk
PKG_NAME:=libidn
-PKG_VERSION:=1.30
+PKG_VERSION:=1.32
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@GNU/libidn
-PKG_MD5SUM:=b17edc8551cd31cc5f14c82a9dabf58e
+PKG_MD5SUM:=4dd8356ba577287ea7076bfa1554b534
PKG_LICENSE:=GPL-2.0+ GPL-3.0+ LGPL-2.1+ LGPL-3.0+ Apache-2.0
PKG_LICENSE_FILES:=COPYING COPYINGv2 COPYINGv3 COPYING.LESSERv2 COPYING.LESSERv3 java/LICENSE-2.0.txt
include $(TOPDIR)/rules.mk
PKG_NAME:=libinput
-PKG_VERSION:=0.18.0
+PKG_VERSION:=0.20.0
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://www.freedesktop.org/software/libinput/
-PKG_MD5SUM:=0ddbb0d53d58dec0a86de6791560011a
+PKG_MD5SUM:=444f3a4061be560310cb761cac6fa178
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=COPYING
--- /dev/null
+choice
+ depends on PACKAGE_libstrophe
+ prompt "Select XML library"
+ default libstrophe-expat
+
+config libstrophe-expat
+ bool "expat"
+ select PACKAGE_libexpat
+
+config libstrophe-libxml2
+ bool "libxml2"
+ select PACKAGE_libxml2
+
+endchoice
--- /dev/null
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libstrophe
+PKG_VERSION:=0.8.7
+PKG_RELEASE=1
+
+PKG_LICENSE:=GPL-3.0
+PKG_LICENSE_FILES:=COPYING
+PKG_MAINTAINER:=Chih-Wei Chen <changeway@gmail.com>
+
+PKG_SOURCE_URL:=https://github.com/strophe/libstrophe/archive/
+PKG_SOURCE:=$(PKG_VERSION).tar.gz
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+PKG_CONFIG_DEPENDS:= \
+ CONFIG_libstrophe-libxml2 \
+ CONFIG_libstrophe-expat
+
+include $(INCLUDE_DIR)/package.mk
+
+ifeq ($(CONFIG_libstrophe-libxml2),y)
+CONFIGURE_ARGS += \
+ --with-libxml2
+endif
+
+define Package/libstrophe
+ SECTION:=libs
+ CATEGORY:=Libraries
+ TITLE:=XMPP client library
+ URL:=http://strophe.im/libstrophe
+ DEPENDS:= +libopenssl +libstrophe-libxml2:libxml2 +libstrophe-expat:libexpat
+ MENU:=1
+endef
+
+define Package/libstrophe/description
+ A simple, lightweight C library for writing XMPP clients
+endef
+
+define Package/libstrophe/config
+ source "$(SOURCE)/Config.in"
+endef
+
+define Build/InstallDev
+ $(INSTALL_DIR) $(1)/usr/
+ $(CP) $(PKG_INSTALL_DIR)/usr/include/ $(1)/usr/
+
+ $(INSTALL_DIR) $(1)/usr/lib/
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libstrophe.{la,a,so*} $(1)/usr/lib/
+endef
+
+define Package/libstrophe/install
+ $(INSTALL_DIR) $(1)/usr/lib/
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libstrophe.so.* $(1)/usr/lib
+endef
+
+$(eval $(call BuildPackage,libstrophe))
include $(TOPDIR)/rules.mk
PKG_NAME:=libunistring
-PKG_VERSION:=0.9.5
+PKG_VERSION:=0.9.6
PKG_RELEASE:=1
-PKG_MD5SUM:=1a705bcdcb83799d544137617b377cfd
+PKG_MD5SUM:=dfae4ff5583649ed24d8f368f1d0543b
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://ftp.gnu.org/gnu/libunistring
#
-# Copyright (C) 2006-2014 OpenWrt.org
+# Copyright (C) 2006-2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=mxml
-PKG_VERSION:=2.8
+PKG_VERSION:=2.9
PKG_RELEASE:=1
-PKG_MD5SUM:=d85ee6d30de053581242c4a86e79a5d2
+PKG_MD5SUM:=e21cad0f7aacd18f942aa0568a8dee19
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.msweet.org/files/project3/
include $(TOPDIR)/rules.mk
PKG_NAME:=opencv
-PKG_VERSION:=2.4.11
-PKG_RELEASE:=3
+PKG_VERSION:=3.0.0
+PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).zip
PKG_SOURCE_URL:=http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/$(PKG_VERSION)/
-PKG_MD5SUM:=32f498451bff1817a60e1aabc2939575
+PKG_MD5SUM:=09004c275d8092cbdf5b61675cecd399
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
-
define Package/opencv/Default/description
OpenCV (Open Source Computer Vision Library) is an open source computer
vision and machine learning software library. OpenCV was built to provide
define Package/opencv
SECTION:=libs
CATEGORY:=Libraries
- TITLE:=opencv-2.4.11
+ TITLE:=OpenCV
URL:=http://opencv.org/
MAINTAINER:=WRTnode Team <pub@wrtnode.com>
DEPENDS:=+libpthread +librt +libstdcpp +zlib +libjpeg
endef
-
PKG_INSTALL:=1
CMAKE_OPTIONS += -DBUILD_opencv_gpu:BOOL=OFF \
PKG_NAME:=openldap
PKG_VERSION:=2.4.41
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
PKG_SOURCE_URL:=ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/ \
--with-threads \
--with-tls \
--with-yielding_select="yes" \
- --without-cyrus-sasl \
--without-threads \
--enable-null \
--disable-bdb \
PKG_NAME:=pthsem
PKG_VERSION:=2.0.8
-PKG_RELEASE:=4
+PKG_RELEASE:=5
PKG_MAINTAINER:=Othmar Truniger <github@truniger.ch>
PKG_LICENSE:=LGPL-2.1+
--- /dev/null
+--- a/pth.h.in 2015-07-16 21:14:48.786970549 +0200
++++ b/pth.h.in 2015-07-16 21:15:22.439416462 +0200
+@@ -43,7 +43,7 @@
+ #include <time.h> /* for struct timespec */
+ #include <sys/time.h> /* for struct timeval */
+ #include <sys/socket.h> /* for sockaddr */
+-#include <sys/signal.h> /* for sigset_t */
++#include <signal.h> /* for sigset_t */
+ @EXTRA_INCLUDE_SYS_SELECT_H@
+
+ /* fallbacks for essential typedefs */
+--- a/pthread.h.in 2015-07-16 21:14:58.948310639 +0200
++++ b/pthread.h.in 2015-07-16 21:15:40.989869061 +0200
+@@ -111,7 +111,7 @@
+ #include <sys/types.h> /* for ssize_t */
+ #include <sys/time.h> /* for struct timeval */
+ #include <sys/socket.h> /* for sockaddr */
+-#include <sys/signal.h> /* for sigset_t */
++#include <signal.h> /* for sigset_t */
+ #include <time.h> /* for struct timespec */
+ #include <unistd.h> /* for off_t */
+ @EXTRA_INCLUDE_SYS_SELECT_H@
include $(TOPDIR)/rules.mk
PKG_NAME:=sqlite
-PKG_VERSION:=3081002
+PKG_VERSION:=3081101
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-autoconf-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.sqlite.org/2015/
-PKG_MD5SUM:=a18bfc015cd49a1e7a961b7b77bc3b37
+PKG_MD5SUM:=298c8d6af7ca314f68de92bc7a356cbe
PKG_LICENSE:=PUBLICDOMAIN
PKG_LICENSE_FILES:=
--- /dev/null
+#
+# Copyright (C) 2014, 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=yajl
+PKG_VERSION:=2.1.0
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Charles Southerland <charlie@stuphlabs.com>
+PKG_LICENSE:=ISC
+PKG_LICENSE_FILES:=COPYING
+PKG_REV:=66cb08ca2ad8581080b626a75dfca266a890afb2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=$(PKG_REV)
+PKG_SOURCE_URL:=git://github.com/lloyd/yajl.git
+PKG_SOURCE_PROTO:=git
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/yajl
+ SECTION:=libs
+ CATEGORY:=Libraries
+ TITLE:=Yet Another JSON Library
+ URL:=http://lloyd.github.io/yajl
+endef
+
+define Package/yajl/description
+ Yet Another JSON Library. YAJL is a small event-driven (SAX-style)
+JSON parser written in ANSI C, and a small validating JSON generator.
+YAJL is released under the ISC license.
+
+ YAJL was created by Lloyd Hilaiel.
+endef
+
+PKG_INSTALL:=1
+
+CMAKE_OPTIONS += \
+ -DCMAKE_BUILD_TYPE:String="Release"
+
+define Build/InstallDev
+ $(INSTALL_DIR) $(1)/usr/include
+ $(CP) $(PKG_INSTALL_DIR)/usr/include/yajl $(1)/usr/include/
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libyajl.so* $(1)/usr/lib/
+endef
+
+define Package/yajl/install
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libyajl.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,yajl))
--- /dev/null
+--- a/reformatter/CMakeLists.txt
++++ b/reformatter/CMakeLists.txt
+@@ -26,7 +26,7 @@
+
+ ADD_EXECUTABLE(json_reformat ${SRCS})
+
+-TARGET_LINK_LIBRARIES(json_reformat yajl_s)
++TARGET_LINK_LIBRARIES(json_reformat yajl_s m)
+
+ # copy the binary into the output directory
+ GET_TARGET_PROPERTY(binPath json_reformat LOCATION)
--- /dev/null
+--- a/perf/CMakeLists.txt
++++ b/perf/CMakeLists.txt
+@@ -20,4 +20,4 @@
+
+ ADD_EXECUTABLE(perftest ${SRCS})
+
+-TARGET_LINK_LIBRARIES(perftest yajl_s)
++TARGET_LINK_LIBRARIES(perftest yajl_s m)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:= http://download.zeromq.org
-PKG_MD5SUM:=73c39f5eb01b9d7eaf74a5d899f1d03d
+PKG_MD5SUM:=0a4b44aa085644f25c177f79dc13f253
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
PKG_BUILD_DEPENDS:=libuuid
PKG_FIXUP:=autoreconf
include $(INCLUDE_DIR)/uclibc++.mk
include $(INCLUDE_DIR)/package.mk
-define Package/libzmq
+define Package/libzmq/default
TITLE:=ZeroMQ - Message Queue engine
URL:=http://www.zeromq.org/
SECTION:=libs
CATEGORY:=Libraries
- DEPENDS:=+libuuid +libpthread +librt +PACKAGE_libsodium:libsodium $(CXX_DEPENDS)
- MENU:=1
+ DEPENDS:=+libuuid +libpthread +librt $(CXX_DEPENDS)
+ PROVIDES:=libzmq
endef
-define Package/libzmq/config
- config LIBZMQ_CURVEZMQ
- bool "Include support for CurveZMQ security"
- depends on PACKAGE_libzmq
- default y
- select PACKAGE_libsodium
+define Package/libzmq-nc
+ $(call Package/libzmq/default)
+ VARIANT:=nc
endef
-define Package/libzmq/description
+define Package/libzmq-curve
+ $(call Package/libzmq/default)
+ VARIANT:=curve
+ TITLE+= (CurveZMQ)
+ DEPENDS+=+libsodium
+endef
+
+define Package/libzmq-nc/description
This package contains the ZeroMQ messaging engine shared library.
- CurveZMQ security protocols are optional using libsodium.
+endef
+
+define Package/libzmq-curve/description
+ $(call Package/libzmq-nc/description)
+ Includes CurveZMQ security by libsodium.
endef
# add extra configure flags here
--enable-static \
--enable-shared
-ifneq ($(CONFIG_PACKAGE_libsodium),)
+ifeq ($(BUILD_VARIANT),curve)
CONFIGURE_ARGS+= --with-libsodium
else
CONFIGURE_ARGS+= --without-libsodium
endif
-# add make variable overrides here
-MAKE_FLAGS +=
-
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/zmq.h $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libzmq.pc $(1)/usr/lib/pkgconfig/
endef
-define Package/libzmq/install
+define Package/libzmq-nc/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libzmq.so.* $(1)/usr/lib/
endef
-$(eval $(call BuildPackage,libzmq))
+Package/libzmq-curve/install=$(Package/libzmq-nc/install)
+
+$(eval $(call BuildPackage,libzmq-nc))
+$(eval $(call BuildPackage,libzmq-curve))
--- /dev/null
+--- a/configure.ac
++++ b/configure.ac
+@@ -147,8 +147,10 @@ case "${host_os}" in
+ *linux*)
+ # Define on Linux to enable all library features. Define if using a gnu compiler
+ if test "x$GXX" = "xyes"; then
+- CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS"
++ CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS -Wno-long-long"
+ fi
++ libzmq_pedantic="no"
++ libzmq_werror="no"
+ AC_DEFINE(ZMQ_HAVE_LINUX, 1, [Have Linux OS])
+ libzmq_on_linux="yes"
+
--- /dev/null
+--- a/src/metadata.hpp
++++ b/src/metadata.hpp
+@@ -31,7 +31,7 @@ namespace zmq
+ {
+ public:
+
+- typedef std::map <std::string, const std::string> dict_t;
++ typedef std::map <std::string, std::string> dict_t;
+
+ metadata_t (const dict_t &dict);
+ virtual ~metadata_t ();
+--- a/src/socket_base.cpp
++++ b/src/socket_base.cpp
+@@ -20,6 +20,7 @@
+ #include <new>
+ #include <string>
+ #include <algorithm>
++#include <ctype.h>
+
+ #include "platform.hpp"
+
+--- a/src/stream_engine.cpp
++++ b/src/stream_engine.cpp
+@@ -198,7 +198,7 @@ void zmq::stream_engine_t::plug (io_thre
+ // Compile metadata.
+ typedef metadata_t::dict_t properties_t;
+ properties_t properties;
+- properties.insert(std::make_pair("Peer-Address", peer_address));
++ properties.insert(std::make_pair<std::string, std::string>("Peer-Address", peer_address));
+ zmq_assert (metadata == NULL);
+ metadata = new (std::nothrow) metadata_t (properties);
+ }
+@@ -805,7 +805,7 @@ void zmq::stream_engine_t::mechanism_rea
+
+ // If we have a peer_address, add it to metadata
+ if (!peer_address.empty()) {
+- properties.insert(std::make_pair("Peer-Address", peer_address));
++ properties.insert(std::make_pair<std::string, std::string>("Peer-Address", peer_address));
+ }
+
+ // Add ZAP properties.
--- /dev/null
+--- a/src/blob.hpp
++++ b/src/blob.hpp
+@@ -21,6 +21,7 @@
+ #define __ZMQ_BLOB_HPP_INCLUDED__
+
+ #include <string>
++#include <ios>
+ #include <string.h>
+
+ // Borrowed from id3lib_strings.h:
--- /dev/null
+--- a/src/mtrie.cpp
++++ b/src/mtrie.cpp
+@@ -17,11 +17,11 @@
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+-#include <stdlib.h>
+-
+ #include <new>
+ #include <algorithm>
+
++#include <stdlib.h>
++
+ #include "platform.hpp"
+ #if defined ZMQ_HAVE_WINDOWS
+ #include "windows.hpp"
+--- a/src/raw_encoder.cpp
++++ b/src/raw_encoder.cpp
+@@ -17,6 +17,11 @@
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
++#include <basic_definitions>
++#include <exception>
++#include <cstddef>
++#include <algorithm>
++
+ #include "encoder.hpp"
+ #include "raw_encoder.hpp"
+ #include "likely.hpp"
+--- a/src/trie.cpp
++++ b/src/trie.cpp
+@@ -17,11 +17,11 @@
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+-#include <stdlib.h>
+-
+ #include <new>
+ #include <algorithm>
+
++#include <stdlib.h>
++
+ #include "platform.hpp"
+ #if defined ZMQ_HAVE_WINDOWS
+ #include "windows.hpp"
+--- a/src/encoder.hpp
++++ b/src/encoder.hpp
+@@ -29,7 +29,6 @@
+ #include <stddef.h>
+ #include <string.h>
+ #include <stdlib.h>
+-#include <algorithm>
+
+ #include "err.hpp"
+ #include "msg.hpp"
+--- a/src/v1_encoder.cpp
++++ b/src/v1_encoder.cpp
+@@ -17,6 +17,11 @@
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
++#include <basic_definitions>
++#include <exception>
++#include <cstddef>
++#include <algorithm>
++
+ #include "encoder.hpp"
+ #include "v1_encoder.hpp"
+ #include "likely.hpp"
+--- a/src/v2_encoder.cpp
++++ b/src/v2_encoder.cpp
+@@ -17,6 +17,11 @@
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
++#include <basic_definitions>
++#include <exception>
++#include <cstddef>
++#include <algorithm>
++
+ #include "v2_protocol.hpp"
+ #include "v2_encoder.hpp"
+ #include "likely.hpp"
+++ /dev/null
---- a/configure.ac 2014-06-04 10:19:35.140061796 +0800
-+++ b/configure.ac 2014-06-04 11:08:17.231997926 +0800
-@@ -127,8 +127,10 @@
- *linux*)
- # Define on Linux to enable all library features. Define if using a gnu compiler
- if test "x$GXX" = "xyes"; then
-- CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS"
-+ CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS -Wno-long-long"
- fi
-+ libzmq_pedantic="no"
-+ libzmq_werror="no"
- AC_DEFINE(ZMQ_HAVE_LINUX, 1, [Have Linux OS])
- libzmq_on_linux="yes"
-
+++ /dev/null
---- a/src/metadata.hpp 2015-06-17 21:39:33.629934688 +0800
-+++ b/src/metadata.hpp 2014-10-14 22:07:36.000000000 +0800
-@@ -31,7 +31,7 @@
- {
- public:
-
-- typedef std::map <std::string, const std::string> dict_t;
-+ typedef std::map <std::string, std::string> dict_t;
-
- metadata_t (const dict_t &dict);
- virtual ~metadata_t ();
---- a/src/socket_base.cpp 2015-06-17 21:42:26.289413233 +0800
-+++ b/src/socket_base.cpp 2015-06-02 18:31:00.000000000 +0800
-@@ -20,6 +20,7 @@
- #include <new>
- #include <string>
- #include <algorithm>
-+#include <ctype.h>
-
- #include "platform.hpp"
-
---- a/src/stream_engine.cpp 2015-06-17 21:57:29.599443517 +0800
-+++ b/src/stream_engine.cpp 2015-06-02 18:31:00.000000000 +0800
-@@ -198,7 +198,7 @@
- // Compile metadata.
- typedef metadata_t::dict_t properties_t;
- properties_t properties;
-- properties.insert(std::make_pair("Peer-Address", peer_address));
-+ properties.insert(std::make_pair<std::string, std::string>("Peer-Address", peer_address));
- zmq_assert (metadata == NULL);
- metadata = new (std::nothrow) metadata_t (properties);
- }
-@@ -805,7 +805,7 @@
-
- // If we have a peer_address, add it to metadata
- if (!peer_address.empty()) {
-- properties.insert(std::make_pair("Peer-Address", peer_address));
-+ properties.insert(std::make_pair<std::string, std::string>("Peer-Address", peer_address));
- }
-
- // Add ZAP properties.
+++ /dev/null
---- a/src/blob.hpp 2014-06-04 10:19:12.680062287 +0800
-+++ b/src/blob.hpp 2014-06-04 10:30:31.168047457 +0800
-@@ -21,6 +21,7 @@
- #define __ZMQ_BLOB_HPP_INCLUDED__
-
- #include <string>
-+#include <ios>
- #include <string.h>
-
- // Borrowed from id3lib_strings.h:
include $(TOPDIR)/rules.mk
PKG_NAME:=ffmpeg
-PKG_VERSION:=2.6.3
-PKG_RELEASE:=2
+PKG_VERSION:=2.7.2
+PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://ffmpeg.org/releases/
-PKG_MD5SUM:=e2cc3c209f91393d35ab58598e41cf22
+PKG_MD5SUM:=7eb2140bab9f0a8669b65b50c8e4cfb5
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
PKG_LICENSE:=LGPL-2.1+ GPL-2+ LGPL-3
include $(TOPDIR)/rules.mk
PKG_NAME:=bwm-ng
-PKG_VERSION:=0.6
-PKG_RELEASE:=2
+PKG_VERSION:=0.6.1
+PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.gropp.org/bwm-ng
-PKG_MD5SUM:=d3a02484fb7946371bfb4e10927cebfb
+PKG_MD5SUM:=ef0c7669508e95f56250ad4f8db98b7f
PKG_MAINTAINER:=Julen Landa Alustiza <julen@zokormazo.info>
PKG_LICENSE:=GPL2-2.0
PKG_LICENSE_FILES:=COPYING
+++ /dev/null
---- a/src/output.c
-+++ b/src/output.c
-@@ -234,7 +234,7 @@ int print_header(int option) {
- if (output_method==PLAIN_OUT && ansi_output) printf("\033[1;2H");
- printf("bwm-ng v" VERSION " (delay %2.3fs); ",(float)delay/1000);
- if (output_method==PLAIN_OUT) printf("press 'ctrl-c' to end this%s",(ansi_output ? "\033[2;2H" : "")); else printf("input: ");
-- printf(input2str());
-+ printf("%s\n",input2str());
- printf("%s\n",show_all_if2str());
- if (output_method==PLAIN_OUT) {
- if (ansi_output)
#
-# Copyright (C) 2006-2008 OpenWrt.org
+# Copyright (C) 2006-2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
PKG_NAME:=ctorrent
PKG_VERSION:=dnh3.3.2
-PKG_RELEASE:=6
+PKG_RELEASE:=7
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/dtorrent \
--- /dev/null
+--- a/compat.c
++++ b/compat.c
+@@ -63,6 +63,7 @@ int snprintf(char *str, size_t size, con
+
+ #ifndef HAVE_STRNSTR
+ #include <string.h>
++#include <sys/types.h>
+ /* FUNCTION PROGRAMER: Siberiaic Sang */
+ char *strnstr(const char *haystack, const char *needle, size_t haystacklen)
+ {
include $(TOPDIR)/rules.mk
PKG_NAME:=dnscrypt-proxy
-PKG_VERSION:=1.5.0
+PKG_VERSION:=1.6.0
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://download.dnscrypt.org/dnscrypt-proxy
-PKG_MD5SUM:=bcaaaae4797082dd7a6ba618cc3e687c
+PKG_MD5SUM:=039b8106cf4e15302dc2487cb7fbb17b
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
config dnscrypt-proxy
option address '127.0.0.1'
option port '5353'
- # option resolver 'opendns'
+ # option resolver 'cisco'
# option resolvers_list '/usr/share/dnscrypt-proxy/dnscrypt-resolvers.csv'
# option ephemeral_keys '1'
+ # more details at https://github.com/jedisct1/dnscrypt-proxy#public-key-client-authentication
+ # option client_key ''
config_get port "$section" 'port'
config_get resolver "$section" 'resolver'
config_get resolvers_list "$section" 'resolvers_list'
+ config_get client_key "$section" 'client_key'
config_get_bool ephemeral_keys "$section" 'ephemeral_keys'
service_start /usr/sbin/dnscrypt-proxy -d \
-a ${address}:${port} \
-u nobody \
-L ${resolvers_list:-'/usr/share/dnscrypt-proxy/dnscrypt-resolvers.csv'} \
- -R ${resolver:-'opendns'} \
- ${ephemeral_keys:+'-E'}
+ -R ${resolver:-'cisco'} \
+ ${ephemeral_keys:+'-E'} \
+ ${client_key:+'--client-key='$client_key}
}
start() {
include $(TOPDIR)/rules.mk
PKG_NAME:=freeradius2
-PKG_VERSION:=2.2.7
+PKG_VERSION:=2.2.8
PKG_RELEASE:=1
PKG_SOURCE:=freeradius-server-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=\
ftp://ftp.freeradius.org/pub/freeradius/ \
ftp://ftp.freeradius.org/pub/freeradius/old/
-PKG_MD5SUM:=b84b9ffa1ac9b20b2643e5a08ac483a1
+PKG_MD5SUM:=0adc2454392ab8a43664dea416022e28
PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYRIGHT LICENSE
include $(TOPDIR)/rules.mk
PKG_NAME:=git
-PKG_VERSION:=2.4.2
+PKG_VERSION:=2.4.6
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@KERNEL/software/scm/git/
-PKG_MD5SUM:=0b8dc818ed4766342978d744522aec49
+PKG_MD5SUM:=fb2c5214f5dc90bad0a2abdd4c425df6
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
NO_MKSTEMPS="YesPlease" \
NO_GETTEXT="YesPlease" \
NO_UNIX_SOCKETS="YesPlease" \
- NO_IPV6="YesPlease" \
NO_ICONV="YesPlease" \
NO_NSEC="YesPlease" \
NO_PERL="YesPlease" \
$(RM) $(PKG_INSTALL_DIR)/usr/bin/git-cvsserver
$(CP) $(PKG_INSTALL_DIR)/usr/bin/git-* $(1)/usr/bin
$(INSTALL_DIR) $(1)/usr/lib/git-core
+ $(LN) /usr/bin/git $(1)/usr/lib/git-core/git
( cd $(PKG_INSTALL_DIR); $(TAR) \
--exclude=usr/lib/git-core/git-http-backend \
--exclude=usr/lib/git-core/git-http-fetch \
git-http-fetch$X: http.o http-walker.o http-fetch.o GIT-LDFLAGS $(GITLIBS)
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
$(LIBS) $(CURL_LIBCURL)
-@@ -2277,10 +2269,11 @@ endif
+@@ -2279,10 +2271,11 @@ endif
bindir=$$(cd '$(DESTDIR_SQ)$(bindir_SQ)' && pwd) && \
execdir=$$(cd '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' && pwd) && \
{ test "$$bindir/" = "$$execdir/" || \
include $(TOPDIR)/rules.mk
PKG_NAME:=gnunet
-PKG_SOURCE_VERSION:=36048
+PKG_SOURCE_VERSION:=36139
PKG_VERSION:=0.10.1-svn$(PKG_SOURCE_VERSION)
PKG_RELEASE:=1
# ToDo:
+# - UCI integration
# - break-out {peer,name,data}store for each backend
# - package testing stuff
done )
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/gnunet/hellos/* $(1)/usr/share/gnunet/hellos
- $(INSTALL_DIR) $(1)/etc/init.d/
+ $(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/gnunet.init $(1)/etc/init.d/gnunet
+ $(INSTALL_DIR) $(1)/lib/upgrade/keep.d
+ $(INSTALL_DATA) ./files/gnunet.upgrade $(1)/lib/upgrade/keep.d/gnunet
endef
define Build/InstallDev
DEPENDS_transport-http_server:=+libmicrohttpd
PLUGIN_transport-http_server:=transport_http_server transport_https_server
-PLUGIN_transport-wifi:=transport_wlan
-LIBEXEC_transport-wifi:=helper-transport-wlan
+PLUGIN_transport-wlan:=transport_wlan
+LIBEXEC_transport-wlan:=helper-transport-wlan
DEPENDS_experiments:=+libglpk
PLUGIN_experiments:=ats_mlp ats_ril
DEPENDS_datastore:=+gnunet-gns +libsqlite3
BIN_datastore:=datastore
LIB_datastore:=datastore
-PLUGIN_datastore:=datacache_sqlite datastore_heap datastore_sqlite namecache_sqlite namestore_sqlite peerstore_sqlite
+PLUGIN_datastore:=datastore_heap
LIBEXEC_datastore:=daemon-latency-logger service-datastore
CONF_datastore:=datastore
LIBEXEC_transport-bluetooth:=helper-transport-bluetooth
DEPENDS_utils:=+certtool +openssl-util
-BIN_utils:=config gns-proxy-setup-ca transport-certificate-creation
+BIN_utils:=gns-proxy-setup-ca transport-certificate-creation
DEPENDS_vpn:=+kmod-tun
+BIN_vpn:=vpn
LIB_vpn:=tun vpn
LIBEXEC_vpn:=daemon-exit daemon-pt helper-exit helper-vpn service-vpn
CONF_vpn:=exit pt vpn
}
prepare_config() {
- mkdir -p $GNUNET_HOME
- chown gnunet:gnunet $GNUNET_HOME
- chmod 0750 $GNUNET_HOME
+ if [ ! -e "$GNUNET_HOME" ]; then
+ mkdir -p $GNUNET_HOME
+ chown gnunet:gnunet $GNUNET_HOME
+ chmod 0750 $GNUNET_HOME
+ fi
touch $CONFIGFILE
chown root:gnunet $CONFIGFILE
chmod 0640 $CONFIGFILE
gnunet-config -c $CONFIGFILE -s PATHS -o GNUNET_HOME -V $GNUNET_HOME
- # enable gns2dns service
- defaultservices=$( gnunet-config -c /tmp/run/gnunet/gnunet.conf -s arm -o DEFAULTSERVICES )
- defaultservices="$defaultservices dns2gns"
+
+ # minimal persistency in /etc/gnunet
+ [ ! -d /etc/gnunet ] && {
+ mkdir -p /etc/gnunet
+ chown gnunet:gnunet /etc/gnunet
+ }
+ gnunet-config -c $CONFIGFILE -s PATHS -o GNUNET_CONFIG_HOME -V /etc/gnunet
+ gnunet-config -c $CONFIGFILE -s PEER -o PRIVATE_KEY -V /etc/gnunet/private_key.ecc
+ gnunet-config -c $CONFIGFILE -s identity -o EGODIR -V /etc/gnunet/identity/egos
+ gnunet-config -c $CONFIGFILE -s revocation -o DATABASE -V /etc/gnunet/revocation.dat
+ gnunet-config -c $CONFIGFILE -s nse -o PROOFFILE -V /etc/gnunet/proof.dat
+ gnunet-config -c $CONFIGFILE -s namestore-sqlite -o FILENAME -V /etc/gnunet/namestore.sqlite
+
+ # minimal datastore (todo: make this configurable)
+ gnunet-config -c $CONFIGFILE -s datastore -o DATABASE -V heap
+ gnunet-config -c $CONFIGFILE -s datastore -o QUOTA -V "4 MB"
+ gnunet-config -c $CONFIGFILE -s fs -o CONTENT_PUSHING -V NO
+ gnunet-config -c $CONFIGFILE -s fs -o CONTENT_CACHING -V NO
+
+ # limit dhtcache memory usage to 4 MB
+ gnunet-config -c $CONFIGFILE -s dhtcache -o QUOTA -V "4 MB"
+
+ # enable dns2gns
+ gnunet-config -c $CONFIGFILE -s dns2gns -o AUTOSTART -V YES
+ gnunet-config -c $CONFIGFILE -s dns2gns -o FORCESTART -V YES
+
# enable all installed transport plugins
- gnunet-config -c $CONFIGFILE -s arm -o DEFAULTSERVICES -V "$defaultservices"
transport_plugins=$(gnunet-config -c $CONFIGFILE -s transport -o PLUGINS)
for transplug in /usr/lib/gnunet/libgnunet_plugin_transport_*.so; do
transplug=$( echo $transplug |
transport_plugins="$transport_plugins $transplug"
done
gnunet-config -c $CONFIGFILE -s transport -o PLUGINS -V "$transport_plugins"
+
+ gnunet-config -c $CONFIGFILE -s pt -o FORCESTART -V YES
+ gnunet-config -c $CONFIGFILE -s exit -o AUTOSTART -V YES
+ gnunet-config -c $CONFIGFILE -s exit -o FORCESTART -V YES
+ gnunet-config -c $CONFIGFILE -s exit -o EXIT_IPV4 -V YES
+ # ssh and www services
+# gnunet-config -c $CONFIGFILE -s exit -o EXIT_RANGE_IPV4_POLICY -V "169.254.86.1:22;169.254.86.1:80;"
+# gnunet-config -c $CONFIGFILE -s ssh.gnunet. -o TCP_REDIRECTS -V "22:169.254.86.1:22"
+# gnunet-config -c $CONFIGFILE -s www.gnunet. -o TCP_REDIRECTS -V "80:169.254.86.1:80"
+ # iperf (TCP) and echo (UDP) for battlemesh
+ gnunet-config -c $CONFIGFILE -s exit -o EXIT_RANGE_IPV4_POLICY -V "169.254.86.1:7;169.254.86.1:5201;"
+ gnunet-config -c $CONFIGFILE -s iperf.gnunet. -o TCP_REDIRECTS -V "5201:169.254.86.1:5201"
+ gnunet-config -c $CONFIGFILE -s echo.gnunet. -o UDP_REDIRECTS -V "7:169.254.86.1:7"
}
start_service() {
fix_libexec_permissions
- [ ! -e $GNUNET_HOME ] && prepare_config
+ prepare_config
procd_open_instance
procd_set_param user gnunet
--- /dev/null
+/etc/gnunet
PKG_NAME:=gnurl
PKG_VERSION:=7.40.0
-PKG_RELEASE:=5
+PKG_RELEASE:=6
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://gnunet.org/sites/default/files
lib/vtls/gtls.h | 3 +++
4 files changed, 29 insertions(+), 5 deletions(-)
-diff --git a/acinclude.m4 b/acinclude.m4
-index 6ed7ffb..ca01869 100644
--- a/acinclude.m4
+++ b/acinclude.m4
-@@ -2615,8 +2615,8 @@ AC_HELP_STRING([--without-ca-path], [Don't use a default CA path]),
+@@ -2614,8 +2614,8 @@ AC_HELP_STRING([--without-ca-path], [Don
capath="no"
elif test "x$want_capath" != "xno" -a "x$want_capath" != "xunset"; then
dnl --with-ca-path given
fi
capath="$want_capath"
ca="no"
-diff --git a/docs/libcurl/opts/CURLOPT_CAPATH.3 b/docs/libcurl/opts/CURLOPT_CAPATH.3
-index 642953d..6695f9f 100644
--- a/docs/libcurl/opts/CURLOPT_CAPATH.3
+++ b/docs/libcurl/opts/CURLOPT_CAPATH.3
-@@ -43,9 +43,8 @@ All TLS based protocols: HTTPS, FTPS, IMAPS, POP3, SMTPS etc.
+@@ -43,9 +43,8 @@ All TLS based protocols: HTTPS, FTPS, IM
.SH EXAMPLE
TODO
.SH AVAILABILITY
.SH RETURN VALUE
Returns CURLE_OK if TLS enabled, and CURLE_UNKNOWN_OPTION if not, or
CURLE_OUT_OF_MEMORY if there was insufficient heap space.
-diff --git a/lib/vtls/gtls.c b/lib/vtls/gtls.c
-index 05aef19..c792540 100644
--- a/lib/vtls/gtls.c
+++ b/lib/vtls/gtls.c
-@@ -97,6 +97,10 @@ static bool gtls_inited = FALSE;
- # if (GNUTLS_VERSION_NUMBER >= 0x03020d)
- # define HAS_OCSP
+@@ -98,6 +98,10 @@ static bool gtls_inited = FALSE;
+ # define HAS_ALPN
+ # endif
# endif
+
+# if (GNUTLS_VERSION_NUMBER >= 0x030306)
+# endif
#endif
- #ifdef HAS_OCSP
-@@ -462,6 +466,24 @@ gtls_connect_step1(struct connectdata *conn,
+ /*
+@@ -463,6 +467,24 @@ gtls_connect_step1(struct connectdata *c
rc, data->set.ssl.CAfile);
}
if(data->set.ssl.CRLfile) {
/* set the CRL list file */
rc = gnutls_certificate_set_x509_crl_file(conn->ssl[sockindex].cred,
-diff --git a/lib/vtls/gtls.h b/lib/vtls/gtls.h
-index c3867e5..af1cb5b 100644
--- a/lib/vtls/gtls.h
+++ b/lib/vtls/gtls.h
-@@ -54,6 +54,9 @@ bool Curl_gtls_cert_status_request(void);
- /* Set the API backend definition to GnuTLS */
- #define CURL_SSL_BACKEND CURLSSLBACKEND_GNUTLS
+@@ -53,6 +53,9 @@ void Curl_gtls_md5sum(unsigned char *tmp
+ unsigned char *md5sum, /* output */
+ size_t md5len);
+/* this backend supports the CAPATH option */
+#define have_curlssl_ca_path 1
/* API setup for GnuTLS */
#define curlssl_init Curl_gtls_init
#define curlssl_cleanup Curl_gtls_cleanup
---
-2.4.4
-
--- /dev/null
+From 6218ded6001ea330e589f92b6b2fa12777752b5d Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg <daniel@haxx.se>
+Date: Thu, 16 Apr 2015 23:52:04 +0200
+Subject: [PATCH] fix_hostname: zero length host name caused -1 index offset
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+If a URL is given with a zero-length host name, like in "http://:80" or
+just ":80", `fix_hostname()` will index the host name pointer with a -1
+offset (as it blindly assumes a non-zero length) and both read and
+assign that address.
+
+CVE-2015-3144
+
+Bug: http://curl.haxx.se/docs/adv_20150422D.html
+Reported-by: Hanno Böck
+---
+ lib/url.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/lib/url.c
++++ b/lib/url.c
+@@ -3602,7 +3602,7 @@ static void fix_hostname(struct SessionH
+ host->dispname = host->name;
+
+ len = strlen(host->name);
+- if(host->name[len-1] == '.')
++ if(len && (host->name[len-1] == '.'))
+ /* strip off a single trailing dot if present, primarily for SNI but
+ there's no use for it */
+ host->name[len-1]=0;
--- /dev/null
+From ea595c516bc936a514753597aa6c59fd6eb0765e Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg <daniel@haxx.se>
+Date: Thu, 16 Apr 2015 16:37:40 +0200
+Subject: [PATCH] cookie: cookie parser out of boundary memory access
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The internal libcurl function called sanitize_cookie_path() that cleans
+up the path element as given to it from a remote site or when read from
+a file, did not properly validate the input. If given a path that
+consisted of a single double-quote, libcurl would index a newly
+allocated memory area with index -1 and assign a zero to it, thus
+destroying heap memory it wasn't supposed to.
+
+CVE-2015-3145
+
+Bug: http://curl.haxx.se/docs/adv_20150422C.html
+Reported-by: Hanno Böck
+---
+ lib/cookie.c | 12 +++++++-----
+ 1 file changed, 7 insertions(+), 5 deletions(-)
+
+--- a/lib/cookie.c
++++ b/lib/cookie.c
+@@ -236,11 +236,14 @@ static char *sanitize_cookie_path(const
+ return NULL;
+
+ /* some stupid site sends path attribute with '"'. */
++ len = strlen(new_path);
+ if(new_path[0] == '\"') {
+- memmove((void *)new_path, (const void *)(new_path + 1), strlen(new_path));
++ memmove((void *)new_path, (const void *)(new_path + 1), len);
++ len--;
+ }
+- if(new_path[strlen(new_path) - 1] == '\"') {
+- new_path[strlen(new_path) - 1] = 0x0;
++ if(len && (new_path[len - 1] == '\"')) {
++ new_path[len - 1] = 0x0;
++ len--;
+ }
+
+ /* RFC6265 5.2.4 The Path Attribute */
+@@ -252,8 +255,7 @@ static char *sanitize_cookie_path(const
+ }
+
+ /* convert /hoge/ to /hoge */
+- len = strlen(new_path);
+- if(1 < len && new_path[len - 1] == '/') {
++ if(len && new_path[len - 1] == '/') {
+ new_path[len - 1] = 0x0;
+ }
+
--- /dev/null
+From 69a2e8d7ec581695a62527cb2252e7350f314ffa Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg <daniel@haxx.se>
+Date: Thu, 23 Apr 2015 15:58:21 +0200
+Subject: [PATCH] CURLOPT_HEADEROPT: default to separate
+
+Make the HTTP headers separated by default for improved security and
+reduced risk for information leakage.
+
+Bug: http://curl.haxx.se/docs/adv_20150429.html
+Reported-by: Yehezkel Horowitz, Oren Souroujon
+---
+ docs/libcurl/opts/CURLOPT_HEADEROPT.3 | 12 ++++++------
+ lib/url.c | 1 +
+ tests/data/test1527 | 2 +-
+ tests/data/test287 | 2 +-
+ tests/libtest/lib1527.c | 1 +
+ 5 files changed, 10 insertions(+), 8 deletions(-)
+
+--- a/docs/libcurl/opts/CURLOPT_HEADEROPT.3
++++ b/docs/libcurl/opts/CURLOPT_HEADEROPT.3
+@@ -5,7 +5,7 @@
+ .\" * | (__| |_| | _ <| |___
+ .\" * \___|\___/|_| \_\_____|
+ .\" *
+-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
++.\" * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
+ .\" *
+ .\" * This software is licensed as described in the file COPYING, which
+ .\" * you should have received as part of this distribution. The terms
+@@ -31,10 +31,10 @@ CURLcode curl_easy_setopt(CURL *handle,
+ Pass a long that is a bitmask of options of how to deal with headers. The two
+ mutually exclusive options are:
+
+-\fBCURLHEADER_UNIFIED\fP - keep working as before. This means
+-\fICURLOPT_HTTPHEADER(3)\fP headers will be used in requests both to servers
+-and proxies. With this option enabled, \fICURLOPT_PROXYHEADER(3)\fP will not
+-have any effect.
++\fBCURLHEADER_UNIFIED\fP - the headers specified in
++\fICURLOPT_HTTPHEADER(3)\fP will be used in requests both to servers and
++proxies. With this option enabled, \fICURLOPT_PROXYHEADER(3)\fP will not have
++any effect.
+
+ \fBCURLHEADER_SEPARATE\fP - makes \fICURLOPT_HTTPHEADER(3)\fP headers only get
+ sent to a server and not to a proxy. Proxy headers must be set with
+@@ -44,7 +44,7 @@ headers. When doing CONNECT, libcurl wil
+ headers only to the proxy and then \fICURLOPT_HTTPHEADER(3)\fP headers only to
+ the server.
+ .SH DEFAULT
+-CURLHEADER_UNIFIED
++CURLHEADER_SEPARATE (changed in 7.42.1, ased CURLHEADER_UNIFIED before then)
+ .SH PROTOCOLS
+ HTTP
+ .SH EXAMPLE
+--- a/lib/url.c
++++ b/lib/url.c
+@@ -605,6 +605,7 @@ CURLcode Curl_init_userdefined(struct Us
+ set->ssl_enable_alpn = TRUE;
+
+ set->expect_100_timeout = 1000L; /* Wait for a second by default. */
++ set->sep_headers = TRUE; /* separated header lists by default */
+ return result;
+ }
+
+--- a/tests/data/test1527
++++ b/tests/data/test1527
+@@ -45,7 +45,7 @@ http-proxy
+ lib1527
+ </tool>
+ <name>
+-Check same headers are generated without CURLOPT_PROXYHEADER
++Check same headers are generated with CURLOPT_HEADEROPT == CURLHEADER_UNIFIED
+ </name>
+ <command>
+ http://the.old.moo.1527:%HTTPPORT/1527 %HOSTIP:%PROXYPORT
+--- a/tests/data/test287
++++ b/tests/data/test287
+@@ -28,7 +28,7 @@ http
+ HTTP proxy CONNECT with custom User-Agent header
+ </name>
+ <command>
+-http://test.remote.example.com.287:%HTTPPORT/path/287 -H "User-Agent: looser/2007" --proxy http://%HOSTIP:%HTTPPORT --proxytunnel
++http://test.remote.example.com.287:%HTTPPORT/path/287 -H "User-Agent: looser/2015" --proxy http://%HOSTIP:%HTTPPORT --proxytunnel --proxy-header "User-Agent: looser/2007"
+ </command>
+ </client>
+
+--- a/tests/libtest/lib1527.c
++++ b/tests/libtest/lib1527.c
+@@ -83,6 +83,7 @@ int test(char *URL)
+ test_setopt(curl, CURLOPT_READFUNCTION, read_callback);
+ test_setopt(curl, CURLOPT_HTTPPROXYTUNNEL, 1L);
+ test_setopt(curl, CURLOPT_INFILESIZE, strlen(data));
++ test_setopt(curl, CURLOPT_HEADEROPT, CURLHEADER_UNIFIED);
+
+ res = curl_easy_perform(curl);
+
--- /dev/null
+From e6d7c30734487246e83b95520e81bc1ccf0a2376 Mon Sep 17 00:00:00 2001
+From: Kamil Dudka <kdudka@redhat.com>
+Date: Thu, 28 May 2015 20:04:35 +0200
+Subject: [PATCH] http: do not leak basic auth credentials on re-used
+ connections
+
+CVE-2015-3236
+
+This partially reverts commit curl-7_39_0-237-g87c4abb
+
+Bug: http://curl.haxx.se/docs/adv_20150617A.html
+---
+ lib/http.c | 16 ++++------------
+ 1 file changed, 4 insertions(+), 12 deletions(-)
+
+--- a/lib/http.c
++++ b/lib/http.c
+@@ -2327,20 +2327,12 @@ CURLcode Curl_http(struct connectdata *c
+ te
+ );
+
+- /*
+- * Free userpwd for Negotiate/NTLM. Cannot reuse as it is associated with
+- * the connection and shouldn't be repeated over it either.
+- */
+- switch (data->state.authhost.picked) {
+- case CURLAUTH_NEGOTIATE:
+- case CURLAUTH_NTLM:
+- case CURLAUTH_NTLM_WB:
+- Curl_safefree(conn->allocptr.userpwd);
+- break;
+- }
++ /* clear userpwd to avoid re-using credentials from re-used connections */
++ Curl_safefree(conn->allocptr.userpwd);
+
+ /*
+- * Same for proxyuserpwd
++ * Free proxyuserpwd for Negotiate/NTLM. Cannot reuse as it is associated
++ * with the connection and shouldn't be repeated over it either.
+ */
+ switch (data->state.authproxy.picked) {
+ case CURLAUTH_NEGOTIATE:
--- a/configure.ac
+++ b/configure.ac
-@@ -2885,6 +2885,7 @@ CURL_VERIFY_RUNTIMELIBS
+@@ -2879,6 +2879,7 @@ CURL_VERIFY_RUNTIMELIBS
AC_CHECK_SIZEOF(size_t)
AC_CHECK_SIZEOF(long)
--- a/Makefile.am
+++ b/Makefile.am
-@@ -129,7 +129,7 @@ CLEANFILES = $(VC6_LIBDSP) $(VC6_SRCDSP) $(VC7_LIBVCPROJ) $(VC7_SRCVCPROJ) \
- bin_SCRIPTS = curl-config
+@@ -129,7 +129,7 @@ CLEANFILES = $(VC6_LIBDSP) $(VC6_SRCDSP)
+ bin_SCRIPTS = gnurl-config
SUBDIRS = lib src include
-DIST_SUBDIRS = $(SUBDIRS) tests packages docs
+DIST_SUBDIRS = $(SUBDIRS) packages
pkgconfigdir = $(libdir)/pkgconfig
- pkgconfig_DATA = libcurl.pc
+ pkgconfig_DATA = libgnurl.pc
--- a/Makefile.in
+++ b/Makefile.in
-@@ -577,7 +577,7 @@ CLEANFILES = $(VC6_LIBDSP) $(VC6_SRCDSP) $(VC7_LIBVCPROJ) $(VC7_SRCVCPROJ) \
+@@ -577,7 +577,7 @@ CLEANFILES = $(VC6_LIBDSP) $(VC6_SRCDSP)
- bin_SCRIPTS = curl-config
+ bin_SCRIPTS = gnurl-config
SUBDIRS = lib src include
-DIST_SUBDIRS = $(SUBDIRS) tests packages docs
+DIST_SUBDIRS = $(SUBDIRS) packages
pkgconfigdir = $(libdir)/pkgconfig
- pkgconfig_DATA = libcurl.pc
+ pkgconfig_DATA = libgnurl.pc
LIB_VTLS_CFILES = vtls/openssl.c vtls/gtls.c vtls/vtls.c vtls/nss.c \
define Package/iotivity
SECTION:=net
CATEGORY:=Network
- DEPENDS:= +libpthread +librt +libstdcpp +libuuid
+ DEPENDS:=@!USE_UCLIBC +libpthread +librt +libstdcpp +libuuid
TITLE:=IoTivity Library
URL:=https://www.iotivity.org
endef
include $(TOPDIR)/rules.mk
PKG_NAME:=knxd
-PKG_VERSION=2015-06-27-$(PKG_SOURCE_VERSION)
-PKG_RELEASE:=2
+PKG_VERSION=2015-07-19-$(PKG_SOURCE_VERSION)
+PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/knxd/knxd.git
-PKG_SOURCE_VERSION:=50e7f6e6bfa13c2b6140b0f76aaa70234bf44b1d
+PKG_SOURCE_VERSION:=be1fcfe85cc1dfcc41f791cd9a45c57fe18da6a0
PKG_SOURCE_SUBDIR:=$(PKG_NAME)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
SECTION:=net
CATEGORY:=Network
TITLE:=EIB KNX daemon
- DEPENDS:=+pthsem +libusb-1.0 +libstdcpp
+ DEPENDS:=+pthsem +libusb-1.0
endef
define Package/knxd/description
/etc/config/knxd
endef
-define Package/libeibclient
- SECTION:=libs
- CATEGORY:=Libraries
- TITLE:=Library for EIB clients
- DEPENDS:=+pthsem
-endef
-
-define Package/libeibclient/description
-EIB KNX client library
-endef
-
define Package/knxd-tools
SECTION:=net
CATEGORY:=Network
TITLE:=EIB KNX Utils
- DEPENDS:=+libeibclient
endef
define Package/knxd-tools/description
EIB KNX Tools
endef
+TARGET_CXXFLAGS+= -fno-rtti
+TARGET_CXX=$(TARGET_CC)
+
CONFIGURE_ARGS+= \
--disable-ft12 \
--enable-eibnetip \
--enable-eibnetiptunnel \
--enable-eibnetipserver \
--enable-usb \
- --enable-tpuart \
--enable-tpuarts \
- --disable-pei16 \
--disable-pei16s \
--enable-groupcache \
--without-pth-test \
+ --disable-systemd \
--without-libstdc
EXTRA_LDFLAGS+= \
-fno-builtin -largp
-define Build/InstallDev
- $(INSTALL_DIR) $(1)/usr/include
- $(CP) $(PKG_INSTALL_DIR)/usr/include/eib*.h $(1)/usr/include/
-
- $(INSTALL_DIR) $(1)/usr/lib
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/libeibclient.{a,so*} $(1)/usr/lib/
-endef
-
define Package/knxd/install
$(INSTALL_DIR) $(1)/usr/bin
$(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
+ $(RM) $(1)/usr/bin/knxtool
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/knxd.init $(1)/etc/init.d/knxd
$(INSTALL_DATA) ./files/knxd.config $(1)/etc/config/knxd
endef
-define Package/libeibclient/install
+define Package/knxd-tools/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libeibclient.so* $(1)/usr/lib/
-endef
-
-define Package/knxd-tools/install
$(INSTALL_DIR) $(1)/usr/bin
-
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/knxd/examples/bin/knxtool $(1)/usr/bin/
- ln -sf knxtool $(1)/usr/bin/knxread
- ln -sf knxtool $(1)/usr/bin/knxreadtemp
- ln -sf knxtool $(1)/usr/bin/knxwrite
- ln -sf knxtool $(1)/usr/bin/knxlog
- ln -sf knxtool $(1)/usr/bin/knxon
- ln -sf knxtool $(1)/usr/bin/knxoff
- ln -sf knxtool $(1)/usr/bin/knxif
- ln -sf knxtool $(1)/usr/bin/knxswrite
- ln -sf knxtool $(1)/usr/bin/knxbool
- ln -sf knxtool $(1)/usr/bin/knxdimup
-
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/knxd/examples/bin/busmonitor1 $(1)/usr/bin/
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/knxd/examples/bin/busmonitor2 $(1)/usr/bin/
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/knxd/examples/bin/busmonitor3 $(1)/usr/bin/
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/knxd/examples/bin/eibread-cgi $(1)/usr/bin/
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/knxd/examples/bin/eibwrite-cgi $(1)/usr/bin/
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/knxd/examples/bin/vbusmonitor1 $(1)/usr/bin/
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/knxd/examples/bin/vbusmonitor2 $(1)/usr/bin/
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/knxd/examples/bin/vbusmonitor3 $(1)/usr/bin/
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/knxd/examples/bin/groupwrite $(1)/usr/bin/
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/knxd/examples/bin/groupswrite $(1)/usr/bin/
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/knxd/examples/bin/grouplisten $(1)/usr/bin/
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/knxd/examples/bin/groupread $(1)/usr/bin/
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/knxd/examples/bin/groupresponse $(1)/usr/bin/
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/knxd/examples/bin/groupreadresponse $(1)/usr/bin/
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/knxd/examples/bin/groupsocketlisten $(1)/usr/bin/
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/knxd/examples/bin/groupsocketread $(1)/usr/bin/
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/knxd/examples/bin/groupsocketwrite $(1)/usr/bin/
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/knxd/examples/bin/groupsocketswrite $(1)/usr/bin/
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/knxtool $(1)/usr/bin/
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/knxd/eibwrite-cgi $(1)/usr/bin/
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/knxd/eibread-cgi $(1)/usr/bin/
endef
$(eval $(call BuildPackage,knxd))
-$(eval $(call BuildPackage,libeibclient))
$(eval $(call BuildPackage,knxd-tools))
+++ /dev/null
---- a/src/examples/common.h 2015-06-27 15:20:15.266563893 +0200
-+++ b/src/examples/common.h 2015-06-27 15:23:09.406457392 +0200
-@@ -20,6 +20,7 @@
- #include <stdlib.h>
- #include <errno.h>
- #include <unistd.h>
-+#include <sys/select.h>
- #include "eibclient.h"
-
- /** unsigned char*/
--- /dev/null
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=kplex
+PKG_VERSION:=20150728
+
+PKG_RELEASE=$(PKG_SOURCE_VERSION)
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/stripydog/kplex.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=fec47cd1877ec7903969adefa4220838a706d940
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+
+PKG_LICENSE:=GPL-3.0+
+PKG_LICENSE_FILES:=COPYING
+
+PKG_MAINTAINER:=Nuno Goncalves <nunojpg@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/kplex
+ SECTION:=net
+ CATEGORY:=Network
+ TITLE:=NMEA-0183 multiplexer and router
+ DEPENDS:=+libpthread
+ URL:=http://www.stripydog.com/kplex/
+endef
+
+define Package/kplex/description
+ Kplex is a program for combining and routing NMEA-0183 data to and from multiple
+ sources and destinations. kplex inputs and outputs may be any of Serial lines,
+ Pseudo Terminals (ptys), Network Interfaces and Files.
+endef
+
+
+define Package/kplex/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/kplex $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,kplex))
#
-# Copyright (C) 2006-2013 OpenWrt.org
+# Copyright (C) 2006-2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=lighttpd
-PKG_VERSION:=1.4.35
-PKG_RELEASE:=5
+PKG_VERSION:=1.4.36
+PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://download.lighttpd.net/lighttpd/releases-1.4.x
-PKG_MD5SUM:=c7ae774eab4cb7ac85e41b712f4ee9ba
+PKG_MD5SUM:=1843daffcb018aa528f6d15d43544654
PKG_LICENSE:=BSD-3c
PKG_LICENSE_FILES:=COPYING
PKG_NAME:=luci-app-sqm
PKG_VERSION:=3
-PKG_RELEASE:=2
+PKG_RELEASE:=5
PKG_LICENSE:=GPLv2
LUCI_DIR:=/usr/lib/lua/luci
s.anonymous = true
-- BASIC
-e = s:taboption("tab_basic", Flag, "enabled", translate("Enable"))
+e = s:taboption("tab_basic", Flag, "enabled", translate("Enable this SQM instance."))
e.rmempty = false
+-- sm: following jow's advise, be helpful to the user and enable
+-- sqm's init script if even a single sm instance/interface
+-- is enabled; this is unexpected in that the init script gets
+-- enabled as soon as at least one sqm instance is enabled
+-- and that state is saved, so it does not require "Save & Apply"
+-- to effect the init scripts.
+-- the implementation was inpired/lifted from
+-- https://github.com/openwrt/luci/blob/master/applications/luci-app-minidlna/luasrc/model/cbi/minidlna.lua
+function e.write(self, section, value)
+ if value == "1" then
+ luci.sys.init.enable("sqm")
+ m.message = translate("The SQM GUI has just enabled the sqm initscript on your behalf. Remember to disable the sqm initscript manually under System Startup menu in case this change was not wished for.")
+-- luci.sys.call("/etc/init.d/sqm start >/dev/null")
+-- else
+-- luci.sys.call("/etc/init.d/sqm stop >/dev/null")
+-- luci.sys.init.disable("sqm")
+ end
+ return Flag.write(self, section, value)
+end
+-- TODO: inform the user what we just did...
+
n = s:taboption("tab_basic", ListValue, "interface", translate("Interface name"))
-- sm lifted from luci-app-wol, the original implementation failed to show pppoe-ge00 type interface names
for _, iface in ipairs(ifaces) do
c:value("ns2_codel")
c:value("pie")
c:value("sfq")
+c:value("cake")
c.default = "fq_codel"
c.rmempty = false
sc.rmempty = false
sc.description = qos_desc
-ad = s:taboption("tab_qdisc", Flag, "qdisc_advanced", translate("Show and Use Advanced Configuration"))
+ad = s:taboption("tab_qdisc", Flag, "qdisc_advanced", translate("Show and Use Advanced Configuration. Advanced options will only be used as long as this box is checked."))
ad.default = false
ad.rmempty = true
eecn.rmempty = true
eecn:depends("qdisc_advanced", "1")
-ad2 = s:taboption("tab_qdisc", Flag, "qdisc_really_really_advanced", translate("Show and Use Dangerous Configuration"))
+ad2 = s:taboption("tab_qdisc", Flag, "qdisc_really_really_advanced", translate("Show and Use Dangerous Configuration. Dangerous options will only be used as long as this box is checked."))
ad2.default = false
ad2.rmempty = true
ad2:depends("qdisc_advanced", "1")
po:depends("linklayer", "atm")
-adll = s:taboption("tab_linklayer", Flag, "linklayer_advanced", translate("Show Advanced Linklayer Options, (only needed if MTU > 1500)"))
+adll = s:taboption("tab_linklayer", Flag, "linklayer_advanced", translate("Show Advanced Linklayer Options, (only needed if MTU > 1500). Advanced options will only be used as long as this box is checked."))
adll.rmempty = true
adll:depends("linklayer", "ethernet")
-- adll:depends("linklayer", "adsl")
smpu:depends("linklayer_advanced", "1")
lla = s:taboption("tab_linklayer", ListValue, "linklayer_adaptation_mechanism", translate("Which linklayer adaptation mechanism to use; for testing only"))
+lla:value("cake")
lla:value("htb_private")
lla:value("tc_stab", "tc_stab ("..translate("default")..")")
lla.default = "tc_stab"
PKG_NAME:=mwan3
PKG_VERSION:=1.6
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_MAINTAINER:=Jeroen Louwes <jeroen.louwes@gmail.com>
PKG_LICENSE:=GPLv2
config_get enabled "$1" enabled 0
- device=$(uci get -p /var/state network.$1.ifname) &> /dev/null
+ device=$(uci -p /var/state get network.$1.ifname) &> /dev/null
if [ -n "$device" ] ; then
[ "$enabled" -eq 1 ] && ACTION=ifup INTERFACE=$1 DEVICE=$device /sbin/hotplug-call iface
check_iface_status()
{
let iface_id++
- device=$(uci get -p /var/state network.$1.ifname) &> /dev/null
+ device=$(uci -p /var/state get network.$1.ifname) &> /dev/null
if [ -z "$device" ]; then
echo " interface $1 is unknown"
fi
if [ -n "$($IP rule | awk '$5 == "'$device'"')" -a -n "$($IPT -S mwan3_iface_$1 2> /dev/null)" -a -n "$($IP route list table $iface_id default dev $device 2> /dev/null)" ]; then
- if [ -n "$(uci get -p /var/state mwan3.$1.track_ip 2> /dev/null)" ]; then
+ if [ -n "$(uci -p /var/state get mwan3.$1.track_ip 2> /dev/null)" ]; then
echo " interface $1 is online (tracking $tracking)"
else
echo " interface $1 is online"
echo " interface $1 error"
else
if [ "$enabled" -eq 1 ]; then
- if [ -n "$(uci get -p /var/state mwan3.$1.track_ip 2> /dev/null)" ]; then
+ if [ -n "$(uci -p /var/state get mwan3.$1.track_ip 2> /dev/null)" ]; then
echo " interface $1 is offline (tracking $tracking)"
else
echo " interface $1 is offline"
--- /dev/null
+#
+# 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.7.0
+PKG_RELEASE:=1
+PKG_LICENSE:=Custom
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=ftp://ftp.netperf.org/netperf/
+PKG_MD5SUM:=ad1c5342d61f297c417a93133aeba65a
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/netperf
+ SECTION:=net
+ CATEGORY:=Network
+ TITLE:=Network performance measurement tool
+ URL:=http://www.netperf.org/
+ MAINTAINER:=Toke Høiland-Jørgensen <toke@toke.dk>
+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))
--- /dev/null
+#!/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
+}
--- /dev/null
+diff --git a/src/netrt_rtnetlink.c b/src/netrt_rtnetlink.c
+index 10e4750..318c0c2 100644
+--- a/src/netrt_rtnetlink.c
++++ b/src/netrt_rtnetlink.c
+@@ -5,7 +5,6 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+-#include <bits/sockaddr.h>
+ #include <asm/types.h>
+ #include <linux/rtnetlink.h>
+ #include <netinet/in.h>
PKG_NAME:=ntripcaster
PKG_VERSION:=0.1.5
-PKG_RELEASE:=1
-PKG_LICENSE:=GPL-2.0+
-PKG_SOURCE:=$(PKG_NAME)$(PKG_VERSION).zip
-PKG_SOURCE_URL:=http://igs.bkg.bund.de/root_ftp/NTRIP/software/
-PKG_MD5SUM:=8c85a6c31d8c5cdf2638fe103207a1fd
+PKG_RELEASE=$(PKG_SOURCE_VERSION)
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/nunojpg/ntripcaster.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=03878920195cf854b38a1ea424f1cae57353fa87
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+
+PKG_LICENSE:=GPL-2.0+
PKG_MAINTAINER:=Nuno Goncalves <nunojpg@gmail.com>
BKG Standard Ntrip Broadcaster
endef
-define Build/Prepare
- mkdir -p $(PKG_BUILD_DIR)
- unzip $(DL_DIR)/$(PKG_SOURCE) -d $(PKG_BUILD_DIR)
- mv $(PKG_BUILD_DIR)/$(PKG_NAME)$(PKG_VERSION)/* $(PKG_BUILD_DIR)
- chmod +x $(PKG_BUILD_DIR)/configure
-endef
-
define Package/ntripcaster/install
- $(INSTALL_DIR) $(1)/usr/local/ntripcaster/bin
- $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ntripcaster $(1)/usr/local/ntripcaster/bin/
- $(INSTALL_DIR) $(1)/usr/local/ntripcaster/conf
- $(INSTALL_DATA) $(PKG_BUILD_DIR)/conf/ntripcaster.conf.dist $(1)/usr/local/ntripcaster/conf/
- $(INSTALL_DATA) $(PKG_BUILD_DIR)/conf/sourcetable.dat.dist $(1)/usr/local/ntripcaster/conf/
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ntripcaster $(1)/usr/bin/
+ $(INSTALL_DIR) $(1)/usr/share/ntripcaster/conf
+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/conf/ntripcaster.conf.dist $(1)/usr/share/ntripcaster/conf/
+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/conf/sourcetable.dat.dist $(1)/usr/share/ntripcaster/conf/
endef
$(eval $(call BuildPackage,ntripcaster))
PKG_NAME:=ntripclient
PKG_VERSION:=1.5.0
-PKG_RELEASE:=3
-PKG_LICENSE:=GPL-2.0+
-PKG_SOURCE:=$(PKG_NAME).zip
-PKG_SOURCE_URL:=http://igs.bkg.bund.de/root_ftp/NTRIP/software/
-PKG_MD5SUM:=4b357fa648d74e4e13c4b5a2a39f5624
+PKG_RELEASE=$(PKG_SOURCE_VERSION)
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/nunojpg/ntripclient.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=dcfb2cb3e6f31b7291a94e7f86379c78ffc0d44e
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+
+PKG_LICENSE:=GPL-2.0+
PKG_MAINTAINER:=Nuno Goncalves <nunojpg@gmail.com>
Ntrip Version 2.0 Command Line Client, reading from Ntrip Version 1.0 or 2.0 Caster
endef
-define Build/Prepare
- mkdir -p $(PKG_BUILD_DIR)
- unzip $(DL_DIR)/$(PKG_SOURCE) -d $(PKG_BUILD_DIR)
- $(call Build/Prepare/Default)
-endef
-
MAKE_FLAGS += \
OPTS="$(TARGET_CFLAGS)"
PKG_NAME:=ntripserver
PKG_VERSION:=1.5.1
-PKG_RELEASE:=2
-PKG_LICENSE:=GPL-2.0+
-PKG_SOURCE:=$(PKG_NAME).zip
-PKG_SOURCE_URL:=http://igs.bkg.bund.de/root_ftp/NTRIP/software/
-PKG_MD5SUM:=cecff5da0173896df041bd889935fc12
+PKG_RELEASE=$(PKG_SOURCE_VERSION)
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/nunojpg/ntripserver.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=c3034ab575e8442222eb8c2ee9e224cac99cfa6d
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+
+PKG_LICENSE:=GPL-2.0+
PKG_MAINTAINER:=Nuno Goncalves <nunojpg@gmail.com>
endef
define Package/ntripserver/description
- Ntrip Version 2.0 Command Line Server, reading from SISNeT Server, TCP/UDP IP Port, Serial port, or NtripCaster to support an Ntrip Version 1.0 or 2.0 Caster
+ Ntrip Version 2.0 Command Line Server, reading from SISNeT Server, TCP/UDP IP
+ Port, Serial port, or NtripCaster to support an Ntrip Version 1.0 or 2.0 Caster
endef
MAKE_FLAGS += \
OPTS="$(TARGET_CFLAGS)"
-define Build/Prepare
- mkdir -p $(PKG_BUILD_DIR)
- unzip $(DL_DIR)/$(PKG_SOURCE) -d $(PKG_BUILD_DIR)
-endef
-
define Package/ntripserver/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ntripserver $(1)/usr/bin/
include $(TOPDIR)/rules.mk
PKG_NAME:=ola
-PKG_VERSION:=0.9.6
+PKG_VERSION:=0.9.7
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/OpenLightingProject/ola.git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=e9ece0540fb40beb1be33417cb7e0abf45af74e0
+PKG_SOURCE_VERSION:=2a306e4f0221fea9f4833ba04b042e72c6f10cd3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_LICENSE:=LGPL-2.1+
--- /dev/null
+diff --git a/common/network/NetworkUtils.cpp b/common/network/NetworkUtils.cpp
+index 3914818..094a311 100644
+--- a/common/network/NetworkUtils.cpp
++++ b/common/network/NetworkUtils.cpp
+@@ -39,6 +39,10 @@ typedef uint32_t in_addr_t;
+ #include <resolv.h>
+ #endif
+
++#ifdef HAVE_ENDIAN_H
++#include <endian.h>
++#endif
++
+ #if defined(HAVE_LINUX_NETLINK_H) && defined(HAVE_LINUX_RTNETLINK_H)
+ #define USE_NETLINK_FOR_DEFAULT_ROUTE 1
+ #include <linux/netlink.h>
#
-# Copyright (C) 2009-2011 OpenWrt.org
+# Copyright (C) 2009-2015 OpenWrt.org
# Copyright (C) 2009 Jakob Pfeiffer
# Copyright (C) 2014 Artem Makhutov
#
PKG_NAME:=opennhrp
PKG_VERSION:=0.14.1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_MAINTAINER:=Artem Makhutov <artem@makhutov.org>
PKG_LICENSE:=MIT License
--- /dev/null
+--- a/nhrp/opennhrp.c
++++ b/nhrp/opennhrp.c
+@@ -9,6 +9,7 @@
+ #include <ctype.h>
+ #include <stdio.h>
+ #include <errno.h>
++#include <fcntl.h>
+ #include <malloc.h>
+ #include <stddef.h>
+ #include <string.h>
+--- a/nhrp/nhrp_common.h
++++ b/nhrp/nhrp_common.h
+@@ -12,6 +12,7 @@
+ #include <stdint.h>
+ #include <stdlib.h>
+ #include <sys/time.h>
++#include <sys/types.h>
+ #include <linux/if_ether.h>
+
+ struct nhrp_interface;
include $(TOPDIR)/rules.mk
PKG_NAME:=openssh
-PKG_VERSION:=6.8p1
+PKG_VERSION:=6.9p1
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/ \
http://ftp.belnet.be/pub/OpenBSD/OpenSSH/portable/
-PKG_MD5SUM:=08f72de6751acfbd0892b5f003922701
+PKG_MD5SUM:=0b161c44fc31fbc6b76a6f8ae639f16f
PKG_LICENSE:=BSD ISC
PKG_LICENSE_FILES:=LICENCE
#!/bin/sh /etc/rc.common
-# Copyright (C) 2006 OpenWrt.org
+# Copyright (C) 2015 OpenWrt.org
START=60
+USE_PROCD=1
+
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
+validate_login_section() {
+ uci_validate_section pptpd login "${1}" \
+ 'username:string' \
+ 'password:string'
+}
+
+validate_pptpd_section() {
+ uci_validate_section pptpd service "${1}" \
+ 'enabled:uinteger' \
+ 'localip:string' \
+ 'remoteip:string'
+}
+
setup_login() {
- local section="$1"
+ validate_login_section "${1}" || {
+ echo "validation failed"
+ return 1
+ }
- config_get username "$section" username
- config_get password "$section" password
- [ -n "$username" ] || return 0
- [ -n "$password" ] || return 0
+ [ -n "${username}" ] || return 0
+ [ -n "${password}" ] || return 0
- echo "$username pptp-server $password *" >> $CHAP_SECRETS
+ echo "${username} pptp-server ${password} *" >> $CHAP_SECRETS
}
setup_config() {
- local section="$1"
+ validate_pptpd_section "${1}" || {
+ echo "validation failed"
+ return 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
+ return 0
}
-start() {
+start_service() {
config_load pptpd
setup_config pptpd || return
config_foreach setup_login login
- start_pptpd
-}
-stop() {
- service_stop $BIN
+ ln -sfn $CHAP_SECRETS /etc/ppp/chap-secrets
+
+ procd_open_instance
+ procd_set_param command $BIN -c $CONFIG
+ procd_close_instance
}
include $(TOPDIR)/rules.mk
PKG_NAME:=shadowsocks-libev
-PKG_VERSION:=2.2.2
+PKG_VERSION:=2.2.3
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/shadowsocks/shadowsocks-libev.git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)
-PKG_SOURCE_VERSION:=4883903e657095b93f88a3a3b9a0dccdffdaa397
+PKG_SOURCE_VERSION:=2b1eef11973de3f7380401fd20f937e84bc2b756
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MAINTAINER:=Jian Chang <aa65535@live.com>
TITLE:=Lightweight Secured Socks5 Proxy $(2)
URL:=https://github.com/shadowsocks/shadowsocks-libev
VARIANT:=$(1)
- DEPENDS:=$(3) +resolveip +ipset +ip +iptables-mod-tproxy
+ DEPENDS:=$(3) +libpthread +ipset +ip +iptables-mod-tproxy
endef
Package/shadowsocks-libev = $(call Package/shadowsocks-libev/Default,openssl,(OpenSSL),+libopenssl)
Package/shadowsocks-libev-polarssl = $(call Package/shadowsocks-libev/Default,polarssl,(PolarSSL),+libpolarssl)
define Package/shadowsocks-libev/description
-Shadowsocks-libev is a lightweight secured scoks5 proxy for embedded devices and low end boxes.
+Shadowsocks-libev is a lightweight secured socks5 proxy for embedded devices and low end boxes.
endef
Package/shadowsocks-libev-polarssl/description = $(Package/shadowsocks-libev/description)
option timeout '60'
option encrypt_method 'rc4-md5'
option ignore_list '/dev/null'
- option udp_relay '0'
+ option udp_mode '0'
option tunnel_enable '1'
option tunnel_port '5300'
option tunnel_forward '8.8.4.4:53'
config_get server $1 server
config_get server_port $1 server_port
config_get local_port $1 local_port
- config_get password $1 password
config_get timeout $1 timeout
+ config_get password $1 password
config_get encrypt_method $1 encrypt_method
config_get ignore_list $1 ignore_list
- config_get udp_relay $1 udp_relay
+ config_get udp_mode $1 udp_mode
+ config_get udp_server $1 udp_server
+ config_get udp_server_port $1 udp_server_port
+ config_get udp_local_port $1 udp_local_port
+ config_get udp_timeout $1 udp_timeout
+ config_get udp_password $1 udp_password
+ config_get udp_encrypt_method $1 udp_encrypt_method
config_get_bool tunnel_enable $1 tunnel_enable
config_get tunnel_port $1 tunnel_port
config_get tunnel_forward $1 tunnel_forward
config_get wan_bp_ip $1 wan_bp_ip
config_get wan_fw_ip $1 wan_fw_ip
config_get ipt_ext $1 ipt_ext
+ : ${timeout:=60}
+ : ${udp_timeout:=60}
: ${tunnel_port:=5300}
: ${tunnel_forward:=8.8.4.4:53}
}
/usr/bin/ss-rules \
-s "$server" \
-l "$local_port" \
+ -S "$udp_server" \
+ -L "$udp_local_port" \
-i "$ignore_list" \
-a "$ac_args" \
-b "$wan_bp_ip" \
}
start_redir() {
- service_start /usr/bin/ss-redir \
- -c "$CONFIG_FILE" $udp
+ cat <<-EOF >$CONFIG_FILE
+ {
+ "server": "$server",
+ "server_port": $server_port,
+ "local_address": "0.0.0.0",
+ "local_port": $local_port,
+ "password": "$password",
+ "timeout": $timeout,
+ "method": "$encrypt_method"
+ }
+EOF
+ if [ "$udp_mode" = 2 ]; then
+ /usr/bin/ss-redir \
+ -c $CONFIG_FILE \
+ -f /var/run/ss-redir_t.pid
+ cat <<-EOF >$CONFIG_FILE
+ {
+ "server": "$udp_server",
+ "server_port": $udp_server_port,
+ "local_address": "0.0.0.0",
+ "local_port": $udp_local_port,
+ "password": "$udp_password",
+ "timeout": $udp_timeout,
+ "method": "$udp_encrypt_method"
+ }
+EOF
+ fi
+ /usr/bin/ss-redir \
+ -c $CONFIG_FILE \
+ -f /var/run/ss-redir.pid \
+ $udp
return $?
}
start_tunnel() {
- service_start /usr/bin/ss-tunnel \
- -c "$CONFIG_FILE" \
- -l "$tunnel_port" \
- -L "$tunnel_forward" \
- -u
+ : ${udp:="-u"}
+ /usr/bin/ss-tunnel \
+ -c $CONFIG_FILE \
+ -l $tunnel_port \
+ -L $tunnel_forward \
+ -f /var/run/ss-tunnel.pid \
+ $udp
return $?
}
config_load shadowsocks-libev
config_foreach get_config shadowsocks-libev
[ "$enable" = 1 ] || exit 0
- [ "$udp_relay" = 1 ] && udp="-u"
- mkdir -p $(dirname $CONFIG_FILE)
+ mkdir -p /var/run /var/etc
: ${server:?}
: ${server_port:?}
: ${local_port:?}
: ${password:?}
: ${encrypt_method:?}
- cat <<-EOF >$CONFIG_FILE
- {
- "server": "$server",
- "server_port": $server_port,
- "local_address": "0.0.0.0",
- "local_port": $local_port,
- "password": "$password",
- "timeout": $timeout,
- "method": "$encrypt_method"
- }
-EOF
+ case $udp_mode in
+ 1) udp="-u"
+ ;;
+ 2)
+ udp="-U"
+ : ${udp_server:?}
+ : ${udp_server_port:?}
+ : ${udp_local_port:?}
+ : ${udp_password:?}
+ : ${udp_encrypt_method:?}
+ ;;
+ esac
+
start_rules
}
stop() {
/usr/bin/ss-rules -f
- service_stop /usr/bin/ss-redir
- service_stop /usr/bin/ss-tunnel
- rm -f $CONFIG_FILE
+ killall -q -9 ss-redir
+ killall -q -9 ss-tunnel
}
-e <extra_options> extra options for iptables
-o apply the rules to the OUTPUT chain
-u enable udprelay mode, TPROXY is required
+ -U enable udprelay mode, using different IP
+ and ports for TCP and UDP
-f flush the rules
EOF
}
fw_rule() {
$ipt_n -N SS_SPEC_WAN_FW && \
$ipt_n -A SS_SPEC_WAN_FW -p tcp \
- -j REDIRECT --to-ports $LOCAL_PORT 2>/dev/null || {
+ -j REDIRECT --to-ports $local_port 2>/dev/null || {
loger 3 "Can't redirect, please check the iptables."
exit 1
}
}
tp_rule() {
- [ "$TPROXY" = 1 ] || return 0
+ [ -n "$TPROXY" ] || return 0
ip rule add fwmark 0x01/0x01 table 100
ip route add local 0.0.0.0/0 dev lo table 100
$ipt_m -N SS_SPEC_TPROXY
return $?
}
-while getopts ":s:l:c:i:e:a:b:w:ouf" arg; do
+while getopts ":s:l:S:L:i:e:a:b:w:ouUf" arg; do
case $arg in
s)
- SERVER=$OPTARG
+ server=$OPTARG
;;
l)
+ local_port=$OPTARG
+ ;;
+ S)
+ SERVER=$OPTARG
+ ;;
+ L)
LOCAL_PORT=$OPTARG
;;
i)
u)
TPROXY=1
;;
+ U)
+ TPROXY=2
+ ;;
f)
flush_r
exit 0
esac
done
-if [ -z "$SERVER" -o -z "$LOCAL_PORT" ]; then
+if [ -z "$server" -o -z "$local_port" ]; then
usage
exit 2
fi
-SERVER=$(resolveip -t60 $SERVER)
+if [ "$TPROXY" = 1 ]; then
+ SERVER=$server
+ LOCAL_PORT=$local_port
+fi
-if [ -z "$SERVER" ]; then
- loger 3 "Can't resolve the server hostname."
- exit 1
+if [ "$TPROXY" = 2 ]; then
+ if [ -z "$SERVER" -o -z "$LOCAL_PORT" ]; then
+ loger 3 "Please use -S and -L specifies IP and port for UDP."
+ fi
fi
if [ -f "$IGNORE" ]; then
fi
IPLIST=$(cat <<-EOF | grep -E "^([0-9]{1,3}\.){3}[0-9]{1,3}"
+ $server
$SERVER
0.0.0.0/8
10.0.0.0/8
PKG_NAME:=sqm-scripts
PKG_VERSION:=8
-PKG_RELEASE:=4
+PKG_RELEASE:=7
PKG_LICENSE:=GPLv2
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
option script 'simple.qos'
option qdisc_advanced '0'
option ingress_ecn 'ECN'
- option egress_ecn 'NOECN'
+ option egress_ecn 'ECN'
option qdisc_really_really_advanced '0'
option itarget 'auto'
option etarget 'auto'
#improve the logread output
sqm_logger() {
- logger -t SQM -s ${1}
+ logger -t SQM -s "${1}"
}
insmod() {
echo ${STABSTRING}
}
+#sm: cake knows how to handle ATM and per packet overhead, so expose and use this...
+get_cake_lla_string() {
+ STABSTRING=""
+ if [ "${LLAM}" = "cake" -a "${LINKLAYER}" != "none" ];
+ then
+ if [ "${LINKLAYER}" = "atm" ];
+ then
+ STABSTRING="atm"
+ fi
+
+ STABSTRING="${STABSTRING} overhead ${OVERHEAD}"
+ sqm_logger "cake link layer adjustments: ${STABSTRING}"
+ fi
+ echo ${STABSTRING}
+}
+
+
sqm_stop() {
$TC qdisc del dev $IFACE ingress
$TC qdisc del dev $IFACE root
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
-# Copyright (C) 2012-4 Michael D. Taht, Toke Høiland-Jørgensen, Sebastian Moeller
+# Copyright (C) 2012-5 Michael D. Taht, Toke Høiland-Jørgensen, Sebastian Moeller
# Compared to the complexity that debloat had become
# this cleanly shows a means of going from diffserv marking
ipt -t mangle -N QOS_MARK_${IFACE}
-ipt -t mangle -A QOS_MARK_${IFACE} -j MARK --set-mark 0x2${IPT_MASK_STRING}
-# You can go further with classification but...
-ipt -t mangle -A QOS_MARK_${IFACE} -m dscp --dscp-class CS1 -j MARK --set-mark 0x3${IPT_MASK_STRING}
-ipt -t mangle -A QOS_MARK_${IFACE} -m dscp --dscp-class CS6 -j MARK --set-mark 0x1${IPT_MASK_STRING}
-ipt -t mangle -A QOS_MARK_${IFACE} -m dscp --dscp-class EF -j MARK --set-mark 0x1${IPT_MASK_STRING}
-ipt -t mangle -A QOS_MARK_${IFACE} -m dscp --dscp-class AF42 -j MARK --set-mark 0x1${IPT_MASK_STRING}
-ipt -t mangle -A QOS_MARK_${IFACE} -m tos --tos Minimize-Delay -j MARK --set-mark 0x1${IPT_MASK_STRING}
+case $QDISC in
+ cake*)
+ sqm_logger cake does all the diffserv work - no need for iptables rules
+ ;;
+ *)
+ ipt -t mangle -A QOS_MARK_${IFACE} -j MARK --set-mark 0x2${IPT_MASK_STRING}
+ # You can go further with classification but...
+ ipt -t mangle -A QOS_MARK_${IFACE} -m dscp --dscp-class CS1 -j MARK --set-mark 0x3${IPT_MASK_STRING}
+ ipt -t mangle -A QOS_MARK_${IFACE} -m dscp --dscp-class CS6 -j MARK --set-mark 0x1${IPT_MASK_STRING}
+ ipt -t mangle -A QOS_MARK_${IFACE} -m dscp --dscp-class EF -j MARK --set-mark 0x1${IPT_MASK_STRING}
+ ipt -t mangle -A QOS_MARK_${IFACE} -m dscp --dscp-class AF42 -j MARK --set-mark 0x1${IPT_MASK_STRING}
+ ipt -t mangle -A QOS_MARK_${IFACE} -m tos --tos Minimize-Delay -j MARK --set-mark 0x1${IPT_MASK_STRING}
+ ;;
+esac
# and it might be a good idea to do it for udp tunnels too
if [ "$SQUASH_DSCP" = "1" ]
then
sqm_logger "Squashing differentiated services code points (DSCP) from ingress."
+CAKE_OPTS=besteffort # someday squash
ipt -t mangle -I PREROUTING -i $IFACE -m dscp ! --dscp 0 -j DSCP --set-dscp-class be
else
sqm_logger "Keeping differentiated services code points (DSCP) from ingress."
+CAKE_OPTS=""
ipt -t mangle -A PREROUTING -i $IFACE -m mark --mark 0x00${IPT_MASK_STRING} -g QOS_MARK_${IFACE}
fi
LQ="quantum `get_mtu $IFACE $CEIL`"
$TC qdisc del dev $IFACE root 2> /dev/null
-$TC qdisc add dev $IFACE root handle 1: `get_stab_string` htb default 12
-$TC class add dev $IFACE parent 1: classid 1:1 htb $LQ rate ${CEIL}kbit ceil ${CEIL}kbit `get_htb_adsll_string`
-$TC class add dev $IFACE parent 1:1 classid 1:10 htb $LQ rate ${CEIL}kbit ceil ${CEIL}kbit prio 0 `get_htb_adsll_string`
-$TC class add dev $IFACE parent 1:1 classid 1:11 htb $LQ rate 128kbit ceil ${PRIO_RATE}kbit prio 1 `get_htb_adsll_string`
-$TC class add dev $IFACE parent 1:1 classid 1:12 htb $LQ rate ${BE_RATE}kbit ceil ${BE_CEIL}kbit prio 2 `get_htb_adsll_string`
-$TC class add dev $IFACE parent 1:1 classid 1:13 htb $LQ rate ${BK_RATE}kbit ceil ${BE_CEIL}kbit prio 3 `get_htb_adsll_string`
-
-$TC qdisc add dev $IFACE parent 1:11 handle 110: $QDISC `get_limit ${ELIMIT}` `get_target "${ETARGET}" ${UPLINK}` `get_ecn ${EECN}` `get_quantum 300` `get_flows ${PRIO_RATE}` ${EQDISC_OPTS}
-$TC qdisc add dev $IFACE parent 1:12 handle 120: $QDISC `get_limit ${ELIMIT}` `get_target "${ETARGET}" ${UPLINK}` `get_ecn ${EECN}` `get_quantum 300` `get_flows ${BE_RATE}` ${EQDISC_OPTS}
-$TC qdisc add dev $IFACE parent 1:13 handle 130: $QDISC `get_limit ${ELIMIT}` `get_target "${ETARGET}" ${UPLINK}` `get_ecn ${EECN}` `get_quantum 300` `get_flows ${BK_RATE}` ${EQDISC_OPTS}
-
-
-# Need a catchall rule
-
-$TC filter add dev $IFACE parent 1:0 protocol all prio 999 u32 \
- match ip protocol 0 0x00 flowid 1:12
-
-# FIXME should probably change the filter here to do pre-nat
+case $QDISC in
+ cake*)
+ $TC qdisc add dev $IFACE root `get_stab_string` $QDISC bandwidth ${CEIL}kbit `get_cake_lla_string` ${EQDISC_OPTS}
+ ;;
+ *)
+ $TC qdisc add dev $IFACE root handle 1: `get_stab_string` htb default 12
+ $TC class add dev $IFACE parent 1: classid 1:1 htb $LQ rate ${CEIL}kbit ceil ${CEIL}kbit `get_htb_adsll_string`
+ $TC class add dev $IFACE parent 1:1 classid 1:10 htb $LQ rate ${CEIL}kbit ceil ${CEIL}kbit prio 0 `get_htb_adsll_string`
+ $TC class add dev $IFACE parent 1:1 classid 1:11 htb $LQ rate 128kbit ceil ${PRIO_RATE}kbit prio 1 `get_htb_adsll_string`
+ $TC class add dev $IFACE parent 1:1 classid 1:12 htb $LQ rate ${BE_RATE}kbit ceil ${BE_CEIL}kbit prio 2 `get_htb_adsll_string`
+ $TC class add dev $IFACE parent 1:1 classid 1:13 htb $LQ rate ${BK_RATE}kbit ceil ${BE_CEIL}kbit prio 3 `get_htb_adsll_string`
+
+ $TC qdisc add dev $IFACE parent 1:11 handle 110: $QDISC `get_limit ${ELIMIT}` `get_target "${ETARGET}" ${UPLINK}` `get_ecn ${EECN}` `get_quantum 300` `get_flows ${PRIO_RATE}` ${EQDISC_OPTS}
+ $TC qdisc add dev $IFACE parent 1:12 handle 120: $QDISC `get_limit ${ELIMIT}` `get_target "${ETARGET}" ${UPLINK}` `get_ecn ${EECN}` `get_quantum 300` `get_flows ${BE_RATE}` ${EQDISC_OPTS}
+ $TC qdisc add dev $IFACE parent 1:13 handle 130: $QDISC `get_limit ${ELIMIT}` `get_target "${ETARGET}" ${UPLINK}` `get_ecn ${EECN}` `get_quantum 300` `get_flows ${BK_RATE}` ${EQDISC_OPTS}
+
+ # Need a catchall rule
+
+ $TC filter add dev $IFACE parent 1:0 protocol all prio 999 u32 \
+ match ip protocol 0 0x00 flowid 1:12
+
+ # FIXME should probably change the filter here to do pre-nat
-$TC filter add dev $IFACE parent 1:0 protocol ip prio 1 handle 1 fw classid 1:11
-$TC filter add dev $IFACE parent 1:0 protocol ip prio 2 handle 2 fw classid 1:12
-$TC filter add dev $IFACE parent 1:0 protocol ip prio 3 handle 3 fw classid 1:13
+ $TC filter add dev $IFACE parent 1:0 protocol ip prio 1 handle 1 fw classid 1:11
+ $TC filter add dev $IFACE parent 1:0 protocol ip prio 2 handle 2 fw classid 1:12
+ $TC filter add dev $IFACE parent 1:0 protocol ip prio 3 handle 3 fw classid 1:13
-# ipv6 support. Note that the handle indicates the fw mark bucket that is looked for
+ # ipv6 support. Note that the handle indicates the fw mark bucket that is looked for
-$TC filter add dev $IFACE parent 1:0 protocol ipv6 prio 4 handle 1 fw classid 1:11
-$TC filter add dev $IFACE parent 1:0 protocol ipv6 prio 5 handle 2 fw classid 1:12
-$TC filter add dev $IFACE parent 1:0 protocol ipv6 prio 6 handle 3 fw classid 1:13
+ $TC filter add dev $IFACE parent 1:0 protocol ipv6 prio 4 handle 1 fw classid 1:11
+ $TC filter add dev $IFACE parent 1:0 protocol ipv6 prio 5 handle 2 fw classid 1:12
+ $TC filter add dev $IFACE parent 1:0 protocol ipv6 prio 6 handle 3 fw classid 1:13
-# Arp traffic
+ # Arp traffic
-$TC filter add dev $IFACE parent 1:0 protocol arp prio 7 handle 1 fw classid 1:11
+ $TC filter add dev $IFACE parent 1:0 protocol arp prio 7 handle 1 fw classid 1:11
-# ICMP traffic - Don't impress your friends. Deoptimize to manage ping floods
-# better instead
+ # ICMP traffic - Don't impress your friends. Deoptimize to manage ping floods
+ # better instead
-$TC filter add dev $IFACE parent 1:0 protocol ip prio 8 \
- u32 match ip protocol 1 0xff flowid 1:13
+ $TC filter add dev $IFACE parent 1:0 protocol ip prio 8 \
+ u32 match ip protocol 1 0xff flowid 1:13
-$TC filter add dev $IFACE parent 1:0 protocol ipv6 prio 9 \
- u32 match ip protocol 1 0xff flowid 1:13
+ $TC filter add dev $IFACE parent 1:0 protocol ipv6 prio 9 \
+ u32 match ip protocol 1 0xff flowid 1:13
+ ;;
+esac
#diffserv $IFACE
if [ "$SQUASH_INGRESS" = "1" ]
then
-sqm_logger "Do not perform DSCP based filtering on ingress. (1-tier classification)"
-# Revert to no dscp based filtering
-$TC qdisc del dev $DEV root 2>/dev/null
-$TC qdisc add dev $DEV root handle 1: `get_stab_string` htb default 10
-$TC class add dev $DEV parent 1: classid 1:1 htb $LQ rate ${DOWNLINK}kbit ceil ${DOWNLINK}kbit `get_htb_adsll_string`
-$TC class add dev $DEV parent 1:1 classid 1:10 htb $LQ rate ${DOWNLINK}kbit ceil ${DOWNLINK}kbit prio 0 `get_htb_adsll_string`
-$TC qdisc add dev $DEV parent 1:10 handle 110: $QDISC `get_limit ${ILIMIT}` `get_target "${ITARGET}" ${DOWNLINK}` `get_ecn ${IECN}` `get_flows ${DOWNLINK}` ${IQDISC_OPTS}
+ sqm_logger "Do not perform DSCP based filtering on ingress. (1-tier classification)"
+ # Revert to no dscp based filtering
+ case $QDISC in
+ cake*)
+ $TC qdisc add dev $DEV root `get_stab_string` $QDISC bandwidth ${DOWNLINK}kbit besteffort `get_cake_lla_string` ${IQDISC_OPTS}
+ ;;
+ *)
+ $TC qdisc add dev $DEV root handle 1: `get_stab_string` htb default 10
+ $TC class add dev $DEV parent 1: classid 1:1 htb $LQ rate ${DOWNLINK}kbit ceil ${DOWNLINK}kbit `get_htb_adsll_string`
+ $TC class add dev $DEV parent 1:1 classid 1:10 htb $LQ rate ${DOWNLINK}kbit ceil ${DOWNLINK}kbit prio 0 `get_htb_adsll_string`
+ $TC qdisc add dev $DEV parent 1:10 handle 110: $QDISC `get_limit ${ILIMIT}` `get_target "${ITARGET}" ${DOWNLINK}` `get_ecn ${IECN}` `get_flows ${DOWNLINK}` ${IQDISC_OPTS}
+ ;;
+ esac
else
-sqm_logger "Perform DSCP based filtering on ingress. (3-tier classification)"
-$TC qdisc add dev $DEV root handle 1: `get_stab_string` htb default 12
-$TC class add dev $DEV parent 1: classid 1:1 htb $LQ rate ${CEIL}kbit ceil ${CEIL}kbit `get_htb_adsll_string`
-$TC class add dev $DEV parent 1:1 classid 1:10 htb $LQ rate ${CEIL}kbit ceil ${CEIL}kbit prio 0 `get_htb_adsll_string`
-$TC class add dev $DEV parent 1:1 classid 1:11 htb $LQ rate 32kbit ceil ${PRIO_RATE}kbit prio 1 `get_htb_adsll_string`
-$TC class add dev $DEV parent 1:1 classid 1:12 htb $LQ rate ${BE_RATE}kbit ceil ${BE_CEIL}kbit prio 2 `get_htb_adsll_string`
-$TC class add dev $DEV parent 1:1 classid 1:13 htb $LQ rate ${BK_RATE}kbit ceil ${BE_CEIL}kbit prio 3 `get_htb_adsll_string`
-
-# I'd prefer to use a pre-nat filter but that causes permutation...
-
-$TC qdisc add dev $DEV parent 1:11 handle 110: $QDISC `get_limit ${ILIMIT}` `get_target "${ITARGET}" ${DOWNLINK}` `get_ecn ${IECN}` `get_quantum 500` `get_flows ${PRIO_RATE}` ${IQDISC_OPTS}
-$TC qdisc add dev $DEV parent 1:12 handle 120: $QDISC `get_limit ${ILIMIT}` `get_target "${ITARGET}" ${DOWNLINK}` `get_ecn ${IECN}` `get_quantum 1500` `get_flows ${BE_RATE}` ${IQDISC_OPTS}
-$TC qdisc add dev $DEV parent 1:13 handle 130: $QDISC `get_limit ${ILIMIT}` `get_target "${ITARGET}" ${DOWNLINK}` `get_ecn ${IECN}` `get_quantum 300` `get_flows ${BK_RATE}` ${IQDISC_OPTS}
-
-diffserv $DEV
-
+ sqm_logger "Perform DSCP based filtering on ingress. (3-tier classification)"
+ case $QDISC in
+ cake*)
+ $TC qdisc add dev $DEV root `get_stab_string` $QDISC bandwidth ${DOWNLINK}kbit `get_cake_lla_string` $CAKE_OPTS ${IQDISC_OPTS}
+ ;;
+ *)
+ $TC qdisc add dev $DEV root handle 1: `get_stab_string` htb default 12
+ $TC class add dev $DEV parent 1: classid 1:1 htb $LQ rate ${CEIL}kbit ceil ${CEIL}kbit `get_htb_adsll_string`
+ $TC class add dev $DEV parent 1:1 classid 1:10 htb $LQ rate ${CEIL}kbit ceil ${CEIL}kbit prio 0 `get_htb_adsll_string`
+ $TC class add dev $DEV parent 1:1 classid 1:11 htb $LQ rate 32kbit ceil ${PRIO_RATE}kbit prio 1 `get_htb_adsll_string`
+ $TC class add dev $DEV parent 1:1 classid 1:12 htb $LQ rate ${BE_RATE}kbit ceil ${BE_CEIL}kbit prio 2 `get_htb_adsll_string`
+ $TC class add dev $DEV parent 1:1 classid 1:13 htb $LQ rate ${BK_RATE}kbit ceil ${BE_CEIL}kbit prio 3 `get_htb_adsll_string`
+
+ # I'd prefer to use a pre-nat filter but that causes permutation...
+
+ $TC qdisc add dev $DEV parent 1:11 handle 110: $QDISC `get_limit ${ILIMIT}` `get_target "${ITARGET}" ${DOWNLINK}` `get_ecn ${IECN}` `get_quantum 500` `get_flows ${PRIO_RATE}` ${IQDISC_OPTS}
+ $TC qdisc add dev $DEV parent 1:12 handle 120: $QDISC `get_limit ${ILIMIT}` `get_target "${ITARGET}" ${DOWNLINK}` `get_ecn ${IECN}` `get_quantum 1500` `get_flows ${BE_RATE}` ${IQDISC_OPTS}
+ $TC qdisc add dev $DEV parent 1:13 handle 130: $QDISC `get_limit ${ILIMIT}` `get_target "${ITARGET}" ${DOWNLINK}` `get_ecn ${IECN}` `get_quantum 300` `get_flows ${BK_RATE}` ${IQDISC_OPTS}
+
+ diffserv $DEV
+ ;;
+ esac
fi
ifconfig $DEV up
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
-# Copyright (C) 2012-4 Michael D. Taht, Toke Høiland-Jørgensen, Sebastian Moeller
+# Copyright (C) 2012-5 Michael D. Taht, Toke Høiland-Jørgensen, Sebastian Moeller
. /usr/lib/sqm/functions.sh
sqm_logger "Starting simplest.qos"
LQ="quantum `get_mtu $IFACE ${UPLINK}`"
$TC qdisc del dev $IFACE root 2>/dev/null
-$TC qdisc add dev $IFACE root handle 1: `get_stab_string` htb default 10
-$TC class add dev $IFACE parent 1: classid 1:1 htb $LQ rate ${UPLINK}kbit ceil ${UPLINK}kbit `get_htb_adsll_string`
-$TC class add dev $IFACE parent 1:1 classid 1:10 htb $LQ rate ${UPLINK}kbit ceil ${UPLINK}kbit prio 0 `get_htb_adsll_string`
-$TC qdisc add dev $IFACE parent 1:10 handle 110: $QDISC `get_limit ${ELIMIT}` `get_target "${ETARGET}" ${UPLINK}` `get_ecn ${EECN}` `get_flows ${UPLINK}` ${EQDISC_OPTS}
+case $QDISC in
+ cake*)
+ $TC qdisc add dev $IFACE root `get_stab_string` cake bandwidth ${UPLINK}kbit besteffort `get_cake_lla_string` ${EQDISC_OPTS}
+ ;;
+ *)
+ $TC qdisc add dev $IFACE root handle 1: `get_stab_string` htb default 10
+ $TC class add dev $IFACE parent 1: classid 1:1 htb $LQ rate ${UPLINK}kbit ceil ${UPLINK}kbit `get_htb_adsll_string`
+ $TC class add dev $IFACE parent 1:1 classid 1:10 htb $LQ rate ${UPLINK}kbit ceil ${UPLINK}kbit prio 0 `get_htb_adsll_string`
+ $TC qdisc add dev $IFACE parent 1:10 handle 110: $QDISC `get_limit ${ELIMIT}` `get_target "${ETARGET}" ${UPLINK}` `get_ecn ${EECN}` `get_flows ${UPLINK}` ${EQDISC_OPTS}
+ ;;
+esac
}
LQ="quantum `get_mtu $IFACE ${DOWNLINK}`"
$TC qdisc del dev $DEV root 2>/dev/null
-$TC qdisc add dev $DEV root handle 1: `get_stab_string` htb default 10
-$TC class add dev $DEV parent 1: classid 1:1 htb $LQ rate ${DOWNLINK}kbit ceil ${DOWNLINK}kbit `get_htb_adsll_string`
-$TC class add dev $DEV parent 1:1 classid 1:10 htb $LQ rate ${DOWNLINK}kbit ceil ${DOWNLINK}kbit prio 0 `get_htb_adsll_string`
-
-# FIXME: I'd prefer to use a pre-nat filter but we need to detect if nat is on this interface
-# AND we need to permute by a random number which we can't do from userspace filters
-
-# Most high rate flows are REALLY close. This stomps on those harder, but hurts on high rate long distance
-#$TC qdisc add dev $DEV parent 1:10 handle 110: $QDISC limit $LIMIT $ECN interval 20ms target 3ms `get_flows ${DOWNLINK}`
-$TC qdisc add dev $DEV parent 1:10 handle 110: $QDISC `get_limit ${ILIMIT}` `get_target "${ITARGET}" ${DOWNLINK}` `get_ecn ${IECN}` `get_flows ${DOWNLINK}` ${IQDISC_OPTS}
+case $QDISC in
+ cake*)
+ $TC qdisc add dev $DEV root `get_stab_string` cake bandwidth ${DOWNLINK}kbit besteffort `get_cake_lla_string` ${IQDISC_OPTS}
+ ;;
+ *)
+ $TC qdisc add dev $DEV root handle 1: `get_stab_string` htb default 10
+ $TC class add dev $DEV parent 1: classid 1:1 htb $LQ rate ${DOWNLINK}kbit ceil ${DOWNLINK}kbit `get_htb_adsll_string`
+ $TC class add dev $DEV parent 1:1 classid 1:10 htb $LQ rate ${DOWNLINK}kbit ceil ${DOWNLINK}kbit prio 0 `get_htb_adsll_string`
+
+ # FIXME: I'd prefer to use a pre-nat filter but we need to detect if nat is on this interface
+ # AND we need to permute by a random number which we can't do from userspace filters
+
+ # Most high rate flows are REALLY close. This stomps on those harder, but hurts on high rate long distance
+ #$TC qdisc add dev $DEV parent 1:10 handle 110: $QDISC limit $LIMIT $ECN interval 20ms target 3ms `get_flows ${DOWNLINK}`
+ $TC qdisc add dev $DEV parent 1:10 handle 110: $QDISC `get_limit ${ILIMIT}` `get_target "${ITARGET}" ${DOWNLINK}` `get_ecn ${IECN}` `get_flows ${DOWNLINK}` ${IQDISC_OPTS}
+ ;;
+esac
ifconfig $DEV up
PKG_NAME:=sslh
PKG_VERSION:=v1.17
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://rutschle.net/tech/
local val
# A) listen parameter
config_get vals "${section}" listen
- [ -n "${vals}" ] && for val in $vals; do append args "-p ${val}"; done
+ [ -n "${vals}" ] && for val in $vals; do append args "-p${val}"; done
# B) ssh parameter
config_get val "${section}" ssh
[ -n "${val}" ] && append args "--ssh ${val}"
eap-md5 \
eap-mschapv2 \
eap-radius \
+ eap-tls \
farp \
fips-prf \
gcm \
+strongswan-mod-eap-md5 \
+strongswan-mod-eap-mschapv2 \
+strongswan-mod-eap-radius \
+ +strongswan-mod-eap-tls \
+strongswan-mod-farp \
+strongswan-mod-fips-prf \
+strongswan-mod-gcm \
$(INSTALL_DIR) $(1)/etc
$(CP) $(PKG_INSTALL_DIR)/etc/strongswan.conf $(1)/etc/
$(INSTALL_DIR) $(1)/usr/lib/ipsec
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/{libstrongswan.so.*,libhydra.so.*} $(1)/usr/lib/ipsec/
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/{libtls.so.*,libstrongswan.so.*,libhydra.so.*} $(1)/usr/lib/ipsec/
$(INSTALL_CONF) ./files/ipsec.secrets $(1)/etc/
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/ipsec.init $(1)/etc/init.d/ipsec
$(eval $(call BuildPlugin,eap-md5,EAP MD5 (CHAP) EAP auth,))
$(eval $(call BuildPlugin,eap-mschapv2,EAP MS-CHAPv2 EAP auth,+strongswan-mod-md4 +strongswan-mod-des))
$(eval $(call BuildPlugin,eap-radius,EAP RADIUS auth,))
+$(eval $(call BuildPlugin,eap-tls,EAP TLS auth,))
$(eval $(call BuildPlugin,farp,fake arp respsonses,))
$(eval $(call BuildPlugin,fips-prf,FIPS PRF crypto,+strongswan-mod-sha1))
$(eval $(call BuildPlugin,gcm,GCM AEAD wrapper crypto,))
include $(TOPDIR)/rules.mk
PKG_NAME:=stunnel
-PKG_VERSION:=5.14
+PKG_VERSION:=5.20
PKG_RELEASE:=1
PKG_LICENSE:=GPL-2.0+
PKG_SOURCE_URL:=http://stunnel.cybermirror.org/archive/5.x/
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=e716501960dc6856d80f92547298f724
+PKG_MD5SUM:=3264375026c2b496b5d258e243222de8
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
+++ /dev/null
---- a/src/prototypes.h
-+++ b/src/prototypes.h
-@@ -590,7 +590,7 @@ extern GETNAMEINFO s_getnameinfo;
-
- #endif /* USE_WIN32 */
-
--int getnameinfo(const struct sockaddr *, int, char *, int, char *, int, int);
-+int getnameinfo(const struct sockaddr *, socklen_t, char *, socklen_t, char *, socklen_t, unsigned int);
-
- #endif /* !defined HAVE_GETNAMEINFO */
-
---- a/src/resolver.c
-+++ b/src/resolver.c
-@@ -538,8 +538,9 @@ const char *s_gai_strerror(int err) {
- /* implementation is limited to functionality needed by stunnel */
-
- #ifndef HAVE_GETNAMEINFO
--int getnameinfo(const struct sockaddr *sa, int salen,
-- char *host, int hostlen, char *serv, int servlen, int flags) {
-+int getnameinfo(const struct sockaddr *sa, socklen_t salen,
-+ char *host, socklen_t hostlen, char *serv, socklen_t servlen,
-+ unsigned int flags) {
-
- #if defined(USE_WIN32) && !defined(_WIN32_WCE)
- if(s_getnameinfo)
--- /dev/null
+Index: stunnel-5.20/src/cron.c
+===================================================================
+--- stunnel-5.20.orig/src/cron.c
++++ stunnel-5.20/src/cron.c
+@@ -46,6 +46,9 @@ NOEXPORT void cron_thread(void *arg);
+ #endif
+ #if defined(USE_PTHREAD) || defined(USE_WIN32)
+ NOEXPORT void cron_worker(void);
++#endif
++
++#ifndef OPENSSL_NO_DH
+ NOEXPORT void cron_dh_param(void);
+ #endif
+
PKG_NAME:=transmission
PKG_VERSION:=2.84
-PKG_RELEASE:=3
+PKG_RELEASE:=4
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://download-origin.transmissionbt.com/files/ http://mirrors.m0k.org/transmission/files
$(call Package/transmission/template)
DEPENDS:=+libcurl +libopenssl +libpthread +libevent2 +librt
MENU:=1
+ USERID:=transmission=224:transmission=224
endef
define Package/transmission-cli
option config_dir '/tmp/transmission'
#option user 'nobody'
option mem_percentage 50
+ option nice 10
+ option ionice_flags '-c 3'
option alt_speed_down 50
option alt_speed_enabled false
option alt_speed_time_begin 540
local USE
local user
- local download_dir
+ local download_dir config_dir
local mem_percentage
+ local config_overwrite nice ionice_flags
+ local cmdline
section_enabled "$section" || return 1
config_get user "$cfg" 'user'
config_get download_dir "$cfg" 'download_dir' '/var/etc/transmission'
config_get mem_percentage "$cfg" 'mem_percentage' '50'
+ config_get config_overwrite "$cfg" config_overwrite 1
+ config_get nice "$cfg" nice 0
+ config_get ionice_flags "$cfg" ionice_flags ''
+ which ionice > /dev/null || ionice_flags=''
local MEM=$(sed -ne 's!^MemTotal:[[:space:]]*\([0-9]*\) kB$!\1!p' /proc/meminfo)
if test "$MEM" -gt 1;then
[ -z "$user" ] || chown -R $user $config_dir
}
- echo "{" > $config_file
-
- append_params "$cfg" \
- alt_speed_down alt_speed_enabled alt_speed_time_begin alt_speed_time_day \
- alt_speed_time_enabled alt_speed_time_end alt_speed_up blocklist_enabled \
- cache_size_mb download_queue_enabled download_queue_size \
- dht_enabled encryption idle_seeding_limit idle_seeding_limit_enabled \
- incomplete_dir_enabled lazy_bitfield_enabled lpd_enabled message_level \
- peer_limit_global peer_limit_per_torrent peer_port \
- peer_port_random_high peer_port_random_low peer_port_random_on_start \
- pex_enabled port_forwarding_enabled preallocation prefetch_enabled \
- ratio_limit ratio_limit_enabled rename_partial_files rpc_authentication_required \
- rpc_enabled rpc_port rpc_whitelist_enabled queue_stalled_enabled \
- queue_stalled_minutes scrape_paused_torrents_enabled script_torrent_done_enabled \
- seed_queue_enabled seed_queue_size \
- speed_limit_down speed_limit_down_enabled speed_limit_up \
- speed_limit_up_enabled start_added_torrents trash_original_torrent_files \
- umask upload_slots_per_torrent utp_enabled scrape_paused_torrents \
- watch_dir_enabled
-
- append_params_quotes "$cfg" \
- blocklist_url bind_address_ipv4 bind_address_ipv6 download_dir incomplete_dir \
- peer_congestion_algorithm peer_socket_tos rpc_bind_address rpc_password rpc_url \
- rpc_username rpc_whitelist script_torrent_done_filename watch_dir
-
- echo "\""invalid-key"\": false" >> $config_file
- echo "}" >> $config_file
+ [ "$config_overwrite" == 0 ] || {
+
+ echo "{" > $config_file
+
+ append_params "$cfg" \
+ alt_speed_down alt_speed_enabled alt_speed_time_begin alt_speed_time_day \
+ alt_speed_time_enabled alt_speed_time_end alt_speed_up blocklist_enabled \
+ cache_size_mb download_queue_enabled download_queue_size \
+ dht_enabled encryption idle_seeding_limit idle_seeding_limit_enabled \
+ incomplete_dir_enabled lazy_bitfield_enabled lpd_enabled message_level \
+ peer_limit_global peer_limit_per_torrent peer_port \
+ peer_port_random_high peer_port_random_low peer_port_random_on_start \
+ pex_enabled port_forwarding_enabled preallocation prefetch_enabled \
+ ratio_limit ratio_limit_enabled rename_partial_files rpc_authentication_required \
+ rpc_enabled rpc_port rpc_whitelist_enabled queue_stalled_enabled \
+ queue_stalled_minutes scrape_paused_torrents_enabled script_torrent_done_enabled \
+ seed_queue_enabled seed_queue_size \
+ speed_limit_down speed_limit_down_enabled speed_limit_up \
+ speed_limit_up_enabled start_added_torrents trash_original_torrent_files \
+ umask upload_slots_per_torrent utp_enabled scrape_paused_torrents \
+ watch_dir_enabled
+
+ append_params_quotes "$cfg" \
+ blocklist_url bind_address_ipv4 bind_address_ipv6 download_dir incomplete_dir \
+ peer_congestion_algorithm peer_socket_tos rpc_bind_address rpc_password rpc_url \
+ rpc_username rpc_whitelist script_torrent_done_filename watch_dir
+
+ echo "\""invalid-key"\": false" >> $config_file
+ echo "}" >> $config_file
+ }
+
+ cmdline="/usr/bin/transmission-daemon -g $config_dir -f"
+ [ "$ionice_flags" ] && cmdline="ionice $ionice_flags $cmdline"
procd_open_instance
- procd_set_param command /usr/bin/transmission-daemon -g $config_dir -f
+ procd_set_param command $cmdline
procd_set_param respawn retry=60
procd_set_param user "$user"
+ procd_set_param nice "$nice"
if test -z "$USE";then
procd_set_param limits core="0 0"
else
PKG_NAME:=vpnc
PKG_REV:=550
PKG_VERSION:=0.5.3.r$(PKG_REV)
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://svn.unix-ag.uni-kl.de/vpnc/trunk/
logger -t vpnc "initializing..."
serv_addr=
for ip in $(resolveip -t 10 "$server"); do
- ( proto_add_host_dependency "$config" "$ip" $interface )
+ ( proto_add_host_dependency "vpn-$config" "$ip" $interface )
serv_addr=1
done
[ -n "$serv_addr" ] || {
--- /dev/null
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=squeezelite
+PKG_VERSION:=1.8
+PKG_RELEASE=1
+
+PKG_LICENSE:=GPL-3.0
+PKG_LICENSE_FILES:=LICENSE.txt
+PKG_MAINTAINER:= Ted Hess <thess@kitschensync.net>
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://code.google.com/p/squeezelite/
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=8b8dfe6918ebe45ade5f3d9b68d453d7b8128d99
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
+
+PKG_BUILD_DEPENDS:=libflac libvorbis libmad libfaad2 SQUEEZELITE_WMA:libffmpeg-audio-dec
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/squeezelite/default
+ SECTION:=sound
+ CATEGORY:=Sound
+ TITLE:=Headless squeezebox emulator
+ PROVIDES:=squeezelite
+ URL:=https://code.google.com/p/squeezelite/
+ DEPENDS:= +alsa-lib +SQUEEZELITE_RESAMPLE:libsoxr
+ MENU:=1
+endef
+
+define Package/squeezelite-full
+ $(call Package/squeezelite/default)
+ TITLE+= (full)
+ DEPENDS+= +libflac +libvorbis +libmad +libfaad2 \
+ +SQUEEZELITE_WMA:libffmpeg-audio-dec
+ VARIANT:=full
+endef
+
+define Package/squeezelite-mini
+ $(call Package/squeezelite/default)
+ TITLE+= (minimal)
+ VARIANT:=mini
+endef
+
+define Package/squeezelite/config/default
+
+ config SQUEEZELITE_WMA
+ bool "WMA/ALAC decode support"
+ help
+ Include WMA and ALAC decoding using ffmpeg
+ default n
+
+ config SQUEEZELITE_RESAMPLE
+ bool "Resample support"
+ help
+ Include support for resampling using libsoxr
+ default n
+
+ config SQUEEZELITE_DSD
+ bool "DSD playback over PCM (DoP)"
+ help
+ Include support for DSD over PCM for compatible DAC"
+ default n
+endef
+
+define Package/squeezelite-full/config
+ if PACKAGE_squeezelite-full
+ $(call Package/squeezelite/config/default)
+ endif
+endef
+
+define Package/squeezelite-mini/config
+ if PACKAGE_squeezelite-mini
+ $(call Package/squeezelite/config/default)
+ endif
+endef
+
+define Package/squeezelite/description/default
+ Squeezelite is a small headless squeezebox emulator for linux using alsa audio output
+ It is aimed at supporting high quality audio at multiple sample rates including
+ 44.1/48/88.2/96/176.4/192k/352.8/384kHz
+ Supported codecs: mp3, flac, ogg, aac, (wma and alac via ffmpeg)
+ Native support for PCM builtin
+ Optional support of DSD playback via PCM for DoP capable DAC
+ Optional resampling to match sound device
+endef
+
+define Package/squeezelite/description
+ $(call Package/squeezelite/description/default)
+ .
+ This package has all the audio codecs compiled in.
+endef
+
+define Package/squeezelite-mini/description
+ $(call Package/squeezelite/description/default)
+ .
+ This package will dynamically load installed codecs.
+endef
+
+#ifeq ($(CONFIG_SQUEEZELITE_WMA),y)
+# PKG_BUILD_DEPENDS+= libffmpeg-audio-dec
+#endif
+
+TARGET_CFLAGS+= -Wall -fPIC -O2 -DSELFPIPE
+
+ifeq ($(CONFIG_SQUEEZELITE_WMA),y)
+ TARGET_CFLAGS+= -DFFMPEG
+endif
+
+ifeq ($(CONFIG_SQUEEZELITE_DSD),y)
+ TARGET_CFLAGS+= -DDSD
+endif
+
+ifeq ($(CONFIG_SQUEEZELITE_RESAMPLE),y)
+ TARGET_CFLAGS+= -DRESAMPLE
+endif
+
+TARGET_LDFLAGS+= -lasound -lpthread -lm -lrt
+
+ifeq ($(BUILD_VARIANT),full)
+ TARGET_CFLAGS+= -DLINKALL
+endif
+
+define Package/squeezelite/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/squeezelite $(1)/usr/bin
+ $(INSTALL_DIR) $(1)/etc/init.d
+ $(INSTALL_BIN) ./files/squeezelite.init $(1)/etc/init.d/squeezelite
+ $(INSTALL_DIR) $(1)/etc/config
+ $(INSTALL_CONF) ./files/squeezelite.conf $(1)/etc/config/squeezelite
+endef
+
+Package/squeezelite-mini/install=$(Package/squeezelite/install)
+Package/squeezelite-full/install=$(Package/squeezelite/install)
+
+$(eval $(call BuildPackage,squeezelite-mini))
+$(eval $(call BuildPackage,squeezelite-full))
--- /dev/null
+
+config options 'options'
+ option name 'SqueezeWrt'
+ option model_name 'SqueezeLite'
+ option close_delay '0'
+ option priority '0'
+ option max_sr '0'
+ option device 'hw:0,0'
+ option decoder_auto_conf '1'
+ option dsd_over_pcm '0'
+ option ircontrol '0'
+ option enabled '1'
--- /dev/null
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2015 OpenWrt.org
+
+START=99
+STOP=1
+
+USE_PROCD=1
+PROG=/usr/bin/squeezelite
+
+#
+# Auto config checks for existing codec installations if not specified in config
+# Explicit disable (override) by setting appropriate "decode_xxx" in config
+#
+checkcodec() {
+ config_get_bool auto_conf options "decoder_auto_conf" 1
+ config_get_bool codec options "$1" $auto_conf
+
+ if [ $codec -ne 0 ] ; then
+ if [ $auto_conf -eq 0 ] ; then
+ #force use requested
+ echo "$4"
+ else
+ if [ -e "/usr/lib/${2}" ] ; then
+ # Use codec (it exists)
+ echo "$4"
+ else
+ #exclude non-existant
+ if [ -z "$4" ] ; then
+ echo "-e $3"
+ else
+ echo "$4,$3"
+ fi
+ fi
+ fi
+ else
+ # explicitly excluded
+ if [ -z "$4" ] ; then
+ echo "-e $3"
+ else
+ echo "$4,$3"
+ fi
+ fi
+}
+
+make_cmdline() {
+ cmdline=""
+
+ config_get name options name "SqueezeWrt"
+ cmdline="$cmdline -n $name"
+
+ config_get model_name options model_name "SqueezeLite"
+ cmdline="$cmdline -M $model_name"
+
+ config_get device options device ""
+ [ -n $device ] && cmdline="$cmdline -o $device"
+
+ config_get alsa_buffer options alsa_buffer 200
+ [ $alsa_buffer -eq 0 ] && alsa_buffer="200"
+
+ config_get alsa_period options alsa_period 4
+ [ $alsa_period -eq 0 ] && alsa_period="4"
+
+ config_get alsa_format options alsa_format 16
+ [ $alsa_format = "0" ] && alsa_format="16"
+
+ config_get alsa_mmap options alsa_mmap 0
+ cmdline="$cmdline -a $alsa_buffer:$alsa_period:$alsa_format:$alsa_mmap"
+
+ config_get stream_bufsiz options stream_bufsiz 2048
+ config_get out_bufsiz options out_bufsiz 3763
+ cmdline="$cmdline -b $stream_bufsiz:$out_bufsiz"
+
+ config_get max_sr options max_sr 0
+ if [ $max_sr -ne 0 ] ; then
+ max_sr="-r $max_sr"
+
+ config_get sr_delay options sr_delay 0
+ [ $sr_delay -ne 0 ] && max_sr="$max_sr:$sr_delay"
+ cmdline="$cmdline $max_sr"
+ fi
+
+
+ config_get close_delay options close_delay 0
+ [ $close_delay -ne 0 ] && cmdline="$cmdline -C $close_delay"
+
+ config_get server_addr options server_addr ""
+ if [ -n "$server_addr" ] ; then
+ config_get server_port options server_port 3483
+ cmdline="$cmdline -s $server_addr:$server_port"
+ fi
+
+ config_get priority options priority 0
+ [ $priority -ne 0 ] && cmdline="$cmdline -p $priority"
+
+ #
+ # ***NOTE: codec lib names are in squeezelite.h (set decode_auto_conf to 0 to ignore)
+ #
+ local excl_codecs=""
+ excl_codecs=`checkcodec decode_flac "libFLAC.so.8" flac "$excl_codecs"`
+ excl_codecs=`checkcodec decode_mp3 "libmad.so.0" mp3 "$excl_codecs"`
+ excl_codecs=`checkcodec decode_aac "libfaad.so.2" aac "$excl_codecs"`
+ excl_codecs=`checkcodec decode_ogg "libvorbisfile.so.3" ogg "$excl_codecs"`
+ excl_codecs=`checkcodec decode_wma_alac "libavcodec.so.56" wma,alac "$excl_codecs"`
+ cmdline="$cmdline $excl_codecs"
+
+ config_get dop options dsd_over_pcm 0
+ [ $dop -eq 1 ] && cmdline="$cmdline -D"
+}
+
+start_service() {
+ config_load squeezelite
+
+ config_get_bool enabled options 'enabled' 0
+ [ $enabled -eq 0 ] && return
+
+ # Build command params
+ make_cmdline
+
+ procd_open_instance
+ logger -t 'squeezelite' "$cmdline"
+ procd_set_param command "$PROG" $cmdline
+ procd_close_instance
+}
+
+# Wait for service to exit and release sockets
+reload_service() {
+ stop
+ sleep 2
+ start
+}
+
+restart() {
+ reload_service
+}
--- /dev/null
+From 1c53ed7db5b49ebf347efe65dbf9b740f9d54557 Mon Sep 17 00:00:00 2001
+From: Carlo Landmeter <clandmeter@gmail.com>
+Date: Tue, 31 Mar 2015 09:52:53 +0000
+Subject: [PATCH] respect LDFLAGS
+
+---
+ Makefile | 17 +++++++++--------
+ 1 file changed, 9 insertions(+), 8 deletions(-)
+
+--- a/Makefile
++++ b/Makefile
+@@ -1,6 +1,7 @@
+ # Cross compile support - create a Makefile which defines these three variables and then includes this Makefile...
+-CFLAGS ?= -Wall -fPIC -O2 $(OPTS)
+-LDFLAGS ?= -lasound -lpthread -lm -lrt
++CFLAGS ?= -Wall -O2
++CFLAGS += -fPIC $(OPTS)
++LIBS ?= -lasound -lpthread -lm -lrt
+ EXECUTABLE ?= squeezelite
+
+ # passing one or more of these in $(OPTS) enables optional feature inclusion
+@@ -52,20 +53,20 @@ endif
+
+ # add optional link options
+ ifneq (,$(findstring $(OPT_LINKALL), $(CFLAGS)))
+- LDFLAGS += $(LINKALL)
++ LIBS += $(LINKALL)
+ ifneq (,$(findstring $(OPT_FF), $(CFLAGS)))
+- LDFLAGS += $(LINKALL_FF)
++ LIBS += $(LINKALL_FF)
+ endif
+ ifneq (,$(findstring $(OPT_RESAMPLE), $(CFLAGS)))
+- LDFLAGS += $(LINKALL_RESAMPLE)
++ LIBS += $(LINKALL_RESAMPLE)
+ endif
+ ifneq (,$(findstring $(OPT_IR), $(CFLAGS)))
+- LDFLAGS += $(LINKALL_IR)
++ LIBS += $(LINKALL_IR)
+ endif
+ else
+ # if not LINKALL and linux add LINK_LINUX
+ ifeq ($(UNAME), Linux)
+- LDFLAGS += $(LINK_LINUX)
++ LIBS += $(LINK_LINUX)
+ endif
+ endif
+
+@@ -74,7 +75,7 @@ OBJECTS = $(SOURCES:.c=.o)
+ all: $(EXECUTABLE)
+
+ $(EXECUTABLE): $(OBJECTS)
+- $(CC) $(OBJECTS) $(LDFLAGS) -o $@
++ $(CC) $(OBJECTS) $(LDFLAGS) $(LIBS) -o $@
+
+ $(OBJECTS): $(DEPS)
+
--- /dev/null
+--- a/main.c
++++ b/main.c
+@@ -187,6 +187,17 @@ static void sighandler(int signum) {
+ signal(signum, SIG_DFL);
+ }
+
++// Waits for nonzero MAC
++static void get_nonzero_mac(u8_t mac[], u32_t timeout_ms) {
++ u32_t wait_timeout = gettime_ms() + timeout_ms;
++ do{
++ get_mac(mac);
++ if ((mac[0]+mac[1]+mac[2]+mac[3]+mac[4]+mac[5]) != 0) {
++ break;
++ }
++ }while(wait_timeout > gettime_ms());
++}
++
+ int main(int argc, char **argv) {
+ char *server = NULL;
+ char *output_device = "default";
+@@ -240,7 +251,8 @@ int main(int argc, char **argv) {
+ #define MAXCMDLINE 512
+ char cmdline[MAXCMDLINE] = "";
+
+- get_mac(mac);
++ // Waits for nonzero MAC
++ get_nonzero_mac(mac,10000);
+
+ for (i = 0; i < argc && (strlen(argv[i]) + strlen(cmdline) + 2 < MAXCMDLINE); i++) {
+ strcat(cmdline, argv[i]);
--- /dev/null
+--- a/Makefile
++++ b/Makefile
+@@ -15,7 +15,7 @@ OPT_IR = -DIR
+ SOURCES = \
+ main.c slimproto.c buffer.c stream.c utils.c \
+ output.c output_alsa.c output_pa.c output_stdout.c output_pack.c decode.c \
+- flac.c pcm.c mad.c vorbis.c faad.c mpg.c
++ flac.c pcm.c mad.c vorbis.c faad.c
+
+ SOURCES_DSD = dsd.c dop.c dsd2pcm/dsd2pcm.c
+ SOURCES_FF = ffmpeg.c
+@@ -25,7 +25,7 @@ SOURCES_IR = ir.c
+
+ LINK_LINUX = -ldl
+
+-LINKALL = -lFLAC -lmad -lvorbisfile -lfaad -lmpg123
++LINKALL = -lFLAC -lmad -lvorbisfile -lfaad
+ LINKALL_FF = -lavcodec -lavformat -lavutil
+ LINKALL_RESAMPLE = -lsoxr
+ LINKALL_IR = -llirc_client
+--- a/decode.c
++++ b/decode.c
+@@ -146,8 +146,8 @@ void decode_init(log_level level, const
+ // try mad then mpg for mp3 unless command line option passed
+ if (!(strstr(exclude_codecs, "mp3") || strstr(exclude_codecs, "mad")) &&
+ (!include_codecs || strstr(include_codecs, "mp3") || strstr(include_codecs, "mad"))) codecs[i] = register_mad();
+- if (!(strstr(exclude_codecs, "mp3") || strstr(exclude_codecs, "mpg")) && !codecs[i] &&
+- (!include_codecs || strstr(include_codecs, "mp3") || strstr(include_codecs, "mpg"))) codecs[i] = register_mpg();
++// if (!(strstr(exclude_codecs, "mp3") || strstr(exclude_codecs, "mpg")) && !codecs[i] &&
++// (!include_codecs || strstr(include_codecs, "mp3") || strstr(include_codecs, "mpg"))) codecs[i] = register_mpg();
+
+ mutex_create(decode.mutex);
+
+--- a/main.c
++++ b/main.c
+@@ -35,7 +35,8 @@
+ #else
+ #define CODECS_DSD ""
+ #endif
+-#define CODECS_MP3 " (mad,mpg for specific mp3 codec)"
++//#define CODECS_MP3 " (mad,mpg for specific mp3 codec)"
++#define CODECS_MP3 " (mad for specific mp3 codec)"
+
+ #define CODECS CODECS_BASE CODECS_FF CODECS_DSD CODECS_MP3
+
+--- a/squeezelite.h
++++ b/squeezelite.h
+@@ -140,7 +140,7 @@
+ #if LINUX
+ #define LIBFLAC "libFLAC.so.8"
+ #define LIBMAD "libmad.so.0"
+-#define LIBMPG "libmpg123.so.0"
++//#define LIBMPG "libmpg123.so.0"
+ #define LIBVORBIS "libvorbisfile.so.3"
+ #define LIBTREMOR "libvorbisidec.so.1"
+ #define LIBFAAD "libfaad.so.2"
+@@ -154,7 +154,7 @@
+ #if OSX
+ #define LIBFLAC "libFLAC.8.dylib"
+ #define LIBMAD "libmad.0.dylib"
+-#define LIBMPG "libmpg123.0.dylib"
++//#define LIBMPG "libmpg123.0.dylib"
+ #define LIBVORBIS "libvorbisfile.3.dylib"
+ #define LIBTREMOR "libvorbisidec.1.dylib"
+ #define LIBFAAD "libfaad.2.dylib"
+@@ -167,7 +167,7 @@
+ #if WIN
+ #define LIBFLAC "libFLAC.dll"
+ #define LIBMAD "libmad-0.dll"
+-#define LIBMPG "libmpg123-0.dll"
++//#define LIBMPG "libmpg123-0.dll"
+ #define LIBVORBIS "libvorbisfile.dll"
+ #define LIBTREMOR "libvorbisidec.dll"
+ #define LIBFAAD "libfaad2.dll"
+@@ -180,7 +180,7 @@
+ #if FREEBSD
+ #define LIBFLAC "libFLAC.so.11"
+ #define LIBMAD "libmad.so.2"
+-#define LIBMPG "libmpg123.so.0"
++//#define LIBMPG "libmpg123.so.0"
+ #define LIBVORBIS "libvorbisfile.so.6"
+ #define LIBTREMOR "libvorbisidec.so.1"
+ #define LIBFAAD "libfaad.so.2"
--- /dev/null
+--- a/output_alsa.c
++++ b/output_alsa.c
+@@ -862,8 +862,11 @@ void output_init_alsa(log_level level, c
+ LOG_INFO("memory locked");
+ }
+
++#ifdef M_TRIM_THRESHOLD
++ // mallopt is not defined in musl libc
+ mallopt(M_TRIM_THRESHOLD, -1);
+ mallopt(M_MMAP_MAX, 0);
++#endif
+
+ touch_memory(silencebuf, MAX_SILENCE_FRAMES * BYTES_PER_FRAME);
+ touch_memory(outputbuf->buf, outputbuf->size);
--- /dev/null
+--- a/faad.c
++++ b/faad.c
+@@ -593,6 +593,8 @@ static bool load_faad() {
+ return false;
+ }
+
++ err = dlerror(); // Reset previous dynamic linking error string (if there was)
++
+ a->NeAACDecGetCurrentConfiguration = dlsym(handle, "NeAACDecGetCurrentConfiguration");
+ a->NeAACDecSetConfiguration = dlsym(handle, "NeAACDecSetConfiguration");
+ a->NeAACDecOpen = dlsym(handle, "NeAACDecOpen");
+--- a/ffmpeg.c
++++ b/ffmpeg.c
+@@ -590,6 +590,8 @@ static bool load_ff() {
+ return false;
+ }
+
++ err = dlerror(); // Reset previous dynamic linking error string (if there was)
++
+ sprintf(name, LIBAVFORMAT, LIBAVFORMAT_VERSION_MAJOR);
+ handle_format = dlopen(name, RTLD_NOW);
+ if (!handle_format) {
+--- a/flac.c
++++ b/flac.c
+@@ -241,6 +241,8 @@ static bool load_flac() {
+ return false;
+ }
+
++ err = dlerror(); // Reset previous dynamic linking error string (if there was)
++
+ f->FLAC__StreamDecoderErrorStatusString = dlsym(handle, "FLAC__StreamDecoderErrorStatusString");
+ f->FLAC__StreamDecoderStateString = dlsym(handle, "FLAC__StreamDecoderStateString");
+ f->FLAC__stream_decoder_new = dlsym(handle, "FLAC__stream_decoder_new");
+--- a/ir.c
++++ b/ir.c
+@@ -167,10 +167,10 @@ static void *ir_thread() {
+ UNLOCK_I;
+ wake_controller();
+ }
+-
++
+ free(code);
+ }
+-
++
+ return 0;
+ }
+
+@@ -184,6 +184,8 @@ static bool load_lirc() {
+ return false;
+ }
+
++ err = dlerror(); // Reset previous dynamic linking error string (if there was)
++
+ i->lirc_init = dlsym(handle, "lirc_init");
+ i->lirc_deinit = dlsym(handle, "lirc_deinit");
+ i->lirc_readconfig = dlsym(handle, "lirc_readconfig");
+--- a/mad.c
++++ b/mad.c
+@@ -364,7 +364,9 @@ static bool load_mad() {
+ LOG_INFO("dlerror: %s", dlerror());
+ return false;
+ }
+-
++
++ err = dlerror(); // Reset previous dynamic linking error string (if there was)
++
+ m->mad_stream_init = dlsym(handle, "mad_stream_init");
+ m->mad_frame_init = dlsym(handle, "mad_frame_init");
+ m->mad_synth_init = dlsym(handle, "mad_synth_init");
+--- a/mpg.c
++++ b/mpg.c
+@@ -221,7 +221,9 @@ static bool load_mpg() {
+ LOG_INFO("dlerror: %s", dlerror());
+ return false;
+ }
+-
++
++ err = dlerror(); // Reset previous dynamic linking error string (if there was)
++
+ m->mpg123_init = dlsym(handle, "mpg123_init");
+ m->mpg123_feature = dlsym(handle, "mpg123_feature");
+ m->mpg123_rates = dlsym(handle, "mpg123_rates");
+--- a/resample.c
++++ b/resample.c
+@@ -250,6 +250,8 @@ static bool load_soxr(void) {
+ return false;
+ }
+
++ err = dlerror(); // Reset previous dynamic linking error string (if there was)
++
+ r->soxr_io_spec = dlsym(handle, "soxr_io_spec");
+ r->soxr_quality_spec = dlsym(handle, "soxr_quality_spec");
+ r->soxr_create = dlsym(handle, "soxr_create");
+--- a/vorbis.c
++++ b/vorbis.c
+@@ -286,6 +286,8 @@ static bool load_vorbis() {
+ }
+ }
+
++ err = dlerror(); // Reset previous dynamic linking error string (if there was)
++
+ v->ov_read = tremor ? NULL : dlsym(handle, "ov_read");
+ v->ov_read_tremor = tremor ? dlsym(handle, "ov_read") : NULL;
+ v->ov_info = dlsym(handle, "ov_info");
#
-# Copyright (C) 2006-2014 OpenWrt.org
+# Copyright (C) 2006-2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=alsa-utils
-PKG_VERSION:=1.0.28
-PKG_RELEASE:=2
+PKG_VERSION:=1.0.29
+PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=ftp://ftp.alsa-project.org/pub/utils/ \
http://alsa.cybermirror.org/utils/
-PKG_MD5SUM:=361552d5b1cacd0a1e7ba09e69990211
+PKG_MD5SUM:=6b289bf874c4c9a63f4b3973093dd404
PKG_INSTALL:=1
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
include $(TOPDIR)/rules.mk
PKG_NAME:=bluez
-PKG_VERSION:=5.30
-PKG_RELEASE:=2
+PKG_VERSION:=5.31
+PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_SOURCE_URL:=http://www.kernel.org/pub/linux/bluetooth/
-PKG_MD5SUM:=24ba1d1e8e7ef5b8f4033a3059d7600e
+PKG_SOURCE_URL:=@KERNEL/linux/bluetooth/
+PKG_MD5SUM:=cb1db487b65dd4d57a2dd6b8f063c393
PKG_LICENSE:=GPL-2.0+
PKG_LICENSE_FILES:=COPYING
--- a/Makefile.in
+++ b/Makefile.in
-@@ -2055,7 +2055,7 @@ unit_tests = $(am__append_32) unit/test-
+@@ -2394,7 +2394,7 @@ unit_tests = $(am__append_32) unit/test-
@CLIENT_TRUE@ monitor/uuid.h monitor/uuid.c
@CLIENT_TRUE@client_bluetoothctl_LDADD = gdbus/libgdbus-internal.la @GLIB_LIBS@ @DBUS_LIBS@ \
@MONITOR_TRUE@monitor_btmon_SOURCES = monitor/main.c monitor/bt.h \
@MONITOR_TRUE@ monitor/display.h monitor/display.c \
-@@ -2226,7 +2226,7 @@ unit_tests = $(am__append_32) unit/test-
+@@ -2594,7 +2594,7 @@ unit_tests = $(am__append_32) unit/test-
@EXPERIMENTAL_TRUE@tools_hcieventmask_LDADD = lib/libbluetooth-internal.la
@EXPERIMENTAL_TRUE@tools_btmgmt_SOURCES = tools/btmgmt.c src/uuid-helper.c client/display.c
@EXPERIMENTAL_TRUE@tools_btmgmt_LDADD = lib/libbluetooth-internal.la src/libshared-mainloop.la \
@EXPERIMENTAL_TRUE@tools_btinfo_SOURCES = tools/btinfo.c monitor/bt.h
@EXPERIMENTAL_TRUE@tools_btinfo_LDADD = src/libshared-mainloop.la
-@@ -2266,13 +2266,13 @@ unit_tests = $(am__append_32) unit/test-
+@@ -2642,13 +2642,13 @@ unit_tests = $(am__append_32) unit/test-
@READLINE_TRUE@ client/display.h
@READLINE_TRUE@attrib_gatttool_LDADD = lib/libbluetooth-internal.la \
@READLINE_TRUE@tools_obex_server_tool_SOURCES = $(gobex_sources) $(btio_sources) \
@READLINE_TRUE@ tools/obex-server-tool.c
-@@ -2282,13 +2282,13 @@ unit_tests = $(am__append_32) unit/test-
+@@ -2658,13 +2658,13 @@ unit_tests = $(am__append_32) unit/test-
@READLINE_TRUE@ client/display.h client/display.c
@READLINE_TRUE@tools_bluetooth_player_LDADD = gdbus/libgdbus-internal.la \
#
-# Copyright (C) 2006-2014 OpenWrt.org
+# Copyright (C) 2006-2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=collectd
-PKG_VERSION:=5.4.2
+PKG_VERSION:=5.5.0
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://collectd.org/files/
-PKG_MD5SUM:=feff9fd0ed89e956d7cf12ba18cfc248
+PKG_MD5SUM:=c39305ef5514b44238b0d31f77e29e6a
PKG_FIXUP:=autoreconf
PKG_REMOVE_FILES:=aclocal.m4 libltdl/aclocal.m4
amqp \
apple_sensors \
aquaero \
+ barometer \
battery \
+ ceph \
cgroups \
cpufreq \
curl_json \
curl_xml \
dbi \
+ drbd \
entropy \
ethstat \
+ fhcount \
genericjmx \
gmond \
hddtemp \
+ ipc \
ipmi \
ipvs \
java \
- libvirt \
+ log_logstash \
+ lvm \
lpar \
mbmon \
md \
notify_email \
numa \
nut \
+ openldap \
openvz \
oracle \
perl \
rrdcached \
serial \
sigrok \
+ smart \
statsd \
swap \
tape \
tokyotyrant \
+ turbostat \
uuid \
varnish \
+ virt \
vserver \
- write_graphite \
+ write_kafka \
+ write_log \
write_mongodb \
write_redis \
write_riemann \
+ write_sensu \
+ write_tsdb \
xmms \
zfs_arc \
+ zookeeper
COLLECTD_PLUGINS_SELECTED:= \
apache \
users \
vmem \
wireless \
+ write_graphite \
write_http \
PKG_CONFIG_DEPENDS:= \
$(eval $(call BuildPlugin,users,user logged in status input,users,))
$(eval $(call BuildPlugin,vmem,virtual memory usage input,vmem,))
$(eval $(call BuildPlugin,wireless,wireless status input,wireless,))
+$(eval $(call BuildPlugin,write-graphite,Carbon/Graphite output,write_graphite,+PACKAGE_collectd-mod-write-graphite:libpthread))
$(eval $(call BuildPlugin,write-http,HTTP POST output,write_http,+PACKAGE_collectd-mod-write-http:libcurl))
--- a/src/Makefile.am
+++ b/src/Makefile.am
-@@ -4,7 +4,7 @@ SUBDIRS += liboconfig
- endif
+@@ -7,7 +7,7 @@ SUBDIRS += daemon
+ PLUGIN_LDFLAGS = -module -avoid-version -export-symbols-regex '\<module_register\>'
if COMPILER_IS_GCC
-AM_CFLAGS = -Wall -Werror
+AM_CFLAGS = -Wall
endif
- AM_CPPFLAGS = -DPREFIX='"${prefix}"'
+ AM_CPPFLAGS = -I$(srcdir)/daemon
--- a/src/libcollectdclient/Makefile.am
+++ b/src/libcollectdclient/Makefile.am
@@ -1,7 +1,7 @@
double tmp = atof (value);
--- a/src/utils_rrdcreate.c
+++ b/src/utils_rrdcreate.c
-@@ -212,6 +212,9 @@ static int rra_get (char ***ret, const v
+@@ -217,6 +217,9 @@ static int rra_get (char ***ret, const v
rts_num = rra_timespans_num;
}
if ((rra_def = (char **) malloc ((rra_max + 1) * sizeof (char *))) == NULL)
--- a/src/utils_rrdcreate.h
+++ b/src/utils_rrdcreate.h
-@@ -36,6 +36,8 @@ struct rrdcreate_config_s
+@@ -41,6 +41,8 @@ struct rrdcreate_config_s
int *timespans;
size_t timespans_num;
---- a/src/configfile.c
-+++ b/src/configfile.c
-@@ -105,7 +105,7 @@ static cf_global_option_t cf_global_opti
+--- a/src/daemon/configfile.c
++++ b/src/daemon/configfile.c
+@@ -109,7 +109,7 @@ static cf_global_option_t cf_global_opti
{"BaseDir", NULL, PKGLOCALSTATEDIR},
{"PIDFile", NULL, PIDFILE},
{"Hostname", NULL, NULL},
+++ b/version-gen.sh
@@ -2,7 +2,7 @@
- DEFAULT_VERSION="5.4.2.git"
+ DEFAULT_VERSION="5.5.0.git"
--VERSION="`git describe 2> /dev/null | sed -e 's/^collectd-//'`"
-+#VERSION="`git describe 2> /dev/null | sed -e 's/^collectd-//'`"
+-VERSION="`git describe 2> /dev/null | grep collectd | sed -e 's/^collectd-//'`"
++#VERSION="`git describe 2> /dev/null | grep collectd | sed -e 's/^collectd-//'`"
if test -z "$VERSION"; then
VERSION="$DEFAULT_VERSION"
--- a/src/olsrd.c
+++ b/src/olsrd.c
-@@ -653,7 +653,7 @@ static int olsrd_read (void) /* {{{ */
+@@ -658,7 +658,7 @@ static int olsrd_read (void) /* {{{ */
if (fh == NULL)
return (-1);
--- a/configure.ac
+++ b/configure.ac
-@@ -580,6 +580,9 @@ AC_CHECK_HEADERS(net/pfvar.h,
+@@ -589,6 +589,9 @@ AC_CHECK_HEADERS(net/pfvar.h,
have_termios_h="no"
AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"])
+# For the iwinfo plugin
+AC_CHECK_LIB(iwinfo, iwinfo_backend, [with_iwinfo="yes"], [with_iwinfo="no (libiwinfo not found)"], [])
+
- #
- # Checks for typedefs, structures, and compiler characteristics.
- #
-@@ -4841,6 +4844,7 @@ plugin_interface="no"
+ # For the turbostat plugin
+ have_asm_msrindex_h="no"
+ AC_CHECK_HEADERS(asm/msr-index.h, [have_asm_msrindex_h="yes"])
+@@ -5171,6 +5174,7 @@ plugin_interface="no"
plugin_ipmi="no"
plugin_ipvs="no"
plugin_irq="no"
+plugin_iwinfo="no"
- plugin_libvirt="no"
plugin_load="no"
+ plugin_log_logstash="no"
plugin_memory="no"
-@@ -5179,6 +5183,7 @@ AC_PLUGIN([ipmi], [$plugin_ipmi],
+@@ -5562,6 +5566,7 @@ AC_PLUGIN([ipmi], [$plugin_ipmi],
AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics])
AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
+AC_PLUGIN([iwinfo], [$with_iwinfo], [Common iwinfo wireless statistics])
AC_PLUGIN([java], [$with_java], [Embed the Java Virtual Machine])
- AC_PLUGIN([libvirt], [$plugin_libvirt], [Virtual machine statistics])
AC_PLUGIN([load], [$plugin_load], [System load])
-@@ -5480,6 +5485,7 @@ Configuration:
- protobuf-c . . . . . $have_protoc_c
+ AC_PLUGIN([logfile], [yes], [File logging plugin])
+@@ -5891,6 +5896,7 @@ Configuration:
oracle . . . . . . . $with_oracle
+ protobuf-c . . . . . $have_protoc_c
python . . . . . . . $with_python
+ iwinfo . . . . . . . $with_iwinfo
Features:
daemon mode . . . . . $enable_daemon
-@@ -5524,6 +5530,7 @@ Configuration:
+@@ -5940,6 +5946,7 @@ Configuration:
iptables . . . . . . $enable_iptables
ipvs . . . . . . . . $enable_ipvs
irq . . . . . . . . . $enable_irq
+ iwinfo . . . . . . . $enable_iwinfo
java . . . . . . . . $enable_java
- libvirt . . . . . . . $enable_libvirt
load . . . . . . . . $enable_load
+ logfile . . . . . . . $enable_logfile
--- a/src/collectd.conf.in
+++ b/src/collectd.conf.in
-@@ -109,6 +109,7 @@
+@@ -128,6 +128,7 @@
#@BUILD_PLUGIN_IPMI_TRUE@LoadPlugin ipmi
#@BUILD_PLUGIN_IPVS_TRUE@LoadPlugin ipvs
#@BUILD_PLUGIN_IRQ_TRUE@LoadPlugin irq
+#@BUILD_PLUGIN_IWINFO_TRUE@LoadPlugin iwinfo
#@BUILD_PLUGIN_JAVA_TRUE@LoadPlugin java
- #@BUILD_PLUGIN_LIBVIRT_TRUE@LoadPlugin libvirt
@BUILD_PLUGIN_LOAD_TRUE@@BUILD_PLUGIN_LOAD_TRUE@LoadPlugin load
-@@ -502,6 +503,12 @@
+ #@BUILD_PLUGIN_LPAR_TRUE@LoadPlugin lpar
+@@ -582,6 +583,12 @@
# IgnoreSelected true
#</Plugin>
+# Interface "wlan0"
+#</Plugin>
+
- #<Plugin "java">
+ #<Plugin java>
# JVMArg "-verbose:jni"
# JVMArg "-Djava.class.path=@prefix@/share/collectd/java/collectd-api.jar"
--- a/src/collectd.conf.pod
+++ b/src/collectd.conf.pod
-@@ -2077,6 +2077,27 @@ and all other interrupts are collected.
+@@ -2572,6 +2572,27 @@ and all other interrupts are collected.
=back
+}
--- a/src/Makefile.am
+++ b/src/Makefile.am
-@@ -530,6 +530,15 @@ collectd_LDADD += "-dlopen" irq.la
- collectd_DEPENDENCIES += irq.la
+@@ -459,6 +459,13 @@ irq_la_SOURCES = irq.c \
+ irq_la_LDFLAGS = $(PLUGIN_LDFLAGS)
endif
+if BUILD_PLUGIN_IWINFO
+pkglib_LTLIBRARIES += iwinfo.la
-+iwinfo_la_SOURCES = iwinfo.c
++iwinfo_la_SOURCES = iwinfo.c utils_ignorelist.c utils_ignorelist.h
+iwinfo_la_LDFLAGS = -module -avoid-version
+iwinfo_la_LIBADD = -liwinfo
-+collectd_LDADD += "-dlopen" iwinfo.la
-+collectd_DEPENDENCIES += iwinfo.la
+endif
+
if BUILD_PLUGIN_JAVA
java_la_SOURCES = java.c
--- a/src/types.db
+++ b/src/types.db
-@@ -195,7 +195,7 @@ voltage value:GAUGE:U:U
+@@ -227,6 +227,7 @@ voltage value:GAUGE:U:U
vs_memory value:GAUGE:0:9223372036854775807
vs_processes value:GAUGE:0:65535
vs_threads value:GAUGE:0:65535
--
+stations value:GAUGE:0:256
+
#
# Legacy types
- # (required for the v5 upgrade target)
--- a/src/ping.c
+++ b/src/ping.c
-@@ -651,7 +651,7 @@ static int ping_read (void) /* {{{ */
+@@ -656,7 +656,7 @@ static int ping_read (void) /* {{{ */
/ ((double) (pkg_recv * (pkg_recv - 1))));
/* Calculate drop rate. */
include $(TOPDIR)/rules.mk
PKG_NAME:=gammu
-PKG_VERSION:=1.36.2
-PKG_RELEASE:=3
+PKG_VERSION:=1.36.3
+PKG_RELEASE:=1
PKG_SOURCE_URL:=http://dl.cihar.com/gammu/releases/
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_MD5SUM:=60702f67a756b058706995824f40016a
+PKG_MD5SUM:=d5a6914996ebedcd6cac6622f2e4018b
PKG_MAINTAINER:=Vitaly Protsko <villy@sft.ru>
PKG_LICENCE:=GPL-2.0
include $(TOPDIR)/rules.mk
PKG_NAME:=i2c-tools
-PKG_VERSION:=3.1.1
+PKG_VERSION:=3.1.2
PKG_RELEASE:=1
-PKG_SOURCE_URL:=http://dl.lm-sensors.org/i2c-tools/releases/ \
- http://web.archive.org/web/20150326044243/http://dl.lm-sensors.org/i2c-tools/releases/
+PKG_SOURCE_URL:=http://dl.lm-sensors.org/i2c-tools/releases/
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_MD5SUM:=0fdbff53ebd0b8d9249256d6c56480b1
+PKG_MD5SUM:=7104a1043d11a5e2c7b131614eb1b962
PKG_BUILD_PARALLEL:=1
PKG_BUILD_DEPENDS:=PACKAGE_python-smbus:python
--- /dev/null
+if PACKAGE_lcd4linux-custom
+
+config LCD4LINUX_CUSTOM_NEEDS_libdbus
+ 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_libX11
+# bool
+
+config LCD4LINUX_CUSTOM_NEEDS_ppp
+ bool
+
+config LCD4LINUX_CUSTOM_NEEDS_python
+ 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_libusb
+ select LCD4LINUX_CUSTOM_NEEDS_libgd
+
+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
--- /dev/null
+#
+# Copyright (C) 2007-2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lcd4linux
+PKG_REV:=1203
+PKG_VERSION:=r$(PKG_REV)
+PKG_RELEASE:=2
+
+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) \
+ 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 \
+ ppp \
+# 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
+ PKG_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_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_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 \
+ +libgd \
+ $(if $(ICONV_FULL),+libiconv-full) \
+ +libmpdclient \
+ +libmysqlclient \
+ +libncurses \
+ +libsqlite3 \
+ +libusb-compat \
+# +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))
--- /dev/null
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2007-2015 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
+}
+
--- /dev/null
+--- 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"
--- /dev/null
+--- 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), "/?");
--- /dev/null
+--- 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@
+
--- /dev/null
+--- 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;
--- /dev/null
+--- /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
--- /dev/null
+--- 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);
+
--- /dev/null
+--- 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"
+@@ -936,6 +937,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.ac
++++ b/configure.ac
+@@ -115,6 +115,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)
+
--- /dev/null
+--- 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);
--- /dev/null
+--- 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
+ ;;
+@@ -797,6 +801,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
+@@ -581,6 +581,11 @@ Display FutabaVFD {
+ }
+ }
+
++Display TEW673GRU {
++ Driver 'TEW673GRU'
++ Font '6x8'
++ Port '/dev/spidev1.0'
++}
+
+ #Plugin KVV {
+ # StationID '12_701'
include $(TOPDIR)/rules.mk
PKG_NAME:=LVM2
-PKG_VERSION:=2.02.124
+PKG_VERSION:=2.02.126
PKG_RELEASE:=1
PKG_LICENSE:=GPL-2.0 LGPL-2.1
PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).tgz
PKG_SOURCE_URL:=ftp://sources.redhat.com/pub/lvm2
-PKG_MD5SUM:=da8d81a6a2ea235025795d9e001a6ae3
+PKG_MD5SUM:=38cd1953b62bd256c9e924adee01e995
PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME).$(PKG_VERSION)
--- a/lib/commands/toolcontext.c
+++ b/lib/commands/toolcontext.c
-@@ -1690,8 +1690,10 @@ struct cmd_context *create_toolcontext(u
+@@ -1686,8 +1686,10 @@ struct cmd_context *create_toolcontext(u
unsigned threaded)
{
struct cmd_context *cmd;
#ifdef M_MMAP_MAX
mallopt(M_MMAP_MAX, 0);
-@@ -1727,7 +1729,7 @@ struct cmd_context *create_toolcontext(u
+@@ -1723,7 +1725,7 @@ struct cmd_context *create_toolcontext(u
/* FIXME Make this configurable? */
reset_lvm_errno(1);
/* Set in/out stream buffering before glibc */
if (set_buffering) {
/* Allocate 2 buffers */
-@@ -2100,7 +2102,7 @@ void destroy_toolcontext(struct cmd_cont
+@@ -2096,7 +2098,7 @@ void destroy_toolcontext(struct cmd_cont
if (cmd->libmem)
dm_pool_destroy(cmd->libmem);
if (is_valid_fd(STDIN_FILENO) &&
--- a/tools/lvmcmdline.c
+++ b/tools/lvmcmdline.c
-@@ -1688,6 +1688,7 @@ int lvm_split(char *str, int *argc, char
+@@ -1722,6 +1722,7 @@ int lvm_split(char *str, int *argc, char
/* Make sure we have always valid filedescriptors 0,1,2 */
static int _check_standard_fds(void)
{
int err = is_valid_fd(STDERR_FILENO);
if (!is_valid_fd(STDIN_FILENO) &&
-@@ -1714,6 +1715,12 @@ static int _check_standard_fds(void)
+@@ -1748,6 +1749,12 @@ static int _check_standard_fds(void)
strerror(errno));
return 0;
}
include $(TOPDIR)/rules.mk
PKG_NAME:=nano
-PKG_VERSION:=2.4.1
+PKG_VERSION:=2.4.2
PKG_RELEASE:=1
PKG_LICENSE:=GPL-3.0+
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.nano-editor.org/dist/v2.4
-PKG_MD5SUM:=1c612b478f976abf8ef926480c7a3684
+PKG_MD5SUM:=ce6968992fec4283c17984b53554168b
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
--- /dev/null
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=rtl-ais
+PKG_VERSION:=20150713
+
+PKG_RELEASE=$(PKG_SOURCE_VERSION)
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/dgiardini/rtl-ais.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=d1084f6514cb161266f5bc5c6662070ad7c87560
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+
+PKG_LICENSE:=GPL-2.0+
+PKG_LICENSE_FILES:=COPYING
+
+PKG_MAINTAINER:=Nuno Goncalves <nunojpg@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/rtl-ais
+ SECTION:=utils
+ CATEGORY:=Utilities
+ TITLE:=rtl-sdr AIS dual channel tuner
+ DEPENDS:=+libpthread +librtlsdr
+ URL:=https://github.com/dgiardini/rtl-ais
+endef
+
+define Package/rtl-ais/description
+ rtl_ais uses a rtl2832u dvb-t dongle to tune AIS (Automatic Identification
+ System) used on ships and by vessel traffic services
+endef
+
+
+define Package/rtl-ais/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/rtl_ais $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,rtl-ais))
#
-# Copyright (C) 2013 OpenWrt.org
+# Copyright (C) 2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=rtl-sdr
-PKG_VERSION:=2014-02-10
-PKG_RELEASE:=$(PKG_SOURCE_VERSION)
+PKG_VERSION:=0.5.3-20150608-$(PKG_SOURCE_VERSION)
+PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=git://git.osmocom.org/rtl-sdr.git
+PKG_SOURCE_VERSION:=e3c03f738f5aef4dc51e2b741fbdb542b9cc1bb1
+
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=6ee557360645da158e3065111349c318894b497b
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
+PKG_BUILD_PARALLEL:=1
+
CMAKE_INSTALL:=1
PKG_LICENSE:=GPLv2
PKG_NAME:=tcsh
PKG_VERSION:=6.19.00
-PKG_RELEASE:=3
+PKG_RELEASE:=4
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:= \
--- /dev/null
+--- a/config_f.h
++++ b/config_f.h
+@@ -135,11 +135,7 @@
+ * This can be much slower and no memory statistics will be
+ * provided.
+ */
+-#if defined(__MACHTEN__) || defined(PURIFY) || defined(MALLOC_TRACE) || defined(_OSD_POSIX) || defined(__MVS__) || defined (__CYGWIN__) || defined(__GLIBC__) || defined(__OpenBSD__) || defined(__APPLE__)
+ # define SYSMALLOC
+-#else
+-# undef SYSMALLOC
+-#endif
+
+ /*
+ * USE_ACCESS Use access(2) rather than stat(2) when POSIX is defined.
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=@SF/tmux
+PKG_SOURCE_URL:=https://github.com/tmux/tmux/releases/download/$(PKG_VERSION)
PKG_MD5SUM:=9fb6b443392c3978da5d599f1e814eaa
PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
include $(TOPDIR)/rules.mk
PKG_NAME:=unrar
-PKG_VERSION:=5.2.7
+PKG_VERSION:=5.3.1
PKG_RELEASE:=1
PKG_SOURCE:=unrarsrc-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.rarlab.com/rar
-PKG_MD5SUM:=0c145e1ac47d428553123462c0740279
+PKG_MD5SUM:=c0471d0f5513fb3f8e3f019538a0fb7a
PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
PKG_LICENSE:=UnRAR