PKG_NAME:=ipmitool
PKG_VERSION:=1.8.18
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@SF/$(PKG_NAME)
CATEGORY:=Administration
DEPENDS:=+libopenssl +libncurses +libreadline
TITLE:=Command-line interface to IPMI-enabled devices
- URL:=http://sourceforge.net/projects/ipmitool/
+ URL:=https://github.com/ipmitool/ipmitool
MAINTAINER:=Alexander Couzens <lynxis@fe80.eu>
endef
--- /dev/null
+From cf39da53236abf02d39c6a98a645488933f3e861 Mon Sep 17 00:00:00 2001
+From: Rosen Penev <rosenp@gmail.com>
+Date: Tue, 21 Aug 2018 19:29:07 -0700
+Subject: [PATCH] ipmitool: Fix compile with deprecated APIs disabled.
+
+From the man page:
+
+EVP_CIPHER_CTX was made opaque in OpenSSL 1.1.0. As a result,
+EVP_CIPHER_CTX_reset() appeared and EVP_CIPHER_CTX_cleanup() disappeared.
+EVP_CIPHER_CTX_init() remains as an alias for EVP_CIPHER_CTX_reset().
+
+Signed-off-by: Rosen Penev <rosenp@gmail.com>
+---
+ src/plugins/lanplus/lanplus_crypt_impl.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/src/plugins/lanplus/lanplus_crypt_impl.c b/src/plugins/lanplus/lanplus_crypt_impl.c
+index 9652a5e..e94401e 100644
+--- a/src/plugins/lanplus/lanplus_crypt_impl.c
++++ b/src/plugins/lanplus/lanplus_crypt_impl.c
+@@ -183,7 +183,11 @@ lanplus_encrypt_aes_cbc_128(const uint8_t * iv,
+ lprintf(LOG_DEBUG, "ERROR: EVP_CIPHER_CTX_new() failed");
+ return;
+ }
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ EVP_CIPHER_CTX_init(ctx);
++#else
++ EVP_CIPHER_CTX_reset(ctx);
++#endif
+ EVP_EncryptInit_ex(ctx, EVP_aes_128_cbc(), NULL, key, iv);
+ EVP_CIPHER_CTX_set_padding(ctx, 0);
+
+@@ -262,7 +266,11 @@ lanplus_decrypt_aes_cbc_128(const uint8_t * iv,
+ lprintf(LOG_DEBUG, "ERROR: EVP_CIPHER_CTX_new() failed");
+ return;
+ }
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ EVP_CIPHER_CTX_init(ctx);
++#else
++ EVP_CIPHER_CTX_reset(ctx);
++#endif
+ EVP_DecryptInit_ex(ctx, EVP_aes_128_cbc(), NULL, key, iv);
+ EVP_CIPHER_CTX_set_padding(ctx, 0);
+
+--
+2.7.4
+
include $(TOPDIR)/rules.mk
PKG_NAME:=netdata
-PKG_VERSION:=1.10.0
-PKG_RELEASE:=2
+PKG_VERSION:=1.11.0
+PKG_RELEASE:=1
PKG_MAINTAINER:=
PKG_LICENSE:=GPL-3.0
PKG_LICENSE_FILES:=COPYING
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_SOURCE_URL:=https://github.com/firehol/netdata/releases/download/v$(PKG_VERSION)
-PKG_HASH:=0514fc002c5c5fb730156b3fe928965b22327833c6c17e22b7097eda657e77a2
+PKG_SOURCE:=$(PKG_NAME)-v$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/netdata/netdata/releases/download/v$(PKG_VERSION)
+PKG_HASH:=c42c8411c22c72e3e52fed38d7b9537bcfaf568d01e9c1e35ec645490627619d
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)_rolling
PKG_INSTALL:=1
PKG_FIXUP:=autoreconf
+PKG_USE_MIPS16:=0
include $(INCLUDE_DIR)/package.mk
define Package/netdata/description
netdata is a highly optimized Linux daemon providing real-time performance
monitoring for Linux systems, applications and SNMP devices over the web.
+
+ If you want to use Python plugins install python3, python3-yaml and
+ python3-urllib3 however urllib3 isn't packaged yet (needs a PR on GitHub)
endef
TARGET_CFLAGS := $(filter-out -O%,$(TARGET_CFLAGS))
TARGET_CFLAGS += -ffunction-sections -fdata-sections -O3
TARGET_LDFLAGS += -Wl,--gc-sections
-CONFIGURE_ARGS += --with-zlib --with-math --disable-x86-sse --disable-lto
+CONFIGURE_ARGS += \
+ --with-zlib \
+ --with-math \
+ --disable-x86-sse \
+ --enable-lto \
+ --without-libcap \
+ --disable-plugin-nfacct
define Package/netdata/conffiles
/etc/netdata/
endef
define Package/netdata/install
- mkdir -p $(1)/etc/netdata
+ $(INSTALL_DIR) $(1)/etc/netdata/custom-plugins.d
$(CP) $(PKG_INSTALL_DIR)/etc/netdata $(1)/etc
$(CP) ./files/netdata.conf $(1)/etc/netdata
- mkdir -p $(1)/etc/netdata/custom-plugins.d
-
- mkdir -p $(1)/usr/share/netdata
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/netdata $(1)/usr/lib
+ $(CP) $(1)/usr/lib/netdata/conf.d/fping.conf $(1)/etc
+ $(CP) $(1)/usr/lib/netdata/conf.d/health_alarm_notify.conf $(1)/etc
+ rm -rf $(1)/usr/lib/netdata/python.d/python_modules/pyyaml2
+ rm -rf $(1)/usr/lib/netdata/python.d/python_modules/pyyaml3
+ rm -rf $(1)/usr/lib/netdata/python.d/python_modules/urllib3
+ $(CP) $(1)/usr/lib/netdata/plugins.d/tc-qos-helper.sh $(1)/etc
+ $(INSTALL_DIR) $(1)/usr/sbin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/netdata $(1)/usr/sbin
+ $(INSTALL_DIR) $(1)/usr/share/netdata
$(CP) $(PKG_INSTALL_DIR)/usr/share/netdata $(1)/usr/share
rm -rf $(1)/usr/share/netdata/web/images
rm -rf $(1)/usr/share/netdata/web/old
rm $(1)/usr/share/netdata/web/fonts/*.svg
rm $(1)/usr/share/netdata/web/fonts/*.ttf
rm $(1)/usr/share/netdata/web/fonts/*.woff
-
- mkdir -p $(1)/usr/lib/netdata
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/netdata $(1)/usr/lib
- rm $(1)/usr/lib/netdata/python.d/python-modules-installer.sh
- chmod 4755 $(1)/usr/lib/netdata/plugins.d/apps.plugin
-
- mkdir -p $(1)/etc/init.d
+ $(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/netdata.init $(1)/etc/init.d/netdata
-
- mkdir -p $(1)/usr/sbin
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/netdata $(1)/usr/sbin
endef
$(eval $(call BuildPackage,netdata))
--- /dev/null
+diff --git a/collectors/charts.d.plugin/charts.d.conf b/collectors/charts.d.plugin/charts.d.conf
+index acb2a6f..8111859 100644
+--- a/collectors/charts.d.plugin/charts.d.conf
++++ b/collectors/charts.d.plugin/charts.d.conf
+@@ -30,7 +30,7 @@
+
+ # the default enable/disable for all charts.d collectors
+ # the default is "yes"
+-# enable_all_charts="yes"
++enable_all_charts="no"
+
+ # BY DEFAULT ENABLED MODULES
+ # ap=yes
+diff --git a/collectors/python.d.plugin/python.d.conf b/collectors/python.d.plugin/python.d.conf
+index 97f4cb8..001a3f1 100644
+--- a/collectors/python.d.plugin/python.d.conf
++++ b/collectors/python.d.plugin/python.d.conf
+@@ -7,7 +7,7 @@
+ #
+
+ # Enable / disable the whole python.d.plugin (all its modules)
+-enabled: yes
++enabled: no
+
+ # ----------------------------------------------------------------------
+ # Enable / Disable python.d.plugin modules
+++ /dev/null
---- a/conf.d/charts.d.conf
-+++ b/conf.d/charts.d.conf
-@@ -30,7 +30,7 @@
-
- # the default enable/disable for all charts.d collectors
- # the default is "yes"
--# enable_all_charts="yes"
-+enable_all_charts="no"
-
- # BY DEFAULT ENABLED MODULES
- # ap=yes
---- a/conf.d/python.d.conf
-+++ b/conf.d/python.d.conf
-@@ -7,7 +7,7 @@
- #
-
- # Enable / disable the whole python.d.plugin (all its modules)
--enabled: yes
-+enabled: no
-
- # Prevent log flood
- # Define how many log messages can be written to log file in one log_interval
--- /dev/null
+diff --git a/collectors/python.d.plugin/python.d.plugin.in b/collectors/python.d.plugin/python.d.plugin.in
+index 7ac03fd..d0a3f19 100755
+--- a/collectors/python.d.plugin/python.d.plugin.in
++++ b/collectors/python.d.plugin/python.d.plugin.in
+@@ -1,6 +1,4 @@
+-#!/usr/bin/env bash
+-'''':; exec "$(command -v python || command -v python3 || command -v python2 ||
+-echo "ERROR python IS NOT AVAILABLE IN THIS SYSTEM")" "$0" "$@" # '''
++#!/usr/bin/python3
+
+ # -*- coding: utf-8 -*-
+ # Description:
include $(TOPDIR)/rules.mk
PKG_NAME:=automake
-PKG_VERSION:=1.15
-PKG_RELEASE:=4
+PKG_VERSION:=1.15.1
+PKG_RELEASE:=1
PKG_SOURCE_URL:=@GNU/automake
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_HASH:=9908c75aabd49d13661d6dcb1bc382252d22cc77bf733a2d55e87f2aa2db8636
+PKG_HASH:=af6ba39142220687c500f79b4aa2f181d9b24e4f8d8ec497cea4ba26c64bedaf
PKG_MAINTAINER:=Heinrich Schuchardt <xypron.glpk@gmx.de>
PKG_LICENSE:=GPL-3.0+
FIX_PATHS = $(SED) '1c \#!/usr/bin/perl' -e 's| /[^ ]*/bin/perl| /usr/bin/perl|g'
+AM_VERSION:=$(word 1,$(subst ., ,$(PKG_VERSION))).$(word 2,$(subst ., ,$(PKG_VERSION)))
+
define Package/automake/install
$(INSTALL_DIR) $(1)/usr/bin
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/automake-$(PKG_VERSION) \
- $(1)/usr/bin/automake-$(PKG_VERSION)
- $(LN) automake-$(PKG_VERSION) $(1)/usr/bin/automake
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/aclocal-$(PKG_VERSION) \
- $(1)/usr/bin/aclocal-$(PKG_VERSION)
- $(LN) aclocal-$(PKG_VERSION) $(1)/usr/bin/aclocal
- $(FIX_PATHS) $(1)/usr/bin/automake-$(PKG_VERSION)
- $(FIX_PATHS) $(1)/usr/bin/aclocal-$(PKG_VERSION)
- $(INSTALL_DIR) $(1)/usr/share/automake-$(PKG_VERSION)
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/automake-$(AM_VERSION) \
+ $(1)/usr/bin/automake-$(AM_VERSION)
+ $(LN) automake-$(AM_VERSION) $(1)/usr/bin/automake
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/aclocal-$(AM_VERSION) \
+ $(1)/usr/bin/aclocal-$(AM_VERSION)
+ $(LN) aclocal-$(AM_VERSION) $(1)/usr/bin/aclocal
+ $(FIX_PATHS) $(1)/usr/bin/automake-$(AM_VERSION)
+ $(FIX_PATHS) $(1)/usr/bin/aclocal-$(AM_VERSION)
+ $(INSTALL_DIR) $(1)/usr/share/automake-$(AM_VERSION)
for dir in \
- automake-$(PKG_VERSION) automake-$(PKG_VERSION)/Automake \
- automake-$(PKG_VERSION)/am aclocal \
- aclocal-$(PKG_VERSION) aclocal-$(PKG_VERSION)/internal \
+ automake-$(AM_VERSION) automake-$(AM_VERSION)/Automake \
+ automake-$(AM_VERSION)/am aclocal \
+ aclocal-$(AM_VERSION) aclocal-$(AM_VERSION)/internal \
; do \
$(INSTALL_DIR) $(1)/usr/share/$$$$dir; \
for file in $$$$(cd $(PKG_INSTALL_DIR) && \
include $(TOPDIR)/rules.mk
PKG_NAME:=python-ldap
-PKG_VERSION:=2.4.32
+PKG_VERSION:=3.1.0
PKG_RELEASE:=1
PKG_MAINTAINER:=Dmitry Trefilov <the-alien@live.ru>
PKG_LICENSE:=Python-style
PKG_LICENSE_FILES:=LICENSE
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/67/d9/fa0ea70d1792875745116ad62ac8d4bcb07550b15cded591bb57df6a6d9a
-PKG_HASH:=5810f1b5a9ae9255df99fb9c2dcab7352fed325687efda56c0faae1a82c5e3cb
+PKG_SOURCE_URL:=https://files.pythonhosted.org/packages/source/p/python-ldap
+PKG_HASH:=41975e79406502c092732c57ef0c2c2eb318d91e8e765f81f5d4ab6c1db727c5
include $(INCLUDE_DIR)/package.mk
include ../python-package.mk
CATEGORY:=Languages
DEPENDS:=+libopenldap +python
TITLE:=Python modules for implementing LDAP clients
- URL:=http://python-ldap.org/
+ URL:=https://python-ldap.org/
endef
define Package/python-ldap/description
+++ /dev/null
-From: Dmitrij Trefilov <the-alien@live.ru>
-
-Subject: [PATCH] lang: removed hardcoded include and library directories from setup.cfg
-Signed-off-by: Dmitrij Trefilov <the-alien@live.ru>
----
---- a/setup.cfg
-+++ b/setup.cfg
-@@ -1,6 +1,6 @@
- [_ldap]
--library_dirs = /usr/lib /usr/lib64 /usr/local/lib /usr/local/lib64
--include_dirs = /usr/include /usr/include/sasl /usr/local/include /usr/local/include/sasl
-+library_dirs =
-+include_dirs =
- defines = HAVE_SASL HAVE_TLS HAVE_LIBLDAP_R
- extra_compile_args =
- extra_objects =
PKG_NAME:=cyrus-sasl
PKG_VERSION_BASE:=2.1.27
PKG_VERSION:=$(PKG_VERSION_BASE)-rc8
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
--- /dev/null
+From d2a7592b9884049d3da384c5c37f77629ce9ac56 Mon Sep 17 00:00:00 2001
+From: Rosen Penev <rosenp@gmail.com>
+Date: Tue, 6 Nov 2018 18:58:30 -0800
+Subject: [PATCH] openssl: Fix compilation without deprecated APIs
+
+bn.h was missing. Including engine.h does not work if OpenSSL was built
+without it. cyrus-sasl makes no use of it anyway.
+---
+ common/crypto-compat.c | 1 -
+ common/crypto-compat.h | 1 +
+ 2 files changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/common/crypto-compat.c b/common/crypto-compat.c
+index f4717b6..8195879 100644
+--- a/common/crypto-compat.c
++++ b/common/crypto-compat.c
+@@ -12,7 +12,6 @@
+ #if defined(HAVE_OPENSSL) && (OPENSSL_VERSION_NUMBER < 0x10100000L)
+
+ #include <string.h>
+-#include <openssl/engine.h>
+
+ static void *OPENSSL_zalloc(size_t num)
+ {
+diff --git a/common/crypto-compat.h b/common/crypto-compat.h
+index 73424ad..d3ffdca 100644
+--- a/common/crypto-compat.h
++++ b/common/crypto-compat.h
+@@ -15,6 +15,7 @@
+ #include <openssl/dh.h>
+ #include <openssl/evp.h>
+ #include <openssl/hmac.h>
++#include <openssl/bn.h>
+
+ int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d);
+ int RSA_set0_factors(RSA *r, BIGNUM *p, BIGNUM *q);
+--
+2.19.1
+
include $(TOPDIR)/rules.mk
PKG_NAME:=file
-PKG_VERSION:=5.34
+PKG_VERSION:=5.35
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pkgs.fedoraproject.org/lookaside/pkgs/file/ \
+PKG_SOURCE_URL:=https://src.fedoraproject.org/lookaside/pkgs/file/ \
http://download.openpkg.org/components/cache/file/ \
ftp://ftp.astron.com/pub/file/
-PKG_HASH:=f15a50dbbfa83fec0bd1161e8e191b092ec832720e30cd14536e044ac623b20a
+PKG_HASH:=30c45e817440779be7aac523a905b123cba2a6ed0bf4f5439e1e99ba940b5546
PKG_LICENSE:=BSD-2c
PKG_LICENSE_FILES:=COPYING
include $(TOPDIR)/rules.mk
PKG_NAME:=libaio
-PKG_VERSION:=0.3.110
+PKG_VERSION:=0.3.111
PKG_RELEASE:=1
-PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz
-PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/liba/libaio/
-PKG_HASH:=e019028e631725729376250e32b473012f7cb68e1f7275bfc1bbcdd0f8745f7e
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://releases.pagure.org/libaio
+PKG_HASH:=62cf871ad8fd09eb3418f00aca7a7d449299b8e1de31c65f28bf6a2ef1fa502a
PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
PKG_LICENSE:=LGPL-2.1
+PKG_ASLR_PIE:=1
+PKG_BUILD_PARALLEL:=1
+
PKG_USE_MIPS16:=0
include $(INCLUDE_DIR)/package.mk
LIBAIO_CFLAGS:=-nostdlib -nostartfiles -I. $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(FPIC)
-TARGET_CFLAGS += $(FPIC)
-
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR) \
$(TARGET_CONFIGURE_OPTS) \
+Description: Add/fix support for m68k, mips, paris, sparc
+Author: Guillem Jover <guillem@debian.org>
+Origin: vendor
+Forwarded: no
+Last-Update: 2014-10-09
+
+
---
- harness/main.c | 10 ++
+ harness/main.c | 10 +++++++++
src/libaio.h | 1
- src/syscall-m68k.h | 78 +++++++++++++++++
- src/syscall-mips.h | 223 +++++++++++++++++++++++++++++++++++++++++++++++++++
- src/syscall-parisc.h | 146 +++++++++++++++++++++++++++++++++
- src/syscall-sparc.h | 20 +++-
- src/syscall.h | 6 +
- 7 files changed, 479 insertions(+), 5 deletions(-)
+ src/syscall-m68k.h | 5 ++++
+ src/syscall-mips.h | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++
+ src/syscall-parisc.h | 6 +++++
+ src/syscall.h | 6 +++++
+ 6 files changed, 82 insertions(+)
--- /dev/null
+++ b/src/syscall-m68k.h
-@@ -0,0 +1,78 @@
+@@ -0,0 +1,5 @@
+#define __NR_io_setup 241
+#define __NR_io_destroy 242
+#define __NR_io_getevents 243
+#define __NR_io_submit 244
+#define __NR_io_cancel 245
-+
-+#define io_syscall1(type,fname,sname,atype,a) \
-+type fname(atype a) \
-+{ \
-+register long __res __asm__ ("%d0") = __NR_##sname; \
-+register long __a __asm__ ("%d1") = (long)(a); \
-+__asm__ __volatile__ ("trap #0" \
-+ : "+d" (__res) \
-+ : "d" (__a) ); \
-+return (type) __res; \
-+}
-+
-+#define io_syscall2(type,fname,sname,atype,a,btype,b) \
-+type fname(atype a,btype b) \
-+{ \
-+register long __res __asm__ ("%d0") = __NR_##sname; \
-+register long __a __asm__ ("%d1") = (long)(a); \
-+register long __b __asm__ ("%d2") = (long)(b); \
-+__asm__ __volatile__ ("trap #0" \
-+ : "+d" (__res) \
-+ : "d" (__a), "d" (__b) \
-+ ); \
-+return (type) __res; \
-+}
-+
-+#define io_syscall3(type,fname,sname,atype,a,btype,b,ctype,c) \
-+type fname(atype a,btype b,ctype c) \
-+{ \
-+register long __res __asm__ ("%d0") = __NR_##sname; \
-+register long __a __asm__ ("%d1") = (long)(a); \
-+register long __b __asm__ ("%d2") = (long)(b); \
-+register long __c __asm__ ("%d3") = (long)(c); \
-+__asm__ __volatile__ ("trap #0" \
-+ : "+d" (__res) \
-+ : "d" (__a), "d" (__b), \
-+ "d" (__c) \
-+ ); \
-+return (type) __res; \
-+}
-+
-+#define io_syscall4(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d) \
-+type fname (atype a, btype b, ctype c, dtype d) \
-+{ \
-+register long __res __asm__ ("%d0") = __NR_##sname; \
-+register long __a __asm__ ("%d1") = (long)(a); \
-+register long __b __asm__ ("%d2") = (long)(b); \
-+register long __c __asm__ ("%d3") = (long)(c); \
-+register long __d __asm__ ("%d4") = (long)(d); \
-+__asm__ __volatile__ ("trap #0" \
-+ : "+d" (__res) \
-+ : "d" (__a), "d" (__b), \
-+ "d" (__c), "d" (__d) \
-+ ); \
-+return (type) __res; \
-+}
-+
-+#define io_syscall5(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d,etype,e) \
-+type fname (atype a,btype b,ctype c,dtype d,etype e) \
-+{ \
-+register long __res __asm__ ("%d0") = __NR_##sname; \
-+register long __a __asm__ ("%d1") = (long)(a); \
-+register long __b __asm__ ("%d2") = (long)(b); \
-+register long __c __asm__ ("%d3") = (long)(c); \
-+register long __d __asm__ ("%d4") = (long)(d); \
-+register long __e __asm__ ("%d5") = (long)(e); \
-+__asm__ __volatile__ ("trap #0" \
-+ : "+d" (__res) \
-+ : "d" (__a), "d" (__b), \
-+ "d" (__c), "d" (__d), "d" (__e) \
-+ ); \
-+return (type) __res; \
-+}
-+
--- a/src/syscall.h
+++ b/src/syscall.h
-@@ -28,6 +28,12 @@
+@@ -27,6 +27,12 @@
+ #include "syscall-arm.h"
+ #elif defined(__sparc__)
#include "syscall-sparc.h"
- #elif defined(__aarch64__)
- #include "syscall-arm64.h"
+#elif defined(__m68k__)
+#include "syscall-m68k.h"
+#elif defined(__hppa__)
+#include "syscall-parisc.h"
+#elif defined(__mips__)
+#include "syscall-mips.h"
- #else
- #warning "using generic syscall method"
+ #elif defined(__aarch64__) || defined(__riscv)
#include "syscall-generic.h"
+ #else
--- /dev/null
+++ b/src/syscall-mips.h
-@@ -0,0 +1,223 @@
+@@ -0,0 +1,54 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ *
+ * Copyright (C) 1995, 96, 97, 98, 99, 2000 by Ralf Baechle
+ * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
-+ *
-+ * Changed system calls macros _syscall5 - _syscall7 to push args 5 to 7 onto
-+ * the stack. Robin Farine for ACN S.A, Copyright (C) 1996 by ACN S.A
+ */
+
+#ifndef _MIPS_SIM_ABI32
+#define __NR_io_submit (__NR_Linux + 203)
+#define __NR_io_cancel (__NR_Linux + 204)
+#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
-+
-+#define io_syscall1(type,fname,sname,atype,a) \
-+type fname(atype a) \
-+{ \
-+ register unsigned long __a0 asm("$4") = (unsigned long) a; \
-+ register unsigned long __a3 asm("$7"); \
-+ unsigned long __v0; \
-+ \
-+ __asm__ volatile ( \
-+ ".set\tnoreorder\n\t" \
-+ "li\t$2, %3\t\t\t# " #fname "\n\t" \
-+ "syscall\n\t" \
-+ "move\t%0, $2\n\t" \
-+ ".set\treorder" \
-+ : "=&r" (__v0), "=r" (__a3) \
-+ : "r" (__a0), "i" (__NR_##sname) \
-+ : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
-+ "memory"); \
-+ \
-+ if (__a3 == 0) \
-+ return (type) __v0; \
-+ return (type) -1; \
-+}
-+
-+#define io_syscall2(type,fname,sname,atype,a,btype,b) \
-+type fname(atype a, btype b) \
-+{ \
-+ register unsigned long __a0 asm("$4") = (unsigned long) a; \
-+ register unsigned long __a1 asm("$5") = (unsigned long) b; \
-+ register unsigned long __a3 asm("$7"); \
-+ unsigned long __v0; \
-+ \
-+ __asm__ volatile ( \
-+ ".set\tnoreorder\n\t" \
-+ "li\t$2, %4\t\t\t# " #fname "\n\t" \
-+ "syscall\n\t" \
-+ "move\t%0, $2\n\t" \
-+ ".set\treorder" \
-+ : "=&r" (__v0), "=r" (__a3) \
-+ : "r" (__a0), "r" (__a1), "i" (__NR_##sname) \
-+ : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
-+ "memory"); \
-+ \
-+ if (__a3 == 0) \
-+ return (type) __v0; \
-+ return (type) -1; \
-+}
-+
-+#define io_syscall3(type,fname,sname,atype,a,btype,b,ctype,c) \
-+type fname(atype a, btype b, ctype c) \
-+{ \
-+ register unsigned long __a0 asm("$4") = (unsigned long) a; \
-+ register unsigned long __a1 asm("$5") = (unsigned long) b; \
-+ register unsigned long __a2 asm("$6") = (unsigned long) c; \
-+ register unsigned long __a3 asm("$7"); \
-+ unsigned long __v0; \
-+ \
-+ __asm__ volatile ( \
-+ ".set\tnoreorder\n\t" \
-+ "li\t$2, %5\t\t\t# " #fname "\n\t" \
-+ "syscall\n\t" \
-+ "move\t%0, $2\n\t" \
-+ ".set\treorder" \
-+ : "=&r" (__v0), "=r" (__a3) \
-+ : "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_##sname) \
-+ : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
-+ "memory"); \
-+ \
-+ if (__a3 == 0) \
-+ return (type) __v0; \
-+ return (type) -1; \
-+}
-+
-+#define io_syscall4(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d) \
-+type fname(atype a, btype b, ctype c, dtype d) \
-+{ \
-+ register unsigned long __a0 asm("$4") = (unsigned long) a; \
-+ register unsigned long __a1 asm("$5") = (unsigned long) b; \
-+ register unsigned long __a2 asm("$6") = (unsigned long) c; \
-+ register unsigned long __a3 asm("$7") = (unsigned long) d; \
-+ unsigned long __v0; \
-+ \
-+ __asm__ volatile ( \
-+ ".set\tnoreorder\n\t" \
-+ "li\t$2, %5\t\t\t# " #fname "\n\t" \
-+ "syscall\n\t" \
-+ "move\t%0, $2\n\t" \
-+ ".set\treorder" \
-+ : "=&r" (__v0), "+r" (__a3) \
-+ : "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_##sname) \
-+ : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
-+ "memory"); \
-+ \
-+ if (__a3 == 0) \
-+ return (type) __v0; \
-+ return (type) -1; \
-+}
-+
-+#if (_MIPS_SIM == _MIPS_SIM_ABI32)
-+
-+/*
-+ * Using those means your brain needs more than an oil change ;-)
-+ */
-+
-+#define io_syscall5(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d,etype,e) \
-+type fname(atype a, btype b, ctype c, dtype d, etype e) \
-+{ \
-+ register unsigned long __a0 asm("$4") = (unsigned long) a; \
-+ register unsigned long __a1 asm("$5") = (unsigned long) b; \
-+ register unsigned long __a2 asm("$6") = (unsigned long) c; \
-+ register unsigned long __a3 asm("$7") = (unsigned long) d; \
-+ unsigned long __v0; \
-+ \
-+ __asm__ volatile ( \
-+ ".set\tnoreorder\n\t" \
-+ "lw\t$2, %6\n\t" \
-+ "subu\t$29, 32\n\t" \
-+ "sw\t$2, 16($29)\n\t" \
-+ "li\t$2, %5\t\t\t# " #fname "\n\t" \
-+ "syscall\n\t" \
-+ "move\t%0, $2\n\t" \
-+ "addiu\t$29, 32\n\t" \
-+ ".set\treorder" \
-+ : "=&r" (__v0), "+r" (__a3) \
-+ : "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_##sname), \
-+ "m" ((unsigned long)e) \
-+ : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
-+ "memory"); \
-+ \
-+ if (__a3 == 0) \
-+ return (type) __v0; \
-+ return (type) -1; \
-+}
-+
-+#endif /* (_MIPS_SIM == _MIPS_SIM_ABI32) */
-+
-+#if (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64)
-+
-+#define io_syscall5(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d,etype,e) \
-+type fname (atype a,btype b,ctype c,dtype d,etype e) \
-+{ \
-+ register unsigned long __a0 asm("$4") = (unsigned long) a; \
-+ register unsigned long __a1 asm("$5") = (unsigned long) b; \
-+ register unsigned long __a2 asm("$6") = (unsigned long) c; \
-+ register unsigned long __a3 asm("$7") = (unsigned long) d; \
-+ register unsigned long __a4 asm("$8") = (unsigned long) e; \
-+ unsigned long __v0; \
-+ \
-+ __asm__ volatile ( \
-+ ".set\tnoreorder\n\t" \
-+ "li\t$2, %6\t\t\t# " #fname "\n\t" \
-+ "syscall\n\t" \
-+ "move\t%0, $2\n\t" \
-+ ".set\treorder" \
-+ : "=&r" (__v0), "+r" (__a3) \
-+ : "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a4), "i" (__NR_##sname) \
-+ : "$2", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
-+ "memory"); \
-+ \
-+ if (__a3 == 0) \
-+ return (type) __v0; \
-+ return (type) -1; \
-+}
-+
-+#endif /* (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64) */
-+
--- a/src/libaio.h
+++ b/src/libaio.h
-@@ -66,6 +66,7 @@ typedef enum io_iocb_cmd {
+@@ -71,6 +71,7 @@ typedef enum io_iocb_cmd {
/* big endian, 64 bits */
#elif defined(__powerpc64__) || defined(__s390x__) || \
+ (defined(__hppa__) && defined(__arch64__)) || \
(defined(__sparc__) && defined(__arch64__)) || \
- (defined(__aarch64__) && defined(__AARCH64EB__))
- #define PADDED(x, y) unsigned y; x
+ (defined(__aarch64__) && defined(__AARCH64EB__)) || \
+ (defined(__GNUC__) && defined(__BYTE_ORDER__) && \
--- /dev/null
+++ b/src/syscall-parisc.h
-@@ -0,0 +1,146 @@
-+/*
-+ * Linux system call numbers.
-+ *
-+ * Cary Coutant says that we should just use another syscall gateway
-+ * page to avoid clashing with the HPUX space, and I think he's right:
-+ * it will would keep a branch out of our syscall entry path, at the
-+ * very least. If we decide to change it later, we can ``just'' tweak
-+ * the LINUX_GATEWAY_ADDR define at the bottom and make __NR_Linux be
-+ * 1024 or something. Oh, and recompile libc. =)
-+ *
-+ * 64-bit HPUX binaries get the syscall gateway address passed in a register
-+ * from the kernel at startup, which seems a sane strategy.
-+ */
-+
+@@ -0,0 +1,6 @@
+#define __NR_Linux 0
+#define __NR_io_setup (__NR_Linux + 215)
+#define __NR_io_destroy (__NR_Linux + 216)
+#define __NR_io_getevents (__NR_Linux + 217)
+#define __NR_io_submit (__NR_Linux + 218)
+#define __NR_io_cancel (__NR_Linux + 219)
-+
-+#define SYS_ify(syscall_name) __NR_##syscall_name
-+
-+/* Assume all syscalls are done from PIC code just to be
-+ * safe. The worst case scenario is that you lose a register
-+ * and save/restore r19 across the syscall. */
-+#define PIC
-+
-+/* Definition taken from glibc 2.3.3
-+ * sysdeps/unix/sysv/linux/hppa/sysdep.h
-+ */
-+
-+#ifdef PIC
-+/* WARNING: CANNOT BE USED IN A NOP! */
-+# define K_STW_ASM_PIC " copy %%r19, %%r4\n"
-+# define K_LDW_ASM_PIC " copy %%r4, %%r19\n"
-+# define K_USING_GR4 "%r4",
-+#else
-+# define K_STW_ASM_PIC " \n"
-+# define K_LDW_ASM_PIC " \n"
-+# define K_USING_GR4
-+#endif
-+
-+/* GCC has to be warned that a syscall may clobber all the ABI
-+ registers listed as "caller-saves", see page 8, Table 2
-+ in section 2.2.6 of the PA-RISC RUN-TIME architecture
-+ document. However! r28 is the result and will conflict with
-+ the clobber list so it is left out. Also the input arguments
-+ registers r20 -> r26 will conflict with the list so they
-+ are treated specially. Although r19 is clobbered by the syscall
-+ we cannot say this because it would violate ABI, thus we say
-+ r4 is clobbered and use that register to save/restore r19
-+ across the syscall. */
-+
-+#define K_CALL_CLOB_REGS "%r1", "%r2", K_USING_GR4 \
-+ "%r20", "%r29", "%r31"
-+
-+#undef K_INLINE_SYSCALL
-+#define K_INLINE_SYSCALL(name, nr, args...) ({ \
-+ long __sys_res; \
-+ { \
-+ register unsigned long __res __asm__("r28"); \
-+ K_LOAD_ARGS_##nr(args) \
-+ /* FIXME: HACK stw/ldw r19 around syscall */ \
-+ __asm__ volatile( \
-+ K_STW_ASM_PIC \
-+ " ble 0x100(%%sr2, %%r0)\n" \
-+ " ldi %1, %%r20\n" \
-+ K_LDW_ASM_PIC \
-+ : "=r" (__res) \
-+ : "i" (SYS_ify(name)) K_ASM_ARGS_##nr \
-+ : "memory", K_CALL_CLOB_REGS K_CLOB_ARGS_##nr \
-+ ); \
-+ __sys_res = (long)__res; \
-+ } \
-+ __sys_res; \
-+})
-+
-+#define K_LOAD_ARGS_0()
-+#define K_LOAD_ARGS_1(r26) \
-+ register unsigned long __r26 __asm__("r26") = (unsigned long)(r26); \
-+ K_LOAD_ARGS_0()
-+#define K_LOAD_ARGS_2(r26,r25) \
-+ register unsigned long __r25 __asm__("r25") = (unsigned long)(r25); \
-+ K_LOAD_ARGS_1(r26)
-+#define K_LOAD_ARGS_3(r26,r25,r24) \
-+ register unsigned long __r24 __asm__("r24") = (unsigned long)(r24); \
-+ K_LOAD_ARGS_2(r26,r25)
-+#define K_LOAD_ARGS_4(r26,r25,r24,r23) \
-+ register unsigned long __r23 __asm__("r23") = (unsigned long)(r23); \
-+ K_LOAD_ARGS_3(r26,r25,r24)
-+#define K_LOAD_ARGS_5(r26,r25,r24,r23,r22) \
-+ register unsigned long __r22 __asm__("r22") = (unsigned long)(r22); \
-+ K_LOAD_ARGS_4(r26,r25,r24,r23)
-+#define K_LOAD_ARGS_6(r26,r25,r24,r23,r22,r21) \
-+ register unsigned long __r21 __asm__("r21") = (unsigned long)(r21); \
-+ K_LOAD_ARGS_5(r26,r25,r24,r23,r22)
-+
-+/* Even with zero args we use r20 for the syscall number */
-+#define K_ASM_ARGS_0
-+#define K_ASM_ARGS_1 K_ASM_ARGS_0, "r" (__r26)
-+#define K_ASM_ARGS_2 K_ASM_ARGS_1, "r" (__r25)
-+#define K_ASM_ARGS_3 K_ASM_ARGS_2, "r" (__r24)
-+#define K_ASM_ARGS_4 K_ASM_ARGS_3, "r" (__r23)
-+#define K_ASM_ARGS_5 K_ASM_ARGS_4, "r" (__r22)
-+#define K_ASM_ARGS_6 K_ASM_ARGS_5, "r" (__r21)
-+
-+/* The registers not listed as inputs but clobbered */
-+#define K_CLOB_ARGS_6
-+#define K_CLOB_ARGS_5 K_CLOB_ARGS_6, "%r21"
-+#define K_CLOB_ARGS_4 K_CLOB_ARGS_5, "%r22"
-+#define K_CLOB_ARGS_3 K_CLOB_ARGS_4, "%r23"
-+#define K_CLOB_ARGS_2 K_CLOB_ARGS_3, "%r24"
-+#define K_CLOB_ARGS_1 K_CLOB_ARGS_2, "%r25"
-+#define K_CLOB_ARGS_0 K_CLOB_ARGS_1, "%r26"
-+
-+#define io_syscall1(type,fname,sname,type1,arg1) \
-+type fname(type1 arg1) \
-+{ \
-+ return K_INLINE_SYSCALL(sname, 1, arg1); \
-+}
-+
-+#define io_syscall2(type,fname,sname,type1,arg1,type2,arg2) \
-+type fname(type1 arg1, type2 arg2) \
-+{ \
-+ return K_INLINE_SYSCALL(sname, 2, arg1, arg2); \
-+}
-+
-+#define io_syscall3(type,fname,sname,type1,arg1,type2,arg2,type3,arg3) \
-+type fname(type1 arg1, type2 arg2, type3 arg3) \
-+{ \
-+ return K_INLINE_SYSCALL(sname, 3, arg1, arg2, arg3); \
-+}
-+
-+#define io_syscall4(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
-+type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
-+{ \
-+ return K_INLINE_SYSCALL(sname, 4, arg1, arg2, arg3, arg4); \
-+}
-+
-+#define io_syscall5(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
-+type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
-+{ \
-+ return K_INLINE_SYSCALL(sname, 5, arg1, arg2, arg3, arg4, arg5); \
-+}
-+
--- a/harness/main.c
+++ b/harness/main.c
@@ -12,7 +12,17 @@
#else
//#warning Not really sure where kernel memory is. Guessing.
#define KERNEL_RW_POINTER ((void *)0xffffffff81000000)
---- a/src/syscall-sparc.h
-+++ b/src/syscall-sparc.h
-@@ -20,7 +20,9 @@ __asm__ __volatile__ ("t 0x10\n\t" \
- : "=r" (__res), "=&r" (__o0) \
- : "1" (__o0), "r" (__g1) \
- : "cc"); \
--return (type) __res; \
-+if (__res < -255 || __res >= 0) \
-+ return (type) __res; \
-+return -1; \
- }
-
- #define io_syscall2(type,fname,sname,type1,arg1,type2,arg2) \
-@@ -38,7 +40,9 @@ __asm__ __volatile__ ("t 0x10\n\t" \
- : "=r" (__res), "=&r" (__o0) \
- : "1" (__o0), "r" (__o1), "r" (__g1) \
- : "cc"); \
--return (type) __res; \
-+if (__res < -255 || __res >= 0) \
-+ return (type) __res; \
-+return -1; \
- }
-
- #define io_syscall3(type,fname,sname,type1,arg1,type2,arg2,type3,arg3) \
-@@ -57,7 +61,9 @@ __asm__ __volatile__ ("t 0x10\n\t" \
- : "=r" (__res), "=&r" (__o0) \
- : "1" (__o0), "r" (__o1), "r" (__o2), "r" (__g1) \
- : "cc"); \
--return (type) __res; \
-+if (__res < -255 || __res >= 0) \
-+ return (type) __res; \
-+return -1; \
- }
-
- #define io_syscall4(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
-@@ -77,7 +83,9 @@ __asm__ __volatile__ ("t 0x10\n\t" \
- : "=r" (__res), "=&r" (__o0) \
- : "1" (__o0), "r" (__o1), "r" (__o2), "r" (__o3), "r" (__g1) \
- : "cc"); \
--return (type) __res; \
-+if (__res < -255 || __res >= 0) \
-+ return (type) __res; \
-+return -1; \
- }
-
- #define io_syscall5(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
-@@ -99,5 +107,7 @@ __asm__ __volatile__ ("t 0x10\n\t" \
- : "=r" (__res), "=&r" (__o0) \
- : "1" (__o0), "r" (__o1), "r" (__o2), "r" (__o3), "r" (__o4), "r" (__g1) \
- : "cc"); \
--return (type) __res; \
-+if (__res < -255 || __res >= 0) \
-+ return (type) __res; \
-+return -1; \
- }
-From: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
-Subject: Add SH supprt
-
-The test-suite logs can be found at:
-
- <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=535288>
+Author: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+Description: Add SH supprt
+ The test-suite logs can be found at:
+ .
+ <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=535288>
---
- harness/main.c | 2 -
- src/libaio.h | 4 ++
- src/syscall-sh.h | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
- src/syscall.h | 2 +
- 4 files changed, 84 insertions(+), 2 deletions(-)
+ harness/main.c | 2 +-
+ src/libaio.h | 4 +++-
+ src/syscall-sh.h | 6 ++++++
+ src/syscall.h | 2 ++
+ 4 files changed, 12 insertions(+), 2 deletions(-)
--- a/harness/main.c
- defined(__sh__) || defined(__bfin__) || defined(__MIPSEL__) || \
+ (defined(__sh__) && defined(__LITTLE_ENDIAN__)) || \
+ defined(__bfin__) || defined(__MIPSEL__) || \
- defined(__cris__)
- #define PADDED(x, y) x; unsigned y
- #define PADDEDptr(x, y) x; unsigned y
-@@ -76,6 +77,7 @@ typedef enum io_iocb_cmd {
+ defined(__cris__) || (defined(__riscv) && __riscv_xlen == 32) || \
+ (defined(__GNUC__) && defined(__BYTE_ORDER__) && \
+ __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ && __SIZEOF_LONG__ == 4)
+@@ -83,6 +84,7 @@ typedef enum io_iocb_cmd {
/* big endian, 32 bits */
#elif defined(__PPC__) || defined(__s390__) || \
(defined(__arm__) && defined(__ARMEB__)) || \
+ (defined(__sh__) && defined (__BIG_ENDIAN__)) || \
defined(__sparc__) || defined(__MIPSEB__) || defined(__m68k__) || \
- defined(__hppa__) || defined(__frv__) || defined(__avr32__)
- #define PADDED(x, y) unsigned y; x
+ defined(__hppa__) || defined(__frv__) || defined(__avr32__) || \
+ (defined(__GNUC__) && defined(__BYTE_ORDER__) && \
--- /dev/null
+++ b/src/syscall-sh.h
-@@ -0,0 +1,78 @@
+@@ -0,0 +1,6 @@
+/* Copy from ./arch/sh/include/asm/unistd_32.h */
+#define __NR_io_setup 245
+#define __NR_io_destroy 246
+#define __NR_io_getevents 247
+#define __NR_io_submit 248
+#define __NR_io_cancel 249
-+
-+#define io_syscall1(type,fname,sname,type1,arg1) \
-+type fname(type1 arg1) \
-+{ \
-+register long __sc0 __asm__ ("r3") = __NR_##sname; \
-+register long __sc4 __asm__ ("r4") = (long) arg1; \
-+__asm__ __volatile__ ("trapa #0x11" \
-+ : "=z" (__sc0) \
-+ : "0" (__sc0), "r" (__sc4) \
-+ : "memory"); \
-+ return (type) __sc0;\
-+}
-+
-+#define io_syscall2(type,fname,sname,type1,arg1,type2,arg2) \
-+type fname(type1 arg1,type2 arg2) \
-+{ \
-+register long __sc0 __asm__ ("r3") = __NR_##sname; \
-+register long __sc4 __asm__ ("r4") = (long) arg1; \
-+register long __sc5 __asm__ ("r5") = (long) arg2; \
-+ __asm__ __volatile__ ("trapa #0x12" \
-+ : "=z" (__sc0) \
-+ : "0" (__sc0), "r" (__sc4), "r" (__sc5) \
-+ : "memory"); \
-+ return (type) __sc0;\
-+}
-+
-+#define io_syscall3(type,fname,sname,type1,arg1,type2,arg2,type3,arg3) \
-+type fname(type1 arg1,type2 arg2,type3 arg3) \
-+{ \
-+register long __sc0 __asm__ ("r3") = __NR_##sname; \
-+register long __sc4 __asm__ ("r4") = (long) arg1; \
-+register long __sc5 __asm__ ("r5") = (long) arg2; \
-+register long __sc6 __asm__ ("r6") = (long) arg3; \
-+ __asm__ __volatile__ ("trapa #0x13" \
-+ : "=z" (__sc0) \
-+ : "0" (__sc0), "r" (__sc4), "r" (__sc5), "r" (__sc6) \
-+ : "memory"); \
-+ return (type) __sc0;\
-+}
-+
-+#define io_syscall4(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
-+type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
-+{ \
-+register long __sc0 __asm__ ("r3") = __NR_##sname; \
-+register long __sc4 __asm__ ("r4") = (long) arg1; \
-+register long __sc5 __asm__ ("r5") = (long) arg2; \
-+register long __sc6 __asm__ ("r6") = (long) arg3; \
-+register long __sc7 __asm__ ("r7") = (long) arg4; \
-+__asm__ __volatile__ ("trapa #0x14" \
-+ : "=z" (__sc0) \
-+ : "0" (__sc0), "r" (__sc4), "r" (__sc5), "r" (__sc6), \
-+ "r" (__sc7) \
-+ : "memory" ); \
-+ return (type) __sc0;\
-+}
-+
-+#define io_syscall5(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
-+type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
-+{ \
-+register long __sc3 __asm__ ("r3") = __NR_##sname; \
-+register long __sc4 __asm__ ("r4") = (long) arg1; \
-+register long __sc5 __asm__ ("r5") = (long) arg2; \
-+register long __sc6 __asm__ ("r6") = (long) arg3; \
-+register long __sc7 __asm__ ("r7") = (long) arg4; \
-+register long __sc0 __asm__ ("r0") = (long) arg5; \
-+__asm__ __volatile__ ("trapa #0x15" \
-+ : "=z" (__sc0) \
-+ : "0" (__sc0), "r" (__sc4), "r" (__sc5), "r" (__sc6), "r" (__sc7), \
-+ "r" (__sc3) \
-+ : "memory" ); \
-+ return (type) __sc0;\
-+}
--- a/src/syscall.h
+++ b/src/syscall.h
-@@ -34,6 +34,8 @@
+@@ -33,6 +33,8 @@
#include "syscall-parisc.h"
#elif defined(__mips__)
#include "syscall-mips.h"
+#elif defined(__sh__)
+#include "syscall-sh.h"
- #else
- #warning "using generic syscall method"
+ #elif defined(__aarch64__) || defined(__riscv)
#include "syscall-generic.h"
+ #else
--- /dev/null
+Description: Fix structure padding for mips64
+Author: Guillem Jover <guillem@debian.org>
+Forwarded: no
+Last-Update: 2014-07-23
+
+
+---
+ src/libaio.h | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+--- a/src/libaio.h
++++ b/src/libaio.h
+@@ -52,7 +52,8 @@ typedef enum io_iocb_cmd {
+ /* little endian, 32 bits */
+ #if defined(__i386__) || (defined(__arm__) && !defined(__ARMEB__)) || \
+ (defined(__sh__) && defined(__LITTLE_ENDIAN__)) || \
+- defined(__bfin__) || defined(__MIPSEL__) || \
++ defined(__bfin__) || \
++ (defined(__MIPSEL__) && !defined(__mips64)) || \
+ defined(__cris__) || (defined(__riscv) && __riscv_xlen == 32) || \
+ (defined(__GNUC__) && defined(__BYTE_ORDER__) && \
+ __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ && __SIZEOF_LONG__ == 4)
+@@ -62,6 +63,7 @@ typedef enum io_iocb_cmd {
+
+ /* little endian, 64 bits */
+ #elif defined(__ia64__) || defined(__x86_64__) || defined(__alpha__) || \
++ (defined(__mips64) && defined(__MIPSEL__)) || \
+ (defined(__aarch64__) && defined(__AARCH64EL__)) || \
+ (defined(__riscv) && __riscv_xlen == 64) || \
+ (defined(__GNUC__) && defined(__BYTE_ORDER__) && \
+@@ -74,6 +76,7 @@ typedef enum io_iocb_cmd {
+ #elif defined(__powerpc64__) || defined(__s390x__) || \
+ (defined(__hppa__) && defined(__arch64__)) || \
+ (defined(__sparc__) && defined(__arch64__)) || \
++ (defined(__mips64) && defined(__MIPSEB__)) || \
+ (defined(__aarch64__) && defined(__AARCH64EB__)) || \
+ (defined(__GNUC__) && defined(__BYTE_ORDER__) && \
+ __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ && __SIZEOF_LONG__ == 8)
+++ /dev/null
----
- src/syscall-sparc64.h | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++
- src/syscall.h | 2 +
- 2 files changed, 100 insertions(+)
-
---- a/src/syscall.h
-+++ b/src/syscall.h
-@@ -24,6 +24,8 @@
- #include "syscall-alpha.h"
- #elif defined(__arm__)
- #include "syscall-arm.h"
-+#elif defined(__sparc__) && defined(__arch64__)
-+#include "syscall-sparc64.h"
- #elif defined(__sparc__)
- #include "syscall-sparc.h"
- #elif defined(__aarch64__)
---- /dev/null
-+++ b/src/syscall-sparc64.h
-@@ -0,0 +1,98 @@
-+#define __NR_io_setup 268
-+#define __NR_io_destroy 269
-+#define __NR_io_submit 270
-+#define __NR_io_cancel 271
-+#define __NR_io_getevents 272
-+
-+#define io_syscall1(type,fname,sname,type1,arg1) \
-+type fname(type1 arg1) \
-+{ \
-+ unsigned long __res; \
-+ register unsigned long __g1 __asm__("g1") = __NR_##sname; \
-+ register unsigned long __o0 __asm__("o0") = (unsigned long) arg1; \
-+ __asm__ __volatile__("t 0x6d\n\t" \
-+ "sub %%g0, %%o0, %0\n\t" \
-+ "movcc %%xcc, %%o0, %0\n" \
-+ "1:" \
-+ : "=r" (__res), "=&r" (__o0) \
-+ : "1" (__o0), "r" (__g1) \
-+ : "cc"); \
-+ return (type) __res; \
-+}
-+
-+#define io_syscall2(type,fname,sname,type1,arg1,type2,arg2) \
-+type fname(type1 arg1, type2 arg2) \
-+{ \
-+ unsigned long __res; \
-+ register unsigned long __g1 __asm__("g1") = __NR_##sname; \
-+ register unsigned long __o0 __asm__("o0") = (unsigned long) arg1; \
-+ register unsigned long __o1 __asm__("o1") = (unsigned long) arg2; \
-+ __asm__ __volatile__("t 0x6d\n\t" \
-+ "sub %%g0, %%o0, %0\n\t" \
-+ "movcc %%xcc, %%o0, %0\n" \
-+ "1:" \
-+ : "=r" (__res), "=&r" (__o0) \
-+ : "1" (__o0), "r" (__o1), "r" (__g1) \
-+ : "cc"); \
-+ return (type) __res; \
-+}
-+
-+#define io_syscall3(type,fname,sname,type1,arg1,type2,arg2,type3,arg3) \
-+type fname(type1 arg1, type2 arg2, type3 arg3) \
-+{ \
-+ unsigned long __res; \
-+ register unsigned long __g1 __asm__("g1") = __NR_##sname; \
-+ register unsigned long __o0 __asm__("o0") = (unsigned long) arg1; \
-+ register unsigned long __o1 __asm__("o1") = (unsigned long) arg2; \
-+ register unsigned long __o2 __asm__("o2") = (unsigned long) arg3; \
-+ __asm__ __volatile__("t 0x6d\n\t" \
-+ "sub %%g0, %%o0, %0\n\t" \
-+ "movcc %%xcc, %%o0, %0\n" \
-+ "1:" \
-+ : "=r" (__res), "=&r" (__o0) \
-+ : "1" (__o0), "r" (__o1), "r" (__o2), \
-+ "r" (__g1) \
-+ : "cc"); \
-+ return (type) __res; \
-+}
-+
-+#define io_syscall4(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
-+type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
-+{ \
-+ unsigned long __res; \
-+ register unsigned long __g1 __asm__("g1") = __NR_##sname; \
-+ register unsigned long __o0 __asm__("o0") = (unsigned long) arg1; \
-+ register unsigned long __o1 __asm__("o1") = (unsigned long) arg2; \
-+ register unsigned long __o2 __asm__("o2") = (unsigned long) arg3; \
-+ register unsigned long __o3 __asm__("o3") = (unsigned long) arg4; \
-+ __asm__ __volatile__("t 0x6d\n\t" \
-+ "sub %%g0, %%o0, %0\n\t" \
-+ "movcc %%xcc, %%o0, %0\n" \
-+ "1:" \
-+ : "=r" (__res), "=&r" (__o0) \
-+ : "1" (__o0), "r" (__o1), "r" (__o2), \
-+ "r" (__o3), "r" (__g1) \
-+ : "cc"); \
-+ return (type) __res; \
-+}
-+
-+#define io_syscall5(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
-+type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
-+{ \
-+ unsigned long __res; \
-+ register unsigned long __g1 __asm__("g1") = __NR_##sname; \
-+ register unsigned long __o0 __asm__("o0") = (unsigned long) arg1; \
-+ register unsigned long __o1 __asm__("o1") = (unsigned long) arg2; \
-+ register unsigned long __o2 __asm__("o2") = (unsigned long) arg3; \
-+ register unsigned long __o3 __asm__("o3") = (unsigned long) arg4; \
-+ register unsigned long __o4 __asm__("o4") = (unsigned long) arg5; \
-+ __asm__ __volatile__("t 0x6d\n\t" \
-+ "sub %%g0, %%o0, %0\n\t" \
-+ "movcc %%xcc, %%o0, %0\n" \
-+ "1:" \
-+ : "=r" (__res), "=&r" (__o0) \
-+ : "1" (__o0), "r" (__o1), "r" (__o2), \
-+ "r" (__o3), "r" (__o4), "r" (__g1) \
-+ : "cc"); \
-+ return (type) __res; \
-+}
-Index: libaio-0.3.109/src/syscall-x86_64.h
-===================================================================
---- libaio-0.3.109.orig/src/syscall-x86_64.h 2009-10-09 11:17:02.000000000 -0700
-+++ libaio-0.3.109/src/syscall-x86_64.h 2013-03-03 07:15:13.000000000 -0800
-@@ -1,8 +1,18 @@
+Description: Add support for x32 (from the Yocto project)
+Author: Daniel Schepler <dschepler@gmail.com>
+Origin: vendor
+Forwarded: no
+Bug-Debian: 702183
+Last-Update: 2013-05-06
+
+
+---
+ harness/main.c | 2 +-
+ src/syscall-x86_64.h | 10 ++++++++++
+ 2 files changed, 11 insertions(+), 1 deletion(-)
+
+--- a/src/syscall-x86_64.h
++++ b/src/syscall-x86_64.h
+@@ -1,5 +1,15 @@
+#ifndef __NR_io_setup
#define __NR_io_setup 206
+#endif
+#ifndef __NR_io_cancel
#define __NR_io_cancel 210
+#endif
-
- #define __syscall_clobber "r11","rcx","memory"
- #define __syscall "syscall"
-@@ -42,10 +52,11 @@
- type fname (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
- { \
- long __res; \
--__asm__ volatile ("movq %5,%%r10 ;" __syscall \
-+register long __a4 asm ("r10") = (long) arg4; \
-+__asm__ volatile (__syscall \
- : "=a" (__res) \
- : "0" (__NR_##sname),"D" ((long)(arg1)),"S" ((long)(arg2)), \
-- "d" ((long)(arg3)),"g" ((long)(arg4)) : __syscall_clobber,"r10" ); \
-+ "d" ((long)(arg3)),"r" (__a4)); \
- return __res; \
- }
-
-@@ -54,10 +65,11 @@
- type fname (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \
- { \
- long __res; \
--__asm__ volatile ("movq %5,%%r10 ; movq %6,%%r8 ; " __syscall \
-+register long __a4 asm ("r10") = (long) arg4; \
-+register long __a5 asm ("r8") = (long) arg5; \
-+__asm__ volatile (__syscall \
- : "=a" (__res) \
- : "0" (__NR_##sname),"D" ((long)(arg1)),"S" ((long)(arg2)), \
-- "d" ((long)(arg3)),"g" ((long)(arg4)),"g" ((long)(arg5)) : \
-- __syscall_clobber,"r8","r10" ); \
-+ "d" ((long)(arg3)),"r" (__a4),"r" (__a5)); \
- return __res; \
- }
-Index: libaio-0.3.109/harness/main.c
-===================================================================
---- libaio-0.3.109.orig/harness/main.c 2013-03-03 06:58:51.000000000 -0800
-+++ libaio-0.3.109/harness/main.c 2013-03-03 07:23:40.000000000 -0800
+--- a/harness/main.c
++++ b/harness/main.c
@@ -14,7 +14,7 @@
#if __LP64__ == 0
#if defined(__i386__) || defined(__powerpc__) || defined(__mips__)
+++ /dev/null
-Description: Fix mips/mipsel syscall wrappers to return correct error values.
-Author: Jurica Stanojkovic <Jurica.Stanojkovic@rt-rk.com>
-Forwarded: no
-Last-Update: 2012-09-24
-
-
-diff -upNr a/src/syscall-mips.h b/src/syscall-mips.h
---- a/src/syscall-mips.h 2012-09-13 11:46:35.652286733 +0200
-+++ b/src/syscall-mips.h 2012-09-13 16:09:17.964407909 +0200
-@@ -76,7 +76,7 @@ type fname(atype a) \
- \
- if (__a3 == 0) \
- return (type) __v0; \
-- return (type) -1; \
-+ return (type) 0 - __v0; \
- }
-
- #define io_syscall2(type,fname,sname,atype,a,btype,b) \
-@@ -100,7 +100,7 @@ type fname(atype a, btype b) \
- \
- if (__a3 == 0) \
- return (type) __v0; \
-- return (type) -1; \
-+ return (type) 0 - __v0; \
- }
-
- #define io_syscall3(type,fname,sname,atype,a,btype,b,ctype,c) \
-@@ -125,7 +125,7 @@ type fname(atype a, btype b, ctype c) \
- \
- if (__a3 == 0) \
- return (type) __v0; \
-- return (type) -1; \
-+ return (type) 0 - __v0; \
- }
-
- #define io_syscall4(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d) \
-@@ -150,7 +150,7 @@ type fname(atype a, btype b, ctype c, dt
- \
- if (__a3 == 0) \
- return (type) __v0; \
-- return (type) -1; \
-+ return (type) 0 - __v0; \
- }
-
- #if (_MIPS_SIM == _MIPS_SIM_ABI32)
-@@ -186,7 +186,7 @@ type fname(atype a, btype b, ctype c, dt
- \
- if (__a3 == 0) \
- return (type) __v0; \
-- return (type) -1; \
-+ return (type) 0 - __v0; \
- }
-
- #endif /* (_MIPS_SIM == _MIPS_SIM_ABI32) */
-@@ -216,7 +216,7 @@ type fname (atype a,btype b,ctype c,dtyp
- \
- if (__a3 == 0) \
- return (type) __v0; \
-- return (type) -1; \
-+ return (type) 0 - __v0; \
- }
-
- #endif /* (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64) */
+++ /dev/null
-Description: Fix structure padding for mips64
-Author: Guillem Jover <guillem@debian.org>
-Forwarded: no
-Last-Update: 2014-07-23
-
----
- src/libaio.h | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
-
---- a/src/libaio.h
-+++ b/src/libaio.h
-@@ -52,7 +52,8 @@ typedef enum io_iocb_cmd {
- /* little endian, 32 bits */
- #if defined(__i386__) || (defined(__arm__) && !defined(__ARMEB__)) || \
- (defined(__sh__) && defined(__LITTLE_ENDIAN__)) || \
-- defined(__bfin__) || defined(__MIPSEL__) || \
-+ defined(__bfin__) || \
-+ (defined(__MIPSEL__) && !defined(__mips64)) || \
- defined(__cris__)
- #define PADDED(x, y) x; unsigned y
- #define PADDEDptr(x, y) x; unsigned y
-@@ -60,6 +61,7 @@ typedef enum io_iocb_cmd {
-
- /* little endian, 64 bits */
- #elif defined(__ia64__) || defined(__x86_64__) || defined(__alpha__) || \
-+ (defined(__mips64) && defined(__MIPSEL__)) || \
- (defined(__aarch64__) && defined(__AARCH64EL__))
- #define PADDED(x, y) x, y
- #define PADDEDptr(x, y) x
-@@ -69,6 +71,7 @@ typedef enum io_iocb_cmd {
- #elif defined(__powerpc64__) || defined(__s390x__) || \
- (defined(__hppa__) && defined(__arch64__)) || \
- (defined(__sparc__) && defined(__arch64__)) || \
-+ (defined(__mips64) && defined(__MIPSEB__)) || \
- (defined(__aarch64__) && defined(__AARCH64EB__))
- #define PADDED(x, y) unsigned y; x
- #define PADDEDptr(x,y) x
PKG_NAME:=libevhtp
PKG_VERSION:=1.1.6
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_LICENSE:=BSD-3-Clause
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=https://chromium.googlesource.com/external/github.com/ellzey/libevhtp
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=91071e2f20749cd469b87ac2ef1c158dc2a6806f
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
-PKG_MIRROR_HASH:=c9c4415539e78ac9021a8507cd16b9101564dd03286bc84428cc1ee11f0df1fd
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://codeload.github.com/criticalstack/libevhtp/tar.gz/$(PKG_VERSION)?
+PKG_HASH:=725dd0a32237b2a097cdc2003d09278a082ccce310aaba7441a5fd8fa8f26635
PKG_INSTALL:=1
--- /dev/null
+diff --git a/evhtp.c b/evhtp.c
+index 24687be..b646925 100644
+--- a/evhtp.c
++++ b/evhtp.c
+@@ -1667,9 +1667,9 @@ _evhtp_accept_cb(evserv_t * serv, int fd, struct sockaddr * s, int sl, void * ar
+
+ #ifndef EVHTP_DISABLE_SSL
+ #ifndef EVHTP_DISABLE_EVTHR
+-static unsigned long
+-_evhtp_ssl_get_thread_id(void) {
+- return (unsigned long)pthread_self();
++static void
++_evhtp_ssl_get_thread_id(CRYPTO_THREADID *id) {
++ CRYPTO_THREADID_set_numeric(id, (unsigned long)pthread_self());
+ }
+
+ static void
+@@ -2999,7 +2999,7 @@ evhtp_ssl_use_threads(void) {
+ pthread_mutex_init(&(ssl_locks[i]), NULL);
+ }
+
+- CRYPTO_set_id_callback(_evhtp_ssl_get_thread_id);
++ CRYPTO_THREADID_set_callback(_evhtp_ssl_get_thread_id);
+ CRYPTO_set_locking_callback(_evhtp_ssl_thread_lock);
+
+ return 0;
include $(TOPDIR)/rules.mk
PKG_NAME:=libmraa
-PKG_VERSION:=0.9.0
+PKG_VERSION:=2.0.0
+PKG_RELEASE:=1
-PKG_RELEASE=$(PKG_SOURCE_VERSION)-1
-
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=https://github.com/intel-iot-devkit/mraa.git
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=049ba5fa9f2d18ac0ec6729c46916b34998d3c5f
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
-PKG_MIRROR_HASH:=0c81cff6dcfe401ead0d8976c6f9a6a86b75ab38413a45a40b7eb20b639d78e4
-PKG_BUILD_DEPENDS:=node python/host swig/host node/host
-CMAKE_INSTALL:=1
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://codeload.github.com/intel-iot-devkit/mraa/tar.gz/v$(PKG_VERSION)?
+PKG_HASH:=c9f3c3741c6894be5516adecfe6b55a38960b6718b268a9afd645f7955e5a716
+PKG_BUILD_DIR:=$(BUILD_DIR)/mraa-$(PKG_VERSION)
PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
PKG_LICENSE:=LGPL-2.1
+PKG_BUILD_DEPENDS:=node python/host swig/host node/host
+CMAKE_INSTALL:=1
+
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
define Package/libmraa
SECTION:=libs
CATEGORY:=Libraries
- DEPENDS:=+python +libstdcpp
+ DEPENDS:=+python +libstdcpp +libjson-c
TITLE:=Intel IoT lowlevel IO library
endef
+++ /dev/null
- CMakeLists.txt | 10 ++++------
- api/mraa/types.h | 1 +
- include/mraa_internal.h | 7 +++++++
- src/CMakeLists.txt | 5 +++++
- src/i2c/i2c.c | 2 +-
- src/mraa.c | 3 +++
- src/uart/uart.c | 1 +
- 7 files changed, 22 insertions(+), 7 deletions(-)
-
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -14,12 +14,7 @@
- set (CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
-
- # Make a version file containing the current version from git.
--include (GetGitRevisionDescription)
--git_describe (VERSION "--tags")
--if ("x_${VERSION}" STREQUAL "x_GIT-NOTFOUND" OR "x_${VERSION}" STREQUAL "x_HEAD-HASH-NOTFOUND" OR "x_${VERSION}" STREQUAL "x_-128-NOTFOUND")
-- message (WARNING " - Install git to compile a production libmraa!")
-- set (VERSION "v0.8.1-dirty")
--endif ()
-+set (VERSION "v0.9.0")
-
- message (INFO " - libmraa Version ${VERSION}")
-
-@@ -84,8 +79,10 @@
- set (X86PLAT ON)
- elseif (DETECTED_ARCH MATCHES "arm.*")
- set (ARMPLAT ON)
-+elseif (DETECTED_ARCH MATCHES "mips")
-+ set (MIPSPLAT ON)
- else ()
-- message(FATAL_ERROR "Only x86 and arm platforms currently supported")
-+ message(FATAL_ERROR "Only x86, arm and mips platforms currently supported")
- endif()
-
- if (BUILDSWIGPYTHON)
---- a/api/mraa/types.h
-+++ b/api/mraa/types.h
-@@ -46,6 +46,7 @@
- MRAA_BEAGLEBONE = 6, /**< The different BeagleBone Black Modes B/C */
- MRAA_BANANA = 7, /**< Allwinner A20 based Banana Pi and Banana Pro */
- MRAA_INTEL_NUC5 = 8, /**< The Intel 5th generations Broadwell NUCs */
-+ MRAA_MTK_LINKIT = 9, /**< Mediatek MT7688 based Linkit (Air) */
-
- // USB platform extenders start at 256
- MRAA_FTDI_FT4222 = 256, /**< FTDI FT4222 USB to i2c bridge */
---- a/include/mraa_internal.h
-+++ b/include/mraa_internal.h
-@@ -66,6 +66,13 @@
- mraa_platform_t mraa_usb_platform_extender(mraa_board_t* board);
-
- /**
-+ * runtime detect running arm platforms
-+ *
-+ * @return mraa_platform_t of the init'ed platform
-+ */
-+mraa_platform_t mraa_mips_platform();
-+
-+/**
- * helper function to check if file exists
- *
- * @param filename to check
---- a/src/CMakeLists.txt
-+++ b/src/CMakeLists.txt
-@@ -71,6 +71,11 @@
- add_subdirectory(usb)
- endif ()
-
-+if (MIPSPLAT)
-+ add_subdirectory(mips)
-+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMIPSPLAT=1")
-+endif()
-+
- set (mraa_LIB_SRCS
- ${mraa_LIB_PLAT_SRCS_NOAUTO}
- # autogenerated version file
---- a/src/i2c/i2c.c
-+++ b/src/i2c/i2c.c
-@@ -31,9 +31,9 @@
- #include <stdlib.h>
- #include <unistd.h>
- #include <fcntl.h>
-+#include <errno.h>
- #include <inttypes.h>
- #include <sys/types.h>
--#include <sys/errno.h>
- #include <sys/ioctl.h>
- #include "linux/i2c-dev.h"
-
---- a/src/mraa.c
-+++ b/src/mraa.c
-@@ -111,6 +111,9 @@
- #elif defined(ARMPLAT)
- // Use runtime ARM platform detection
- platform_type = mraa_arm_platform();
-+#elif MIPSPLAT
-+ // Use runtime ARM platform detection
-+ platform_type = mraa_mips_platform();
- #else
- #error mraa_ARCH NOTHING
- #endif
---- a/src/uart/uart.c
-+++ b/src/uart/uart.c
-@@ -26,6 +26,7 @@
-
- #include <stdlib.h>
- #include <sys/stat.h>
-+#include <sys/time.h>
- #include <unistd.h>
- #include <string.h>
- #include <termios.h>
+++ /dev/null
-From 2c67c6f51ce5bab18c79f4304ccf42716f59f13c Mon Sep 17 00:00:00 2001
-From: John Crispin <blogic@openwrt.org>
-Date: Thu, 23 Jul 2015 13:21:25 +0200
-Subject: [PATCH 2/4] add mips support
-
-Signed-off-by: John Crispin <blogic@openwrt.org>
----
- include/mips/mediatek.h | 39 ++++++
- src/mips/CMakeLists.txt | 6 +
- src/mips/mediatek.c | 349 +++++++++++++++++++++++++++++++++++++++++++++++
- src/mips/mips.c | 60 ++++++++
- 4 files changed, 454 insertions(+)
- create mode 100644 include/mips/mediatek.h
- create mode 100644 src/mips/CMakeLists.txt
- create mode 100644 src/mips/mediatek.c
- create mode 100644 src/mips/mips.c
-
---- /dev/null
-+++ b/include/mips/mediatek.h
-@@ -0,0 +1,39 @@
-+/*
-+ * Author: Thomas Ingleby <thomas.c.ingleby@intel.com>
-+ * Author: Michael Ring <mail@michael-ring.org>
-+ * Copyright (c) 2014 Intel Corporation.
-+ *
-+ * Permission is hereby granted, free of charge, to any person obtaining
-+ * a copy of this software and associated documentation files (the
-+ * "Software"), to deal in the Software without restriction, including
-+ * without limitation the rights to use, copy, modify, merge, publish,
-+ * distribute, sublicense, and/or sell copies of the Software, and to
-+ * permit persons to whom the Software is furnished to do so, subject to
-+ * the following conditions:
-+ *
-+ * The above copyright notice and this permission notice shall be
-+ * included in all copies or substantial portions of the Software.
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-+ */
-+
-+#pragma once
-+
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-+
-+#include "mraa_internal.h"
-+
-+mraa_board_t *
-+ mraa_mtk_linkit();
-+
-+#ifdef __cplusplus
-+}
-+#endif
---- /dev/null
-+++ b/src/mips/CMakeLists.txt
-@@ -0,0 +1,6 @@
-+message (INFO " - Adding MIPS platforms")
-+set (mraa_LIB_PLAT_SRCS_NOAUTO ${mraa_LIB_SRCS_NOAUTO}
-+ ${PROJECT_SOURCE_DIR}/src/mips/mips.c
-+ ${PROJECT_SOURCE_DIR}/src/mips/mediatek.c
-+ PARENT_SCOPE
-+)
---- /dev/null
-+++ b/src/mips/mediatek.c
-@@ -0,0 +1,349 @@
-+/*
-+ * Author: Thomas Ingleby <thomas.c.ingleby@intel.com>
-+ * Author: Michael Ring <mail@michael-ring.org>
-+ * Copyright (c) 2014 Intel Corporation.
-+ *
-+ * Permission is hereby granted, free of charge, to any person obtaining
-+ * a copy of this software and associated documentation files (the
-+ * "Software"), to deal in the Software without restriction, including
-+ * without limitation the rights to use, copy, modify, merge, publish,
-+ * distribute, sublicense, and/or sell copies of the Software, and to
-+ * permit persons to whom the Software is furnished to do so, subject to
-+ * the following conditions:
-+ *
-+ * The above copyright notice and this permission notice shall be
-+ * included in all copies or substantial portions of the Software.
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-+ */
-+
-+#include <stdio.h>
-+#include <stdint.h>
-+#include <stdlib.h>
-+#include <string.h>
-+#include <sys/mman.h>
-+#include <mraa/common.h>
-+
-+#include "mraa_internal.h"
-+
-+#include "common.h"
-+
-+#define PLATFORM_MEDIATEK_LINKIT 1
-+#define PLATFORM_MEDIATEK_LINKIT_AIR 2
-+#define MMAP_PATH "/dev/mem"
-+#define MT7628_GPIO_BASE 0x100
-+#define MT7628_BLOCK_SIZE (4 * 1024)
-+#define MT7628_GPIO_CTRL 0x00
-+#define MT7628_GPIO_DATA 0x20
-+#define MT7628_GPIO_SET 0x30
-+#define MT7628_GPIO_CLEAR 0x40
-+
-+#define MAX_SIZE 64
-+
-+// MMAP
-+static uint8_t* mmap_reg = NULL;
-+static int mmap_fd = 0;
-+static int mmap_size;
-+static unsigned int mmap_count = 0;
-+static int platform_detected = 0;
-+
-+mraa_result_t
-+mraa_mtk_linkit_mmap_write(mraa_gpio_context dev, int value)
-+{
-+ volatile uint32_t* addr;
-+ if (value) {
-+ *(volatile uint32_t*) (mmap_reg + MT7628_GPIO_SET + (dev->pin / 32) * 4) =
-+ (uint32_t)(1 << (dev->pin % 32));
-+ } else {
-+ *(volatile uint32_t*) (mmap_reg + MT7628_GPIO_CLEAR + (dev->pin / 32) * 4) =
-+ (uint32_t)(1 << (dev->pin % 32));
-+ }
-+ return MRAA_SUCCESS;
-+}
-+
-+static mraa_result_t
-+mraa_mtk_linkit_mmap_unsetup()
-+{
-+ if (mmap_reg == NULL) {
-+ syslog(LOG_ERR, "linkit mmap: null register can't unsetup");
-+ return MRAA_ERROR_INVALID_RESOURCE;
-+ }
-+ munmap(mmap_reg, mmap_size);
-+ mmap_reg = NULL;
-+ if (close(mmap_fd) != 0) {
-+ return MRAA_ERROR_INVALID_RESOURCE;
-+ }
-+ return MRAA_SUCCESS;
-+}
-+
-+int
-+mraa_mtk_linkit_mmap_read(mraa_gpio_context dev)
-+{
-+ uint32_t value = *(volatile uint32_t*) (mmap_reg + MT7628_GPIO_DATA + (dev->pin / 32) * 4);
-+ if (value & (uint32_t)(1 << (dev->pin % 32))) {
-+ return 1;
-+ }
-+ return 0;
-+}
-+
-+mraa_result_t
-+mraa_mtk_linkit_mmap_setup(mraa_gpio_context dev, mraa_boolean_t en)
-+{
-+ if (dev == NULL) {
-+ syslog(LOG_ERR, "linkit mmap: context not valid");
-+ return MRAA_ERROR_INVALID_HANDLE;
-+ }
-+
-+ if (en == 0) {
-+ if (dev->mmap_write == NULL && dev->mmap_read == NULL) {
-+ syslog(LOG_ERR, "linkit mmap: can't disable disabled mmap gpio");
-+ return MRAA_ERROR_INVALID_PARAMETER;
-+ }
-+ dev->mmap_write = NULL;
-+ dev->mmap_read = NULL;
-+ mmap_count--;
-+ if (mmap_count == 0) {
-+ return mraa_mtk_linkit_mmap_unsetup();
-+ }
-+ return MRAA_SUCCESS;
-+ }
-+
-+ if (dev->mmap_write != NULL && dev->mmap_read != NULL) {
-+ syslog(LOG_ERR, "linkit mmap: can't enable enabled mmap gpio");
-+ return MRAA_ERROR_INVALID_PARAMETER;
-+ }
-+
-+ // Might need to make some elements of this thread safe.
-+ // For example only allow one thread to enter the following block
-+ // to prevent mmap'ing twice.
-+ if (mmap_reg == NULL) {
-+ if ((mmap_fd = open(MMAP_PATH, O_RDWR)) < 0) {
-+ syslog(LOG_ERR, "linkit map: unable to open resource0 file");
-+ return MRAA_ERROR_INVALID_HANDLE;
-+ }
-+
-+ mmap_reg = (uint8_t*) mmap(NULL, MT7628_BLOCK_SIZE, PROT_READ | PROT_WRITE,
-+ MAP_FILE | MAP_SHARED, mmap_fd, MT7628_GPIO_BASE);
-+ if (mmap_reg == MAP_FAILED) {
-+ syslog(LOG_ERR, "linkit mmap: failed to mmap");
-+ mmap_reg = NULL;
-+ close(mmap_fd);
-+ return MRAA_ERROR_NO_RESOURCES;
-+ }
-+ }
-+ dev->mmap_write = &mraa_mtk_linkit_mmap_write;
-+ dev->mmap_read = &mraa_mtk_linkit_mmap_read;
-+ mmap_count++;
-+
-+ return MRAA_SUCCESS;
-+}
-+
-+mraa_board_t*
-+mraa_mtk_linkit()
-+{
-+ mraa_board_t* b = (mraa_board_t*) malloc(sizeof(mraa_board_t));
-+ if (b == NULL) {
-+ return NULL;
-+ }
-+
-+ b->platform_name = "LINKIT";
-+ platform_detected = PLATFORM_MEDIATEK_LINKIT;
-+ b->phy_pin_count = 31;
-+
-+ b->aio_count = 0;
-+ b->adc_raw = 0;
-+ b->adc_supported = 0;
-+ b->pwm_default_period = 500;
-+ b->pwm_max_period = 2147483;
-+ b->pwm_min_period = 1;
-+
-+ b->pins = (mraa_pininfo_t*) malloc(sizeof(mraa_pininfo_t) * b->phy_pin_count);
-+
-+ advance_func->gpio_mmap_setup = &mraa_mtk_linkit_mmap_setup;
-+
-+ strncpy(b->pins[0].name, "P0", MRAA_PIN_NAME_SIZE);
-+ b->pins[0].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
-+
-+ strncpy(b->pins[1].name, "P1", MRAA_PIN_NAME_SIZE);
-+ b->pins[1].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
-+
-+ strncpy(b->pins[2].name, "P2", MRAA_PIN_NAME_SIZE);
-+ b->pins[2].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
-+
-+ strncpy(b->pins[3].name, "P3", MRAA_PIN_NAME_SIZE);
-+ b->pins[3].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
-+
-+ strncpy(b->pins[4].name, "P4", MRAA_PIN_NAME_SIZE);
-+ b->pins[4].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
-+
-+ strncpy(b->pins[5].name, "P5", MRAA_PIN_NAME_SIZE);
-+ b->pins[5].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
-+
-+ strncpy(b->pins[6].name, "P6", MRAA_PIN_NAME_SIZE);
-+ b->pins[6].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
-+
-+ strncpy(b->pins[7].name, "P7", MRAA_PIN_NAME_SIZE);
-+ b->pins[7].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
-+
-+ strncpy(b->pins[8].name, "P8", MRAA_PIN_NAME_SIZE);
-+ b->pins[8].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
-+ b->pins[8].gpio.pinmap = 21;
-+ b->pins[8].uart.parent_id = 2;
-+ b->pins[8].uart.mux_total = 0;
-+
-+ strncpy(b->pins[9].name, "P9", MRAA_PIN_NAME_SIZE);
-+ b->pins[9].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
-+ b->pins[9].gpio.pinmap = 20;
-+ b->pins[9].uart.parent_id = 2;
-+ b->pins[9].uart.mux_total = 0;
-+
-+ strncpy(b->pins[10].name, "P10", MRAA_PIN_NAME_SIZE);
-+ b->pins[10].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
-+ b->pins[10].gpio.pinmap = 2;
-+
-+ strncpy(b->pins[11].name, "P11", MRAA_PIN_NAME_SIZE);
-+ b->pins[11].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
-+ b->pins[11].gpio.pinmap = 3;
-+
-+ strncpy(b->pins[12].name, "P12", MRAA_PIN_NAME_SIZE);
-+ b->pins[12].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
-+ b->pins[12].gpio.pinmap = 0;
-+
-+ strncpy(b->pins[13].name, "P13", MRAA_PIN_NAME_SIZE);
-+ b->pins[13].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
-+ b->pins[13].gpio.pinmap = 1;
-+
-+ strncpy(b->pins[14].name, "P14", MRAA_PIN_NAME_SIZE);
-+ b->pins[14].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
-+
-+ strncpy(b->pins[15].name, "P15", MRAA_PIN_NAME_SIZE);
-+ b->pins[15].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
-+ b->pins[15].gpio.pinmap = 44;
-+
-+ strncpy(b->pins[16].name, "P16", MRAA_PIN_NAME_SIZE);
-+ b->pins[16].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
-+ b->pins[16].gpio.pinmap = 46;
-+ b->pins[16].uart.parent_id = 1;
-+ b->pins[16].uart.mux_total = 0;
-+
-+ strncpy(b->pins[17].name, "P17", MRAA_PIN_NAME_SIZE);
-+ b->pins[17].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
-+ b->pins[17].gpio.pinmap = 45;
-+ b->pins[17].uart.parent_id = 1;
-+ b->pins[17].uart.mux_total = 0;
-+
-+ strncpy(b->pins[18].name, "P18", MRAA_PIN_NAME_SIZE);
-+ b->pins[18].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
-+ b->pins[18].gpio.pinmap = 13;
-+ b->pins[18].uart.parent_id = 1;
-+ b->pins[18].uart.mux_total = 0;
-+
-+ strncpy(b->pins[19].name, "P19", MRAA_PIN_NAME_SIZE);
-+ b->pins[19].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
-+ b->pins[19].gpio.pinmap = 12;
-+ b->pins[19].uart.parent_id = 0;
-+ b->pins[19].uart.mux_total = 0;
-+
-+ strncpy(b->pins[20].name, "P20", MRAA_PIN_NAME_SIZE);
-+ b->pins[20].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 1, 0, 0 };
-+ b->pins[20].gpio.pinmap = 5;
-+ b->pins[20].i2c.pinmap = 0;
-+ b->pins[20].i2c.mux_total = 0;
-+
-+ strncpy(b->pins[21].name, "P21", MRAA_PIN_NAME_SIZE);
-+ b->pins[21].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 1, 0, 0 };
-+ b->pins[21].gpio.pinmap = 4;
-+ b->pins[21].i2c.pinmap = 0;
-+ b->pins[21].i2c.mux_total = 0;
-+
-+ strncpy(b->pins[22].name, "P22", MRAA_PIN_NAME_SIZE);
-+ b->pins[22].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 1, 0, 0, 0 };
-+ b->pins[22].gpio.pinmap = 8;
-+ b->pins[22].spi.pinmap = 0;
-+ b->pins[22].spi.mux_total = 0;
-+
-+ strncpy(b->pins[23].name, "P23", MRAA_PIN_NAME_SIZE);
-+ b->pins[23].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 1, 0, 0, 0 };
-+ b->pins[23].gpio.pinmap = 9;
-+ b->pins[23].spi.pinmap = 0;
-+ b->pins[23].spi.mux_total = 0;
-+
-+ strncpy(b->pins[24].name, "P24", MRAA_PIN_NAME_SIZE);
-+ b->pins[24].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 1, 0, 0, 0 };
-+ b->pins[24].gpio.pinmap = 7;
-+ b->pins[24].spi.pinmap = 0;
-+ b->pins[24].spi.mux_total = 0;
-+
-+ strncpy(b->pins[25].name, "P25", MRAA_PIN_NAME_SIZE);
-+ b->pins[25].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 1, 0, 0, 0 };
-+ b->pins[25].gpio.pinmap = 6;
-+ b->pins[25].spi.pinmap = 0;
-+ b->pins[25].spi.mux_total = 0;
-+
-+ strncpy(b->pins[26].name, "P26", MRAA_PIN_NAME_SIZE);
-+ b->pins[26].capabilites = (mraa_pincapabilities_t){ 1, 1, 1, 0, 0, 0, 0, 0 };
-+ b->pins[26].gpio.pinmap = 18;
-+
-+ strncpy(b->pins[27].name, "P27", MRAA_PIN_NAME_SIZE);
-+ b->pins[27].capabilites = (mraa_pincapabilities_t){ 1, 1, 1, 0, 0, 0, 0, 0 };
-+ b->pins[27].gpio.pinmap = 19;
-+
-+ strncpy(b->pins[28].name, "P28", MRAA_PIN_NAME_SIZE);
-+ b->pins[28].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
-+ b->pins[28].gpio.pinmap = 16;
-+
-+ strncpy(b->pins[29].name, "P29", MRAA_PIN_NAME_SIZE);
-+ b->pins[29].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
-+ b->pins[29].gpio.pinmap = 17;
-+
-+ strncpy(b->pins[30].name, "P30", MRAA_PIN_NAME_SIZE);
-+ b->pins[30].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
-+ b->pins[30].gpio.pinmap = 14;
-+
-+ strncpy(b->pins[31].name, "P31", MRAA_PIN_NAME_SIZE);
-+ b->pins[31].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
-+ b->pins[31].gpio.pinmap = 15;
-+
-+ // BUS DEFINITIONS
-+ b->i2c_bus_count = 1;
-+ b->def_i2c_bus = 0;
-+ b->i2c_bus[0].bus_id = 0;
-+ b->i2c_bus[0].sda = 20;
-+ b->i2c_bus[0].scl = 21;
-+
-+ b->spi_bus_count = 1;
-+ b->def_spi_bus = 0;
-+ b->spi_bus[0].bus_id = 0;
-+ b->spi_bus[0].slave_s = 0;
-+ b->spi_bus[0].cs = 25;
-+ b->spi_bus[0].mosi = 22;
-+ b->spi_bus[0].miso = 23;
-+ b->spi_bus[0].sclk = 21;
-+
-+ b->uart_dev_count = 3;
-+ b->def_uart_dev = 0;
-+ b->uart_dev[0].rx = 18;
-+ b->uart_dev[0].tx = 19;
-+
-+ b->uart_dev[1].rx = 16;
-+ b->uart_dev[1].tx = 17;
-+
-+ b->uart_dev[2].rx = 9;
-+ b->uart_dev[2].tx = 8;
-+
-+ b->gpio_count = 0;
-+ int i;
-+ for (i = 0; i < b->phy_pin_count; i++) {
-+ if (b->pins[i].capabilites.gpio) {
-+ b->gpio_count++;
-+ }
-+ }
-+
-+ return b;
-+}
---- /dev/null
-+++ b/src/mips/mips.c
-@@ -0,0 +1,60 @@
-+/*
-+ * Author: Thomas Ingleby <thomas.c.ingleby@intel.com>
-+ * Author: Michael Ring <mail@michael-ring.org>
-+ * Copyright (c) 2014 Intel Corporation.
-+ *
-+ * Permission is hereby granted, free of charge, to any person obtaining
-+ * a copy of this software and associated documentation files (the
-+ * "Software"), to deal in the Software without restriction, including
-+ * without limitation the rights to use, copy, modify, merge, publish,
-+ * distribute, sublicense, and/or sell copies of the Software, and to
-+ * permit persons to whom the Software is furnished to do so, subject to
-+ * the following conditions:
-+ *
-+ * The above copyright notice and this permission notice shall be
-+ * included in all copies or substantial portions of the Software.
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-+ */
-+
-+#include <stdlib.h>
-+#include <string.h>
-+
-+#include "mraa_internal.h"
-+#include "mips/mediatek.h"
-+
-+mraa_platform_t
-+mraa_mips_platform()
-+{
-+ mraa_platform_t platform_type = MRAA_UNKNOWN_PLATFORM;
-+ size_t len = 100;
-+ char* line = malloc(len);
-+ FILE* fh = fopen("/proc/cpuinfo", "r");
-+ if (fh != NULL) {
-+ while (getline(&line, &len, fh) != -1) {
-+ if (strncmp(line, "machine", 7) == 0) {
-+ if (strstr(line, "MediaTek LinkIt Smart 7688")) {
-+ platform_type = MRAA_MTK_LINKIT;
-+ }
-+ }
-+ }
-+ fclose(fh);
-+ }
-+ free(line);
-+
-+ switch (platform_type) {
-+ case MRAA_MTK_LINKIT:
-+ plat = mraa_mtk_linkit();
-+ break;
-+ default:
-+ plat = NULL;
-+ syslog(LOG_ERR, "Unknown Platform, currently not supported by MRAA");
-+ }
-+ return platform_type;
-+}
+++ /dev/null
-From 9540f9b93704e8e80ab2048954ca88d8e6eddf86 Mon Sep 17 00:00:00 2001
-From: John Crispin <blogic@openwrt.org>
-Date: Thu, 23 Jul 2015 16:43:42 +0200
-Subject: [PATCH 3/4] uart
-
----
- src/uart/uart.c | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/src/uart/uart.c b/src/uart/uart.c
-index 3ef55a4..5102f81 100644
---- a/src/uart/uart.c
-+++ b/src/uart/uart.c
-@@ -34,6 +34,9 @@
- #include "uart.h"
- #include "mraa_internal.h"
-
-+#ifndef CMSPAR
-+#define CMSPAR 010000000000
-+#endif
- // This function takes an unsigned int and converts it to a B* speed_t
- // that can be used with linux/posix termios
- static speed_t
---
-1.7.10.4
-
+++ /dev/null
-From 3c34e5f87a741ec2fc7809fc8c169a832275d32c Mon Sep 17 00:00:00 2001
-From: John Crispin <blogic@openwrt.org>
-Date: Thu, 23 Jul 2015 18:19:32 +0200
-Subject: [PATCH 4/4] fixes
-
----
- src/mips/mediatek.c | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
-
---- a/src/mips/mediatek.c
-+++ b/src/mips/mediatek.c
-@@ -37,12 +37,12 @@
- #define PLATFORM_MEDIATEK_LINKIT 1
- #define PLATFORM_MEDIATEK_LINKIT_AIR 2
- #define MMAP_PATH "/dev/mem"
--#define MT7628_GPIO_BASE 0x100
--#define MT7628_BLOCK_SIZE (4 * 1024)
--#define MT7628_GPIO_CTRL 0x00
--#define MT7628_GPIO_DATA 0x20
--#define MT7628_GPIO_SET 0x30
--#define MT7628_GPIO_CLEAR 0x40
-+#define MT7628_GPIOMODE_BASE 0x10000000
-+#define MT7628_BLOCK_SIZE 0x1000
-+#define MT7628_GPIO_CTRL 0x600
-+#define MT7628_GPIO_DATA 0x620
-+#define MT7628_GPIO_SET 0x630
-+#define MT7628_GPIO_CLEAR 0x640
-
- #define MAX_SIZE 64
-
-@@ -50,6 +50,9 @@
- static uint8_t* mmap_reg = NULL;
- static int mmap_fd = 0;
- static int mmap_size;
-+static uint8_t* gpio_mmap_reg = NULL;
-+static int gpio_mmap_fd = 0;
-+static int gpio_mmap_size;
- static unsigned int mmap_count = 0;
- static int platform_detected = 0;
-
-@@ -129,9 +132,10 @@
- }
-
- mmap_reg = (uint8_t*) mmap(NULL, MT7628_BLOCK_SIZE, PROT_READ | PROT_WRITE,
-- MAP_FILE | MAP_SHARED, mmap_fd, MT7628_GPIO_BASE);
-+ MAP_FILE | MAP_SHARED, mmap_fd, 0x10000000);
- if (mmap_reg == MAP_FAILED) {
-- syslog(LOG_ERR, "linkit mmap: failed to mmap");
-+ perror("foo");
-+ syslog(LOG_ERR, "linkit mmap: failed to mmap");
- mmap_reg = NULL;
- close(mmap_fd);
- return MRAA_ERROR_NO_RESOURCES;
-@@ -144,201 +148,442 @@
- return MRAA_SUCCESS;
- }
-
-+static int mmap_gpiomode(void)
-+{
-+ if ((gpio_mmap_fd = open(MMAP_PATH, O_RDWR)) < 0) {
-+ syslog(LOG_ERR, "linkit map: unable to open resource0 file");
-+ return MRAA_ERROR_INVALID_HANDLE;
-+ }
-+
-+ gpio_mmap_reg = (uint8_t*) mmap(NULL, MT7628_BLOCK_SIZE, PROT_READ | PROT_WRITE,
-+ MAP_FILE | MAP_SHARED, gpio_mmap_fd, MT7628_GPIOMODE_BASE);
-+ if (gpio_mmap_reg == MAP_FAILED) {
-+ syslog(LOG_ERR, "linkit gpio_mmap: failed to mmap");
-+ gpio_mmap_reg = NULL;
-+ close(gpio_mmap_fd);
-+ return MRAA_ERROR_NO_RESOURCES;
-+ }
-+ return 0;
-+}
-+
-+static void set_gpiomode(unsigned int mask, unsigned int shift, unsigned int val)
-+{
-+ unsigned int reg;
-+ unsigned int offset = 0x60;
-+
-+ if (shift >= 32) {
-+ shift -= 32;
-+ offset += 4;
-+ }
-+
-+ reg = *(volatile uint32_t*) (gpio_mmap_reg + offset);
-+
-+ reg &= ~(mask << shift);
-+ reg |= (val << shift);
-+ *(volatile uint32_t*) (gpio_mmap_reg + offset) = reg;
-+}
-+
-+enum {
-+ MUX_GPIO = 0,
-+ MUX_SPI_S,
-+ MUX_SPI_CS1,
-+ MUX_I2S,
-+ MUX_UART0,
-+ MUX_I2C,
-+ MUX_UART1,
-+ MUX_UART2,
-+ MUX_PWM0,
-+ MUX_PWM1,
-+ MUX_EPHY,
-+ MUX_WLED,
-+ __MUX_MAX,
-+};
-+
-+static unsigned char gpio_mux_groups[64];
-+static struct pinmux {
-+ char *name;
-+ char *func[4];
-+ unsigned int shift;
-+ unsigned int mask;
-+} mt7688_mux[] = {
-+ {
-+ .name = "refclk",
-+ .func = { "refclk", "gpio", NULL, NULL },
-+ .shift = 18,
-+ .mask = 0x1,
-+ }, {
-+ .name = "spi_s",
-+ .func = { "spi_s", "gpio", "utif", "pwm" },
-+ .shift = 2,
-+ .mask = 0x3,
-+ }, {
-+ .name = "spi_cs1",
-+ .func = { "spi_cs1", "gpio", NULL, "refclk" },
-+ .shift = 4,
-+ .mask = 0x3,
-+ }, {
-+ .name = "i2s",
-+ .func = { "i2s", "gpio", "pcm", NULL },
-+ .shift = 6,
-+ .mask = 0x3,
-+ }, {
-+ .name = "uart0",
-+ .func = { "uart", "gpio", NULL, NULL },
-+ .shift = 8,
-+ .mask = 0x3,
-+ }, {
-+ .name = "i2c",
-+ .func = { "i2c", "gpio", NULL, NULL },
-+ .shift = 20,
-+ .mask = 0x3,
-+ }, {
-+ .name = "uart1",
-+ .func = { "uart", "gpio", NULL, NULL },
-+ .shift = 24,
-+ .mask = 0x3,
-+ }, {
-+ .name = "uart2",
-+ .func = { "uart", "gpio", "pwm", NULL },
-+ .shift = 26,
-+ .mask = 0x3,
-+ }, {
-+ .name = "pwm0",
-+ .func = { "pwm", "gpio", NULL, NULL },
-+ .shift = 28,
-+ .mask = 0x3,
-+ }, {
-+ .name = "pwm1",
-+ .func = { "pwm", "gpio", NULL, NULL },
-+ .shift = 30,
-+ .mask = 0x3,
-+ }, {
-+ .name = "ephy",
-+ .func = { "ephy", "gpio", NULL, NULL },
-+ .shift = 34,
-+ .mask = 0x3,
-+ }, {
-+ .name = "wled",
-+ .func = { "wled", "gpio", NULL, NULL },
-+ .shift = 32,
-+ .mask = 0x3,
-+ },
-+};
-+
-+mraa_result_t gpio_init_pre(int pin)
-+{
-+ struct pinmux *m = &mt7688_mux[gpio_mux_groups[pin]];
-+
-+ set_gpiomode(m->mask, m->shift, 1);
-+
-+ return 0;
-+}
-+
-+static void gpiomode_set(unsigned int id, char *name)
-+{
-+ int i;
-+
-+ if (id >= __MUX_MAX)
-+ return;
-+
-+ for (i = 0; i < 4; i++) {
-+ if (!mt7688_mux[id].func[i] || strcmp(mt7688_mux[id].func[i], name))
-+ continue;
-+ set_gpiomode(mt7688_mux[id].mask, mt7688_mux[id].shift, i);
-+ syslog(0, "mraa: set pinmux %s -> %s\n", mt7688_mux[id].name, name);
-+ return;
-+ }
-+}
-+
-+mraa_result_t i2c_init_pre(unsigned int bus)
-+{
-+ gpiomode_set(MUX_I2C, "i2c");
-+ return 0;
-+}
-+
-+mraa_result_t
-+pwm_init_post(mraa_pwm_context pwm)
-+{
-+ switch(pwm->pin) {
-+ case 0:
-+ gpiomode_set(MUX_PWM0, "pwm");
-+ break;
-+ case 1:
-+ gpiomode_set(MUX_PWM1, "pwm");
-+ break;
-+ case 2:
-+ case 3:
-+ gpiomode_set(MUX_UART2, "pwm");
-+ break;
-+ }
-+ return 0;
-+}
-+
-+mraa_result_t spi_init_pre(int bus)
-+{
-+ gpiomode_set(MUX_SPI_CS1, "spi_cs1");
-+ return 0;
-+}
-+
-+mraa_result_t uart_init_pre(int index)
-+{
-+ switch(index) {
-+ case 0:
-+ gpiomode_set(MUX_UART0, "uart");
-+ break;
-+ case 1:
-+ gpiomode_set(MUX_UART1, "uart");
-+ break;
-+ case 2:
-+ gpiomode_set(MUX_UART2, "uart");
-+ break;
-+ }
-+ return 0;
-+}
-+
-+mraa_result_t
-+i2c_freq(mraa_i2c_context dev, mraa_i2c_mode_t mode)
-+{
-+ switch (mode) {
-+ case MRAA_I2C_STD:
-+ break;
-+ default:
-+ syslog(LOG_ERR, "Invalid i2c frequency");
-+ break;
-+ }
-+ return MRAA_SUCCESS;
-+}
-+
-+
- mraa_board_t*
- mraa_mtk_linkit()
- {
-+ int i;
-+
-+ if (mmap_gpiomode())
-+ return NULL;
-+
- mraa_board_t* b = (mraa_board_t*) malloc(sizeof(mraa_board_t));
- if (b == NULL) {
- return NULL;
- }
-
-- b->platform_name = "LINKIT";
-+ memset(b, 0, sizeof(mraa_board_t));
-+
-+ b->platform_name = "LinkIt Smart 7688";
- platform_detected = PLATFORM_MEDIATEK_LINKIT;
-- b->phy_pin_count = 31;
-+ b->phy_pin_count = 64;
-
- b->aio_count = 0;
- b->adc_raw = 0;
- b->adc_supported = 0;
- b->pwm_default_period = 500;
-- b->pwm_max_period = 2147483;
-+ b->pwm_max_period = 1000000;
- b->pwm_min_period = 1;
-
-- b->pins = (mraa_pininfo_t*) malloc(sizeof(mraa_pininfo_t) * b->phy_pin_count);
--
-- advance_func->gpio_mmap_setup = &mraa_mtk_linkit_mmap_setup;
--
-- strncpy(b->pins[0].name, "P0", MRAA_PIN_NAME_SIZE);
-- b->pins[0].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
--
-- strncpy(b->pins[1].name, "P1", MRAA_PIN_NAME_SIZE);
-- b->pins[1].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
--
-- strncpy(b->pins[2].name, "P2", MRAA_PIN_NAME_SIZE);
-- b->pins[2].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
--
-- strncpy(b->pins[3].name, "P3", MRAA_PIN_NAME_SIZE);
-- b->pins[3].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
--
-- strncpy(b->pins[4].name, "P4", MRAA_PIN_NAME_SIZE);
-- b->pins[4].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
--
-- strncpy(b->pins[5].name, "P5", MRAA_PIN_NAME_SIZE);
-- b->pins[5].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
--
-- strncpy(b->pins[6].name, "P6", MRAA_PIN_NAME_SIZE);
-- b->pins[6].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
--
-- strncpy(b->pins[7].name, "P7", MRAA_PIN_NAME_SIZE);
-- b->pins[7].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
--
-- strncpy(b->pins[8].name, "P8", MRAA_PIN_NAME_SIZE);
-- b->pins[8].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
-- b->pins[8].gpio.pinmap = 21;
-- b->pins[8].uart.parent_id = 2;
-- b->pins[8].uart.mux_total = 0;
-+ b->adv_func = (mraa_adv_func_t*) calloc(1, sizeof(mraa_adv_func_t));
-+ if (b->adv_func == NULL) {
-+ return NULL;
-+ }
-
-- strncpy(b->pins[9].name, "P9", MRAA_PIN_NAME_SIZE);
-- b->pins[9].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
-- b->pins[9].gpio.pinmap = 20;
-- b->pins[9].uart.parent_id = 2;
-- b->pins[9].uart.mux_total = 0;
-+ b->adv_func->i2c_init_pre = i2c_init_pre;
-+ b->adv_func->pwm_init_post = pwm_init_post;
-+ b->adv_func->spi_init_pre = spi_init_pre;
-+ b->adv_func->uart_init_pre = uart_init_pre;
-+ b->adv_func->gpio_init_pre = gpio_init_pre;
-+ b->adv_func->i2c_set_frequency_replace = &i2c_freq;
-
-- strncpy(b->pins[10].name, "P10", MRAA_PIN_NAME_SIZE);
-- b->pins[10].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
-- b->pins[10].gpio.pinmap = 2;
-+ b->pins = (mraa_pininfo_t*) malloc(sizeof(mraa_pininfo_t) * b->phy_pin_count);
-
-- strncpy(b->pins[11].name, "P11", MRAA_PIN_NAME_SIZE);
-- b->pins[11].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
-- b->pins[11].gpio.pinmap = 3;
-+ memset(b->pins, 0, sizeof(mraa_pininfo_t) * b->phy_pin_count);
-+ memset(gpio_mux_groups, -1, sizeof(gpio_mux_groups));
-
-- strncpy(b->pins[12].name, "P12", MRAA_PIN_NAME_SIZE);
-- b->pins[12].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
-- b->pins[12].gpio.pinmap = 0;
-+ b->adv_func->gpio_mmap_setup = &mraa_mtk_linkit_mmap_setup;
-
-- strncpy(b->pins[13].name, "P13", MRAA_PIN_NAME_SIZE);
-- b->pins[13].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
-- b->pins[13].gpio.pinmap = 1;
-+ for (i = 0; i < b->phy_pin_count; i++) {
-+ snprintf(b->pins[i].name, MRAA_PIN_NAME_SIZE, "GPIO%d", i);
-+ b->pins[i].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
-+ }
-
-- strncpy(b->pins[14].name, "P14", MRAA_PIN_NAME_SIZE);
-- b->pins[14].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
-+ strncpy(b->pins[43].name, "GPIO43", MRAA_PIN_NAME_SIZE);
-+ b->pins[43].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
-+ b->pins[43].gpio.pinmap = 43;
-+ gpio_mux_groups[43] = MUX_EPHY;
-+
-+ strncpy(b->pins[20].name, "GPIO20", MRAA_PIN_NAME_SIZE);
-+ b->pins[20].capabilites = (mraa_pincapabilities_t){ 1, 1, 1, 0, 0, 0, 0, 1 };
-+ b->pins[20].gpio.pinmap = 20;
-+ b->pins[20].uart.parent_id = 2;
-+ b->pins[20].uart.mux_total = 0;
-+ b->pins[20].pwm.parent_id = 0;
-+ b->pins[20].pwm.pinmap = 2;
-+ gpio_mux_groups[20] = MUX_UART2;
-+
-+ strncpy(b->pins[21].name, "GPIO21", MRAA_PIN_NAME_SIZE);
-+ b->pins[21].capabilites = (mraa_pincapabilities_t){ 1, 1, 1, 0, 0, 0, 0, 1 };
-+ b->pins[21].gpio.pinmap = 21;
-+ b->pins[21].uart.parent_id = 2;
-+ b->pins[21].uart.mux_total = 0;
-+ b->pins[21].pwm.parent_id = 0;
-+ b->pins[21].pwm.pinmap = 3;
-+ gpio_mux_groups[21] = MUX_UART2;
-+
-+ strncpy(b->pins[2].name, "GPIO2", MRAA_PIN_NAME_SIZE);
-+ b->pins[2].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
-+ b->pins[2].gpio.pinmap = 2;
-+ gpio_mux_groups[2] = MUX_I2S;
-+
-+ strncpy(b->pins[3].name, "GPIO3", MRAA_PIN_NAME_SIZE);
-+ b->pins[3].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
-+ b->pins[3].gpio.pinmap = 3;
-+ gpio_mux_groups[3] = MUX_I2S;
-+
-+ strncpy(b->pins[0].name, "GPIO0", MRAA_PIN_NAME_SIZE);
-+ b->pins[0].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
-+ b->pins[0].gpio.pinmap = 0;
-+ gpio_mux_groups[0] = MUX_I2S;
-+
-+ strncpy(b->pins[1].name, "GPIO1", MRAA_PIN_NAME_SIZE);
-+ b->pins[1].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
-+ b->pins[1].gpio.pinmap = 1;
-+ gpio_mux_groups[1] = MUX_I2S;
-+
-+ strncpy(b->pins[37].name, "GPIO37", MRAA_PIN_NAME_SIZE);
-+ b->pins[37].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
-+ b->pins[37].gpio.pinmap = 37;
-+ gpio_mux_groups[37] = MUX_GPIO;
-+
-+ strncpy(b->pins[44].name, "GPIO44", MRAA_PIN_NAME_SIZE);
-+ b->pins[44].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
-+ b->pins[44].gpio.pinmap = 44;
-+ gpio_mux_groups[44] = MUX_WLED;
-+
-+ strncpy(b->pins[46].name, "GPIO46", MRAA_PIN_NAME_SIZE);
-+ b->pins[46].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
-+ b->pins[46].gpio.pinmap = 46;
-+ b->pins[46].uart.parent_id = 1;
-+ b->pins[46].uart.mux_total = 0;
-+ gpio_mux_groups[46] = MUX_UART1;
-+
-+ strncpy(b->pins[45].name, "GPIO45", MRAA_PIN_NAME_SIZE);
-+ b->pins[45].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
-+ b->pins[45].gpio.pinmap = 45;
-+ b->pins[45].uart.parent_id = 1;
-+ b->pins[45].uart.mux_total = 0;
-+ gpio_mux_groups[45] = MUX_UART1;
-+
-+ strncpy(b->pins[13].name, "GPIO13", MRAA_PIN_NAME_SIZE);
-+ b->pins[13].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
-+ b->pins[13].gpio.pinmap = 13;
-+ b->pins[13].uart.parent_id = 1;
-+ b->pins[13].uart.mux_total = 0;
-+ gpio_mux_groups[13] = MUX_UART0;
-+
-+ strncpy(b->pins[12].name, "GPIO12", MRAA_PIN_NAME_SIZE);
-+ b->pins[12].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
-+ b->pins[12].gpio.pinmap = 12;
-+ b->pins[12].uart.parent_id = 0;
-+ b->pins[12].uart.mux_total = 0;
-+ gpio_mux_groups[12] = MUX_UART0;
-+
-+ strncpy(b->pins[5].name, "GPIO5", MRAA_PIN_NAME_SIZE);
-+ b->pins[5].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 1, 0, 0 };
-+ b->pins[5].gpio.pinmap = 5;
-+ b->pins[5].i2c.pinmap = 0;
-+ b->pins[5].i2c.mux_total = 0;
-+ gpio_mux_groups[5] = MUX_I2C;
-+
-+ strncpy(b->pins[4].name, "GPIO4", MRAA_PIN_NAME_SIZE);
-+ b->pins[4].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 1, 0, 0 };
-+ b->pins[4].gpio.pinmap = 4;
-+ b->pins[4].i2c.pinmap = 0;
-+ b->pins[4].i2c.mux_total = 0;
-+ gpio_mux_groups[4] = MUX_I2C;
-+
-+ strncpy(b->pins[6].name, "GPIO6", MRAA_PIN_NAME_SIZE);
-+ b->pins[6].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 1, 0, 0, 0 };
-+ b->pins[6].gpio.pinmap = 6;
-+ b->pins[6].spi.pinmap = 0;
-+ b->pins[6].spi.mux_total = 0;
-+ gpio_mux_groups[6] = MUX_SPI_CS1;
-+
-+ strncpy(b->pins[7].name, "GPIO7", MRAA_PIN_NAME_SIZE);
-+ b->pins[7].capabilites = (mraa_pincapabilities_t){ 1, 0, 0, 0, 1, 0, 0, 0 };
-+ b->pins[7].spi.pinmap = 0;
-+ b->pins[7].spi.mux_total = 0;
-+
-+ strncpy(b->pins[8].name, "GPIO8", MRAA_PIN_NAME_SIZE);
-+ b->pins[8].capabilites = (mraa_pincapabilities_t){ 1, 0, 0, 0, 1, 0, 0, 0 };
-+ b->pins[8].spi.pinmap = 0;
-+ b->pins[8].spi.mux_total = 0;
-+
-+ strncpy(b->pins[9].name, "GPIO9", MRAA_PIN_NAME_SIZE);
-+ b->pins[9].capabilites = (mraa_pincapabilities_t){ 1, 0, 0, 0, 1, 0, 0, 0 };
-+ b->pins[9].spi.pinmap = 0;
-+ b->pins[9].spi.mux_total = 0;
-+
-+ strncpy(b->pins[18].name, "GPIO18", MRAA_PIN_NAME_SIZE);
-+ b->pins[18].capabilites = (mraa_pincapabilities_t){ 1, 1, 1, 0, 0, 0, 0, 0 };
-+ b->pins[18].gpio.pinmap = 18;
-+ b->pins[18].pwm.parent_id = 0;
-+ b->pins[18].pwm.pinmap = 0;
-+ gpio_mux_groups[18] = MUX_PWM0;
-+
-+ strncpy(b->pins[19].name, "GPIO19", MRAA_PIN_NAME_SIZE);
-+ b->pins[19].capabilites = (mraa_pincapabilities_t){ 1, 1, 1, 0, 0, 0, 0, 0 };
-+ b->pins[19].gpio.pinmap = 19;
-+ b->pins[19].pwm.parent_id = 0;
-+ b->pins[19].pwm.pinmap = 1;
-+ gpio_mux_groups[19] = MUX_PWM1;
-+
-+ strncpy(b->pins[16].name, "GPIO16", MRAA_PIN_NAME_SIZE);
-+ b->pins[16].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
-+ b->pins[16].gpio.pinmap = 16;
-+ gpio_mux_groups[16] = MUX_SPI_S;
-+
-+ strncpy(b->pins[17].name, "GPIO17", MRAA_PIN_NAME_SIZE);
-+ b->pins[17].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
-+ b->pins[17].gpio.pinmap = 17;
-+ gpio_mux_groups[17] = MUX_SPI_S;
-+
-+ strncpy(b->pins[14].name, "GPIO14", MRAA_PIN_NAME_SIZE);
-+ b->pins[14].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
-+ b->pins[14].gpio.pinmap = 14;
-+ gpio_mux_groups[14] = MUX_SPI_S;
-
-- strncpy(b->pins[15].name, "P15", MRAA_PIN_NAME_SIZE);
-+ strncpy(b->pins[15].name, "GPIO15", MRAA_PIN_NAME_SIZE);
- b->pins[15].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
-- b->pins[15].gpio.pinmap = 44;
--
-- strncpy(b->pins[16].name, "P16", MRAA_PIN_NAME_SIZE);
-- b->pins[16].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
-- b->pins[16].gpio.pinmap = 46;
-- b->pins[16].uart.parent_id = 1;
-- b->pins[16].uart.mux_total = 0;
--
-- strncpy(b->pins[17].name, "P17", MRAA_PIN_NAME_SIZE);
-- b->pins[17].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
-- b->pins[17].gpio.pinmap = 45;
-- b->pins[17].uart.parent_id = 1;
-- b->pins[17].uart.mux_total = 0;
--
-- strncpy(b->pins[18].name, "P18", MRAA_PIN_NAME_SIZE);
-- b->pins[18].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
-- b->pins[18].gpio.pinmap = 13;
-- b->pins[18].uart.parent_id = 1;
-- b->pins[18].uart.mux_total = 0;
--
-- strncpy(b->pins[19].name, "P19", MRAA_PIN_NAME_SIZE);
-- b->pins[19].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
-- b->pins[19].gpio.pinmap = 12;
-- b->pins[19].uart.parent_id = 0;
-- b->pins[19].uart.mux_total = 0;
--
-- strncpy(b->pins[20].name, "P20", MRAA_PIN_NAME_SIZE);
-- b->pins[20].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 1, 0, 0 };
-- b->pins[20].gpio.pinmap = 5;
-- b->pins[20].i2c.pinmap = 0;
-- b->pins[20].i2c.mux_total = 0;
--
-- strncpy(b->pins[21].name, "P21", MRAA_PIN_NAME_SIZE);
-- b->pins[21].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 1, 0, 0 };
-- b->pins[21].gpio.pinmap = 4;
-- b->pins[21].i2c.pinmap = 0;
-- b->pins[21].i2c.mux_total = 0;
--
-- strncpy(b->pins[22].name, "P22", MRAA_PIN_NAME_SIZE);
-- b->pins[22].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 1, 0, 0, 0 };
-- b->pins[22].gpio.pinmap = 8;
-- b->pins[22].spi.pinmap = 0;
-- b->pins[22].spi.mux_total = 0;
--
-- strncpy(b->pins[23].name, "P23", MRAA_PIN_NAME_SIZE);
-- b->pins[23].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 1, 0, 0, 0 };
-- b->pins[23].gpio.pinmap = 9;
-- b->pins[23].spi.pinmap = 0;
-- b->pins[23].spi.mux_total = 0;
--
-- strncpy(b->pins[24].name, "P24", MRAA_PIN_NAME_SIZE);
-- b->pins[24].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 1, 0, 0, 0 };
-- b->pins[24].gpio.pinmap = 7;
-- b->pins[24].spi.pinmap = 0;
-- b->pins[24].spi.mux_total = 0;
--
-- strncpy(b->pins[25].name, "P25", MRAA_PIN_NAME_SIZE);
-- b->pins[25].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 1, 0, 0, 0 };
-- b->pins[25].gpio.pinmap = 6;
-- b->pins[25].spi.pinmap = 0;
-- b->pins[25].spi.mux_total = 0;
--
-- strncpy(b->pins[26].name, "P26", MRAA_PIN_NAME_SIZE);
-- b->pins[26].capabilites = (mraa_pincapabilities_t){ 1, 1, 1, 0, 0, 0, 0, 0 };
-- b->pins[26].gpio.pinmap = 18;
--
-- strncpy(b->pins[27].name, "P27", MRAA_PIN_NAME_SIZE);
-- b->pins[27].capabilites = (mraa_pincapabilities_t){ 1, 1, 1, 0, 0, 0, 0, 0 };
-- b->pins[27].gpio.pinmap = 19;
--
-- strncpy(b->pins[28].name, "P28", MRAA_PIN_NAME_SIZE);
-- b->pins[28].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
-- b->pins[28].gpio.pinmap = 16;
--
-- strncpy(b->pins[29].name, "P29", MRAA_PIN_NAME_SIZE);
-- b->pins[29].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
-- b->pins[29].gpio.pinmap = 17;
--
-- strncpy(b->pins[30].name, "P30", MRAA_PIN_NAME_SIZE);
-- b->pins[30].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
-- b->pins[30].gpio.pinmap = 14;
--
-- strncpy(b->pins[31].name, "P31", MRAA_PIN_NAME_SIZE);
-- b->pins[31].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
-- b->pins[31].gpio.pinmap = 15;
-+ b->pins[15].gpio.pinmap = 15;
-+ gpio_mux_groups[15] = MUX_SPI_S;
-
- // BUS DEFINITIONS
- b->i2c_bus_count = 1;
- b->def_i2c_bus = 0;
-- b->i2c_bus[0].bus_id = 0;
-- b->i2c_bus[0].sda = 20;
-- b->i2c_bus[0].scl = 21;
-+ b->i2c_bus[0].bus_id = 0;
-+ b->i2c_bus[0].sda = 5;
-+ b->i2c_bus[0].scl = 4;
-
- b->spi_bus_count = 1;
- b->def_spi_bus = 0;
-- b->spi_bus[0].bus_id = 0;
-- b->spi_bus[0].slave_s = 0;
-- b->spi_bus[0].cs = 25;
-- b->spi_bus[0].mosi = 22;
-- b->spi_bus[0].miso = 23;
-- b->spi_bus[0].sclk = 21;
-+ b->spi_bus[0].bus_id = 32766;
-+ b->spi_bus[0].slave_s = 1;
-+ b->spi_bus[0].cs = 6;
-+ b->spi_bus[0].mosi = 8;
-+ b->spi_bus[0].miso = 9;
-+ b->spi_bus[0].sclk = 7;
-
- b->uart_dev_count = 3;
- b->def_uart_dev = 0;
-- b->uart_dev[0].rx = 18;
-- b->uart_dev[0].tx = 19;
--
-- b->uart_dev[1].rx = 16;
-- b->uart_dev[1].tx = 17;
--
-- b->uart_dev[2].rx = 9;
-- b->uart_dev[2].tx = 8;
-+ b->uart_dev[0].rx = 13;
-+ b->uart_dev[0].tx = 12;
-+ b->uart_dev[0].device_path = "/dev/ttyS0";
-+ b->uart_dev[1].rx = 46;
-+ b->uart_dev[1].tx = 45;
-+ b->uart_dev[1].device_path = "/dev/ttyS1";
-+ b->uart_dev[2].rx = 21;
-+ b->uart_dev[2].tx = 20;
-+ b->uart_dev[2].device_path = "/dev/ttyS2";
-
- b->gpio_count = 0;
-- int i;
- for (i = 0; i < b->phy_pin_count; i++) {
- if (b->pins[i].capabilites.gpio) {
- b->gpio_count++;
---- a/src/gpio/gpio.c
-+++ b/src/gpio/gpio.c
-@@ -113,6 +113,8 @@
- close(export);
- }
-
-+ mraa_gpio_use_mmaped(dev, 1);
-+
- init_internal_cleanup:
- if (status != MRAA_SUCCESS) {
- if (dev != NULL)
PKG_NAME:=libndpi
PKG_VERSION:=2.4
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/ntop/nDPI/tar.gz/$(PKG_VERSION)?
PKG_LICENSE:=LGPLv3
PKG_FIXUP:=autoreconf
+PKG_BUILD_DEPENDS:=libpcap
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
endef
define Package/libndpi/description
- nDPI is an open source LGPLv3 library for deep-packet inspection.
+ nDPI is an open source LGPLv3 library for deep-packet inspection.
Based on OpenDPI it includes ntop extensions.
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include/
$(CP) \
- $(PKG_INSTALL_DIR)/usr/include/ndpi \
+ $(PKG_INSTALL_DIR)/usr/local/include/ndpi \
$(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) \
- $(PKG_INSTALL_DIR)/usr/lib/libndpi.so* \
+ $(PKG_INSTALL_DIR)/usr/local/lib/libndpi.so \
$(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) \
- $(PKG_INSTALL_DIR)/usr/local/libdata/pkgconfig/libndpi.pc \
+ $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libndpi.pc \
$(1)/usr/lib/pkgconfig/
endef
define Package/libndpi/install
$(INSTALL_DIR) $(1)/usr/lib/
$(CP) \
- $(PKG_INSTALL_DIR)/usr/lib/libndpi.so* \
+ $(PKG_INSTALL_DIR)/usr/local/lib/libndpi.so \
$(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/bin/
$(CP) \
- $(PKG_INSTALL_DIR)/usr/local/bin/ndpiReader \
+ $(PKG_INSTALL_DIR)/usr/bin/ndpiReader \
$(1)/usr/bin/
endef
--- /dev/null
+From 91ac4e4beed953fc9d2185ca2e6813dde47e8d5a Mon Sep 17 00:00:00 2001
+From: Guido Falsi <mad@madpilot.net>
+Date: Mon, 27 Aug 2018 17:52:56 +0200
+Subject: [PATCH 1/9] Move the configure include file inclusion and code
+ depending on it in code protected by the NDPI_LIB_COMPILATION define, this
+ should avoid it polluting the environment when including this file from
+ ntopng, version against stable branch.
+
+---
+ src/include/ndpi_typedefs.h | 15 ++++++++++-----
+ src/lib/ndpi_main.c | 7 -------
+ 2 files changed, 10 insertions(+), 12 deletions(-)
+
+diff --git a/src/include/ndpi_typedefs.h b/src/include/ndpi_typedefs.h
+index 6a61b44..386b217 100644
+--- a/src/include/ndpi_typedefs.h
++++ b/src/include/ndpi_typedefs.h
+@@ -26,9 +26,6 @@
+
+ #include "ndpi_define.h"
+
+-/* Needed to have access to HAVE_* defines */
+-#include "ndpi_config.h"
+-
+ /* NDPI_LOG_LEVEL */
+ typedef enum {
+ NDPI_LOG_ERROR,
+@@ -854,7 +851,17 @@ typedef struct ndpi_proto {
+ #define NUM_CUSTOM_CATEGORIES 5
+ #define CUSTOM_CATEGORY_LABEL_LEN 32
+
++#ifdef NDPI_LIB_COMPILATION
++
++/* Needed to have access to HAVE_* defines */
++#include "ndpi_define.h"
++
+ #ifdef HAVE_HYPERSCAN
++struct hs {
++ hs_database_t *database;
++ hs_scratch_t *scratch;
++};
++
+ struct hs_list {
+ char *expression;
+ unsigned int id;
+@@ -862,8 +869,6 @@ struct hs_list {
+ };
+ #endif
+
+-#ifdef NDPI_LIB_COMPILATION
+-
+ struct ndpi_detection_module_struct {
+ NDPI_PROTOCOL_BITMASK detection_bitmask;
+ NDPI_PROTOCOL_BITMASK generic_http_packet_bitmask;
+diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c
+index b002126..8061aa1 100644
+--- a/src/lib/ndpi_main.c
++++ b/src/lib/ndpi_main.c
+@@ -51,13 +51,6 @@
+ #include <hs/hs.h>
+ #endif
+
+-#ifdef HAVE_HYPERSCAN
+-struct hs {
+- hs_database_t *database;
+- hs_scratch_t *scratch;
+-};
+-#endif
+-
+ #define NDPI_CONST_GENERIC_PROTOCOL_NAME "GenericProtocol"
+
+ static int _ndpi_debug_callbacks = 0;
+--
+2.19.1
+
--- /dev/null
+From 6be5188ff93780a7f2acd48f41c4ac1846597091 Mon Sep 17 00:00:00 2001
+From: Luca <deri@ntop.org>
+Date: Tue, 11 Sep 2018 10:02:34 +0300
+Subject: [PATCH 2/9] Fixes #600 Backport of recent fixes (e.g. #601)
+
+---
+ Makefile.am | 5 ++-
+ autogen.sh | 2 +-
+ configure.seed | 13 +++++--
+ src/lib/Makefile | 26 --------------
+ src/lib/Makefile.in | 54 ++++++++++++++++++++++++++++++
+ src/lib/ndpi_main.c | 2 --
+ src/lib/protocols/ssl.c | 36 ++++++++++++++------
+ src/lib/third_party/include/hash.h | 1 +
+ 8 files changed, 94 insertions(+), 45 deletions(-)
+ delete mode 100644 src/lib/Makefile
+ create mode 100644 src/lib/Makefile.in
+
+diff --git a/Makefile.am b/Makefile.am
+index 17c6748..37f0849 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -1,8 +1,7 @@
+ ACLOCAL_AMFLAGS = -I m4
+-
+ SUBDIRS = src/lib example tests
+
+-pkgconfigdir = $(libdir)/pkgconfig
++pkgconfigdir = $(prefix)/libdata/pkgconfig
+ pkgconfig_DATA = libndpi.pc
+
+-EXTRA_DIST = libndpi.sym autogen.sh
++EXTRA_DIST = autogen.sh
+diff --git a/autogen.sh b/autogen.sh
+index 6596b2f..efeffc4 100755
+--- a/autogen.sh
++++ b/autogen.sh
+@@ -5,7 +5,7 @@ NDPI_MINOR="4"
+ NDPI_PATCH="0"
+ NDPI_VERSION_SHORT="$NDPI_MAJOR.$NDPI_MINOR.$NDPI_PATCH"
+
+-rm -f configure config.h config.h.in src/lib/Makefile.in
++rm -f configure config.h config.h.in
+
+ AUTOCONF=$(command -v autoconf)
+ AUTOMAKE=$(command -v automake)
+diff --git a/configure.seed b/configure.seed
+index 6b85c66..8f8817f 100644
+--- a/configure.seed
++++ b/configure.seed
+@@ -10,6 +10,7 @@ AC_PROG_CC
+ AM_PROG_CC_C_O
+ AX_PTHREAD
+
++NDPI_VERSION_SHORT="@NDPI_VERSION_SHORT@"
+ NDPI_MAJOR="@NDPI_MAJOR@"
+ NDPI_MINOR="@NDPI_MINOR@"
+ NDPI_PATCH="@NDPI_PATCH@"
+@@ -51,11 +52,16 @@ else
+ AC_CHECK_LIB([numa], [numa_available], [LIBNUMA="-lnuma"])
+ fi
+
+-
++if test -z `which clang`; then
++CC=gcc
++else
++CC=clang
++fi
++
+ HS_LIB=
+ HS_INC=
+
+-AC_ARG_WITH(hyperscan, [ --with-hyperscan Enable nDPI build with Intel Hyperscan])
++AC_ARG_WITH(hyperscan, [ --with-hyperscan Enable nDPI build with Intel Hyperscan])
+
+ if test "${with_hyperscan+set}" = set; then
+ BKP=$LIBS
+@@ -127,12 +133,13 @@ AC_ARG_ENABLE([debug-messages],
+
+ AC_CHECK_LIB(pthread, pthread_setaffinity_np, AC_DEFINE_UNQUOTED(HAVE_PTHREAD_SETAFFINITY_NP, 1, [libc has pthread_setaffinity_np]))
+
+-AC_CONFIG_FILES([Makefile example/Makefile tests/Makefile libndpi.pc src/include/ndpi_define.h])
++AC_CONFIG_FILES([Makefile example/Makefile tests/Makefile libndpi.pc src/include/ndpi_define.h src/lib/Makefile])
+ AC_CONFIG_HEADERS(src/include/ndpi_config.h)
+ AC_SUBST(GIT_RELEASE)
+ AC_SUBST(NDPI_MAJOR)
+ AC_SUBST(NDPI_MINOR)
+ AC_SUBST(NDPI_PATCH)
++AC_SUBST(NDPI_VERSION_SHORT)
+ AC_SUBST(SVN_DATE)
+ AC_SUBST(JSON_C_LIB)
+ AC_SUBST(PCAP_INC)
+diff --git a/src/lib/Makefile b/src/lib/Makefile
+deleted file mode 100644
+index 19c6f1c..0000000
+--- a/src/lib/Makefile
++++ /dev/null
+@@ -1,26 +0,0 @@
+-#
+-# Simple non-autotools dependent makefile
+-#
+-# ./autogen.sh
+-# cd src/lib
+-# make -f Makefile.simple
+-#
+-CFLAGS += -fPIC -DPIC -I../include -Ithird_party/include -DNDPI_LIB_COMPILATION -g
+-RANLIB = ranlib
+-
+-OBJECTS = $(patsubst protocols/%.c, protocols/%.o, $(wildcard protocols/*.c)) $(patsubst third_party/src/%.c, third_party/src/%.o, $(wildcard third_party/src/*.c)) ndpi_main.o
+-HEADERS = $(wildcard ../include/*.h)
+-
+-all: libndpi.a
+-
+-ndpi_main.c: ndpi_content_match.c.inc
+-
+-libndpi.a: $(OBJECTS)
+- ar rc $@ $(OBJECTS)
+- $(RANLIB) $@
+-
+-%.o: %.c $(HEADERS) Makefile
+- $(CC) $(CFLAGS) -c $< -o $@
+-
+-clean:
+- /bin/rm -f libndpi.a $(OBJECTS)
+diff --git a/src/lib/Makefile.in b/src/lib/Makefile.in
+new file mode 100644
+index 0000000..ca29001
+--- /dev/null
++++ b/src/lib/Makefile.in
+@@ -0,0 +1,54 @@
++#
++# Simple non-autotools dependent makefile
++#
++# ./autogen.sh
++# cd src/lib
++# make Makefile
++#
++
++
++#
++# Installation directories
++#
++prefix = /usr/local
++libdir = ${prefix}/lib
++includedir = ${prefix}/include/ndpi
++CC = @CC@
++CFLAGS += -fPIC -DPIC -I../include -Ithird_party/include -DNDPI_LIB_COMPILATION -O2 # -g
++RANLIB = ranlib
++
++OBJECTS = $(patsubst protocols/%.c, protocols/%.o, $(wildcard protocols/*.c)) $(patsubst third_party/src/%.c, third_party/src/%.o, $(wildcard third_party/src/*.c)) ndpi_main.o
++HEADERS = $(wildcard ../include/*.h)
++NDPI_LIB_STATIC = libndpi.a
++NDPI_LIB_SHARED_BASE = libndpi.so
++NDPI_LIB_SHARED = $(NDPI_LIB_SHARED_BASE).@NDPI_VERSION_SHORT@
++NDPI_LIBS = $(NDPI_LIB_STATIC) $(NDPI_LIB_SHARED)
++
++ifeq ($(OS),Darwin)
++CC=clang
++endif
++
++all: $(NDPI_LIBS)
++
++ndpi_main.c: ndpi_content_match.c.inc
++
++$(NDPI_LIB_STATIC): $(OBJECTS)
++ ar rc $@ $(OBJECTS)
++ $(RANLIB) $@
++
++$(NDPI_LIB_SHARED): $(OBJECTS)
++ $(CC) -shared -fPIC -o $@ $(OBJECTS)
++ ln -Fs $(NDPI_LIB_SHARED) $(NDPI_LIB_SHARED_BASE)
++
++%.o: %.c $(HEADERS) Makefile
++ $(CC) $(CFLAGS) -c $< -o $@
++
++clean:
++ /bin/rm -f $(NDPI_LIB_STATIC) $(OBJECTS) *.o *.so *.lo
++
++install: $(NDPI_LIBS)
++ mkdir -p $(DESTDIR)$(libdir)
++ cp $(NDPI_LIBS) $(DESTDIR)$(libdir)/
++ ln -Fs $(DESTDIR)$(libdir)/$(NDPI_LIB_SHARED) $(DESTDIR)$(libdir)/$(NDPI_LIB_SHARED_BASE)
++ mkdir -p $(DESTDIR)$(includedir)
++ cp ../include/*.h $(DESTDIR)$(includedir)
+diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c
+index 8061aa1..540e158 100644
+--- a/src/lib/ndpi_main.c
++++ b/src/lib/ndpi_main.c
+@@ -43,9 +43,7 @@
+
+ #include "ndpi_content_match.c.inc"
+ #include "third_party/include/ndpi_patricia.h"
+-#include "third_party/src/ndpi_patricia.c"
+ #include "third_party/include/hash.h"
+-#include "third_party/src/hash.c"
+
+ #ifdef HAVE_HYPERSCAN
+ #include <hs/hs.h>
+diff --git a/src/lib/protocols/ssl.c b/src/lib/protocols/ssl.c
+index b8c3697..59aedcb 100644
+--- a/src/lib/protocols/ssl.c
++++ b/src/lib/protocols/ssl.c
+@@ -27,7 +27,7 @@
+
+ #include "ndpi_api.h"
+
+-/* #define CERTIFICATE_DEBUG 1 */
++// #define CERTIFICATE_DEBUG 1
+ #define NDPI_MAX_SSL_REQUEST_SIZE 10000
+
+ /* Skype.c */
+@@ -246,28 +246,43 @@ int getSSLcertificate(struct ndpi_detection_module_struct *ndpi_struct,
+ u_int16_t compression_len;
+ u_int16_t extensions_len;
+
+- compression_len = packet->payload[offset+1];
+- offset += compression_len + 3;
++ offset++;
++ compression_len = packet->payload[offset];
++ offset++;
++
++#ifdef CERTIFICATE_DEBUG
++ printf("SSL [compression_len: %u]\n", compression_len);
++#endif
++
++ // offset += compression_len + 3;
++ offset += compression_len;
+
+ if(offset < total_len) {
+- extensions_len = packet->payload[offset];
++ extensions_len = ntohs(*((u_int16_t*)&packet->payload[offset]));
++ offset += 2;
++
++#ifdef CERTIFICATE_DEBUG
++ printf("SSL [extensions_len: %u]\n", extensions_len);
++#endif
+
+- if((extensions_len+offset) < total_len) {
++ if((extensions_len+offset) <= total_len) {
+ /* Move to the first extension
+ Type is u_int to avoid possible overflow on extension_len addition */
+- u_int extension_offset = 1;
++ u_int extension_offset = 0;
+
+ while(extension_offset < extensions_len) {
+ u_int16_t extension_id, extension_len;
+
+- memcpy(&extension_id, &packet->payload[offset+extension_offset], 2);
++ extension_id = ntohs(*((u_int16_t*)&packet->payload[offset+extension_offset]));
+ extension_offset += 2;
+
+- memcpy(&extension_len, &packet->payload[offset+extension_offset], 2);
++ extension_len = ntohs(*((u_int16_t*)&packet->payload[offset+extension_offset]));
+ extension_offset += 2;
+
+- extension_id = ntohs(extension_id), extension_len = ntohs(extension_len);
+-
++#ifdef CERTIFICATE_DEBUG
++ printf("SSL [extension_id: %u][extension_len: %u]\n", extension_id, extension_len);
++#endif
++
+ if(extension_id == 0) {
+ u_int begin = 0,len;
+ char *server_name = (char*)&packet->payload[offset+extension_offset];
+@@ -316,6 +331,7 @@ int sslTryAndRetrieveServerCertificate(struct ndpi_detection_module_struct *ndpi
+ if((packet->payload_packet_len > 9) && (packet->payload[0] == 0x16)) {
+ char certificate[64];
+ int rc;
++
+ certificate[0] = '\0';
+ rc = getSSLcertificate(ndpi_struct, flow, certificate, sizeof(certificate));
+ packet->ssl_certificate_num_checks++;
+diff --git a/src/lib/third_party/include/hash.h b/src/lib/third_party/include/hash.h
+index 4f53e5a..2251706 100644
+--- a/src/lib/third_party/include/hash.h
++++ b/src/lib/third_party/include/hash.h
+@@ -25,5 +25,6 @@ extern int ht_hash( hashtable_t *hashtable, char *key );
+ extern entry_t *ht_newpair( char *key, u_int16_t value );
+ extern void ht_set( hashtable_t *hashtable, char *key, u_int16_t value );
+ extern u_int16_t ht_get( hashtable_t *hashtable, char *key );
++extern void ht_free( hashtable_t *hashtable );
+
+ #endif /* _HASH_H_ */
+--
+2.19.1
+
--- /dev/null
+From efd8348c3a5ace204410608f1805c9d5899096ab Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=D0=98=D0=B2=D0=B0=D0=BD=20=D0=A1=D0=BF=D0=B8=D0=BD=D0=B5?=
+ =?UTF-8?q?=D0=BD=D0=BA=D0=BE?= <ispinenko@ideco.ru>
+Date: Thu, 13 Sep 2018 18:23:47 +0500
+Subject: [PATCH 3/9] Fixed duplicate protocol name. #607
+
+---
+ src/lib/ndpi_main.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c
+index 540e158..33ccbb1 100644
+--- a/src/lib/ndpi_main.c
++++ b/src/lib/ndpi_main.c
+@@ -1225,7 +1225,7 @@ static void ndpi_init_protocol_defaults(struct ndpi_detection_module_struct *ndp
+ ndpi_build_default_ports(ports_b, 0, 0, 0, 0, 0) /* UDP */);
+ ndpi_set_proto_defaults(ndpi_mod, NDPI_PROTOCOL_FUN, NDPI_PROTOCOL_VIDTO,
+ no_master,
+- no_master, "PPStream", NDPI_PROTOCOL_CATEGORY_MEDIA,
++ no_master, "Vidto", NDPI_PROTOCOL_CATEGORY_MEDIA,
+ ndpi_build_default_ports(ports_a, 0, 0, 0, 0, 0) /* TCP */,
+ ndpi_build_default_ports(ports_b, 0, 0, 0, 0, 0) /* UDP */);
+
+--
+2.19.1
+
--- /dev/null
+From ba72865f23cd0d52f373573308e0e05c5bd37ba8 Mon Sep 17 00:00:00 2001
+From: Luca Deri <deri@ntop.org>
+Date: Wed, 19 Sep 2018 11:11:15 +0200
+Subject: [PATCH 4/9] Added missing ndpi_protocol2id() prototype Fixed error
+ when crearing symlink in Makefile
+
+---
+ src/include/ndpi_api.h | 15 ++++++++++++++-
+ src/lib/Makefile.in | 2 +-
+ 2 files changed, 15 insertions(+), 2 deletions(-)
+
+diff --git a/src/include/ndpi_api.h b/src/include/ndpi_api.h
+index 3fefc8e..56c5436 100644
+--- a/src/include/ndpi_api.h
++++ b/src/include/ndpi_api.h
+@@ -420,7 +420,7 @@ extern "C" {
+ char *bigram_to_match);
+
+ /**
+- * Write the protocol name in the buffer -buf- as master_protocol.protocol
++ * Write the protocol name in the buffer -buf- as master_protocol.protocol (string)
+ *
+ * @par ndpi_mod = the detection module
+ * @par proto = the struct ndpi_protocol contain the protocols name
+@@ -432,6 +432,19 @@ extern "C" {
+ char* ndpi_protocol2name(struct ndpi_detection_module_struct *ndpi_mod,
+ ndpi_protocol proto, char *buf, u_int buf_len);
+
++ /**
++ * Write the protocol name in the buffer -buf- as master_protocol.protocol (number)
++ *
++ * @par ndpi_mod = the detection module
++ * @par proto = the struct ndpi_protocol contain the protocols name
++ * @par buf = the buffer to write the name of the protocols
++ * @par buf_len = the length of the buffer
++ * @return the buffer contains the master_protocol and protocol name
++ *
++ */
++ char* ndpi_protocol2id(struct ndpi_detection_module_struct *ndpi_mod,
++ ndpi_protocol proto, char *buf, u_int buf_len);
++
+ /**
+ * Find out if a given category is custom/user-defined
+ *
+diff --git a/src/lib/Makefile.in b/src/lib/Makefile.in
+index ca29001..cbbc54b 100644
+--- a/src/lib/Makefile.in
++++ b/src/lib/Makefile.in
+@@ -38,7 +38,7 @@ $(NDPI_LIB_STATIC): $(OBJECTS)
+
+ $(NDPI_LIB_SHARED): $(OBJECTS)
+ $(CC) -shared -fPIC -o $@ $(OBJECTS)
+- ln -Fs $(NDPI_LIB_SHARED) $(NDPI_LIB_SHARED_BASE)
++ ln -fs $(NDPI_LIB_SHARED) $(NDPI_LIB_SHARED_BASE)
+
+ %.o: %.c $(HEADERS) Makefile
+ $(CC) $(CFLAGS) -c $< -o $@
+--
+2.19.1
+
--- /dev/null
+From 54fd7face86f3d5287bc8d0f2633bd13c66498cf Mon Sep 17 00:00:00 2001
+From: Vitaly Lavrov <vel21ripn@gmail.com>
+Date: Sun, 30 Sep 2018 22:49:18 +0300
+Subject: [PATCH 5/9] Do not use the available clang as the default compiler.
+ Use the CC environment variable when running autogen.sh and configure.
+
+---
+ configure.seed | 6 ------
+ 1 file changed, 6 deletions(-)
+
+diff --git a/configure.seed b/configure.seed
+index 8f8817f..b150fdb 100644
+--- a/configure.seed
++++ b/configure.seed
+@@ -51,12 +51,6 @@ if test $SHORT_MACHINE = "arm"; then
+ else
+ AC_CHECK_LIB([numa], [numa_available], [LIBNUMA="-lnuma"])
+ fi
+-
+-if test -z `which clang`; then
+-CC=gcc
+-else
+-CC=clang
+-fi
+
+ HS_LIB=
+ HS_INC=
+--
+2.19.1
+
--- /dev/null
+From 6dcf1f3fbab782804339db5a3fe8cd0c88c07795 Mon Sep 17 00:00:00 2001
+From: lucaderi <deri@ntop.org>
+Date: Thu, 4 Oct 2018 21:36:46 +0200
+Subject: [PATCH 6/9] Backported ndpi_protocol2id
+
+---
+ src/include/ndpi_api.h | 17 +++++++++++++++--
+ src/lib/ndpi_main.c | 17 +++++++++++++++++
+ 2 files changed, 32 insertions(+), 2 deletions(-)
+
+diff --git a/src/include/ndpi_api.h b/src/include/ndpi_api.h
+index 56c5436..ccbad73 100644
+--- a/src/include/ndpi_api.h
++++ b/src/include/ndpi_api.h
+@@ -274,7 +274,7 @@ extern "C" {
+ */
+ u_int16_t ndpi_get_flow_masterprotocol(struct ndpi_detection_module_struct *ndpi_struct,
+ struct ndpi_flow_struct *flow);
+-
++
+ /**
+ * API call that is called internally by ndpi_detection_process_packet or by apps
+ * that want to avoid calling ndpi_detection_process_packet as they have already
+@@ -432,6 +432,19 @@ extern "C" {
+ char* ndpi_protocol2name(struct ndpi_detection_module_struct *ndpi_mod,
+ ndpi_protocol proto, char *buf, u_int buf_len);
+
++ /**
++ * Same as ndpi_protocol2name() with the difference that the numeric protocol
++ * name is returned
++ *
++ * @par ndpi_mod = the detection module
++ * @par proto = the struct ndpi_protocol contain the protocols name
++ * @par buf = the buffer to write the name of the protocols
++ * @par buf_len = the length of the buffer
++ * @return the buffer contains the master_protocol and protocol name
++ *
++ */
++ char* ndpi_protocol2id(struct ndpi_detection_module_struct *ndpi_mod,
++ ndpi_protocol proto, char *buf, u_int buf_len);
+ /**
+ * Write the protocol name in the buffer -buf- as master_protocol.protocol (number)
+ *
+@@ -746,7 +759,7 @@ extern "C" {
+ u_int ndpi_get_ndpi_num_custom_protocols(struct ndpi_detection_module_struct *ndpi_mod);
+ u_int ndpi_get_ndpi_detection_module_size();
+ void ndpi_set_log_level(struct ndpi_detection_module_struct *ndpi_mod, u_int l);
+-
++
+ /**
+ * Add a string to match to an automata
+ *
+diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c
+index 33ccbb1..e1cf577 100644
+--- a/src/lib/ndpi_main.c
++++ b/src/lib/ndpi_main.c
+@@ -5319,6 +5319,23 @@ ndpi_protocol ndpi_guess_undetected_protocol(struct ndpi_detection_module_struct
+
+ /* ****************************************************** */
+
++char* ndpi_protocol2id(struct ndpi_detection_module_struct *ndpi_mod,
++ ndpi_protocol proto, char *buf, u_int buf_len) {
++ if((proto.master_protocol != NDPI_PROTOCOL_UNKNOWN)
++ && (proto.master_protocol != proto.app_protocol)) {
++ if(proto.app_protocol != NDPI_PROTOCOL_UNKNOWN)
++ snprintf(buf, buf_len, "%u.%u",
++ proto.master_protocol, proto.app_protocol);
++ else
++ snprintf(buf, buf_len, "%u", proto.master_protocol);
++ } else
++ snprintf(buf, buf_len, "%u", proto.app_protocol);
++
++ return(buf);
++}
++
++/* ****************************************************** */
++
+ char* ndpi_protocol2name(struct ndpi_detection_module_struct *ndpi_mod,
+ ndpi_protocol proto, char *buf, u_int buf_len) {
+ if((proto.master_protocol != NDPI_PROTOCOL_UNKNOWN)
+--
+2.19.1
+
--- /dev/null
+From a1f6cbb6c9a212b5b3b6605254ae35bead5c43df Mon Sep 17 00:00:00 2001
+From: Hank Leininger <hlein@korelogic.com>
+Date: Mon, 8 Oct 2018 18:17:30 -0600
+Subject: [PATCH 7/9] Symlink the shared library to pwd.
+
+DESTDIR is used, for instance, by distros to facilitate installing
+to a temp path for testing / package-building.
+
+In general nDPI supports DESTDIR (yay!), but using an absolute path
+for the target of the library link has two problems:
+
+1) If DESTDIR is set to /some/tmp/path, we end up with a link that
+points to /some/tmp/path/usr/lib/libndpi-x.y.z, which is definitely
+not what is intended - once the package is installed, the link is
+broken.
+
+2) Absolute links are problematic for distributions; pointing to
+/usr/lib/libndpi-x.y.z during package build-and-test would point to
+either a nonexistent file, or an old and possibly wrong one.
+
+Both of these are avoided if we just link to the target with no path
+at all.
+---
+ src/lib/Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/lib/Makefile.in b/src/lib/Makefile.in
+index cbbc54b..dc1e34b 100644
+--- a/src/lib/Makefile.in
++++ b/src/lib/Makefile.in
+@@ -49,6 +49,6 @@ clean:
+ install: $(NDPI_LIBS)
+ mkdir -p $(DESTDIR)$(libdir)
+ cp $(NDPI_LIBS) $(DESTDIR)$(libdir)/
+- ln -Fs $(DESTDIR)$(libdir)/$(NDPI_LIB_SHARED) $(DESTDIR)$(libdir)/$(NDPI_LIB_SHARED_BASE)
++ ln -Fs $(NDPI_LIB_SHARED) $(DESTDIR)$(libdir)/$(NDPI_LIB_SHARED_BASE)
+ mkdir -p $(DESTDIR)$(includedir)
+ cp ../include/*.h $(DESTDIR)$(includedir)
+--
+2.19.1
+
--- /dev/null
+From cfd97bbbca6afddb1bcedb407cb21127d7cb5d53 Mon Sep 17 00:00:00 2001
+From: Hank Leininger <hlein@korelogic.com>
+Date: Mon, 8 Oct 2018 19:08:51 -0600
+Subject: [PATCH 8/9] Use a more standard path for pkg-config files.
+
+The Linuxes I've checked all seem to use /usr/{,local/}lib*/pkgconfig,
+not /usr/libdata/. I think FreeBSD does use /usr/libdata/ but also
+supports /usr/lib*/pkgconfig, although I have not tested this change
+on a FreeBSD system.
+---
+ Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 37f0849..4090817 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -1,7 +1,7 @@
+ ACLOCAL_AMFLAGS = -I m4
+ SUBDIRS = src/lib example tests
+
+-pkgconfigdir = $(prefix)/libdata/pkgconfig
++pkgconfigdir = $(libdir)/pkgconfig
+ pkgconfig_DATA = libndpi.pc
+
+ EXTRA_DIST = autogen.sh
+--
+2.19.1
+
--- /dev/null
+From b4b7a810697145b718a9a3b6d8a39e700613a640 Mon Sep 17 00:00:00 2001
+From: Hank Leininger <hlein@korelogic.com>
+Date: Mon, 8 Oct 2018 21:22:41 -0600
+Subject: [PATCH 9/9] Correct the include file path in -I CFLAGS argument.
+
+src/lib/Makefile.in install headers into ${prefix}/include/ndpi,
+but the shipped libndpi.pc.in specifies a different path. Therefore
+anything trying to build using $(pkg-config --cflags libndpi) will
+fail to find the nDPI headers.
+
+This patch simply makes libndpi.pc.in agree with src/lib/Makefile.in.
+---
+ libndpi.pc.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libndpi.pc.in b/libndpi.pc.in
+index 291429c..5e1cde7 100644
+--- a/libndpi.pc.in
++++ b/libndpi.pc.in
+@@ -7,4 +7,4 @@ Name: libndpi
+ Description: deep packet inspection library
+ Version: @VERSION@
+ Libs: -L${libdir} -lndpi
+-Cflags: -I${includedir}/libndpi-@VERSION@
++Cflags: -I${includedir}/ndpi
+--
+2.19.1
+
+++ /dev/null
-From 0e09c2b5c573ad1fce7c8f13b6bf255e1f21d390 Mon Sep 17 00:00:00 2001
-From: Luca <deri@ntop.org>
-Date: Tue, 11 Sep 2018 10:02:34 +0300
-Subject: [PATCH] Fixes #600 Backport of recent fixes (e.g. #601)
-
----
- Makefile.am | 5 ++-
- autogen.sh | 2 +-
- configure.seed | 13 +++++--
- src/lib/Makefile.in | 54 ++++++++++++++++++++++++++++++
- src/lib/ndpi_main.c | 2 --
- src/lib/protocols/ssl.c | 36 ++++++++++++++------
- src/lib/third_party/include/hash.h | 1 +
- 7 files changed, 94 insertions(+), 19 deletions(-)
- create mode 100644 src/lib/Makefile.in
-
-diff --git a/Makefile.am b/Makefile.am
-index 17c6748..37f0849 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -1,8 +1,7 @@
- ACLOCAL_AMFLAGS = -I m4
--
- SUBDIRS = src/lib example tests
-
--pkgconfigdir = $(libdir)/pkgconfig
-+pkgconfigdir = $(prefix)/libdata/pkgconfig
- pkgconfig_DATA = libndpi.pc
-
--EXTRA_DIST = libndpi.sym autogen.sh
-+EXTRA_DIST = autogen.sh
-diff --git a/autogen.sh b/autogen.sh
-index 6596b2f..efeffc4 100755
---- a/autogen.sh
-+++ b/autogen.sh
-@@ -5,7 +5,7 @@ NDPI_MINOR="4"
- NDPI_PATCH="0"
- NDPI_VERSION_SHORT="$NDPI_MAJOR.$NDPI_MINOR.$NDPI_PATCH"
-
--rm -f configure config.h config.h.in src/lib/Makefile.in
-+rm -f configure config.h config.h.in
-
- AUTOCONF=$(command -v autoconf)
- AUTOMAKE=$(command -v automake)
-diff --git a/configure.seed b/configure.seed
-index 6b85c66..8f8817f 100644
---- a/configure.seed
-+++ b/configure.seed
-@@ -10,6 +10,7 @@ AC_PROG_CC
- AM_PROG_CC_C_O
- AX_PTHREAD
-
-+NDPI_VERSION_SHORT="@NDPI_VERSION_SHORT@"
- NDPI_MAJOR="@NDPI_MAJOR@"
- NDPI_MINOR="@NDPI_MINOR@"
- NDPI_PATCH="@NDPI_PATCH@"
-@@ -51,11 +52,16 @@ else
- AC_CHECK_LIB([numa], [numa_available], [LIBNUMA="-lnuma"])
- fi
-
--
-+if test -z `which clang`; then
-+CC=gcc
-+else
-+CC=clang
-+fi
-+
- HS_LIB=
- HS_INC=
-
--AC_ARG_WITH(hyperscan, [ --with-hyperscan Enable nDPI build with Intel Hyperscan])
-+AC_ARG_WITH(hyperscan, [ --with-hyperscan Enable nDPI build with Intel Hyperscan])
-
- if test "${with_hyperscan+set}" = set; then
- BKP=$LIBS
-@@ -127,12 +133,13 @@ AC_ARG_ENABLE([debug-messages],
-
- AC_CHECK_LIB(pthread, pthread_setaffinity_np, AC_DEFINE_UNQUOTED(HAVE_PTHREAD_SETAFFINITY_NP, 1, [libc has pthread_setaffinity_np]))
-
--AC_CONFIG_FILES([Makefile example/Makefile tests/Makefile libndpi.pc src/include/ndpi_define.h])
-+AC_CONFIG_FILES([Makefile example/Makefile tests/Makefile libndpi.pc src/include/ndpi_define.h src/lib/Makefile])
- AC_CONFIG_HEADERS(src/include/ndpi_config.h)
- AC_SUBST(GIT_RELEASE)
- AC_SUBST(NDPI_MAJOR)
- AC_SUBST(NDPI_MINOR)
- AC_SUBST(NDPI_PATCH)
-+AC_SUBST(NDPI_VERSION_SHORT)
- AC_SUBST(SVN_DATE)
- AC_SUBST(JSON_C_LIB)
- AC_SUBST(PCAP_INC)
-diff --git a/src/lib/Makefile.in b/src/lib/Makefile.in
-new file mode 100644
-index 0000000..ca29001
---- /dev/null
-+++ b/src/lib/Makefile.in
-@@ -0,0 +1,54 @@
-+#
-+# Simple non-autotools dependent makefile
-+#
-+# ./autogen.sh
-+# cd src/lib
-+# make Makefile
-+#
-+
-+
-+#
-+# Installation directories
-+#
-+prefix = /usr
-+libdir = ${prefix}/lib
-+includedir = ${prefix}/include/ndpi
-+CC = @CC@
-+CFLAGS += -fPIC -DPIC -I../include -Ithird_party/include -DNDPI_LIB_COMPILATION -O2 # -g
-+RANLIB = ranlib
-+
-+OBJECTS = $(patsubst protocols/%.c, protocols/%.o, $(wildcard protocols/*.c)) $(patsubst third_party/src/%.c, third_party/src/%.o, $(wildcard third_party/src/*.c)) ndpi_main.o
-+HEADERS = $(wildcard ../include/*.h)
-+NDPI_LIB_STATIC = libndpi.a
-+NDPI_LIB_SHARED_BASE = libndpi.so
-+NDPI_LIB_SHARED = $(NDPI_LIB_SHARED_BASE).@NDPI_VERSION_SHORT@
-+NDPI_LIBS = $(NDPI_LIB_STATIC) $(NDPI_LIB_SHARED)
-+
-+ifeq ($(OS),Darwin)
-+CC=clang
-+endif
-+
-+all: $(NDPI_LIBS)
-+
-+ndpi_main.c: ndpi_content_match.c.inc
-+
-+$(NDPI_LIB_STATIC): $(OBJECTS)
-+ ar rc $@ $(OBJECTS)
-+ $(RANLIB) $@
-+
-+$(NDPI_LIB_SHARED): $(OBJECTS)
-+ $(CC) -shared -fPIC -o $@ $(OBJECTS)
-+ ln -Fs $(NDPI_LIB_SHARED) $(NDPI_LIB_SHARED_BASE)
-+
-+%.o: %.c $(HEADERS) Makefile
-+ $(CC) $(CFLAGS) -c $< -o $@
-+
-+clean:
-+ /bin/rm -f $(NDPI_LIB_STATIC) $(OBJECTS) *.o *.so *.lo
-+
-+install: $(NDPI_LIBS)
-+ mkdir -p $(DESTDIR)$(libdir)
-+ cp $(NDPI_LIBS) $(DESTDIR)$(libdir)/
-+ ln -Fs $(DESTDIR)$(libdir)/$(NDPI_LIB_SHARED) $(DESTDIR)$(libdir)/$(NDPI_LIB_SHARED_BASE)
-+ mkdir -p $(DESTDIR)$(includedir)
-+ cp ../include/*.h $(DESTDIR)$(includedir)
-diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c
-index b002126..5beb6b4 100644
---- a/src/lib/ndpi_main.c
-+++ b/src/lib/ndpi_main.c
-@@ -43,9 +43,7 @@
-
- #include "ndpi_content_match.c.inc"
- #include "third_party/include/ndpi_patricia.h"
--#include "third_party/src/ndpi_patricia.c"
- #include "third_party/include/hash.h"
--#include "third_party/src/hash.c"
-
- #ifdef HAVE_HYPERSCAN
- #include <hs/hs.h>
-diff --git a/src/lib/protocols/ssl.c b/src/lib/protocols/ssl.c
-index b8c3697..59aedcb 100644
---- a/src/lib/protocols/ssl.c
-+++ b/src/lib/protocols/ssl.c
-@@ -27,7 +27,7 @@
-
- #include "ndpi_api.h"
-
--/* #define CERTIFICATE_DEBUG 1 */
-+// #define CERTIFICATE_DEBUG 1
- #define NDPI_MAX_SSL_REQUEST_SIZE 10000
-
- /* Skype.c */
-@@ -246,28 +246,43 @@ int getSSLcertificate(struct ndpi_detection_module_struct *ndpi_struct,
- u_int16_t compression_len;
- u_int16_t extensions_len;
-
-- compression_len = packet->payload[offset+1];
-- offset += compression_len + 3;
-+ offset++;
-+ compression_len = packet->payload[offset];
-+ offset++;
-+
-+#ifdef CERTIFICATE_DEBUG
-+ printf("SSL [compression_len: %u]\n", compression_len);
-+#endif
-+
-+ // offset += compression_len + 3;
-+ offset += compression_len;
-
- if(offset < total_len) {
-- extensions_len = packet->payload[offset];
-+ extensions_len = ntohs(*((u_int16_t*)&packet->payload[offset]));
-+ offset += 2;
-+
-+#ifdef CERTIFICATE_DEBUG
-+ printf("SSL [extensions_len: %u]\n", extensions_len);
-+#endif
-
-- if((extensions_len+offset) < total_len) {
-+ if((extensions_len+offset) <= total_len) {
- /* Move to the first extension
- Type is u_int to avoid possible overflow on extension_len addition */
-- u_int extension_offset = 1;
-+ u_int extension_offset = 0;
-
- while(extension_offset < extensions_len) {
- u_int16_t extension_id, extension_len;
-
-- memcpy(&extension_id, &packet->payload[offset+extension_offset], 2);
-+ extension_id = ntohs(*((u_int16_t*)&packet->payload[offset+extension_offset]));
- extension_offset += 2;
-
-- memcpy(&extension_len, &packet->payload[offset+extension_offset], 2);
-+ extension_len = ntohs(*((u_int16_t*)&packet->payload[offset+extension_offset]));
- extension_offset += 2;
-
-- extension_id = ntohs(extension_id), extension_len = ntohs(extension_len);
--
-+#ifdef CERTIFICATE_DEBUG
-+ printf("SSL [extension_id: %u][extension_len: %u]\n", extension_id, extension_len);
-+#endif
-+
- if(extension_id == 0) {
- u_int begin = 0,len;
- char *server_name = (char*)&packet->payload[offset+extension_offset];
-@@ -316,6 +331,7 @@ int sslTryAndRetrieveServerCertificate(struct ndpi_detection_module_struct *ndpi
- if((packet->payload_packet_len > 9) && (packet->payload[0] == 0x16)) {
- char certificate[64];
- int rc;
-+
- certificate[0] = '\0';
- rc = getSSLcertificate(ndpi_struct, flow, certificate, sizeof(certificate));
- packet->ssl_certificate_num_checks++;
-diff --git a/src/lib/third_party/include/hash.h b/src/lib/third_party/include/hash.h
-index 4f53e5a..2251706 100644
---- a/src/lib/third_party/include/hash.h
-+++ b/src/lib/third_party/include/hash.h
-@@ -25,5 +25,6 @@ extern int ht_hash( hashtable_t *hashtable, char *key );
- extern entry_t *ht_newpair( char *key, u_int16_t value );
- extern void ht_set( hashtable_t *hashtable, char *key, u_int16_t value );
- extern u_int16_t ht_get( hashtable_t *hashtable, char *key );
-+extern void ht_free( hashtable_t *hashtable );
-
- #endif /* _HASH_H_ */
---
-2.19.1
-
include $(TOPDIR)/rules.mk
PKG_NAME:=liboping
-PKG_VERSION:=1.9.0
+PKG_VERSION:=1.10.0
PKG_RELEASE:=1
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
PKG_LICENSE:=LGPL-2.1+
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://noping.cc/files
-PKG_HASH:=44bb1d88b56b88fda5533edb3aa005c69b3cd396f20453a157d7e31e536f3530
+PKG_HASH:=eb38aa93f93e8ab282d97e2582fbaea88b3f889a08cbc9dbf20059c3779d5cd8
PKG_FIXUP:=autoreconf
+PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
define Package/liboping/Default
- URL:=http://verplant.org/liboping/
+ URL:=https://noping.cc
endef
define Package/liboping
PKG_NAME:=libssh
PKG_VERSION:=0.7.6
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://www.libssh.org/files/0.7/
--- /dev/null
+From a8523d83c242c6f71dbf69fab0ca91d768e78f05 Mon Sep 17 00:00:00 2001
+From: Andreas Schneider <asn@cryptomilk.org>
+Date: Sun, 6 Nov 2016 12:07:32 +0100
+Subject: [PATCH] threads: Use new API call for OpenSSL CRYPTO THREADID
+
+BUG: https://red.libssh.org/issues/222
+
+Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
+---
+ ConfigureChecks.cmake | 4 ++++
+ config.h.cmake | 3 +++
+ src/threads.c | 19 +++++++++++++++++--
+ 3 files changed, 24 insertions(+), 2 deletions(-)
+
+diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
+index 0a53c5b1..43179d8f 100644
+--- a/ConfigureChecks.cmake
++++ b/ConfigureChecks.cmake
+@@ -95,6 +95,10 @@ if (OPENSSL_FOUND)
+ set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
+ set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_CRYPTO_LIBRARY})
+ check_function_exists(CRYPTO_ctr128_encrypt HAVE_OPENSSL_CRYPTO_CTR128_ENCRYPT)
++
++ set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
++ set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_CRYPTO_LIBRARY})
++ check_function_exists(CRYPTO_THREADID_set_callback HAVE_OPENSSL_CRYPTO_THREADID_SET_CALLBACK)
+ endif()
+
+ if (CMAKE_HAVE_PTHREAD_H)
+diff --git a/config.h.cmake b/config.h.cmake
+index 3e7f7939..b87fea5c 100644
+--- a/config.h.cmake
++++ b/config.h.cmake
+@@ -79,6 +79,9 @@
+ /* Define to 1 if you have the `CRYPTO_ctr128_encrypt' function. */
+ #cmakedefine HAVE_OPENSSL_CRYPTO_CTR128_ENCRYPT 1
+
++/* Define to 1 if you have the `CRYPTO_THREADID_set_callback' function. */
++#cmakedefine HAVE_OPENSSL_CRYPTO_THREADID_SET_CALLBACK 1
++
+ /* Define to 1 if you have the `snprintf' function. */
+ #cmakedefine HAVE_SNPRINTF 1
+
+diff --git a/src/threads.c b/src/threads.c
+index 7f3a304e..062c3b84 100644
+--- a/src/threads.c
++++ b/src/threads.c
+@@ -116,6 +116,15 @@ static void libcrypto_lock_callback(int mode, int i, const char *file, int line)
+ }
+ }
+
++#ifdef HAVE_OPENSSL_CRYPTO_THREADID_SET_CALLBACK
++static void libcrypto_THREADID_callback(CRYPTO_THREADID *id)
++{
++ unsigned long thread_id = (*user_callbacks->thread_id)();
++
++ CRYPTO_THREADID_set_numeric(id, thread_id);
++}
++#endif /* HAVE_OPENSSL_CRYPTO_THREADID_SET_CALLBACK */
++
+ static int libcrypto_thread_init(void){
+ int n=CRYPTO_num_locks();
+ int i;
+@@ -127,8 +136,14 @@ static int libcrypto_thread_init(void){
+ for (i=0;i<n;++i){
+ user_callbacks->mutex_init(&libcrypto_mutexes[i]);
+ }
+- CRYPTO_set_id_callback(user_callbacks->thread_id);
+- CRYPTO_set_locking_callback(libcrypto_lock_callback);
++
++#ifdef HAVE_OPENSSL_CRYPTO_THREADID_SET_CALLBACK
++ CRYPTO_THREADID_set_callback(libcrypto_THREADID_callback);
++#else
++ CRYPTO_set_id_callback(user_callbacks->thread_id);
++#endif
++
++ CRYPTO_set_locking_callback(libcrypto_lock_callback);
+
+ return SSH_OK;
+ }
+--
+2.19.1
+
set(PACKAGE ${APPLICATION_NAME})
set(VERSION ${APPLICATION_VERSION})
-@@ -272,6 +271,8 @@ if (WITH_GSSAPI AND NOT GSSAPI_FOUND)
+@@ -276,6 +275,8 @@ if (WITH_GSSAPI AND NOT GSSAPI_FOUND)
endif (WITH_GSSAPI AND NOT GSSAPI_FOUND)
# ENDIAN
--- /dev/null
+From 8d5cf617d53d0545a0d141abf94396c28ca7e736 Mon Sep 17 00:00:00 2001
+From: Andreas Schneider <asn@cryptomilk.org>
+Date: Sun, 29 Oct 2017 16:06:14 +0100
+Subject: [PATCH] pki_crypto: Don't use deprecated function with newer
+ OpenSSL
+
+Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
+---
+ src/pki_crypto.c | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/src/pki_crypto.c b/src/pki_crypto.c
+index 9e27436c..34d6e81c 100644
+--- a/src/pki_crypto.c
++++ b/src/pki_crypto.c
+@@ -451,11 +451,24 @@ int pki_key_generate_rsa(ssh_key key, int parameter){
+
+ int pki_key_generate_dss(ssh_key key, int parameter){
+ int rc;
++#if OPENSSL_VERSION_NUMBER > 0x10100000L
++ rc = DSA_generate_parameters_ex(key->dsa,
++ parameter,
++ NULL, /* seed */
++ 0, /* seed_len */
++ NULL, /* counter_ret */
++ NULL, /* h_ret */
++ NULL); /* cb */
++ if (rc != 1) {
++ return SSH_ERROR;
++ }
++#else
+ key->dsa = DSA_generate_parameters(parameter, NULL, 0, NULL, NULL,
+ NULL, NULL);
+ if(key->dsa == NULL){
+ return SSH_ERROR;
+ }
++#endif
+ rc = DSA_generate_key(key->dsa);
+ if (rc != 1){
+ DSA_free(key->dsa);
+--
+2.19.1
+
--- /dev/null
+From ab67e42d6a0529f5fb81ee86049bf10abe99f839 Mon Sep 17 00:00:00 2001
+From: Jakub Jelen <jjelen@redhat.com>
+Date: Tue, 7 Nov 2017 09:38:40 +0100
+Subject: [PATCH] pki_crypto: Avoid segfault with OpenSSL 1.1.0
+
+Signed-off-by: Jakub Jelen <jjelen@redhat.com>
+Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
+---
+ src/pki_crypto.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/pki_crypto.c b/src/pki_crypto.c
+index 34d6e81c..30f49a81 100644
+--- a/src/pki_crypto.c
++++ b/src/pki_crypto.c
+@@ -452,6 +452,10 @@ int pki_key_generate_rsa(ssh_key key, int parameter){
+ int pki_key_generate_dss(ssh_key key, int parameter){
+ int rc;
+ #if OPENSSL_VERSION_NUMBER > 0x10100000L
++ key->dsa = DSA_new();
++ if (!key->dsa) {
++ return SSH_ERROR;
++ }
+ rc = DSA_generate_parameters_ex(key->dsa,
+ parameter,
+ NULL, /* seed */
+--
+2.19.1
+
--- /dev/null
+From c39f7578765859d7416e4140c92d034c8cae3341 Mon Sep 17 00:00:00 2001
+From: Jakub Jelen <jjelen@redhat.com>
+Date: Wed, 8 Nov 2017 15:35:08 +0100
+Subject: [PATCH] pki_crypto: Avoid potential memory leak
+
+Signed-off-by: Jakub Jelen <jjelen@redhat.com>
+Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
+---
+ src/pki_crypto.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/src/pki_crypto.c b/src/pki_crypto.c
+index 30f49a81..d9f7753a 100644
+--- a/src/pki_crypto.c
++++ b/src/pki_crypto.c
+@@ -453,7 +453,7 @@ int pki_key_generate_dss(ssh_key key, int parameter){
+ int rc;
+ #if OPENSSL_VERSION_NUMBER > 0x10100000L
+ key->dsa = DSA_new();
+- if (!key->dsa) {
++ if (key->dsa == NULL) {
+ return SSH_ERROR;
+ }
+ rc = DSA_generate_parameters_ex(key->dsa,
+@@ -464,6 +464,8 @@ int pki_key_generate_dss(ssh_key key, int parameter){
+ NULL, /* h_ret */
+ NULL); /* cb */
+ if (rc != 1) {
++ DSA_free(key->dsa);
++ key->dsa = NULL;
+ return SSH_ERROR;
+ }
+ #else
+--
+2.19.1
+
--- /dev/null
+From 8349ff1ec3d001aa85cc94a9004509cca8ebf036 Mon Sep 17 00:00:00 2001
+From: Rosen Penev <rosenp@gmail.com>
+Date: Wed, 7 Nov 2018 17:17:53 -0800
+Subject: [PATCH] crypto: Fix compilation for OpenSSL without deprecated
+ APIs
+
+Added missing bn.h include.
+
+Made engine.h include conditional, otherwise it would fail.
+
+DSA_generate_parameters was deprecated long before 1.1.0.
+
+Signed-off-by: Rosen Penev <rosenp@gmail.com>
+---
+ src/libcrypto-compat.c | 5 ++++-
+ src/libcrypto-compat.h | 1 +
+ src/pki_crypto.c | 2 +-
+ 3 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/src/libcrypto-compat.c b/src/libcrypto-compat.c
+index 4b1f36a5..b8b4f11a 100644
+--- a/src/libcrypto-compat.c
++++ b/src/libcrypto-compat.c
+@@ -8,9 +8,12 @@
+ */
+
+ #include <string.h>
+-#include <openssl/engine.h>
+ #include "libcrypto-compat.h"
+
++#ifndef OPENSSL_NO_ENGINE
++#include <openssl/engine.h>
++#endif
++
+ static void *OPENSSL_zalloc(size_t num)
+ {
+ void *ret = OPENSSL_malloc(num);
+diff --git a/src/libcrypto-compat.h b/src/libcrypto-compat.h
+index 21542c65..00e4f2a3 100644
+--- a/src/libcrypto-compat.h
++++ b/src/libcrypto-compat.h
+@@ -10,6 +10,7 @@
+ #include <openssl/dh.h>
+ #include <openssl/evp.h>
+ #include <openssl/hmac.h>
++#include <openssl/bn.h>
+
+ int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d);
+ int RSA_set0_factors(RSA *r, BIGNUM *p, BIGNUM *q);
+diff --git a/src/pki_crypto.c b/src/pki_crypto.c
+index d9f7753a..c1aac409 100644
+--- a/src/pki_crypto.c
++++ b/src/pki_crypto.c
+@@ -451,7 +451,7 @@ int pki_key_generate_rsa(ssh_key key, int parameter){
+
+ int pki_key_generate_dss(ssh_key key, int parameter){
+ int rc;
+-#if OPENSSL_VERSION_NUMBER > 0x10100000L
++#if OPENSSL_VERSION_NUMBER > 0x00908000L
+ key->dsa = DSA_new();
+ if (key->dsa == NULL) {
+ return SSH_ERROR;
+--
+2.19.1
+
include $(TOPDIR)/rules.mk
PKG_NAME:=libuv
-PKG_VERSION:=1.20.3
+PKG_VERSION:=1.23.2
PKG_RELEASE:=1
PKG_LICENSE_FILES:=LICENSE
PKG_SOURCE:=$(PKG_NAME)-v$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://dist.libuv.org/dist/v$(PKG_VERSION)/
-PKG_HASH:=3bb7aad916c7a5fd0053dcb6adee49905360a2a160f4a59bc62dbe4370328579
+PKG_HASH:=8ab472ed816bb70c147ddbdfa7b9becfa10921df8a03faf2c87a54eac642c355
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-v$(PKG_VERSION)
PKG_BUILD_PARALLEL:=1
PKG_NAME:=libwebsockets
PKG_VERSION:=3.0.1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
--- /dev/null
+--- a/lib/tls/private.h
++++ b/lib/tls/private.h
+@@ -64,6 +64,8 @@
+ #include <openssl/err.h>
+ #include <openssl/md5.h>
+ #include <openssl/sha.h>
++ #include <openssl/rsa.h>
++ #include <openssl/bn.h>
+ #ifdef LWS_HAVE_OPENSSL_ECDH_H
+ #include <openssl/ecdh.h>
+ #endif
index b260969..ece281d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
-@@ -1050,9 +1050,9 @@ if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR (CMAKE_C_COMPILER_ID
+@@ -1055,9 +1055,9 @@ if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR (CMAKE_C_COMPILER_ID
endif()
if (UNIX AND NOT LWS_WITH_ESP32)
PKG_NAME:=openldap
PKG_VERSION:=2.4.46
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
PKG_SOURCE_URL:=https://gpl.savoirfairelinux.net/pub/mirrors/openldap/openldap-release/ \
--- /dev/null
+From d7a778004b0e0c7453075f1c7d429537162df436 Mon Sep 17 00:00:00 2001
+From: Howard Chu <hyc@openldap.org>
+Date: Fri, 21 Sep 2018 18:41:20 +0100
+Subject: [PATCH] ITS#8809 add missing includes
+
+---
+ libraries/libldap/tls_o.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/libraries/libldap/tls_o.c b/libraries/libldap/tls_o.c
+index 010f311d7..99626ec15 100644
+--- a/libraries/libldap/tls_o.c
++++ b/libraries/libldap/tls_o.c
+@@ -43,6 +43,9 @@
+ #include <openssl/err.h>
+ #include <openssl/rand.h>
+ #include <openssl/safestack.h>
++#include <openssl/bn.h>
++#include <openssl/rsa.h>
++#include <openssl/dh.h>
+ #elif defined( HAVE_SSL_H )
+ #include <ssl.h>
+ #endif
+--
+2.19.1
+
include $(TOPDIR)/rules.mk
PKG_NAME:=qrencode
-PKG_VERSION:=4.0.0
+PKG_VERSION:=4.0.2
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=http://fukuchi.org/works/qrencode/
-PKG_HASH:=c90035e16921117d4086a7fdee65aab85be32beb4a376f6b664b8a425d327d0b
+PKG_SOURCE_URL:=https://fukuchi.org/works/qrencode
+PKG_HASH:=c9cb278d3b28dcc36b8d09e8cad51c0eca754eb004cb0247d4703cb4472b58b4
+
PKG_MAINTAINER:=Jonathan Bennett <JBennett@incomsystems.biz>
PKG_LICENSE:=LGPL-2.1+
+
+PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
PKG_FIXUP:=autoreconf
SECTION:=libs
CATEGORY:=Libraries
TITLE:=Library for encoding data in a QR Code symbol
- URL:=http://fukuchi.org/works/qrencode/
+ URL:=https://fukuchi.org/works/qrencode/
endef
define Package/libqrencode/description
PKG_NAME:=alpine
PKG_VERSION:=2.21.9999
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
--- /dev/null
+diff --git a/imap/src/osdep/unix/ssl_unix.c b/imap/src/osdep/unix/ssl_unix.c
+index 4c4d6ef..f2df2f2 100644
+--- a/imap/src/osdep/unix/ssl_unix.c
++++ b/imap/src/osdep/unix/ssl_unix.c
+@@ -33,9 +33,9 @@
+ #include <bio.h>
+ #include <crypto.h>
+ #include <rand.h>
+-#ifdef OPENSSL_1_1_0
+ #include <rsa.h>
+ #include <bn.h>
++#ifdef OPENSSL_1_1_0
+ #ifdef TLSv1_1_client_method
+ #undef TLSv1_1_client_method
+ #endif /* TLSv1_1_client_method */
+@@ -862,22 +862,16 @@ static RSA *ssl_genkey (SSL_CTX_TYPE *con,int export,int keylength)
+ static RSA *key = NIL;
+ if (!key) { /* if don't have a key already */
+ /* generate key */
+-#ifdef OPENSSL_1_1_0
+ BIGNUM *e = BN_new();
+ if (!RSA_generate_key_ex (key, export ? keylength : 1024, e,NIL)) {
+-#else
+- if (!(key = RSA_generate_key (export ? keylength : 1024,RSA_F4,NIL,NIL))) {
+-#endif /* OPENSSL_1_1_0 */
+ syslog (LOG_ALERT,"Unable to generate temp key, host=%.80s",
+ tcp_clienthost ());
+ while ((i = ERR_get_error ()) != 0L)
+ syslog (LOG_ALERT,"SSL error status: %s",ERR_error_string (i,NIL));
+ exit (1);
+ }
+-#ifdef OPENSSL_1_1_0
+ BN_free(e);
+ e = NULL;
+-#endif /* OPENSSL_1_1_0 */
+ }
+ return key;
+ }
+diff --git a/pith/smkeys.h b/pith/smkeys.h
+index e37eea3..a6c143b 100644
+--- a/pith/smkeys.h
++++ b/pith/smkeys.h
+@@ -32,6 +32,8 @@
+ #include <openssl/safestack.h>
+ #include <openssl/conf.h>
+ #include <openssl/x509v3.h>
++#include <openssl/bn.h>
++#include <openssl/rsa.h>
+
+ #ifndef OPENSSL_1_1_0
+ #define X509_get0_notBefore(x) ((x) && (x)->cert_info \
+@@ -47,9 +49,6 @@
+ ? (x)->cert_info->validity->notAfter \
+ : NULL)
+ #define X509_REQ_get0_pubkey(x) (X509_REQ_get_pubkey((x)))
+-#else
+-#include <openssl/rsa.h>
+-#include <openssl/bn.h>
+ #endif /* OPENSSL_1_1_0 */
+
+ #define EMAILADDRLEADER "emailAddress="
define Package/msmtp-mta
$(call Package/msmtp/Default)
TITLE+= (as MTA)
- DEPENDS+=@(PACKAGE_msmtp||PACAKGE_msmtp-nossl)
+ DEPENDS+=@(PACKAGE_msmtp||PACKAGE_msmtp-nossl)
endef
define Package/msmtp-mta/description
PKG_NAME:=ffmpeg
PKG_VERSION:=3.2.12
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://ffmpeg.org/releases/
define Package/ffserver
-$(call Package/ffserver/Default)
+$(call Package/ffmpeg/Default)
SECTION:=multimedia
CATEGORY:=Multimedia
TITLE+= streaming server
$(call Package/libffmpeg/Default)
TITLE+= (full)
DEPENDS+= +alsa-lib +PACKAGE_libopus:libopus \
- $(if $$(CONFIG_SOFT_FLOAT),\
- +PACKAGE_shine:shine,\
- +PACKAGE_lame-lib:lame-lib +PACKAGE_libx264:libx264 +PACKAGE_fdk-aac:fdk-aac)
+ +SOFT_FLOAT:shine \
+ +!SOFT_FLOAT:lame-lib \
+ +!SOFT_FLOAT:libx264
VARIANT:=full
endef
include $(TOPDIR)/rules.mk
PKG_NAME:=icecast
-PKG_VERSION:=2.4.3
-PKG_RELEASE:=3
+PKG_VERSION:=2.4.4
+PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://downloads.xiph.org/releases/icecast/
-PKG_HASH:=c85ca48c765d61007573ee1406a797ae6cb31fb5961a42e7f1c87adb45ddc592
+PKG_HASH:=49b5979f9f614140b6a38046154203ee28218d8fc549888596a683ad604e4d44
PKG_MAINTAINER:=André Gaul <andre@gaul.io>, \
Ted Hess <thess@kitschensync.net>
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
+PKG_CPE_ID:=cpe:/a:icecast:icecast
PKG_FIXUP:=autoreconf
PKG_INSTALL:= 1
DEPENDS:=+libcurl +libxml2 +libxslt +libogg +libvorbisidec
TITLE:=A streaming media server for Ogg/Vorbis and MP3 audio streams
USERID:=icecast=87:icecast=87
- URL:=http://www.icecast.org/
+ URL:=https://icecast.org/
endef
define Package/icecast/description
+--- a/m4/ogg.m4
++++ b/m4/ogg.m4
+@@ -29,7 +29,7 @@ XIPH_GCC_WARNING([-I$ogg_prefix/include],,
+ ])
+ AC_CACHE_CHECK([for libogg], xt_cv_lib_ogg,
+ [dnl
+-OGG_LIBS="-logg"
++OGG_LIBS="-lvorbisidec"
+
+ #
+ # check if the installed Ogg is sufficiently new.
+diff --git a/m4/vorbis.m4 b/m4/vorbis.m4
+index 17add29..066dc2a 100644
+--- a/m4/vorbis.m4
++++ b/m4/vorbis.m4
+@@ -38,9 +38,9 @@ if test "x$vorbis_prefix" != "x$ogg_prefix"; then
+ ])
+ fi
+
+-VORBIS_LIBS="-lvorbis"
+-VORBISFILE_LIBS="-lvorbisfile"
+-VORBISENC_LIBS="-lvorbisenc"
++VORBIS_LIBS="-lvorbisidec"
++VORBISFILE_LIBS="-lvorbisidec"
++VORBISENC_LIBS="-lvorbisidec"
+
+ xt_save_LIBS="$LIBS"
+ xt_save_LDFLAGS="$LDFLAGS"
+@@ -58,18 +58,6 @@ AC_TRY_LINK_FUNC(ogg_stream_init, [xt_lib_vorbis=ok],
+ )
+ ])
+
+-if test "x$xt_lib_vorbis" = "xok"; then
+-#
+-# Now check if the installed Vorbis is sufficiently new.
+-#
+-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
+-#include <vorbis/codec.h>
+-#include <vorbis/vorbisenc.h>
+- ], [
+-struct ovectl_ratemanage_arg a;
+-])],,[xt_lib_vorbis="old version found"])
+-AC_MSG_RESULT([$xt_lib_vorbis])
+-fi
+ CPPFLAGS="$xt_save_CPPFLAGS"
+ LIBS="$xt_save_LIBS"
+ LDFLAGS="$xt_save_LDFLAGS"
--- a/src/format_vorbis.c
+++ b/src/format_vorbis.c
@@ -19,7 +19,7 @@
typedef struct vorbis_codec_tag
{
-@@ -583,3 +584,91 @@ static refbuf_t *process_vorbis_page (og
+@@ -583,3 +584,91 @@ static refbuf_t *process_vorbis_page (ogg_state_t *ogg_info,
return NULL;
}
+ oggpack_writeclear(&opb);
+ return 0;
+}
---- a/m4/vorbis.m4
-+++ b/m4/vorbis.m4
-@@ -38,9 +38,9 @@ if test "x$vorbis_prefix" != "x$ogg_pref
- ])
- fi
-
--VORBIS_LIBS="-lvorbis"
--VORBISFILE_LIBS="-lvorbisfile"
--VORBISENC_LIBS="-lvorbisenc"
-+VORBIS_LIBS="-lvorbisidec"
-+VORBISFILE_LIBS="-lvorbisidec"
-+VORBISENC_LIBS="-lvorbisidec"
-
- xt_save_LIBS="$LIBS"
- xt_save_LDFLAGS="$LDFLAGS"
-@@ -58,18 +58,6 @@ AC_TRY_LINK_FUNC(ogg_stream_init, [xt_li
- )
- ])
-
--if test "x$xt_lib_vorbis" = "xok"; then
--#
--# Now check if the installed Vorbis is sufficiently new.
--#
--AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
--#include <vorbis/codec.h>
--#include <vorbis/vorbisenc.h>
-- ], [
--struct ovectl_ratemanage_arg a;
--])],,[xt_lib_vorbis="old version found"])
--AC_MSG_RESULT([$xt_lib_vorbis])
--fi
- CPPFLAGS="$xt_save_CPPFLAGS"
- LIBS="$xt_save_LIBS"
- LDFLAGS="$xt_save_LDFLAGS"
---- a/m4/ogg.m4
-+++ b/m4/ogg.m4
-@@ -29,7 +29,7 @@ XIPH_GCC_WARNING([-I$ogg_prefix/include]
- ])
- AC_CACHE_CHECK([for libogg], xt_cv_lib_ogg,
- [dnl
--OGG_LIBS="-logg"
-+OGG_LIBS="-lvorbisidec"
-
- #
- # check if the installed Ogg is sufficiently new.
EXTRA_DIST = HACKING m4/acx_pthread.m4 m4/ogg.m4 \
m4/theora.m4 m4/vorbis.m4 m4/speex.m4 \
-@@ -11,7 +11,7 @@ EXTRA_DIST = HACKING m4/acx_pthread.m4 m
+@@ -11,7 +11,7 @@ EXTRA_DIST = HACKING m4/acx_pthread.m4 m4/ogg.m4 \
m4/xiph_types.m4 m4/xiph_xml2.m4
docdir = $(datadir)/doc/$(PACKAGE)
--- a/m4/xiph_curl.m4
+++ b/m4/xiph_curl.m4
-@@ -52,7 +52,7 @@ AC_CHECK_HEADERS([curl/curl.h],, curl_ok
+@@ -52,7 +52,7 @@ AC_CHECK_HEADERS([curl/curl.h],, curl_ok="no")
AC_MSG_CHECKING(for libcurl)
if test "$curl_ok" = "yes"
then
- <hostname>localhost</hostname>
+ <hostname>OpenWrt</hostname>
- <!-- You may have multiple <listener> elements -->
+ <!-- You may have multiple <listen-socket> elements -->
<listen-socket>
@@ -234,11 +234,9 @@
PKG_NAME:=adblock
PKG_VERSION:=3.5.5
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_LICENSE:=GPL-3.0+
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
config source 'adguard'
option adb_src 'https://filters.adtidy.org/windows/filters/15.txt'
- option adb_src_rset 'BEGIN{FS=\"[/|^|\r]\"}/^\|\|([[:alnum:]_-]+\.)+[[:alpha:]]+([\/\^\r]|$)/{print tolower(\$3)}'
+ option adb_src_rset 'BEGIN{FS=\"[/|^|\r]\"}/^\|\|([[:alnum:]_-]+\.)+[[:alpha:]]+[\/\^\r]+$/{print tolower(\$3)}'
option adb_src_desc 'combined adguard dns filter list, frequent updates, approx. 17.000 entries'
option enabled '0'
include $(TOPDIR)/rules.mk
PKG_NAME:=dhcpcd
-PKG_VERSION:=7.0.5
+PKG_VERSION:=7.0.8
PKG_RELEASE:=1
PKG_SOURCE_URL:=ftp://roy.marples.name/pub/dhcpcd \
http://roy.marples.name/downloads/dhcpcd
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_HASH:=aa43fdb990be7c413fa92bdbcfb3775e4cdbff725cbcb68cd2a714ed4f58879d
+PKG_HASH:=96968e883369ab4afd11eba9dfd9bb109f5dfff65b2814ce6c432f36362dc9b5
PKG_LICENSE:=BSD-2c
PKG_LICENSE_FILES:=
PKG_HASH:=b8e95d1526cd2434dedbae292afd2d17f0780ac2dca2be21264712b41eb76a3d
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/Jool-$(PKG_VERSION)
-PKG_MAINTAINER:=Dan Luedtke <mail@danrl.com>
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
include $(TOPDIR)/rules.mk
PKG_NAME:=miniupnpc
-PKG_VERSION:=2.0.20170509
+PKG_VERSION:=2.1
PKG_RELEASE:=1
-PKG_SOURCE_URL:=http://miniupnp.free.fr/files
+PKG_SOURCE_URL:=https://miniupnp.tuxfamily.org/files
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_HASH:=d3c368627f5cdfb66d3ebd64ca39ba54d6ff14a61966dbecb8dd296b7039f16a
+PKG_HASH:=e19fb5e01ea5a707e2a8cb96f537fbd9f3a913d53d804a3265e3aeab3d2064c6
PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
PKG_INSTALL:=1
define Package/miniupnpc/Default
TITLE:=Lightweight UPnP
- URL:=http://miniupnp.tuxfamily.org/
+ URL:=https://miniupnp.tuxfamily.org
endef
define Package/miniupnpc
--- a/Makefile
+++ b/Makefile
-@@ -187,8 +187,8 @@ installpythonmodule3: pythonmodule3
- python3 setup.py install
+@@ -186,8 +186,8 @@ installpythonmodule3: pythonmodule3
+ MAKE=$(MAKE) python3 setup.py install
validateminixml: minixmlvalid
- @echo "minixml validation test"
--- a/upnpcommands.c
+++ b/upnpcommands.c
-@@ -370,7 +370,7 @@ UPNP_AddPortMapping(const char * control
+@@ -371,7 +371,7 @@ UPNP_AddPortMapping(const char * control
AddPortMappingArgs[5].elt = "NewEnabled";
AddPortMappingArgs[5].val = "1";
AddPortMappingArgs[6].elt = "NewPortMappingDescription";
include $(TOPDIR)/rules.mk
PKG_NAME:=mosquitto
-PKG_VERSION:=1.5.3
-PKG_RELEASE:=3
+PKG_VERSION:=1.5.4
+PKG_RELEASE:=1
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE.txt
PKG_CPE_ID:=cpe:/a:eclipse:mosquitto
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://mosquitto.org/files/source/
-PKG_HASH:=3081a998d303a883b1cd064009beabc88aa9159e26f5258a4ae6007160491d10
+PKG_HASH:=5fd7f3454fd6d286645d032bc07f44a1c8583cec02ef2422c9eb32e0a89a9b2f
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/rules.mk
PKG_NAME:=nft-qos
-PKG_VERSION:=1.0.0
+PKG_VERSION:=1.0.1
PKG_RELEASE:=1
PKG_LICENSE:=GPL-2.0
# static limit rate init
qosdef_init_static() {
local unit_dl unit_ul rate_dl rate_ul
- local limit_enable limit_type hook_ul="input" hook_dl="postrouting"
+ local limit_enable limit_type hook_ul="prerouting" hook_dl="postrouting"
uci_validate_section nft-qos default default \
'limit_enable:bool:0' \
[ -z "$NFT_QOS_HAS_BRIDGE" ] && {
hook_ul="postrouting"
- hook_dl="input"
+ hook_dl="prerouting"
}
qosdef_appendx "table $NFT_QOS_INET_FAMILY nft-qos-static {\n"
depends on NGINX_SSL
help
Add support for NGINX-based Media Streaming Server module.
+ DASH enhanced - https://github.com/ut0mt8/nginx-rtmp-module
default n
config NGINX_TS_MODULE
prompt "Enable RTMP module"
help
Add support for NGINX-based Media Streaming Server module.
+ DASH enhanced - https://github.com/ut0mt8/nginx-rtmp-module
default n
config NGINX_TS_MODULE
PKG_NAME:=nginx
PKG_VERSION:=1.15.5
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=nginx-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://nginx.org/download/
ifeq ($(CONFIG_NGINX_RTMP_MODULE),y)
define Download/nginx-rtmp
- VERSION:=791b6136f02bc9613daf178723ac09f4df5a3bbf
+ VERSION:=c0e7c000ed860ef547a59ecf31f775db63f92b56
SUBDIR:=nginx-rtmp
FILE:=ngx-rtmp-module-$(PKG_VERSION)-$$(VERSION).tar.gz
- URL:=https://github.com/arut/nginx-rtmp-module.git
- MIRROR_HASH:=8db3f7b545ce98f47415e0436e12dfb55ae787afd3cd9515b5642c7b9dc0ef00
+ URL:=https://github.com/ut0mt8/nginx-rtmp-module.git
+ MIRROR_HASH:=ceb8264d920f3ce2fe96af97af824d6800095e3b3ff00e61f088bef9873f421e
PROTO:=git
endef
$(eval $(call Download,nginx-rtmp))
include $(TOPDIR)/rules.mk
PKG_NAME:=nlbwmon
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/jow-/nlbwmon.git
procd_close_instance
}
+add_interface_trigger() {
+ local interface ignore
+
+ config_get interface "$1" interface
+ config_get_bool ignore "$1" ignore 0
+
+ [ -n "$interface" -a $ignore -eq 0 ] && procd_add_interface_trigger "interface.*" "$interface" /etc/init.d/nlbwmon reload
+}
+
+service_triggers() {
+ procd_add_reload_trigger "dhcp" "system"
+
+ config_load dhcp
+ config_foreach add_interface_trigger dhcp
+}
+
KARCH=$(LINUX_KARCH) \
ovs_intree_kmod_configs:=CONFIG_PACKAGE_kmod-openvswitch-intree
-ovs_intree_kmod_enabled:=$(strip $(foreach c,$(ovs_intree_kmod_configs),$(c)))
+ovs_intree_kmod_enabled:=$(strip $(foreach c,$(ovs_intree_kmod_configs),$($(c))))
PKG_CONFIG_DEPENDS+=$(ovs_intree_kmod_configs)
ifneq ($(ovs_intree_kmod_enabled),)
CONFIGURE_ARGS += --with-linux=$(LINUX_DIR)
include $(TOPDIR)/rules.mk
PKG_NAME:=squid
-PKG_VERSION:=4.3
+PKG_VERSION:=4.4
PKG_RELEASE:=1
PKG_LICENSE:=GPL-2.0
PKG_SOURCE_URL:=http://www3.us.squid-cache.org/Versions/v4/ \
http://www2.pl.squid-cache.org/Versions/v4/ \
http://www.squid-cache.org/Versions/v4/
-PKG_HASH:=322612ef0544828f6c673a25124b32364fb41ef5e2847e21c89480b5546a4c7c
+PKG_HASH:=4905e6da7f5574d2583ba36f398bb062a12d51e70d67035078b6e85b09e9ee82
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
src/Makefile.in | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
-Index: squid-4.0.21/src/Makefile.in
-===================================================================
---- squid-4.0.21.orig/src/Makefile.in
-+++ squid-4.0.21/src/Makefile.in
-@@ -7642,7 +7642,8 @@ cache_cf.o: cf_parser.cci
+--- a/src/Makefile.in
++++ b/src/Makefile.in
+@@ -8383,7 +8383,8 @@
# cf_gen builds the configuration files.
cf_gen$(EXEEXT): $(cf_gen_SOURCES) $(cf_gen_DEPENDENCIES) cf_gen_defines.cci
---- squid-4.0.21.orig/src/tools.cc
-+++ squid-4.0.21/src/tools.cc
-@@ -581,7 +581,8 @@
+--- a/src/tools.cc
++++ b/src/tools.cc
+@@ -582,7 +582,8 @@
}
#else
include $(TOPDIR)/rules.mk
PKG_NAME:=tgt
-PKG_VERSION:=1.0.73
-PKG_RELEASE:=2
+PKG_VERSION:=1.0.74
+PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/fujita/tgt/tar.gz/v$(PKG_VERSION)?
-PKG_HASH:=2e3899a2235386a68df8cbf0eccb6a44e221a3e9e6bd9215c903c3fc9ed34bbf
+PKG_HASH:=bfc202790d5326d7a18bd3928b4bb204ffb0acf443a5ec5c16a1a0fbc53be99f
PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
PKG_LICENSE:=GPL-2.0
CATEGORY:=Network
URL:=http://stgt.sourceforge.net/
TITLE:=userspace iSCSI target
- DEPENDS:=+libpthread +libaio @KERNEL_AIO
+ DEPENDS:=+libpthread +libaio
endef
define Package/tgt/description
-diff --git a/usr/Makefile b/usr/Makefile
-index d4e3eaf..ec1c9a3 100644
--- a/usr/Makefile
+++ b/usr/Makefile
@@ -1,11 +1,11 @@
---- tgt-1.0.48.orig/Makefile 2014-06-04 15:03:53.000000000 +0300
-+++ tgt-1.0.48/Makefile 2014-06-04 15:18:13.132963670 +0300
-@@ -64,7 +64,7 @@
+--- a/Makefile
++++ b/Makefile
+@@ -64,7 +64,7 @@ clean-conf:
$(MAKE) -C conf clean
.PHONY: install
-diff --git a/usr/tgtd.h b/usr/tgtd.h
-index d8b2ac1..c6eee54 100644
--- a/usr/tgtd.h
+++ b/usr/tgtd.h
@@ -9,6 +9,10 @@
struct concat_buf;
#define NR_SCSI_OPCODES 256
-diff --git a/usr/util.h b/usr/util.h
-index 0e34c35..3e2e63b 100644
--- a/usr/util.h
+++ b/usr/util.h
@@ -16,6 +16,10 @@
PKG_NAME:=unbound
PKG_VERSION:=1.8.1
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE
--- /dev/null
+diff --git a/daemon/daemon.c b/daemon/daemon.c
+index 4c3d5f1..50f5060 100644
+--- a/daemon/daemon.c
++++ b/daemon/daemon.c
+@@ -769,7 +769,7 @@ daemon_delete(struct daemon* daemon)
+ # endif
+ # ifdef HAVE_OPENSSL_CONFIG
+ EVP_cleanup();
+-# if OPENSSL_VERSION_NUMBER < 0x10100000
++# if (OPENSSL_VERSION_NUMBER < 0x10100000) || !defined(OPENSSL_NO_ENGINE)
+ ENGINE_cleanup();
+ # endif
+ CONF_modules_free();
+diff --git a/util/net_help.c b/util/net_help.c
+index 91368c8..a932010 100644
+--- a/util/net_help.c
++++ b/util/net_help.c
+@@ -1006,10 +1006,10 @@ void* outgoing_ssl_fd(void* sslctx, int fd)
+ static lock_basic_type *ub_openssl_locks = NULL;
+
+ /** callback that gets thread id for openssl */
+-static unsigned long
+-ub_crypto_id_cb(void)
++static void
++ub_crypto_id_cb(CRYPTO_THREADID *id)
+ {
+- return (unsigned long)log_thread_get();
++ CRYPTO_THREADID_set_numeric(id, (unsigned long)log_thread_get());
+ }
+
+ static void
+@@ -1035,7 +1035,7 @@ int ub_openssl_lock_init(void)
+ for(i=0; i<CRYPTO_num_locks(); i++) {
+ lock_basic_init(&ub_openssl_locks[i]);
+ }
+- CRYPTO_set_id_callback(&ub_crypto_id_cb);
++ CRYPTO_THREADID_set_callback(&ub_crypto_id_cb);
+ CRYPTO_set_locking_callback(&ub_crypto_lock_cb);
+ #endif /* OPENSSL_THREADS */
+ return 1;
+@@ -1047,7 +1047,7 @@ void ub_openssl_lock_delete(void)
+ int i;
+ if(!ub_openssl_locks)
+ return;
+- CRYPTO_set_id_callback(NULL);
++ CRYPTO_THREADID_set_callback(NULL);
+ CRYPTO_set_locking_callback(NULL);
+ for(i=0; i<CRYPTO_num_locks(); i++) {
+ lock_basic_destroy(&ub_openssl_locks[i]);
PKG_NAME:=znc
PKG_VERSION:=1.7.1
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://znc.in/releases \
--disable-perl \
--enable-poll \
--disable-python \
- --enable-ssl \
+ --enable-openssl \
--disable-swig \
--disable-tcl \
--enable-tdns \
--- /dev/null
+diff --git a/configure b/configure
+index 18c5005..908fc09 100755
+--- a/configure
++++ b/configure
+@@ -4746,6 +4746,7 @@ $as_echo_n "checking whether openssl is usable... " >&6; }
+
+
+ #include <openssl/ssl.h>
++ #include <openssl/dh.h>
+
+ int
+ main ()
+diff --git a/configure.ac b/configure.ac
+index c94833e..b46a53d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -368,6 +368,7 @@ if test "x$SSL" != "xno"; then
+ AC_LINK_IFELSE([
+ AC_LANG_PROGRAM([[
+ #include <openssl/ssl.h>
++ #include <openssl/dh.h>
+ ]], [[
+ SSL_CTX* ctx = SSL_CTX_new(TLSv1_method());
+ SSL* ssl = SSL_new(ctx);
+diff --git a/src/Utils.cpp b/src/Utils.cpp
+index cced568..425831a 100644
+--- a/src/Utils.cpp
++++ b/src/Utils.cpp
+@@ -27,6 +27,8 @@
+ #include <znc/Message.h>
+ #ifdef HAVE_LIBSSL
+ #include <openssl/ssl.h>
++#include <openssl/bn.h>
++#include <openssl/rsa.h>
+ #endif /* HAVE_LIBSSL */
+ #include <memory>
+ #include <unistd.h>
+diff --git a/src/main.cpp b/src/main.cpp
+index 7d4e209..8d458a9 100644
+--- a/src/main.cpp
++++ b/src/main.cpp
+@@ -46,8 +46,8 @@ static void locking_callback(int mode, int type, const char* file, int line) {
+ }
+ }
+
+-static unsigned long thread_id_callback() {
+- return (unsigned long)pthread_self();
++static void thread_id_callback(CRYPTO_THREADID *id) {
++ CRYPTO_THREADID_set_numeric(id, (unsigned long)pthread_self());
+ }
+
+ static CRYPTO_dynlock_value* dyn_create_callback(const char* file, int line) {
+@@ -78,7 +78,7 @@ static void thread_setup() {
+ for (std::unique_ptr<CMutex>& mtx : lock_cs)
+ mtx = std::unique_ptr<CMutex>(new CMutex());
+
+- CRYPTO_set_id_callback(&thread_id_callback);
++ CRYPTO_THREADID_set_callback(&thread_id_callback);
+ CRYPTO_set_locking_callback(&locking_callback);
+
+ CRYPTO_set_dynlock_create_callback(&dyn_create_callback);
+diff --git a/third_party/Csocket/Csocket.cc b/third_party/Csocket/Csocket.cc
+index 46a3bfd..017d22f 100644
+--- a/third_party/Csocket/Csocket.cc
++++ b/third_party/Csocket/Csocket.cc
+@@ -47,10 +47,16 @@
+ #include <stdio.h>
+ #include <openssl/ssl.h>
+ #include <openssl/conf.h>
+-#include <openssl/engine.h>
++#include <openssl/bn.h>
++#include <openssl/dh.h>
++#include <openssl/dsa.h>
++#include <openssl/rsa.h>
+ #ifndef OPENSSL_NO_COMP
+ #include <openssl/comp.h>
+ #endif
++#ifndef OPENSSL_NO_ENGINE
++#include <openssl/engine.h>
++#endif
+ #define HAVE_ERR_REMOVE_STATE
+ #ifdef OPENSSL_VERSION_NUMBER
+ # if OPENSSL_VERSION_NUMBER >= 0x10000000
include $(TOPDIR)/rules.mk
PKG_NAME:=alsa-utils
-PKG_VERSION:=1.1.6
-PKG_RELEASE:=2
+PKG_VERSION:=1.1.7
+PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=ftp://ftp.alsa-project.org/pub/utils/ \
http://distfiles.gentoo.org/distfiles/
-PKG_HASH:=155caecc40b2220f686f34ba3655a53e3bdbc0586adb1056733949feaaf7d36e
+PKG_HASH:=1db27fb54ab7fdeb54b00d68b8a174808ffea198cfbd67e3c959482194e1540a
PKG_INSTALL:=1
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=cryptodev-linux
-PKG_VERSION:=1.9.git-2017-10-04
+PKG_VERSION:=1.9.git-2018-11-02
PKG_RELEASE:=1
PKG_SOURCE_URL:=https://github.com/cryptodev-linux/cryptodev-linux
PKG_SOURCE_PROTO:=git
-PKG_SOURCE_VERSION:=0a54e38b264d9a3bed74c642a61b88191660d0f8
-PKG_MIRROR_HASH:=af3c303afe7ff995b120add6101261a652a6478a2a69018dd740f49a8b14ed09
+PKG_SOURCE_VERSION:=f1a693000d116718379f8b53ed7bc6b9c0f7de27
+PKG_MIRROR_HASH:=340d314e2a88bf2449ccee906b141e085d376f6e2a94a64e36254e8376323169
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
include $(TOPDIR)/rules.mk
PKG_NAME:=dmidecode
-PKG_VERSION:=3.1
+PKG_VERSION:=3.2
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@SAVANNAH/$(PKG_NAME)
-PKG_HASH:=d766ce9b25548c59b1e7e930505b4cad9a7bb0b904a1a391fbb604d529781ac0
+PKG_HASH:=077006fa2da0d06d6383728112f2edef9684e9c8da56752e97cd45a11f838edd
PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
PKG_LICENSE:=GPL-2.0
CATEGORY:=Utilities
DEPENDS:=@(TARGET_x86||TARGET_x86_64)
TITLE:=Displays BIOS informations.
- URL:=http://www.nongnu.org/dmidecode/
+ URL:=https://www.nongnu.org/dmidecode/
endef
define Package/dmidecode/description
include $(TOPDIR)/rules.mk
PKG_NAME:=hplip
-PKG_VERSION:=3.18.9
+PKG_VERSION:=3.18.10
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/hplip
-PKG_HASH:=20093830994de16bb36c049c1fdb688569531525fb994f7e605e66266a2d783c
+PKG_HASH:=50d3c645f4ba5ae4a10c0f87cedcd0c0fd1598b412c9511476a9bb3b13101901
PKG_MAINTAINER:=Luiz Angelo Daros de Luca <luizluca@gmail.com>
PKG_LICENSE:=GPL-2.0 GPL-2.0+
include $(TOPDIR)/rules.mk
PKG_NAME:=jq
-PKG_VERSION:=1.5
-PKG_RELEASE:=2
+PKG_VERSION:=1.6
+PKG_RELEASE:=1
PKG_LICENSE:=BSD
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/stedolan/jq/releases/download/jq-$(PKG_VERSION)/
-PKG_HASH:=c4d2bfec6436341113419debf479d833692cc5cdab7eb0326b5a4d4fbe9f493c
+PKG_HASH:=9625784cf2e4fd9842f1d407681ce4878b5b0dcddbcd31c6135114a30c71e6a8
PKG_INSTALL:=1
TARGET_CFLAGS += -std=c99
+CONFIGURE_ARGS+= \
+ --disable-docs \
+ --disable-valgrind \
+ --without-oniguruma
+
define Package/jq
SECTION:=utils
CATEGORY:=Utilities
+++ /dev/null
-From 2d38a12d686a5156d4e7afb1fed7851805590582 Mon Sep 17 00:00:00 2001
-From: W-Mark Kubacki <wmark@hurrikane.de>
-Date: Fri, 19 Aug 2016 19:50:39 +0200
-Subject: [PATCH] Skip printing at MAX_DEPTH and deeper
-
-This addresses #1136, and mitigates a stack exhaustion when printing
-a very deeply nested term.
----
- src/jv_print.c | 8 +++++++-
- 1 file changed, 7 insertions(+), 1 deletion(-)
-
-diff --git a/src/jv_print.c b/src/jv_print.c
-index 5f4f234..cf6651b 100644
---- src/jv_print.c
-+++ src/jv_print.c
-@@ -13,6 +13,10 @@
- #include "jv_dtoa.h"
- #include "jv_unicode.h"
-
-+#ifndef MAX_DEPTH
-+#define MAX_DEPTH 256
-+#endif
-+
- #define ESC "\033"
- #define COL(c) (ESC "[" c "m")
- #define COLRESET (ESC "[0m")
-@@ -150,7 +154,9 @@ static void jv_dump_term(struct dtoa_context* C, jv x, int flags, int indent, FI
- }
- }
- }
-- switch (jv_get_kind(x)) {
-+ if (indent > MAX_DEPTH) {
-+ put_str("<stripped: exceeds max depth>", F, S, flags & JV_PRINT_ISATTY);
-+ } else switch (jv_get_kind(x)) {
- default:
- case JV_KIND_INVALID:
- if (flags & JV_PRINT_INVALID) {
+++ /dev/null
-From 8eb1367ca44e772963e704a700ef72ae2e12babd Mon Sep 17 00:00:00 2001
-From: Nicolas Williams <nico@cryptonector.com>
-Date: Sat, 24 Oct 2015 17:24:57 -0500
-Subject: [PATCH] Heap buffer overflow in tokenadd() (fix #105)
-
-This was an off-by one: the NUL terminator byte was not allocated on
-resize. This was triggered by JSON-encoded numbers longer than 256
-bytes.
----
- src/jv_parse.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/src/jv_parse.c b/src/jv_parse.c
-index 3102ed4..84245b8 100644
---- src/jv_parse.c
-+++ src/jv_parse.c
-@@ -383,7 +383,7 @@ static pfunc stream_token(struct jv_parser* p, char ch) {
-
- static void tokenadd(struct jv_parser* p, char c) {
- assert(p->tokenpos <= p->tokenlen);
-- if (p->tokenpos == p->tokenlen) {
-+ if (p->tokenpos >= (p->tokenlen - 1)) {
- p->tokenlen = p->tokenlen*2 + 256;
- p->tokenbuf = jv_mem_realloc(p->tokenbuf, p->tokenlen);
- }
-@@ -485,7 +485,7 @@ static pfunc check_literal(struct jv_parser* p) {
- TRY(value(p, v));
- } else {
- // FIXME: better parser
-- p->tokenbuf[p->tokenpos] = 0; // FIXME: invalid
-+ p->tokenbuf[p->tokenpos] = 0;
- char* end = 0;
- double d = jvp_strtod(&p->dtoa, p->tokenbuf, &end);
- if (end == 0 || *end != 0)
include $(TOPDIR)/rules.mk
PKG_NAME:=open-plc-utils
-PKG_VERSION:=2017-12-03
+PKG_VERSION:=2018-11-03
PKG_RELEASE:=$(PKG_SOURCE_VERSION)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/qca/open-plc-utils.git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=18b7e2a9a17f043fe8ac8b457680aafb1c249c55
+PKG_SOURCE_VERSION:=32408520fcebe785983a68e39ec83830a3005779
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
-PKG_MIRROR_HASH:=8ccbee8a6eb9a9be97bab74e02033cdb57456ae5f78fd3b19a3661352b89e259
+PKG_MIRROR_HASH:=1c5a2bb75550f1d7069f857c30f1f45ccfd3b0b0e9abadbca10f4df582f51d1c
PKG_MAINTAINER:=Florian Fainelli <florian@openwrt.org>
+++ /dev/null
-Index: open-plc-utils-2017-01-15/docbook/version.h.html
-===================================================================
---- open-plc-utils-2017-01-15.orig/docbook/version.h.html 2017-01-13 19:44:27.000000000 +0100
-+++ open-plc-utils-2017-01-15/docbook/version.h.html 2017-12-03 03:46:31.119387280 +0100
-@@ -40,7 +40,6 @@
- #define PROJECT "open-plc-utils"
- #define VERSION "0.0.6"
- #define RELEASE "OSRQCA-929"
--#define COMPILE __TIME__ " " __DATE__
- #define CONTACT "cmaier@qca.qualcomm.com"
- #define LICENSE "Clear BSD"
-
-Index: open-plc-utils-2017-01-15/tools/version.c
-===================================================================
---- open-plc-utils-2017-01-15.orig/tools/version.c 2017-01-13 19:44:27.000000000 +0100
-+++ open-plc-utils-2017-01-15/tools/version.c 2017-12-03 03:45:57.358690651 +0100
-@@ -30,7 +30,6 @@
- printf (RELEASE " ");
- printf ("ISO C ");
-- printf (COMPANY " ");
-+ printf (COMPANY "\n");
-- printf (COMPILE "\n");
- return;
- }
-
-Index: open-plc-utils-2017-01-15/tools/version.h
-===================================================================
---- open-plc-utils-2017-01-15.orig/tools/version.h 2017-01-13 19:44:27.000000000 +0100
-+++ open-plc-utils-2017-01-15/tools/version.h 2017-12-03 03:46:08.902929217 +0100
-@@ -20,7 +20,6 @@
- #define PROJECT "open-plc-utils"
- #define VERSION "0.0.6"
- #define RELEASE "OSRQCA-929"
--#define COMPILE __TIME__ " " __DATE__
- #define CONTACT "https://github.com/qca/open-plc-utils"
- #define LICENSE "Clear BSD"
-
include $(TOPDIR)/rules.mk
PKG_NAME:=rng-tools
-PKG_VERSION:=5
-PKG_RELEASE:=6
+PKG_VERSION:=6.6
+PKG_RELEASE:=1
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=@SF/gkernel/rng-tools/$(PKG_VERSION)/
-PKG_HASH:=60a102b6603bbcce2da341470cad42eeaa9564a16b4490e7867026ca11a3078e
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/nhorman/rng-tools.git
+PKG_SOURCE_VERSION:=4ebc21d6f387bb7b4b3f6badc429e27b21c0a6ee
+PKG_MIRROR_HASH:=d942283b7482337d40a4933f7b24a5d1361518dacf9c87928f5ea06d492e95b0
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
PKG_LICENSE:=GPLv2
PKG_MAINTAINER:=Nathaniel Wesley Filardo <nwfilardo@gmail.com>
SECTION:=utils
CATEGORY:=Utilities
TITLE:=Daemon for adding entropy to kernel entropy pool
- URL:=http://sourceforge.net/projects/gkernel/
+ URL:=https://github.com/nhorman/rng-tools
+ DEPENDS:=+libsysfs
endef
define Package/rng-tools/description
endif
CONFIGURE_ARGS += \
- --without-libgcrypt
+ --without-libgcrypt \
+ --without-nistbeacon
+
+define Build/Prepare
+ $(call Build/Prepare/Default)
+ (cd $(PKG_BUILD_DIR); ln -s README.md README)
+endef
define Package/rng-tools/install
$(INSTALL_DIR) $(1)/etc/init.d
+++ /dev/null
-From d401b23149a89fc14806dc8c347f2a85205a95cd Mon Sep 17 00:00:00 2001
-From: Philip Prindeville <philipp@redfish-solutions.com>
-Date: Mon, 26 Jun 2017 18:34:04 -0600
-Subject: [PATCH v1 1/1] Cleanup calls to message() containing newlines
-To: Philipp Rumpf <prumpf@mandrakesoft.com>, Jeff Garzik <jgarzik@pobox.com>, Henrique de Moraes Holschuh <hmh@debian.org>, Andrew Morton <akpm@linux-foundation.org>
-Cc: Philip Prindeville <philipp@redfish-solutions.com>
-
-Newlines are added automatically by logging daemons, and having
-embedded newlines can cause extra blank lines in syslog-ng,
-busybox, etc.
-
-Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
----
- rngd.c | 8 ++++----
- rngd_entsource.c | 6 +++---
- rngd_linux.c | 2 +-
- rngd_rdrand.c | 6 +++---
- 4 files changed, 11 insertions(+), 11 deletions(-)
-
-diff --git a/rngd.c b/rngd.c
-index 0205d40e0abb970fb126460306398388bd7462a0..f10198682a14f2f1460100a1d274ad0d724cb326 100644
---- a/rngd.c
-+++ b/rngd.c
-@@ -271,7 +271,7 @@ static void do_loop(int random_step)
- } else if (iter->failures >= MAX_RNG_FAILURES) {
- if (!arguments->quiet)
- message(LOG_DAEMON|LOG_ERR,
-- "too many FIPS failures, disabling entropy source\n");
-+ "too many FIPS failures, disabling entropy source");
- iter->disabled = true;
- }
- }
-@@ -282,7 +282,7 @@ static void do_loop(int random_step)
-
- if (!arguments->quiet)
- message(LOG_DAEMON|LOG_ERR,
-- "No entropy sources working, exiting rngd\n");
-+ "No entropy sources working, exiting rngd");
- }
-
- static void term_signal(int signo)
-@@ -317,7 +317,7 @@ int main(int argc, char **argv)
- message(LOG_DAEMON|LOG_ERR,
- "can't open any entropy source");
- message(LOG_DAEMON|LOG_ERR,
-- "Maybe RNG device modules are not loaded\n");
-+ "Maybe RNG device modules are not loaded");
- }
- return 1;
- }
-@@ -337,7 +337,7 @@ int main(int argc, char **argv)
- && (rc_tpm || !arguments->enable_tpm)) {
- if (!arguments->quiet)
- message(LOG_DAEMON|LOG_ERR,
-- "No entropy source available, shutting down\n");
-+ "No entropy source available, shutting down");
- return 1;
- }
-
-diff --git a/rngd_entsource.c b/rngd_entsource.c
-index f0e219d7af674204e5bdcf96e9045c40717872c3..8c1d7cb33159c9a0e03a4ea83f3a3358c706e2e3 100644
---- a/rngd_entsource.c
-+++ b/rngd_entsource.c
-@@ -64,7 +64,7 @@ int xread(void *buf, size_t size, struct rng *ent_src)
- }
-
- if (size) {
-- message(LOG_DAEMON|LOG_ERR, "read error\n");
-+ message(LOG_DAEMON|LOG_ERR, "read error");
- return -1;
- }
- return 0;
-@@ -114,7 +114,7 @@ int xread_tpm(void *buf, size_t size, struct rng *ent_src)
- sizeof(rng_cmd) - r);
- if (retval < 0) {
- message(LOG_ERR|LOG_INFO,
-- "Error writing %s\n",
-+ "Error writing %s",
- ent_src->rng_name);
- retval = -1;
- goto error_out;
-@@ -123,7 +123,7 @@ int xread_tpm(void *buf, size_t size, struct rng *ent_src)
- }
- if (r < sizeof(rng_cmd)) {
- message(LOG_ERR|LOG_INFO,
-- "Error writing %s\n", ent_src->rng_name);
-+ "Error writing %s", ent_src->rng_name);
- retval = -1;
- goto error_out;
- }
-diff --git a/rngd_linux.c b/rngd_linux.c
-index c4f45dedecad0fd3bf80a35d7c240b917bf5ffdd..481c6bb15def3f06989766988b61f35d91207b58 100644
---- a/rngd_linux.c
-+++ b/rngd_linux.c
-@@ -131,7 +131,7 @@ void random_add_entropy(void *buf, size_t size)
- memcpy(entropy.data, buf, size);
-
- if (ioctl(random_fd, RNDADDENTROPY, &entropy) != 0) {
-- message(LOG_DAEMON|LOG_ERR, "RNDADDENTROPY failed: %s\n",
-+ message(LOG_DAEMON|LOG_ERR, "RNDADDENTROPY failed: %s",
- strerror(errno));
- exit(1);
- }
-diff --git a/rngd_rdrand.c b/rngd_rdrand.c
-index 4d7a5a7b3f52c3af8e677d3c4d758d4d235f1dd6..c1919d538428a8647dbce88d7d76384761e5b6cc 100644
---- a/rngd_rdrand.c
-+++ b/rngd_rdrand.c
-@@ -162,7 +162,7 @@ static inline int gcrypt_mangle(unsigned char *tmp)
-
- if (gcry_error) {
- message(LOG_DAEMON|LOG_ERR,
-- "gcry_cipher_encrypt error: %s\n",
-+ "gcry_cipher_encrypt error: %s",
- gcry_strerror(gcry_error));
- return -1;
- }
-@@ -257,7 +257,7 @@ static int init_gcrypt(const void *key)
-
- if (!gcry_check_version(MIN_GCRYPT_VERSION)) {
- message(LOG_DAEMON|LOG_ERR,
-- "libgcrypt version mismatch: have %s, require >= %s\n",
-+ "libgcrypt version mismatch: have %s, require >= %s",
- gcry_check_version(NULL), MIN_GCRYPT_VERSION);
- return 1;
- }
-@@ -278,7 +278,7 @@ static int init_gcrypt(const void *key)
-
- if (gcry_error) {
- message(LOG_DAEMON|LOG_ERR,
-- "could not set key or IV: %s\n",
-+ "could not set key or IV: %s",
- gcry_strerror(gcry_error));
- gcry_cipher_close(gcry_cipher_hd);
- return 1;
---
-2.7.4
-
include $(TOPDIR)/rules.mk
PKG_NAME:=sysstat
-PKG_VERSION:=11.6.4
+PKG_VERSION:=12.0.2
PKG_RELEASE:=1
PKG_LICENSE:=GPL-2.0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://pagesperso-orange.fr/sebastien.godard/
-PKG_HASH:=6aa6398b200f09a2874fffc9c31eb943aea64d707a4afe5f5f1751d876157b09
+PKG_HASH:=2d30947c8fabbb5015c229fbc149f2891db4926cdf165e5f099310795d8dac80
PKG_INSTALL:=1