PKG_NAME:=zabbix
PKG_VERSION:=5.0.1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://cdn.zabbix.com/zabbix/sources/stable/5.0/
TITLE:=Zabbix
URL:=https://www.zabbix.com/
USERID:=zabbix=53:zabbix=53
- DEPENDS += $(ICONV_DEPENDS) +libpcre +zlib +ZABBIX_GNUTLS:libgnutls +ZABBIX_OPENSSL:libopenssl
+ DEPENDS += $(ICONV_DEPENDS) +libpcre +zlib +ZABBIX_GNUTLS:libgnutls +ZABBIX_OPENSSL:libopenssl @!USE_UCLIBC
endef
define Package/zabbix-agentd
+++ /dev/null
---- a/src/libs/zbxsysinfo/linux/cpu.c
-+++ b/src/libs/zbxsysinfo/linux/cpu.c
-@@ -22,6 +22,45 @@
- #include "stats.h"
- #include "log.h"
-
-+
-+/* uclibc and dietlibc do not have this junk -ReneR */
-+#if defined (__UCLIBC__) || defined (__dietlibc__)
-+static int getloadavg (double loadavg[], int nelem)
-+{
-+ int fd;
-+
-+ fd = open ("/proc/loadavg", O_RDONLY);
-+ if (fd < 0)
-+ return -1;
-+ else
-+ {
-+ char buf[65], *p;
-+ ssize_t nread;
-+ int i;
-+
-+ nread = read (fd, buf, sizeof buf - 1);
-+ close (fd);
-+ if (nread <= 0)
-+ return -1;
-+ buf[nread - 1] = '\0';
-+
-+ if (nelem > 3)
-+ nelem = 3;
-+ p = buf;
-+ for (i = 0; i < nelem; ++i)
-+ {
-+ char *endp;
-+ loadavg[i] = strtod (p, &endp);
-+ if (endp == p)
-+ return -1;
-+ p = endp;
-+ }
-+
-+ return i;
-+ }
-+}
-+#endif
-+
- int SYSTEM_CPU_NUM(AGENT_REQUEST *request, AGENT_RESULT *result)
- {
- char *type;
PKG_NAME:=lpc21isp
PKG_VERSION:=197
-PKG_RELEASE:=3
+PKG_RELEASE:=4
PKG_LICENSE:=LGPL-3.0-or-later
PKG_LICENSE_FILES:=README gpl.txt lgpl-3.0.txt
--- /dev/null
+--- a/lpc21isp.c
++++ b/lpc21isp.c
+@@ -533,7 +533,7 @@ static void OpenSerialPort(ISP_ENVIRONMENT *IspEnvironment)
+
+ tcgetattr(IspEnvironment->fdCom, &IspEnvironment->oldtio); /* save current port settings */
+
+- bzero(&IspEnvironment->newtio, sizeof(IspEnvironment->newtio));
++ memset(&IspEnvironment->newtio, 0, sizeof(IspEnvironment->newtio));
+ IspEnvironment->newtio.c_cflag = CS8 | CLOCAL | CREAD;
+
+ #if defined(__FreeBSD__) || defined(__OpenBSD__)
--- /dev/null
+--- a/lpc21isp.c
++++ b/lpc21isp.c
+@@ -1130,7 +1130,8 @@ void ClearSerialPortBuffers(ISP_ENVIRONMENT *IspEnvironment)
+ */
+ void Sleep(unsigned long MilliSeconds)
+ {
+- usleep(MilliSeconds*1000); //convert to microseconds
++ struct timespec m = { MilliSeconds / 1000 , (MilliSeconds % 1000 ) * 1000 * 1000};
++ nanosleep(&m, &m); //convert to nanoseconds
+ }
+ #endif // defined COMPILE_FOR_LINUX
+
include $(TOPDIR)/rules.mk
PKG_NAME:=meson
-PKG_VERSION:=0.55.0
-PKG_RELEASE:=3
+PKG_VERSION:=0.55.1
+PKG_RELEASE:=1
PYPI_NAME:=meson
-PKG_HASH:=0a1ae2bfe2ae14ac47593537f93290fb79e9b775c55b4c53c282bc3ca3745b35
+PKG_HASH:=3b5741f884e04928bdfa1947467ff06afa6c98e623c25cef75adf71ca39ce080
PKG_MAINTAINER:=Andre Heider <a.heider@gmail.com>
PKG_LICENSE:=Apache-2.0
+++ /dev/null
-From 019ed04331695bb6f5c5fff70dfced34c4ba9012 Mon Sep 17 00:00:00 2001
-From: Daniel Mensinger <daniel@mensinger-ka.de>
-Date: Thu, 16 Jul 2020 20:29:34 +0200
-Subject: [PATCH 1/3] mdata: Generate mesondata.py from */data folders
-
----
- mesonbuild/mesondata.py | 374 ++++++++++++++++++++++++++++++++++++++++
- tools/gen_data.py | 139 +++++++++++++++
- 2 files changed, 513 insertions(+)
- create mode 100644 mesonbuild/mesondata.py
- create mode 100755 tools/gen_data.py
-
-diff --git a/mesonbuild/mesondata.py b/mesonbuild/mesondata.py
-new file mode 100644
-index 0000000000..1f223c251b
---- /dev/null
-+++ b/mesonbuild/mesondata.py
-@@ -0,0 +1,374 @@
-+# Copyright 2020 The Meson development team
-+
-+# Licensed under the Apache License, Version 2.0 (the "License");
-+# you may not use this file except in compliance with the License.
-+# You may obtain a copy of the License at
-+
-+# http://www.apache.org/licenses/LICENSE-2.0
-+
-+# Unless required by applicable law or agreed to in writing, software
-+# distributed under the License is distributed on an "AS IS" BASIS,
-+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-+# See the License for the specific language governing permissions and
-+# limitations under the License.
-+
-+
-+####
-+#### WARNING: This is an automatically generated file! Do not edit!
-+#### Generated by tools/gen_data.py
-+####
-+
-+
-+from pathlib import Path
-+import typing as T
-+
-+if T.TYPE_CHECKING:
-+ from .environment import Environment
-+
-+######################
-+# BEGIN Data section #
-+######################
-+
-+file_0_data_CMakeListsLLVM_txt = '''\
-+cmake_minimum_required(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} )
-+
-+set(PACKAGE_FOUND FALSE)
-+
-+while(TRUE)
-+ find_package(LLVM REQUIRED CONFIG QUIET)
-+
-+ # ARCHS has to be set via the CMD interface
-+ if(LLVM_FOUND OR "${ARCHS}" STREQUAL "")
-+ break()
-+ endif()
-+
-+ list(GET ARCHS 0 CMAKE_LIBRARY_ARCHITECTURE)
-+ list(REMOVE_AT ARCHS 0)
-+endwhile()
-+
-+if(LLVM_FOUND)
-+ set(PACKAGE_FOUND TRUE)
-+
-+ foreach(mod IN LISTS LLVM_MESON_MODULES)
-+ # Reset variables
-+ set(out_mods)
-+ set(real_mods)
-+
-+ # Generate a lower and upper case version
-+ string(TOLOWER "${mod}" mod_L)
-+ string(TOUPPER "${mod}" mod_U)
-+
-+ # Get the mapped components
-+ llvm_map_components_to_libnames(out_mods ${mod} ${mod_L} ${mod_U})
-+ list(SORT out_mods)
-+ list(REMOVE_DUPLICATES out_mods)
-+
-+ # Make sure that the modules exist
-+ foreach(i IN LISTS out_mods)
-+ if(TARGET ${i})
-+ list(APPEND real_mods ${i})
-+ endif()
-+ endforeach()
-+
-+ # Set the output variables
-+ set(MESON_LLVM_TARGETS_${mod} ${real_mods})
-+ foreach(i IN LISTS real_mods)
-+ set(MESON_TARGET_TO_LLVM_${i} ${mod})
-+ endforeach()
-+ endforeach()
-+
-+ # Check the following variables:
-+ # LLVM_PACKAGE_VERSION
-+ # LLVM_VERSION
-+ # LLVM_VERSION_STRING
-+ if(NOT DEFINED PACKAGE_VERSION)
-+ if(DEFINED LLVM_PACKAGE_VERSION)
-+ set(PACKAGE_VERSION "${LLVM_PACKAGE_VERSION}")
-+ elseif(DEFINED LLVM_VERSION)
-+ set(PACKAGE_VERSION "${LLVM_VERSION}")
-+ elseif(DEFINED LLVM_VERSION_STRING)
-+ set(PACKAGE_VERSION "${LLVM_VERSION_STRING}")
-+ endif()
-+ endif()
-+
-+ # Check the following variables:
-+ # LLVM_LIBRARIES
-+ # LLVM_LIBS
-+ set(libs)
-+ if(DEFINED LLVM_LIBRARIES)
-+ set(libs LLVM_LIBRARIES)
-+ elseif(DEFINED LLVM_LIBS)
-+ set(libs LLVM_LIBS)
-+ endif()
-+
-+ # Check the following variables:
-+ # LLVM_INCLUDE_DIRS
-+ # LLVM_INCLUDES
-+ # LLVM_INCLUDE_DIR
-+ set(includes)
-+ if(DEFINED LLVM_INCLUDE_DIRS)
-+ set(includes LLVM_INCLUDE_DIRS)
-+ elseif(DEFINED LLVM_INCLUDES)
-+ set(includes LLVM_INCLUDES)
-+ elseif(DEFINED LLVM_INCLUDE_DIR)
-+ set(includes LLVM_INCLUDE_DIR)
-+ endif()
-+
-+ # Check the following variables:
-+ # LLVM_DEFINITIONS
-+ set(definitions)
-+ if(DEFINED LLVM_DEFINITIONS)
-+ set(definitions LLVM_DEFINITIONS)
-+ endif()
-+
-+ set(PACKAGE_INCLUDE_DIRS "${${includes}}")
-+ set(PACKAGE_DEFINITIONS "${${definitions}}")
-+ set(PACKAGE_LIBRARIES "${${libs}}")
-+endif()
-+'''
-+
-+file_1_data_CMakePathInfo_txt = '''\
-+cmake_minimum_required(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION})
-+
-+set(TMP_PATHS_LIST)
-+list(APPEND TMP_PATHS_LIST ${CMAKE_PREFIX_PATH})
-+list(APPEND TMP_PATHS_LIST ${CMAKE_FRAMEWORK_PATH})
-+list(APPEND TMP_PATHS_LIST ${CMAKE_APPBUNDLE_PATH})
-+list(APPEND TMP_PATHS_LIST $ENV{CMAKE_PREFIX_PATH})
-+list(APPEND TMP_PATHS_LIST $ENV{CMAKE_FRAMEWORK_PATH})
-+list(APPEND TMP_PATHS_LIST $ENV{CMAKE_APPBUNDLE_PATH})
-+list(APPEND TMP_PATHS_LIST ${CMAKE_SYSTEM_PREFIX_PATH})
-+list(APPEND TMP_PATHS_LIST ${CMAKE_SYSTEM_FRAMEWORK_PATH})
-+list(APPEND TMP_PATHS_LIST ${CMAKE_SYSTEM_APPBUNDLE_PATH})
-+
-+set(LIB_ARCH_LIST)
-+if(CMAKE_LIBRARY_ARCHITECTURE_REGEX)
-+ file(GLOB implicit_dirs RELATIVE /lib /lib/*-linux-gnu* )
-+ foreach(dir ${implicit_dirs})
-+ if("${dir}" MATCHES "${CMAKE_LIBRARY_ARCHITECTURE_REGEX}")
-+ list(APPEND LIB_ARCH_LIST "${dir}")
-+ endif()
-+ endforeach()
-+endif()
-+
-+# "Export" these variables:
-+set(MESON_ARCH_LIST ${LIB_ARCH_LIST})
-+set(MESON_PATHS_LIST ${TMP_PATHS_LIST})
-+set(MESON_CMAKE_ROOT ${CMAKE_ROOT})
-+set(MESON_CMAKE_SYSROOT ${CMAKE_SYSROOT})
-+set(MESON_FIND_ROOT_PATH ${CMAKE_FIND_ROOT_PATH})
-+
-+message(STATUS ${TMP_PATHS_LIST})
-+'''
-+
-+file_2_data_CMakeLists_txt = '''\
-+# fail noisily if attempt to use this file without setting:
-+# cmake_minimum_required(VERSION ${CMAKE_VERSION})
-+# project(... LANGUAGES ...)
-+
-+cmake_policy(SET CMP0000 NEW)
-+
-+set(PACKAGE_FOUND FALSE)
-+set(_packageName "${NAME}")
-+string(TOUPPER "${_packageName}" PACKAGE_NAME)
-+
-+while(TRUE)
-+ find_package("${NAME}" QUIET COMPONENTS ${COMPS})
-+
-+ # ARCHS has to be set via the CMD interface
-+ if(${_packageName}_FOUND OR ${PACKAGE_NAME}_FOUND OR "${ARCHS}" STREQUAL "")
-+ break()
-+ endif()
-+
-+ list(GET ARCHS 0 CMAKE_LIBRARY_ARCHITECTURE)
-+ list(REMOVE_AT ARCHS 0)
-+endwhile()
-+
-+if(${_packageName}_FOUND OR ${PACKAGE_NAME}_FOUND)
-+ set(PACKAGE_FOUND TRUE)
-+
-+ # Check the following variables:
-+ # FOO_VERSION
-+ # Foo_VERSION
-+ # FOO_VERSION_STRING
-+ # Foo_VERSION_STRING
-+ if(NOT DEFINED PACKAGE_VERSION)
-+ if(DEFINED ${_packageName}_VERSION)
-+ set(PACKAGE_VERSION "${${_packageName}_VERSION}")
-+ elseif(DEFINED ${PACKAGE_NAME}_VERSION)
-+ set(PACKAGE_VERSION "${${PACKAGE_NAME}_VERSION}")
-+ elseif(DEFINED ${_packageName}_VERSION_STRING)
-+ set(PACKAGE_VERSION "${${_packageName}_VERSION_STRING}")
-+ elseif(DEFINED ${PACKAGE_NAME}_VERSION_STRING)
-+ set(PACKAGE_VERSION "${${PACKAGE_NAME}_VERSION_STRING}")
-+ endif()
-+ endif()
-+
-+ # Check the following variables:
-+ # FOO_LIBRARIES
-+ # Foo_LIBRARIES
-+ # FOO_LIBS
-+ # Foo_LIBS
-+ set(libs)
-+ if(DEFINED ${_packageName}_LIBRARIES)
-+ set(libs ${_packageName}_LIBRARIES)
-+ elseif(DEFINED ${PACKAGE_NAME}_LIBRARIES)
-+ set(libs ${PACKAGE_NAME}_LIBRARIES)
-+ elseif(DEFINED ${_packageName}_LIBS)
-+ set(libs ${_packageName}_LIBS)
-+ elseif(DEFINED ${PACKAGE_NAME}_LIBS)
-+ set(libs ${PACKAGE_NAME}_LIBS)
-+ endif()
-+
-+ # Check the following variables:
-+ # FOO_INCLUDE_DIRS
-+ # Foo_INCLUDE_DIRS
-+ # FOO_INCLUDES
-+ # Foo_INCLUDES
-+ # FOO_INCLUDE_DIR
-+ # Foo_INCLUDE_DIR
-+ set(includes)
-+ if(DEFINED ${_packageName}_INCLUDE_DIRS)
-+ set(includes ${_packageName}_INCLUDE_DIRS)
-+ elseif(DEFINED ${PACKAGE_NAME}_INCLUDE_DIRS)
-+ set(includes ${PACKAGE_NAME}_INCLUDE_DIRS)
-+ elseif(DEFINED ${_packageName}_INCLUDES)
-+ set(includes ${_packageName}_INCLUDES)
-+ elseif(DEFINED ${PACKAGE_NAME}_INCLUDES)
-+ set(includes ${PACKAGE_NAME}_INCLUDES)
-+ elseif(DEFINED ${_packageName}_INCLUDE_DIR)
-+ set(includes ${_packageName}_INCLUDE_DIR)
-+ elseif(DEFINED ${PACKAGE_NAME}_INCLUDE_DIR)
-+ set(includes ${PACKAGE_NAME}_INCLUDE_DIR)
-+ endif()
-+
-+ # Check the following variables:
-+ # FOO_DEFINITIONS
-+ # Foo_DEFINITIONS
-+ set(definitions)
-+ if(DEFINED ${_packageName}_DEFINITIONS)
-+ set(definitions ${_packageName}_DEFINITIONS)
-+ elseif(DEFINED ${PACKAGE_NAME}_DEFINITIONS)
-+ set(definitions ${PACKAGE_NAME}_DEFINITIONS)
-+ endif()
-+
-+ set(PACKAGE_INCLUDE_DIRS "${${includes}}")
-+ set(PACKAGE_DEFINITIONS "${${definitions}}")
-+ set(PACKAGE_LIBRARIES "${${libs}}")
-+endif()
-+'''
-+
-+file_3_data_preload_cmake = '''\
-+if(MESON_PS_LOADED)
-+ return()
-+endif()
-+
-+set(MESON_PS_LOADED ON)
-+
-+# Dummy macros that have a special meaning in the meson code
-+macro(meson_ps_execute_delayed_calls)
-+endmacro()
-+
-+macro(meson_ps_reload_vars)
-+endmacro()
-+
-+# Helper macro to inspect the current CMake state
-+macro(meson_ps_inspect_vars)
-+ set(MESON_PS_CMAKE_CURRENT_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}")
-+ set(MESON_PS_CMAKE_CURRENT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
-+ meson_ps_execute_delayed_calls()
-+endmacro()
-+
-+
-+# Override some system functions with custom code and forward the args
-+# to the original function
-+macro(add_custom_command)
-+ meson_ps_inspect_vars()
-+ _add_custom_command(${ARGV})
-+endmacro()
-+
-+macro(add_custom_target)
-+ meson_ps_inspect_vars()
-+ _add_custom_target(${ARGV})
-+endmacro()
-+
-+macro(set_property)
-+ meson_ps_inspect_vars()
-+ _set_property(${ARGV})
-+endmacro()
-+
-+function(set_source_files_properties)
-+ set(FILES)
-+ set(I 0)
-+ set(PROPERTIES OFF)
-+
-+ while(I LESS ARGC)
-+ if(NOT PROPERTIES)
-+ if("${ARGV${I}}" STREQUAL "PROPERTIES")
-+ set(PROPERTIES ON)
-+ else()
-+ list(APPEND FILES "${ARGV${I}}")
-+ endif()
-+
-+ math(EXPR I "${I} + 1")
-+ else()
-+ set(ID_IDX ${I})
-+ math(EXPR PROP_IDX "${ID_IDX} + 1")
-+
-+ set(ID "${ARGV${ID_IDX}}")
-+ set(PROP "${ARGV${PROP_IDX}}")
-+
-+ set_property(SOURCE ${FILES} PROPERTY "${ID}" "${PROP}")
-+ math(EXPR I "${I} + 2")
-+ endif()
-+ endwhile()
-+endfunction()
-+
-+set(MESON_PS_DELAYED_CALLS add_custom_command;add_custom_target;set_property)
-+meson_ps_reload_vars()
-+'''
-+
-+
-+####################
-+# END Data section #
-+####################
-+
-+class DataFile:
-+ def __init__(self, path: Path, sha256sum: str, data: str) -> None:
-+ self.path = path
-+ self.sha256sum = sha256sum
-+ self.data = data
-+
-+ def write_once(self, path: Path) -> None:
-+ if not path.exists():
-+ path.write_text(self.data)
-+
-+ def write_to_private(self, env: 'Environment') -> Path:
-+ out_file = Path(env.scratch_dir) / 'data' / self.path.name
-+ out_file.parent.mkdir(exist_ok=True)
-+ self.write_once(out_file)
-+ return out_file
-+
-+
-+mesondata = {
-+ 'dependencies/data/CMakeListsLLVM.txt': DataFile(
-+ Path('dependencies/data/CMakeListsLLVM.txt'),
-+ '412cec3315597041a978d018cdaca282dcd47693793540da88ae2f80d0cbd7cd',
-+ file_0_data_CMakeListsLLVM_txt,
-+ ),
-+ 'dependencies/data/CMakePathInfo.txt': DataFile(
-+ Path('dependencies/data/CMakePathInfo.txt'),
-+ '90da8b443982d9c87139b7dc84228eb58cab4315764949637208f25e2bda7db2',
-+ file_1_data_CMakePathInfo_txt,
-+ ),
-+ 'dependencies/data/CMakeLists.txt': DataFile(
-+ Path('dependencies/data/CMakeLists.txt'),
-+ '71a2d58381f912bbfb1c8709884d34d721f682edf2fca001e1f582f0bffd0da7',
-+ file_2_data_CMakeLists_txt,
-+ ),
-+ 'cmake/data/preload.cmake': DataFile(
-+ Path('cmake/data/preload.cmake'),
-+ '064d047b18a5c919ad016b838bed50c5d40aebe9e53da0e70eff9d52a2c1ca1f',
-+ file_3_data_preload_cmake,
-+ ),
-+}
-diff --git a/tools/gen_data.py b/tools/gen_data.py
-new file mode 100755
-index 0000000000..2cc05a44e7
---- /dev/null
-+++ b/tools/gen_data.py
-@@ -0,0 +1,139 @@
-+#!/usr/bin/env python3
-+
-+# Copyright 2020 Daniel Mensinger
-+
-+# Licensed under the Apache License, Version 2.0 (the "License");
-+# you may not use this file except in compliance with the License.
-+# You may obtain a copy of the License at
-+
-+# http://www.apache.org/licenses/LICENSE-2.0
-+
-+# Unless required by applicable law or agreed to in writing, software
-+# distributed under the License is distributed on an "AS IS" BASIS,
-+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-+# See the License for the specific language governing permissions and
-+# limitations under the License.
-+
-+import sys
-+import hashlib
-+import textwrap
-+import re
-+from pathlib import Path
-+from datetime import datetime
-+import typing as T
-+
-+class DataFile:
-+ file_counter = 0
-+
-+ def __init__(self, path: Path, root: Path):
-+ self.path = path
-+ self.id = self.path.relative_to(root)
-+ self.data_str = f'file_{DataFile.file_counter}_data_' + re.sub('[^a-zA-Z0-9]', '_', self.path.name)
-+ DataFile.file_counter += 1
-+
-+ b = self.path.read_bytes()
-+ self.data = b.decode()
-+ self.sha256sum = hashlib.sha256(b).hexdigest()
-+
-+ def __repr__(self) -> str:
-+ return f'<{type(self).__name__}: [{self.sha256sum}] {self.id}>'
-+
-+def main() -> int:
-+ root_dir = Path(__file__).resolve().parents[1]
-+ mesonbuild_dir = root_dir / 'mesonbuild'
-+ out_file = mesonbuild_dir / 'mesondata.py'
-+
-+ data_dirs = mesonbuild_dir.glob('**/data')
-+
-+ data_files: T.List[DataFile] = []
-+
-+ for d in data_dirs:
-+ for p in d.iterdir():
-+ data_files += [DataFile(p, mesonbuild_dir)]
-+
-+ print(f'Found {len(data_files)} data files')
-+
-+ # Generate the data script
-+ data = ''
-+
-+ data += textwrap.dedent(f'''\
-+ # Copyright {datetime.today().year} The Meson development team
-+
-+ # Licensed under the Apache License, Version 2.0 (the "License");
-+ # you may not use this file except in compliance with the License.
-+ # You may obtain a copy of the License at
-+
-+ # http://www.apache.org/licenses/LICENSE-2.0
-+
-+ # Unless required by applicable law or agreed to in writing, software
-+ # distributed under the License is distributed on an "AS IS" BASIS,
-+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-+ # See the License for the specific language governing permissions and
-+ # limitations under the License.
-+
-+
-+ ####
-+ #### WARNING: This is an automatically generated file! Do not edit!
-+ #### Generated by {Path(__file__).resolve().relative_to(root_dir)}
-+ ####
-+
-+
-+ from pathlib import Path
-+ import typing as T
-+
-+ if T.TYPE_CHECKING:
-+ from .environment import Environment
-+
-+ ######################
-+ # BEGIN Data section #
-+ ######################
-+
-+ ''')
-+
-+ for i in data_files:
-+ data += f"{i.data_str} = '''\\\n{i.data}'''\n\n"
-+
-+ data += textwrap.dedent(f'''
-+ ####################
-+ # END Data section #
-+ ####################
-+
-+ class DataFile:
-+ def __init__(self, path: Path, sha256sum: str, data: str) -> None:
-+ self.path = path
-+ self.sha256sum = sha256sum
-+ self.data = data
-+
-+ def write_once(self, path: Path) -> None:
-+ if not path.exists():
-+ path.write_text(self.data)
-+
-+ def write_to_private(self, env: 'Environment') -> Path:
-+ out_file = Path(env.scratch_dir) / 'data' / self.path.name
-+ out_file.parent.mkdir(exist_ok=True)
-+ self.write_once(out_file)
-+ return out_file
-+
-+
-+ mesondata = {{
-+ ''')
-+
-+ for i in data_files:
-+ data += textwrap.indent(textwrap.dedent(f"""\
-+ '{i.id}': DataFile(
-+ Path('{i.id}'),
-+ '{i.sha256sum}',
-+ {i.data_str},
-+ ),
-+ """), ' ')
-+
-+ data += textwrap.dedent('''\
-+ }
-+ ''')
-+
-+ print(f'Updating {out_file}')
-+ out_file.write_text(data)
-+ return 0
-+
-+if __name__ == '__main__':
-+ sys.exit(main())
-
-From 05ddd6543d4c4fc33b4c64f26291e73f49733f71 Mon Sep 17 00:00:00 2001
-From: Daniel Mensinger <daniel@mensinger-ka.de>
-Date: Thu, 16 Jul 2020 20:33:57 +0200
-Subject: [PATCH 2/3] mdata: remove setuptools and use mesondata instead
-
----
- mesonbuild/cmake/interpreter.py | 5 ++---
- mesonbuild/dependencies/base.py | 6 ++----
- setup.py | 5 -----
- 4 files changed, 4 insertions(+), 16 deletions(-)
-
-diff --git a/mesonbuild/cmake/interpreter.py b/mesonbuild/cmake/interpreter.py
-index 05169478e8..f404109cf6 100644
---- a/mesonbuild/cmake/interpreter.py
-+++ b/mesonbuild/cmake/interpreter.py
-@@ -15,8 +15,6 @@
- # This class contains the basic functionality needed to run any interpreter
- # or an interpreter-based tool.
-
--import pkg_resources
--
- from .common import CMakeException, CMakeTarget, TargetOptions
- from .client import CMakeClient, RequestCMakeInputs, RequestConfigure, RequestCompute, RequestCodeModel
- from .fileapi import CMakeFileAPI
-@@ -25,6 +23,7 @@
- from .. import mlog, mesonlib
- from ..environment import Environment
- from ..mesonlib import MachineChoice, OrderedSet, version_compare
-+from ..mesondata import mesondata
- from ..compilers.compilers import lang_suffixes, header_suffixes, obj_suffixes, lib_suffixes, is_header
- from enum import Enum
- from functools import lru_cache
-@@ -814,7 +813,7 @@ def configure(self, extra_cmake_options: T.List[str]) -> None:
- raise CMakeException('Unable to find CMake')
- self.trace = CMakeTraceParser(cmake_exe.version(), self.build_dir, permissive=True)
-
-- preload_file = pkg_resources.resource_filename('mesonbuild', 'cmake/data/preload.cmake')
-+ preload_file = mesondata['cmake/data/preload.cmake'].write_to_private(self.env)
-
- # Prefere CMAKE_PROJECT_INCLUDE over CMAKE_TOOLCHAIN_FILE if possible,
- # since CMAKE_PROJECT_INCLUDE was actually designed for code injection.
-diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py
-index 23701da957..4c9c9fe18a 100644
---- a/mesonbuild/dependencies/base.py
-+++ b/mesonbuild/dependencies/base.py
-@@ -29,8 +29,6 @@
- from enum import Enum
- from pathlib import Path, PurePath
-
--import pkg_resources
--
- from .. import mlog
- from .. import mesonlib
- from ..compilers import clib_langs
-@@ -40,6 +38,7 @@
- from ..mesonlib import MachineChoice, MesonException, OrderedSet, PerMachine
- from ..mesonlib import Popen_safe, version_compare_many, version_compare, listify, stringlistify, extract_as_list, split_args
- from ..mesonlib import Version, LibType
-+from ..mesondata import mesondata
-
- if T.TYPE_CHECKING:
- from ..compilers.compilers import CompilerType # noqa: F401
-@@ -1512,8 +1511,7 @@ def _setup_cmake_dir(self, cmake_file: str) -> str:
- build_dir = self._get_build_dir()
-
- # Insert language parameters into the CMakeLists.txt and write new CMakeLists.txt
-- # Per the warning in pkg_resources, this is *not* a path and os.path and Pathlib are *not* safe to use here.
-- cmake_txt = pkg_resources.resource_string('mesonbuild', 'dependencies/data/' + cmake_file).decode()
-+ cmake_txt = mesondata['dependencies/data/' + cmake_file].data
-
- # In general, some Fortran CMake find_package() also require C language enabled,
- # even if nothing from C is directly used. An easy Fortran example that fails
-diff --git a/setup.py b/setup.py
-index 1f95be70c8..145f19c522 100644
---- a/setup.py
-+++ b/setup.py
-@@ -37,10 +37,6 @@
- 'mesonbuild.scripts',
- 'mesonbuild.templates',
- 'mesonbuild.wrap']
--package_data = {
-- 'mesonbuild.dependencies': ['data/CMakeLists.txt', 'data/CMakeListsLLVM.txt', 'data/CMakePathInfo.txt'],
-- 'mesonbuild.cmake': ['data/run_ctgt.py', 'data/preload.cmake'],
--}
- data_files = []
- if sys.platform != 'win32':
- # Only useful on UNIX-like systems
-@@ -51,6 +47,5 @@
- setup(name='meson',
- version=version,
- packages=packages,
-- package_data=package_data,
- entry_points=entries,
- data_files=data_files,)
-
-From 393d6e133d9abd584a2fc414971628e84ea48b7c Mon Sep 17 00:00:00 2001
-From: Daniel Mensinger <daniel@mensinger-ka.de>
-Date: Thu, 16 Jul 2020 20:34:15 +0200
-Subject: [PATCH 3/3] mdata: Add test to ensure mesondata.py is up-to-date
-
----
- run_unittests.py | 32 ++++++++++++++++++++++++++++++++
- 1 file changed, 32 insertions(+)
-
-diff --git a/run_unittests.py b/run_unittests.py
-index 820b705b54..2c03a3e75c 100755
---- a/run_unittests.py
-+++ b/run_unittests.py
-@@ -1485,6 +1485,38 @@ def test_all_functions_defined_in_ast_interpreter(self):
- astint = AstInterpreter('.', '', '')
- self.assertEqual(set(interp.funcs.keys()), set(astint.funcs.keys()))
-
-+ def test_mesondata_is_up_to_date(self):
-+ from mesonbuild.mesondata import mesondata
-+ err_msg = textwrap.dedent('''
-+
-+ ###########################################################
-+ ### mesonbuild.mesondata is not up-to-date ###
-+ ### Please regenerate it by running tools/gen_data.py ###
-+ ###########################################################
-+
-+ ''')
-+
-+ root_dir = Path(__file__).resolve().parent
-+ mesonbuild_dir = root_dir / 'mesonbuild'
-+
-+ data_dirs = mesonbuild_dir.glob('**/data')
-+ data_files = [] # type: T.List[T.Tuple(str, str)]
-+
-+ for i in data_dirs:
-+ for p in i.iterdir():
-+ data_files += [(p.relative_to(mesonbuild_dir).as_posix(), hashlib.sha256(p.read_bytes()).hexdigest())]
-+
-+ from pprint import pprint
-+ current_files = set(mesondata.keys())
-+ scanned_files = set([x[0] for x in data_files])
-+
-+ self.assertSetEqual(current_files, scanned_files, err_msg + 'Data files were added or removed\n')
-+ errors = []
-+ for i in data_files:
-+ if mesondata[i[0]].sha256sum != i[1]:
-+ errors += [i[0]]
-+
-+ self.assertListEqual(errors, [], err_msg + 'Files were changed')
-
- class BasePlatformTests(unittest.TestCase):
- prefix = '/usr'
+++ /dev/null
-From 1ce4258c219fe08b6d6eaa6aa944f27d91d054cb Mon Sep 17 00:00:00 2001
-From: James Hilliard <james.hilliard1@gmail.com>
-Date: Sat, 18 Jul 2020 17:01:33 -0600
-Subject: [PATCH] backends: fix rpath match pattern
-
-Since -Wl,-rpath= is not the only valid rpath ldflags syntax we
-need to try and match all valid rpath ldflags.
-
-In addition we should prevent -Wl,--just-symbols from being used to
-set rpath due to inconsistent compiler support.
-
-Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
----
- mesonbuild/backend/backends.py | 30 ++++++++++++++++++++++++--
- run_unittests.py | 39 +++++++++++++++++++++++-----------
- 2 files changed, 55 insertions(+), 14 deletions(-)
-
-diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
-index cfd3a397fd..e053f67e6b 100644
---- a/mesonbuild/backend/backends.py
-+++ b/mesonbuild/backend/backends.py
-@@ -14,6 +14,7 @@
-
- from collections import OrderedDict
- from functools import lru_cache
-+from pathlib import Path
- import enum
- import json
- import os
-@@ -455,10 +456,35 @@ def get_external_rpath_dirs(self, target):
- args.extend(self.environment.coredata.get_external_link_args(target.for_machine, lang))
- except Exception:
- pass
-+ # Match rpath formats:
-+ # -Wl,-rpath=
-+ # -Wl,-rpath,
-+ rpath_regex = re.compile(r'-Wl,-rpath[=,]([^,]+)')
-+ # Match solaris style compat runpath formats:
-+ # -Wl,-R
-+ # -Wl,-R,
-+ runpath_regex = re.compile(r'-Wl,-R[,]?([^,]+)')
-+ # Match symbols formats:
-+ # -Wl,--just-symbols=
-+ # -Wl,--just-symbols,
-+ symbols_regex = re.compile(r'-Wl,--just-symbols[=,]([^,]+)')
- for arg in args:
-- if arg.startswith('-Wl,-rpath='):
-- for dir in arg.replace('-Wl,-rpath=','').split(':'):
-+ rpath_match = rpath_regex.match(arg)
-+ if rpath_match:
-+ for dir in rpath_match.group(1).split(':'):
- dirs.add(dir)
-+ runpath_match = runpath_regex.match(arg)
-+ if runpath_match:
-+ for dir in runpath_match.group(1).split(':'):
-+ # The symbols arg is an rpath if the path is a directory
-+ if Path(dir).is_dir():
-+ dirs.add(dir)
-+ symbols_match = symbols_regex.match(arg)
-+ if symbols_match:
-+ for dir in symbols_match.group(1).split(':'):
-+ # Prevent usage of --just-symbols to specify rpath
-+ if Path(dir).is_dir():
-+ raise MesonException('Invalid arg for --just-symbols, {} is a directory.'.format(dir))
- return dirs
-
- def rpaths_for_bundled_shared_libraries(self, target, exclude_system=True):
-diff --git a/run_unittests.py b/run_unittests.py
-index b5294b9f82..73131c75b7 100755
---- a/run_unittests.py
-+++ b/run_unittests.py
-@@ -6451,19 +6451,34 @@ def test_global_rpath(self):
- self.init(yonder_dir)
- self.build()
- self.install(use_destdir=False)
-- self.new_builddir()
-
-- # Build an app that uses that installed library.
-- # Supply the rpath to the installed library via LDFLAGS
-- # (as systems like buildroot and guix are wont to do)
-- # and verify install preserves that rpath.
-- env = {'LDFLAGS': '-Wl,-rpath=' + yonder_libdir,
-- 'PKG_CONFIG_PATH': os.path.join(yonder_libdir, 'pkgconfig')}
-- self.init(testdir, override_envvars=env)
-- self.build()
-- self.install(use_destdir=False)
-- got_rpath = get_rpath(os.path.join(yonder_prefix, 'bin/rpathified'))
-- self.assertEqual(got_rpath, yonder_libdir)
-+ # Since rpath has multiple valid formats we need to
-+ # test that they are all properly used.
-+ rpath_formats = [
-+ ('-Wl,-rpath=', False),
-+ ('-Wl,-rpath,', False),
-+ ('-Wl,--just-symbols=', True),
-+ ('-Wl,--just-symbols,', True),
-+ ('-Wl,-R', False),
-+ ('-Wl,-R,', False)
-+ ]
-+ for rpath_format, exception in rpath_formats:
-+ # Build an app that uses that installed library.
-+ # Supply the rpath to the installed library via LDFLAGS
-+ # (as systems like buildroot and guix are wont to do)
-+ # and verify install preserves that rpath.
-+ self.new_builddir()
-+ env = {'LDFLAGS': rpath_format + yonder_libdir,
-+ 'PKG_CONFIG_PATH': os.path.join(yonder_libdir, 'pkgconfig')}
-+ if exception:
-+ with self.assertRaises(subprocess.CalledProcessError):
-+ self.init(testdir, override_envvars=env)
-+ break
-+ self.init(testdir, override_envvars=env)
-+ self.build()
-+ self.install(use_destdir=False)
-+ got_rpath = get_rpath(os.path.join(yonder_prefix, 'bin/rpathified'))
-+ self.assertEqual(got_rpath, yonder_libdir, rpath_format)
-
- @skip_if_not_base_option('b_sanitize')
- def test_pch_with_address_sanitizer(self):
--- /dev/null
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=generate-ipv6-address
+PKG_VERSION:=0.1
+PKG_RELEASE:=1
+
+PKG_SOURCE:=generate-ipv6-address-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://www.irif.fr/~jch/software/files/
+PKG_HASH:=e1356d245d5f891fa39b796a8a2deefdaa89f08130dc97a378738ca5ed9a20fa
+PKG_INSTALL:=1
+
+PKG_MAINTAINER:=Nick Hainke <vincent@systemli.org>
+PKG_LICENSE:=MIT
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/generate-ipv6-address
+ SECTION:=net
+ CATEGORY:=Network
+ TITLE:=Generate IPv6 Addresses
+ URL:=https://www.irif.fr/~jch/
+ DEPENDS:=@IPV6
+endef
+
+define Package/generate-ipv6-address/description
+ Generates IPv6 addresses from a given prefix and either a given MAC-48
+ address (an Ethernet hardware address) or a randomly drawn host number.
+endef
+
+MAKE_FLAGS += \
+ PREFIX="$(PKG_INSTALL_DIR)/usr"
+
+define Package/generate-ipv6-address/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/generate-ipv6-address $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,generate-ipv6-address))
+++ /dev/null
-#
-# Copyright (C) 2014 Bruno Randolf <br1@einfach.org>
-# Copyright (C) 2019 Yousong Zhou <yszhou4tech@gmail.com>
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-include $(INCLUDE_DIR)/kernel.mk
-
-PKG_NAME:=exfat-nofuse
-PKG_RELEASE:=3
-
-PKG_SOURCE_URL:=https://github.com/dorimanx/exfat-nofuse.git
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_DATE:=2018-04-17
-PKG_SOURCE_VERSION:=01c30ad52625a7261e1b0d874553b6ca7af25966
-PKG_MIRROR_HASH:=47e3b6b8384e4beaa07dc762f4e0cce9a067750cbb4b2fb4ba18d2348038c270
-
-PKG_MAINTAINER:=Yousong Zhou <yszhou4tech@gmail.com>
-PKG_LICENSE:=GPL-2.0
-PKG_LICENSE_FILES:=LICENSE
-
-include $(INCLUDE_DIR)/package.mk
-
-define KernelPackage/fs-exfat0
- SUBMENU:=Filesystems
- TITLE:=ExFAT Kernel driver (deprecated)
- FILES:=$(PKG_BUILD_DIR)/exfat.ko
- AUTOLOAD:=$(call AutoLoad,30,exfat,1)
- DEPENDS:=+kmod-nls-base @(LINUX_4_14||LINUX_4_19)
-endef
-
-define KernelPackage/fs-exfat0/description
- Kernel module for ExFAT Filesytems
-endef
-
-define Build/Compile
- $(KERNEL_MAKE) \
- CONFIG_EXFAT_FS=m \
- M="$(PKG_BUILD_DIR)" \
- modules
-endef
-
-$(eval $(call KernelPackage,fs-exfat0))
+++ /dev/null
-From c0d3452e0366e2ab4fc51e7981e48636facdf486 Mon Sep 17 00:00:00 2001
-From: Yousong Zhou <yszhou4tech@gmail.com>
-Date: Tue, 8 Jan 2019 15:45:26 +0000
-Subject: [PATCH 1/2] exfat_oal: use get_seconds() directly
-
----
- exfat_oal.c | 9 +--------
- 1 file changed, 1 insertion(+), 8 deletions(-)
-
-diff --git a/exfat_oal.c b/exfat_oal.c
-index 7435442..83f8e4b 100644
---- a/exfat_oal.c
-+++ b/exfat_oal.c
-@@ -128,16 +128,9 @@ static time_t accum_days_in_year[] = {
-
- TIMESTAMP_T *tm_current(TIMESTAMP_T *tp)
- {
-- struct timespec ts;
- time_t second, day, leap_day, month, year;
-
--#if LINUX_VERSION_CODE < KERNEL_VERSION(4,8,0)
-- ts = CURRENT_TIME_SEC;
--#else
-- ktime_get_real_ts(&ts);
--#endif
--
-- second = ts.tv_sec;
-+ second = get_seconds();
- second -= sys_tz.tz_minuteswest * SECS_PER_MIN;
-
- /* Jan 1 GMT 00:00:00 1980. But what about another time zone? */
+++ /dev/null
-From 4b9607d6fd4a35d9bb35527fae7aac23d848c0ce Mon Sep 17 00:00:00 2001
-From: Yousong Zhou <yszhou4tech@gmail.com>
-Date: Tue, 8 Jan 2019 15:45:24 +0000
-Subject: [PATCH 2/2] 4.18.patch
-
-Imported from https://aur.archlinux.org/cgit/aur.git/plain/4.18.patch?h=exfat-dkms-git
----
- exfat_super.c | 10 ++++++++++
- 1 file changed, 10 insertions(+)
-
-diff --git a/exfat_super.c b/exfat_super.c
-index 312de36..3ac18b0 100644
---- a/exfat_super.c
-+++ b/exfat_super.c
-@@ -147,8 +147,13 @@ static time_t accum_days_in_year[] = {
- static void _exfat_truncate(struct inode *inode, loff_t old_size);
-
- /* Convert a FAT time/date pair to a UNIX date (seconds since 1 1 70). */
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,18,01)
-+void exfat_time_fat2unix(struct exfat_sb_info *sbi, struct timespec64 *ts,
-+ DATE_TIME_T *tp)
-+#else
- void exfat_time_fat2unix(struct exfat_sb_info *sbi, struct timespec *ts,
- DATE_TIME_T *tp)
-+#endif
- {
- time_t year = tp->Year;
- time_t ld;
-@@ -166,8 +171,13 @@ void exfat_time_fat2unix(struct exfat_sb_info *sbi, struct timespec *ts,
- }
-
- /* Convert linear UNIX date to a FAT time/date pair. */
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,18,01)
-+void exfat_time_unix2fat(struct exfat_sb_info *sbi, struct timespec64 *ts,
-+ DATE_TIME_T *tp)
-+#else
- void exfat_time_unix2fat(struct exfat_sb_info *sbi, struct timespec *ts,
- DATE_TIME_T *tp)
-+#endif
- {
- time_t second = ts->tv_sec;
- time_t day, month, year;
include $(TOPDIR)/rules.mk
PKG_NAME:=lua-mosquitto
-PKG_VERSION:=0.3
+PKG_VERSION:=0.4.1
PKG_RELEASE:=1
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_MIRROR_HASH:=104a143131812a507e74f9debde45614d006b6ea6c3b0265b83060b14b9d3a34
+PKG_MIRROR_HASH:=d6bc828ea05f9a1ff3241f575a6ce699e577f9b79277182699e8fa03ac094ac9
PKG_SOURCE_PROTO:=git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_URL:=https://github.com/flukso/lua-mosquitto.git
include $(TOPDIR)/rules.mk
PKG_NAME:=lua-penlight
-PKG_VERSION:=1.7.0
+PKG_VERSION:=1.8.0
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(BUILD_DIR)/Penlight-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/Tieske/Penlight/tar.gz/$(PKG_VERSION)?
-PKG_HASH:=5b793fc93fa7227190e191e5b24a8f0ce9dd5958ccebe7a53842a58b5d46057f
+PKG_HASH:=a1a41c5ec82c0459bc0508a0fb1cb56dfaa83a1dd7754d7174b336ad65420d3d
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE.md
These can be installed via pip and ideally they should only be installed like this, because it's a bit simpler than running them through the OpenWrt build system.
-Which is why [for example] if you need python cffi on the host build, it's easier to just add it via:
+#### Requirements files
+
+All host-side Python packages are installed with pip using [requirements files](https://pip.pypa.io/en/stable/user_guide/#requirements-files), with [hash-checking mode](https://pip.pypa.io/en/stable/reference/pip_install/#hash-checking-mode) enabled. These requirements files are stored in the [host-pip-requirements](./host-pip-requirements) directory.
+
+Each requirements file is named after the Python package it installs and contains the package's pinned version and `--hash` option. The `--hash` option value is the SHA256 hash of the package's source tarball; this value can be found on [pypi.org](https://pypi.org/).
+
+For example, the requirements file for setuptools-scm ([setuptools-scm.txt](./host-pip-requirements/setuptools-scm.txt)) contains:
+
+```
+setuptools-scm==4.1.2 --hash=sha256:a8994582e716ec690f33fec70cca0f85bd23ec974e3f783233e4879090a7faa8
+```
+
+If the Python package to be installed depends on other Python packages, those dependencies, with their pinned versions and `--hash` options, also need to be specified in the requirements file. For instance, [cffi.txt](./host-pip-requirements/cffi.txt) includes information for pycparser because pycparser is a dependency of cffi and will be installed with cffi.
+
+There are two types of requirements files in [host-pip-requirements](./host-pip-requirements):
+
+* Installs the latest version of a Python package.
+
+ A requirements file of this type is named with the package name only (for example, [setuptools-scm.txt](./host-pip-requirements/setuptools-scm.txt)) and is used when there is no strict version requirement.
+
+ These files will be updated as newer versions of the Python packages are available.
+
+* Installs a specific version of a Python package.
+
+ A requirements file of this type is named with the package name and version number (for example, [Django-1.11.txt](./host-pip-requirements/Django-1.11.txt)) and is used when a specific (usually older) version is required.
+
+ Installing the latest versions of packages is preferred over specific versions whenever possible.
+
+#### Installing host-side Python packages
+
+Set `HOST_PYTHON3_PACKAGE_BUILD_DEPENDS` to the names of one or more requirements files in [host-pip-requirements](./host-pip-requirements), without the directory path or ".txt" extension.
+
+For example:
+
```
PKG_BUILD_PARALLEL:=0
-HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:="cffi==$(PKG_VERSION)"
+HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:=setuptools-scm
```
-[cffi is one of those packages that needs a host-side package installed].
-This works reasonably well in the current OpenWrt build system, as binaries get built for this package and get installed in the staging-dir `$(STAGING_DIR)/usr/lib/pythonX.Y/site-packages`.
+The Python package will be installed in `$(STAGING_DIR_HOSTPKG)/lib/pythonX.Y/site-packages`.
-`PKG_BUILD_PARALLEL:=0` is necessary because installing packages with multiple concurrent pip processes can lead to [errors or unexpected results](https://github.com/pypa/pip/issues/2361).
+Parallel builds need to be disabled because installing packages with multiple concurrent pip processes can lead to [errors or unexpected results](https://github.com/pypa/pip/issues/2361).
PKG_BUILD_DEPENDS:=libffi/host
PKG_BUILD_PARALLEL:=0
-HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:="cffi>=1.1"
+HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:=cffi # cffi>=1.1
include ../pypi.mk
include $(INCLUDE_DIR)/package.mk
--- /dev/null
+Cython==0.29.21 --hash=sha256:e57acb89bd55943c8d8bf813763d20b9099cc7165c0f16b707631a7654be9cad
--- /dev/null
+Django==1.11.29 --hash=sha256:4200aefb6678019a0acf0005cd14cfce3a5e6b9b90d06145fcdd2e474ad4329c
+pytz==2020.1 --hash=sha256:c35965d010ce31b23eeb663ed3cc8c906275d6be1a34393a1d73a41febf4a048
--- /dev/null
+cffi==1.14.2 --hash=sha256:ae8f34d50af2c2154035984b8b5fc5d9ed63f32fe615646ab435b05b132ca91b
+pycparser==2.20 --hash=sha256:2d475327684562c3a96cc71adf7dc8c4f0565175cf86b6d7a404ff4c771f15f0
--- /dev/null
+ply==3.11 --hash=sha256:00c7c1aaa88358b9c765b6d3000c6eec0ba42abca5351b095321aef446081da3
--- /dev/null
+setuptools-scm==4.1.2 --hash=sha256:a8994582e716ec690f33fec70cca0f85bd23ec974e3f783233e4879090a7faa8
--- /dev/null
+toml==0.10.1 --hash=sha256:926b612be1e5ce0634a2ca03470f95169cf16f939018233a670519cb4ac58b0f
# yes, zip... sigh
PYPI_SOURCE_EXT:=zip
PKG_BUILD_PARALLEL:=0
-HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:="Cython==0.29.21"
+HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:=Cython # Cython>=0.29.21
include ../pypi.mk
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/rules.mk
PKG_NAME:=python-cffi
-PKG_VERSION:=1.14.1
+PKG_VERSION:=1.14.2
PKG_RELEASE:=1
PYPI_NAME:=cffi
-PKG_HASH:=b2a2b0d276a136146e012154baefaea2758ef1f56ae9f4e01c612b0831e0bd2f
+PKG_HASH:=ae8f34d50af2c2154035984b8b5fc5d9ed63f32fe615646ab435b05b132ca91b
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE
PKG_BUILD_DEPENDS:=libffi/host
PKG_BUILD_PARALLEL:=0
-HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:="cffi>=1.8,!=1.11.3"
+HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:=cffi # cffi>=1.8,!=1.11.3
include ../pypi.mk
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/rules.mk
PKG_NAME:=python-docker
-PKG_VERSION:=4.2.2
+PKG_VERSION:=4.3.1
PKG_RELEASE:=1
PYPI_NAME:=docker
-PKG_HASH:=26eebadce7e298f55b76a88c4f8802476c5eaddbdbe38dbc6cce8781c47c9b54
+PKG_HASH:=bad94b8dd001a8a4af19ce4becc17f41b09f228173ffe6a4e0355389eef142f2
PKG_MAINTAINER:=Javier Marcet <javier@marcet.info>
PKG_LICENSE:=Apache-2.0
include $(TOPDIR)/rules.mk
PKG_NAME:=python-hyperlink
-PKG_VERSION:=19.0.0
-PKG_RELEASE:=2
+PKG_VERSION:=20.0.1
+PKG_RELEASE:=1
PYPI_NAME:=hyperlink
-PKG_HASH:=4288e34705da077fada1111a24a0aa08bb1e76699c9ce49876af722441845654
+PKG_HASH:=47fcc7cd339c6cb2444463ec3277bdcfe142c8b1daf2160bdd52248deec815af
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE
URL:=https://github.com/python-hyper/hyperlink
DEPENDS:= \
+python3-light \
+ +python3-codecs \
+python3-idna
endef
IRIs easy.
endef
+define Py3Package/python3-hyperlink/filespec
++|$(PYTHON3_PKG_DIR)
+-|$(PYTHON3_PKG_DIR)/hyperlink/hypothesis.py
+endef
+
$(eval $(call Py3Package,python3-hyperlink))
$(eval $(call BuildPackage,python3-hyperlink))
$(eval $(call BuildPackage,python3-hyperlink-src))
--- a/setup.py
+++ b/setup.py
-@@ -24,8 +24,9 @@ setup(name='hyperlink',
- author=__author__,
- author_email=__contact__,
- url=__url__,
-- packages=['hyperlink', 'hyperlink.test'],
-+ packages=['hyperlink'],
- include_package_data=True,
-+ exclude_package_data={'':['test/*']},
- zip_safe=False,
- license=__license__,
- platforms='any',
+@@ -25,7 +25,7 @@ setup(
+ author=__author__,
+ author_email=__contact__,
+ url=__url__,
+- packages=find_packages(where="src"),
++ packages=find_packages(where="src", exclude=["*.test", "*.test.*"]),
+ package_dir={"": "src"},
+ package_data=dict(hyperlink=["py.typed"]),
+ zip_safe=False,
--- /dev/null
+#
+# Copyright (C) 2020 CZ.NIC, z. s. p. o. (https://www.nic.cz/)
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=python-iniconfig
+PKG_VERSION:=1.0.1
+PKG_RELEASE:=1
+
+PYPI_NAME:=iniconfig
+PKG_HASH:=e5f92f89355a67de0595932a6c6c02ab4afddc6fcdc0bfc5becd0d60884d3f69
+
+PKG_MAINTAINER:=Jan Pavlinec <jan.pavlinec@nic.cz>
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_BUILD_PARALLEL:=0
+HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:=setuptools-scm
+
+include ../pypi.mk
+include $(INCLUDE_DIR)/package.mk
+include ../python3-package.mk
+
+define Package/python3-iniconfig
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ TITLE:=Simple config-ini parser
+ URL:=https://github.com/RonnyPfannschmidt/iniconfig
+ DEPENDS:= +python3-light
+endef
+
+define Package/python3-iniconfig/description
+ iniconfig is a small and simple INI-file parser module.
+endef
+
+$(eval $(call Py3Package,python3-iniconfig))
+$(eval $(call BuildPackage,python3-iniconfig))
+$(eval $(call BuildPackage,python3-iniconfig-src))
PKG_LICENSE_FILES:=COPYING
PKG_BUILD_PARALLEL:=0
-HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:=setuptools_scm
+HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:=setuptools-scm
include ../pypi.mk
include $(INCLUDE_DIR)/package.mk
--- /dev/null
+#
+# Copyright (C) 2020 CZ.NIC, z. s. p. o. (https://www.nic.cz/)
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=python-psutil
+PKG_VERSION:=5.7.2
+PKG_RELEASE:=1
+
+PYPI_NAME:=psutil
+PKG_HASH:=90990af1c3c67195c44c9a889184f84f5b2320dce3ee3acbd054e3ba0b4a7beb
+
+PKG_MAINTAINER:=Jan Pavlinec <jan.pavlinec@nic.cz>
+PKG_LICENSE:=BSD 3-Clause
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_BUILD_PARALLEL:=0
+HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:=setuptools-scm
+
+include ../pypi.mk
+include $(INCLUDE_DIR)/package.mk
+include ../python3-package.mk
+
+define Package/python3-psutil
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ TITLE:=psutil (process and system utilities)
+ URL:=https://github.com/giampaolo/psutil
+ DEPENDS:=+python3-light
+endef
+
+define Package/python3-psutil/description
+ psutil is a cross-platform library for retrieving information
+ on running processes and system utilization.
+endef
+
+$(eval $(call Py3Package,python3-psutil))
+$(eval $(call BuildPackage,python3-psutil))
+$(eval $(call BuildPackage,python3-psutil-src))
include $(TOPDIR)/rules.mk
PKG_NAME:=python-py
-PKG_VERSION:=1.8.1
-PKG_RELEASE:=3
+PKG_VERSION:=1.9.0
+PKG_RELEASE:=1
PYPI_NAME:=py
-PKG_HASH:=5e27081401262157467ad6e7f851b7aa402c5852dbcb3dae06768434de5752aa
+PKG_HASH:=9ca6883ce56b4e8da7e79ac18787889fa5206c79dcc67fb065376cd2fe03f342
PKG_MAINTAINER:=Jan Pavlinec <jan.pavlinec@nic.cz>
PKG_LICENSE:=MIT
CATEGORY:=Languages
TITLE:=py
URL:=https://github.com/pytest-dev/py
- DEPENDS:=+python3-light
+ DEPENDS:=+python3-light +python3-xml +python3-urllib
endef
define Package/python3-py/description
PKG_NAME:=python-pycparser
PKG_VERSION:=2.20
-PKG_RELEASE:=3
+PKG_RELEASE:=4
PYPI_NAME:=pycparser
PKG_HASH:=2d475327684562c3a96cc71adf7dc8c4f0565175cf86b6d7a404ff4c771f15f0
PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
PKG_BUILD_PARALLEL:=0
-HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:="ply==3.10"
+HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:=ply # ply==3.10
include ../pypi.mk
include $(INCLUDE_DIR)/package.mk
PKG_BUILD_DEPENDS:=libffi/host
PKG_BUILD_PARALLEL:=0
-HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:="cffi>=1.4.1"
+HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:=cffi # cffi>=1.4.1
PYTHON3_PKG_SETUP_VARS:= SODIUM_INSTALL=system
include $(TOPDIR)/rules.mk
PKG_NAME:=python-pytest-xdist
-PKG_VERSION:=1.34.0
+PKG_VERSION:=2.0.0
PKG_RELEASE:=1
PYPI_NAME:=pytest-xdist
-PKG_HASH:=340e8e83e2a4c0d861bdd8d05c5d7b7143f6eea0aba902997db15c2a86be04ee
+PKG_HASH:=3217b1f40290570bf27b1f82714fc4ed44c3260ba9b2f6cde0372378fc707ad3
+
PKG_MAINTAINER:=Jan Pavlinec <jan.pavlinec@nic.cz>
PKG_LICENSE:=MIT
+python3-pytest \
+python3-pytest-forked \
+python3-execnet \
- +python3-six
+ +python3-six \
+ +python3-psutil
endef
define Package/python3-pytest-xdist/description
include $(TOPDIR)/rules.mk
PKG_NAME:=python-pytest
-PKG_VERSION:=5.4.2
-PKG_RELEASE:=2
+PKG_VERSION:=6.0.1
+PKG_RELEASE:=1
PYPI_NAME:=pytest
-PKG_HASH:=eb2b5e935f6a019317e455b6da83dd8650ac9ffd2ee73a7b657a30873d67a698
+PKG_HASH:=85228d75db9f45e06e57ef9bf4429267f81ac7c0d742cc9ed63d09886a9fe6f4
PKG_MAINTAINER:=Jan Pavlinec <jan.pavlinec@nic.cz>
PKG_LICENSE:=MIT
TITLE:=Python testing framework
URL:=https://docs.pytest.org/en/latest/
DEPENDS:= \
- +python3-light \
+ +python3 \
+python3-more-itertools \
+python3-py \
+python3-attrs \
+python3-pluggy \
+python3-packaging \
- +python3-wcwidth \
- +python3-decimal \
- +python3-logging \
- +python3-urllib
+ +python3-toml \
+ +python3-iniconfig
endef
define Package/python3-pytest/description
--- /dev/null
+#
+# Copyright (C) 2020 CZ.NIC, z. s. p. o. (https://www.nic.cz/)
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=python-toml
+PKG_VERSION:=0.10.1
+PKG_RELEASE:=1
+
+PYPI_NAME:=toml
+PKG_HASH:=926b612be1e5ce0634a2ca03470f95169cf16f939018233a670519cb4ac58b0f
+
+PKG_MAINTAINER:=Jan Pavlinec <jan.pavlinec@nic.cz>
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+
+include ../pypi.mk
+include $(INCLUDE_DIR)/package.mk
+include ../python3-package.mk
+
+define Package/python3-toml
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ TITLE:=A Python library for parsing and creating TOML
+ URL:=https://github.com/uiri/toml
+ DEPENDS:= +python3-light +python3-decimal
+endef
+
+define Package/python3-toml/description
+ Python Library for Tom's Obvious, Minimal Language
+endef
+
+$(eval $(call Py3Package,python3-toml))
+$(eval $(call BuildPackage,python3-toml))
+$(eval $(call BuildPackage,python3-toml-src))
PKG_LICENSE_FILES:=LICENSE
PKG_BUILD_PARALLEL:=0
-HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:="setuptools_scm[toml] >= 3.4.1"
+HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:=setuptools-scm toml # setuptools_scm[toml] >= 3.4.1
include ../pypi.mk
include $(INCLUDE_DIR)/package.mk
# Note: I shamelessly copied this from Yousong's logic (from python-packages);
HOST_PYTHON3_PIP:=$(STAGING_DIR_HOSTPKG)/bin/pip$(PYTHON3_VERSION)
+HOST_PYTHON3_PIP_CACHE_DIR:=$(DL_DIR)/pip-cache
+
# $(1) => packages to install
define HostPython3/PipInstall
$(HOST_PYTHON3_VARS) \
$(HOST_PYTHON3_PIP) \
+ --cache-dir "$(HOST_PYTHON3_PIP_CACHE_DIR)" \
--disable-pip-version-check \
- --cache-dir "$(DL_DIR)/pip-cache" \
install \
--no-binary :all: \
+ --require-hashes \
$(1)
+ ifdef CONFIG_PYTHON3_HOST_PIP_CACHE_WORLD_READABLE
+ $(FIND) $(HOST_PYTHON3_PIP_CACHE_DIR) -not -type d -exec chmod go+r '{}' \;
+ $(FIND) $(HOST_PYTHON3_PIP_CACHE_DIR) -type d -exec chmod go+rx '{}' \;
+ endif
endef
# $(1) => build subdir
PYTHON3_PKG_SETUP_ARGS ?= --single-version-externally-managed
PYTHON3_PKG_SETUP_VARS ?=
+PYTHON3_PKG_HOST_PIP_INSTALL_ARGS = \
+ $(foreach req,$(HOST_PYTHON3_PACKAGE_BUILD_DEPENDS), \
+ --requirement \
+ $(if $(findstring /,$(req)),$(req),$(python3_mk_path)host-pip-requirements/$(req).txt) \
+ )
+
define Py3Build/FindStdlibDepends
$(SHELL) $(python3_mk_path)python3-find-stdlib-depends.sh -n "$(PKG_NAME)" "$(PKG_BUILD_DIR)"
endef
define Py3Build/Compile/Default
- $(if $(HOST_PYTHON3_PACKAGE_BUILD_DEPENDS),
- $(call HostPython3/PipInstall,$(HOST_PYTHON3_PACKAGE_BUILD_DEPENDS))
+ $(if $(PYTHON3_PKG_HOST_PIP_INSTALL_ARGS), \
+ $(call HostPython3/PipInstall,$(PYTHON3_PKG_HOST_PIP_INSTALL_ARGS)) \
)
$(call Python3/ModSetup, \
$(PYTHON3_PKG_SETUP_DIR), \
bool "Enable Bluetooth support"
default n
+config PYTHON3_HOST_PIP_CACHE_WORLD_READABLE
+ bool "Ensure host pip cache is world-readable"
+ default n
+
endmenu
include $(TOPDIR)/rules.mk
PKG_NAME:=boost
-PKG_VERSION:=1.73.0
-PKG_SOURCE_VERSION:=1_73_0
-PKG_RELEASE:=1
+PKG_VERSION:=1.74.0
+PKG_SOURCE_VERSION:=1_74_0
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)_$(PKG_SOURCE_VERSION).tar.bz2
PKG_SOURCE_URL:=@SF/$(PKG_NAME)/$(PKG_NAME)/$(PKG_VERSION) https://dl.bintray.com/boostorg/release/$(PKG_VERSION)/source/
-PKG_HASH:=4eb3b8d442b426dc35346235c8733b5ae35ba431690e38c6a8263dce9fcbb402
+PKG_HASH:=83bfc1507731a0906e387fc28b7ef5417d591429e51e788417fe9ff025e116b1
PKG_MAINTAINER:=Carlos M. Ferreira <carlosmf.pt@gmail.com>
PKG_LICENSE:=BSL-1.0
endef
define Package/boost/description
-This package provides the Boost v1.73.0 libraries.
+This package provides the Boost v1.74.0 libraries.
Boost is a set of free, peer-reviewed, portable C++ source libraries.
This package provides the following run-time libraries:
- wave
There are many more header-only libraries supported by Boost.
-See more at http://www.boost.org/doc/libs/1_72_0/
+See more at http://www.boost.org/doc/libs/1_74_0/
endef
PKG_BUILD_DEPENDS:=boost/host PACKAGE_python3:python3
TARGET_CFLAGS += \
$(if $(CONFIG_SOFT_FLOAT),-DBOOST_NO_FENV_H) -fPIC
-EXTRA_CXXFLAGS += $(if $(CONFIG_GCC_USE_VERSION_5),-std=gnu++14,-std=gnu++17)
+EXTRA_CXXFLAGS += $(if $(CONFIG_GCC_USE_VERSION_10),-std=gnu++20,$(if $(CONFIG_GCC_USE_VERSION_5),-std=gnu++14,-std=gnu++17))
ifneq ($(findstring mips,$(ARCH)),)
BOOST_ABI = o32
+++ /dev/null
---- a/boost/outcome/experimental/status-code/status_code_ptr.hpp 2020-04-28 09:23:14.792565200 +0100
-+++ b/boost/outcome/experimental/status-code/status_code_ptr.hpp 2020-04-28 09:24:34.311741000 +0100
-@@ -103,7 +103,7 @@
- #endif
- virtual void _do_erased_copy(status_code<void> &dst, const status_code<void> &src, size_t /*unused*/) const override // NOLINT
- {
-- assert(dst.domain() == *this);
-+ // Note that dst will not have its domain set
- assert(src.domain() == *this);
- auto &d = static_cast<_mycode &>(dst); // NOLINT
- const auto &_s = static_cast<const _mycode &>(src); // NOLINT
+++ /dev/null
---- a/boost/beast/core/detail/impl/read.hpp 2020-04-22 09:34:50.000000000 -0400
-+++ b/boost/beast/core/detail/impl/read.hpp 2020-05-02 13:50:11.141761700 -0400
-@@ -214,7 +214,7 @@
- class AsyncReadStream,
- class DynamicBuffer,
- class CompletionCondition,
-- class ReadHandler,
-+ BOOST_BEAST_ASYNC_TPARAM2 ReadHandler,
- class>
- BOOST_BEAST_ASYNC_RESULT2(ReadHandler)
- async_read(
-diff -aruN a/boost/beast/core/detail/is_invocable.hpp b/boost/beast/core/detail/is_invocable.hpp
---- a/boost/beast/core/detail/is_invocable.hpp 2020-04-22 09:34:50.000000000 -0400
-+++ b/boost/beast/core/detail/is_invocable.hpp 2020-05-02 13:50:11.141761700 -0400
-@@ -10,6 +10,8 @@
- #ifndef BOOST_BEAST_DETAIL_IS_INVOCABLE_HPP
- #define BOOST_BEAST_DETAIL_IS_INVOCABLE_HPP
-
-+#include <boost/asio/async_result.hpp>
-+#include <boost/type_traits/make_void.hpp>
- #include <type_traits>
- #include <utility>
-
-@@ -51,6 +53,26 @@
- };
- /** @} */
-
-+template<class CompletionToken, class Signature, class = void>
-+struct is_completion_token_for : std::false_type
-+{
-+};
-+
-+struct any_initiation
-+{
-+ template<class...AnyArgs>
-+ void operator()(AnyArgs&&...);
-+};
-+
-+template<class CompletionToken, class R, class...Args>
-+struct is_completion_token_for<
-+ CompletionToken, R(Args...), boost::void_t<decltype(
-+ boost::asio::async_initiate<CompletionToken, R(Args...)>(
-+ any_initiation(), std::declval<CompletionToken&>())
-+ )>> : std::true_type
-+{
-+};
-+
- } // detail
- } // beast
- } // boost
-diff -aruN a/boost/beast/core/detail/read.hpp b/boost/beast/core/detail/read.hpp
---- a/boost/beast/core/detail/read.hpp 2020-04-22 09:34:50.000000000 -0400
-+++ b/boost/beast/core/detail/read.hpp 2020-05-02 13:50:11.142761711 -0400
-@@ -219,7 +219,7 @@
- class AsyncReadStream,
- class DynamicBuffer,
- class CompletionCondition,
-- class ReadHandler
-+ BOOST_BEAST_ASYNC_TPARAM2 ReadHandler
- #if ! BOOST_BEAST_DOXYGEN
- , class = typename std::enable_if<
- is_async_read_stream<AsyncReadStream>::value &&
-diff -aruN a/boost/beast/core/detect_ssl.hpp b/boost/beast/core/detect_ssl.hpp
---- a/boost/beast/core/detect_ssl.hpp 2020-04-22 09:34:50.000000000 -0400
-+++ b/boost/beast/core/detect_ssl.hpp 2020-05-02 13:50:11.143761722 -0400
-@@ -374,13 +374,13 @@
- void operator()(
- DetectHandler&& h,
- AsyncReadStream* s, // references are passed as pointers
-- DynamicBuffer& b)
-+ DynamicBuffer* b)
- {
- detect_ssl_op<
- typename std::decay<DetectHandler>::type,
- AsyncReadStream,
- DynamicBuffer>(
-- std::forward<DetectHandler>(h), *s, b);
-+ std::forward<DetectHandler>(h), *s, *b);
- }
- };
-
-@@ -439,7 +439,7 @@
- detail::run_detect_ssl_op{},
- token,
- &stream, // pass the reference by pointer
-- buffer);
-+ &buffer);
- }
-
- //]
-diff -aruN a/boost/beast/core/impl/basic_stream.hpp b/boost/beast/core/impl/basic_stream.hpp
---- a/boost/beast/core/impl/basic_stream.hpp 2020-04-22 09:34:50.000000000 -0400
-+++ b/boost/beast/core/impl/basic_stream.hpp 2020-05-02 13:50:11.144761733 -0400
-@@ -776,7 +776,7 @@
- //------------------------------------------------------------------------------
-
- template<class Protocol, class Executor, class RatePolicy>
--template<class ConnectHandler>
-+template<BOOST_BEAST_ASYNC_TPARAM1 ConnectHandler>
- BOOST_BEAST_ASYNC_RESULT1(ConnectHandler)
- basic_stream<Protocol, Executor, RatePolicy>::
- async_connect(
-@@ -795,7 +795,7 @@
- template<class Protocol, class Executor, class RatePolicy>
- template<
- class EndpointSequence,
-- class RangeConnectHandler,
-+ BOOST_ASIO_COMPLETION_TOKEN_FOR(void(error_code, typename Protocol::endpoint)) RangeConnectHandler,
- class>
- BOOST_ASIO_INITFN_RESULT_TYPE(RangeConnectHandler,void(error_code, typename Protocol::endpoint))
- basic_stream<Protocol, Executor, RatePolicy>::
-@@ -817,7 +817,7 @@
- template<
- class EndpointSequence,
- class ConnectCondition,
-- class RangeConnectHandler,
-+ BOOST_ASIO_COMPLETION_TOKEN_FOR(void(error_code, typename Protocol::endpoint)) RangeConnectHandler,
- class>
- BOOST_ASIO_INITFN_RESULT_TYPE(RangeConnectHandler,void (error_code, typename Protocol::endpoint))
- basic_stream<Protocol, Executor, RatePolicy>::
-@@ -839,7 +839,7 @@
- template<class Protocol, class Executor, class RatePolicy>
- template<
- class Iterator,
-- class IteratorConnectHandler>
-+ BOOST_ASIO_COMPLETION_TOKEN_FOR(void(error_code, Iterator)) IteratorConnectHandler>
- BOOST_ASIO_INITFN_RESULT_TYPE(IteratorConnectHandler,void (error_code, Iterator))
- basic_stream<Protocol, Executor, RatePolicy>::
- async_connect(
-@@ -860,7 +860,7 @@
- template<
- class Iterator,
- class ConnectCondition,
-- class IteratorConnectHandler>
-+ BOOST_ASIO_COMPLETION_TOKEN_FOR(void(error_code, Iterator)) IteratorConnectHandler>
- BOOST_ASIO_INITFN_RESULT_TYPE(IteratorConnectHandler,void (error_code, Iterator))
- basic_stream<Protocol, Executor, RatePolicy>::
- async_connect(
-@@ -881,7 +881,7 @@
- //------------------------------------------------------------------------------
-
- template<class Protocol, class Executor, class RatePolicy>
--template<class MutableBufferSequence, class ReadHandler>
-+template<class MutableBufferSequence, BOOST_BEAST_ASYNC_TPARAM2 ReadHandler>
- BOOST_BEAST_ASYNC_RESULT2(ReadHandler)
- basic_stream<Protocol, Executor, RatePolicy>::
- async_read_some(
-@@ -901,7 +901,7 @@
- }
-
- template<class Protocol, class Executor, class RatePolicy>
--template<class ConstBufferSequence, class WriteHandler>
-+template<class ConstBufferSequence, BOOST_BEAST_ASYNC_TPARAM2 WriteHandler>
- BOOST_BEAST_ASYNC_RESULT2(WriteHandler)
- basic_stream<Protocol, Executor, RatePolicy>::
- async_write_some(
-diff -aruN a/boost/beast/core/impl/buffered_read_stream.hpp b/boost/beast/core/impl/buffered_read_stream.hpp
---- a/boost/beast/core/impl/buffered_read_stream.hpp 2020-04-22 09:34:50.000000000 -0400
-+++ b/boost/beast/core/impl/buffered_read_stream.hpp 2020-05-02 13:50:11.144761733 -0400
-@@ -110,7 +110,7 @@
- operator()(
- ReadHandler&& h,
- buffered_read_stream* s,
-- Buffers const& b)
-+ Buffers const* b)
- {
- // If you get an error on the following line it means
- // that your handler does not meet the documented type
-@@ -124,7 +124,7 @@
- read_op<
- Buffers,
- typename std::decay<ReadHandler>::type>(
-- std::forward<ReadHandler>(h), *s, b);
-+ std::forward<ReadHandler>(h), *s, *b);
- }
- };
-
-@@ -141,7 +141,7 @@
- }
-
- template<class Stream, class DynamicBuffer>
--template<class ConstBufferSequence, class WriteHandler>
-+template<class ConstBufferSequence, BOOST_BEAST_ASYNC_TPARAM2 WriteHandler>
- BOOST_BEAST_ASYNC_RESULT2(WriteHandler)
- buffered_read_stream<Stream, DynamicBuffer>::
- async_write_some(
-@@ -153,7 +153,7 @@
- static_assert(net::is_const_buffer_sequence<
- ConstBufferSequence>::value,
- "ConstBufferSequence type requirements not met");
-- static_assert(detail::is_invocable<WriteHandler,
-+ static_assert(detail::is_completion_token_for<WriteHandler,
- void(error_code, std::size_t)>::value,
- "WriteHandler type requirements not met");
- return next_layer_.async_write_some(buffers,
-@@ -212,7 +212,7 @@
- }
-
- template<class Stream, class DynamicBuffer>
--template<class MutableBufferSequence, class ReadHandler>
-+template<class MutableBufferSequence, BOOST_BEAST_ASYNC_TPARAM2 ReadHandler>
- BOOST_BEAST_ASYNC_RESULT2(ReadHandler)
- buffered_read_stream<Stream, DynamicBuffer>::
- async_read_some(
-@@ -233,7 +233,7 @@
- typename ops::run_read_op{},
- handler,
- this,
-- buffers);
-+ &buffers);
- }
-
- } // beast
-diff -aruN a/boost/beast/core/impl/flat_stream.hpp b/boost/beast/core/impl/flat_stream.hpp
---- a/boost/beast/core/impl/flat_stream.hpp 2020-04-22 09:34:50.000000000 -0400
-+++ b/boost/beast/core/impl/flat_stream.hpp 2020-05-02 13:50:11.145761743 -0400
-@@ -144,7 +144,7 @@
- template<class NextLayer>
- template<
- class MutableBufferSequence,
-- class ReadHandler>
-+ BOOST_BEAST_ASYNC_TPARAM2 ReadHandler>
- BOOST_BEAST_ASYNC_RESULT2(ReadHandler)
- flat_stream<NextLayer>::
- async_read_some(
-@@ -225,7 +225,7 @@
- template<class NextLayer>
- template<
- class ConstBufferSequence,
-- class WriteHandler>
-+ BOOST_BEAST_ASYNC_TPARAM2 WriteHandler>
- BOOST_BEAST_ASYNC_RESULT2(WriteHandler)
- flat_stream<NextLayer>::
- async_write_some(
-diff -aruN a/boost/beast/_experimental/http/impl/icy_stream.hpp b/boost/beast/_experimental/http/impl/icy_stream.hpp
---- a/boost/beast/_experimental/http/impl/icy_stream.hpp 2020-04-22 09:34:50.000000000 -0400
-+++ b/boost/beast/_experimental/http/impl/icy_stream.hpp 2020-05-02 13:50:11.146761754 -0400
-@@ -259,7 +259,7 @@
- template<class NextLayer>
- template<
- class MutableBufferSequence,
-- class ReadHandler>
-+ BOOST_BEAST_ASYNC_TPARAM2 ReadHandler>
- BOOST_BEAST_ASYNC_RESULT2(ReadHandler)
- icy_stream<NextLayer>::
- async_read_some(
-@@ -311,7 +311,7 @@
- template<class NextLayer>
- template<
- class MutableBufferSequence,
-- class WriteHandler>
-+ BOOST_BEAST_ASYNC_TPARAM2 WriteHandler>
- BOOST_BEAST_ASYNC_RESULT2(WriteHandler)
- icy_stream<NextLayer>::
- async_write_some(
-diff -aruN a/boost/beast/_experimental/test/impl/stream.hpp b/boost/beast/_experimental/test/impl/stream.hpp
---- a/boost/beast/_experimental/test/impl/stream.hpp 2020-04-22 09:34:50.000000000 -0400
-+++ b/boost/beast/_experimental/test/impl/stream.hpp 2020-05-02 13:50:11.147761765 -0400
-@@ -306,7 +306,7 @@
- return 0;
- }
-
--template<class MutableBufferSequence, class ReadHandler>
-+template<class MutableBufferSequence, BOOST_BEAST_ASYNC_TPARAM2 ReadHandler>
- BOOST_BEAST_ASYNC_RESULT2(ReadHandler)
- stream::
- async_read_some(
-@@ -386,7 +386,7 @@
- return n;
- }
-
--template<class ConstBufferSequence, class WriteHandler>
-+template<class ConstBufferSequence, BOOST_BEAST_ASYNC_TPARAM2 WriteHandler>
- BOOST_BEAST_ASYNC_RESULT2(WriteHandler)
- stream::
- async_write_some(
-diff -aruN a/boost/beast/http/field.hpp b/boost/beast/http/field.hpp
---- a/boost/beast/http/field.hpp 2020-04-22 09:34:50.000000000 -0400
-+++ b/boost/beast/http/field.hpp 2020-05-02 13:50:11.149761786 -0400
-@@ -396,12 +396,9 @@
- string_to_field(string_view s);
-
- /// Write the text for a field name to an output stream.
--inline
-+BOOST_BEAST_DECL
- std::ostream&
--operator<<(std::ostream& os, field f)
--{
-- return os << to_string(f);
--}
-+operator<<(std::ostream& os, field f);
-
- } // http
- } // beast
-diff -aruN a/boost/beast/http/impl/field.ipp b/boost/beast/http/impl/field.ipp
---- a/boost/beast/http/impl/field.ipp 2020-04-22 09:34:50.000000000 -0400
-+++ b/boost/beast/http/impl/field.ipp 2020-05-02 13:50:11.150761798 -0400
-@@ -11,10 +11,12 @@
- #define BOOST_BEAST_HTTP_IMPL_FIELD_IPP
-
- #include <boost/beast/http/field.hpp>
-+#include <boost/assert.hpp>
- #include <algorithm>
- #include <array>
- #include <cstring>
--#include <boost/assert.hpp>
-+#include <ostream>
-+
-
- namespace boost {
- namespace beast {
-@@ -565,6 +567,12 @@
- return detail::get_field_table().string_to_field(s);
- }
-
-+std::ostream&
-+operator<<(std::ostream& os, field f)
-+{
-+ return os << to_string(f);
-+}
-+
- } // http
- } // beast
- } // boost
-diff -aruN a/boost/beast/http/impl/file_body_win32.hpp b/boost/beast/http/impl/file_body_win32.hpp
---- a/boost/beast/http/impl/file_body_win32.hpp 2020-04-22 09:34:50.000000000 -0400
-+++ b/boost/beast/http/impl/file_body_win32.hpp 2020-05-02 13:50:11.150761798 -0400
-@@ -597,7 +597,7 @@
- template<
- class Protocol, class Executor,
- bool isRequest, class Fields,
-- class WriteHandler>
-+ BOOST_BEAST_ASYNC_TPARAM2 WriteHandler>
- BOOST_BEAST_ASYNC_RESULT2(WriteHandler)
- async_write_some(
- net::basic_stream_socket<
-diff -aruN a/boost/beast/http/impl/read.hpp b/boost/beast/http/impl/read.hpp
---- a/boost/beast/http/impl/read.hpp 2020-04-22 09:34:50.000000000 -0400
-+++ b/boost/beast/http/impl/read.hpp 2020-05-02 13:50:11.150761798 -0400
-@@ -304,7 +304,7 @@
- class AsyncReadStream,
- class DynamicBuffer,
- bool isRequest,
-- class ReadHandler>
-+ BOOST_BEAST_ASYNC_TPARAM2 ReadHandler>
- BOOST_BEAST_ASYNC_RESULT2(ReadHandler)
- async_read_some(
- AsyncReadStream& stream,
-@@ -373,7 +373,7 @@
- class AsyncReadStream,
- class DynamicBuffer,
- bool isRequest,
-- class ReadHandler>
-+ BOOST_BEAST_ASYNC_TPARAM2 ReadHandler>
- BOOST_BEAST_ASYNC_RESULT2(ReadHandler)
- async_read_header(
- AsyncReadStream& stream,
-@@ -443,7 +443,7 @@
- class AsyncReadStream,
- class DynamicBuffer,
- bool isRequest,
-- class ReadHandler>
-+ BOOST_BEAST_ASYNC_TPARAM2 ReadHandler>
- BOOST_BEAST_ASYNC_RESULT2(ReadHandler)
- async_read(
- AsyncReadStream& stream,
-@@ -531,7 +531,7 @@
- class AsyncReadStream,
- class DynamicBuffer,
- bool isRequest, class Body, class Allocator,
-- class ReadHandler>
-+ BOOST_BEAST_ASYNC_TPARAM2 ReadHandler>
- BOOST_BEAST_ASYNC_RESULT2(ReadHandler)
- async_read(
- AsyncReadStream& stream,
-diff -aruN a/boost/beast/http/impl/write.hpp b/boost/beast/http/impl/write.hpp
---- a/boost/beast/http/impl/write.hpp 2020-04-22 09:34:50.000000000 -0400
-+++ b/boost/beast/http/impl/write.hpp 2020-05-02 13:50:11.150761798 -0400
-@@ -463,7 +463,7 @@
- template<
- class AsyncWriteStream,
- bool isRequest, class Body, class Fields,
-- class WriteHandler>
-+ BOOST_BEAST_ASYNC_TPARAM2 WriteHandler>
- BOOST_BEAST_ASYNC_RESULT2(WriteHandler)
- async_write_some_impl(
- AsyncWriteStream& stream,
-@@ -526,7 +526,7 @@
- template<
- class AsyncWriteStream,
- bool isRequest, class Body, class Fields,
-- class WriteHandler>
-+ BOOST_BEAST_ASYNC_TPARAM2 WriteHandler>
- BOOST_BEAST_ASYNC_RESULT2(WriteHandler)
- async_write_some(
- AsyncWriteStream& stream,
-@@ -608,7 +608,7 @@
- template<
- class AsyncWriteStream,
- bool isRequest, class Body, class Fields,
-- class WriteHandler>
-+ BOOST_BEAST_ASYNC_TPARAM2 WriteHandler>
- BOOST_BEAST_ASYNC_RESULT2(WriteHandler)
- async_write_header(
- AsyncWriteStream& stream,
-@@ -681,7 +681,7 @@
- template<
- class AsyncWriteStream,
- bool isRequest, class Body, class Fields,
-- class WriteHandler>
-+ BOOST_BEAST_ASYNC_TPARAM2 WriteHandler>
- BOOST_BEAST_ASYNC_RESULT2(WriteHandler)
- async_write(
- AsyncWriteStream& stream,
-@@ -801,7 +801,7 @@
- template<
- class AsyncWriteStream,
- bool isRequest, class Body, class Fields,
-- class WriteHandler>
-+ BOOST_BEAST_ASYNC_TPARAM2 WriteHandler>
- BOOST_BEAST_ASYNC_RESULT2(WriteHandler)
- async_write(
- AsyncWriteStream& stream,
-@@ -830,7 +830,7 @@
- template<
- class AsyncWriteStream,
- bool isRequest, class Body, class Fields,
-- class WriteHandler>
-+ BOOST_BEAST_ASYNC_TPARAM2 WriteHandler>
- BOOST_BEAST_ASYNC_RESULT2(WriteHandler)
- async_write(
- AsyncWriteStream& stream,
-diff -aruN a/boost/beast/http/span_body.hpp b/boost/beast/http/span_body.hpp
---- a/boost/beast/http/span_body.hpp 2020-04-22 09:34:50.000000000 -0400
-+++ b/boost/beast/http/span_body.hpp 2020-05-02 13:50:11.151761808 -0400
-@@ -36,8 +36,10 @@
- struct span_body
- {
- private:
-- static_assert(std::is_pod<T>::value,
-- "POD requirements not met");
-+ static_assert(
-+ std::is_trivial<T>::value &&
-+ std::is_standard_layout<T>::value,
-+ "POD requirements not met");
-
- public:
- /** The type of container used for the body
-diff -aruN a/boost/beast/ssl/ssl_stream.hpp b/boost/beast/ssl/ssl_stream.hpp
---- a/boost/beast/ssl/ssl_stream.hpp 2020-04-22 09:34:50.000000000 -0400
-+++ b/boost/beast/ssl/ssl_stream.hpp 2020-05-02 13:50:11.151761808 -0400
-@@ -555,7 +555,7 @@
- need to ensure that all data is written before the asynchronous operation
- completes.
- */
-- template<class ConstBufferSequence, class WriteHandler>
-+ template<class ConstBufferSequence, BOOST_BEAST_ASYNC_TPARAM2 WriteHandler>
- BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, void(boost::system::error_code, std::size_t))
- async_write_some(ConstBufferSequence const& buffers,
- BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
-@@ -636,7 +636,7 @@
- if you need to ensure that the requested amount of data is read before
- the asynchronous operation completes.
- */
-- template<class MutableBufferSequence, class ReadHandler>
-+ template<class MutableBufferSequence, BOOST_BEAST_ASYNC_TPARAM2 ReadHandler>
- BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, void(boost::system::error_code, std::size_t))
- async_read_some(MutableBufferSequence const& buffers,
- BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
-diff -aruN a/boost/beast/version.hpp b/boost/beast/version.hpp
---- a/boost/beast/version.hpp 2020-04-22 09:34:50.000000000 -0400
-+++ b/boost/beast/version.hpp 2020-05-02 13:50:11.151761808 -0400
-@@ -20,7 +20,7 @@
- This is a simple integer that is incremented by one every
- time a set of code changes is merged to the develop branch.
- */
--#define BOOST_BEAST_VERSION 290
-+#define BOOST_BEAST_VERSION 292
-
- #define BOOST_BEAST_VERSION_STRING "Boost.Beast/" BOOST_STRINGIZE(BOOST_BEAST_VERSION)
-
-diff -aruN a/boost/beast/websocket/impl/accept.hpp b/boost/beast/websocket/impl/accept.hpp
---- a/boost/beast/websocket/impl/accept.hpp 2020-04-22 09:34:50.000000000 -0400
-+++ b/boost/beast/websocket/impl/accept.hpp 2020-05-02 13:50:11.153761830 -0400
-@@ -542,7 +542,7 @@
-
- template<class NextLayer, bool deflateSupported>
- template<
-- class AcceptHandler>
-+ BOOST_BEAST_ASYNC_TPARAM1 AcceptHandler>
- BOOST_BEAST_ASYNC_RESULT1(AcceptHandler)
- stream<NextLayer, deflateSupported>::
- async_accept(
-@@ -564,7 +564,7 @@
- template<class NextLayer, bool deflateSupported>
- template<
- class ResponseDecorator,
-- class AcceptHandler>
-+ BOOST_BEAST_ASYNC_TPARAM1 AcceptHandler>
- BOOST_BEAST_ASYNC_RESULT1(AcceptHandler)
- stream<NextLayer, deflateSupported>::
- async_accept_ex(
-@@ -590,7 +590,7 @@
- template<class NextLayer, bool deflateSupported>
- template<
- class ConstBufferSequence,
-- class AcceptHandler>
-+ BOOST_BEAST_ASYNC_TPARAM1 AcceptHandler>
- BOOST_BEAST_ASYNC_RESULT1(AcceptHandler)
- stream<NextLayer, deflateSupported>::
- async_accept(
-@@ -621,7 +621,7 @@
- template<
- class ConstBufferSequence,
- class ResponseDecorator,
-- class AcceptHandler>
-+ BOOST_BEAST_ASYNC_TPARAM1 AcceptHandler>
- BOOST_BEAST_ASYNC_RESULT1(AcceptHandler)
- stream<NextLayer, deflateSupported>::
- async_accept_ex(
-@@ -654,7 +654,7 @@
- template<class NextLayer, bool deflateSupported>
- template<
- class Body, class Allocator,
-- class AcceptHandler>
-+ BOOST_BEAST_ASYNC_TPARAM1 AcceptHandler>
- BOOST_BEAST_ASYNC_RESULT1(AcceptHandler)
- stream<NextLayer, deflateSupported>::
- async_accept(
-@@ -678,7 +678,7 @@
- template<
- class Body, class Allocator,
- class ResponseDecorator,
-- class AcceptHandler>
-+ BOOST_BEAST_ASYNC_TPARAM1 AcceptHandler>
- BOOST_BEAST_ASYNC_RESULT1(AcceptHandler)
- stream<NextLayer, deflateSupported>::
- async_accept_ex(
-diff -aruN a/boost/beast/websocket/impl/close.hpp b/boost/beast/websocket/impl/close.hpp
---- a/boost/beast/websocket/impl/close.hpp 2020-04-22 09:34:50.000000000 -0400
-+++ b/boost/beast/websocket/impl/close.hpp 2020-05-02 13:50:11.153761830 -0400
-@@ -382,7 +382,7 @@
- }
-
- template<class NextLayer, bool deflateSupported>
--template<class CloseHandler>
-+template<BOOST_BEAST_ASYNC_TPARAM1 CloseHandler>
- BOOST_BEAST_ASYNC_RESULT1(CloseHandler)
- stream<NextLayer, deflateSupported>::
- async_close(close_reason const& cr, CloseHandler&& handler)
-diff -aruN a/boost/beast/websocket/impl/handshake.hpp b/boost/beast/websocket/impl/handshake.hpp
---- a/boost/beast/websocket/impl/handshake.hpp 2020-04-22 09:34:50.000000000 -0400
-+++ b/boost/beast/websocket/impl/handshake.hpp 2020-05-02 13:50:11.153761830 -0400
-@@ -268,7 +268,7 @@
- //------------------------------------------------------------------------------
-
- template<class NextLayer, bool deflateSupported>
--template<class HandshakeHandler>
-+template<BOOST_BEAST_ASYNC_TPARAM1 HandshakeHandler>
- BOOST_BEAST_ASYNC_RESULT1(HandshakeHandler)
- stream<NextLayer, deflateSupported>::
- async_handshake(
-@@ -293,7 +293,7 @@
- }
-
- template<class NextLayer, bool deflateSupported>
--template<class HandshakeHandler>
-+template<BOOST_BEAST_ASYNC_TPARAM1 HandshakeHandler>
- BOOST_BEAST_ASYNC_RESULT1(HandshakeHandler)
- stream<NextLayer, deflateSupported>::
- async_handshake(
-diff -aruN a/boost/beast/websocket/impl/ping.hpp b/boost/beast/websocket/impl/ping.hpp
---- a/boost/beast/websocket/impl/ping.hpp 2020-04-22 09:34:50.000000000 -0400
-+++ b/boost/beast/websocket/impl/ping.hpp 2020-05-02 13:50:11.153761830 -0400
-@@ -288,7 +288,7 @@
- }
-
- template<class NextLayer, bool deflateSupported>
--template<class WriteHandler>
-+template<BOOST_BEAST_ASYNC_TPARAM1 WriteHandler>
- BOOST_BEAST_ASYNC_RESULT1(WriteHandler)
- stream<NextLayer, deflateSupported>::
- async_ping(ping_data const& payload, WriteHandler&& handler)
-@@ -306,7 +306,7 @@
- }
-
- template<class NextLayer, bool deflateSupported>
--template<class WriteHandler>
-+template<BOOST_BEAST_ASYNC_TPARAM1 WriteHandler>
- BOOST_BEAST_ASYNC_RESULT1(WriteHandler)
- stream<NextLayer, deflateSupported>::
- async_pong(ping_data const& payload, WriteHandler&& handler)
-diff -aruN a/boost/beast/websocket/impl/read.hpp b/boost/beast/websocket/impl/read.hpp
---- a/boost/beast/websocket/impl/read.hpp 2020-04-22 09:34:50.000000000 -0400
-+++ b/boost/beast/websocket/impl/read.hpp 2020-05-02 13:50:11.153761830 -0400
-@@ -804,7 +804,7 @@
- }
-
- template<class NextLayer, bool deflateSupported>
--template<class DynamicBuffer, class ReadHandler>
-+template<class DynamicBuffer, BOOST_BEAST_ASYNC_TPARAM2 ReadHandler>
- BOOST_BEAST_ASYNC_RESULT2(ReadHandler)
- stream<NextLayer, deflateSupported>::
- async_read(DynamicBuffer& buffer, ReadHandler&& handler)
-@@ -878,7 +878,7 @@
- }
-
- template<class NextLayer, bool deflateSupported>
--template<class DynamicBuffer, class ReadHandler>
-+template<class DynamicBuffer, BOOST_BEAST_ASYNC_TPARAM2 ReadHandler>
- BOOST_BEAST_ASYNC_RESULT2(ReadHandler)
- stream<NextLayer, deflateSupported>::
- async_read_some(
-@@ -1263,7 +1263,7 @@
- }
-
- template<class NextLayer, bool deflateSupported>
--template<class MutableBufferSequence, class ReadHandler>
-+template<class MutableBufferSequence, BOOST_BEAST_ASYNC_TPARAM2 ReadHandler>
- BOOST_BEAST_ASYNC_RESULT2(ReadHandler)
- stream<NextLayer, deflateSupported>::
- async_read_some(
-diff -aruN a/boost/beast/websocket/impl/write.hpp b/boost/beast/websocket/impl/write.hpp
---- a/boost/beast/websocket/impl/write.hpp 2020-04-22 09:34:50.000000000 -0400
-+++ b/boost/beast/websocket/impl/write.hpp 2020-05-02 13:50:11.153761830 -0400
-@@ -700,7 +700,7 @@
- }
-
- template<class NextLayer, bool deflateSupported>
--template<class ConstBufferSequence, class WriteHandler>
-+template<class ConstBufferSequence, BOOST_BEAST_ASYNC_TPARAM2 WriteHandler>
- BOOST_BEAST_ASYNC_RESULT2(WriteHandler)
- stream<NextLayer, deflateSupported>::
- async_write_some(bool fin,
-@@ -756,7 +756,7 @@
- }
-
- template<class NextLayer, bool deflateSupported>
--template<class ConstBufferSequence, class WriteHandler>
-+template<class ConstBufferSequence, BOOST_BEAST_ASYNC_TPARAM2 WriteHandler>
- BOOST_BEAST_ASYNC_RESULT2(WriteHandler)
- stream<NextLayer, deflateSupported>::
- async_write(
-diff -aruN a/boost/beast/websocket/stream.hpp b/boost/beast/websocket/stream.hpp
---- a/boost/beast/websocket/stream.hpp 2020-04-22 09:34:50.000000000 -0400
-+++ b/boost/beast/websocket/stream.hpp 2020-05-02 13:50:11.154761841 -0400
-@@ -2634,7 +2634,7 @@
-
- template<
- class ResponseDecorator,
-- class AcceptHandler>
-+ BOOST_BEAST_ASYNC_TPARAM1 AcceptHandler>
- BOOST_BEAST_ASYNC_RESULT1(AcceptHandler)
- async_accept_ex(
- ResponseDecorator const& decorator,
-@@ -2643,7 +2643,7 @@
- template<
- class ConstBufferSequence,
- class ResponseDecorator,
-- class AcceptHandler>
-+ BOOST_BEAST_ASYNC_TPARAM1 AcceptHandler>
- BOOST_BEAST_ASYNC_RESULT1(AcceptHandler)
- async_accept_ex(
- ConstBufferSequence const& buffers,
-@@ -2656,7 +2656,7 @@
- template<
- class Body, class Allocator,
- class ResponseDecorator,
-- class AcceptHandler>
-+ BOOST_BEAST_ASYNC_TPARAM1 AcceptHandler>
- BOOST_BEAST_ASYNC_RESULT1(AcceptHandler)
- async_accept_ex(
- http::request<Body,
-diff -aruN a/libs/beast/CHANGELOG.md b/libs/beast/CHANGELOG.md
---- a/libs/beast/CHANGELOG.md 2020-04-22 09:34:50.000000000 -0400
-+++ b/libs/beast/CHANGELOG.md 2020-05-02 13:51:02.388315008 -0400
-@@ -1,3 +1,25 @@
-+Version 292:
-+
-+* Fix compile errors on Visual Studio with /std:c++latest
-+* Fix standalone compilation error with std::string_view
-+* OpenSSL 1.0.2 or later is required
-+* Fix c++20 deprecation warning in span_body
-+
-+--------------------------------------------------------------------------------
-+
-+Version 291:
-+
-+* Test websocket with use_awaitable
-+* Test http write with use_awaitable
-+* Test http read with use_awaitable
-+* Fix use buffered_read_stream with use_awaitable
-+* Implement is_completion_token_for trait
-+* Test use_awaitable with basic_stream
-+* Fix async_detect_ssl with use_awaitable
-+* Add clang coroutines-ts to circleci config
-+
-+--------------------------------------------------------------------------------
-+
- Version 290:
-
- * Travis build host now bionic
-diff -aruN a/libs/beast/CMakeLists.txt b/libs/beast/CMakeLists.txt
---- a/libs/beast/CMakeLists.txt 2020-04-22 09:34:50.000000000 -0400
-+++ b/libs/beast/CMakeLists.txt 2020-05-02 13:51:02.389315019 -0400
-@@ -40,7 +40,7 @@
- #
- #-------------------------------------------------------------------------------
-
--project (Beast VERSION 290)
-+project (Beast VERSION 292)
-
- set_property (GLOBAL PROPERTY USE_FOLDERS ON)
- option (Beast_BUILD_EXAMPLES "Build examples" ON)
-diff -aruN a/libs/beast/doc/qbk/01_intro/_intro.qbk b/libs/beast/doc/qbk/01_intro/_intro.qbk
---- a/libs/beast/doc/qbk/01_intro/_intro.qbk 2020-04-22 09:34:50.000000000 -0400
-+++ b/libs/beast/doc/qbk/01_intro/_intro.qbk 2020-05-02 13:51:02.391315040 -0400
-@@ -58,7 +58,7 @@
-
- * [*C++11:] Robust support for most language features.
- * [*Boost:] Beast only works with Boost, not stand-alone Asio
--* [*OpenSSL:] Required to build the tests, examples, and to use TLS/Secure sockets.
-+* [*OpenSSL:] Version 1.0.2 or higher. Required to build the tests, examples, and to use TLS/Secure sockets.
-
- Tested with these compilers: msvc-14+, gcc 4.8.4+, clang 3.6+.
-
-diff -aruN a/libs/beast/test/beast/core/async_base.cpp b/libs/beast/test/beast/core/async_base.cpp
---- a/libs/beast/test/beast/core/async_base.cpp 2020-04-22 09:34:50.000000000 -0400
-+++ b/libs/beast/test/beast/core/async_base.cpp 2020-05-02 13:51:02.470315892 -0400
-@@ -585,7 +585,7 @@
- //--------------------------------------------------------------------------
-
- // Asynchronously read into a buffer until the buffer is full, or an error occurs
-- template<class AsyncReadStream, class ReadHandler>
-+ template<class AsyncReadStream, BOOST_BEAST_ASYNC_TPARAM2 ReadHandler>
- typename net::async_result<ReadHandler, void(error_code, std::size_t)>::return_type
- async_read(AsyncReadStream& stream, net::mutable_buffer buffer, ReadHandler&& handler)
- {
-diff -aruN a/libs/beast/test/beast/core/basic_stream.cpp b/libs/beast/test/beast/core/basic_stream.cpp
---- a/libs/beast/test/beast/core/basic_stream.cpp 2020-04-22 09:34:50.000000000 -0400
-+++ b/libs/beast/test/beast/core/basic_stream.cpp 2020-05-02 13:51:02.470315892 -0400
-@@ -30,6 +30,13 @@
- #include <array>
- #include <thread>
-
-+#if BOOST_ASIO_HAS_CO_AWAIT
-+#include <boost/asio/awaitable.hpp>
-+#include <boost/asio/co_spawn.hpp>
-+#include <boost/asio/use_awaitable.hpp>
-+#endif
-+
-+
- namespace boost {
- namespace beast {
-
-@@ -258,7 +265,7 @@
- {
- string_view s_;
- net::ip::tcp::socket socket_;
--
-+
- public:
- session(
- string_view s,
-@@ -1297,6 +1304,52 @@
-
- //--------------------------------------------------------------------------
-
-+#if BOOST_ASIO_HAS_CO_AWAIT
-+ void testAwaitableCompilation(
-+ basic_stream<net::ip::tcp>& stream,
-+ net::mutable_buffer outbuf,
-+ net::const_buffer inbuf,
-+ net::ip::tcp::resolver::results_type resolve_results)
-+ {
-+ static_assert(std::is_same_v<
-+ net::awaitable<std::size_t>, decltype(
-+ stream.async_read_some(outbuf, net::use_awaitable))>);
-+
-+ static_assert(std::is_same_v<
-+ net::awaitable<std::size_t>, decltype(
-+ stream.async_write_some(inbuf, net::use_awaitable))>);
-+
-+ static_assert(std::is_same_v<
-+ net::awaitable<net::ip::tcp::resolver::results_type::const_iterator>, decltype(
-+ stream.async_connect(
-+ resolve_results.begin(),
-+ resolve_results.end(),
-+ net::use_awaitable))>);
-+
-+ static_assert(std::is_same_v<
-+ net::awaitable<net::ip::tcp::endpoint>, decltype(
-+ stream.async_connect(
-+ resolve_results,
-+ net::use_awaitable))>);
-+
-+ static_assert(std::is_same_v<
-+ net::awaitable<void>, decltype(
-+ stream.async_connect(
-+ resolve_results.begin()->endpoint(),
-+ net::use_awaitable))>);
-+
-+ auto comparison_function = [](error_code&, net::ip::tcp::endpoint) { return true; };
-+
-+ static_assert(std::is_same_v<
-+ net::awaitable<net::ip::tcp::resolver::results_type::const_iterator>, decltype(
-+ stream.async_connect(
-+ resolve_results.begin(),
-+ resolve_results.end(),
-+ comparison_function,
-+ net::use_awaitable))>);
-+ }
-+#endif
-+
- void
- run()
- {
-@@ -1307,6 +1360,11 @@
- testMembers();
- testJavadocs();
- testIssue1589();
-+
-+#if BOOST_ASIO_HAS_CO_AWAIT
-+ // test for compilation success only
-+ boost::ignore_unused(&basic_stream_test::testAwaitableCompilation);
-+#endif
- }
- };
-
-diff -aruN a/libs/beast/test/beast/core/buffered_read_stream.cpp b/libs/beast/test/beast/core/buffered_read_stream.cpp
---- a/libs/beast/test/beast/core/buffered_read_stream.cpp 2020-04-22 09:34:50.000000000 -0400
-+++ b/libs/beast/test/beast/core/buffered_read_stream.cpp 2020-05-02 13:51:02.470315892 -0400
-@@ -21,6 +21,9 @@
- #include <boost/asio/spawn.hpp>
- #include <boost/asio/strand.hpp>
- #include <boost/optional.hpp>
-+#if BOOST_ASIO_HAS_CO_AWAIT
-+#include <boost/asio/use_awaitable.hpp>
-+#endif
-
- namespace boost {
- namespace beast {
-@@ -211,6 +214,22 @@
- }
- };
-
-+#if BOOST_ASIO_HAS_CO_AWAIT
-+ void testAwaitableCompiles(
-+ buffered_read_stream<test::stream, flat_buffer>& stream,
-+ net::mutable_buffer rxbuf,
-+ net::const_buffer txbuf)
-+ {
-+ static_assert(std::is_same_v<
-+ net::awaitable<std::size_t>, decltype(
-+ stream.async_read_some(rxbuf, net::use_awaitable))>);
-+
-+ static_assert(std::is_same_v<
-+ net::awaitable<std::size_t>, decltype(
-+ stream.async_write_some(txbuf, net::use_awaitable))>);
-+ }
-+#endif
-+
- void run() override
- {
- testSpecialMembers();
-@@ -221,6 +240,10 @@
- });
-
- testAsyncLoop();
-+
-+#if BOOST_ASIO_HAS_CO_AWAIT
-+ boost::ignore_unused(&buffered_read_stream_test::testAwaitableCompiles);
-+#endif
- }
- };
-
-diff -aruN a/libs/beast/test/beast/core/detect_ssl.cpp b/libs/beast/test/beast/core/detect_ssl.cpp
---- a/libs/beast/test/beast/core/detect_ssl.cpp 2020-04-22 09:34:50.000000000 -0400
-+++ b/libs/beast/test/beast/core/detect_ssl.cpp 2020-05-02 13:51:02.470315892 -0400
-@@ -16,6 +16,11 @@
- #include <boost/beast/core/flat_buffer.hpp>
- #include <boost/beast/core/string.hpp>
- #include <boost/core/exchange.hpp>
-+#if BOOST_ASIO_HAS_CO_AWAIT
-+#include <boost/asio/awaitable.hpp>
-+#include <boost/asio/co_spawn.hpp>
-+#include <boost/asio/use_awaitable.hpp>
-+#endif
- namespace boost {
- namespace beast {
-
-@@ -166,12 +171,25 @@
- }
- }
-
-+#if BOOST_ASIO_HAS_CO_AWAIT
-+ void testAwaitableCompiles(test::stream& stream, flat_buffer& b)
-+ {
-+ static_assert(
-+ std::is_same_v<
-+ net::awaitable<bool>, decltype(
-+ async_detect_ssl(stream, b, net::use_awaitable))>);
-+ }
-+#endif
-+
- void
- run() override
- {
- testDetect();
- testRead();
- testAsyncRead();
-+#if BOOST_ASIO_HAS_CO_AWAIT
-+ boost::ignore_unused(&detect_ssl_test::testAwaitableCompiles);
-+#endif
- }
- };
-
-diff -aruN a/libs/beast/test/beast/core/flat_stream.cpp b/libs/beast/test/beast/core/flat_stream.cpp
---- a/libs/beast/test/beast/core/flat_stream.cpp 2020-04-22 09:34:50.000000000 -0400
-+++ b/libs/beast/test/beast/core/flat_stream.cpp 2020-05-02 13:51:02.471315902 -0400
-@@ -17,6 +17,9 @@
- #include <boost/beast/core/role.hpp>
- #include <initializer_list>
- #include <vector>
-+#if BOOST_ASIO_HAS_CO_AWAIT
-+#include <boost/asio/use_awaitable.hpp>
-+#endif
-
- namespace boost {
- namespace beast {
-@@ -208,11 +211,30 @@
- check({1,2,3,4}, 3, 3, true);
- }
-
-+#if BOOST_ASIO_HAS_CO_AWAIT
-+ void testAwaitableCompiles(
-+ flat_stream<test::stream>& stream,
-+ net::mutable_buffer rxbuf,
-+ net::const_buffer txbuf)
-+ {
-+ static_assert(std::is_same_v<
-+ net::awaitable<std::size_t>, decltype(
-+ stream.async_read_some(rxbuf, net::use_awaitable))>);
-+
-+ static_assert(std::is_same_v<
-+ net::awaitable<std::size_t>, decltype(
-+ stream.async_write_some(txbuf, net::use_awaitable))>);
-+ }
-+#endif
-+
- void
- run() override
- {
- testMembers();
- testSplit();
-+#if BOOST_ASIO_HAS_CO_AWAIT
-+ boost::ignore_unused(&flat_stream_test::testAwaitableCompiles);
-+#endif
- }
- };
-
-diff -aruN a/libs/beast/test/beast/core/stream_traits.cpp b/libs/beast/test/beast/core/stream_traits.cpp
---- a/libs/beast/test/beast/core/stream_traits.cpp 2020-04-22 09:34:50.000000000 -0400
-+++ b/libs/beast/test/beast/core/stream_traits.cpp 2020-05-02 13:51:02.471315902 -0400
-@@ -214,14 +214,14 @@
- struct async_read_stream
- {
- net::io_context::executor_type get_executor() noexcept;
-- template<class MutableBufferSequence, class ReadHandler>
-+ template<class MutableBufferSequence, BOOST_BEAST_ASYNC_TPARAM2 ReadHandler>
- void async_read_some(MutableBufferSequence const&, ReadHandler&&);
- };
-
- struct async_write_stream
- {
- net::io_context::executor_type get_executor() noexcept;
-- template<class ConstBufferSequence, class WriteHandler>
-+ template<class ConstBufferSequence, BOOST_BEAST_ASYNC_TPARAM2 WriteHandler>
- void async_write_some(ConstBufferSequence const&, WriteHandler&&);
- };
-
-@@ -232,9 +232,9 @@
- struct async_stream : async_read_stream, async_write_stream
- {
- net::io_context::executor_type get_executor() noexcept;
-- template<class MutableBufferSequence, class ReadHandler>
-+ template<class MutableBufferSequence, BOOST_BEAST_ASYNC_TPARAM2 ReadHandler>
- void async_read_some(MutableBufferSequence const&, ReadHandler&&);
-- template<class ConstBufferSequence, class WriteHandler>
-+ template<class ConstBufferSequence, BOOST_BEAST_ASYNC_TPARAM2 WriteHandler>
- void async_write_some(ConstBufferSequence const&, WriteHandler&&);
- };
-
-diff -aruN a/libs/beast/test/beast/http/CMakeLists.txt b/libs/beast/test/beast/http/CMakeLists.txt
---- a/libs/beast/test/beast/http/CMakeLists.txt 2020-04-22 09:34:50.000000000 -0400
-+++ b/libs/beast/test/beast/http/CMakeLists.txt 2020-05-02 13:51:02.472315914 -0400
-@@ -26,6 +26,7 @@
- empty_body.cpp
- error.cpp
- field.cpp
-+ field_compiles.cpp
- fields.cpp
- file_body.cpp
- message.cpp
-diff -aruN a/libs/beast/test/beast/http/field_compiles.cpp b/libs/beast/test/beast/http/field_compiles.cpp
---- a/libs/beast/test/beast/http/field_compiles.cpp 1969-12-31 19:00:00.000000000 -0500
-+++ b/libs/beast/test/beast/http/field_compiles.cpp 2020-05-02 13:51:02.473315924 -0400
-@@ -0,0 +1,11 @@
-+//
-+// Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com)
-+//
-+// Distributed under the Boost Software License, Version 1.0. (See accompanying
-+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-+//
-+// Official repository: https://github.com/boostorg/beast
-+//
-+
-+// Test that header file is self-contained.
-+#include <boost/beast/http/field.hpp>
-diff -aruN a/libs/beast/test/beast/http/Jamfile b/libs/beast/test/beast/http/Jamfile
---- a/libs/beast/test/beast/http/Jamfile 2020-04-22 09:34:50.000000000 -0400
-+++ b/libs/beast/test/beast/http/Jamfile 2020-05-02 13:51:02.472315914 -0400
-@@ -16,6 +16,7 @@
- dynamic_body.cpp
- error.cpp
- field.cpp
-+ field_compiles.cpp
- fields.cpp
- file_body.cpp
- message.cpp
-diff -aruN a/libs/beast/test/beast/http/read.cpp b/libs/beast/test/beast/http/read.cpp
---- a/libs/beast/test/beast/http/read.cpp 2020-04-22 09:34:50.000000000 -0400
-+++ b/libs/beast/test/beast/http/read.cpp 2020-05-02 13:51:02.472315914 -0400
-@@ -25,6 +25,9 @@
- #include <boost/asio/strand.hpp>
- #include <boost/asio/ip/tcp.hpp>
- #include <atomic>
-+#if BOOST_ASIO_HAS_CO_AWAIT
-+#include <boost/asio/use_awaitable.hpp>
-+#endif
-
- namespace boost {
- namespace beast {
-@@ -529,6 +532,49 @@
- }
- }
-
-+#if BOOST_ASIO_HAS_CO_AWAIT
-+ void testAwaitableCompiles(
-+ test::stream& stream,
-+ flat_buffer& dynbuf,
-+ parser<true, string_body>& request_parser,
-+ request<http::string_body>& request,
-+ parser<false, string_body>& response_parser,
-+ response<http::string_body>& response)
-+ {
-+ static_assert(std::is_same_v<
-+ net::awaitable<std::size_t>, decltype(
-+ http::async_read(stream, dynbuf, request, net::use_awaitable))>);
-+
-+ static_assert(std::is_same_v<
-+ net::awaitable<std::size_t>, decltype(
-+ http::async_read(stream, dynbuf, request_parser, net::use_awaitable))>);
-+
-+ static_assert(std::is_same_v<
-+ net::awaitable<std::size_t>, decltype(
-+ http::async_read(stream, dynbuf, response, net::use_awaitable))>);
-+
-+ static_assert(std::is_same_v<
-+ net::awaitable<std::size_t>, decltype(
-+ http::async_read(stream, dynbuf, response_parser, net::use_awaitable))>);
-+
-+ static_assert(std::is_same_v<
-+ net::awaitable<std::size_t>, decltype(
-+ http::async_read_some(stream, dynbuf, request_parser, net::use_awaitable))>);
-+
-+ static_assert(std::is_same_v<
-+ net::awaitable<std::size_t>, decltype(
-+ http::async_read_some(stream, dynbuf, response_parser, net::use_awaitable))>);
-+
-+ static_assert(std::is_same_v<
-+ net::awaitable<std::size_t>, decltype(
-+ http::async_read_header(stream, dynbuf, request_parser, net::use_awaitable))>);
-+
-+ static_assert(std::is_same_v<
-+ net::awaitable<std::size_t>, decltype(
-+ http::async_read_header(stream, dynbuf, response_parser, net::use_awaitable))>);
-+ }
-+#endif
-+
- void
- run() override
- {
-@@ -552,6 +598,9 @@
- testRegression430();
- testReadGrind();
- testAsioHandlerInvoke();
-+#if BOOST_ASIO_HAS_CO_AWAIT
-+ boost::ignore_unused(&read_test::testAwaitableCompiles);
-+#endif
- }
- };
-
-diff -aruN a/libs/beast/test/beast/http/write.cpp b/libs/beast/test/beast/http/write.cpp
---- a/libs/beast/test/beast/http/write.cpp 2020-04-22 09:34:50.000000000 -0400
-+++ b/libs/beast/test/beast/http/write.cpp 2020-05-02 13:51:02.473315924 -0400
-@@ -26,6 +26,9 @@
- #include <boost/asio/strand.hpp>
- #include <sstream>
- #include <string>
-+#if BOOST_ASIO_HAS_CO_AWAIT
-+#include <boost/asio/use_awaitable.hpp>
-+#endif
-
- namespace boost {
- namespace beast {
-@@ -994,6 +997,59 @@
- }
- }
-
-+#if BOOST_ASIO_HAS_CO_AWAIT
-+ void testAwaitableCompiles(
-+ test::stream& stream,
-+ serializer<true, string_body>& request_serializer,
-+ request<string_body>& req,
-+ request<string_body> const& creq,
-+ serializer<false, string_body>& response_serializer,
-+ response<string_body>& resp,
-+ response<string_body> const& cresp)
-+ {
-+ static_assert(std::is_same_v<
-+ net::awaitable<std::size_t>, decltype(
-+ http::async_write(stream, request_serializer, net::use_awaitable))>);
-+
-+ static_assert(std::is_same_v<
-+ net::awaitable<std::size_t>, decltype(
-+ http::async_write(stream, response_serializer, net::use_awaitable))>);
-+
-+ static_assert(std::is_same_v<
-+ net::awaitable<std::size_t>, decltype(
-+ http::async_write(stream, req, net::use_awaitable))>);
-+
-+ static_assert(std::is_same_v<
-+ net::awaitable<std::size_t>, decltype(
-+ http::async_write(stream, creq, net::use_awaitable))>);
-+
-+ static_assert(std::is_same_v<
-+ net::awaitable<std::size_t>, decltype(
-+ http::async_write(stream, resp, net::use_awaitable))>);
-+
-+ static_assert(std::is_same_v<
-+ net::awaitable<std::size_t>, decltype(
-+ http::async_write(stream, cresp, net::use_awaitable))>);
-+
-+ static_assert(std::is_same_v<
-+ net::awaitable<std::size_t>, decltype(
-+ http::async_write_some(stream, request_serializer, net::use_awaitable))>);
-+
-+ static_assert(std::is_same_v<
-+ net::awaitable<std::size_t>, decltype(
-+ http::async_write_some(stream, response_serializer, net::use_awaitable))>);
-+
-+ static_assert(std::is_same_v<
-+ net::awaitable<std::size_t>, decltype(
-+ http::async_write_header(stream, request_serializer, net::use_awaitable))>);
-+
-+ static_assert(std::is_same_v<
-+ net::awaitable<std::size_t>, decltype(
-+ http::async_write_header(stream, response_serializer, net::use_awaitable))>);
-+ }
-+#endif
-+
-+
- void
- run() override
- {
-@@ -1017,6 +1073,9 @@
- });
- testAsioHandlerInvoke();
- testBodyWriters();
-+#if BOOST_ASIO_HAS_CO_AWAIT
-+ boost::ignore_unused(&write_test::testAwaitableCompiles);
-+#endif
- }
- };
-
-diff -aruN a/libs/beast/test/beast/websocket/accept.cpp b/libs/beast/test/beast/websocket/accept.cpp
---- a/libs/beast/test/beast/websocket/accept.cpp 2020-04-22 09:34:50.000000000 -0400
-+++ b/libs/beast/test/beast/websocket/accept.cpp 2020-05-02 13:51:02.473315924 -0400
-@@ -14,7 +14,9 @@
- #include <boost/beast/_experimental/test/tcp.hpp>
- #include <boost/beast/_experimental/unit_test/suite.hpp>
- #include "test.hpp"
--
-+#if BOOST_ASIO_HAS_CO_AWAIT
-+#include <boost/asio/use_awaitable.hpp>
-+#endif
- namespace boost {
- namespace beast {
- namespace websocket {
-@@ -810,6 +812,27 @@
- }
- }
-
-+#if BOOST_ASIO_HAS_CO_AWAIT
-+ void testAwaitableCompiles(
-+ stream<net::ip::tcp::socket>& s,
-+ http::request<http::empty_body>& req,
-+ net::mutable_buffer buf
-+ )
-+ {
-+ static_assert(std::is_same_v<
-+ net::awaitable<void>, decltype(
-+ s.async_accept(net::use_awaitable))>);
-+
-+ static_assert(std::is_same_v<
-+ net::awaitable<void>, decltype(
-+ s.async_accept(req, net::use_awaitable))>);
-+
-+ static_assert(std::is_same_v<
-+ net::awaitable<void>, decltype(
-+ s.async_accept(buf, net::use_awaitable))>);
-+ }
-+#endif
-+
- void
- run() override
- {
-@@ -820,6 +843,9 @@
- testInvalidInputs();
- testEndOfStream();
- testAsync();
-+#if BOOST_ASIO_HAS_CO_AWAIT
-+ boost::ignore_unused(&accept_test::testAwaitableCompiles);
-+#endif
- }
- };
-
-diff -aruN a/libs/beast/test/beast/websocket/close.cpp b/libs/beast/test/beast/websocket/close.cpp
---- a/libs/beast/test/beast/websocket/close.cpp 2020-04-22 09:34:50.000000000 -0400
-+++ b/libs/beast/test/beast/websocket/close.cpp 2020-05-02 13:51:02.473315924 -0400
-@@ -16,6 +16,9 @@
-
- #include <boost/asio/io_context.hpp>
- #include <boost/asio/strand.hpp>
-+#if BOOST_ASIO_HAS_CO_AWAIT
-+#include <boost/asio/use_awaitable.hpp>
-+#endif
-
- namespace boost {
- namespace beast {
-@@ -735,6 +738,15 @@
- }
- };
-
-+#if BOOST_ASIO_HAS_CO_AWAIT
-+ void testAwaitableCompiles(stream<test::stream>& s, close_reason cr )
-+ {
-+ static_assert(std::is_same_v<
-+ net::awaitable<void>, decltype(
-+ s.async_close(cr, net::use_awaitable))>);
-+ }
-+#endif
-+
- void
- run() override
- {
-@@ -742,6 +754,9 @@
- testTimeout();
- testSuspend();
- testMoveOnly();
-+#if BOOST_ASIO_HAS_CO_AWAIT
-+ boost::ignore_unused(&close_test::testAwaitableCompiles);
-+#endif
- }
- };
-
-diff -aruN a/libs/beast/test/beast/websocket/handshake.cpp b/libs/beast/test/beast/websocket/handshake.cpp
---- a/libs/beast/test/beast/websocket/handshake.cpp 2020-04-22 09:34:50.000000000 -0400
-+++ b/libs/beast/test/beast/websocket/handshake.cpp 2020-05-02 13:51:02.473315924 -0400
-@@ -18,6 +18,9 @@
- #include <boost/asio/io_context.hpp>
- #include <boost/asio/strand.hpp>
- #include <thread>
-+#if BOOST_ASIO_HAS_CO_AWAIT
-+#include <boost/asio/use_awaitable.hpp>
-+#endif
-
- namespace boost {
- namespace beast {
-@@ -704,6 +707,23 @@
- }
- }
-
-+#if BOOST_ASIO_HAS_CO_AWAIT
-+ void testAwaitableCompiles(
-+ stream<test::stream>& s,
-+ std::string host,
-+ std::string port,
-+ response_type& resp)
-+ {
-+ static_assert(std::is_same_v<
-+ net::awaitable<void>, decltype(
-+ s.async_handshake(host, port, net::use_awaitable))>);
-+
-+ static_assert(std::is_same_v<
-+ net::awaitable<void>, decltype(
-+ s.async_handshake(resp, host, port, net::use_awaitable))>);
-+ }
-+#endif
-+
- void
- run() override
- {
-@@ -714,6 +734,9 @@
- testMoveOnly();
- testAsync();
- testIssue1460();
-+#if BOOST_ASIO_HAS_CO_AWAIT
-+ boost::ignore_unused(&handshake_test::testAwaitableCompiles);
-+#endif
- }
- };
-
-diff -aruN a/libs/beast/test/beast/websocket/ping.cpp b/libs/beast/test/beast/websocket/ping.cpp
---- a/libs/beast/test/beast/websocket/ping.cpp 2020-04-22 09:34:50.000000000 -0400
-+++ b/libs/beast/test/beast/websocket/ping.cpp 2020-05-02 13:51:02.474315935 -0400
-@@ -18,6 +18,10 @@
- #include <boost/asio/io_context.hpp>
- #include <boost/asio/strand.hpp>
-
-+#if BOOST_ASIO_HAS_CO_AWAIT
-+#include <boost/asio/use_awaitable.hpp>
-+#endif
-+
- namespace boost {
- namespace beast {
- namespace websocket {
-@@ -483,12 +487,30 @@
- }
- };
-
-+#if BOOST_ASIO_HAS_CO_AWAIT
-+ void testAwaitableCompiles(
-+ stream<test::stream>& s,
-+ ping_data& pdat)
-+ {
-+ static_assert(std::is_same_v<
-+ net::awaitable<void>, decltype(
-+ s.async_ping(pdat, net::use_awaitable))>);
-+
-+ static_assert(std::is_same_v<
-+ net::awaitable<void>, decltype(
-+ s.async_pong(pdat, net::use_awaitable))>);
-+ }
-+#endif
-+
- void
- run() override
- {
- testPing();
- testSuspend();
- testMoveOnly();
-+#if BOOST_ASIO_HAS_CO_AWAIT
-+ boost::ignore_unused(&ping_test::testAwaitableCompiles);
-+#endif
- }
- };
-
-diff -aruN a/libs/beast/test/beast/websocket/read2.cpp b/libs/beast/test/beast/websocket/read2.cpp
---- a/libs/beast/test/beast/websocket/read2.cpp 2020-04-22 09:34:50.000000000 -0400
-+++ b/libs/beast/test/beast/websocket/read2.cpp 2020-05-02 13:51:02.474315935 -0400
-@@ -14,6 +14,10 @@
-
- #include <boost/asio/write.hpp>
-
-+#if BOOST_ASIO_HAS_CO_AWAIT
-+#include <boost/asio/use_awaitable.hpp>
-+#endif
-+
- #include <boost/config/workaround.hpp>
- #if BOOST_WORKAROUND(BOOST_GCC, < 80200)
- #define BOOST_BEAST_SYMBOL_HIDDEN __attribute__ ((visibility("hidden")))
-@@ -673,10 +677,34 @@
- }
- }
-
-+#if BOOST_ASIO_HAS_CO_AWAIT
-+ void testAwaitableCompiles(
-+ stream<test::stream>& s,
-+ flat_buffer& dynbuf,
-+ net::mutable_buffer buf,
-+ std::size_t limit)
-+ {
-+ static_assert(std::is_same_v<
-+ net::awaitable<std::size_t>, decltype(
-+ s.async_read(dynbuf, net::use_awaitable))>);
-+
-+ static_assert(std::is_same_v<
-+ net::awaitable<std::size_t>, decltype(
-+ s.async_read_some(buf, net::use_awaitable))>);
-+
-+ static_assert(std::is_same_v<
-+ net::awaitable<std::size_t>, decltype(
-+ s.async_read_some(dynbuf, limit, net::use_awaitable))>);
-+ }
-+#endif
-+
- void
- run() override
- {
- testRead();
-+#if BOOST_ASIO_HAS_CO_AWAIT
-+ boost::ignore_unused(&read2_test::testAwaitableCompiles);
-+#endif
- }
- };
-
-diff -aruN a/libs/beast/test/beast/websocket/write.cpp b/libs/beast/test/beast/websocket/write.cpp
---- a/libs/beast/test/beast/websocket/write.cpp 2020-04-22 09:34:50.000000000 -0400
-+++ b/libs/beast/test/beast/websocket/write.cpp 2020-05-02 13:51:02.474315935 -0400
-@@ -13,6 +13,10 @@
- #include <boost/asio/io_context.hpp>
- #include <boost/asio/strand.hpp>
-
-+#if BOOST_ASIO_HAS_CO_AWAIT
-+#include <boost/asio/use_awaitable.hpp>
-+#endif
-+
- #include "test.hpp"
-
- namespace boost {
-@@ -716,6 +720,22 @@
- BEAST_EXPECT(n1 < n0 + s.size());
- }
-
-+#if BOOST_ASIO_HAS_CO_AWAIT
-+ void testAwaitableCompiles(
-+ stream<test::stream>& s,
-+ net::mutable_buffer buf,
-+ bool fin)
-+ {
-+ static_assert(std::is_same_v<
-+ net::awaitable<std::size_t>, decltype(
-+ s.async_write(buf, net::use_awaitable))>);
-+
-+ static_assert(std::is_same_v<
-+ net::awaitable<std::size_t>, decltype(
-+ s.async_write_some(fin, buf, net::use_awaitable))>);
-+ }
-+#endif
-+
- void
- run() override
- {
-@@ -726,6 +746,9 @@
- testMoveOnly();
- testIssue300();
- testIssue1666();
-+#if BOOST_ASIO_HAS_CO_AWAIT
-+ boost::ignore_unused(&write_test::testAwaitableCompiles);
-+#endif
- }
- };
-
include $(TOPDIR)/rules.mk
PKG_NAME:=glib2
-PKG_VERSION:=2.65.0
-PKG_RELEASE:=5
+PKG_VERSION:=2.65.1
+PKG_RELEASE:=1
PKG_SOURCE:=glib-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNOME/glib/2.65
-PKG_HASH:=b041e63cd0ac1fccb486374022ade040d907aad29b278e27d9e43e9294a6e7a3
+PKG_HASH:=bc63bf6c32713e0ee1dddc28e03f23b4a20c78bcb9a2c5b0f4eea41e46fb9cee
PKG_MAINTAINER:=Peter Wagner <tripolar@gmx.at>
PKG_LICENSE:=LGPL-2.1-or-later
--- a/gio/meson.build
+++ b/gio/meson.build
-@@ -881,20 +881,6 @@ endif
+@@ -874,20 +874,6 @@ endif
# Dependencies used by executables below
have_libelf = false
--- a/meson.build
+++ b/meson.build
-@@ -2137,16 +2137,10 @@ endif
+@@ -2168,16 +2168,10 @@ endif
glib_conf.set('HAVE_PROC_SELF_CMDLINE', have_proc_self_cmdline)
--- /dev/null
+--- a/meson.build
++++ b/meson.build
+@@ -1986,8 +1986,8 @@ endif
+ # FIXME: glib-gettext.m4 has much more checks to detect broken/uncompatible
+ # implementations. This could be extended if issues are found in some platforms.
+ libintl_deps = []
+-if cc.has_function('ngettext')
+- have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset')
++if true
++ have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset', prefix :'#include <libintl.h>')
+ else
+ # First just find the bare library.
+ libintl = cc.find_library('intl', required : false)
PKG_NAME:=libgphoto2
PKG_VERSION:=2.5.25
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PORT_VERSION:=0.12.0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
define Package/libgphoto2
$(call Package/libgphoto2/Default)
- DEPENDS:=+libpthread +libltdl +libusb-compat +libusb-1.0 $(ICONV_DEPENDS)
+ DEPENDS:=+libpthread +libltdl +libusb-compat +libusb-1.0 $(ICONV_DEPENDS) $(INTL_DEPENDS)
TITLE:=The basic library of the gphoto2 program, version $(PKG_VERSION).
MENU:=1
endef
include $(TOPDIR)/rules.mk
PKG_NAME:=libnetconf2
-PKG_VERSION:=1.1.24
+PKG_VERSION:=1.1.26
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/CESNET/libnetconf2/tar.gz/v$(PKG_VERSION)?
-PKG_HASH:=1a69db028bf970f0dab15ed508b58e0cf0806a7e4492828404b75c97ec8ab306
+PKG_HASH:=2ce2b819f3544fd46a3a4c8ba6dd0a3798cab2a63aa347bc1eb5275a2c89b7bd
-PKG_MAINTAINER:=Mislav Novakovic <mislav.novakovic@sartura.hr>
+PKG_MAINTAINER:=Jakov Smolic <jakov.smolic@sartura.hr>
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE
---- a/CMakeLists.txt 2020-05-08 13:29:30.903800624 +0300
-+++ b/CMakeLists.txt 2020-05-08 13:29:50.943582218 +0300
-@@ -153,7 +153,7 @@
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNC_ENABLED_SSH")
- message(STATUS "LibSSH version ${LibSSH_VERSION} found")
-
-- if(LibSSH_VERSION VERSION_EQUAL 0.9.3 OR LibSSH_VERSION VERSION_EQUAL 0.9.4)
-+ if(LibSSH_VERSION VERSION_EQUAL 0.9.x)
- message(FATAL_ERROR "LibSSH ${LibSSH_VERSION} includes regression bugs and libnetconf2 will NOT work properly, try to use another version")
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index f21fec9..5b912af 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -148,7 +148,7 @@ endif()
+ # dependencies - libssh
+ if(ENABLE_SSH)
+ find_package(LibSSH 0.7.0 REQUIRED)
+- if(LIBSSH_VERSION VERSION_EQUAL 0.9.3 OR LIBSSH_VERSION VERSION_EQUAL 0.9.4)
++ if(LIBSSH_VERSION VERSION_EQUAL 0.9.x)
+ message(FATAL_ERROR "LibSSH ${LIBSSH_VERSION} includes regression bugs and libnetconf2 will NOT work properly, try to use another version")
endif()
+--
+2.26.2
+
PKG_NAME:=libssh
PKG_VERSION:=0.9.4
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://www.libssh.org/files/0.9/
--- /dev/null
+From 6417f5a3cac8537ac6f6ff7fc1642dfaa0917fb4 Mon Sep 17 00:00:00 2001
+From: Jakub Jelen <jjelen@redhat.com>
+Date: Thu, 16 Apr 2020 11:13:34 +0200
+Subject: [PATCH] channels: Avoid returning SSH_AGAIN from
+ ssh_channel_poll_timeout()
+
+This addresses a regression introduced in 3bad0607, partially fixed in 022409e9,
+but the function was still able to return SSH_AGAIN, which was not expected by
+callers.
+
+Based on discussion in [1] and [2]
+
+[1] https://gitlab.com/libssh/libssh-mirror/-/merge_requests/101
+[2] https://www.libssh.org/archive/libssh/2020-03/0000029.html
+
+Signed-off-by: Jakub Jelen <jjelen@redhat.com>
+Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
+---
+ src/channels.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/src/channels.c b/src/channels.c
+index bcc1c207..9fe309d0 100644
+--- a/src/channels.c
++++ b/src/channels.c
+@@ -3116,6 +3116,12 @@ int ssh_channel_poll_timeout(ssh_channel channel, int timeout, int is_stderr)
+ session->session_state == SSH_SESSION_STATE_ERROR) {
+ rc = SSH_ERROR;
+ goto out;
++ } else if (rc == SSH_AGAIN) {
++ /* If the above timeout expired, it is ok and we do not need to
++ * attempt to check the read buffer. The calling functions do not
++ * expect us to return SSH_AGAIN either here. */
++ rc = SSH_OK;
++ goto out;
+ }
+ len = ssh_buffer_get_len(stdbuf);
+ if (len > 0) {
+--
+2.26.2
+
include $(TOPDIR)/rules.mk
PKG_NAME:=libuhttpd
-PKG_VERSION:=3.1.0
+PKG_VERSION:=3.2.0
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL=https://github.com/zhaojh329/libuhttpd/releases/download/v$(PKG_VERSION)
-PKG_HASH:=733fdb2183fe4984e2f909c41e24d81989a748265a75ef288018568e67a9cd49
+PKG_HASH:=b47623f023d6a1218f2cb078bcc9019949a7f30acce79423e524a481d4bc834d
PKG_MAINTAINER:=Jianhui Zhao <zhaojh329@gmail.com>
PKG_LICENSE:=MIT
include $(TOPDIR)/rules.mk
PKG_NAME:=libwebsockets
-PKG_VERSION:=3.2.1
-PKG_RELEASE:=1
+PKG_VERSION:=3.1.0
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_URL:=https://codeload.github.com/warmcat/libwebsockets/tar.gz/v$(PKG_VERSION)?
-PKG_HASH:=5b1521002771420bc91e1c91f36bc51f54bf4035c4bebde296dec235a45c33df
+PKG_HASH:=db948be74c78fc13f1f1a55e76707d7baae3a1c8f62b625f639e8f2736298324
PKG_SOURCE_VERSION:=v$(PKG_VERSION)
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
-@@ -1482,9 +1482,9 @@ if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COM
- endif()
+@@ -1233,9 +1233,9 @@ if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COM
+ endif()
if (UNIX AND NOT LWS_WITH_ESP32)
-- set(CMAKE_C_FLAGS "-Wall -Wsign-compare -Wuninitialized -Werror ${VISIBILITY_FLAG} -Wundef ${GCOV_FLAGS} ${CMAKE_C_FLAGS} ${ASAN_FLAGS}" )
-+ set(CMAKE_C_FLAGS "-Wall -Wsign-compare -Wuninitialized ${VISIBILITY_FLAG} -Wundef ${GCOV_FLAGS} ${CMAKE_C_FLAGS} ${ASAN_FLAGS}" )
+- set(CMAKE_C_FLAGS "-Wall -Wsign-compare -Wignored-qualifiers -Wtype-limits -Wuninitialized -Werror ${VISIBILITY_FLAG} -Wundef ${GCOV_FLAGS} ${CMAKE_C_FLAGS} ${ASAN_FLAGS}" )
++ set(CMAKE_C_FLAGS "-Wall -Wsign-compare -Wignored-qualifiers -Wtype-limits -Wuninitialized ${VISIBILITY_FLAG} -Wundef ${GCOV_FLAGS} ${CMAKE_C_FLAGS} ${ASAN_FLAGS}" )
else()
-- set(CMAKE_C_FLAGS "-Wall -Wsign-compare -Wuninitialized -Werror ${VISIBILITY_FLAG} ${GCOV_FLAGS} ${CMAKE_C_FLAGS}" )
-+ set(CMAKE_C_FLAGS "-Wall -Wsign-compare -Wuninitialized ${VISIBILITY_FLAG} ${GCOV_FLAGS} ${CMAKE_C_FLAGS}" )
+- set(CMAKE_C_FLAGS "-Wall -Wsign-compare -Wignored-qualifiers -Wtype-limits -Wuninitialized -Werror ${VISIBILITY_FLAG} ${GCOV_FLAGS} ${CMAKE_C_FLAGS}" )
++ set(CMAKE_C_FLAGS "-Wall -Wsign-compare -Wignored-qualifiers -Wtype-limits -Wuninitialized ${VISIBILITY_FLAG} ${GCOV_FLAGS} ${CMAKE_C_FLAGS}" )
endif()
endif ()
include $(TOPDIR)/rules.mk
PKG_NAME:=libyang
-PKG_VERSION:=1.0.167
+PKG_VERSION:=1.0.184
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/CESNET/libyang/tar.gz/v$(PKG_VERSION)?
-PKG_HASH:=2431fa5c7cfbe6a6f2c0873547b976f018438967adfe268726911dd3d95eaa31
+PKG_HASH:=1a5637451b73c4c5683837eb4c51371bb084795f653bc1a5fc20fed5541b58bc
-PKG_MAINTAINER:=Mislav Novakovic <mislav.novakovic@sartura.hr>
+PKG_MAINTAINER:=Jakov Smolic <jakov.smolic@sartura.hr>
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libyang.so* $(1)/usr/lib/
- $(INSTALL_DIR) $(1)/usr/lib/libyang
- $(INSTALL_DIR) $(1)/usr/lib/libyang/extensions
- $(INSTALL_DIR) $(1)/usr/lib/libyang/user_types
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libyang/extensions/* $(1)/usr/lib/libyang/extensions
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libyang/user_types/* $(1)/usr/lib/libyang/user_types
+ $(INSTALL_DIR) $(1)/usr/lib/libyang1
+ $(INSTALL_DIR) $(1)/usr/lib/libyang1/extensions
+ $(INSTALL_DIR) $(1)/usr/lib/libyang1/user_types
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libyang1/extensions/* $(1)/usr/lib/libyang1/extensions
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libyang1/user_types/* $(1)/usr/lib/libyang1/user_types
endef
define Package/libyang-cpp/install
PKG_NAME:=tcp_wrappers
PKG_VERSION:=7.6
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=ftp://ftp.porcupine.org/pub/security
return (STR_NE(eval_hostaddr(host), unknown) && HOSTNAME_KNOWN(name));
--- a/tcpd.h
+++ b/tcpd.h
-@@ -4,6 +4,25 @@
+@@ -4,6 +4,27 @@
* Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
*/
+#include <netinet/in.h>
+#include <stdio.h>
+
-+__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+
/* Structure to describe one communications endpoint. */
#define STRING_LENGTH 128 /* hosts, users, processes */
-@@ -25,10 +44,10 @@ struct request_info {
+@@ -25,10 +46,10 @@ struct request_info {
char pid[10]; /* access via eval_pid(request) */
struct host_info client[1]; /* client endpoint info */
struct host_info server[1]; /* server endpoint info */
struct netconfig *config; /* netdir handle */
};
-@@ -61,25 +80,30 @@ extern char paranoid[];
+@@ -61,25 +82,30 @@ extern char paranoid[];
/* Global functions. */
#if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT)
extern char *hosts_allow_table; /* for verification mode redirection */
extern char *hosts_deny_table; /* for verification mode redirection */
extern int hosts_access_verbose; /* for verbose matching mode */
-@@ -92,9 +116,14 @@ extern int resident; /* > 0 if residen
+@@ -92,9 +118,14 @@ extern int resident; /* > 0 if resident process */
*/
#ifdef __STDC__
extern struct request_info *request_init(); /* initialize request */
extern struct request_info *request_set(); /* update request structure */
#endif
-@@ -117,27 +146,31 @@ extern struct request_info *request_set(
+@@ -117,27 +148,31 @@ extern struct request_info *request_set(); /* update request structure */
* host_info structures serve as caches for the lookup results.
*/
#endif
/*
-@@ -178,7 +211,7 @@ extern struct tcpd_context tcpd_context;
+@@ -178,7 +213,7 @@ extern struct tcpd_context tcpd_context;
* behavior.
*/
extern int dry_run; /* verification flag */
/* Bug workarounds. */
-@@ -217,3 +250,7 @@ extern char *fix_strtok();
+@@ -217,3 +252,9 @@ extern char *fix_strtok();
#define strtok my_strtok
extern char *my_strtok();
#endif
+
-+__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+#endif /* tcpd.h */
--- a/Makefile
PKG_NAME:=gstreamer1
PKG_VERSION:=1.17.2
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=gstreamer-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://gstreamer.freedesktop.org/src/gstreamer
MESON_ARGS += \
-Dgst_debug=false \
-Dgst_parse=true \
- -Dregistry=false \
+ -Dregistry=true \
-Dtracer_hooks=false \
-Dptp-helper-setuid-user=none \
-Dptp-helper-setuid-group=none \
- -Doption-parsing=false \
+ -Doption-parsing=true \
-Dpoisoning=false \
-Dmemory-alignment=malloc \
-Dcheck=enabled \
+++ /dev/null
-if PACKAGE_netopeer2-keystored
-
-config SSH_KEYS
- bool "Generate default ssh keys"
- default y
-
-endif
+++ /dev/null
-#
-# Copyright (C) 2017 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-# Warning by default OpenWrt does not have a root password which is necessery for NETCONF server.
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=Netopeer2
-PKG_VERSION:=1.1.27
-PKG_RELEASE:=2
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://codeload.github.com/CESNET/Netopeer2/tar.gz/v$(PKG_VERSION)?
-PKG_HASH:=e3914aae78d19f445a37ef37408f7ce209ebf0b05deb412b1bc56a021448885f
-
-PKG_MAINTAINER:=Mislav Novakovic <mislav.novakovic@sartura.hr>
-PKG_LICENSE:=BSD-3-Clause
-PKG_LICENSE_FILES:=LICENSE
-
-CMAKE_INSTALL:=1
-PKG_BUILD_PARALLEL:=1
-
-include $(INCLUDE_DIR)/package.mk
-include $(INCLUDE_DIR)/cmake.mk
-
-define Package/netopeer2-keystored/config
- source "$(SOURCE)/Config_keystored.in"
-endef
-
-define Package/netopeer2-server
- SECTION:=utils
- CATEGORY:=Utilities
- TITLE:=NETCONF server
- URL:=https://github.com/CESNET/Netopeer2
- DEPENDS:=+libcurl +libpthread +libyang +libnetconf2 +netopeer2-keystored +libsysrepo +sysrepocfg +sysrepoctl +sysrepo
- MENU:=1
-endef
-
-define Package/netopeer2-cli
- SECTION:=utils
- CATEGORY:=Utilities
- TITLE:=Netopeer2 cli tool
- URL:=https://github.com/CESNET/Netopeer2
- DEPENDS:=+libpthread +libyang +libnetconf2 +libopenssl
-endef
-
-define Package/netopeer2-keystored
- SECTION:=utils
- CATEGORY:=Utilities
- TITLE:=Netopeer2 key store management
- URL:=https://github.com/CESNET/Netopeer2
- DEPENDS:=+libopenssl +libsysrepo +sysrepo +sysrepocfg +sysrepoctl +SSH_KEYS:openssh-keygen
- MENU:=1
-endef
-
-define Package/netopeer2/description
- Netopeer2 is a set of tools implementing network configuration tools based on the NETCONF
- Protocol. This is the second generation of the toolset, originally available as the Netopeer
- project. Netopeer2 is based on the new generation of the NETCONF and YANG libraries -
- libyang and libnetconf2. The Netopeer server uses sysrepo as a NETCONF datastore implementation.
-endef
-
-CMAKE_OPTIONS += \
- -DGENERATE_HOSTKEY:BOOL=OFF \
- -DINSTALL_MODULES:BOOL=OFF \
- -DCMAKE_BUILD_TYPE=release
-
-#-DKEYSTORED_KEYS_DIR:STRING=/etc/keystored/keys \
-
-define Package/netopeer2-server/install
- $(INSTALL_DIR) $(1)/usr/bin
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/netopeer2-server $(1)/usr/bin/
-
- $(INSTALL_DIR) $(1)/etc/sysrepo/yang
- $(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/ietf-ssh-server@2019-07-02.yang $(1)/etc/sysrepo/yang/
- $(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/ietf-tls-server@2019-07-02.yang $(1)/etc/sysrepo/yang/
- $(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/iana-crypt-hash@2014-08-06.yang $(1)/etc/sysrepo/yang/
- $(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/ietf-x509-cert-to-name@2014-12-10.yang $(1)/etc/sysrepo/yang/
- $(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/ietf-netconf-server@2019-07-02.yang $(1)/etc/sysrepo/yang/
- $(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/ietf-netconf-monitoring@2010-10-04.yang $(1)/etc/sysrepo/yang/
- $(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/ietf-netconf-acm@2018-02-14.yang $(1)/etc/sysrepo/yang/
- $(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/ietf-netconf-nmda@2019-01-07.yang $(1)/etc/sysrepo/yang/
- $(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/ietf-netconf@2013-09-29.yang $(1)/etc/sysrepo/yang/
- $(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/ietf-datastores@2017-08-17.yang $(1)/etc/sysrepo/yang/
- $(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/ietf-crypto-types@2019-07-02.yang $(1)/etc/sysrepo/yang/
- $(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/iana-crypt-hash@2014-08-06.yang $(1)/etc/sysrepo/yang/
- $(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/ietf-tcp-server@2019-07-02.yang $(1)/etc/sysrepo/yang/
-
- $(INSTALL_DIR) $(1)/etc/uci-defaults
- $(INSTALL_BIN) ./files/netopeer2-server.default $(1)/etc/uci-defaults/98_netopeer2-server
-
- $(INSTALL_DIR) $(1)/etc/init.d/
- $(INSTALL_BIN) ./files/netopeer2-server.init $(1)/etc/init.d/netopeer2-server
-
- $(INSTALL_DIR) $(1)/usr/share/netopeer2-server
- $(INSTALL_DATA) ./files/stock_config.xml $(1)/usr/share/netopeer2-server
-endef
-
-define Package/netopeer2-cli/install
- $(INSTALL_DIR) $(1)/usr/bin
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/netopeer2-cli $(1)/usr/bin/
-endef
-
-define Package/netopeer2-keystored/install
- $(INSTALL_DIR) $(1)/etc/sysrepo/yang
- $(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/ietf-keystore@2019-07-02.yang $(1)/etc/sysrepo/yang/
-
- $(INSTALL_DIR) $(1)/etc/uci-defaults
-
- $(INSTALL_DIR) $(1)/etc/keystored/keys
-ifeq ($(CONFIG_SSH_KEYS),y)
- $(INSTALL_BIN) ./files/netopeer2-keystored-keygen.default $(1)/etc/uci-defaults/97_netopeer2-keystored
-else
- $(INSTALL_BIN) ./files/netopeer2-keystored.default $(1)/etc/uci-defaults/97_netopeer2-keystored
- #ssh key name is specified in ./files/stock_config.xml file, you will need to provide the ssh keys yourself.
- $(INSTALL_DATA) ./files/ssh_host_rsa_key.pem $(1)/etc/keystored/keys
- $(INSTALL_DATA) ./files/ssh_host_rsa_key.pub.pem $(1)/etc/keystored/keys
-endif
-
-endef
-
-$(eval $(call BuildPackage,netopeer2-server))
-$(eval $(call BuildPackage,netopeer2-cli))
-$(eval $(call BuildPackage,netopeer2-keystored))
+++ /dev/null
-#!/bin/sh
-
-# Warning, problems can occur if the device restarts in the middle of this uci-default script
-
-if [ -x /bin/sysrepoctl ]; then
- match=$(sysrepoctl -l | grep "ietf-keystore ")
- if [ ! "$match" ]; then
- sysrepoctl --install --yang=/etc/sysrepo/yang/ietf-keystore@2019-07-02.yang -o root:root -p 600
- if [ -x /bin/sysrepocfg ]; then
- sysrepocfg -f xml -d startup -i /usr/share/netopeer2-keystored/stock_key_config.xml ietf-keystore
- rm /usr/share/netopeer2-keystored/stock_key_config.xml
- fi
-
- #generate ssh keys
- if [ ! -f "/etc/keystored/keys/ssh_host_rsa_key.pem" ]; then
- ssh-keygen -m pem -t rsa -q -N "" -f /etc/keystored/keys/ssh_host_rsa_key.pem
- chmod go-rw /etc/keystored/keys/ssh_host_rsa_key.pem
- fi
- fi
-fi
-
-exit 0
+++ /dev/null
-#!/bin/sh
-
-# Warning, problems can occur if the device restarts in the middle of this uci-default script
-
-if [ -x /bin/sysrepoctl ]; then
- match=$(sysrepoctl -l | grep "ietf-keystore ")
- if [ ! "$match" ]; then
- sysrepoctl --install --yang=/etc/sysrepo/yang/ietf-keystore@2019-07-02.yang -o root:root -p 600
- if [ -x /bin/sysrepocfg ]; then
- sysrepocfg -f xml -d startup -i /usr/share/netopeer2-keystored/stock_key_config.xml ietf-keystore
- rm /usr/share/netopeer2-keystored/stock_key_config.xml
- fi
- fi
-fi
-
-exit 0
+++ /dev/null
-#!/bin/sh
-
-# Warning, problems can occur if the device restarts in the middle of this uci-default script
-
-if [ -x /bin/sysrepoctl ]; then
- match=$(sysrepoctl -l | grep "ietf-ssh-server ")
- if [ ! "$match" ]; then
- sysrepoctl --install --yang=/etc/sysrepo/yang/ietf-ssh-server@2019-07-02.yang -p 600
- fi
-
- match=$(sysrepoctl -l | grep "ietf-tls-server ")
- if [ ! "$match" ]; then
- sysrepoctl --install --yang=/etc/sysrepo/yang/ietf-tls-server@2019-07-02.yang -p 600
- fi
-
- match=$(sysrepoctl -l | grep "iana-crypt-hash ")
- if [ ! "$match" ]; then
- sysrepoctl --install --yang=/etc/sysrepo/yang/iana-crypt-hash@2014-08-06.yang -p 600
- fi
-
- match=$(sysrepoctl -l | grep "ietf-x509-cert-to-name ")
- if [ ! "$match" ]; then
- sysrepoctl --install --yang=/etc/sysrepo/yang/ietf-x509-cert-to-name@2014-12-10.yang -p 600
- fi
-
- match=$(sysrepoctl -l | grep "ietf-netconf-server ")
- if [ ! "$match" ]; then
- sysrepoctl --install --yang=/etc/sysrepo/yang/ietf-netconf-server@2019-07-02.yang -o root:root -p 600
- sysrepoctl -m ietf-netconf-server -e listen
- sysrepoctl -m ietf-netconf-server -e ssh-listen
- sysrepoctl -m ietf-netconf-server -e tls-listen
- sysrepoctl -m ietf-netconf-server -e call-home
- sysrepoctl -m ietf-netconf-server -e ssh-call-home
- sysrepoctl -m ietf-netconf-server -e tls-call-home
- sysrepoctl -m ietf-netconf -e url
- if [ -x /bin/sysrepocfg ]; then
- sysrepocfg -f xml -d startup -i /usr/share/netopeer2-server/stock_config.xml ietf-netconf-server
- rm /usr/share/netopeer2-server/stock_config.xml
- fi
- fi
-
- match=$(sysrepoctl -l | grep "ietf-netconf-monitoring ")
- if [ ! "$match" ]; then
- sysrepoctl --install --yang=/etc/sysrepo/yang/ietf-netconf-monitoring@2010-10-04.yang -o root:root -p 600
- fi
-
- match=$(sysrepoctl -l | grep "ietf-netconf-with-defaults ")
- if [ ! "$match" ]; then
- sysrepoctl --install --yang=/etc/sysrepo/yang/ietf-netconf@2013-09-29.yang -o root:root -p 600
- fi
-
- match=$(sysrepoctl -l | grep "ietf-datastores ")
- if [ ! "$match" ]; then
- sysrepoctl --install --yang=/etc/sysrepo/yang/ietf-datastores@2017-08-17.yang -o root:root -p 600
- fi
-
-fi
-
-exit 0
+++ /dev/null
-#!/bin/sh /etc/rc.common
-
-START=99
-STOP=11
-
-USE_PROCD=1
-PROG=/bin/netopeer2-server
-
-start_service() {
- procd_open_instance
- procd_set_param command $PROG
- procd_append_param command -d -v 0
- procd_set_param respawn
- procd_close_instance
-}
-
-stop_service()
-{
- service_stop ${PROG}
- rm /var/run/netopeer2-server.pid
-}
+++ /dev/null
-<netconf-server xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-server">
- <listen>
- <endpoint>
- <name>test_ssh_listen_endpt</name>
- <ssh>
- <address>::</address>
- <port>830</port>
- <host-keys>
- <host-key>
- <name>test_ssh_listen_key</name>
- <public-key>ssh_host_rsa_key</public-key>
- </host-key>
- </host-keys>
- </ssh>
- </endpoint>
- </listen>
-</netconf-server>
+++ /dev/null
---- a/cli/commands.c 2020-05-08 16:29:28.284509842 +0300
-+++ b/cli/commands.c 2020-05-08 16:29:38.856397844 +0300
-@@ -1727,7 +1727,7 @@
- BIO_printf(bio_out, "\n");
-
- BIO_printf(bio_out, "Valid until: ");
-- ASN1_TIME_print(bio_out, X509_get_notAfter(cert));
-+ ASN1_TIME_print(bio_out, X509_get0_notAfter(cert));
- BIO_printf(bio_out, "\n");
-
- has_san = 0;
+++ /dev/null
---- a/cli/commands.h
-+++ b/cli/commands.h
-@@ -17,7 +17,7 @@
-
- #include "cli_version.h"
-
--char some_msg[4096];
-+static char some_msg[4096];
- #define INSTRUCTION(format,args...) {snprintf(some_msg,4095,format,##args);printf("\n %s",some_msg);}
- #define ERROR(function,format,args...) {snprintf(some_msg,4095,format,##args);fprintf(stderr,"%s: %s\n",function,some_msg);}
-
---- a/src/log.h
-+++ b/src/log.h
-@@ -36,7 +36,7 @@ extern uint8_t np2_sr_verbose_level;
- /**
- * @brief netopeer2 flag whether to print messages to stderr (only if not daemon).
- */
--uint8_t np2_stderr_log;
-+extern uint8_t np2_stderr_log;
-
- /**
- * @brief internal printing function, follows the levels from libnetconf2
include $(TOPDIR)/rules.mk
PKG_NAME:=bind
-PKG_VERSION:=9.16.4
-PKG_RELEASE:=2
+PKG_VERSION:=9.16.6
+PKG_RELEASE:=1
USERID:=bind=57:bind=57
PKG_MAINTAINER:=Noah Meyerhans <frodo@morgul.net>
PKG_SOURCE_URL:= \
https://www.mirrorservice.org/sites/ftp.isc.org/isc/bind9/$(PKG_VERSION) \
https://ftp.isc.org/isc/bind9/$(PKG_VERSION)
-PKG_HASH:=7522088d3daac8bcabaae37998178e09139ef5ccae6631cb1d8a625b770f370a
+PKG_HASH:=b567b0f3b47dd03b345a4848af7f2acdd3f5cea2bd804edd85d9ef50743571cb
PKG_FIXUP:=autoreconf
PKG_REMOVE_FILES:=aclocal.m4 libtool.m4
include $(TOPDIR)/rules.mk
PKG_NAME:=davfs2
-PKG_VERSION:=1.5.6
+PKG_VERSION:=1.6.0
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SAVANNAH/davfs2
-PKG_HASH:=417476cdcfd53966b2dcfaf12455b54f315959b488a89255ab4b44586153d801
+PKG_HASH:=2e6b675685bd917772be60f0999ae098c80f79ff20dc131e8fec4547cbb63b50
PKG_MAINTAINER:=Federico Di Marco <fededim@gmail.com>
-PKG_LICENSE:=GPL-3
+PKG_LICENSE:=GPL-3.0-or-later
PKG_LICENSE_FILES:=COPYING
PKG_CPE_ID:=cpe:/a:davfs2:davfs2
-PKG_FIXUP:=gettext-version autoreconf
+PKG_FIXUP:=gettext-version
+PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
CONFIGURE_ARGS += \
--with-neon="$(STAGING_DIR)/usr" \
- --without-libiconv-prefix \
- --without-libintl-prefix \
--disable-rpath
define Package/davfs2/install
+++ /dev/null
---- a/configure.ac
-+++ b/configure.ac
-@@ -36,7 +36,7 @@ AC_PROG_LN_S
- # Checks for libraries.
- AM_GNU_GETTEXT_VERSION(0.18.1)
- AM_GNU_GETTEXT([external])
--NE_REQUIRE_VERSIONS([0], [27 28 29 30])
-+NE_REQUIRE_VERSIONS([0], [27 28 29 30 31])
- DAV_CHECK_NEON
-
- # Checks for header files.
+++ /dev/null
---- a/src/kernel_interface.c
-+++ b/src/kernel_interface.c
-@@ -45,6 +45,8 @@
- #include <unistd.h>
- #endif
-
-+#include <sys/types.h>
-+
- #ifdef HAVE_SYS_MOUNT_H
- #include <sys/mount.h>
- #endif
--- /dev/null
+--- a/src/kernel_interface.c
++++ b/src/kernel_interface.c
+@@ -45,6 +45,8 @@
+ #include <unistd.h>
+ #endif
+
++#include <sys/types.h>
++
+ #ifdef HAVE_SYS_MOUNT_H
+ #include <sys/mount.h>
+ #endif
+#endif /* _COMPAT_H */
--- a/src/kernel_interface.c
+++ b/src/kernel_interface.c
-@@ -19,8 +19,8 @@
+@@ -19,9 +19,9 @@
#include "config.h"
+#include "compat.h"
+ #include <errno.h>
-#include <error.h>
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
+++ /dev/null
---- a/src/dav_coda.c
-+++ b/src/dav_coda.c
-@@ -97,7 +97,7 @@ static unsigned int blocksize;
- static size_t alignment;
-
- /* Send debug messages to syslog if != 0. */
--int debug;
-+extern int debug;
-
-
- /* Private function prototypes */
include $(TOPDIR)/rules.mk
PKG_NAME:=dawn
-PKG_SOURCE_DATE:=2020-08-07
+PKG_SOURCE_DATE:=2020-08-21
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/berlin-open-wireless-lab/DAWN.git
-PKG_SOURCE_VERSION:=50d54a625366cffd48f0ec3f23456d5a04c45fd3
-PKG_MIRROR_HASH:=cdea4f6ff0209afa0320e143043e0417fd6d65c349651e491f6023affd39fa10
+PKG_SOURCE_VERSION:=25a493c4384e00027cc0f38465ea19d2555b036e
+PKG_MIRROR_HASH:=2f959d5ad60d14224c1dc1bb77fe998cc909c69480dc444c89a7071dc5c8dbea
PKG_MAINTAINER:=Nick Hainke <vincent@systemli.org>
PKG_LICENSE:=GPL-2.0-only
config network
option broadcast_ip '10.0.0.255'
option broadcast_port '1025'
+ option server_ip ''
option tcp_port '1026'
option network_option '2' # 0 udp broadcast, 1 multicast, 2 tcp
option shared_key 'Niiiiiiiiiiiiiik'
start_service()
{
local _tcp_buffer
+ local _network_option
+
config_load dawn
- load_tcp_port() {
+ load_tcp_config() {
config_get _tcp_buffer "$1" tcp_port
+ config_get _network_option "$1" network_option
}
- config_foreach load_tcp_port network
+ config_foreach load_tcp_config network
touch /tmp/dawn_mac_list
procd_set_param command $PROG
procd_set_param stdout 0 # here it is possible to remove the debug output...
procd_set_param stderr 1
- procd_add_mdns "dawn" "tcp" "${_tcp_buffer}"
+ if [ ${_network_option} -eq 2 ]; then
+ procd_add_mdns "dawn" "tcp" "${_tcp_buffer}"
+ echo "UMDNS with port ${_tcp_buffer}"
+ fi
procd_close_instance
echo "Dawn instance started!"
- echo "UMDNS with port ${_tcp_buffer}"
}
PKG_VERSION:=2.7.8
# Release == build
# increase on changes of services files or tld_names.dat
-PKG_RELEASE:=22
+PKG_RELEASE:=24
PKG_LICENSE:=GPL-2.0
PKG_MAINTAINER:=
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/ddns.defaults $(1)/etc/uci-defaults/ddns_cloudflare.com-v4
$(INSTALL_DIR) $(1)/usr/lib/ddns
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/update_cloudflare_com_v4.sh $(1)/usr/lib/ddns
- $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/update_cloudflare_com_v4_token.sh $(1)/usr/lib/ddns
endef
define Package/ddns-scripts_cloudflare.com-v4/postinst
#!/bin/sh
# and create new
printf "%s\\t%s\\n" '"cloudflare.com-v4"' '"update_cloudflare_com_v4.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services
printf "%s\\t%s\\n" '"cloudflare.com-v4"' '"update_cloudflare_com_v4.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services_ipv6
- printf "%s\\t%s\\n" '"cloudflare.com-v4-token"' '"update_cloudflare_com_v4_token.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services
- printf "%s\\t%s\\n" '"cloudflare.com-v4-token"' '"update_cloudflare_com_v4_token.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services_ipv6
# on real system restart service if enabled
[ -z "$${IPKG_INSTROOT}" ] && {
[ -x /etc/uci-defaults/ddns_cloudflare.com-v4 ] && \
"loopia.se" "http://[USERNAME]:[PASSWORD]@dns.loopia.se/XDynDNSServer/XDynDNS.php?system=custom&hostname=[DOMAIN]&myip=[IP]" "good|nochg"
+"moniker.com" "https://dynamicdns.key-systems.net/update.php?hostname=[DOMAIN]&password=[PASSWORD]&ip=[IP]" "success"
+
"mydns.jp" "http://www.mydns.jp/directip.html?MID=[USERNAME]&PWD=[PASSWORD]&IPV4ADDR=[IP]"
"myip.co.ua" "http://[USERNAME]:[PASSWORD]@myip.co.ua/update?hostname=[DOMAIN]&myip=[IP]" "good"
write_log 13 "cURL: libcurl compiled without Proxy support"
fi
# set headers
-__PRGBASE="$__PRGBASE --header 'X-Auth-Email: $username' "
-__PRGBASE="$__PRGBASE --header 'X-Auth-Key: $password' "
+if [ "$username" = "Bearer" ]; then
+ write_log 7 "Found Username 'Bearer' using Password as Bearer Authorization Token"
+ __PRGBASE="$__PRGBASE --header 'Authorization: Bearer $password' "
+else
+ __PRGBASE="$__PRGBASE --header 'X-Auth-Email: $username' "
+ __PRGBASE="$__PRGBASE --header 'X-Auth-Key: $password' "
+fi
__PRGBASE="$__PRGBASE --header 'Content-Type: application/json' "
# read zone id for registered domain.TLD
+++ /dev/null
-#!/bin/sh
-#
-#.Distributed under the terms of the GNU General Public License (GPL) version 2.0
-#
-# script for sending updates to cloudflare.com
-#.based on Ben Kulbertis cloudflare-update-record.sh found at http://gist.github.com/benkulbertis
-#.and on George Johnson's cf-ddns.sh found at https://github.com/gstuartj/cf-ddns.sh
-#.2016-2018 Christian Schoenebeck <christian dot schoenebeck at gmail dot com>
-
-# CloudFlare API documentation at https://api.cloudflare.com/
-#
-# This script is parsed by dynamic_dns_functions.sh inside send_update() function
-#
-# using following options from /etc/config/ddns
-# option username - your cloudflare e-mail
-# option password - cloudflare api token, you can get it from cloudflare.com/my-account/
-# option domain - "hostname@yourdomain.TLD" # syntax changed to remove split_FQDN() function and tld_names.dat.gz
-#
-# The proxy status would not be changed by this script. Please change it in Cloudflare dashboard manually.
-#
-# variable __IP already defined with the ip-address to use for update
-#
-
-# check parameters
-[ -z "$CURL" ] && [ -z "$CURL_SSL" ] && write_log 14 "Cloudflare communication require cURL with SSL support. Please install"
-#[ -z "$username" ] && write_log 14 "Service section not configured correctly! Missing key as 'username'"
-[ -z "$password" ] && write_log 14 "Service section not configured correctly! Missing secret as 'password'"
-[ $use_https -eq 0 ] && use_https=1 # force HTTPS
-
-# used variables
-local __HOST __DOMAIN __TYPE __URLBASE __PRGBASE __RUNPROG __DATA __IPV6 __ZONEID __RECID __PROXIED
-local __URLBASE="https://api.cloudflare.com/client/v4"
-local __TTL=120
-
-# split __HOST __DOMAIN from $domain
-# given data:
-# @example.com for "domain record"
-# host.sub@example.com for a "host record"
-__HOST=$(printf %s "$domain" | cut -d@ -f1)
-__DOMAIN=$(printf %s "$domain" | cut -d@ -f2)
-
-# Cloudflare v4 needs:
-# __DOMAIN = the base domain i.e. example.com
-# __HOST = the FQDN of record to modify
-# i.e. example.com for the "domain record" or host.sub.example.com for "host record"
-
-# handling domain record then set __HOST = __DOMAIN
-[ -z "$__HOST" ] && __HOST=$__DOMAIN
-# handling host record then rebuild fqdn host@domain.tld => host.domain.tld
-[ "$__HOST" != "$__DOMAIN" ] && __HOST="${__HOST}.${__DOMAIN}"
-
-# set record type
-[ $use_ipv6 -eq 0 ] && __TYPE="A" || __TYPE="AAAA"
-
-# transfer function to use for godaddy
-# all needed variables are set global here
-# so we can use them directly
-cloudflare_transfer() {
- local __CNT=0
- local __ERR
- while : ; do
- write_log 7 "#> $__RUNPROG"
- eval "$__RUNPROG"
- __ERR=$? # save communication error
- [ $__ERR -eq 0 ] && break # no error break while
-
- write_log 3 "cURL Error: '$__ERR'"
- write_log 7 "$(cat $ERRFILE)" # report error
-
- [ $VERBOSE_MODE -gt 1 ] && {
- # VERBOSE_MODE > 1 then NO retry
- write_log 4 "Transfer failed - Verbose Mode: $VERBOSE_MODE - NO retry on error"
- break
- }
-
- __CNT=$(( $__CNT + 1 )) # increment error counter
- # if error count > retry_count leave here
- [ $retry_count -gt 0 -a $__CNT -gt $retry_count ] && \
- write_log 14 "Transfer failed after $retry_count retries"
-
- write_log 4 "Transfer failed - retry $__CNT/$retry_count in $RETRY_SECONDS seconds"
- sleep $RETRY_SECONDS &
- PID_SLEEP=$!
- wait $PID_SLEEP # enable trap-handler
- PID_SLEEP=0
- done
-
- # check for error
- grep -q '"success":\s*true' $DATFILE || {
- write_log 4 "CloudFlare reported an error:"
- write_log 7 "$(cat $DATFILE)" # report error
- return 1 # HTTP-Fehler
- }
-}
-
-# Build base command to use
-__PRGBASE="$CURL -RsS -o $DATFILE --stderr $ERRFILE"
-# force network/interface-device to use for communication
-if [ -n "$bind_network" ]; then
- local __DEVICE
- network_get_physdev __DEVICE $bind_network || \
- write_log 13 "Can not detect local device using 'network_get_physdev $bind_network' - Error: '$?'"
- write_log 7 "Force communication via device '$__DEVICE'"
- __PRGBASE="$__PRGBASE --interface $__DEVICE"
-fi
-# force ip version to use
-if [ $force_ipversion -eq 1 ]; then
- [ $use_ipv6 -eq 0 ] && __PRGBASE="$__PRGBASE -4" || __PRGBASE="$__PRGBASE -6" # force IPv4/IPv6
-fi
-# set certificate parameters
-if [ "$cacert" = "IGNORE" ]; then # idea from Ticket #15327 to ignore server cert
- __PRGBASE="$__PRGBASE --insecure" # but not empty better to use "IGNORE"
-elif [ -f "$cacert" ]; then
- __PRGBASE="$__PRGBASE --cacert $cacert"
-elif [ -d "$cacert" ]; then
- __PRGBASE="$__PRGBASE --capath $cacert"
-elif [ -n "$cacert" ]; then # it's not a file and not a directory but given
- write_log 14 "No valid certificate(s) found at '$cacert' for HTTPS communication"
-fi
-# disable proxy if not set (there might be .wgetrc or .curlrc or wrong environment set)
-# or check if libcurl compiled with proxy support
-if [ -z "$proxy" ]; then
- __PRGBASE="$__PRGBASE --noproxy '*'"
-elif [ -z "$CURL_PROXY" ]; then
- # if libcurl has no proxy support and proxy should be used then force ERROR
- write_log 13 "cURL: libcurl compiled without Proxy support"
-fi
-# set headers
-#__PRGBASE="$__PRGBASE --header 'X-Auth-Email: $username' "
-__PRGBASE="$__PRGBASE --header 'Authorization: Bearer $password' "
-__PRGBASE="$__PRGBASE --header 'Content-Type: application/json' "
-
-# read zone id for registered domain.TLD
-__RUNPROG="$__PRGBASE --request GET '$__URLBASE/zones?name=$__DOMAIN'"
-cloudflare_transfer || return 1
-# extract zone id
-__ZONEID=$(grep -o '"id":\s*"[^"]*' $DATFILE | grep -o '[^"]*$' | head -1)
-[ -z "$__ZONEID" ] && {
- write_log 4 "Could not detect 'zone id' for domain.tld: '$__DOMAIN'"
- return 127
-}
-
-# read record id for A or AAAA record of host.domain.TLD
-__RUNPROG="$__PRGBASE --request GET '$__URLBASE/zones/$__ZONEID/dns_records?name=$__HOST&type=$__TYPE'"
-cloudflare_transfer || return 1
-# extract record id
-__RECID=$(grep -o '"id":\s*"[^"]*' $DATFILE | grep -o '[^"]*$' | head -1)
-[ -z "$__RECID" ] && {
- write_log 4 "Could not detect 'record id' for host.domain.tld: '$__HOST'"
- return 127
-}
-
-# extract current stored IP
-__DATA=$(grep -o '"content":\s*"[^"]*' $DATFILE | grep -o '[^"]*$' | head -1)
-
-# check data
-[ $use_ipv6 -eq 0 ] \
- && __DATA=$(printf "%s" "$__DATA" | grep -m 1 -o "$IPV4_REGEX") \
- || __DATA=$(printf "%s" "$__DATA" | grep -m 1 -o "$IPV6_REGEX")
-
-# we got data so verify
-[ -n "$__DATA" ] && {
- # expand IPv6 for compare
- if [ $use_ipv6 -eq 1 ]; then
- expand_ipv6 $__IP __IPV6
- expand_ipv6 $__DATA __DATA
- [ "$__DATA" = "$__IPV6" ] && { # IPv6 no update needed
- write_log 7 "IPv6 at CloudFlare.com already up to date"
- return 0
- }
- else
- [ "$__DATA" = "$__IP" ] && { # IPv4 no update needed
- write_log 7 "IPv4 at CloudFlare.com already up to date"
- return 0
- }
- fi
-}
-
-# update is needed
-# let's build data to send
-# set proxied parameter
-__PROXIED=$(grep -o '"proxied":\s*[^",]*' $DATFILE | grep -o '[^:]*$')
-
-# use file to work around " needed for json
-cat > $DATFILE << EOF
-{"id":"$__ZONEID","type":"$__TYPE","name":"$__HOST","content":"$__IP","ttl":$__TTL,"proxied":$__PROXIED}
-EOF
-
-# let's complete transfer command
-__RUNPROG="$__PRGBASE --request PUT --data @$DATFILE '$__URLBASE/zones/$__ZONEID/dns_records/$__RECID'"
-cloudflare_transfer || return 1
-
-return 0
-
--- /dev/null
+#
+# This software is licensed under the Public Domain.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=fakepop
+PKG_VERSION:=11
+PKG_RELEASE:=1
+
+PKG_MAINTAINER:=Marc Egerton <foxtrot@realloc.me>
+PKG_LICENSE:=GPL-3.0-or-later
+
+PKG_SOURCE:=fakepop_11.tar.gz
+PKG_SOURCE_URL:=http://deb.debian.org/debian/pool/main/f/fakepop/
+PKG_HASH:=9756259ade152f8dac78174019b4145b4e07738631055c34bc04e64f865393e7
+# Downloaded .tar.gz contains "fakepop-10" instead of "fakepop-11"...
+PKG_BUILD_DIR:=$(BUILD_DIR)/fakepop-10
+
+include $(INCLUDE_DIR)/nls.mk
+include $(INCLUDE_DIR)/package.mk
+
+define Package/fakepop
+ SECTION:=net
+ CATEGORY:=Network
+ TITLE:=fakepop
+ DEPENDS:=+glib2 +xinetd
+endef
+
+define Package/fakepop/description
+ fake pop3 server which returns the same messages to all users
+endef
+
+define Package/fakepop/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/fakepop $(1)/usr/bin/
+ $(INSTALL_DIR) $(1)/etc/xinetd.d
+ $(CP) ./files/fakepop $(1)/etc/xinetd.d/
+ mkdir $(1)/etc/fakepop
+endef
+
+$(eval $(call BuildPackage,fakepop))
--- /dev/null
+service pop3
+{
+ socket_type = stream
+ protocol = tcp
+ wait = no
+ user = nobody
+ server = /usr/bin/fakepop
+ port = 110
+ disable = no
+}
include $(TOPDIR)/rules.mk
PKG_NAME:=fping
-PKG_VERSION:=4.4
+PKG_VERSION:=5.0
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://fping.org/dist/
-PKG_HASH:=9f854b65a52dc7b1749d6743e35d0a6268179d1a724267339fc9a066b2b72d11
+PKG_SOURCE_URL:=https://fping.org/dist
+PKG_HASH:=ed38c0b9b64686a05d1b3bc1d66066114a492e04e44eef1821d43b1263cd57b8
PKG_MAINTAINER:=Nikil Mehta <nikil.mehta@gmail.com>
PKG_LICENSE:=BSD-4-Clause
include $(TOPDIR)/rules.mk
PKG_NAME:=hs20
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE_URL:=http://w1.fi/hostap.git
PKG_SOURCE_PROTO:=git
PKG_LICENSE:=BSD-3-Clause
PKG_CPE_ID:=cpe:/a:w1.fi:hostapd
+define Download/dm-ddf-dtd
+ URL:=http://www.openmobilealliance.org/tech/DTD
+ FILE:=dm_ddf-v1_2.dtd
+ HASH:=1fb8f97ee13b673e0d2386ef3ec64fbc9c8d75429a9725dc3fac295c4d5ccae4
+endef
+
+define Download/spp-xsd
+ URL:=https://raw.githubusercontent.com/greearb/hostap-ct/7a7b81d0e58c81796c7408a47082c9cc7587aa21/hs20/server/examples/Fedora20/hs20/spp
+ URL_FILE:=spp.xsd
+ FILE:=spp-v1_0.xsd
+ HASH:=83be16db72e96cca8d654d7f0b446cdd017090d5512a4cd5f7172204331fd8f2
+endef
+
PKG_BUILD_PARALLEL:=1
PKG_ASLR_PIE_REGULAR:=1
include $(INCLUDE_DIR)/package.mk
+define Package/hs20-common
+ SECTION:=net
+ CATEGORY:=Network
+ SUBMENU:=WirelessAPD
+ TITLE:=Hotspot 2.0 OSU common files
+ URL:=http://hostap.epitest.fi/
+endef
+
+define Package/hs20-common/description
+Hotspot 2.0 OSU common files
+
+Hotspot 2.0 SPP and OMA DM XML schema/DTD files
+endef
+
define Package/hs20-client
SECTION:=net
CATEGORY:=Network
SUBMENU:=WirelessAPD
TITLE:=Hotspot 2.0 OSU client
URL:=http://hostap.epitest.fi/
- DEPENDS:=+libopenssl +libcurl +libxml2
+ DEPENDS:=+hs20-common +libopenssl +libcurl +libxml2
+endef
+
+define Package/hs20-client/description
+Hotspot 2.0 OSU client
+
endef
define Package/hs20-server
SUBMENU:=WirelessAPD
TITLE:=Hotspot 2.0 OSU server
URL:=http://hostap.epitest.fi/
- DEPENDS:=+libopenssl +libsqlite3 +libxml2 +php7 +php7-cgi +php7-mod-xml +openssl-util +sqlite3-cli
+ DEPENDS:=+hs20-common +libopenssl +libsqlite3 +libxml2 +php7 +php7-cgi +php7-mod-xml +php7-mod-pdo-sqlite +openssl-util +sqlite3-cli +uhttpd +xxd
+endef
+
+define Package/hs20-server/description
+Hotspot 2.0 OSU server
+
+This implementation and the example configuration is meant only for
+testing purposes in a lab environment. This design is not secure to be
+installed in a publicly available Internet server without considerable
+amount of modification and review for security issues.
+endef
+
+define Build/Prepare
+ $(call Build/Prepare/Default)
+ $(eval $(call Download,dm-ddf-dtd))
+ $(eval $(call Download,spp-xsd))
endef
define Build/Configure
- cp "./files/hs20.config" "$(PKG_BUILD_DIR)/hostapd/.config"
+ $(CP) ./files/hostapd.config $(PKG_BUILD_DIR)/hostapd/.config
endef
define Build/RunMake
$(call Build/RunMake,hs20/client,-lssl -lcrypto -lcurl -lxml2,all)
endef
+define Package/hs20-common/install
+ $(INSTALL_DIR) $(1)/etc/hs20/spp
+ $(INSTALL_DATA) $(DL_DIR)/dm_ddf-v1_2.dtd $(1)/etc/hs20/spp
+ $(INSTALL_DATA) $(DL_DIR)/spp-v1_0.xsd $(1)/etc/hs20/spp/spp.xsd
+endef
+
define Package/hs20-client/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/hs20/client/hs20-osu-client $(1)/usr/sbin/
endef
define Package/hs20-server/install
- $(INSTALL_DIR) $(1)/usr/sbin $(1)/usr/share/hs20/ca $(1)/www/hs20
+ $(INSTALL_DIR) $(1)/usr/sbin $(1)/usr/share/hs20/ca $(1)/www/hs20 $(1)/etc/uci-defaults $(1)/etc/hs20/spp $(1)/etc/config $(1)/etc/init.d
$(INSTALL_BIN) $(PKG_BUILD_DIR)/hostapd/hostapd $(1)/usr/sbin/hostapd-hs20-radius-server
$(INSTALL_BIN) $(PKG_BUILD_DIR)/hostapd/hlr_auc_gw $(1)/usr/sbin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/hs20/server/hs20_spp_server $(1)/usr/sbin/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/hs20/server/www/* $(1)/www/hs20
- $(INSTALL_DATA) $(PKG_BUILD_DIR)/hs20/server/*.txt $(1)/usr/share/hs20
- $(INSTALL_DATA) $(PKG_BUILD_DIR)/hs20/server/ca/* $(1)/usr/share/hs20/ca
+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/hs20/server/sql.txt $(1)/usr/share/hs20
+ $(CP) $(PKG_BUILD_DIR)/hs20/server/ca/* $(1)/usr/share/hs20/ca
+ $(INSTALL_BIN) ./files/hs20-server.defaults $(1)/etc/uci-defaults/hs20-server
+ $(INSTALL_CONF) ./files/hs20.config $(1)/etc/config/hs20
+ $(INSTALL_BIN) ./files/hs20.init $(1)/etc/init.d/hs20
endef
+$(eval $(call BuildPackage,hs20-common))
$(eval $(call BuildPackage,hs20-client))
$(eval $(call BuildPackage,hs20-server))
--- /dev/null
+CONFIG_DRIVER_NONE=y
+CONFIG_PKCS12=y
+CONFIG_RADIUS_SERVER=y
+CONFIG_EAP=y
+CONFIG_EAP_TLS=y
+CONFIG_EAP_MSCHAPV2=y
+CONFIG_EAP_PEAP=y
+CONFIG_EAP_GTC=y
+CONFIG_EAP_TTLS=y
+CONFIG_EAP_SIM=y
+CONFIG_EAP_AKA=y
+CONFIG_EAP_AKA_PRIME=y
+CONFIG_SQLITE=y
+CONFIG_HS20=y
+CONFIG_WPS=y
--- /dev/null
+#!/bin/sh
+
+uci -q get uhttpd.main.interpreter | grep -q "^\.php" || uci -q batch <<-EOF >/dev/null
+add_list uhttpd.main.interpreter='.php=/usr/bin/php-cgi'
+commit uhttpd
+EOF
+
+mkdir -p /etc/hs20/AS/DB
+[ -e /etc/hs20/AS/DB/eap_user.db ] || sqlite3 /etc/hs20/AS/DB/eap_user.db < /usr/share/hs20/sql.txt
+
+exit 0
-CONFIG_DRIVER_NONE=y
-CONFIG_PKCS12=y
-CONFIG_RADIUS_SERVER=y
-CONFIG_EAP=y
-CONFIG_EAP_TLS=y
-CONFIG_EAP_MSCHAPV2=y
-CONFIG_EAP_PEAP=y
-CONFIG_EAP_GTC=y
-CONFIG_EAP_TTLS=y
-CONFIG_EAP_SIM=y
-CONFIG_EAP_AKA=y
-CONFIG_EAP_AKA_PRIME=y
-CONFIG_SQLITE=y
-CONFIG_HS20=y
+config server server
+ option enabled '0'
+ option spp_http_auth_url 'https://subscription-server.osu.example.com/hs20/spp.php?realm=example.com'
+ option trust_root_cert_url 'https://osu-server.osu.example.com/hs20/files/spp-root-ca.der'
+ option trust_root_cert_fingerprint '5b393a9246865569485c2605c3304e48212b449367858299beba9384c4cf4647'
+ option aaa_trust_root_cert_url 'https://osu-server.osu.example.com/hs20/files/aaa-root-ca.der'
+ option aaa_trust_root_cert_fingerprint '5b393a9246865569485c2605c3304e48212b449367858299beba9384c4cf4647'
+ option free_account 'free'
+ option policy_url 'https://subscription-server.osu.example.com/hs20/spp.php?realm=example.com'
+ option remediation_url 'https://subscription-server.osu.example.com/hs20/remediation.php?session_id='
+ option free_remediation_url 'https://subscription-server.osu.example.com/hs20/free-remediation.php?session_id='
+ option signup_url 'https://subscription-server.osu.example.com/hs20/signup.php?session_id='
+ option osu_nai 'osen@w1.fi'
+ option radius_passphrase 'radius-s3CReT'
+ option as_passphrase 'as-s3CReT'
+
+config ca ca
+ option company 'OpenWrt.org'
+ option friendly_name 'Example Operator'
+ option rootsubject 'Hotspot 2.0 Testing Root CA - 99'
+ option logo_sha1 '5e1d5085676eede6b02da14d31c523ec20ffba0b'
+ option logo_sha256 '4532f7ec36424381617c03c6ce87b55a51d6e7177ffafda243cebf280a68954d'
+ option logo_url 'http://osu.w1.fi/w1fi_logo.png'
+ option domain 'w1.fi'
+ option osu_client_subject 'osu-client.w1.fi'
+ option ocsp_server_subject 'ocsp.w1.fi'
+ option key_passphrase 'whatever'
+ option osu_server_name 'osu.w1.fi'
+ option ocsp_uri 'http://ocsp.w1.fi:8888/'
+ option revoked_subject 'osu-revoked.w1.fi'
+
+config policy policy
+ option update_interval '30'
+ option update_method 'ClientInitiated'
+ option restriction 'Unrestricted'
+ option uri 'https://policy-server.osu.example.com/hs20/spp.php'
--- /dev/null
+#!/bin/sh /etc/rc.common
+
+START=49
+
+USE_PROCD=1
+
+setup_ca() {
+ [ -e /etc/hs20/AS/Key/server.pem ] && return 0
+
+ local company friendly_name rootsubject logo_sha1 logo_sha256 logo_url domain osu_client_subject ocsp_server_subject key_passphrase osu_server_name ocsp_uri revoked_subject
+ config_load hs20
+ config_get company ca company
+ config_get friendly_name ca friendly_name
+ config_get rootsubject ca rootsubject
+ config_get logo_sha1 ca logo_sha1
+ config_get logo_sha256 ca logo_sha256
+ config_get logo_url ca logo_url
+ config_get domain ca domain
+ config_get osu_client_subject ca osu_client_subject
+ config_get ocsp_server_subject ca ocsp_server_subject
+ config_get key_passphrase ca key_passphrase
+ config_get osu_server_name ca osu_server_name
+ config_get ocsp_uri ca ocsp_uri
+
+ mkdir -p /etc/hs20/ca
+ (
+ cd /etc/hs20/ca
+ /bin/busybox sh /usr/share/hs20/ca/setup.sh -c "$company" -C "$friendly_name" -g "$logo_sha1" -G "$logo_sha256" -l "$logo_url" -m "$domain" -o "$osu_client_subject" -O "$ocsp_server_subject" -p "$key_passphrase" -S "$osu_server_name" -u "$ocsp_uri" -V "$revoked_subject"
+ )
+
+ mkdir -p /etc/hs20/AS/Key
+ cp /etc/hs20/ca/server.* /etc/hs20/ca/ca.pem /etc/hs20/AS/Key
+
+ return 0
+}
+
+sql_set() {
+ echo "DELETE FROM osu_config WHERE realm='$1' AND field='$2';"
+ echo "INSERT INTO osu_config(realm,field,value) VALUES('$1','$2','$3');"
+}
+
+setup_dbconf() {
+ local domain spp_http_auth_url trust_root_cert_url
+ config_load hs20
+ config_get realm ca domain
+ config_get spp_http_auth_url server spp_http_auth_url
+ config_get trust_root_cert_url server trust_root_cert_url
+ config_get trust_root_cert_fingerprint server trust_root_cert_fingerprint
+ config_get aaa_trust_root_cert_url server aaa_trust_root_cert_url
+ config_get aaa_trust_root_cert_fingerprint server aaa_trust_root_cert_fingerprint
+ config_get free_account server free_account
+ config_get policy_url server policy_url
+ config_get remediation_url server remediation_url
+ config_get free_remediation_url server free_remediation_url
+ config_get signup_url server signup_url
+ (
+ sql_set $realm spp_http_auth_url "$spp_http_auth_url"
+ sql_set $realm trust_root_cert_url "$trust_root_cert_url"
+ sql_set $realm trust_root_cert_fingerprint "$trust_root_cert_fingerprint"
+ sql_set $realm aaa_trust_root_cert_url "$aaa_trust_root_cert_url"
+ sql_set $realm aaa_trust_root_cert_fingerprint "$aaa_trust_root_cert_fingerprint"
+ sql_set $realm free_account "$free_account"
+ sql_set $realm policy_url "$policy_url"
+ sql_set $realm remediation_url "$remediation_url"
+ sql_set $realm free_remediation_url "$free_remediation_url"
+ sql_set $realm signup_url "$signup_url"
+ ) | sqlite3 /etc/hs20/AS/DB/eap_user.db
+
+ return 0
+}
+
+setup_policy() {
+ local update_interval update_method restriction uri
+ config_load hs20
+ config_get update_interval policy update_interval
+ config_get update_method policy update_method
+ config_get restriction policy restriction
+ config_get uri policy uri
+
+ if [ ! -e "/etc/hs20/spp/policy/default.xml" ]; then
+ mkdir -p /etc/hs20/spp/policy
+ ln -s /tmp/run/spp-default-policy.xml /etc/hs20/spp/policy/default.xml
+ fi
+
+ cat > /tmp/run/spp-default-policy.xml <<EOF
+<Policy>
+ <PolicyUpdate>
+ <UpdateInterval>$update_interval</UpdateInterval>
+ <UpdateMethod>$update_method</UpdateMethod>
+ <Restriction>$restriction</Restriction>
+ <URI>$uri</URI>
+ </PolicyUpdate>
+</Policy>
+
+EOF
+ return 0
+}
+
+prepare_config() {
+ local key_passphrase subscr_remediation_url osu_nai as_passphrase radius_passphrase
+ config_load hs20
+ config_get key_passphrase ca key_passphrase
+ config_get subscr_remediation_url policy uri
+ config_get osu_nai server osu_nai
+ config_get as_passphrase server as_passphrase
+ config_get radius_passphrase server radius_passphrase
+
+ cat > /tmp/run/as-sql.conf <<EOF
+driver=none
+radius_server_clients=/etc/hs20/AS/as.radius_clients
+eap_server=1
+eap_user_file=sqlite:/etc/hs20/AS/DB/eap_user.db
+ca_cert=/etc/hs20/AS/Key/ca.pem
+server_cert=/etc/hs20/AS/Key/server.pem
+private_key=/etc/hs20/AS/Key/server.key
+private_key_passwd=$key_passphrase
+eap_sim_db=unix:/tmp/hlr_auc_gw.sock db=/etc/hs20/AS/DB/eap_sim.db
+subscr_remediation_url=$subscr_remediation_url
+EOF
+
+ mkdir -p /var/run/hostapd/hs20-radius
+ cat > /tmp/run/radius-sql.conf <<EOF
+# hostapd-radius config for the radius used by the OSEN AP
+interface=lo
+driver=none
+logger_syslog=-1
+logger_syslog_level=2
+logger_stdout=-1
+logger_stdout_level=2
+ctrl_interface=/var/run/hostapd/hs20-radius
+ctrl_interface_group=0
+eap_server=1
+eap_user_file=/etc/hs20/AS/hostapd-osen.eap_user
+server_id=ben-ota-2-osen
+radius_server_auth_port=1811
+radius_server_clients=/etc/hs20/AS/hostap.radius_clients
+
+ca_cert=/etc/hs20/ca/ca.pem
+server_cert=/etc/hs20/ca/server.pem
+private_key=/etc/hs20/ca/server.key
+private_key_passwd=$key_passphrase
+
+ocsp_stapling_response=/etc/hs20/ca/ocsp-server-cache.der
+EOF
+
+ cat > /etc/hs20/AS/hostapd-osen.eap_user <<EOF
+# For OSEN authentication (Hotspot 2.0 Release 2)
+"$osu_nai" WFA-UNAUTH-TLS
+EOF
+
+ cat > /etc/hs20/AS/hostap.radius_clients <<EOF
+0.0.0.0/0 $radius_passphrase
+EOF
+
+ cat > /etc/hs20/AS/as.radius_clients <<EOF
+0.0.0.0/0 $as_passphrase
+EOF
+
+ return 0
+}
+
+start_service() {
+ local enabled
+ config_load hs20
+ config_get enabled server enabled
+
+ [ "$enabled" != "1" ] && [ "$enabled" != "true" ] && exit 0
+ echo "starting"
+
+ setup_ca
+ setup_policy
+ setup_dbconf
+ prepare_config
+
+ procd_open_instance ocsp-responder
+ procd_set_param command /usr/bin/openssl ocsp -index /etc/hs20/ca/demoCA/index.txt -port 8888 -nmin 5 -rsigner /etc/hs20/ca/ocsp.pem -rkey /etc/hs20/ca/ocsp.key -CA /etc/hs20/ca/demoCA/cacert.pem -text -ignore_err
+ procd_set_param stdout 1
+ procd_set_param stderr 1
+ procd_set_param respawn
+ procd_close_instance
+
+ procd_open_instance hs20-ac
+ procd_set_param command /usr/sbin/hostapd-hs20-radius-server /tmp/run/as-sql.conf
+ procd_set_param stdout 1
+ procd_set_param stderr 1
+ procd_set_param respawn
+ procd_close_instance
+
+ procd_open_instance hs20-radius
+ procd_set_param command /usr/sbin/hostapd-hs20-radius-server /tmp/run/radius-sql.conf
+ procd_set_param stdout 1
+ procd_set_param stderr 1
+ procd_set_param respawn
+ procd_close_instance
+}
--- /dev/null
+--- a/hs20/server/www/spp.php
++++ b/hs20/server/www/spp.php
+@@ -141,7 +141,7 @@ $addr = $_SERVER["REMOTE_ADDR"];
+ putenv("HS20ADDR=$addr");
+ putenv("HS20TEST=$test");
+
+-$last = exec("$osu_root/spp/hs20_spp_server -r$osu_root -f/tmp/hs20_spp_server.log", $output, $ret);
++$last = exec("/usr/sbin/hs20_spp_server -r$osu_root -f/tmp/hs20_spp_server.log", $output, $ret);
+
+ if ($ret == 2) {
+ if (empty($_SERVER['PHP_AUTH_DIGEST'])) {
--- /dev/null
+--- a/hs20/server/www/config.php
++++ b/hs20/server/www/config.php
+@@ -1,7 +1,11 @@
+ <?php
+-$osu_root = "/home/user/hs20-server";
++$osu_root = "/etc/hs20";
+ $osu_db = "sqlite:$osu_root/AS/DB/eap_user.db";
+ $t_c_file = "$osu_root/terms-and-conditions";
+-$t_c_timestamp = 123456789;
+-$hostapd_ctrl = "udg:///home/user/hs20-server/AS/ctrl/as"
++if (file_exists($t_c_file)) {
++ $t_c_timestamp = filemtime($t_c_file);
++} else {
++ $t_c_timestamp = filemtime($osu_root);
++}
++$hostapd_ctrl = "udg:///var/run/hostapd/hs20-radius/lo"
+ ?>
--- /dev/null
+--- a/hs20/server/ca/setup.sh
++++ b/hs20/server/ca/setup.sh
+@@ -3,7 +3,7 @@
+ if [ -z "$OPENSSL" ]; then
+ OPENSSL=openssl
+ fi
+-export OPENSSL_CONF=$PWD/openssl.cnf
++export OPENSSL_CONF=/usr/share/hs20/ca/openssl.cnf
+ PASS=whatever
+ if [ -z "$DOMAIN" ]; then
+ DOMAIN=w1.fi
+@@ -83,10 +83,10 @@ then
+ fi
+
+ # Set the passphrase and some other common config accordingly.
+-cat openssl-root.cnf | sed "s/@PASSWORD@/$PASS/" \
++cat /usr/share/hs20/ca/openssl-root.cnf | sed "s/@PASSWORD@/$PASS/" \
+ > my-openssl-root.cnf
+
+-cat openssl.cnf | sed "s/@PASSWORD@/$PASS/" |
++cat /usr/share/hs20/ca/openssl.cnf | sed "s/@PASSWORD@/$PASS/" |
+ sed "s,@OCSP_URI@,$OCSP_URI," |
+ sed "s,@LOGO_URI@,$LOGO_URI," |
+ sed "s,@LOGO_HASH1@,$LOGO_HASH1," |
include $(TOPDIR)/rules.mk
PKG_NAME:=i2pd
-PKG_VERSION:=2.30.0
-PKG_RELEASE:=2
+PKG_VERSION:=2.32.1
+PKG_RELEASE:=1
PKG_BUILD_PARALLEL:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/PurpleI2P/i2pd/tar.gz/$(PKG_VERSION)?
-PKG_HASH:=25915cbd33a9f53c89ddf7fbd68fccc5ffc89ab40d4445ccc813da74fae154f2
+PKG_HASH:=64229101411a9dda3237dc27939aa13ec90d4900aae499e59931063c36e8556b
PKG_MAINTAINER:=David Yang <mmyangfl@gmail.com>
PKG_LICENSE:=BSD-3-Clause
PKG_NAME:=isc-dhcp
UPSTREAM_NAME:=dhcp
PKG_VERSION:=4.4.1
-PKG_RELEASE:=6
+PKG_RELEASE:=7
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE
CONFIGURE_ARGS += --enable-dhcpv6
endif
+TARGET_CFLAGS += -fcommon
+
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR) \
BUILD_CC="$(HOSTCC_NOCACHE)" \
include $(TOPDIR)/rules.mk
PKG_NAME:=modemmanager
-PKG_VERSION:=1.14.0
-PKG_RELEASE:=3
+PKG_VERSION:=1.14.2
+PKG_RELEASE:=1
PKG_SOURCE:=ModemManager-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://www.freedesktop.org/software/ModemManager
-PKG_HASH:=8976e2f890380d35144d4d9146bc225d926ae72c9b48d7e50c1dd9674d2bd079
+PKG_HASH:=5fb5553aecd6eb9d6d8ecd130a24f3461e5f93c5f91a0e4ae0508b5228e8b0be
PKG_BUILD_DIR:=$(BUILD_DIR)/ModemManager-$(PKG_VERSION)
PKG_MAINTAINER:=Nicholas Smith <nicholas.smith@telcoantennas.com.au>
include $(TOPDIR)/rules.mk
PKG_NAME:=mosquitto
-PKG_VERSION:=1.6.11
+PKG_VERSION:=1.6.12
PKG_RELEASE:=1
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE.txt
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://mosquitto.org/files/source/
-PKG_HASH:=b02d8f1368c40d5779ee125c37daf9003608eb47d7fbb04c5b938c76c1230a1f
+PKG_HASH:=548d73d19fb787dd0530334e398fd256ef3a581181678488a741a995c4f007fb
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/rules.mk
PKG_NAME:=mwan3
-PKG_VERSION:=2.8.12
-PKG_RELEASE:=2
+PKG_VERSION:=2.9.0
+PKG_RELEASE:=1
PKG_MAINTAINER:=Florian Eckert <fe@dev.tdt.de>
PKG_LICENSE:=GPL-2.0
config globals 'globals'
option mmx_mask '0x3F00'
- option rtmon_interval '5'
config interface 'wan'
option enabled '1'
. /lib/functions/network.sh
. /lib/mwan3/mwan3.sh
. /usr/share/libubox/jshn.sh
+. /lib/mwan3/common.sh
-[ "$ACTION" == "ifup" -o "$ACTION" == "ifdown" ] || exit 1
+SCRIPTNAME="mwan3-hotplug"
+[ "$ACTION" = "ifup" ] || [ "$ACTION" = "ifdown" ] || [ "$ACTION" = "connected" ] || [ "$ACTION" = "disconnected" ] || exit 1
[ -n "$INTERFACE" ] || exit 2
-
-if [ "$ACTION" == "ifup" ]; then
- [ -n "$DEVICE" ] || exit 3
+if ( [ "$ACTION" = "ifup" ] || [ "$ACTION" = "connected" ] ) && [ -z "$DEVICE" ]; then
+ LOG notice "$ACTION called on $INTERFACE with no device set"
+ exit 3
fi
-mwan3_lock "$ACTION" "$INTERFACE"
+[ "$MWAN3_STARTUP" = 1 ] || mwan3_lock "$ACTION" "$INTERFACE"
+
config_load mwan3
config_get_bool enabled globals 'enabled' '0'
[ "${enabled}" -gt 0 ] || {
+ [ "$MWAN3_STARTUP" = 1 ] || mwan3_unlock "$ACTION" "$INTERFACE"
+ LOG notice "mwan3 hotplug on $INTERFACE not called because globally disabled"
+ mwan3_flush_conntrack "$INTERFACE" "$ACTION"
+ exit 0
+}
+
+$IPT4 -S mwan3_hook &>/dev/null || {
mwan3_unlock "$ACTION" "$INTERFACE"
+ LOG warn "hotplug called on $INTERFACE before mwan3 has been set up"
exit 0
}
mwan3_init
-mwan3_set_connected_iptables
-mwan3_set_custom_ipset
+[ "$MWAN3_STARTUP" = 1 ] || {
+ mwan3_set_connected_iptables
+ mwan3_set_custom_ipset
+}
+
+if [ "$MWAN3_STARTUP" != 1 ]; then
+ mwan3_set_user_iface_rules $INTERFACE $DEVICE
+fi
config_get initial_state $INTERFACE initial_state "online"
config_get_bool enabled $INTERFACE 'enabled' '0'
[ "${enabled}" -eq 1 ] || {
- mwan3_unlock "$ACTION" "$INTERFACE"
+ [ "$MWAN3_STARTUP" = 1 ] || mwan3_unlock "$ACTION" "$INTERFACE"
+ LOG notice "mwan3 hotplug on $INTERFACE not called because interface disabled"
exit 0
}
-if [ "$ACTION" = "ifup" ]; then
- config_get family $INTERFACE family ipv4
- if [ "$family" = "ipv4" ]; then
- ubus call network.interface.${INTERFACE}_4 status &>/dev/null
- if [ "$?" -eq "0" ]; then
- network_get_ipaddr src_ip ${INTERFACE}_4
- else
- network_get_ipaddr src_ip ${INTERFACE}
- fi
- [ -n "$src_ip" ] || src_ip="0.0.0.0"
- elif [ "$family" = "ipv6" ]; then
- ubus call network.interface.${INTERFACE}_6 status &>/dev/null
- if [ "$?" -eq "0" ]; then
- network_get_ipaddr6 src_ip ${INTERFACE}_6
- else
- network_get_ipaddr6 src_ip ${INTERFACE}
- fi
- [ -n "$src_ip" ] || src_ip="::"
- fi
-fi
+trackpid=$(pgrep -f "mwan3track $INTERFACE ")
if [ "$initial_state" = "offline" ]; then
- json_load "$(ubus call mwan3 status '{"section":"interfaces"}')"
- json_select "interfaces"
- json_select "${INTERFACE}"
- json_get_var running running
- json_get_var status status
+ status=$(cat $MWAN3TRACK_STATUS_DIR/$INTERFACE/STATUS 2>/dev/null || echo unknown)
else
status=online
- running=1
fi
-$LOG notice "Execute "$ACTION" event on interface $INTERFACE (${DEVICE:-unknown})"
+[ -z "$TRUE_INTERFACE" ] && mwan3_get_true_iface TRUE_INTERFACE $INTERFACE
+
+binary_status=$status
+[ "$binary_status" = "online" ] || binary_status=offline
+
+LOG notice "Execute "$ACTION" event on interface $INTERFACE (${DEVICE:-unknown})"
case "$ACTION" in
- ifup)
- mwan3_set_general_rules
- mwan3_set_general_iptables
+ ifup|connected)
mwan3_create_iface_iptables $INTERFACE $DEVICE
mwan3_create_iface_rules $INTERFACE $DEVICE
mwan3_create_iface_route $INTERFACE $DEVICE
- if [ "${running}" -eq 1 ] && [ "${status}" = "online" ]; then
- $LOG notice "Starting tracker on interface $INTERFACE (${DEVICE:-unknown})"
- mwan3_set_iface_hotplug_state $INTERFACE "online"
- mwan3_track $INTERFACE $DEVICE "online" "$src_ip"
+ [ "$MWAN3_STARTUP" != 1 ] && mwan3_add_non_default_iface_route $INTERFACE $DEVICE
+ mwan3_set_iface_hotplug_state $INTERFACE "$binary_status"
+
+ mwan3_get_src_ip src_ip "$TRUE_INTERFACE"
+ if [ -n "${trackpid}" ]; then
+ device_pid=$(pgrep -f "mwan3track $INTERFACE $DEVICE ")
+ if [ "$device_pid" = "$trackpid" ]; then
+ [ "$ACTION" = ifup ] && kill -USR2 "$trackpid"
+ else
+ mwan3_track $INTERFACE $DEVICE "$binary_status" "$src_ip"
+ LOG notice "Restarted tracker [$!] on interface $INTERFACE (${DEVICE:-unknown})"
+ fi
else
- $LOG notice "Starting tracker on interface $INTERFACE (${DEVICE:-unknown})"
- mwan3_set_iface_hotplug_state $INTERFACE "offline"
- mwan3_track $INTERFACE $DEVICE "offline" "$src_ip"
+ mwan3_track $INTERFACE $DEVICE "$binary_status" "$src_ip"
+ LOG notice "Started tracker [$!] on interface $INTERFACE (${DEVICE:-unknown})"
fi
- mwan3_set_policies_iptables
- mwan3_set_user_rules
+ [ "$MWAN3_STARTUP" != 1 ] && [ "$binary_status" == "online" ] && mwan3_set_policies_iptables
+
;;
- ifdown)
+ ifdown|disconnected)
mwan3_set_iface_hotplug_state $INTERFACE "offline"
mwan3_delete_iface_ipset_entries $INTERFACE
- mwan3_track_signal $INTERFACE $DEVICE
+ mwan3_delete_iface_rules $INTERFACE
+ mwan3_delete_iface_route $INTERFACE
+ mwan3_delete_iface_iptables $INTERFACE
+ if [ "$ACTION" = "ifdown" ]; then
+ [ -n "$trackpid" ] && kill -USR1 "$trackpid"
+ fi
mwan3_set_policies_iptables
- mwan3_set_user_rules
;;
esac
-
-mwan3_unlock "$ACTION" "$INTERFACE"
-
+[ "$MWAN3_STARTUP" = 1 ] || mwan3_unlock "$ACTION" "$INTERFACE"
exit 0
+++ /dev/null
-#!/bin/sh
-
-. /lib/functions.sh
-. /lib/functions/network.sh
-. /lib/mwan3/mwan3.sh
-
-mwan3_lock "$ACTION" "mwan3rtmon"
-
-config_load mwan3
-config_get_bool enabled globals 'enabled' '0'
-[ "${enabled}" -gt 0 ] || {
- mwan3_unlock "$ACTION" "mwan3rtmon"
- exit 0
-}
-
-if [ "$ACTION" = "ifup" ]; then
- mwan3_rtmon
-fi
-
-config_get_bool enabled "$INTERFACE" 'enabled' '0'
-[ "${enabled}" -eq 0 ] || {
- mwan3_flush_conntrack "$INTERFACE" "$ACTION"
-}
-
-mwan3_unlock "$ACTION" "mwan3rtmon"
-
-exit 0
. /lib/functions.sh
. /lib/mwan3/mwan3.sh
- mwan3_lock "$ACTION" "user"
+ [ "$MWAN3_STARTUP" = 1 ] || mwan3_lock "$ACTION" "$DEVICE-user"
config_load mwan3
config_get_bool enabled globals 'enabled' '0'
[ "${enabled}" -gt 0 ] || {
- mwan3_unlock "$ACTION" "user"
+ [ "$MWAN3_STARTUP" = 1 ] || mwan3_unlock "$ACTION" "$DEVICE-user"
exit 0
}
config_get_bool enabled "$INTERFACE" enabled 0
[ "${enabled}" -eq 1 ] || {
- mwan3_unlock "$ACTION" "user"
+ [ "$MWAN3_STARTUP" = 1 ] || mwan3_unlock "$ACTION" "$DEVICE-user"
exit 0
}
- mwan3_unlock "$ACTION" "user"
+ [ "$MWAN3_STARTUP" = 1 ] || mwan3_unlock "$ACTION" "$DEVICE-user"
env -i ACTION="$ACTION" INTERFACE="$INTERFACE" DEVICE="$DEVICE" \
/bin/sh /etc/mwan3.user
boot() {
. /lib/config/uci.sh
- uci_toggle_state mwan3 globals enabled "1"
- mwan3_boot=1
+ # disabled until mwan3 start runs so hotplug scripts
+ # do not start prematurely
+ uci_toggle_state mwan3 globals enabled "0"
rc_procd start_service
}
}
start_service() {
- [ -n "${mwan3_boot}" ] && return 0
/usr/sbin/mwan3 start 1000>&-
}
local uptime=$(cat /proc/uptime)
echo "${uptime%%.*}"
}
+
+SCRIPTNAME="$(basename "$0")"
+LOG()
+{
+ local facility=$1; shift
+ # in development, we want to show 'debug' level logs
+ # when this release is out of beta, the comment in the line below
+ # should be removed
+ [ "$facility" = "debug" ] && return
+ logger -t "$SCRIPTNAME[$$]" -p $facility "$*"
+}
IPS="ipset"
IPT4="iptables -t mangle -w"
IPT6="ip6tables -t mangle -w"
-LOG="logger -t mwan3[$$] -p"
+IPT4R="iptables-restore -T mangle -w -n"
+IPT6R="ip6tables-restore -T mangle -w -n"
CONNTRACK_FILE="/proc/net/nf_conntrack"
IPv6_REGEX="([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|"
IPv6_REGEX="${IPv6_REGEX}([0-9a-fA-F]{1,4}:){1,7}:|"
command -v ip6tables > /dev/null
NO_IPV6=$?
-# return true(=0) if has any mwan3 interface enabled
-# otherwise return false
-mwan3_rtmon_ipv4()
+mwan3_push_update()
{
- local idx=0
- local ret=1
- local tbl=""
-
- local tid family enabled
-
- mkdir -p /tmp/mwan3rtmon
- ($IP4 route list table main | grep -v "^default\|linkdown" | sort -n; echo empty fixup) >/tmp/mwan3rtmon/ipv4.main
- while uci get mwan3.@interface[$idx] >/dev/null 2>&1 ; do
- tid=$((idx+1))
-
- family="$(uci -q get mwan3.@interface[$idx].family)"
- [ -z "$family" ] && family="ipv4"
-
- enabled="$(uci -q get mwan3.@interface[$idx].enabled)"
- [ -z "$enabled" ] && enabled="0"
-
- [ "$family" = "ipv4" ] && {
- tbl=$($IP4 route list table $tid 2>/dev/null)
- if echo "$tbl" | grep -q ^default; then
- (echo "$tbl" | grep -v "^default\|linkdown" | sort -n; echo empty fixup) >/tmp/mwan3rtmon/ipv4.$tid
- cat /tmp/mwan3rtmon/ipv4.$tid | grep -v -x -F -f /tmp/mwan3rtmon/ipv4.main | while read line; do
- $IP4 route del table $tid $line
- done
- cat /tmp/mwan3rtmon/ipv4.main | grep -v -x -F -f /tmp/mwan3rtmon/ipv4.$tid | while read line; do
- $IP4 route add table $tid $line
- done
- fi
- }
- if [ "$enabled" = "1" ]; then
- ret=0
- fi
- idx=$((idx+1))
- done
- rm -f /tmp/mwan3rtmon/ipv4.*
- return $ret
+ # helper function to build an update string to pass on to
+ # IPTR or IPS RESTORE. Modifies the 'update' variable in
+ # the local scope.
+ update="$update
+$*";
}
-# return true(=0) if has any mwan3 interface enabled
-# otherwise return false
-mwan3_rtmon_ipv6()
+mwan3_update_dev_to_table()
{
- local idx=0
- local ret=1
- local tbl=""
-
- local tid family enabled
-
- mkdir -p /tmp/mwan3rtmon
- ($IP6 route list table main | grep -v "^default\|^::/0\|^fe80::/64\|^unreachable" | sort -n; echo empty fixup) >/tmp/mwan3rtmon/ipv6.main
- while uci get mwan3.@interface[$idx] >/dev/null 2>&1 ; do
- tid=$((idx+1))
-
- family="$(uci -q get mwan3.@interface[$idx].family)"
- # Set default family to ipv4 that is no mistake
- [ -z "$family" ] && family="ipv4"
-
- enabled="$(uci -q get mwan3.@interface[$idx].enabled)"
- [ -z "$enabled" ] && enabled="0"
-
- [ "$family" = "ipv6" ] && {
- tbl=$($IP6 route list table $tid 2>/dev/null)
- if echo "$tbl" | grep -q "^default\|^::/0"; then
- (echo "$tbl" | grep -v "^default\|^::/0\|^unreachable" | sort -n; echo empty fixup) >/tmp/mwan3rtmon/ipv6.$tid
- cat /tmp/mwan3rtmon/ipv6.$tid | grep -v -x -F -f /tmp/mwan3rtmon/ipv6.main | while read line; do
- $IP6 route del table $tid $line
- done
- cat /tmp/mwan3rtmon/ipv6.main | grep -v -x -F -f /tmp/mwan3rtmon/ipv6.$tid | while read line; do
- $IP6 route add table $tid $line
- done
- fi
- }
- if [ "$enabled" = "1" ]; then
- ret=0
+ local _tid
+ mwan3_dev_tbl_ipv4=" "
+ mwan3_dev_tbl_ipv6=" "
+
+ update_table()
+ {
+ local family curr_table device enabled
+ let _tid++
+ config_get family "$1" family ipv4
+ network_get_device device "$1"
+ [ -z "$device" ] && return
+ config_get enabled "$1" enabled
+ [ "$enabled" -eq 0 ] && return
+ curr_table=$(eval "echo \"\$mwan3_dev_tbl_${family}\"")
+ export "mwan3_dev_tbl_$family=${curr_table}${device}=$_tid "
+ }
+ network_flush_cache
+ config_foreach update_table interface
+}
+
+mwan3_update_iface_to_table()
+{
+ local _tid
+ mwan3_iface_tbl=" "
+ update_table()
+ {
+ let _tid++
+ export mwan3_iface_tbl="${mwan3_iface_tbl}${1}=$_tid "
+ }
+ config_foreach update_table interface
+}
+
+mwan3_get_true_iface()
+{
+ local family V
+ _true_iface=$2
+ config_get family "$iface" family ipv4
+ if [ "$family" = "ipv4" ]; then
+ V=4
+ elif [ "$family" = "ipv6" ]; then
+ V=6
+ fi
+ ubus call "network.interface.${iface}_${V}" status &>/dev/null && _true_iface="${iface}_${V}"
+ export "$1=$_true_iface"
+}
+
+mwan3_route_line_dev()
+{
+ # must have mwan3 config already loaded
+ # arg 1 is route device
+ local _tid route_line route_device route_family entry curr_table
+ route_line=$2
+ route_family=$3
+ route_device=$(echo "$route_line" | sed -ne "s/.*dev \([^ ]*\).*/\1/p")
+ unset "$1"
+ [ -z "$route_device" ] && return
+
+ curr_table=$(eval "echo \"\$mwan3_dev_tbl_${route_family}\"")
+ for entry in $curr_table; do
+ if [ "${entry%%=*}" = "$route_device" ]; then
+ _tid=${entry##*=}
+ export "$1=$_tid"
+ return
fi
- idx=$((idx+1))
done
- rm -f /tmp/mwan3rtmon/ipv6.*
- return $ret
}
# counts how many bits are set to 1
else
config_load mwan3
config_get MMX_MASK globals mmx_mask '0x3F00'
- echo "$MMX_MASK" > "${MWAN3_STATUS_DIR}/mmx_mask"
- $LOG notice "Using firewall mask ${MMX_MASK}"
+ echo "$MMX_MASK"| tr 'A-F' 'a-f' > "${MWAN3_STATUS_DIR}/mmx_mask"
+ LOG debug "Using firewall mask ${MMX_MASK}"
bitcnt=$(mwan3_count_one_bits MMX_MASK)
mmdefault=$(((1<<bitcnt)-1))
MWAN3_INTERFACE_MAX=$(($mmdefault-3))
uci_toggle_state mwan3 globals iface_max "$MWAN3_INTERFACE_MAX"
- $LOG notice "Max interface count is ${MWAN3_INTERFACE_MAX}"
+ LOG debug "Max interface count is ${MWAN3_INTERFACE_MAX}"
fi
# mark mask constants
mwan3_lock() {
lock /var/run/mwan3.lock
-# $LOG debug "$1 $2 (lock)"
+ #LOG debug "$1 $2 (lock)"
}
mwan3_unlock() {
-# $LOG debug "$1 $2 (unlock)"
+ #LOG debug "$1 $2 (unlock)"
lock -u /var/run/mwan3.lock
}
-mwan3_get_iface_id()
+mwan3_get_src_ip()
{
- local _tmp _iface _iface_count
-
- _iface="$2"
+ local family _src_ip true_iface
+ true_iface=$2
+ unset "$1"
+ config_get family "$true_iface" family ipv4
+ if [ "$family" = "ipv4" ]; then
+ network_get_ipaddr _src_ip "$true_iface"
+ [ -n "$_src_ip" ] || _src_ip="0.0.0.0"
+ elif [ "$family" = "ipv6" ]; then
+ network_get_ipaddr6 _src_ip "$true_iface"
+ [ -n "$_src_ip" ] || _src_ip="::"
+ fi
+ export "$1=$_src_ip"
+}
- mwan3_get_id()
- {
- let _iface_count++
- [ "$1" = "$_iface" ] && _tmp=$_iface_count
- }
- config_foreach mwan3_get_id interface
+mwan3_get_iface_id()
+{
+ local _tmp
+ [ -z "$mwan3_iface_tbl" ] && mwan3_update_iface_to_table
+ _tmp="${mwan3_iface_tbl##* ${2}=}"
+ _tmp=${_tmp%% *}
export "$1=$_tmp"
+ new_val=$_tmp
}
mwan3_set_custom_ipset_v4()
local custom_network_v4
for custom_network_v4 in $($IP4 route list table "$1" | awk '{print $1}' | egrep '[0-9]{1,3}(\.[0-9]{1,3}){3}'); do
- $LOG notice "Adding network $custom_network_v4 from table $1 to mwan3_custom_v4 ipset"
- $IPS -! add mwan3_custom_v4_temp "$custom_network_v4"
+ LOG notice "Adding network $custom_network_v4 from table $1 to mwan3_custom_v4 ipset"
+ mwan3_push_update -! add mwan3_custom_v4 "$custom_network_v4"
done
}
local custom_network_v6
for custom_network_v6 in $($IP6 route list table "$1" | awk '{print $1}' | egrep "$IPv6_REGEX"); do
- $LOG notice "Adding network $custom_network_v6 from table $1 to mwan3_custom_v6 ipset"
- $IPS -! add mwan3_custom_v6_temp "$custom_network_v6"
+ LOG notice "Adding network $custom_network_v6 from table $1 to mwan3_custom_v6 ipset"
+ mwan3_push_update -! add mwan3_custom_v6 "$custom_network_v6"
done
}
mwan3_set_custom_ipset()
{
- $IPS -! create mwan3_custom_v4 hash:net
- $IPS create mwan3_custom_v4_temp hash:net
- config_list_foreach "globals" "rt_table_lookup" mwan3_set_custom_ipset_v4
- $IPS swap mwan3_custom_v4_temp mwan3_custom_v4
- $IPS destroy mwan3_custom_v4_temp
+ local update=""
+ mwan3_push_update -! create mwan3_custom_v4 hash:net
+ config_list_foreach "globals" "rt_table_lookup" mwan3_set_custom_ipset_v4
- $IPS -! create mwan3_custom_v6 hash:net family inet6
- $IPS create mwan3_custom_v6_temp hash:net family inet6
+ mwan3_push_update -! create mwan3_custom_v6 hash:net family inet6
config_list_foreach "globals" "rt_table_lookup" mwan3_set_custom_ipset_v6
- $IPS swap mwan3_custom_v6_temp mwan3_custom_v6
- $IPS destroy mwan3_custom_v6_temp
- $IPS -! create mwan3_connected list:set
- $IPS -! add mwan3_connected mwan3_custom_v4
- $IPS -! add mwan3_connected mwan3_custom_v6
+ mwan3_push_update -! create mwan3_connected list:set
+ mwan3_push_update -! add mwan3_connected mwan3_custom_v4
+ mwan3_push_update -! add mwan3_connected mwan3_custom_v6
+ error=$(echo "$update" | $IPS restore 2>&1) || LOG error "set_custom_ipset: $error"
}
mwan3_set_connected_ipv4()
{
local connected_network_v4 candidate_list cidr_list
+ local ipv4regex='[0-9]{1,3}(\.[0-9]{1,3}){3}'
+ $IPS -! create mwan3_connected_v4 hash:net
+ $IPS create mwan3_connected_v4_temp hash:net
+
candidate_list=""
cidr_list=""
- for connected_network_v4 in $($IP4 route | awk '{print $1}' | egrep '[0-9]{1,3}(\.[0-9]{1,3}){3}'); do
- [ -z "${connected_network_v4##*/*}" ] &&
- cidr_list="$cidr_list $connected_network_v4" ||
- candidate_list="$candidate_list $connected_network_v4"
- done
-
- for connected_network_v4 in $($IP4 route list table 0 | awk '{print $2}' | egrep '[0-9]{1,3}(\.[0-9]{1,3}){3}'); do
- [ -z "${connected_network_v4##*/*}" ] &&
- cidr_list="$cidr_list $connected_network_v4" ||
- candidate_list="$candidate_list $connected_network_v4"
+ route_lists()
+ {
+ $IP4 route | awk '{print $1}'
+ $IP4 route list table 0 | awk '{print $2}'
+ }
+ for connected_network_v4 in $(route_lists | egrep "$ipv4regex"); do
+ if [ -z "${connected_network_v4##*/*}" ]; then
+ cidr_list="$cidr_list $connected_network_v4"
+ else
+ candidate_list="$candidate_list $connected_network_v4"
+ fi
done
for connected_network_v4 in $cidr_list; do
mwan3_set_connected_iptables()
{
- local connected_network_v6 source_network_v6
-
- $IPS -! create mwan3_connected_v4 hash:net
- $IPS create mwan3_connected_v4_temp hash:net
-
+ local connected_network_v6 source_network_v6 error
+ local update=""
mwan3_set_connected_ipv4
[ $NO_IPV6 -eq 0 ] && {
- $IPS -! create mwan3_connected_v6 hash:net family inet6
- $IPS create mwan3_connected_v6_temp hash:net family inet6
+ mwan3_push_update -! create mwan3_connected_v6 hash:net family inet6
+ mwan3_push_update flush mwan3_connected_v6
for connected_network_v6 in $($IP6 route | awk '{print $1}' | egrep "$IPv6_REGEX"); do
- $IPS -! add mwan3_connected_v6_temp "$connected_network_v6"
+ mwan3_push_update -! add mwan3_connected_v6 "$connected_network_v6"
done
- $IPS swap mwan3_connected_v6_temp mwan3_connected_v6
- $IPS destroy mwan3_connected_v6_temp
- $IPS -! create mwan3_source_v6 hash:net family inet6
- $IPS create mwan3_source_v6_temp hash:net family inet6
- for source_network_v6 in $($IP6 addr ls | sed -ne 's/ *inet6 \([^ \/]*\).* scope global.*/\1/p'); do
- $IPS -! add mwan3_source_v6_temp "$source_network_v6"
+ mwan3_push_update -! create mwan3_source_v6 hash:net family inet6
+ for source_network_v6 in $($IP6 addr ls | sed -ne 's/ *inet6 \([^ \/]*\).* scope global.*/\1/p'); do
+ mwan3_push_update -! add mwan3_source_v6 "$source_network_v6"
done
- $IPS swap mwan3_source_v6_temp mwan3_source_v6
- $IPS destroy mwan3_source_v6_temp
}
- $IPS -! create mwan3_connected list:set
- $IPS -! add mwan3_connected mwan3_connected_v4
- [ $NO_IPV6 -eq 0 ] && $IPS -! add mwan3_connected mwan3_connected_v6
+ mwan3_push_update -! create mwan3_connected list:set
+ mwan3_push_update flush mwan3_connected
+ mwan3_push_update -! add mwan3_connected mwan3_connected_v4
+ [ $NO_IPV6 -eq 0 ] && mwan3_push_update -! add mwan3_connected mwan3_connected_v6
- $IPS -! create mwan3_dynamic_v4 hash:net
- $IPS -! add mwan3_connected mwan3_dynamic_v4
+ mwan3_push_update -! create mwan3_dynamic_v4 hash:net
+ mwan3_push_update -! add mwan3_connected mwan3_dynamic_v4
- [ $NO_IPV6 -eq 0 ] && $IPS -! create mwan3_dynamic_v6 hash:net family inet6
- [ $NO_IPV6 -eq 0 ] && $IPS -! add mwan3_connected mwan3_dynamic_v6
+ [ $NO_IPV6 -eq 0 ] && mwan3_push_update -! create mwan3_dynamic_v6 hash:net family inet6
+ [ $NO_IPV6 -eq 0 ] && mwan3_push_update -! add mwan3_connected mwan3_dynamic_v6
+ error=$(echo "$update" | $IPS restore 2>&1) || LOG error "set_connected_iptables: $error"
}
mwan3_set_general_rules()
mwan3_set_general_iptables()
{
- local IPT
-
+ local IPT current update error
for IPT in "$IPT4" "$IPT6"; do
[ "$IPT" = "$IPT6" ] && [ $NO_IPV6 -ne 0 ] && continue
- if ! $IPT -S mwan3_ifaces_in &> /dev/null; then
- $IPT -N mwan3_ifaces_in
+ current="$($IPT -S)"
+ update="*mangle"
+ if [ -n "${current##*-N mwan3_ifaces_in*}" ]; then
+ mwan3_push_update -N mwan3_ifaces_in
fi
- if ! $IPT -S mwan3_connected &> /dev/null; then
- $IPT -N mwan3_connected
+ if [ -n "${current##*-N mwan3_connected*}" ]; then
+ mwan3_push_update -N mwan3_connected
$IPS -! create mwan3_connected list:set
- $IPT -A mwan3_connected \
- -m set --match-set mwan3_connected dst \
- -j MARK --set-xmark $MMX_DEFAULT/$MMX_MASK
+ mwan3_push_update -A mwan3_connected \
+ -m set --match-set mwan3_connected dst \
+ -j MARK --set-xmark $MMX_DEFAULT/$MMX_MASK
fi
- if ! $IPT -S mwan3_rules &> /dev/null; then
- $IPT -N mwan3_rules
+ if [ -n "${current##*-N mwan3_rules*}" ]; then
+ mwan3_push_update -N mwan3_rules
fi
- if ! $IPT -S mwan3_hook &> /dev/null; then
- $IPT -N mwan3_hook
+ if [ -n "${current##*-N mwan3_hook*}" ]; then
+ mwan3_push_update -N mwan3_hook
# do not mangle ipv6 ra service
if [ "$IPT" = "$IPT6" ]; then
- $IPT6 -A mwan3_hook \
- -p ipv6-icmp \
- -m icmp6 --icmpv6-type 133 \
- -j RETURN
- $IPT6 -A mwan3_hook \
- -p ipv6-icmp \
- -m icmp6 --icmpv6-type 134 \
- -j RETURN
- $IPT6 -A mwan3_hook \
- -p ipv6-icmp \
- -m icmp6 --icmpv6-type 135 \
- -j RETURN
- $IPT6 -A mwan3_hook \
- -p ipv6-icmp \
- -m icmp6 --icmpv6-type 136 \
- -j RETURN
- $IPT6 -A mwan3_hook \
- -p ipv6-icmp \
- -m icmp6 --icmpv6-type 137 \
- -j RETURN
+ mwan3_push_update -A mwan3_hook \
+ -p ipv6-icmp \
+ -m icmp6 --icmpv6-type 133 \
+ -j RETURN
+ mwan3_push_update -A mwan3_hook \
+ -p ipv6-icmp \
+ -m icmp6 --icmpv6-type 134 \
+ -j RETURN
+ mwan3_push_update -A mwan3_hook \
+ -p ipv6-icmp \
+ -m icmp6 --icmpv6-type 135 \
+ -j RETURN
+ mwan3_push_update -A mwan3_hook \
+ -p ipv6-icmp \
+ -m icmp6 --icmpv6-type 136 \
+ -j RETURN
+ mwan3_push_update -A mwan3_hook \
+ -p ipv6-icmp \
+ -m icmp6 --icmpv6-type 137 \
+ -j RETURN
# do not mangle outgoing echo request
- $IPT6 -A mwan3_hook \
- -m set --match-set mwan3_source_v6 src \
- -p ipv6-icmp \
- -m icmp6 --icmpv6-type 128 \
- -j RETURN
+ mwan3_push_update -A mwan3_hook \
+ -m set --match-set mwan3_source_v6 src \
+ -p ipv6-icmp \
+ -m icmp6 --icmpv6-type 128 \
+ -j RETURN
fi
- $IPT -A mwan3_hook \
- -j CONNMARK --restore-mark --nfmask "$MMX_MASK" --ctmask "$MMX_MASK"
- $IPT -A mwan3_hook \
- -m mark --mark 0x0/$MMX_MASK \
- -j mwan3_ifaces_in
- $IPT -A mwan3_hook \
- -m mark --mark 0x0/$MMX_MASK \
- -j mwan3_connected
- $IPT -A mwan3_hook \
- -m mark --mark 0x0/$MMX_MASK \
- -j mwan3_rules
- $IPT -A mwan3_hook \
- -j CONNMARK --save-mark --nfmask "$MMX_MASK" --ctmask "$MMX_MASK"
- $IPT -A mwan3_hook \
- -m mark ! --mark $MMX_DEFAULT/$MMX_MASK \
- -j mwan3_connected
+ mwan3_push_update -A mwan3_hook \
+ -j CONNMARK --restore-mark --nfmask "$MMX_MASK" --ctmask "$MMX_MASK"
+ mwan3_push_update -A mwan3_hook \
+ -m mark --mark 0x0/$MMX_MASK \
+ -j mwan3_ifaces_in
+ mwan3_push_update -A mwan3_hook \
+ -m mark --mark 0x0/$MMX_MASK \
+ -j mwan3_connected
+ mwan3_push_update -A mwan3_hook \
+ -m mark --mark 0x0/$MMX_MASK \
+ -j mwan3_rules
+ mwan3_push_update -A mwan3_hook \
+ -j CONNMARK --save-mark --nfmask "$MMX_MASK" --ctmask "$MMX_MASK"
+ mwan3_push_update -A mwan3_hook \
+ -m mark ! --mark $MMX_DEFAULT/$MMX_MASK \
+ -j mwan3_connected
fi
- if ! $IPT -S PREROUTING | grep mwan3_hook &> /dev/null; then
- $IPT -A PREROUTING -j mwan3_hook
+ if [ -n "${current##*-A PREROUTING -j mwan3_hook*}" ]; then
+ mwan3_push_update -A PREROUTING -j mwan3_hook
fi
-
- if ! $IPT -S OUTPUT | grep mwan3_hook &> /dev/null; then
- $IPT -A OUTPUT -j mwan3_hook
+ if [ -n "${current##*-A OUTPUT -j mwan3_hook*}" ]; then
+ mwan3_push_update -A OUTPUT -j mwan3_hook
+ fi
+ mwan3_push_update COMMIT
+ mwan3_push_update ""
+ if [ "$IPT" = "$IPT4" ]; then
+ error=$(echo "$update" | $IPT4R 2>&1) || LOG error "set_general_iptables: $error"
+ else
+ error=$(echo "$update" | $IPT6R 2>&1) || LOG error "set_general_iptables: $error"
fi
done
}
mwan3_create_iface_iptables()
{
- local id family connected_name IPT
+ local id family connected_name IPT IPTR current update error
config_get family "$1" family ipv4
mwan3_get_iface_id id "$1"
if [ "$family" = "ipv4" ]; then
connected_name=mwan3_connected
IPT="$IPT4"
+ IPTR="$IPT4R"
$IPS -! create $connected_name list:set
elif [ "$family" = "ipv6" ] && [ $NO_IPV6 -eq 0 ]; then
connected_name=mwan3_connected_v6
IPT="$IPT6"
+ IPTR="$IPT6R"
$IPS -! create $connected_name hash:net family inet6
else
return
fi
-
- if ! $IPT -S mwan3_ifaces_in &> /dev/null; then
- $IPT -N mwan3_ifaces_in
+ current="$($IPT -S)"
+ update="*mangle"
+ if [ -n "${current##*-N mwan3_ifaces_in*}" ]; then
+ mwan3_push_update -N mwan3_ifaces_in
fi
- if ! $IPT -S "mwan3_iface_in_$1" &> /dev/null; then
- $IPT -N "mwan3_iface_in_$1"
+ if [ -n "${current##*-N mwan3_iface_in_$1*}" ]; then
+ mwan3_push_update -N "mwan3_iface_in_$1"
+ else
+ mwan3_push_update -F "mwan3_iface_in_$1"
fi
- $IPT -F "mwan3_iface_in_$1"
- $IPT -A "mwan3_iface_in_$1" \
- -i "$2" \
- -m set --match-set $connected_name src \
- -m mark --mark 0x0/$MMX_MASK \
- -m comment --comment "default" \
- -j MARK --set-xmark $MMX_DEFAULT/$MMX_MASK
- $IPT -A "mwan3_iface_in_$1" \
- -i "$2" \
- -m mark --mark 0x0/$MMX_MASK \
- -m comment --comment "$1" \
- -j MARK --set-xmark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK
+ mwan3_push_update -A "mwan3_iface_in_$1" \
+ -i "$2" \
+ -m set --match-set $connected_name src \
+ -m mark --mark 0x0/$MMX_MASK \
+ -m comment --comment "default" \
+ -j MARK --set-xmark $MMX_DEFAULT/$MMX_MASK
+ mwan3_push_update -A "mwan3_iface_in_$1" \
+ -i "$2" \
+ -m mark --mark 0x0/$MMX_MASK \
+ -m comment --comment "$1" \
+ -j MARK --set-xmark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK
+
+ if [ -n "${current##*-A mwan3_ifaces_in -m mark --mark 0x0/$MMX_MASK -j mwan3_iface_in_${1}*}" ]; then
+ mwan3_push_update -A mwan3_ifaces_in \
+ -m mark --mark 0x0/$MMX_MASK \
+ -j "mwan3_iface_in_$1"
+ LOG debug "create_iface_iptables: mwan3_iface_in_$1 not in iptables, adding"
+ else
+ LOG debug "create_iface_iptables: mwan3_iface_in_$1 already in iptables, skip"
+ fi
- $IPT -D mwan3_ifaces_in \
- -m mark --mark 0x0/$MMX_MASK \
- -j "mwan3_iface_in_$1" &> /dev/null
- $IPT -A mwan3_ifaces_in \
- -m mark --mark 0x0/$MMX_MASK \
- -j "mwan3_iface_in_$1"
+ mwan3_push_update COMMIT
+ mwan3_push_update ""
+ error=$(echo "$update" | $IPTR 2>&1) || LOG error "create_iface_iptables: $error"
}
mwan3_create_iface_route()
{
- local id via metric V V_ IP
+ local id via metric V V_ IP family
+ local iface device cmd true_iface
- config_get family "$1" family ipv4
- mwan3_get_iface_id id "$1"
+ iface=$1
+ device=$2
+ config_get family "$iface" family ipv4
+ mwan3_get_iface_id id "$iface"
[ -n "$id" ] || return 0
+ mwan3_get_true_iface true_iface $iface
if [ "$family" = "ipv4" ]; then
- V=4
V_=""
IP="$IP4"
elif [ "$family" = "ipv6" ]; then
- V=6
V_=6
IP="$IP6"
- else
- return
fi
- if ubus call network.interface.${1}_${V} status &>/dev/null; then
- network_get_gateway${V_} via "${1}_${V}"
- else
- network_get_gateway${V_} via "$1"
- fi
+ network_get_gateway${V_} via "$true_iface"
- ( [ -z "$via" ] || [ "$via" = "0.0.0.0" ] || [ "$via" = "::" ] ) && unset via
+ { [ -z "$via" ] || [ "$via" = "0.0.0.0" ] || [ "$via" = "::" ] ; } && unset via
- network_get_metric metric "$1"
+ network_get_metric metric "$true_iface"
$IP route flush table "$id"
- $IP route add table "$id" default \
+ cmd="$IP route add table $id default \
${via:+via} $via \
${metric:+metric} $metric \
- dev "$2"
- mwan3_rtmon_ipv${V}
+ dev $2"
+ $cmd || LOG warn "ip cmd failed $cmd"
}
+mwan3_add_non_default_iface_route()
+{
+ local tid route_line family IP id
+ config_get family "$1" family ipv4
+ mwan3_get_iface_id id "$1"
+
+ [ -n "$id" ] || return 0
+
+ if [ "$family" = "ipv4" ]; then
+ IP="$IP4"
+ elif [ "$family" = "ipv6" ]; then
+ IP="$IP6"
+ fi
+
+ mwan3_update_dev_to_table
+ $IP route list table main | grep -v "^default\|linkdown\|^::/0\|^fe80::/64\|^unreachable" | while read route_line; do
+ mwan3_route_line_dev "tid" "$route_line" "$family"
+ if [ -z "$tid" ] || [ "$tid" = "$id" ]; then
+ $IP route add table $id $route_line ||
+ LOG warn "failed to add $route_line to table $id"
+ fi
+
+ done
+}
+
+mwan3_add_all_nondefault_routes()
+{
+ local tid IP route_line ipv family active_tbls tid
+
+ add_active_tbls()
+ {
+ let tid++
+ config_get family "$1" family ipv4
+ [ "$family" != "$ipv" ] && return
+ $IP route list table $tid 2>/dev/null | grep -q "^default\|^::/0" && {
+ active_tbls="$active_tbls${tid} "
+ }
+ }
+
+ add_route()
+ {
+ let tid++
+ [ -n "${active_tbls##* $tid *}" ] && return
+ $IP route add table $tid $route_line ||
+ LOG warn "failed to add $route_line to table $tid"
+ }
+
+ mwan3_update_dev_to_table
+ for ipv in ipv4 ipv6; do
+ [ "$ipv" = "ipv6" ] && [ $NO_IPV6 -ne 0 ] && continue
+ if [ "$ipv" = "ipv4" ]; then
+ IP="$IP4"
+ elif [ "$ipv" = "ipv6" ]; then
+ IP="$IP6"
+ fi
+ tid=0
+ active_tbls=" "
+ config_foreach add_active_tbls interface
+ $IP route list table main | grep -v "^default\|linkdown\|^::/0\|^fe80::/64\|^unreachable" | while read route_line; do
+ mwan3_route_line_dev "tid" "$route_line" "$ipv"
+ if [ -n "$tid" ]; then
+ $IP route add table $tid $route_line
+ else
+ config_foreach add_route interface
+ fi
+ done
+ done
+}
mwan3_delete_iface_route()
{
local id
mwan3_create_iface_rules()
{
- local id family
+ local id family IP
config_get family "$1" family ipv4
mwan3_get_iface_id id "$1"
[ -n "$id" ] || return 0
if [ "$family" = "ipv4" ]; then
-
- while [ -n "$($IP4 rule list | awk '$1 == "'$(($id+1000)):'"')" ]; do
- $IP4 rule del pref $(($id+1000))
- done
-
- while [ -n "$($IP4 rule list | awk '$1 == "'$(($id+2000)):'"')" ]; do
- $IP4 rule del pref $(($id+2000))
- done
-
- $IP4 rule add pref $(($id+1000)) iif "$2" lookup "$id"
- $IP4 rule add pref $(($id+2000)) fwmark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK lookup "$id"
+ IP="$IP4"
+ elif [ "$family" = "ipv6" ] && [ $NO_IPV6 -eq 0 ]; then
+ IP="$IP6"
+ else
+ return
fi
- if [ "$family" = "ipv6" ] && [ $NO_IPV6 -eq 0 ]; then
-
- while [ -n "$($IP6 rule list | awk '$1 == "'$(($id+1000)):'"')" ]; do
- $IP6 rule del pref $(($id+1000))
- done
+ while [ -n "$($IP rule list | awk '$1 == "'$(($id+1000)):'"')" ]; do
+ $IP rule del pref $(($id+1000))
+ done
- while [ -n "$($IP6 rule list | awk '$1 == "'$(($id+2000)):'"')" ]; do
- $IP6 rule del pref $(($id+2000))
- done
+ while [ -n "$($IP rule list | awk '$1 == "'$(($id+2000)):'"')" ]; do
+ $IP rule del pref $(($id+2000))
+ done
- $IP6 rule add pref $(($id+1000)) iif "$2" lookup "$id"
- $IP6 rule add pref $(($id+2000)) fwmark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK lookup "$id"
- fi
+ $IP rule add pref $(($id+1000)) iif "$2" lookup "$id"
+ $IP rule add pref $(($id+2000)) fwmark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK lookup "$id"
}
mwan3_delete_iface_rules()
[ -n "$id" ] || return 0
if [ "$family" = "ipv4" ]; then
-
- while [ -n "$($IP4 rule list | awk '$1 == "'$(($id+1000)):'"')" ]; do
- $IP4 rule del pref $(($id+1000))
- done
-
- while [ -n "$($IP4 rule list | awk '$1 == "'$(($id+2000)):'"')" ]; do
- $IP4 rule del pref $(($id+2000))
- done
+ IP="$IP4"
+ elif [ "$family" = "ipv6" ] && [ $NO_IPV6 -eq 0 ]; then
+ IP="$IP6"
+ else
+ return
fi
- if [ "$family" = "ipv6" ] && [ $NO_IPV6 -eq 0 ]; then
-
- while [ -n "$($IP6 rule list | awk '$1 == "'$(($id+1000)):'"')" ]; do
- $IP6 rule del pref $(($id+1000))
- done
+ while [ -n "$($IP rule list | awk '$1 == "'$(($id+1000)):'"')" ]; do
+ $IP rule del pref $(($id+1000))
+ done
- while [ -n "$($IP6 rule list | awk '$1 == "'$(($id+2000)):'"')" ]; do
- $IP6 rule del pref $(($id+2000))
- done
- fi
+ while [ -n "$($IP rule list | awk '$1 == "'$(($id+2000)):'"')" ]; do
+ $IP rule del pref $(($id+2000))
+ done
}
mwan3_delete_iface_ipset_entries()
[ -n "$id" ] || return 0
for setname in $(ipset -n list | grep ^mwan3_sticky_); do
- for entry in $(ipset list "$setname" | grep "$(echo $(mwan3_id2mask id MMX_MASK) | awk '{ printf "0x%08x", $1; }')" | cut -d ' ' -f 1); do
+ for entry in $(ipset list "$setname" | grep "$(mwan3_id2mask id MMX_MASK | awk '{ printf "0x%08x", $1; }')" | cut -d ' ' -f 1); do
$IPS del "$setname" $entry
done
done
mwan3_rtmon()
{
- pid="$(pgrep -f mwan3rtmon)"
- if [ "${pid}" != "" ]; then
- kill -USR1 "${pid}"
- else
- [ -x /usr/sbin/mwan3rtmon ] && /usr/sbin/mwan3rtmon &
- fi
+ local protocol
+ for protocol in "ipv4" "ipv6"; do
+ pid="$(pgrep -f "mwan3rtmon $protocol")"
+ [ "$protocol" = "ipv6" ] && [ $NO_IPV6 -ne 0 ] && continue
+ if [ "${pid}" = "" ]; then
+ [ -x /usr/sbin/mwan3rtmon ] && /usr/sbin/mwan3rtmon $protocol &
+ fi
+ done
}
mwan3_track()
{
- local track_ip track_ips pid
+ local track_ips pids
mwan3_list_track_ips()
{
}
config_list_foreach "$1" track_ip mwan3_list_track_ips
- for pid in $(pgrep -f "mwan3track $1 $2"); do
- kill -TERM "$pid" > /dev/null 2>&1
- done
- sleep 1
- for pid in $(pgrep -f "mwan3track $1 $2"); do
- kill -KILL "$pid" > /dev/null 2>&1
- done
- if [ -n "$track_ips" ]; then
- [ -x /usr/sbin/mwan3track ] && /usr/sbin/mwan3track "$1" "$2" "$3" "$4" $track_ips &
+ # don't match device in case it changed from last launch
+ if pids=$(pgrep -f "mwan3track $1 "); then
+ kill -TERM $pids > /dev/null 2>&1
+ sleep 1
+ kill -KILL $(pgrep -f "mwan3track $1 ") > /dev/null 2>&1
fi
-}
-mwan3_track_signal()
-{
- local pid
-
- pid="$(pgrep -f "mwan3track $1 $2")"
- [ "${pid}" != "" ] && {
- kill -USR1 "${pid}"
- }
+ if [ -n "$track_ips" ]; then
+ [ -x /usr/sbin/mwan3track ] && MWAN3_STARTUP=0 /usr/sbin/mwan3track "$1" "$2" "$3" "$4" $track_ips &
+ fi
}
mwan3_set_policy()
{
- local iface_count id iface family metric probability weight device is_lowest is_offline IPT total_weight
+ local id iface family metric probability weight device is_lowest is_offline IPT IPTR total_weight current update error
is_lowest=0
config_get iface "$1" interface
[ -n "$iface" ] || return 0
network_get_device device "$iface"
- [ "$metric" -gt $DEFAULT_LOWEST_METRIC ] && $LOG warn "Member interface $iface has >$DEFAULT_LOWEST_METRIC metric. Not appending to policy" && return 0
+ [ "$metric" -gt $DEFAULT_LOWEST_METRIC ] && LOG warn "Member interface $iface has >$DEFAULT_LOWEST_METRIC metric. Not appending to policy" && return 0
mwan3_get_iface_id id "$iface"
+ [ -n "$id" ] || return 0
+
[ "$(mwan3_get_iface_hotplug_state "$iface")" = "online" ]
is_offline=$?
- [ -n "$id" ] || return 0
-
config_get family "$iface" family ipv4
if [ "$family" = "ipv4" ]; then
IPT="$IPT4"
+ IPTR="$IPT4R"
elif [ "$family" = "ipv6" ]; then
IPT="$IPT6"
+ IPTR="$IPT6R"
fi
+ current="$($IPT -S)"
+ update="*mangle"
if [ "$family" = "ipv4" ] && [ $is_offline -eq 0 ]; then
if [ "$metric" -lt "$lowest_metric_v4" ]; then
total_weight_v4=$weight
lowest_metric_v4=$metric
elif [ "$metric" -eq "$lowest_metric_v4" ]; then
- total_weight_v4=$(($total_weight_v4+$weight))
+ total_weight_v4=$(($total_weight_v4+$weight))
total_weight=$total_weight_v4
else
return
fi
fi
if [ $is_lowest -eq 1 ]; then
- $IPT -F "mwan3_policy_$policy"
- $IPT -A "mwan3_policy_$policy" \
- -m mark --mark 0x0/$MMX_MASK \
- -m comment --comment "$iface $weight $weight" \
- -j MARK --set-xmark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK
+ mwan3_push_update -F "mwan3_policy_$policy"
+ mwan3_push_update -A "mwan3_policy_$policy" \
+ -m mark --mark 0x0/$MMX_MASK \
+ -m comment --comment \"$iface $weight $weight\" \
+ -j MARK --set-xmark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK
elif [ $is_offline -eq 0 ]; then
probability=$(($weight*1000/$total_weight))
if [ "$probability" -lt 10 ]; then
else
probability="1"
fi
-
- $IPT -I "mwan3_policy_$policy" \
- -m mark --mark 0x0/$MMX_MASK \
- -m statistic \
- --mode random \
- --probability "$probability" \
- -m comment --comment "$iface $weight $total_weight" \
- -j MARK --set-xmark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK
+
+ mwan3_push_update -I "mwan3_policy_$policy" \
+ -m mark --mark 0x0/$MMX_MASK \
+ -m statistic \
+ --mode random \
+ --probability "$probability" \
+ -m comment --comment \"$iface $weight $total_weight\" \
+ -j MARK --set-xmark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK
elif [ -n "$device" ]; then
- $IPT -S "mwan3_policy_$policy" | grep -q '.*--comment ".* [0-9]* [0-9]*"' || \
- $IPT -I "mwan3_policy_$policy" \
- -o "$device" \
- -m mark --mark 0x0/$MMX_MASK \
- -m comment --comment "out $iface $device" \
- -j MARK --set-xmark $MMX_DEFAULT/$MMX_MASK
+ echo "$current" | grep -q "^-A mwan3_policy_$policy.*--comment .* [0-9]* [0-9]*" ||
+ mwan3_push_update -I "mwan3_policy_$policy" \
+ -o "$device" \
+ -m mark --mark 0x0/$MMX_MASK \
+ -m comment --comment \"out $iface $device\" \
+ -j MARK --set-xmark $MMX_DEFAULT/$MMX_MASK
fi
+ mwan3_push_update COMMIT
+ mwan3_push_update ""
+ error=$(echo "$update" | $IPTR 2>&1) || LOG error "set_policy ($1): $error"
+
}
mwan3_create_policies_iptables()
{
- local last_resort lowest_metric_v4 lowest_metric_v6 total_weight_v4 total_weight_v6 policy IPT
+ local last_resort lowest_metric_v4 lowest_metric_v6 total_weight_v4 total_weight_v6 policy IPT current update error
policy="$1"
config_get last_resort "$1" last_resort unreachable
if [ "$1" != "$(echo "$1" | cut -c1-15)" ]; then
- $LOG warn "Policy $1 exceeds max of 15 chars. Not setting policy" && return 0
+ LOG warn "Policy $1 exceeds max of 15 chars. Not setting policy" && return 0
fi
for IPT in "$IPT4" "$IPT6"; do
[ "$IPT" = "$IPT6" ] && [ $NO_IPV6 -ne 0 ] && continue
- if ! $IPT -S "mwan3_policy_$1" &> /dev/null; then
- $IPT -N "mwan3_policy_$1"
+ current="$($IPT -S)"
+ update="*mangle"
+ if [ -n "${current##*-N mwan3_policy_$1*}" ]; then
+ mwan3_push_update -N "mwan3_policy_$1"
fi
- $IPT -F "mwan3_policy_$1"
+ mwan3_push_update -F "mwan3_policy_$1"
case "$last_resort" in
blackhole)
- $IPT -A "mwan3_policy_$1" \
- -m mark --mark 0x0/$MMX_MASK \
- -m comment --comment "blackhole" \
- -j MARK --set-xmark $MMX_BLACKHOLE/$MMX_MASK
- ;;
+ mwan3_push_update -A "mwan3_policy_$1" \
+ -m mark --mark 0x0/$MMX_MASK \
+ -m comment --comment "blackhole" \
+ -j MARK --set-xmark $MMX_BLACKHOLE/$MMX_MASK
+ ;;
default)
- $IPT -A "mwan3_policy_$1" \
- -m mark --mark 0x0/$MMX_MASK \
- -m comment --comment "default" \
- -j MARK --set-xmark $MMX_DEFAULT/$MMX_MASK
- ;;
+ mwan3_push_update -A "mwan3_policy_$1" \
+ -m mark --mark 0x0/$MMX_MASK \
+ -m comment --comment "default" \
+ -j MARK --set-xmark $MMX_DEFAULT/$MMX_MASK
+ ;;
*)
- $IPT -A "mwan3_policy_$1" \
- -m mark --mark 0x0/$MMX_MASK \
- -m comment --comment "unreachable" \
- -j MARK --set-xmark $MMX_UNREACHABLE/$MMX_MASK
- ;;
+ mwan3_push_update -A "mwan3_policy_$1" \
+ -m mark --mark 0x0/$MMX_MASK \
+ -m comment --comment "unreachable" \
+ -j MARK --set-xmark $MMX_UNREACHABLE/$MMX_MASK
+ ;;
esac
+ mwan3_push_update COMMIT
+ mwan3_push_update ""
+ if [ "$IPT" = "$IPT4" ]; then
+ error=$(echo "$update" | $IPT4R 2>&1) || LOG error "create_policies_iptables ($1): $error"
+ else
+ error=$(echo "$update" | $IPT6R 2>&1) || LOG error "create_policies_iptables ($1): $error"
+ fi
done
lowest_metric_v4=$DEFAULT_LOWEST_METRIC
mwan3_set_sticky_iptables()
{
local id iface
-
- for iface in $($IPT4 -S "$policy" | cut -s -d'"' -f2 | awk '{print $1}'); do
-
+ for iface in $(echo "$current" | grep "^-A $policy" | cut -s -d'"' -f2 | awk '{print $1}'); do
if [ "$iface" = "$1" ]; then
mwan3_get_iface_id id "$1"
[ -n "$id" ] || return 0
-
- for IPT in "$IPT4" "$IPT6"; do
- [ "$IPT" = "$IPT6" ] && [ $NO_IPV6 -ne 0 ] && continuea
- if [ -n "$($IPT -S "mwan3_iface_in_$1" 2> /dev/null)" ]; then
- $IPT -I "mwan3_rule_$rule" \
- -m mark --mark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK \
- -m set ! --match-set "mwan3_sticky_$rule" src,src \
- -j MARK --set-xmark 0x0/$MMX_MASK
- $IPT -I "mwan3_rule_$rule" \
- -m mark --mark 0/$MMX_MASK \
- -j MARK --set-xmark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK
- fi
- done
+ if [ -z "${current##*-N mwan3_iface_in_$1*}" ]; then
+ mwan3_push_update -I "mwan3_rule_$rule" \
+ -m mark --mark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK \
+ -m set ! --match-set "mwan3_sticky_$rule" src,src \
+ -j MARK --set-xmark 0x0/$MMX_MASK
+ mwan3_push_update -I "mwan3_rule_$rule" \
+ -m mark --mark 0/$MMX_MASK \
+ -j MARK --set-xmark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK
+ fi
fi
done
}
mwan3_set_user_iptables_rule()
{
local ipset family proto policy src_ip src_port src_iface src_dev
- local sticky dest_ip dest_port use_policy timeout rule policy IPT
- local global_logging rule_logging loglevel
+ local sticky dest_ip dest_port use_policy timeout policy
+ local global_logging rule_logging loglevel rule_policy rule ipv
rule="$1"
-
+ ipv="$2"
+ rule_policy=0
config_get sticky "$1" sticky 0
config_get timeout "$1" timeout 600
config_get ipset "$1" ipset
config_get proto "$1" proto all
config_get src_ip "$1" src_ip
config_get src_iface "$1" src_iface
- network_get_device src_dev "$src_iface"
config_get src_port "$1" src_port
config_get dest_ip "$1" dest_ip
config_get dest_port "$1" dest_port
config_get use_policy "$1" use_policy
config_get family "$1" family any
+ config_get rule_logging "$1" logging 0
+ config_get global_logging globals logging 0
+ config_get loglevel globals loglevel notice
+
+ if [ -n "$src_iface" ]; then
+ network_get_device src_dev "$src_iface"
+ if [ -z "$src_dev" ]; then
+ LOG notice "could not find device corresponding to src_iface $src_iface for rule $1"
+ return
+ fi
+ fi
[ -z "$dest_ip" ] && unset dest_ip
[ -z "$src_ip" ] && unset src_ip
[ -z "$ipset" ] && unset ipset
[ -z "$src_port" ] && unset src_port
[ -z "$dest_port" ] && unset dest_port
- [ "$proto" != 'tcp' ] && [ "$proto" != 'udp' ] && {
+ if [ "$proto" != 'tcp' ] && [ "$proto" != 'udp' ]; then
[ -n "$src_port" ] && {
- $LOG warn "src_port set to '$src_port' but proto set to '$proto' not tcp or udp. src_port will be ignored"
+ LOG warn "src_port set to '$src_port' but proto set to '$proto' not tcp or udp. src_port will be ignored"
}
+
[ -n "$dest_port" ] && {
- $LOG warn "dest_port set to '$dest_port' but proto set to '$proto' not tcp or udp. dest_port will be ignored"
+ LOG warn "dest_port set to '$dest_port' but proto set to '$proto' not tcp or udp. dest_port will be ignored"
}
unset src_port
unset dest_port
- }
-
- config_get rule_logging "$1" logging 0
- config_get global_logging globals logging 0
- config_get loglevel globals loglevel notice
+ fi
if [ "$1" != "$(echo "$1" | cut -c1-15)" ]; then
- $LOG warn "Rule $1 exceeds max of 15 chars. Not setting rule" && return 0
+ LOG warn "Rule $1 exceeds max of 15 chars. Not setting rule" && return 0
fi
if [ -n "$ipset" ]; then
ipset="-m set --match-set $ipset dst"
fi
- if [ -n "$use_policy" ]; then
- if [ "$use_policy" = "default" ]; then
- policy="MARK --set-xmark $MMX_DEFAULT/$MMX_MASK"
- elif [ "$use_policy" = "unreachable" ]; then
- policy="MARK --set-xmark $MMX_UNREACHABLE/$MMX_MASK"
- elif [ "$use_policy" = "blackhole" ]; then
- policy="MARK --set-xmark $MMX_BLACKHOLE/$MMX_MASK"
- else
- if [ "$sticky" -eq 1 ]; then
+ if [ -z "$use_policy" ]; then
+ return
+ fi
- policy="mwan3_policy_$use_policy"
+ if [ "$use_policy" = "default" ]; then
+ policy="MARK --set-xmark $MMX_DEFAULT/$MMX_MASK"
+ elif [ "$use_policy" = "unreachable" ]; then
+ policy="MARK --set-xmark $MMX_UNREACHABLE/$MMX_MASK"
+ elif [ "$use_policy" = "blackhole" ]; then
+ policy="MARK --set-xmark $MMX_BLACKHOLE/$MMX_MASK"
+ else
+ rule_policy=1
+ policy="mwan3_policy_$use_policy"
+ if [ "$sticky" -eq 1 ]; then
+ $IPS -! create "mwan3_sticky_v4_$rule" \
+ hash:ip,mark markmask "$MMX_MASK" \
+ timeout "$timeout"
+ [ $NO_IPV6 -eq 0 ] &&
+ $IPS -! create "mwan3_sticky_v6_$rule" \
+ hash:ip,mark markmask "$MMX_MASK" \
+ timeout "$timeout" family inet6
+ $IPS -! create "mwan3_sticky_$rule" list:set
+ $IPS -! add "mwan3_sticky_$rule" "mwan3_sticky_v4_$rule"
+ [ $NO_IPV6 -eq 0 ] &&
+ $IPS -! add "mwan3_sticky_$rule" "mwan3_sticky_v6_$rule"
+ fi
+ fi
- for IPT in "$IPT4" "$IPT6"; do
- [ "$IPT" = "$IPT6" ] && [ $NO_IPV6 -ne 0 ] && continue
- if ! $IPT -S "$policy" &> /dev/null; then
- $IPT -N "$policy"
- fi
+ [ "$ipv" = "ipv6" ] && [ $NO_IPV6 -ne 0 ] && return
+ [ "$family" = "ipv4" ] && [ "$ipv" = "ipv6" ] && return
+ [ "$family" = "ipv6" ] && [ "$ipv" = "ipv4" ] && return
- if ! $IPT -S "mwan3_rule_$1" &> /dev/null; then
- $IPT -N "mwan3_rule_$1"
- fi
+ if [ $rule_policy -eq 1 ] && [ -n "${current##*-N $policy*}" ]; then
+ mwan3_push_update -N "$policy"
+ fi
- $IPT -F "mwan3_rule_$1"
- done
+ if [ $rule_policy -eq 1 ] && [ "$sticky" -eq 1 ]; then
+ if [ -n "${current##*-N mwan3_rule_$1*}" ]; then
+ mwan3_push_update -N "mwan3_rule_$1"
+ fi
- $IPS -! create "mwan3_sticky_v4_$rule" \
- hash:ip,mark markmask "$MMX_MASK" \
- timeout "$timeout"
- $IPS -! create "mwan3_sticky_v6_$rule" \
- hash:ip,mark markmask "$MMX_MASK" \
- timeout "$timeout" family inet6
- $IPS -! create "mwan3_sticky_$rule" list:set
- $IPS -! add "mwan3_sticky_$rule" "mwan3_sticky_v4_$rule"
- $IPS -! add "mwan3_sticky_$rule" "mwan3_sticky_v6_$rule"
+ mwan3_push_update -F "mwan3_rule_$1"
+ config_foreach mwan3_set_sticky_iptables interface $ipv
- config_foreach mwan3_set_sticky_iptables interface
-
- for IPT in "$IPT4" "$IPT6"; do
- [ "$IPT" = "$IPT6" ] && [ $NO_IPV6 -ne 0 ] && continue
- $IPT -A "mwan3_rule_$1" \
- -m mark --mark 0/$MMX_MASK \
- -j "$policy"
- $IPT -A "mwan3_rule_$1" \
- -m mark ! --mark 0xfc00/0xfc00 \
- -j SET --del-set "mwan3_sticky_$rule" src,src
- $IPT -A "mwan3_rule_$1" \
- -m mark ! --mark 0xfc00/0xfc00 \
- -j SET --add-set "mwan3_sticky_$rule" src,src
- done
-
- policy="mwan3_rule_$1"
- else
- policy="mwan3_policy_$use_policy"
- for IPT in "$IPT4" "$IPT6"; do
- [ "$IPT" = "$IPT6" ] && [ $NO_IPV6 -ne 0 ] && continue
- if ! $IPT -S "$policy" &> /dev/null; then
- $IPT -N "$policy"
- fi
- done
+ mwan3_push_update -A "mwan3_rule_$1" \
+ -m mark --mark 0/$MMX_MASK \
+ -j "$policy"
+ mwan3_push_update -A "mwan3_rule_$1" \
+ -m mark ! --mark 0xfc00/0xfc00 \
+ -j SET --del-set "mwan3_sticky_$rule" src,src
+ mwan3_push_update -A "mwan3_rule_$1" \
+ -m mark ! --mark 0xfc00/0xfc00 \
+ -j SET --add-set "mwan3_sticky_$rule" src,src
+ policy="mwan3_rule_$1"
+ fi
+ if [ "$global_logging" = "1" ] && [ "$rule_logging" = "1" ]; then
+ mwan3_push_update -A mwan3_rules \
+ -p "$proto" \
+ ${src_ip:+-s} $src_ip \
+ ${src_dev:+-i} $src_dev \
+ ${dest_ip:+-d} $dest_ip \
+ $ipset \
+ ${src_port:+-m} ${src_port:+multiport} ${src_port:+--sports} $src_port \
+ ${dest_port:+-m} ${dest_port:+multiport} ${dest_port:+--dports} $dest_port \
+ -m mark --mark 0/$MMX_MASK \
+ -m comment --comment "$1" \
+ -j LOG --log-level "$loglevel" --log-prefix "MWAN3($1)"
+ fi
- fi
- fi
- for IPT in "$IPT4" "$IPT6"; do
- [ "$IPT" = "$IPT6" ] && [ $NO_IPV6 -ne 0 ] && continue
- [ "$family" = "ipv4" ] && [ "$IPT" = "$IPT6" ] && continue
- [ "$family" = "ipv6" ] && [ "$IPT" = "$IPT4" ] && continue
- [ "$global_logging" = "1" ] && [ "$rule_logging" = "1" ] && {
- $IPT -A mwan3_rules \
- -p "$proto" \
- ${src_ip:+-s} $src_ip \
- ${src_dev:+-i} $src_dev \
- ${dest_ip:+-d} $dest_ip \
- $ipset \
- ${src_port:+-m} ${src_port:+multiport} ${src_port:+--sports} $src_port \
- ${dest_port:+-m} ${dest_port:+multiport} ${dest_port:+--dports} $dest_port \
- -m mark --mark 0/$MMX_MASK \
- -m comment --comment "$1" \
- -j LOG --log-level "$loglevel" --log-prefix "MWAN3($1)"
- }
-
- $IPT -A mwan3_rules \
- -p "$proto" \
- ${src_ip:+-s} $src_ip \
- ${src_dev:+-i} $src_dev \
- ${dest_ip:+-d} $dest_ip \
- $ipset \
- ${src_port:+-m} ${src_port:+multiport} ${src_port:+--sports} $src_port \
- ${dest_port:+-m} ${dest_port:+multiport} ${dest_port:+--dports} $dest_port \
- -m mark --mark 0/$MMX_MASK \
- -j $policy
- done
+ mwan3_push_update -A mwan3_rules \
+ -p "$proto" \
+ ${src_ip:+-s} $src_ip \
+ ${src_dev:+-i} $src_dev \
+ ${dest_ip:+-d} $dest_ip \
+ $ipset \
+ ${src_port:+-m} ${src_port:+multiport} ${src_port:+--sports} $src_port \
+ ${dest_port:+-m} ${dest_port:+multiport} ${dest_port:+--dports} $dest_port \
+ -m mark --mark 0/$MMX_MASK \
+ -j $policy
+
+}
+
+mwan3_set_user_iface_rules()
+{
+ local current iface update family error device is_src_iface
+ iface=$1
+ device=$2
+
+ if [ -z "$device" ]; then
+ LOG notice "set_user_iface_rules: could not find device corresponding to iface $iface"
+ return
+ fi
+
+ config_get family "$iface" family ipv4
+
+ if [ "$family" = "ipv4" ]; then
+ IPT="$IPT4"
+ IPTR="$IPT4R"
+ elif [ "$family" = "ipv6" ]; then
+ IPT="$IPT6"
+ IPTR="$IPT6R"
fi
+ $IPT -S | grep -q "^-A mwan3_rules.*-i $device" && return
+
+ is_src_iface=0
+
+ iface_rule()
+ {
+ local src_iface
+ config_get src_iface "$1" src_iface
+ [ "$src_iface" = "$iface" ] && is_src_iface=1
+ }
+ config_foreach iface_rule rule
+ [ $is_src_iface -eq 1 ] && mwan3_set_user_rules
}
mwan3_set_user_rules()
{
- local IPT
+ local IPT IPTR ipv
+ local current update error
+
+ for ipv in ipv4 ipv6; do
+ if [ "$ipv" = "ipv4" ]; then
+ IPT="$IPT4"
+ IPTR="$IPT4R"
+ elif [ "$ipv" = "ipv6" ]; then
+ IPT="$IPT6"
+ IPTR="$IPT6R"
+ fi
+ [ "$ipv" = "ipv6" ] && [ $NO_IPV6 -ne 0 ] && continue
+ update="*mangle"
+ current="$($IPT -S)"
- for IPT in "$IPT4" "$IPT6"; do
- [ "$IPT" = "$IPT6" ] && [ $NO_IPV6 -ne 0 ] && continue
- if ! $IPT -S mwan3_rules &> /dev/null; then
- $IPT -N mwan3_rules
+
+ if [ -n "${current##*-N mwan3_rules*}" ]; then
+ mwan3_push_update -N "mwan3_rules"
fi
- $IPT -F mwan3_rules
+ mwan3_push_update -F mwan3_rules
+
+ config_foreach mwan3_set_user_iptables_rule rule "$ipv"
+
+ mwan3_push_update COMMIT
+ mwan3_push_update ""
+ error=$(echo "$update" | $IPTR 2>&1) || LOG error "set_user_rules: $error"
done
- config_foreach mwan3_set_user_iptables_rule rule
+
}
mwan3_set_iface_hotplug_state() {
if [ -z "$id" ] || [ -z "$device" ]; then
result="offline"
elif [ -n "$($IP rule | awk '$1 == "'$(($id+1000)):'"')" ] && \
- [ -n "$($IP rule | awk '$1 == "'$(($id+2000)):'"')" ] && \
- [ -n "$($IPT -S mwan3_iface_in_$1 2> /dev/null)" ] && \
- [ -n "$($IP route list table $id default dev $device 2> /dev/null)" ]; then
+ [ -n "$($IP rule | awk '$1 == "'$(($id+2000)):'"')" ] && \
+ [ -n "$($IPT -S mwan3_iface_in_$1 2> /dev/null)" ] && \
+ [ -n "$($IP route list table $id default dev $device 2> /dev/null)" ]; then
json_init
json_add_string section interfaces
json_add_string interface "$1"
uptime="$(printf '%02dh:%02dm:%02ds\n' $(($uptime/3600)) $(($uptime%3600/60)) $(($uptime%60)))"
result="$(mwan3_get_iface_hotplug_state $1) $online, uptime $uptime"
elif [ -n "$($IP rule | awk '$1 == "'$(($id+1000)):'"')" ] || \
- [ -n "$($IP rule | awk '$1 == "'$(($id+2000)):'"')" ] || \
- [ -n "$($IPT -S mwan3_iface_in_$1 2> /dev/null)" ] || \
- [ -n "$($IP route list table $id default dev $device 2> /dev/null)" ]; then
+ [ -n "$($IP rule | awk '$1 == "'$(($id+2000)):'"')" ] || \
+ [ -n "$($IPT -S mwan3_iface_in_$1 2> /dev/null)" ] || \
+ [ -n "$($IP route list table $id default dev $device 2> /dev/null)" ]; then
result="error"
elif [ "$enabled" = "1" ]; then
result="offline"
if [ "$action" = "$flush_conntrack" ]; then
echo f > ${CONNTRACK_FILE}
- $LOG info "Connection tracking flushed for interface '$interface' on action '$action'"
+ LOG info "Connection tracking flushed for interface '$interface' on action '$action'"
fi
}
mwan3_track_clean()
{
rm -rf "$MWAN3_STATUS_DIR/${1}" &> /dev/null
- [ -d "$MWAN3_STATUS_DIR" ] && {
- if [ -z "$(ls -A "$MWAN3_STATUS_DIR")" ]; then
- rm -rf "$MWAN3_STATUS_DIR"
- fi
- }
+ rmdir --ignore-fail-on-non-empty "$MWAN3_STATUS_DIR"
}
. /usr/share/libubox/jshn.sh
. /lib/functions/network.sh
. /lib/mwan3/mwan3.sh
+. /lib/mwan3/common.sh
help()
{
ACTION=ifdown INTERFACE=$1 /sbin/hotplug-call iface
- kill $(pgrep -f "mwan3track $1 $2") &> /dev/null
+ kill $(pgrep -f "mwan3track $1 ") &> /dev/null
mwan3_track_clean $1
}
ifup()
{
- local device enabled up l3_device status
-
- mwan3_lock "command" "mwan3"
-
- config_load mwan3
- config_get_bool enabled globals 'enabled' 0
-
- [ ${enabled} -gt 0 ] || {
- echo "The service mwan3 is global disabled."
- echo "Please execute \"/etc/init.d/mwan3 start\" first."
- mwan3_unlock "command" "mwan3"
- exit 1
- }
+ local device enabled up l3_device status interface true_iface
if [ -z "$1" ]; then
echo "Expecting interface. Usage: mwan3 ifup <interface>"
- mwan3_unlock "command" "mwan3"
exit 0
fi
if [ -n "$2" ]; then
echo "Too many arguments. Usage: mwan3 ifup <interface>"
- mwan3_unlock "command" "mwan3"
exit 0
fi
- config_get enabled "$1" enabled 0
- mwan3_unlock "command" "mwan3"
+ interface=$1
+
+ if [ "${MWAN3_STARTUP}" != 1 ]; then
+ # It is not necessary to obtain a lock here, because it is obtained in the hotplug
+ # script, but we still want to do the check to print a useful error message
+ config_load mwan3
+ config_get_bool enabled globals 'enabled' 0
+
+ [ ${enabled} -gt 0 ] || {
+ echo "The service mwan3 is global disabled."
+ echo "Please execute \"/etc/init.d/mwan3 start\" first."
+ exit 1
+ }
+ else
+ enabled=1
+ fi
+ mwan3_get_true_iface true_iface $interface
+ status=$(ubus -S call network.interface.$true_iface status)
- status=$(ubus -S call network.interface.$1 status)
[ -n "$status" ] && {
json_load "$status"
json_get_vars up l3_device
}
+ hotplug_startup()
+ {
+ MWAN3_STARTUP=$MWAN3_STARTUP ACTION=ifup INTERFACE=$interface DEVICE=$l3_device TRUE_INTERFACE=$true_iface sh /etc/hotplug.d/iface/15-mwan3
+ MWAN3_STARTUP=$MWAN3_STARTUP ACTION=ifup INTERFACE=$interface DEVICE=$l3_device TRUE_INTERFACE=$true_iface sh /etc/hotplug.d/iface/16-mwan3-user
+ }
- if [ "$up" = "1" ] \
- && [ -n "$l3_device" ] \
- && [ "$enabled" = "1" ]; then
- ACTION=ifup INTERFACE=$1 DEVICE=$l3_device /sbin/hotplug-call iface
+ if [ "$up" != "1" ] || [ -z "$l3_device" ] || [ "$enabled" != "1" ]; then
+ return
fi
+
+ if [ "${MWAN3_STARTUP}" = 1 ]; then
+ hotplug_startup &
+ hotplug_pids="$hotplug_pids $!"
+ else
+ hotplug_startup
+ fi
+
}
interfaces()
start()
{
- local enabled
-
+ local enabled hotplug_pids MWAN3_STARTUP
+ MWAN3_STARTUP=1
mwan3_lock "command" "mwan3"
uci_toggle_state mwan3 globals enabled "1"
- mwan3_unlock "command" "mwan3"
-
config_load mwan3
+
+ mwan3_update_iface_to_table
+ mwan3_set_connected_iptables
+ mwan3_set_custom_ipset
+ mwan3_set_general_rules
+ mwan3_set_general_iptables
config_foreach ifup interface
+ wait $hotplug_pids
+ mwan3_add_all_nondefault_routes
+ mwan3_set_policies_iptables
+ mwan3_set_user_rules
+
+
+ mwan3_unlock "command" "mwan3"
+ mwan3_rtmon
+ unset MWAN3_STARTUP
}
stop()
{
- local ipset route rule table IP IPT pid
+ local ipset rule IP IPTR IPT kill_pid family table tid
mwan3_lock "command" "mwan3"
uci_toggle_state mwan3 globals enabled "0"
- for pid in $(pgrep -f "mwan3rtmon"); do
- kill -TERM "$pid" > /dev/null 2>&1
- done
+ {
+ kill -TERM $(pgrep -f "mwan3rtmon") > /dev/null 2>&1
+ kill -TERM $(pgrep -f "mwan3track") > /dev/null 2>&1
- for pid in $(pgrep -f "mwan3track"); do
- kill -TERM "$pid" > /dev/null 2>&1
- done
-
- sleep 1
-
- for pid in $(pgrep -f "mwan3rtmon"); do
- kill -KILL "$pid" > /dev/null 2>&1
- done
-
- for pid in $(pgrep -f "mwan3track"); do
- kill -KILL "$pid" > /dev/null 2>&1
- done
+ sleep 1
+ kill -KILL $(pgrep -f "mwan3rtmon") > /dev/null 2>&1
+ kill -KILL $(pgrep -f "mwan3track") > /dev/null 2>&1
+ } &
+ kill_pid=$!
config_load mwan3
config_foreach mwan3_track_clean interface
- for IP in "$IP4" "$IP6"; do
- [ "$IP" = "$IP6" ] && [ $NO_IPV6 -ne 0 ] && continue
- for route in $(seq 1 $MWAN3_INTERFACE_MAX); do
- $IP route flush table $route &> /dev/null
+ for family in ipv4 ipv6; do
+ if [ "$family" = "ipv4" ]; then
+ IPT="$IPT4"
+ IPTR="$IPT4R"
+ IP="$IP4"
+ elif [ "$family" = "ipv6" ]; then
+ [ $NO_IPV6 -ne 0 ] && continue
+ IPT="$IPT6"
+ IPTR="$IPT6R"
+ IP="$IP6"
+ fi
+
+ for tid in $(ip route list table all | sed -ne 's/.*table \([0-9]\+\).*/\1/p'|sort -u); do
+ [ $tid -gt $MWAN3_INTERFACE_MAX ] && continue
+ $IP route flush table $tid &> /dev/null
done
for rule in $($IP rule list | egrep '^[1-2][0-9]{3}\:' | cut -d ':' -f 1); do
$IP rule del pref $rule &> /dev/null
done
- done
-
- for IPT in "$IPT4" "$IPT6"; do
- [ "$IPT" = "$IPT6" ] && [ $NO_IPV6 -ne 0 ] && continue
- $IPT -D PREROUTING -j mwan3_hook &> /dev/null
- $IPT -D OUTPUT -j mwan3_hook &> /dev/null
-
- for table in $($IPT -S | awk '{print $2}' | grep mwan3 | sort -u); do
- $IPT -F $table &> /dev/null
- done
-
- for table in $($IPT -S | awk '{print $2}' | grep mwan3 | sort -u); do
- $IPT -X $table &> /dev/null
- done
+ table="$($IPT -S)"
+ {
+ echo "*mangle";
+ [ -z "${table##*PREROUTING -j mwan3_hook*}" ] && echo "-D PREROUTING -j mwan3_hook"
+ [ -z "${table##*OUTPUT -j mwan3_hook*}" ] && echo "-D OUTPUT -j mwan3_hook"
+ echo "$table" | awk '{print "-F "$2}' | grep mwan3 | sort -u
+ echo "$table" | awk '{print "-X "$2}' | grep mwan3 | sort -u
+ echo "COMMIT"
+ } | $IPTR
done
for ipset in $($IPS -n list | grep mwan3_); do
$IPS -q destroy $ipset
done
+ if ! pgrep -f "mwan3track" >/dev/null && ! pgrep -f "mwan3rtmon" >/dev/null; then
+ # mwan3track has already exited, no need to send
+ # TERM signal
+ kill $kill_pid 2>/dev/null
+ else
+ # mwan3track has not exited, wait for the killer
+ # to do its work
+ wait $kill_pid
+ fi
+ rm -rf $MWAN3_STATUS_DIR $MWAN3TRACK_STATUS_DIR
+
mwan3_unlock "command" "mwan3"
- rm -rf $MWAN3_STATUS_DIR $MWAN3TRACK_STATUS_DIR
}
restart() {
#!/bin/sh
. /lib/functions.sh
+. /lib/functions/network.sh
. /lib/mwan3/mwan3.sh
+. /lib/mwan3/common.sh
-LOG="logger -t $(basename "$0")[$$] -p"
+mwan3_rtmon_route_handle()
+{
+ config_load mwan3
+ local section action route_line family tbl device metric tos dst line
+ local route_device tid
+ route_line=${1##"Deleted "}
+ route_family=$2
-clean_up() {
- $LOG notice "Stopping mwan3rtmon..."
- exit 0
-}
+ if [ "$route_family" = "ipv4" ]; then
+ IP="$IP4"
+ elif [ "$route_family" = "ipv6" ] && [ $NO_IPV6 -eq 0 ]; then
+ IP="$IP6"
+ else
+ return
+ fi
+
+ if [ "$route_line" == "$1" ]; then
+ action="add"
+ else
+ action="del"
+ fi
+
+ # never add default route lines, since this is handled elsewhere
+ [ -z "${route_line##default*}" ] && return
+ [ -z "${route_line##::/0*}" ] && return
+ route_line=${route_line%% linkdown*}
+ route_line=${route_line%% unreachable*}
+ mwan3_update_dev_to_table
+ mwan3_route_line_dev "tid" "$route_line" "$route_family"
+ handle_route() {
+ tbl=$($IP route list table $tid)
+ if [ $action = "add" ]; then
+ echo "$tbl" | grep -q "^default\|^::/0" || return
+ else
+ [ -z "$tbl" ] && return
+ fi
+ # check that action needs to be performed. May not need to take action if:
+ # Got a route update on ipv6 where route is already in the table
+ # Got a delete event, but table was already flushed
+
+ [ $action = "add" ] && [ -z "${tbl##*$route_line*}" ] && return
+ [ $action = "del" ] && [ -n "${tbl##*$route_line*}" ] && return
+ network_get_device device "$section"
+ LOG debug "adjusting route $device: $IP route "$action" table $tid $route_line"
+ $IP route "$action" table $tid $route_line ||
+ LOG warn "failed: $IP route $action table $tid $route_line"
+ }
+ handle_route_cb(){
+ let tid++
+ config_get family "$section" family ipv4
+ [ "$family" != "$route_family" ] && return
+ handle_route
+ }
-rtchange() {
- $LOG info "Detect rtchange event."
+ if [ $action = "add" ]; then
+ ## handle old routes from 'change' or 'replace'
+ metric=${route_line##*metric }
+ [ "$metric" = "$route_line" ] && unset metric || metric=${metric%% *}
+
+ tos=${route_line##*tos }
+ [ "$tos" = "$route_line" ] && unset tos || tos=${tos%% *}
+
+ dst=${route_line%% *}
+ grep_line="$dst ${tos:+tos $tos}.*table [0-9].*${metric:+metric $metric}"
+ $IP route list table all | grep "$grep_line" | while read line; do
+ tbl=${line##*table }
+ tbl=${tbl%% *}
+ [ $tbl -gt $MWAN3_INTERFACE_MAX ] && continue
+ LOG debug "removing route on ip route change/replace: $line"
+ $IP route del $line
+ done
+ fi
+
+ if [ -n "$tid" ]; then
+ handle_route
+ else
+ config_foreach handle_route_cb interface
+ fi
}
-main() {
- local rtmon_interval
- trap clean_up TERM
- trap rtchange USR1
+main()
+{
+ local IP family
config_load mwan3
- config_get rtmon_interval globals rtmon_interval '5'
+ family=$1
+ [ -z $family ] && family=ipv4
+ if [ "$family" = ipv6 ]; then
+ IP="$IP6"
+ else
+ IP="$IP4"
+ fi
+ mwan3_init
- sleep 3
- while true; do
+ $IP monitor route | while read line; do
+ [ -z "${line##*table*}" ] && continue
+ LOG debug "handling route update $family $line"
mwan3_lock "service" "mwan3rtmon"
- mwan3_rtmon_ipv4 || mwan3_rtmon_ipv6
- ret=$?
+ mwan3_rtmon_route_handle "$line" "$family"
mwan3_unlock "service" "mwan3rtmon"
- [ "$ret" = "0" ] || break
- [ "$rtmon_interval" = "0" ] && break
- sleep "$rtmon_interval" &
- wait
done
}
-
main "$@"
. /lib/functions.sh
. /lib/mwan3/common.sh
-LOG="logger -t $(basename "$0")[$$] -p"
INTERFACE=""
DEVICE=""
PING="/bin/ping"
IFDOWN_EVENT=0
+IFUP_EVENT=0
clean_up() {
- $LOG notice "Stopping mwan3track for interface \"${INTERFACE}\""
+ LOG notice "Stopping mwan3track for interface \"${INTERFACE}\""
exit 0
}
if_down() {
- $LOG info "Detect ifdown event on interface ${INTERFACE} (${DEVICE})"
+ LOG info "Detect ifdown event on interface ${INTERFACE} (${DEVICE})"
IFDOWN_EVENT=1
}
+if_up() {
+ LOG info "Detect ifup event on interface ${INTERFACE} (${DEVICE})"
+ IFUP_EVENT=1
+}
+
validate_track_method() {
case "$1" in
ping)
- command -v ping 1>/dev/null 2>&1 || {
- $LOG warn "Missing ping. Please install iputils-ping package or enable ping util and recompile busybox."
+ [ -x "$PING" ] || {
+ LOG warn "Missing ping. Please enable ping util and recompile busybox."
return 1
}
;;
arping)
command -v arping 1>/dev/null 2>&1 || {
- $LOG warn "Missing arping. Please install iputils-arping package."
+ LOG warn "Missing arping. Please install iputils-arping package."
return 1
}
;;
httping)
command -v httping 1>/dev/null 2>&1 || {
- $LOG warn "Missing httping. Please install httping package."
+ LOG warn "Missing httping. Please install httping package."
return 1
}
[ -n "$2" -a "$2" != "0.0.0.0" -a "$2" != "::" ] || {
- $LOG warn "Cannot determine source IP for the interface which is required by httping."
+ LOG warn "Cannot determine source IP for the interface which is required by httping."
return 1
}
;;
nping-*)
command -v nping 1>/dev/null 2>&1 || {
- $LOG warn "Missing nping. Please install nping package."
+ LOG warn "Missing nping. Please install nping package."
return 1
}
;;
*)
- $LOG warn "Unsupported tracking method: $track_method"
+ LOG warn "Unsupported tracking method: $track_method"
return 2
;;
esac
}
+disconnected() {
+ echo "offline" > /var/run/mwan3track/$INTERFACE/STATUS
+ echo "$(get_uptime)" > /var/run/mwan3track/$INTERFACE/OFFLINE
+ echo "0" > /var/run/mwan3track/$INTERFACE/ONLINE
+ score=0
+ [ "$1" == 1 ] && return
+ LOG notice "Interface $INTERFACE ($DEVICE) is offline"
+ env -i ACTION="disconnected" INTERFACE="$INTERFACE" DEVICE="$DEVICE" /sbin/hotplug-call iface
+}
+
+connected() {
+ echo "online" > /var/run/mwan3track/$INTERFACE/STATUS
+ echo "0" > /var/run/mwan3track/$INTERFACE/OFFLINE
+ echo "$(get_uptime)" > /var/run/mwan3track/$INTERFACE/ONLINE
+ host_up_count=0
+ lost=0
+ turn=0
+ loss=0
+ [ "$1" == 1 ] && return
+ LOG notice "Interface $INTERFACE ($DEVICE) is online"
+ env -i ACTION="connected" INTERFACE="$INTERFACE" DEVICE="$DEVICE" /sbin/hotplug-call iface
+}
+
+firstconnect() {
+ if [ "$STATUS" = "offline" ]; then
+ disconnected 1
+ else
+ connected 1
+ fi
+}
+
+update_status() {
+ local status track_ip
+ track_ip=$1
+ status=$2
+
+ echo "$1" > /var/run/mwan3track/$INTERFACE/TRACK_${track_ip}
+ [ -z "$3" ] && return
+ echo "$3" > /var/run/mwan3track/$INTERFACE/LATENCY_${track_ip}
+ echo "$4" > /var/run/mwan3track/$INTERFACE/LOSS_${track_ip}
+}
+
main() {
local reliability count timeout interval failure_interval
local recovery_interval down up size
DEVICE=$2
STATUS=$3
SRC_IP=$4
- mkdir -p /var/run/mwan3track/$1
+ mkdir -p /var/run/mwan3track/$INTERFACE
trap clean_up TERM
trap if_down USR1
+ trap if_up USR2
config_load mwan3
- config_get track_method $1 track_method ping
- config_get_bool httping_ssl $1 httping_ssl 0
+ config_get track_method $INTERFACE track_method ping
+ config_get_bool httping_ssl $INTERFACE httping_ssl 0
validate_track_method $track_method $SRC_IP || {
track_method=ping
if validate_track_method $track_method; then
- $LOG warn "Using ping to track interface $INTERFACE avaliability"
+ LOG warn "Using ping to track interface $INTERFACE avaliability"
else
- $LOG err "No track method avaliable"
+ LOG err "No track method avaliable"
exit 1
fi
}
- config_get reliability $1 reliability 1
- config_get count $1 count 1
- config_get timeout $1 timeout 4
- config_get interval $1 interval 10
- config_get down $1 down 5
- config_get up $1 up 5
- config_get size $1 size 56
- config_get max_ttl $1 max_ttl 60
- config_get failure_interval $1 failure_interval $interval
- config_get_bool keep_failure_interval $1 keep_failure_interval 0
- config_get recovery_interval $1 recovery_interval $interval
- config_get_bool check_quality $1 check_quality 0
- config_get failure_latency $1 failure_latency 1000
- config_get recovery_latency $1 recovery_latency 500
- config_get failure_loss $1 failure_loss 40
- config_get recovery_loss $1 recovery_loss 10
+ config_get reliability $INTERFACE reliability 1
+ config_get count $INTERFACE count 1
+ config_get timeout $INTERFACE timeout 4
+ config_get interval $INTERFACE interval 10
+ config_get down $INTERFACE down 5
+ config_get up $INTERFACE up 5
+ config_get size $INTERFACE size 56
+ config_get max_ttl $INTERFACE max_ttl 60
+ config_get failure_interval $INTERFACE failure_interval $interval
+ config_get_bool keep_failure_interval $INTERFACE keep_failure_interval 0
+ config_get recovery_interval $INTERFACE recovery_interval $interval
+ config_get_bool check_quality $INTERFACE check_quality 0
+ config_get failure_latency $INTERFACE failure_latency 1000
+ config_get recovery_latency $INTERFACE recovery_latency 500
+ config_get failure_loss $INTERFACE failure_loss 40
+ config_get recovery_loss $INTERFACE recovery_loss 10
local score=$(($down+$up))
local track_ips=$(echo $* | cut -d ' ' -f 5-99)
local host_up_count=0
local lost=0
- local sleep_time=0
local turn=0
- local result
local ping_protocol=4
- local ping_result
- local ping_result_raw
- local ping_status
- local loss=0
- local latency=0
+ local sleep_time result ping_result ping_result_raw ping_status loss latency
- if [ "$STATUS" = "offline" ]; then
- echo "offline" > /var/run/mwan3track/$1/STATUS
- echo "0" > /var/run/mwan3track/$1/ONLINE
- echo "$(get_uptime)" > /var/run/mwan3track/$1/OFFLINE
- score=0
- else
- echo "online" > /var/run/mwan3track/$1/STATUS
- echo "0" > /var/run/mwan3track/$1/OFFLINE
- echo "$(get_uptime)" > /var/run/mwan3track/$1/ONLINE
- env -i ACTION="connected" INTERFACE="$1" DEVICE="$2" /sbin/hotplug-call iface
- fi
+ firstconnect
while true; do
sleep_time=$interval
# pinging IPv6 hosts with an interface is troublesome
# https://bugs.openwrt.org/index.php?do=details&task_id=2897
# so get the IP address of the interface and use that instead
- if echo $track_ip | grep -q ':'; then
- ADDR=$(ip -6 addr ls dev "$DEVICE" | sed -ne '/\/128/d' -e 's/ *inet6 \([^ \/]*\).* scope global.*/\1/p' | head -n1)
- [ -z "$ADDR" ] && ADDR=$(ip -6 addr ls dev "$DEVICE" | sed -ne 's/ *inet6 \([^ \/]*\).* scope global.*/\1/p')
+ if [ -z ${track_ip##*:*} ]; then
ping_protocol=6
+ else
+ unset SRC_IP
fi
if [ $check_quality -eq 0 ]; then
- $PING -$ping_protocol -I ${ADDR:-$DEVICE} -c $count -W $timeout -s $size -t $max_ttl -q $track_ip &> /dev/null
+ $PING -$ping_protocol -I ${SRC_IP:-$DEVICE} -c $count -W $timeout -s $size -t $max_ttl -q $track_ip &> /dev/null
result=$?
else
- ping_result_raw="$($PING -$ping_protocol -I ${ADDR:-$DEVICE} -c $count -W $timeout -s $size -t $max_ttl -q $track_ip 2>/dev/null)"
+ ping_result_raw="$($PING -$ping_protocol -I ${SRC_IP:-$DEVICE} -c $count -W $timeout -s $size -t $max_ttl -q $track_ip 2>/dev/null)"
ping_status=$?
ping_result=$(echo "$ping_result_raw" | tail -n2)
loss="$(echo "$ping_result" | grep "packet loss" | cut -d "," -f3 | awk '{print $1}' | sed -e 's/%//')"
if [ $check_quality -eq 0 ]; then
if [ $result -eq 0 ]; then
let host_up_count++
- echo "up" > /var/run/mwan3track/$1/TRACK_${track_ip}
+ update_status "$track_ip" "up"
+
if [ $score -le $up ]; then
- $LOG info "Check ($track_method) success for target \"$track_ip\" on interface $1 ($2)"
+ LOG info "Check ($track_method) success for target \"$track_ip\" on interface $INTERFACE ($DEVICE). Current score: $score"
fi
else
let lost++
- echo "down" > /var/run/mwan3track/$1/TRACK_${track_ip}
+ update_status "$track_ip" "down"
+
if [ $score -gt $up ]; then
- $LOG info "Check ($track_method) failed for target \"$track_ip\" on interface $1 ($2)"
+ LOG info "Check ($track_method) failed for target \"$track_ip\" on interface $INTERFACE ($DEVICE). Current score: $score"
fi
fi
else
if [ "$loss" -ge "$failure_loss" -o "$latency" -ge "$failure_latency" ]; then
let lost++
- echo "down" > /var/run/mwan3track/$1/TRACK_${track_ip}
- echo "$latency" > /var/run/mwan3track/$1/LATENCY_${track_ip}
- echo "$loss" > /var/run/mwan3track/$1/LOSS_${track_ip}
+ update_status "$track_ip" "down" $latency $loss
if [ $score -gt $up ]; then
- $LOG info "Check (${track_method}: latency=${latency}ms loss=${loss}%) failed for target \"$track_ip\" on interface $1 ($2)"
+ LOG info "Check (${track_method}: latency=${latency}ms loss=${loss}%) failed for target \"$track_ip\" on interface $INTERFACE ($DEVICE). Current score: $score"
fi
elif [ "$loss" -le "$recovery_loss" -a "$latency" -le "$recovery_latency" ]; then
let host_up_count++
- echo "up" > /var/run/mwan3track/$1/TRACK_${track_ip}
- echo "$latency" > /var/run/mwan3track/$1/LATENCY_${track_ip}
- echo "$loss" > /var/run/mwan3track/$1/LOSS_${track_ip}
+ update_status "$track_ip" "up" $latency $loss
if [ $score -le $up ]; then
- $LOG info "Check (${track_method}: latency=${latency}ms loss=${loss}%) success for target \"$track_ip\" on interface $1 ($2)"
+ LOG info "Check (${track_method}: latency=${latency}ms loss=${loss}%) success for target \"$track_ip\" on interface $INTERFACE ($DEVICE). Current score: $score"
fi
else
- echo "skipped" > /var/run/mwan3track/$1/TRACK_${track_ip}
+ echo "skipped" > /var/run/mwan3track/$INTERFACE/TRACK_${track_ip}
fi
fi
else
- echo "skipped" > /var/run/mwan3track/$1/TRACK_${track_ip}
+ echo "skipped" > /var/run/mwan3track/$INTERFACE/TRACK_${track_ip}
fi
done
fi
if [ $score -eq $up ]; then
- echo "offline" > /var/run/mwan3track/$1/STATUS
- env -i ACTION=ifdown INTERFACE=$1 DEVICE=$2 /sbin/hotplug-call iface
+ disconnected
score=0
fi
else
if [ $score -lt $(($down+$up)) ] && [ $lost -gt 0 ]; then
- $LOG info "Lost $(($lost*$count)) ping(s) on interface $1 ($2)"
+ LOG info "Lost $(($lost*$count)) ping(s) on interface $INTERFACE ($DEVICE). Current score: $score"
fi
let score++
lost=0
if [ $score -gt $up ]; then
- echo "online" > /var/run/mwan3track/$1/STATUS
+ echo "online" > /var/run/mwan3track/$INTERFACE/STATUS
score=$(($down+$up))
elif [ $score -le $up ]; then
sleep_time=$recovery_interval
fi
if [ $score -eq $up ]; then
- $LOG notice "Interface $1 ($2) is online"
- echo "online" > /var/run/mwan3track/$1/STATUS
- env -i ACTION=ifup INTERFACE=$1 DEVICE=$2 /sbin/hotplug-call iface
- exit 0
+ connected $INTERFACE $DEVICE
fi
fi
let turn++
mkdir -p "/var/run/mwan3track/${1}"
- echo "${lost}" > /var/run/mwan3track/$1/LOST
- echo "${score}" > /var/run/mwan3track/$1/SCORE
- echo "${turn}" > /var/run/mwan3track/$1/TURN
- echo "$(get_uptime)" > /var/run/mwan3track/$1/TIME
+ echo "${lost}" > /var/run/mwan3track/$INTERFACE/LOST
+ echo "${score}" > /var/run/mwan3track/$INTERFACE/SCORE
+ echo "${turn}" > /var/run/mwan3track/$INTERFACE/TURN
+ echo "$(get_uptime)" > /var/run/mwan3track/$INTERFACE/TIME
host_up_count=0
sleep "${sleep_time}" &
wait
if [ "${IFDOWN_EVENT}" -eq 1 ]; then
- echo "offline" > /var/run/mwan3track/$1/STATUS
- echo "$(get_uptime)" > /var/run/mwan3track/$1/OFFLINE
- echo "0" > /var/run/mwan3track/$1/ONLINE
- $LOG notice "Interface $1 ($2) is offline"
- env -i ACTION="disconnected" INTERFACE="$1" DEVICE="$2" /sbin/hotplug-call iface
- score=0
+ LOG debug "Register ifdown event on interface ${INTERFACE} (${DEVICE})"
+ disconnected 1
IFDOWN_EVENT=0
fi
+ if [ "${IFUP_EVENT}" -eq 1 ]; then
+ LOG debug "Register ifup event on interface ${INTERFACE} (${DEVICE})"
+ firstconnect
+ IFUP_EVENT=0
+ fi
done
}
--- /dev/null
+#
+# Copyright (C) 2017 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+# Warning by default OpenWrt does not have a root password which is necessery for NETCONF server.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=netopeer2
+PKG_VERSION:=1.1.39
+PKG_RELEASE:=1
+
+PKG_LICENSE:=BSD-3-Clause
+PKG_MAINTAINER:=Jakov Smolic <jakov.smolic@sartura.hr>
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://codeload.github.com/CESNET/Netopeer2/tar.gz/v$(PKG_VERSION)?
+PKG_HASH:=e983683eda68792fedd73af54a5c7997496091489aa921f2a9e0dd27f2f6e19a
+
+CMAKE_INSTALL:=1
+
+PKG_BUILD_PARALLEL:=1
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/netopeer2-server
+ SECTION:=utils
+ CATEGORY:=Utilities
+ TITLE:=NETCONF server
+ URL:=https://github.com/CESNET/Netopeer2
+ DEPENDS:=+libcurl +libpthread +libyang +libnetconf2 +libsysrepo +sysrepocfg +sysrepoctl +sysrepo
+ MENU:=1
+endef
+
+define Package/netopeer2-cli
+ SECTION:=utils
+ CATEGORY:=Utilities
+ TITLE:=Netopeer2 cli tool
+ URL:=https://github.com/CESNET/Netopeer2
+ DEPENDS:=+libpthread +libyang +libnetconf2 +libopenssl
+endef
+
+define Package/netopeer2/description
+ Netopeer2 is a set of tools implementing network configuration tools based on the NETCONF
+ Protocol. This is the second generation of the toolset, originally available as the Netopeer
+ project. Netopeer2 is based on the new generation of the NETCONF and YANG libraries -
+ libyang and libnetconf2. The Netopeer server uses sysrepo as a NETCONF datastore implementation.
+endef
+
+CMAKE_OPTIONS += \
+ -DCMAKE_INSTALL_PREFIX:PATH=/usr \
+ -DCMAKE_BUILD_TYPE:STRING=Release \
+ -DGENERATE_HOSTKEY:BOOL=OFF \
+ -DINSTALL_MODULES:BOOL=OFF \
+ -DMERGE_LISTEN_CONFIG:BOOL=OFF
+
+define Package/netopeer2-server/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/netopeer2-server $(1)/usr/bin/
+
+ $(INSTALL_DIR) $(1)/etc/sysrepo/yang
+ $(INSTALL_DIR) $(1)/etc/netopeer2/modules
+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/* $(1)/etc/netopeer2/modules/
+
+ $(INSTALL_DIR) $(1)/etc/uci-defaults
+ $(INSTALL_BIN) ./files/netopeer2-server-setup.default $(1)/etc/uci-defaults/97_netopeer2-server
+ $(INSTALL_BIN) ./files/netopeer2-server-merge-hostkey.default $(1)/etc/uci-defaults/98_netopeer2-server
+ $(INSTALL_BIN) ./files/netopeer2-server-merge-config.default $(1)/etc/uci-defaults/99_netopeer2-server
+
+ $(INSTALL_DIR) $(1)/etc/init.d/
+ $(INSTALL_BIN) ./files/netopeer2-server.init $(1)/etc/init.d/netopeer2-server
+endef
+
+define Package/netopeer2-cli/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/netopeer2-cli $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,netopeer2-server))
+$(eval $(call BuildPackage,netopeer2-cli))
--- /dev/null
+#!/bin/sh
+
+set -e
+
+# avoid problems with sudo path
+SYSREPOCFG=`which sysrepocfg`
+KS_KEY_NAME=genkey
+
+# check that there is no listen/Call Home configuration yet
+SERVER_CONFIG=`$SYSREPOCFG -X -x "/ietf-netconf-server:netconf-server/listen/endpoint[1]/name | /ietf-netconf-server:netconf-server/call-home/netconf-client[1]/name"`
+if [ -z "$SERVER_CONFIG" ]; then
+
+# import default config
+CONFIG="<netconf-server xmlns=\"urn:ietf:params:xml:ns:yang:ietf-netconf-server\">
+ <listen>
+ <endpoint>
+ <name>default-ssh</name>
+ <ssh>
+ <tcp-server-parameters>
+ <local-address>0.0.0.0</local-address>
+ <keepalives>
+ <idle-time>1</idle-time>
+ <max-probes>10</max-probes>
+ <probe-interval>5</probe-interval>
+ </keepalives>
+ </tcp-server-parameters>
+ <ssh-server-parameters>
+ <server-identity>
+ <host-key>
+ <name>default-key</name>
+ <public-key>
+ <keystore-reference>$KS_KEY_NAME</keystore-reference>
+ </public-key>
+ </host-key>
+ </server-identity>
+ <client-authentication>
+ <supported-authentication-methods>
+ <publickey/>
+ <passsword/>
+ <other>interactive</other>
+ </supported-authentication-methods>
+ <users/>
+ </client-authentication>
+ </ssh-server-parameters>
+ </ssh>
+ </endpoint>
+ </listen>
+</netconf-server>"
+TMPFILE=`mktemp -u`
+printf -- "$CONFIG" > $TMPFILE
+# apply it to startup and running
+$SYSREPOCFG --edit=$TMPFILE -d startup -f xml -m ietf-netconf-server -v2
+$SYSREPOCFG -C startup -m ietf-netconf-server -v2
+# remove the tmp file
+rm $TMPFILE
+
+fi
--- /dev/null
+#!/bin/sh
+
+set -e
+
+# avoid problems with sudo path
+SYSREPOCFG=`which sysrepocfg`
+OPENSSL=`which openssl`
+
+# check that there is no SSH key with this name yet
+KEYSTORE_KEY=`$SYSREPOCFG -X -x "/ietf-keystore:keystore/asymmetric-keys/asymmetric-key[name='genkey']/name"`
+if [ -z "$KEYSTORE_KEY" ]; then
+
+# generate a new key
+PRIVPEM=`$OPENSSL genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -outform PEM 2>/dev/null`
+# remove header/footer
+PRIVKEY=`grep -v -- "-----" - <<STDIN
+$PRIVPEM
+STDIN`
+# get public key
+PUBPEM=`$OPENSSL rsa -pubout 2>/dev/null <<STDIN
+$PRIVPEM
+STDIN`
+# remove header/footer
+PUBKEY=`grep -v -- "-----" - <<STDIN
+$PUBPEM
+STDIN`
+
+# generate edit config
+CONFIG="<keystore xmlns=\"urn:ietf:params:xml:ns:yang:ietf-keystore\">
+ <asymmetric-keys>
+ <asymmetric-key>
+ <name>genkey</name>
+ <algorithm>rsa2048</algorithm>
+ <public-key>$PUBKEY</public-key>
+ <private-key>$PRIVKEY</private-key>
+ </asymmetric-key>
+ </asymmetric-keys>
+</keystore>"
+TMPFILE=`mktemp -u`
+printf -- "$CONFIG" > $TMPFILE
+# apply it to startup and running
+$SYSREPOCFG --edit=$TMPFILE -d startup -f xml -m ietf-keystore -v2
+$SYSREPOCFG -C startup -m ietf-keystore -v2
+# remove the tmp file
+rm $TMPFILE
+
+fi
--- /dev/null
+#!/bin/sh
+
+# Warning, problems can occur if the device restarts in the middle of this uci-default script
+
+# install YANG modules
+SYSREPOCTL=`which sysrepoctl`
+MODDIR="/etc/netopeer2/modules"
+PERMS=600
+OWNER=root
+GROUP=root
+
+# array of modules to install
+MODULES="\
+ietf-netconf-acm@2018-02-14.yang
+ietf-netconf@2013-09-29.yang -e writable-running -e candidate -e rollback-on-error -e validate -e startup -e url -e xpath
+ietf-netconf-monitoring@2010-10-04.yang
+ietf-netconf-nmda@2019-01-07.yang -e origin -e with-defaults
+nc-notifications@2008-07-14.yang
+notifications@2008-07-14.yang
+ietf-x509-cert-to-name@2014-12-10.yang
+ietf-crypto-types@2019-07-02.yang
+ietf-keystore@2019-07-02.yang -e keystore-supported
+ietf-truststore@2019-07-02.yang -e truststore-supported -e x509-certificates
+ietf-tcp-common@2019-07-02.yang -e keepalives-supported
+ietf-ssh-server@2019-07-02.yang -e local-client-auth-supported
+ietf-tls-server@2019-07-02.yang -e local-client-auth-supported
+ietf-netconf-server@2019-07-02.yang -e ssh-listen -e tls-listen -e ssh-call-home -e tls-call-home"
+
+# functions
+INSTALL_MODULE() {
+ local module=`echo "$1" | sed 's/\s.*$//'`
+ $SYSREPOCTL -a -i $MODDIR/$module -s $MODDIR -p $PERMS -o $OWNER -g $GROUP -v2
+ local rc=$?
+ if [ $rc -ne 0 ]; then
+ exit $rc
+ fi
+}
+
+UPDATE_MODULE() {
+ $SYSREPOCTL -a -U $MODDIR/$1 -s $MODDIR -p $PERMS -o $OWNER -g $GROUP -v2
+ local rc=$?
+ if [ $rc -ne 0 ]; then
+ exit $rc
+ fi
+}
+
+ENABLE_FEATURE() {
+ $SYSREPOCTL -a -c $1 -e $2 -v2
+ local rc=$?
+ if [ $rc -ne 0 ]; then
+ exit $rc
+ fi
+}
+
+ENABLE_FEATURES() {
+ # parse sysrepoctl features and add extra space at the end for easier matching
+ local sctl_features="`echo "$SCTL_MODULE" | sed 's/\([^|]*|\)\{6\}\(.*\)/\2/'` "
+ # parse features we want to enable
+ local features=`echo "$1" | sed 's/[^ ]* \(.*\)/\1/'`
+ while [ "${features:0:3}" = "-e " ]; do
+ # skip "-e "
+ features=${features:3}
+ # parse feature
+ local feature=`echo "$features" | sed 's/\([^[:space:]]*\).*/\1/'`
+
+ # enable feature if not already
+ sctl_feature=`echo "$sctl_features" | grep " ${feature} "`
+ if [ -z "$sctl_feature" ]; then
+ # enable feature
+ ENABLE_FEATURE $name $feature
+ fi
+
+ # next iteration, skip this feature
+ features=`echo "$features" | sed 's/[^[:space:]]* \(.*\)/\1/'`
+ done
+}
+
+# get current modules
+SCTL_MODULES=`$SYSREPOCTL -l`
+
+IFS=$'\n'
+for i in $MODULES; do
+ name=`echo "$i" | sed 's/\([^@]*\).*/\1/'`
+
+ SCTL_MODULE=`echo "$SCTL_MODULES" | grep "^$name \+|[^|]*| I"`
+ if [ -z "$SCTL_MODULE" ]; then
+ # install module
+ INSTALL_MODULE "$i"
+ ENABLE_FEATURES "$i"
+ continue
+ fi
+
+ sctl_revision=`echo "$SCTL_MODULE" | sed 's/[^|]*| \([^ ]*\).*/\1/'`
+ revision=`echo "$i" | sed 's/[^@]*@\([^\.]*\).*/\1/'`
+ if [ "$sctl_revision" \< "$revision" ]; then
+ # update module without any features
+ file=`echo "$i" | cut -d' ' -f 1`
+ UPDATE_MODULE $file
+ fi
+
+ ENABLE_FEATURES "$i"
+done
+
+unset IFS
+
+exit 0
--- /dev/null
+#!/bin/sh /etc/rc.common
+
+START=99
+STOP=11
+
+USE_PROCD=1
+PROG=/usr/bin/netopeer2-server
+
+start_service() {
+ procd_open_instance
+ procd_set_param command $PROG
+ procd_append_param command -d -v 0
+ procd_set_param respawn
+ procd_close_instance
+}
+
+stop_service()
+{
+ service_stop ${PROG}
+ rm /var/run/netopeer2-server.pid
+}
PKG_NAME:=nft-qos
PKG_VERSION:=1.0.6
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_LICENSE:=GPL-2.0
PKG_MAINTAINER:=Rosy Song <rosysong@rosinson.com>
"\t\tip $operator $ipaddr limit rate over $rate $unit/second drop\n"
}
+# qosdef_append_rule_{MATCH}_{STATEMENT}
+qosdef_append_rule_mac_limit() { # <macaddr> <operator> <unit> <rate>
+ local macaddr=$1
+ local operator=$2
+ local unit=$3
+ local rate=$4
+
+ qosdef_appendx \
+ "\t\tether $operator $macaddr limit rate over $rate $unit/second drop\n"
+}
+
# qosdef_append_rule_{MATCH}_{POLICY}
qosdef_append_rule_ip_policy() { # <operator> <ipaddr> <policy>
qosdef_appendx "\t\tip $1 $2 $3\n"
--- /dev/null
+#!/bin/sh
+# based on static.sh
+# Copyright (C) 2020 Tong Zhang<ztong0001@gmail.com>
+#
+
+. /lib/nft-qos/core.sh
+
+qosdef_validate_mac() {
+ uci_load_validate nft-qos default "$1" "$2" \
+ 'limit_mac_enable:bool:0'
+}
+
+# append rule for mac qos
+qosdef_append_rule_mac() { # <section> <operator>
+ local macaddr unit rate
+ local operator=$2
+
+ config_get macaddr $1 macaddr
+ if [ "$operator" = "saddr" ]; then
+ config_get unit $1 urunit
+ config_get rate $1 urate
+ else
+ config_get unit $1 drunit
+ config_get rate $1 drate
+ fi
+
+ [ -z "$macaddr" ] && return
+
+ qosdef_append_rule_mac_limit $macaddr $operator $unit $rate
+}
+
+# append chain for mac qos
+qosdef_append_chain_mac() { # <hook> <name> <section>
+ local hook=$1 name=$2
+ local config=$3 operator
+
+ case "$name" in
+ download) operator="daddr";;
+ upload) operator="saddr";;
+ esac
+
+ qosdef_appendx "\tchain $name {\n"
+ qosdef_append_chain_def filter $hook 0 accept
+ config_foreach qosdef_append_rule_mac $config $operator
+ qosdef_appendx "\t}\n"
+}
+
+qosdef_flush_mac() {
+ if [ -n "$NFT_QOS_HAS_BRIDGE" ]; then
+ qosdef_flush_table bridge nft-qos-mac
+ else
+ qosdef_flush_table "$NFT_QOS_INET_FAMILY" nft-qos-mac
+ fi
+}
+
+# limit rate by mac address init
+qosdef_init_mac() {
+ local hook_ul="prerouting" hook_dl="postrouting"
+
+ [ "$2" = 0 ] || {
+ logger -t nft-qos-mac "validation failed"
+ return 1
+ }
+
+ [ $limit_mac_enable -eq 0 ] && return 1
+
+ table_name=$NFT_QOS_INET_FAMILY
+ if [ -z "$NFT_QOS_HAS_BRIDGE" ]; then
+ hook_ul="postrouting"
+ hook_dl="prerouting"
+ else
+ table_name="bridge"
+ fi
+
+ qosdef_appendx "table $table_name nft-qos-mac {\n"
+ qosdef_append_chain_mac $hook_ul upload client
+ qosdef_append_chain_mac $hook_dl download client
+ qosdef_appendx "}\n"
+}
# list limit_whitelist '192.168.1.0/24'
# list limit_whitelist 'ABCD:CDEF::1/64'
+ # Option for Mac address based traffic control
+ option limit_mac_enable '0'
+
# Options for Traffic Priority
option priority_enable '0'
option priority_netdev 'lan'
# option ipaddr 'ABCD:FFED::1/64'
# option rate '1024'
#
+# For MAC address based traffic control Samples :
+#
+#config client
+# option drunit 'kbytes'
+# option urunit 'kbytes'
+# option hostname 'tvbox'
+# option macaddr '00:00:00:00:00:00'
+# option drate '300'
+# option urate '30'
#
# Traffic Priority Samples :
#
. /lib/nft-qos/monitor.sh
. /lib/nft-qos/dynamic.sh
. /lib/nft-qos/static.sh
+. /lib/nft-qos/mac.sh
. /lib/nft-qos/priority.sh
START=99
qosdef_validate_dynamic
qosdef_validate_static
qosdef_validate_priority
+ qosdef_validate_mac
procd_close_validate
}
config_load nft-qos
qosdef_init_env
+ qosdef_flush_mac
qosdef_flush_static
qosdef_flush_dynamic
qosdef_remove_priority
qosdef_init_monitor
qosdef_validate_dynamic default qosdef_init_dynamic
qosdef_validate_static default qosdef_init_static
+ qosdef_validate_mac default qosdef_init_mac
qosdef_validate_priority default qosdef_init_priority
qosdef_init_done
qosdef_start
stop_service() {
qosdef_flush_dynamic
qosdef_flush_static
+ qosdef_flush_mac
qosdef_remove_priority
qosdef_clean_cache
}
include $(TOPDIR)/rules.mk
PKG_NAME:=nginx
-PKG_VERSION:=1.19.1
-PKG_RELEASE:=3
+PKG_VERSION:=1.19.2
+PKG_RELEASE:=1
PKG_SOURCE:=nginx-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://nginx.org/download/
-PKG_HASH:=a004776c64ed3c5c7bc9b6116ba99efab3265e6b81d49a57ca4471ff90655492
+PKG_HASH:=7c1f7bb13e79433ee930c597d272a64bc6e30c356a48524f38fd34fa88d62473
PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de> \
Ansuel Smith <ansuelsmth@gmail.com>
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://www.openvswitch.org/releases/
-PKG_HASH:=bf5b19d35c820903c141a40f2a949e2ee047c8c0fd7c5e6e12d2239ed5c90026
+PKG_HASH:=4171e52a8c0ffe160c1daa6687219d902a2a6969b296d223d8dac980ab99a260
PKG_LICENSE:=Apache-2.0
PKG_LICENSE_FILES:=LICENSE
ovs_kmod_packages:=
ovs_kmod_intree_kernel_patchver_min:=3.10
-ovs_kmod_intree_kernel_patchver_max:=5.0
+ovs_kmod_intree_kernel_patchver_max:=5.5
ovs_kmod_intree_not_supported:=$(strip $(call kernel_patchver_lt,$(ovs_kmod_intree_kernel_patchver_min))$(call kernel_patchver_gt,$(ovs_kmod_intree_kernel_patchver_max)))
ovs_kmod_intree_dir:=$(PKG_BUILD_DIR)/datapath/linux
ovs_kmod_upstream_dir:=$(LINUX_DIR)/net/openvswitch
# Versions
-ovs_version:=2.13.1
+ovs_version:=2.14.0
ovs_builddir=$(KERNEL_BUILD_DIR)/openvswitch-$(ovs_version)
# Shared vars, macros
-From 66f96259c596f8f303bd98e5323a447cd60adbb2 Mon Sep 17 00:00:00 2001
+From 974dc36a87274d7bae13e7dddd3364fecf5b3e7c Mon Sep 17 00:00:00 2001
From: Helmut Schaa <helmut.schaa@googlemail.com>
Date: Wed, 8 Jan 2014 13:48:49 +0100
Subject: [PATCH] netdev-linux: Let interface flag survive internal port setup
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
-index c6f3d2740..136668b1d 100644
+index fe7fb9b29..63407ba1b 100644
--- a/lib/netdev-linux.c
+++ b/lib/netdev-linux.c
-@@ -3461,7 +3461,13 @@ update_flags(struct netdev_linux *netdev, enum netdev_flags off,
+@@ -3469,7 +3469,13 @@ update_flags(struct netdev_linux *netdev, enum netdev_flags off,
unsigned int old_flags, new_flags;
int error = 0;
-From 29c5b1f1b53010a49d2ce1cc59060c334b1a40fc Mon Sep 17 00:00:00 2001
+From 54484e79aca0981ebc42ddc68487e6531da9b59d Mon Sep 17 00:00:00 2001
From: Yousong Zhou <yszhou4tech@gmail.com>
Date: Fri, 20 Mar 2020 15:11:31 +0800
Subject: [PATCH] python: separate host/target python for cross-compile
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/Makefile.am b/Makefile.am
-index b279303d1..6140b2c7f 100644
+index 27ef9e4b4..7effb5fec 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -60,7 +60,7 @@ endif
ALL_LOCAL =
BUILT_SOURCES =
diff --git a/m4/openvswitch.m4 b/m4/openvswitch.m4
-index add3aabcc..ada31c491 100644
+index 6fe79297e..f2e0169f8 100644
--- a/m4/openvswitch.m4
+++ b/m4/openvswitch.m4
@@ -383,6 +383,8 @@ else:
-From 1c0697cb4b57e85deafc0d518b68e0b13ba2995b Mon Sep 17 00:00:00 2001
+From 444991b95ed25d58c3cd1646fa823620380b6ce6 Mon Sep 17 00:00:00 2001
From: Yousong Zhou <yszhou4tech@gmail.com>
Date: Wed, 14 Mar 2018 16:44:13 +0800
Subject: [PATCH] ovs-lib: fix install_dir()
-From 3ee8ab22699b503b591b6abb4a2db89ac1881ea6 Mon Sep 17 00:00:00 2001
+From 31514742de07d595ac23c2b0abf0e092f8b26140 Mon Sep 17 00:00:00 2001
From: Yousong Zhou <zhouyousong@yunionyun.com>
Date: Tue, 21 Aug 2018 13:02:21 +0000
Subject: [PATCH] build: trim build
1 file changed, 2 deletions(-)
diff --git a/Makefile.am b/Makefile.am
-index 6140b2c7f..d9f9457fa 100644
+index 7effb5fec..d6df91e8b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -475,12 +475,10 @@ dist-docs:
-From b2c26315339fc17d0ad9d0009321671850cc7295 Mon Sep 17 00:00:00 2001
+From 2939a31ad57f81556afdf5112ee1d68bd2e3f012 Mon Sep 17 00:00:00 2001
From: Yousong Zhou <yszhou4tech@gmail.com>
Date: Mon, 16 Mar 2020 15:18:16 +0800
Subject: [PATCH] datapath: unexport LDFLAGS
-From f29d4866cf566c916000426e0c206db008be4fb3 Mon Sep 17 00:00:00 2001
+From 1df5a0eaf78e93e21d21f1438afbe5fa8a37ea61 Mon Sep 17 00:00:00 2001
From: Yousong Zhou <yszhou4tech@gmail.com>
Date: Tue, 26 May 2020 22:45:53 +0800
Subject: [PATCH] datapath: allow passing additional $(OVS_KERNEL_MAKE_FLAGS)
--- /dev/null
+From e81ccb671014db62bf622cd8f960d7930d27d9dc Mon Sep 17 00:00:00 2001
+From: Yousong Zhou <yszhou4tech@gmail.com>
+Date: Wed, 29 Jul 2020 17:29:14 +0800
+Subject: [PATCH] build: only link libopenvswitch with libunwind, libunbound
+
+Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
+---
+ lib/automake.mk | 2 ++
+ lib/libopenvswitch.pc.in | 2 +-
+ m4/openvswitch.m4 | 6 ++++--
+ 3 files changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/lib/automake.mk b/lib/automake.mk
+index 380a67228..610f3d940 100644
+--- a/lib/automake.mk
++++ b/lib/automake.mk
+@@ -10,6 +10,8 @@ lib_LTLIBRARIES += lib/libopenvswitch.la
+ lib_libopenvswitch_la_LIBADD = $(SSL_LIBS)
+ lib_libopenvswitch_la_LIBADD += $(CAPNG_LDADD)
+ lib_libopenvswitch_la_LIBADD += $(LIBBPF_LDADD)
++lib_libopenvswitch_la_LIBADD += $(LIBUNBOUND_LDADD)
++lib_libopenvswitch_la_LIBADD += $(LIBUNWIND_LDADD)
+
+
+ if WIN32
+diff --git a/lib/libopenvswitch.pc.in b/lib/libopenvswitch.pc.in
+index 2a3f2ca7b..c8d02eb5a 100644
+--- a/lib/libopenvswitch.pc.in
++++ b/lib/libopenvswitch.pc.in
+@@ -7,5 +7,5 @@ Name: libopenvswitch
+ Description: Open vSwitch library
+ Version: @VERSION@
+ Libs: -L${libdir} -lopenvswitch
+-Libs.private: @LIBS@
++Libs.private: @LIBS@ @SSL_LIBS@ @CAPNG_LDADD@ @LIBBPF_LDADD@ @LIBUNBOUND_LDADD@ @LIBUNWIND_LDADD@
+ Cflags: -I${includedir}/openvswitch
+diff --git a/m4/openvswitch.m4 b/m4/openvswitch.m4
+index f2e0169f8..e000c1cc5 100644
+--- a/m4/openvswitch.m4
++++ b/m4/openvswitch.m4
+@@ -657,7 +657,8 @@ AC_DEFUN([OVS_CHECK_UNBOUND],
+ [AC_CHECK_LIB(unbound, ub_ctx_create, [HAVE_UNBOUND=yes], [HAVE_UNBOUND=no])
+ if test "$HAVE_UNBOUND" = yes; then
+ AC_DEFINE([HAVE_UNBOUND], [1], [Define to 1 if unbound is detected.])
+- LIBS="$LIBS -lunbound"
++ LIBUNBOUND_LDADD="-lunbound"
++ AC_SUBST(LIBUNBOUND_LDADD)
+ fi
+ AM_CONDITIONAL([HAVE_UNBOUND], [test "$HAVE_UNBOUND" = yes])
+ AC_SUBST([HAVE_UNBOUND])])
+@@ -669,7 +670,8 @@ AC_DEFUN([OVS_CHECK_UNWIND],
+ [HAVE_UNWIND=no])
+ if test "$HAVE_UNWIND" = yes; then
+ AC_DEFINE([HAVE_UNWIND], [1], [Define to 1 if unwind is detected.])
+- LIBS="$LIBS -lunwind"
++ LIBUNWIND_LDADD="-lunwind"
++ AC_SUBST(LIBUNWIND_LDADD)
+ fi
+ AM_CONDITIONAL([HAVE_UNWIND], [test "$HAVE_UNWIND" = yes])
+ AC_SUBST([HAVE_UNWIND])])
+++ /dev/null
-From 6324f0c594e3773c754861e630fff694d1bec15a Mon Sep 17 00:00:00 2001
-From: Yousong Zhou <yszhou4tech@gmail.com>
-Date: Wed, 29 Jul 2020 17:29:14 +0800
-Subject: [PATCH] build: only link libopenvswitch with libunwind, libunbound
-
-Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
----
- lib/automake.mk | 2 ++
- lib/libopenvswitch.pc.in | 2 +-
- m4/openvswitch.m4 | 6 ++++--
- 3 files changed, 7 insertions(+), 3 deletions(-)
-
-diff --git a/lib/automake.mk b/lib/automake.mk
-index 95925b57c..df95bea10 100644
---- a/lib/automake.mk
-+++ b/lib/automake.mk
-@@ -10,6 +10,8 @@ lib_LTLIBRARIES += lib/libopenvswitch.la
- lib_libopenvswitch_la_LIBADD = $(SSL_LIBS)
- lib_libopenvswitch_la_LIBADD += $(CAPNG_LDADD)
- lib_libopenvswitch_la_LIBADD += $(LIBBPF_LDADD)
-+lib_libopenvswitch_la_LIBADD += $(LIBUNBOUND_LDADD)
-+lib_libopenvswitch_la_LIBADD += $(LIBUNWIND_LDADD)
-
- if WIN32
- lib_libopenvswitch_la_LIBADD += ${PTHREAD_LIBS}
-diff --git a/lib/libopenvswitch.pc.in b/lib/libopenvswitch.pc.in
-index 2a3f2ca7b..c8d02eb5a 100644
---- a/lib/libopenvswitch.pc.in
-+++ b/lib/libopenvswitch.pc.in
-@@ -7,5 +7,5 @@ Name: libopenvswitch
- Description: Open vSwitch library
- Version: @VERSION@
- Libs: -L${libdir} -lopenvswitch
--Libs.private: @LIBS@
-+Libs.private: @LIBS@ @SSL_LIBS@ @CAPNG_LDADD@ @LIBBPF_LDADD@ @LIBUNBOUND_LDADD@ @LIBUNWIND_LDADD@
- Cflags: -I${includedir}/openvswitch
-diff --git a/m4/openvswitch.m4 b/m4/openvswitch.m4
-index ada31c491..6165cc7b1 100644
---- a/m4/openvswitch.m4
-+++ b/m4/openvswitch.m4
-@@ -623,7 +623,8 @@ AC_DEFUN([OVS_CHECK_UNBOUND],
- [AC_CHECK_LIB(unbound, ub_ctx_create, [HAVE_UNBOUND=yes], [HAVE_UNBOUND=no])
- if test "$HAVE_UNBOUND" = yes; then
- AC_DEFINE([HAVE_UNBOUND], [1], [Define to 1 if unbound is detected.])
-- LIBS="$LIBS -lunbound"
-+ LIBUNBOUND_LDADD="-lunbound"
-+ AC_SUBST(LIBUNBOUND_LDADD)
- fi
- AM_CONDITIONAL([HAVE_UNBOUND], [test "$HAVE_UNBOUND" = yes])
- AC_SUBST([HAVE_UNBOUND])])
-@@ -635,7 +636,8 @@ AC_DEFUN([OVS_CHECK_UNWIND],
- [HAVE_UNWIND=no])
- if test "$HAVE_UNWIND" = yes; then
- AC_DEFINE([HAVE_UNWIND], [1], [Define to 1 if unwind is detected.])
-- LIBS="$LIBS -lunwind"
-+ LIBUNWIND_LDADD="-lunwind"
-+ AC_SUBST(LIBUNWIND_LDADD)
- fi
- AM_CONDITIONAL([HAVE_UNWIND], [test "$HAVE_UNWIND" = yes])
- AC_SUBST([HAVE_UNWIND])])
+++ /dev/null
-From f639ec9b25b2758a07d214f7755f1ae0f764e949 Mon Sep 17 00:00:00 2001
-Message-Id: <f639ec9b25b2758a07d214f7755f1ae0f764e949.1597434688.git.mschiffer@universe-factory.net>
-From: Ilya Maximets <i.maximets@ovn.org>
-Date: Wed, 12 Aug 2020 10:57:07 +0200
-Subject: [PATCH] acinclude: Fix build with kernels with prandom* moved to
- prandom.h.
-
-Recent commit c0842fbc1b18 ("random32: move the pseudo-random 32-bit
-definitions to prandom.h") in upstream kernel moved the definition
-of prandom_* functions from random.h to prandom.h. This change was
-also backported to stable kernels.
-
-Fixing our configure script to look for these functions in a new
-location and avoid build failures:
-
- datapath/linux/compat/include/linux/random.h:11:19:
- error: redefinition of 'prandom_u32_max'
-
-Acked-by: Greg Rose <gvrose8192@gmail.com>
-Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
-(cherry picked from commit 0047ca3a0290f1ef954f2c76b31477cf4b9755f5)
----
- acinclude.m4 | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/acinclude.m4 b/acinclude.m4
-index b474422f52c8..7f028836f54c 100644
---- a/acinclude.m4
-+++ b/acinclude.m4
-@@ -781,6 +781,10 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
- [prandom_u32[[\(]]],
- [OVS_DEFINE([HAVE_PRANDOM_U32])])
- OVS_GREP_IFELSE([$KSRC/include/linux/random.h], [prandom_u32_max])
-+ OVS_GREP_IFELSE([$KSRC/include/linux/prandom.h],
-+ [prandom_u32[[\(]]],
-+ [OVS_DEFINE([HAVE_PRANDOM_U32])])
-+ OVS_GREP_IFELSE([$KSRC/include/linux/prandom.h], [prandom_u32_max])
-
- OVS_GREP_IFELSE([$KSRC/include/net/rtnetlink.h], [get_link_net])
- OVS_GREP_IFELSE([$KSRC/include/net/rtnetlink.h], [name_assign_type])
---
-2.28.0
-
include ../openvswitch/openvswitch.mk
PKG_NAME:=ovn
-PKG_VERSION:=20.06.1
-PKG_RELEASE:=3
+PKG_VERSION:=20.06.2
+PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/ovn-org/ovn.git
PKG_SOURCE_VERSION:=v$(PKG_VERSION)
-PKG_MIRROR_HASH:=046002c271fd29c496be53b5673a7ede6f381343bef49732e9bd17ed1454940e
+PKG_MIRROR_HASH:=1cab735f6712be90316183072b6cb8426237f12d2de0293bb80e9954b3502150
PKG_LICENSE:=Apache-2.0
PKG_LICENSE_FILES:=LICENSE
PKG_BUILD_DIR:=$(BUILD_DIR)/seahub-$(PKG_VERSION)-server
-HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:="Django~=1.11"
+HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:=Django-1.11
PKG_BUILD_PARALLEL:=0
PYTHON3_PKG_BUILD:=0
DJANGO_ADMIN_PY="$(STAGING_DIR_HOSTPKG)/bin/django-admin"
define Build/Compile
- $(call HostPython3/PipInstall,$(HOST_PYTHON3_PACKAGE_BUILD_DEPENDS))
+ $(call HostPython3/PipInstall,$(PYTHON3_PKG_HOST_PIP_INSTALL_ARGS))
$(call Build/Compile/Default,locale)
endef
PKG_NAME:=simple-adblock
PKG_VERSION:=1.8.3
-PKG_RELEASE:=13
+PKG_RELEASE:=15
PKG_MAINTAINER:=Stan Grishin <stangri@melmac.net>
PKG_LICENSE:=GPL-3.0-or-later
list blocked_domains_url 'https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt'
# File size: 12.0K
- list blocked_domains_url 'https://ssl.bblck.me/blacklists/domain-list.txt'
+ list blocked_domains_url 'https://cdn.jsdelivr.net/gh/paulgb/BarbBlock/blacklists/domain-list.txt'
# File size: 44.0K
list blocked_domains_url 'https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt'
s|blacklist_hosts_url|blocked_hosts_url|g
s|blacklist_domains_url|blocked_domains_url|g
s|blacklist_domain|blocked_domain|g
+s|ssl.bblck.me|cdn.jsdelivr.net/gh/paulgb/BarbBlock|g
s|dbl.oisd.nl|hosts.oisd.nl|g
s|raw.githubusercontent.com/StevenBlack/hosts/|cdn.jsdelivr.net/gh/StevenBlack/hosts@|g
s|raw.githubusercontent.com/hoshsadiq/adblock-nocoin-list/|cdn.jsdelivr.net/gh/hoshsadiq/adblock-nocoin-list@|g
. /lib/functions/network.sh
. /usr/share/libubox/jshn.sh
# Prefer curl because it supports the file:// scheme.
- if [ -x /usr/bin/curl ]; then
+ if command -v curl >/dev/null 2>&1; then
dl_command="curl --insecure --retry $curlRetry --connect-timeout $dlTimeout --silent"
dl_flag="-o"
- elif wget --version 2>/dev/null | grep -q "+https"; then
+ elif command -v wget >/dev/null 2>&1 && wget --version 2>/dev/null | grep -q "+https"; then
dl_command="wget --no-check-certificate --timeout $dlTimeout -q"
dl_flag="-O"
else
PKG_NAME:=sshtunnel
PKG_VERSION:=4
-PKG_RELEASE:=4
+PKG_RELEASE:=5
PKG_LICENSE:=GPL-2.0-or-later
PKG_MAINTAINER:=Nuno Goncalves <nunojpg@gmail.com>
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/sshtunnel.init $(1)/etc/init.d/sshtunnel
$(INSTALL_DIR) $(1)/etc/config
- $(INSTALL_DATA) ./files/uci_sshtunnel $(1)/etc/config/sshtunnel
+ $(INSTALL_CONF) ./files/uci_sshtunnel $(1)/etc/config/sshtunnel
endef
$(eval $(call BuildPackage,sshtunnel))
include $(TOPDIR)/rules.mk
PKG_NAME:=sysrepo
-PKG_VERSION:=1.4.58
+PKG_VERSION:=1.4.70
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/sysrepo/sysrepo/tar.gz/v$(PKG_VERSION)?
-PKG_HASH:=9c134658a5b812cd86b9113c30fc01be5a094616f473e747032ccf614af9e4dd
+PKG_HASH:=f0f894d4ed98ce9d20fda219378b844731d796e95115c07f4c067d853e20ca36
-PKG_MAINTAINER:=Mislav Novakovic <mislav.novakovic@sartura.hr>
+PKG_MAINTAINER:=Jakov Smolic <jakov.smolic@sartura.hr>
PKG_LICENSE:=Apache-2.0
PKG_LICENSE_FILES:=LICENSE
PKG_NAME:=tgt
PKG_VERSION:=1.0.79
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/fujita/tgt/tar.gz/v$(PKG_VERSION)?
--- /dev/null
+--- a/usr/iscsi/target.c
++++ b/usr/iscsi/target.c
+@@ -224,7 +224,7 @@ get_redirect_address(char *callback, char *buffer, int buflen,
+ {
+ char *p, *addr, *port;
+
+- bzero(buffer, buflen);
++ memset(buffer, 0, buflen);
+ if (call_program(callback, NULL, NULL, buffer, buflen, 0))
+ return -1;
+
PKG_NAME:=u2pnpd
PKG_VERSION:=0.5
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://github.com/mhei/u2pnpd/releases/download/v$(PKG_VERSION)
START=50
STOP=20
-
-SERVICE_DAEMONIZE=1
-SERVICE_PID_FILE=/var/run/u2pnpd.pid
-SERVICE_USE_PID=1
-SERVICE_WRITE_PID=1
+USE_PROCD=1
+
+append_arg() {
+ local cfg="$1"
+ local opt="$2"
+ local var="$3"
+ local def="$4"
+ local val
+ config_get val "$cfg" "$var"
+ [ -n "$val" ] || [ -n "$def" ] && procd_append_param command "$opt" "${val:-$def}"
+}
start_instance() {
- local section="$1"
+ local cfg="$1"
local enabled
- local interface manufacturer manufacturerURL modelDescription
- local modelName modelNumber modelURL serialNumber friendlyName
- local uuid httpsURL
- local i
- config_get_bool enabled "$section" 'enabled' 1
+ config_get_bool enabled "$cfg" 'enabled' 1
[ "$enabled" -gt 0 ] || return 0
- for i in interface httpsURL manufacturer manufacturerURL modelDescription \
- modelName modelNumber modelURL serialNumber friendlyName uuid; do
- config_get "$i" "$section" "$i"
- done
-
- [ -n "$interface" ] && SERVICE_PID_FILE="/var/run/u2pnpd.$interface.pid"
-
- service_start /usr/bin/u2pnpd ${httpsURL:+-s} \
- ${interface:+--interface="$interface"} \
- ${manufacturer:+--manufacturer="$manufacturer"} \
- ${manufacturerURL:+--manufacturerURL="$manufacturerURL"} \
- ${modelDescription:+--modelDescription="$modelDescription"} \
- ${modelName:+--modelName="$modelName"} \
- ${modelNumber:+--modelNumber="$modelNumber"} \
- ${modelURL:+--modelURL="$modelURL"} \
- ${serialNumber:+--serialNumber="$serialNumber"} \
- ${friendlyName:+--friendlyName="$friendlyName"} \
- ${uuid:+--uuid="$uuid"}
-}
-
-stop_instance() {
- local section="$1"
- local interface
-
- config_get interface "$section" 'interface'
- [ -n "$interface" ] && SERVICE_PID_FILE="/var/run/u2pnpd.$interface.pid"
-
- service_stop /usr/bin/u2pnpd
- rm -f "$SERVICE_PID_FILE"
+ procd_open_instance
+ procd_set_param command /usr/bin/u2pnpd
+ append_arg "$cfg" -s httpsURL
+ append_arg "$cfg" --interface interface
+ append_arg "$cfg" --manufacturer manufacturer
+ append_arg "$cfg" --manufacturerURL manufacturerURL
+ append_arg "$cfg" --modelDescription modelDescription
+ append_arg "$cfg" --modelName modelName
+ append_arg "$cfg" --modelNumber modelNumber
+ append_arg "$cfg" --modelURL modelURL
+ append_arg "$cfg" --serialNumber serialNumber
+ append_arg "$cfg" --friendlyName friendlyName
+ append_arg "$cfg" --uuid uuid
+ procd_set_param file /etc/config/u2pnpd
+ procd_set_param respawn
+ procd_close_instance
}
-start() {
- config_load 'u2pnpd'
- config_foreach start_instance 'u2pnpd'
+start_service() {
+ config_load u2pnpd && config_foreach start_instance u2pnpd
}
-stop() {
- config_load 'u2pnpd'
- config_foreach stop_instance 'u2pnpd'
+service_triggers() {
+ procd_add_reload_trigger u2pnpd
}
PKG_NAME:=mpd
PKG_VERSION:=0.21.25
-PKG_RELEASE:=3
+PKG_RELEASE:=4
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://www.musicpd.org/download/mpd/0.21/
TITLE:=Music Player Daemon
URL:=https://www.musicpd.org/
DEPENDS:= +zlib +libcurl +libpthread +libmpdclient +boost $(ICONV_DEPENDS) \
- +AUDIO_SUPPORT:alsa-lib +libexpat +libflac +libid3tag +libfaad2 +libopus
+ +AUDIO_SUPPORT:alsa-lib +libexpat +libflac +libid3tag +libfaad2 +libopus
endef
define Package/mpd/Default/description
define Package/mpd-full
$(call Package/mpd/Default)
TITLE+= (full)
- DEPENDS+= +BUILD_PATENTED:libffmpeg +libvorbis +libmms +libupnp +libshout +AUDIO_SUPPORT:pulseaudio-daemon +yajl
+ DEPENDS+= +AUDIO_SUPPORT:pulseaudio-daemon +libvorbis +libmms +libupnp +libshout +yajl \
+ +BUILD_PATENTED:libffmpeg +!BUILD_PATENTED:libmad
PROVIDES:=mpd
VARIANT:=full
endef
/etc/avahi/services/mpd.service
endef
-ifeq ($(CONFIG_AUDIO_SUPPORT),y)
- TARGET_LDFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib/pulseaudio
-endif
-
MESON_ARGS += \
-Ddocumentation=false \
-Dtest=false \
-Ddaemon=false \
-Dsystemd=disabled \
-Dtcp=true \
- -Dipv6=$(if $(CONFIG_IPV6),enabled,disabled) \
+ -Dipv6=$(if $(CONFIG_IPV6),en,dis)abled \
-Dlocal_socket=true \
-Ddsd=false \
-Ddatabase=true \
-Dzlib=enabled \
-Dzeroconf=disabled
-
ifeq ($(BUILD_VARIANT),full)
MESON_ARGS += \
-Dmms=enabled \
-Dsoundcloud=enabled \
-Dffmpeg=$(if $(CONFIG_BUILD_PATENTED),en,dis)abled \
- -Dmad=disabled \
+ -Dmad=$(if $(CONFIG_BUILD_PATENTED),dis,en)abled \
-Dtremor=disabled \
-Dvorbis=enabled \
-Dfifo=true \
-Drecorder=true \
-Dshout=enabled \
-Dyajl=enabled
+
+ifeq ($(CONFIG_AUDIO_SUPPORT),y)
+ TARGET_LDFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib/pulseaudio
+endif
endif
ifeq ($(BUILD_VARIANT),mini)
PKG_NAME:=mpg123
PKG_VERSION:=1.26.3
-PKG_RELEASE:=1
+PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@SF/mpg123
PKG_LICENSE_FILES:=COPYING
PKG_CPE_ID:=cpe:/a:mpg123:mpg123
+PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
-CMAKE_SOURCE_SUBDIR:=ports/cmake
include $(INCLUDE_DIR)/package.mk
-include $(INCLUDE_DIR)/cmake.mk
define Package/mpg123/Default
URL:=http://www.mpg123.de
DEPENDS+=+libmpg123 +alsa-lib +libout123 +libsyn123
endef
-CMAKE_OPTIONS += \
- -DBUILD_SHARED_LIBS=ON \
- -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
- -DNO_FEATURE_REPORT=ON \
- -DNO_LFS_ALIAS=ON
+CONFIGURE_ARGS += \
+ --enable-shared \
+ --enable-static \
+ --with-audio=alsa \
+ --with-default-audio=alsa
ifeq ($(CONFIG_SOFT_FLOAT),y)
- CMAKE_OPTIONS += \
- -DPLATFORM_DEFINITIONS="OPT_GENERIC" \
- -DACCURATE_ROUNDING=OFF
+ CONFIGURE_ARGS += \
+ --with-cpu=generic_nofpu \
+ --enable-int-quality=yes
+else ifneq ($(findstring 464fp,$(CONFIG_CPU_TYPE)),)
+ CONFIGURE_ARGS += \
+ --with-cpu=altivec
else ifneq ($(findstring neon,$(CONFIG_CPU_TYPE)),)
- CMAKE_OPTIONS += \
- -DPLATFORM_DEFINITIONS="OPT_MULTI OPT_GENERIC OPT_GENERIC_DITHER OPT_NEON"
+ CONFIGURE_ARGS += \
+ --with-cpu=arm_fpu
else ifneq ($(findstring aarch64,$(CONFIG_ARCH)),)
- CMAKE_OPTIONS += \
- -DPLATFORM_DEFINITIONS="OPT_MULTI OPT_GENERIC OPT_GENERIC_DITHER OPT_NEON64"
+ CONFIGURE_ARGS += \
+ --with-cpu=aarch64
else
- CMAKE_OPTIONS += \
- -DPLATFORM_DEFINITIONS="OPT_GENERIC"
+ CONFIGURE_ARGS += \
+ --with-cpu=generic_fpu
endif
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(INSTALL_DATA) \
+ $(PKG_INSTALL_DIR)/usr/include/fmt123.h \
$(PKG_INSTALL_DIR)/usr/include/mpg123.h \
$(PKG_INSTALL_DIR)/usr/include/out123.h \
$(PKG_INSTALL_DIR)/usr/include/syn123.h \
$(INSTALL_DIR) $(1)/usr/lib
$(CP) \
- $(PKG_INSTALL_DIR)/usr/lib/libmpg123.so \
- $(PKG_INSTALL_DIR)/usr/lib/libout123.so \
- $(PKG_INSTALL_DIR)/usr/lib/libsyn123.so \
+ $(PKG_INSTALL_DIR)/usr/lib/libmpg123.{la,a,so*} \
+ $(PKG_INSTALL_DIR)/usr/lib/libout123.{la,a,so*} \
+ $(PKG_INSTALL_DIR)/usr/lib/libsyn123.{la,a,so*} \
$(1)/usr/lib/
- $(INSTALL_DIR) $(1)/usr/lib/cmake/mpg123
- $(CP) \
- $(PKG_INSTALL_DIR)/usr/lib/cmake/mpg123/mpg123-config.cmake \
- $(PKG_INSTALL_DIR)/usr/lib/cmake/mpg123/mpg123-config-version.cmake \
- $(PKG_INSTALL_DIR)/usr/lib/cmake/mpg123/targets.cmake \
- $(PKG_INSTALL_DIR)/usr/lib/cmake/mpg123/targets-release.cmake \
- $(1)/usr/lib/cmake/mpg123
-
$(INSTALL_DIR) $(1)/usr/lib/mpg123
$(CP) \
- $(PKG_INSTALL_DIR)/usr/lib/mpg123/output_alsa.so \
+ $(PKG_INSTALL_DIR)/usr/lib/mpg123/output* \
$(1)/usr/lib/mpg123
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libout123.pc \
$(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libsyn123.pc \
$(1)/usr/lib/pkgconfig
- $(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/libmpg123.pc
- $(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/libmpg123.pc
- $(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/libout123.pc
- $(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/libout123.pc
- $(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/libsyn123.pc
- $(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/libsyn123.pc
endef
define Package/libmpg123/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) \
- $(PKG_INSTALL_DIR)/usr/lib/libmpg123.so* \
+ $(PKG_INSTALL_DIR)/usr/lib/libmpg123.so.* \
$(1)/usr/lib/
endef
define Package/libout123/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) \
- $(PKG_INSTALL_DIR)/usr/lib/libout123.so* \
+ $(PKG_INSTALL_DIR)/usr/lib/libout123.so.* \
$(1)/usr/lib/
endef
define Package/libsyn123/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) \
- $(PKG_INSTALL_DIR)/usr/lib/libsyn123.so* \
+ $(PKG_INSTALL_DIR)/usr/lib/libsyn123.so.* \
$(1)/usr/lib/
endef
$(INSTALL_DIR) $(1)/usr/lib/mpg123
$(CP) \
- $(PKG_INSTALL_DIR)/usr/lib/mpg123/* \
+ $(PKG_INSTALL_DIR)/usr/lib/mpg123/output_*.so \
$(1)/usr/lib/mpg123
endef
+++ /dev/null
---- a/ports/cmake/src/CMakeLists.txt
-+++ b/ports/cmake/src/CMakeLists.txt
-@@ -199,7 +199,7 @@ if(NOT CHECK_MODULES OR NOT COREAUDIO_REQUIRED EQUAL -1)
- endif()
- endif()
-
--find_package(PkgConfig)
-+#find_package(PkgConfig)
- if(PKG_CONFIG_FOUND)
- if(NOT CHECK_MODULES OR NOT PULSE_REQUIRED EQUAL -1)
- pkg_search_module(PULSE libpulse-simple)
PKG_NAME:=at
PKG_VERSION:=3.1.23
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz
PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/a/at
PKG_HASH:=97450aa954aaa8a70218cc8e61a33df9fee9f86527e9f861de302fb7a3c81710
+PKG_MAINTAINER:=Phil Eichinger <phil@zankapfel.net>
PKG_LICENSE:=GPL-2.0-or-later GPL-3.0-or-later ISC
PKG_LICENSE_FILES:=COPYING Copyright
-PKG_MAINTAINER:=Phil Eichinger <phil@zankapfel.net>
include $(INCLUDE_DIR)/package.mk
EXTRA_CFLAGS:=-DNEED_YYWRAP -I$(PKG_BUILD_DIR) \
$(TARGET_LDFLAGS)
-CONFIGURE_ARGS+=--prefix=/usr \
- --with-daemon_username=nobody \
- --with-daemon_groupname=nogroup \
- --with-jobdir=/var/spool/cron/atjobs \
- --with-atspool=/var/spool/cron/atspool
+CONFIGURE_ARGS+= \
+ --prefix=/usr \
+ --without-selinux \
+ --with-daemon_username=nobody \
+ --with-daemon_groupname=nogroup \
+ --with-jobdir=/var/spool/cron/atjobs \
+ --with-atspool=/var/spool/cron/atspool
CONFIGURE_VARS += \
ac_cv_header_security_pam_appl_h=no
PKG_LICENSE:=GPL-2.0-or-later
PKG_FIXUP:=autoreconf
-PKG_BUILD_PARALLEL:=1
+PKG_BUILD_PARALLEL:=0
include $(INCLUDE_DIR)/package.mk
PKG_NAME:=containerd
PKG_VERSION:=1.2.13
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_LICENSE:=Apache-2.0
PKG_LICENSE_FILES:=LICENSE
MAKE_PATH:=$(GO_PKG_WORK_DIR_NAME)/build/src/$(GO_PKG)
MAKE_VARS += $(GO_PKG_VARS)
MAKE_FLAGS += \
- DESTDIR="$(PKG_INSTALL_DIR)" \
VERSION=$(PKG_VERSION) \
REVISION=$(PKG_SOURCE_VERSION)
MAKE_FLAGS += BUILDTAGS=''
endif
-define Build/Compile
- $(call Build/Compile/Default)
-endef
-
-# Avoid installing binaries
-define Build/InstallDev
- $(call Build/Compile/Default,clean)
- rm -f $(STAMP_BUILT)
- $(call GoPackage/Build/InstallDev,$(1))
-endef
+# Reset golang-package.mk overrides so we can use the Makefile
+Build/Compile=$(call Build/Compile/Default)
define Package/containerd/install
$(INSTALL_DIR) $(1)/usr/bin/
include $(TOPDIR)/rules.mk
PKG_NAME:=coremark
-PKG_SOURCE_DATE:=2020-01-19
-PKG_SOURCE_VERSION:=0c91314d1a4fdfc157d623ad5cb6ac5aef746db1
+PKG_SOURCE_DATE:=2020-05-28
+PKG_SOURCE_VERSION:=7685fd32bd7919581bfff2881a6dac6320581400
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_DATE).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/eembc/coremark/tar.gz/$(PKG_SOURCE_VERSION)?
-PKG_HASH:=ed046fc8b4402090a9a4aaea14013489c3184617da493a70c7576da69efea8ba
+PKG_HASH:=ff7ee8b4d333893c1ea68616227b369581926d706c7df720b649e0a0631903a9
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_SOURCE_VERSION)
PKG_MAINTAINER:=Lim Guo Wei <limguowei@gmail.com>
Embedded Microprocessor Benchmark
endef
+DIR_ARCH:=linux$(if $(CONFIG_ARCH_64BIT),64)
+
define Build/Compile
- $(SED) 's|EXE = .exe|EXE =|' $(PKG_BUILD_DIR)/linux/core_portme.mak
+ $(SED) 's|EXE = .exe|EXE =|' $(PKG_BUILD_DIR)/$(DIR_ARCH)/core_portme.mak
mkdir $(PKG_BUILD_DIR)/$(ARCH)
- $(CP) -r $(PKG_BUILD_DIR)/linux/* $(PKG_BUILD_DIR)/$(ARCH)
+ $(CP) -r $(PKG_BUILD_DIR)/$(DIR_ARCH)/* $(PKG_BUILD_DIR)/$(ARCH)
$(MAKE) -C $(PKG_BUILD_DIR) PORT_DIR=$(ARCH) $(MAKE_FLAGS) \
compile
endef
PKG_NAME:=findutils
PKG_VERSION:=4.7.0
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
TITLE+= - locate and updatedb utility
endef
-CONFIGURE_ARGS += --localstatedir=/srv/var
+CONFIGURE_ARGS += \
+ --localstatedir=/srv/var \
+ --without-selinux
CONFIGURE_VARS += ac_cv_path_SORT=sort
define Package/findutils/install
PKG_NAME:=klish
PKG_VERSION:=2.2.0
-PKG_RELEASE:=1
+PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://libcode.org/attachments/download/77/
CONFIGURE_ARGS += --with-libxml2
-TARGET_CFLAGS += -D_XOPEN_SOURCE=500
+TARGET_CFLAGS += -D_GNU_SOURCE
define Package/klish/install
$(INSTALL_DIR) $(1)/usr/bin
--- a/clish/shell/shell_execute.c
+++ b/clish/shell/shell_execute.c
-@@ -19,13 +19,6 @@
+@@ -19,12 +19,14 @@
#include <signal.h>
#include <fcntl.h>
--/* Empty signal handler to ignore signal but don't use SIG_IGN. */
--static void sigignore(int signo)
--{
-- signo = signo; /* Happy compiler */
-- return;
--}
--
++#if defined(__UCLIBC__) && !defined(__UCLIBC_HAS_OBSOLETE_BSD_SIGNAL__)
+ /* Empty signal handler to ignore signal but don't use SIG_IGN. */
+ static void sigignore(int signo)
+ {
+ signo = signo; /* Happy compiler */
+ return;
+ }
++#endif
+
/*-------------------------------------------------------- */
static int clish_shell_lock(const char *lock_path)
- {
include $(TOPDIR)/rules.mk
PKG_NAME:=libnetwork
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_LICENSE:=Apache-2.0
PKG_LICENSE_FILES:=LICENSE
-GO_PKG:=github.com/docker/libnetwork
-GO_PKG_BUILD_PKG:= \
- $(GO_PKG)/cmd/proxy \
- $(GO_PKG)/cmd/dnet
-
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://$(GO_PKG)
PKG_SOURCE_VERSION:=026aabaa659832804b01754aaadd2c0f420c68b6
PKG_BUILD_DEPENDS:=golang/host
PKG_BUILD_PARALLEL:=1
+GO_PKG:=github.com/docker/libnetwork
+GO_PKG_BUILD_PKG:= \
+ $(GO_PKG)/cmd/proxy \
+ $(GO_PKG)/cmd/dnet
+
include $(INCLUDE_DIR)/package.mk
include ../../lang/golang/golang-package.mk
PKG_NAME:=logrotate
PKG_VERSION:=3.16.0
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://github.com/logrotate/logrotate/releases/download/$(PKG_VERSION)
/etc/logrotate.conf
endef
-CONFIGURE_ARGS += $(if $(CONFIG_LOGROTATE_ACL),--with,--without)-acl
+CONFIGURE_ARGS += \
+ $(if $(CONFIG_LOGROTATE_ACL),--with,--without)-acl \
+ --without-selinux
define Build/Compile
$(call Build/Compile/Default, \
include $(TOPDIR)/rules.mk
PKG_NAME:=rng-tools
-PKG_VERSION:=6.7
+PKG_VERSION:=6.10
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/nhorman/rng-tools
PKG_SOURCE_VERSION:=v$(PKG_VERSION)
-PKG_MIRROR_HASH:=05cb68b8600025f362ea0875f5966b60f8195f91ed89b431996a48cd88b1e5b0
+PKG_MIRROR_HASH:=853341a3be05164616ba11a8cf983847477e02d6d43a259fc2352dbec262d649
PKG_MAINTAINER:=Nathaniel Wesley Filardo <nwfilardo@gmail.com>
PKG_LICENSE:=GPL-2.0-or-later
CATEGORY:=Utilities
TITLE:=Daemon for adding entropy to kernel entropy pool
URL:=https://github.com/nhorman/rng-tools
- DEPENDS:=+libsysfs
+ DEPENDS:=+libsysfs +libopenssl
endef
define Package/rng-tools/description
endef
CONFIGURE_ARGS += \
- --without-libgcrypt \
--without-nistbeacon \
- --without-pkcs11
+ --without-pkcs11 \
+ --without-rtlsdr
ifndef CONFIG_USE_GLIBC
CONFIGURE_VARS += LIBS="-largp"
PKG_NAME:=runc
PKG_VERSION:=1.0.0-rc10
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_LICENSE:=Apache-2.0
PKG_LICENSE_FILES:=LICENSE
PKG_BUILD_DEPENDS:=golang/host
PKG_BUILD_PARALLEL:=1
+PKG_INSTALL:=1
PKG_USE_MIPS16:=0
GO_PKG:=github.com/opencontainers/runc
GO_PKG_INSTALL_ALL:=1
MAKE_PATH:=$(GO_PKG_WORK_DIR_NAME)/build/src/$(GO_PKG)
MAKE_VARS += $(GO_PKG_VARS)
-MAKE_FLAGS += \
- COMMIT=$(PKG_SOURCE_VERSION)
+MAKE_FLAGS += COMMIT=$(PKG_SOURCE_VERSION)
ifeq ($(ARCH),mips)
MAKE_FLAGS += EXTRA_FLAGS='-buildmode=default'
MAKE_FLAGS += BUILDTAGS=''
endif
-define Build/Compile
- $(call Build/Compile/Default)
-endef
-
-# Avoid installing binaries
-define Build/InstallDev
- $(call Build/Compile/Default,clean)
- rm -f $(STAMP_BUILT)
- $(call GoPackage/Build/InstallDev,$(1))
-endef
+# Reset golang-package.mk overrides so we can use the Makefile
+Build/Compile=$(call Build/Compile/Default)
define Package/runc/install
$(INSTALL_DIR) $(1)/usr/sbin/
PKG_NAME:=sed
PKG_VERSION:=4.8
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/sed
occurrences of a string within a file.
endef
+CONFIGURE_ARGS += \
+ --disable-acl \
+ --without-selinux
+
define Package/sed/install
$(INSTALL_DIR) $(1)/usr/libexec
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sed $(1)/usr/libexec/sed-gnu
endef
-CONFIGURE_ARGS+= --disable-acl
-
$(eval $(call BuildPackage,sed))
include $(TOPDIR)/rules.mk
PKG_NAME:=sc
-PKG_VERSION:=0.95
+PKG_VERSION:=1.0
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/serialconsole/sc
-PKG_HASH:=5ae99b370a5a3feb38372b383edc23012b5be5d81547aeb1ac52b408037c1d1c
+PKG_HASH:=2e7a27d588a51173dda3093381604e6f0a16bb04e95b00fd652f37c34c2c6d04
+
PKG_MAINTAINER:=Stefan Bethke <stb@lassitu.de>
+PKG_LICENSE:=BSD-2-Clause
+PKG_LICENSE_FILES:=LICENSE
-PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
define Package/serialconsole/install
$(INSTALL_DIR) $(1)/usr/bin
- $(INSTALL_BIN) $(PKG_BUILD_DIR)/sc $(1)/usr/bin/
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/local/bin/sc $(1)/usr/bin/
endef
$(eval $(call BuildPackage,serialconsole))
PKG_NAME:=stress
PKG_VERSION:=1.0.4
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://fossies.org/linux/privat
--- /dev/null
+--- a/src/stress.c
++++ b/src/stress.c
+@@ -262,6 +262,7 @@ main (int argc, char **argv)
+
+ /* Calculate the backoff value so we get good fork throughput. */
+ backoff = do_backoff * forks;
++ struct timespec b = {backoff / 1000000, (backoff % 1000000) * 1000};
+ dbg (stdout, "using backoff sleep of %llius\n", backoff);
+
+ /* If we are supposed to respect a timeout, calculate it. */
+@@ -296,7 +297,7 @@ main (int argc, char **argv)
+ {
+ case 0: /* child */
+ alarm (timeout);
+- usleep (backoff);
++ nanosleep(&b, NULL);
+ if (do_dryrun)
+ exit (0);
+ exit (hogcpu ());
+@@ -317,7 +318,7 @@ main (int argc, char **argv)
+ {
+ case 0: /* child */
+ alarm (timeout);
+- usleep (backoff);
++ nanosleep(&b,&b);
+ if (do_dryrun)
+ exit (0);
+ exit (hogio ());
+@@ -337,7 +338,7 @@ main (int argc, char **argv)
+ {
+ case 0: /* child */
+ alarm (timeout);
+- usleep (backoff);
++ nanosleep(&b, &b);
+ if (do_dryrun)
+ exit (0);
+ exit (hogvm
+@@ -358,7 +359,7 @@ main (int argc, char **argv)
+ {
+ case 0: /* child */
+ alarm (timeout);
+- usleep (backoff);
++ nanosleep(&b, &b);
+ if (do_dryrun)
+ exit (0);
+ exit (hoghdd (do_hdd_bytes));
include $(TOPDIR)/rules.mk
PKG_NAME:=sysstat
-PKG_VERSION:=12.2.2
-PKG_RELEASE:=1
+PKG_VERSION:=12.4.0
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://pagesperso-orange.fr/sebastien.godard/
-PKG_HASH:=78388b64acec81378b962e66b40e57acd4b18ff17a849bc9308f95d290248c9c
+PKG_HASH:=78556c339795ecd07eb10ee09e3f5d52901d3a29f874ae92b45efd0de7b62d16
PKG_MAINTAINER:=Marko Ratkaj <marko.ratkaj@sartura.hr>
PKG_LICENSE:=GPL-2.0-or-later
PKG_LICENSE_FILES:=COPYING
PKG_CPE_ID:=cpe:/a:sysstat_project:sysstat
+PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
--- /dev/null
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -80,7 +80,7 @@ SYSCONFIG_FILE = @SYSCONFIG_FILE@
+ # Compiler flags
+ CFLAGS = @CFLAGS@ -Wall -Wstrict-prototypes -pipe -O2
+ DFLAGS = @DFLAGS@
+-LFLAGS = @STRIP@
++LDFLAGS += @STRIP@
+ DFLAGS += -DSA_DIR=\"$(SA_DIR)\" -DSADC_PATH=\"$(SADC_PATH)\"
+ DFLAGS += $(DFSENSORS)
+ DFLAGS += $(DFPCP)
+@@ -117,7 +117,7 @@ ifeq ($(SYSPARAM),y)
+ DFLAGS += -DHAVE_SYS_PARAM_H
+ endif
+ NLS = @NLS@
+-LFLAGS += @LFINTL@
++LDFLAGS += @LFINTL@
+ ifeq ($(NLS),y)
+ REQUIRE_NLS = -DUSE_NLS -DPACKAGE=\"$(PACKAGE)\" -DLOCALEDIR=\"$(NLS_DIR)\"
+ endif
+@@ -195,7 +195,7 @@ NLSPOT= $(NLSPO:.po=.pot)
+ $(CC) -o $@ -c $(CFLAGS) $(DFLAGS) $<
+
+ % : %.o
+- $(CC) -o $@ $(CFLAGS) $^ $(LFLAGS)
++ $(CC) -o $@ $(CFLAGS) $^ $(LDFLAGS)
+
+ all: sadc sar sadf iostat tapestat mpstat pidstat cifsiostat locales
+
+@@ -283,7 +283,7 @@ librdsensors.a: rd_sensors.o
+
+ sadc.o: sadc.c sa.h version.h common.h rd_stats.h rd_sensors.h
+
+-sadc: LFLAGS += $(LFSENSORS)
++sadc: LDFLAGS += $(LFSENSORS)
+
+ sadc: sadc.o act_sadc.o sa_wrap.o sa_common_sadc.o common_sadc.o systest.o librdstats.a librdsensors.a
+
+@@ -293,7 +293,7 @@ sar: sar.o act_sar.o format_sar.o sa_common.o pr_stats.o librdstats_light.a libs
+
+ sadf.o: sadf.c sadf.h version.h sa.h common.h rd_stats.h rd_sensors.h
+
+-sadf: LFLAGS += $(LFPCP)
++sadf: LDFLAGS += $(LFPCP)
+
+ sadf: sadf.o act_sadf.o format_sadf.o sadf_misc.o pcp_def_metrics.o sa_conv.o rndr_stats.o xml_stats.o json_stats.o svg_stats.o raw_stats.o pcp_stats.o sa_common.o librdstats_light.a libsyscom.a
+
PKG_NAME:=vim
PKG_VERSION:=8.2
-PKG_RELEASE:=1
+PKG_RELEASE:=2
VIMVER:=82
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
--disable-cscope \
--disable-gpm \
--disable-acl \
+ --disable-selinux \
--with-tlib=ncurses \
--with-compiledby="non-existent-hostname-compiled"