From fa77633af7b579c6b745ae2a0888a2188610b809 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Rozie=CC=80re?= Date: Wed, 17 Jan 2018 11:15:34 +0100 Subject: [PATCH 01/12] Move directory --- CMakeLists.txt | 16 +- main.cpp | 6 - src/libs/DSPatch/CMakeCache.txt | 331 +++ .../CMakeFiles/3.10.1/CMakeCCompiler.cmake | 73 + .../CMakeFiles/3.10.1/CMakeCXXCompiler.cmake | 75 + .../3.10.1/CMakeDetermineCompilerABI_C.bin | Bin 0 -> 4304 bytes .../3.10.1/CMakeDetermineCompilerABI_CXX.bin | Bin 0 -> 4288 bytes .../CMakeFiles/3.10.1/CMakeSystem.cmake | 15 + .../3.10.1/CompilerIdC/CMakeCCompilerId.c | 598 ++++++ .../CompilerIdCXX/CMakeCXXCompilerId.cpp | 576 ++++++ .../CMakeDirectoryInformation.cmake | 16 + src/libs/DSPatch/CMakeFiles/CMakeOutput.log | 528 +++++ .../CMakeFiles/DSPatch.dir/CXX.includecache | 184 ++ .../CMakeFiles/DSPatch.dir/DependInfo.cmake | 31 + .../DSPatch/CMakeFiles/DSPatch.dir/build.make | 383 ++++ .../CMakeFiles/DSPatch.dir/cmake_clean.cmake | 20 + .../CMakeFiles/DSPatch.dir/depend.internal | 155 ++ .../CMakeFiles/DSPatch.dir/depend.make | 155 ++ .../DSPatch/CMakeFiles/DSPatch.dir/flags.make | 10 + .../DSPatch/CMakeFiles/DSPatch.dir/link.txt | 1 + .../CMakeFiles/DSPatch.dir/progress.make | 13 + src/libs/DSPatch/CMakeFiles/Makefile.cmake | 122 ++ src/libs/DSPatch/CMakeFiles/Makefile2 | 108 + .../DSPatch/CMakeFiles/TargetDirectories.txt | 7 + src/libs/DSPatch/CMakeFiles/cmake.check_cache | 1 + src/libs/DSPatch/CMakeFiles/feature_tests.bin | Bin 0 -> 8376 bytes src/libs/DSPatch/CMakeFiles/feature_tests.c | 34 + src/libs/DSPatch/CMakeFiles/feature_tests.cxx | 405 ++++ src/libs/DSPatch/CMakeFiles/progress.marks | 1 + src/libs/DSPatch/CMakeLists.txt | 71 + src/libs/DSPatch/LGPLv3.txt | 165 ++ src/libs/DSPatch/Makefile | 528 +++++ src/libs/DSPatch/build.sh | 17 + src/libs/DSPatch/cmake_install.cmake | 82 + src/libs/DSPatch/doc/CMakeLists.txt | 12 + src/libs/DSPatch/doc/Doxyfile | 1835 +++++++++++++++++ src/libs/DSPatch/doc/heartbeat.png | Bin 0 -> 10339 bytes src/libs/DSPatch/include/DSPatch.h | 641 ++++++ src/libs/DSPatch/include/dspatch/DspCircuit.h | 321 +++ .../include/dspatch/DspCircuitThread.h | 89 + .../DSPatch/include/dspatch/DspComponent.h | 282 +++ .../include/dspatch/DspComponentThread.h | 72 + .../DSPatch/include/dspatch/DspParameter.h | 111 + src/libs/DSPatch/include/dspatch/DspPlugin.h | 95 + .../DSPatch/include/dspatch/DspPluginLoader.h | 75 + src/libs/DSPatch/include/dspatch/DspRunType.h | 204 ++ src/libs/DSPatch/include/dspatch/DspSignal.h | 130 ++ .../DSPatch/include/dspatch/DspSignalBus.h | 192 ++ src/libs/DSPatch/include/dspatch/DspThread.h | 45 + .../DSPatch/include/dspatch/DspThreadNull.h | 135 ++ .../DSPatch/include/dspatch/DspThreadUnix.h | 177 ++ .../DSPatch/include/dspatch/DspThreadWin.h | 178 ++ src/libs/DSPatch/include/dspatch/DspWire.h | 58 + src/libs/DSPatch/include/dspatch/DspWireBus.h | 71 + src/libs/DSPatch/index.html | 5 + src/libs/DSPatch/install.sh | 13 + src/libs/DSPatch/install_manifest.txt | 18 + src/libs/DSPatch/src/DSPatch.cpp | 115 ++ src/libs/DSPatch/src/DspCircuit.cpp | 462 +++++ src/libs/DSPatch/src/DspCircuitThread.cpp | 152 ++ src/libs/DSPatch/src/DspComponent.cpp | 847 ++++++++ src/libs/DSPatch/src/DspComponentThread.cpp | 137 ++ src/libs/DSPatch/src/DspParameter.cpp | 473 +++++ src/libs/DSPatch/src/DspPlugin.cpp | 33 + src/libs/DSPatch/src/DspPluginLoader.cpp | 146 ++ src/libs/DSPatch/src/DspSignal.cpp | 85 + src/libs/DSPatch/src/DspSignalBus.cpp | 203 ++ src/libs/DSPatch/src/DspWireBus.cpp | 138 ++ src/mockDataSimulator/CMakeLists.txt | 2 + src/mockDataSimulator/MockSensor.cpp | 42 + src/mockDataSimulator/MockSensor.h | 29 + src/mockDataSimulator/main.cpp | 38 + src/orchestra/CMakeLists.txt | 9 + .../component/OrchAdderComponent.cpp | 23 + src/orchestra/component/OrchAdderComponent.h | 22 + .../component/OrchStreamReaderComponent.cpp | 21 + .../component/OrchStreamReaderComponent.h | 25 + .../component/OrchStreamWriterComponent.cpp | 19 + .../component/OrchStreamWriterComponent.h | 26 + src/orchestra/component/OrchSumComponent.cpp | 23 + src/orchestra/component/OrchSumComponent.h | 25 + src/orchestra/main.cpp | 39 + 82 files changed, 12611 insertions(+), 9 deletions(-) delete mode 100644 main.cpp create mode 100644 src/libs/DSPatch/CMakeCache.txt create mode 100644 src/libs/DSPatch/CMakeFiles/3.10.1/CMakeCCompiler.cmake create mode 100644 src/libs/DSPatch/CMakeFiles/3.10.1/CMakeCXXCompiler.cmake create mode 100755 src/libs/DSPatch/CMakeFiles/3.10.1/CMakeDetermineCompilerABI_C.bin create mode 100755 src/libs/DSPatch/CMakeFiles/3.10.1/CMakeDetermineCompilerABI_CXX.bin create mode 100644 src/libs/DSPatch/CMakeFiles/3.10.1/CMakeSystem.cmake create mode 100644 src/libs/DSPatch/CMakeFiles/3.10.1/CompilerIdC/CMakeCCompilerId.c create mode 100644 src/libs/DSPatch/CMakeFiles/3.10.1/CompilerIdCXX/CMakeCXXCompilerId.cpp create mode 100644 src/libs/DSPatch/CMakeFiles/CMakeDirectoryInformation.cmake create mode 100644 src/libs/DSPatch/CMakeFiles/CMakeOutput.log create mode 100644 src/libs/DSPatch/CMakeFiles/DSPatch.dir/CXX.includecache create mode 100644 src/libs/DSPatch/CMakeFiles/DSPatch.dir/DependInfo.cmake create mode 100644 src/libs/DSPatch/CMakeFiles/DSPatch.dir/build.make create mode 100644 src/libs/DSPatch/CMakeFiles/DSPatch.dir/cmake_clean.cmake create mode 100644 src/libs/DSPatch/CMakeFiles/DSPatch.dir/depend.internal create mode 100644 src/libs/DSPatch/CMakeFiles/DSPatch.dir/depend.make create mode 100644 src/libs/DSPatch/CMakeFiles/DSPatch.dir/flags.make create mode 100644 src/libs/DSPatch/CMakeFiles/DSPatch.dir/link.txt create mode 100644 src/libs/DSPatch/CMakeFiles/DSPatch.dir/progress.make create mode 100644 src/libs/DSPatch/CMakeFiles/Makefile.cmake create mode 100644 src/libs/DSPatch/CMakeFiles/Makefile2 create mode 100644 src/libs/DSPatch/CMakeFiles/TargetDirectories.txt create mode 100644 src/libs/DSPatch/CMakeFiles/cmake.check_cache create mode 100755 src/libs/DSPatch/CMakeFiles/feature_tests.bin create mode 100644 src/libs/DSPatch/CMakeFiles/feature_tests.c create mode 100644 src/libs/DSPatch/CMakeFiles/feature_tests.cxx create mode 100644 src/libs/DSPatch/CMakeFiles/progress.marks create mode 100755 src/libs/DSPatch/CMakeLists.txt create mode 100755 src/libs/DSPatch/LGPLv3.txt create mode 100644 src/libs/DSPatch/Makefile create mode 100755 src/libs/DSPatch/build.sh create mode 100644 src/libs/DSPatch/cmake_install.cmake create mode 100755 src/libs/DSPatch/doc/CMakeLists.txt create mode 100755 src/libs/DSPatch/doc/Doxyfile create mode 100755 src/libs/DSPatch/doc/heartbeat.png create mode 100755 src/libs/DSPatch/include/DSPatch.h create mode 100755 src/libs/DSPatch/include/dspatch/DspCircuit.h create mode 100755 src/libs/DSPatch/include/dspatch/DspCircuitThread.h create mode 100755 src/libs/DSPatch/include/dspatch/DspComponent.h create mode 100755 src/libs/DSPatch/include/dspatch/DspComponentThread.h create mode 100755 src/libs/DSPatch/include/dspatch/DspParameter.h create mode 100755 src/libs/DSPatch/include/dspatch/DspPlugin.h create mode 100755 src/libs/DSPatch/include/dspatch/DspPluginLoader.h create mode 100755 src/libs/DSPatch/include/dspatch/DspRunType.h create mode 100755 src/libs/DSPatch/include/dspatch/DspSignal.h create mode 100755 src/libs/DSPatch/include/dspatch/DspSignalBus.h create mode 100755 src/libs/DSPatch/include/dspatch/DspThread.h create mode 100755 src/libs/DSPatch/include/dspatch/DspThreadNull.h create mode 100755 src/libs/DSPatch/include/dspatch/DspThreadUnix.h create mode 100755 src/libs/DSPatch/include/dspatch/DspThreadWin.h create mode 100755 src/libs/DSPatch/include/dspatch/DspWire.h create mode 100755 src/libs/DSPatch/include/dspatch/DspWireBus.h create mode 100755 src/libs/DSPatch/index.html create mode 100755 src/libs/DSPatch/install.sh create mode 100644 src/libs/DSPatch/install_manifest.txt create mode 100755 src/libs/DSPatch/src/DSPatch.cpp create mode 100755 src/libs/DSPatch/src/DspCircuit.cpp create mode 100755 src/libs/DSPatch/src/DspCircuitThread.cpp create mode 100755 src/libs/DSPatch/src/DspComponent.cpp create mode 100755 src/libs/DSPatch/src/DspComponentThread.cpp create mode 100755 src/libs/DSPatch/src/DspParameter.cpp create mode 100755 src/libs/DSPatch/src/DspPlugin.cpp create mode 100755 src/libs/DSPatch/src/DspPluginLoader.cpp create mode 100755 src/libs/DSPatch/src/DspSignal.cpp create mode 100755 src/libs/DSPatch/src/DspSignalBus.cpp create mode 100755 src/libs/DSPatch/src/DspWireBus.cpp create mode 100644 src/mockDataSimulator/CMakeLists.txt create mode 100644 src/mockDataSimulator/MockSensor.cpp create mode 100644 src/mockDataSimulator/MockSensor.h create mode 100644 src/mockDataSimulator/main.cpp create mode 100644 src/orchestra/CMakeLists.txt create mode 100644 src/orchestra/component/OrchAdderComponent.cpp create mode 100644 src/orchestra/component/OrchAdderComponent.h create mode 100644 src/orchestra/component/OrchStreamReaderComponent.cpp create mode 100644 src/orchestra/component/OrchStreamReaderComponent.h create mode 100644 src/orchestra/component/OrchStreamWriterComponent.cpp create mode 100644 src/orchestra/component/OrchStreamWriterComponent.h create mode 100644 src/orchestra/component/OrchSumComponent.cpp create mode 100644 src/orchestra/component/OrchSumComponent.h create mode 100644 src/orchestra/main.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 79dec7b..66c8b72 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,17 @@ cmake_minimum_required(VERSION 3.8) -project(orchestra) +project(orchestra VERSION 0.1 LANGUAGES CXX) set(CMAKE_CXX_STANDARD 11) -set(SOURCE_FILES main.cpp) -add_executable(orchestra ${SOURCE_FILES}) \ No newline at end of file +macro(ADD_SUBLIB libname) + file(GLOB sublib_sources "src/libs/${libname}/src/*.cpp") + add_library(${libname} SHARED ${sublib_sources}) + include_directories("src/libs/${libname}/include") +endmacro(ADD_SUBLIB) + +ADD_SUBLIB(DSPatch) + +add_subdirectory(src/orchestra) + +add_subdirectory(src/mockDataSimulator) + diff --git a/main.cpp b/main.cpp deleted file mode 100644 index f253cbe..0000000 --- a/main.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include - -int main() { - std::cout << "Hello, World!" << std::endl; - return 0; -} \ No newline at end of file diff --git a/src/libs/DSPatch/CMakeCache.txt b/src/libs/DSPatch/CMakeCache.txt new file mode 100644 index 0000000..85a77ef --- /dev/null +++ b/src/libs/DSPatch/CMakeCache.txt @@ -0,0 +1,331 @@ +# This is the CMakeCache file. +# For build in directory: /Users/benjamin/orchestra/src/libs/DSPatch +# It was generated by CMake: /usr/local/Cellar/cmake/3.10.1/bin/cmake +# You can edit this file to change values found and used by cmake. +# If you do not want to change any of the values, simply exit the editor. +# If you do want to change a value, simply edit, save, and exit the editor. +# The syntax for the file is as follows: +# KEY:TYPE=VALUE +# KEY is the name of a variable in the cache. +# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!. +# VALUE is the current value for the KEY. + +######################## +# EXTERNAL cache entries +######################## + +//Build Documentation +BUILD_DOC:BOOL=OFF + +//Build Examples +BUILD_EXAMPLES:BOOL=OFF + +//Path to a program. +CMAKE_AR:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar + +//Choose the type of build, options are: None(CMAKE_CXX_FLAGS or +// CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel. +CMAKE_BUILD_TYPE:STRING= + +//Enable/Disable color output during build. +CMAKE_COLOR_MAKEFILE:BOOL=ON + +//CXX compiler +CMAKE_CXX_COMPILER:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ + +//Flags used by the compiler during all build types. +CMAKE_CXX_FLAGS:STRING= + +//Flags used by the compiler during debug builds. +CMAKE_CXX_FLAGS_DEBUG:STRING=-g + +//Flags used by the compiler during release builds for minimum +// size. +CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG + +//Flags used by the compiler during release builds. +CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG + +//Flags used by the compiler during release builds with debug info. +CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG + +//C compiler +CMAKE_C_COMPILER:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc + +//Flags used by the compiler during all build types. +CMAKE_C_FLAGS:STRING= + +//Flags used by the compiler during debug builds. +CMAKE_C_FLAGS_DEBUG:STRING=-g + +//Flags used by the compiler during release builds for minimum +// size. +CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG + +//Flags used by the compiler during release builds. +CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG + +//Flags used by the compiler during release builds with debug info. +CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG + +//Flags used by the linker. +CMAKE_EXE_LINKER_FLAGS:STRING= + +//Flags used by the linker during debug builds. +CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during release minsize builds. +CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during release builds. +CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during Release with Debug Info builds. +CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Enable/Disable output of compile commands during generation. +CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=OFF + +//Path to a program. +CMAKE_INSTALL_NAME_TOOL:FILEPATH=/usr/bin/install_name_tool + +//Install path prefix, prepended onto install directories. +CMAKE_INSTALL_PREFIX:PATH=/usr/local + +//Path to a program. +CMAKE_LINKER:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld + +//Path to a program. +CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make + +//Flags used by the linker during the creation of modules. +CMAKE_MODULE_LINKER_FLAGS:STRING= + +//Flags used by the linker during debug builds. +CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during release minsize builds. +CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during release builds. +CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during Release with Debug Info builds. +CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Path to a program. +CMAKE_NM:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm + +//Path to a program. +CMAKE_OBJCOPY:FILEPATH=CMAKE_OBJCOPY-NOTFOUND + +//Path to a program. +CMAKE_OBJDUMP:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/objdump + +//Build architectures for OSX +CMAKE_OSX_ARCHITECTURES:STRING= + +//Minimum OS X version to target for deployment (at runtime); newer +// APIs weak linked. Set to empty string for default value. +CMAKE_OSX_DEPLOYMENT_TARGET:STRING= + +//The product will be built against the headers and libraries located +// inside the indicated SDK. +CMAKE_OSX_SYSROOT:PATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk + +//Value Computed by CMake +CMAKE_PROJECT_NAME:STATIC=DSPatch + +//Path to a program. +CMAKE_RANLIB:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib + +//Flags used by the linker during the creation of dll's. +CMAKE_SHARED_LINKER_FLAGS:STRING= + +//Flags used by the linker during debug builds. +CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during release minsize builds. +CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during release builds. +CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during Release with Debug Info builds. +CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//If set, runtime paths are not added when installing shared libraries, +// but are added when building. +CMAKE_SKIP_INSTALL_RPATH:BOOL=NO + +//If set, runtime paths are not added when using shared libraries. +CMAKE_SKIP_RPATH:BOOL=NO + +//Flags used by the linker during the creation of static libraries. +CMAKE_STATIC_LINKER_FLAGS:STRING= + +//Flags used by the linker during debug builds. +CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during release minsize builds. +CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during release builds. +CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during Release with Debug Info builds. +CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Path to a program. +CMAKE_STRIP:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip + +//If this value is on, makefiles will be generated without the +// .SILENT directive, and all commands will be echoed to the console +// during the make. This is useful for debugging only. With Visual +// Studio IDE projects all commands are done without /nologo. +CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE + +//Value Computed by CMake +DSPatch_BINARY_DIR:STATIC=/Users/benjamin/orchestra/src/libs/DSPatch + +//Dependencies for the target +DSPatch_LIB_DEPENDS:STATIC=general;-static-libstdc++;general;pthread;general;dl; + +//Value Computed by CMake +DSPatch_SOURCE_DIR:STATIC=/Users/benjamin/orchestra/src/libs/DSPatch + + +######################## +# INTERNAL cache entries +######################## + +//ADVANCED property for variable: CMAKE_AR +CMAKE_AR-ADVANCED:INTERNAL=1 +//This is the directory where this CMakeCache.txt was created +CMAKE_CACHEFILE_DIR:INTERNAL=/Users/benjamin/orchestra/src/libs/DSPatch +//Major version of cmake used to create the current loaded cache +CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3 +//Minor version of cmake used to create the current loaded cache +CMAKE_CACHE_MINOR_VERSION:INTERNAL=10 +//Patch version of cmake used to create the current loaded cache +CMAKE_CACHE_PATCH_VERSION:INTERNAL=1 +//ADVANCED property for variable: CMAKE_COLOR_MAKEFILE +CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1 +//Path to CMake executable. +CMAKE_COMMAND:INTERNAL=/usr/local/Cellar/cmake/3.10.1/bin/cmake +//Path to cpack program executable. +CMAKE_CPACK_COMMAND:INTERNAL=/usr/local/Cellar/cmake/3.10.1/bin/cpack +//Path to ctest program executable. +CMAKE_CTEST_COMMAND:INTERNAL=/usr/local/Cellar/cmake/3.10.1/bin/ctest +//ADVANCED property for variable: CMAKE_CXX_COMPILER +CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS +CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG +CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL +CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE +CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO +CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_COMPILER +CMAKE_C_COMPILER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS +CMAKE_C_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG +CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL +CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE +CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO +CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//Path to cache edit program executable. +CMAKE_EDIT_COMMAND:INTERNAL=/usr/local/Cellar/cmake/3.10.1/bin/ccmake +//Executable file format +CMAKE_EXECUTABLE_FORMAT:INTERNAL=Unknown +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS +CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG +CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL +CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE +CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS +CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1 +//Name of external makefile project generator. +CMAKE_EXTRA_GENERATOR:INTERNAL= +//Name of generator. +CMAKE_GENERATOR:INTERNAL=Unix Makefiles +//Name of generator platform. +CMAKE_GENERATOR_PLATFORM:INTERNAL= +//Name of generator toolset. +CMAKE_GENERATOR_TOOLSET:INTERNAL= +//Source directory with the top level CMakeLists.txt file for this +// project +CMAKE_HOME_DIRECTORY:INTERNAL=/Users/benjamin/orchestra/src/libs/DSPatch +//ADVANCED property for variable: CMAKE_INSTALL_NAME_TOOL +CMAKE_INSTALL_NAME_TOOL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_LINKER +CMAKE_LINKER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MAKE_PROGRAM +CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS +CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG +CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL +CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE +CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_NM +CMAKE_NM-ADVANCED:INTERNAL=1 +//number of local generators +CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1 +//ADVANCED property for variable: CMAKE_OBJCOPY +CMAKE_OBJCOPY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_OBJDUMP +CMAKE_OBJDUMP-ADVANCED:INTERNAL=1 +//Platform information initialized +CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_RANLIB +CMAKE_RANLIB-ADVANCED:INTERNAL=1 +//Path to CMake installation. +CMAKE_ROOT:INTERNAL=/usr/local/Cellar/cmake/3.10.1/share/cmake +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS +CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG +CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL +CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE +CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH +CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SKIP_RPATH +CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS +CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG +CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL +CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE +CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STRIP +CMAKE_STRIP-ADVANCED:INTERNAL=1 +//uname command +CMAKE_UNAME:INTERNAL=/usr/bin/uname +//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE +CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 + diff --git a/src/libs/DSPatch/CMakeFiles/3.10.1/CMakeCCompiler.cmake b/src/libs/DSPatch/CMakeFiles/3.10.1/CMakeCCompiler.cmake new file mode 100644 index 0000000..8f3239e --- /dev/null +++ b/src/libs/DSPatch/CMakeFiles/3.10.1/CMakeCCompiler.cmake @@ -0,0 +1,73 @@ +set(CMAKE_C_COMPILER "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc") +set(CMAKE_C_COMPILER_ARG1 "") +set(CMAKE_C_COMPILER_ID "AppleClang") +set(CMAKE_C_COMPILER_VERSION "9.0.0.9000039") +set(CMAKE_C_COMPILER_VERSION_INTERNAL "") +set(CMAKE_C_COMPILER_WRAPPER "") +set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "11") +set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert") +set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes") +set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros") +set(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert") + +set(CMAKE_C_PLATFORM_ID "Darwin") +set(CMAKE_C_SIMULATE_ID "") +set(CMAKE_C_SIMULATE_VERSION "") + + + +set(CMAKE_AR "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar") +set(CMAKE_C_COMPILER_AR "") +set(CMAKE_RANLIB "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib") +set(CMAKE_C_COMPILER_RANLIB "") +set(CMAKE_LINKER "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld") +set(CMAKE_COMPILER_IS_GNUCC ) +set(CMAKE_C_COMPILER_LOADED 1) +set(CMAKE_C_COMPILER_WORKS TRUE) +set(CMAKE_C_ABI_COMPILED TRUE) +set(CMAKE_COMPILER_IS_MINGW ) +set(CMAKE_COMPILER_IS_CYGWIN ) +if(CMAKE_COMPILER_IS_CYGWIN) + set(CYGWIN 1) + set(UNIX 1) +endif() + +set(CMAKE_C_COMPILER_ENV_VAR "CC") + +if(CMAKE_COMPILER_IS_MINGW) + set(MINGW 1) +endif() +set(CMAKE_C_COMPILER_ID_RUN 1) +set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m) +set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) +set(CMAKE_C_LINKER_PREFERENCE 10) + +# Save compiler ABI information. +set(CMAKE_C_SIZEOF_DATA_PTR "8") +set(CMAKE_C_COMPILER_ABI "") +set(CMAKE_C_LIBRARY_ARCHITECTURE "") + +if(CMAKE_C_SIZEOF_DATA_PTR) + set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") +endif() + +if(CMAKE_C_COMPILER_ABI) + set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") +endif() + +if(CMAKE_C_LIBRARY_ARCHITECTURE) + set(CMAKE_LIBRARY_ARCHITECTURE "") +endif() + +set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "") +if(CMAKE_C_CL_SHOWINCLUDES_PREFIX) + set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}") +endif() + + + + + +set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "") +set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/lib") +set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks") diff --git a/src/libs/DSPatch/CMakeFiles/3.10.1/CMakeCXXCompiler.cmake b/src/libs/DSPatch/CMakeFiles/3.10.1/CMakeCXXCompiler.cmake new file mode 100644 index 0000000..7cc5def --- /dev/null +++ b/src/libs/DSPatch/CMakeFiles/3.10.1/CMakeCXXCompiler.cmake @@ -0,0 +1,75 @@ +set(CMAKE_CXX_COMPILER "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++") +set(CMAKE_CXX_COMPILER_ARG1 "") +set(CMAKE_CXX_COMPILER_ID "AppleClang") +set(CMAKE_CXX_COMPILER_VERSION "9.0.0.9000039") +set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "") +set(CMAKE_CXX_COMPILER_WRAPPER "") +set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "98") +set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17") +set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters") +set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates") +set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates") +set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17") + +set(CMAKE_CXX_PLATFORM_ID "Darwin") +set(CMAKE_CXX_SIMULATE_ID "") +set(CMAKE_CXX_SIMULATE_VERSION "") + + + +set(CMAKE_AR "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar") +set(CMAKE_CXX_COMPILER_AR "") +set(CMAKE_RANLIB "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib") +set(CMAKE_CXX_COMPILER_RANLIB "") +set(CMAKE_LINKER "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld") +set(CMAKE_COMPILER_IS_GNUCXX ) +set(CMAKE_CXX_COMPILER_LOADED 1) +set(CMAKE_CXX_COMPILER_WORKS TRUE) +set(CMAKE_CXX_ABI_COMPILED TRUE) +set(CMAKE_COMPILER_IS_MINGW ) +set(CMAKE_COMPILER_IS_CYGWIN ) +if(CMAKE_COMPILER_IS_CYGWIN) + set(CYGWIN 1) + set(UNIX 1) +endif() + +set(CMAKE_CXX_COMPILER_ENV_VAR "CXX") + +if(CMAKE_COMPILER_IS_MINGW) + set(MINGW 1) +endif() +set(CMAKE_CXX_COMPILER_ID_RUN 1) +set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) +set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;mm;CPP) +set(CMAKE_CXX_LINKER_PREFERENCE 30) +set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) + +# Save compiler ABI information. +set(CMAKE_CXX_SIZEOF_DATA_PTR "8") +set(CMAKE_CXX_COMPILER_ABI "") +set(CMAKE_CXX_LIBRARY_ARCHITECTURE "") + +if(CMAKE_CXX_SIZEOF_DATA_PTR) + set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") +endif() + +if(CMAKE_CXX_COMPILER_ABI) + set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") +endif() + +if(CMAKE_CXX_LIBRARY_ARCHITECTURE) + set(CMAKE_LIBRARY_ARCHITECTURE "") +endif() + +set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "") +if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX) + set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}") +endif() + + + + + +set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "c++") +set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/lib") +set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks") diff --git a/src/libs/DSPatch/CMakeFiles/3.10.1/CMakeDetermineCompilerABI_C.bin b/src/libs/DSPatch/CMakeFiles/3.10.1/CMakeDetermineCompilerABI_C.bin new file mode 100755 index 0000000000000000000000000000000000000000..58c16c4f805a10f141c5b69901d07303a28eb994 GIT binary patch literal 4304 zcmeHKL2DC16rLE1MXM=DMNu?}NL5Gzu^6-m6<0S@+M*RiDPxn}(uHOt*Kdj+?ruDEtxd@Ct{rnHcC0?+?`8rQTe0kn9vx# zi6JOjQX*ySuf!U_Y_Inqhsz*d)?0{o54IDmnNZ4lGmHiWx7XXy^~Q7(ajKqK48D{} z_$UZH8H9^Xh12(aqwA4V3Nd-#Ne2AitWHlk*Q$N)z)y-d&DSSgh`gzFjZflzOFJE6 z#!-j8v8Th(Szz9G9riNpKE|M?@NKB(dFJ~6eEx5F=m@l!M6Kd-P%CUFsSOzQumI2FvWq=IaaXVk# z=R*^4H=SRMblO{PC;7hVbcx)0vXy%~S<1G%op$$`)1806Zc26f`pm^Bc#pmPrY@AS4@Bvi9#ayO06tTxc#0d81Xv}3;@Ab&_0u+|6 ek~}8pzk5;BbgB!fy5pcIqd2L_8fI=ZE&c#Pn3SIY literal 0 HcmV?d00001 diff --git a/src/libs/DSPatch/CMakeFiles/3.10.1/CMakeDetermineCompilerABI_CXX.bin b/src/libs/DSPatch/CMakeFiles/3.10.1/CMakeDetermineCompilerABI_CXX.bin new file mode 100755 index 0000000000000000000000000000000000000000..fe6fd4c917168015de6aef6ee96f2b04544961ee GIT binary patch literal 4288 zcmeHKO=}ZT6n)bg{HjeiilRsq6>Tv|@q-|OD2^sr+M*FkOSv}5lnykBBr})_fg-pV zMChWp6c^$zaN$Y>7hSq_=|XoATvieBoR=3eQ$KJmbK%T==gqzM-FM#VzWet1$9AQx zL8Vp)lu}7x2IQeiVWrdoAP`Zo;UueJDpIc3n*D-X>pe5|_L?N}NWE||tVR6V zJ-1d7x3*Z&d;Q5pH>sI3BG3=owrS|O780~TH!A|17%;Woqjpt+m{?oeeTtnMd|7@IJ z9ve%Kr_qF4(tYK^@#-Vwh{oSqX?jjIeZ{08TB#EN`^)091OAlZ)HAkNfmnf9fmnf9 zfmnf9fmnf9fmnh6Q-Rz0;8Xr_;v89kP7c-%P%~m>q0)f_CST z-I;&87Pi9VwW$kD_r6nKl*(PNF_+EFGmo>@AueEH&zXiZ&slh4-ON8+b4D9N=7`P) zVHry>Uk^xiNt~8b_B}_IoP~u{xdi__r4_}80{8J4uV!wq}e tr+K%RUa#;B)0V=d{Og&b&*b>24 & 0x00FF) +# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) +# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) + +#elif defined(__BORLANDC__) +# define COMPILER_ID "Borland" + /* __BORLANDC__ = 0xVRR */ +# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) +# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) + +#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 +# define COMPILER_ID "Watcom" + /* __WATCOMC__ = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__WATCOMC__) +# define COMPILER_ID "OpenWatcom" + /* __WATCOMC__ = VVRP + 1100 */ +# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__SUNPRO_C) +# define COMPILER_ID "SunPro" +# if __SUNPRO_C >= 0x5100 + /* __SUNPRO_C = 0xVRRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) +# else + /* __SUNPRO_CC = 0xVRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) +# endif + +#elif defined(__HP_cc) +# define COMPILER_ID "HP" + /* __HP_cc = VVRRPP */ +# define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000) +# define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100) +# define COMPILER_VERSION_PATCH DEC(__HP_cc % 100) + +#elif defined(__DECC) +# define COMPILER_ID "Compaq" + /* __DECC_VER = VVRRTPPPP */ +# define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000) +# define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100) +# define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000) + +#elif defined(__IBMC__) && defined(__COMPILER_VER__) +# define COMPILER_ID "zOS" + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) + +#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800 +# define COMPILER_ID "XL" + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) + +#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ < 800 +# define COMPILER_ID "VisualAge" + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) + +#elif defined(__PGI) +# define COMPILER_ID "PGI" +# define COMPILER_VERSION_MAJOR DEC(__PGIC__) +# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) +# if defined(__PGIC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) +# endif + +#elif defined(_CRAYC) +# define COMPILER_ID "Cray" +# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) +# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) + +#elif defined(__TI_COMPILER_VERSION__) +# define COMPILER_ID "TI" + /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ +# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) +# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) +# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) + +#elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version) +# define COMPILER_ID "Fujitsu" + +#elif defined(__TINYC__) +# define COMPILER_ID "TinyCC" + +#elif defined(__BCC__) +# define COMPILER_ID "Bruce" + +#elif defined(__SCO_VERSION__) +# define COMPILER_ID "SCO" + +#elif defined(__clang__) && defined(__apple_build_version__) +# define COMPILER_ID "AppleClang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) + +#elif defined(__clang__) +# define COMPILER_ID "Clang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif + +#elif defined(__GNUC__) +# define COMPILER_ID "GNU" +# define COMPILER_VERSION_MAJOR DEC(__GNUC__) +# if defined(__GNUC_MINOR__) +# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) +# endif +# if defined(__GNUC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif + +#elif defined(_MSC_VER) +# define COMPILER_ID "MSVC" + /* _MSC_VER = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) +# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) +# if defined(_MSC_FULL_VER) +# if _MSC_VER >= 1400 + /* _MSC_FULL_VER = VVRRPPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) +# else + /* _MSC_FULL_VER = VVRRPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) +# endif +# endif +# if defined(_MSC_BUILD) +# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) +# endif + +#elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) +# define COMPILER_ID "ADSP" +#if defined(__VISUALDSPVERSION__) + /* __VISUALDSPVERSION__ = 0xVVRRPP00 */ +# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24) +# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF) +#endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# define COMPILER_ID "IAR" +# if defined(__VER__) +# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) +# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) +# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) +# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) +# endif + +#elif defined(__ARMCC_VERSION) +# define COMPILER_ID "ARMCC" +#if __ARMCC_VERSION >= 1000000 + /* __ARMCC_VERSION = VRRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#else + /* __ARMCC_VERSION = VRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#endif + + +#elif defined(__SDCC_VERSION_MAJOR) || defined(SDCC) +# define COMPILER_ID "SDCC" +# if defined(__SDCC_VERSION_MAJOR) +# define COMPILER_VERSION_MAJOR DEC(__SDCC_VERSION_MAJOR) +# define COMPILER_VERSION_MINOR DEC(__SDCC_VERSION_MINOR) +# define COMPILER_VERSION_PATCH DEC(__SDCC_VERSION_PATCH) +# else + /* SDCC = VRP */ +# define COMPILER_VERSION_MAJOR DEC(SDCC/100) +# define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10) +# define COMPILER_VERSION_PATCH DEC(SDCC % 10) +# endif + +#elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION) +# define COMPILER_ID "MIPSpro" +# if defined(_SGI_COMPILER_VERSION) + /* _SGI_COMPILER_VERSION = VRP */ +# define COMPILER_VERSION_MAJOR DEC(_SGI_COMPILER_VERSION/100) +# define COMPILER_VERSION_MINOR DEC(_SGI_COMPILER_VERSION/10 % 10) +# define COMPILER_VERSION_PATCH DEC(_SGI_COMPILER_VERSION % 10) +# else + /* _COMPILER_VERSION = VRP */ +# define COMPILER_VERSION_MAJOR DEC(_COMPILER_VERSION/100) +# define COMPILER_VERSION_MINOR DEC(_COMPILER_VERSION/10 % 10) +# define COMPILER_VERSION_PATCH DEC(_COMPILER_VERSION % 10) +# endif + + +/* These compilers are either not known or too old to define an + identification macro. Try to identify the platform and guess that + it is the native compiler. */ +#elif defined(__sgi) +# define COMPILER_ID "MIPSpro" + +#elif defined(__hpux) || defined(__hpua) +# define COMPILER_ID "HP" + +#else /* unknown compiler */ +# define COMPILER_ID "" +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; +#ifdef SIMULATE_ID +char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; +#endif + +#ifdef __QNXNTO__ +char const* qnxnto = "INFO" ":" "qnxnto[]"; +#endif + +#if defined(__CRAYXE) || defined(__CRAYXC) +char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; +#endif + +#define STRINGIFY_HELPER(X) #X +#define STRINGIFY(X) STRINGIFY_HELPER(X) + +/* Identify known platforms by name. */ +#if defined(__linux) || defined(__linux__) || defined(linux) +# define PLATFORM_ID "Linux" + +#elif defined(__CYGWIN__) +# define PLATFORM_ID "Cygwin" + +#elif defined(__MINGW32__) +# define PLATFORM_ID "MinGW" + +#elif defined(__APPLE__) +# define PLATFORM_ID "Darwin" + +#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) +# define PLATFORM_ID "Windows" + +#elif defined(__FreeBSD__) || defined(__FreeBSD) +# define PLATFORM_ID "FreeBSD" + +#elif defined(__NetBSD__) || defined(__NetBSD) +# define PLATFORM_ID "NetBSD" + +#elif defined(__OpenBSD__) || defined(__OPENBSD) +# define PLATFORM_ID "OpenBSD" + +#elif defined(__sun) || defined(sun) +# define PLATFORM_ID "SunOS" + +#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) +# define PLATFORM_ID "AIX" + +#elif defined(__sgi) || defined(__sgi__) || defined(_SGI) +# define PLATFORM_ID "IRIX" + +#elif defined(__hpux) || defined(__hpux__) +# define PLATFORM_ID "HP-UX" + +#elif defined(__HAIKU__) +# define PLATFORM_ID "Haiku" + +#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) +# define PLATFORM_ID "BeOS" + +#elif defined(__QNX__) || defined(__QNXNTO__) +# define PLATFORM_ID "QNX" + +#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) +# define PLATFORM_ID "Tru64" + +#elif defined(__riscos) || defined(__riscos__) +# define PLATFORM_ID "RISCos" + +#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) +# define PLATFORM_ID "SINIX" + +#elif defined(__UNIX_SV__) +# define PLATFORM_ID "UNIX_SV" + +#elif defined(__bsdos__) +# define PLATFORM_ID "BSDOS" + +#elif defined(_MPRAS) || defined(MPRAS) +# define PLATFORM_ID "MP-RAS" + +#elif defined(__osf) || defined(__osf__) +# define PLATFORM_ID "OSF1" + +#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) +# define PLATFORM_ID "SCO_SV" + +#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) +# define PLATFORM_ID "ULTRIX" + +#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) +# define PLATFORM_ID "Xenix" + +#elif defined(__WATCOMC__) +# if defined(__LINUX__) +# define PLATFORM_ID "Linux" + +# elif defined(__DOS__) +# define PLATFORM_ID "DOS" + +# elif defined(__OS2__) +# define PLATFORM_ID "OS2" + +# elif defined(__WINDOWS__) +# define PLATFORM_ID "Windows3x" + +# else /* unknown platform */ +# define PLATFORM_ID +# endif + +#else /* unknown platform */ +# define PLATFORM_ID + +#endif + +/* For windows compilers MSVC and Intel we can determine + the architecture of the compiler being used. This is because + the compilers do not have flags that can change the architecture, + but rather depend on which compiler is being used +*/ +#if defined(_WIN32) && defined(_MSC_VER) +# if defined(_M_IA64) +# define ARCHITECTURE_ID "IA64" + +# elif defined(_M_X64) || defined(_M_AMD64) +# define ARCHITECTURE_ID "x64" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# elif defined(_M_ARM64) +# define ARCHITECTURE_ID "ARM64" + +# elif defined(_M_ARM) +# if _M_ARM == 4 +# define ARCHITECTURE_ID "ARMV4I" +# elif _M_ARM == 5 +# define ARCHITECTURE_ID "ARMV5I" +# else +# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) +# endif + +# elif defined(_M_MIPS) +# define ARCHITECTURE_ID "MIPS" + +# elif defined(_M_SH) +# define ARCHITECTURE_ID "SHx" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__WATCOMC__) +# if defined(_M_I86) +# define ARCHITECTURE_ID "I86" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# if defined(__ICCARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__ICCAVR__) +# define ARCHITECTURE_ID "AVR" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif +#else +# define ARCHITECTURE_ID +#endif + +/* Convert integer to decimal digit literals. */ +#define DEC(n) \ + ('0' + (((n) / 10000000)%10)), \ + ('0' + (((n) / 1000000)%10)), \ + ('0' + (((n) / 100000)%10)), \ + ('0' + (((n) / 10000)%10)), \ + ('0' + (((n) / 1000)%10)), \ + ('0' + (((n) / 100)%10)), \ + ('0' + (((n) / 10)%10)), \ + ('0' + ((n) % 10)) + +/* Convert integer to hex digit literals. */ +#define HEX(n) \ + ('0' + ((n)>>28 & 0xF)), \ + ('0' + ((n)>>24 & 0xF)), \ + ('0' + ((n)>>20 & 0xF)), \ + ('0' + ((n)>>16 & 0xF)), \ + ('0' + ((n)>>12 & 0xF)), \ + ('0' + ((n)>>8 & 0xF)), \ + ('0' + ((n)>>4 & 0xF)), \ + ('0' + ((n) & 0xF)) + +/* Construct a string literal encoding the version number components. */ +#ifdef COMPILER_VERSION_MAJOR +char const info_version[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', + COMPILER_VERSION_MAJOR, +# ifdef COMPILER_VERSION_MINOR + '.', COMPILER_VERSION_MINOR, +# ifdef COMPILER_VERSION_PATCH + '.', COMPILER_VERSION_PATCH, +# ifdef COMPILER_VERSION_TWEAK + '.', COMPILER_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct a string literal encoding the internal version number. */ +#ifdef COMPILER_VERSION_INTERNAL +char const info_version_internal[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', + 'i','n','t','e','r','n','a','l','[', + COMPILER_VERSION_INTERNAL,']','\0'}; +#endif + +/* Construct a string literal encoding the version number components. */ +#ifdef SIMULATE_VERSION_MAJOR +char const info_simulate_version[] = { + 'I', 'N', 'F', 'O', ':', + 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', + SIMULATE_VERSION_MAJOR, +# ifdef SIMULATE_VERSION_MINOR + '.', SIMULATE_VERSION_MINOR, +# ifdef SIMULATE_VERSION_PATCH + '.', SIMULATE_VERSION_PATCH, +# ifdef SIMULATE_VERSION_TWEAK + '.', SIMULATE_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; +char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; + + + + +#if !defined(__STDC__) +# if defined(_MSC_VER) && !defined(__clang__) +# define C_DIALECT "90" +# else +# define C_DIALECT +# endif +#elif __STDC_VERSION__ >= 201000L +# define C_DIALECT "11" +#elif __STDC_VERSION__ >= 199901L +# define C_DIALECT "99" +#else +# define C_DIALECT "90" +#endif +const char* info_language_dialect_default = + "INFO" ":" "dialect_default[" C_DIALECT "]"; + +/*--------------------------------------------------------------------------*/ + +#ifdef ID_VOID_MAIN +void main() {} +#else +# if defined(__CLASSIC_C__) +int main(argc, argv) int argc; char *argv[]; +# else +int main(int argc, char* argv[]) +# endif +{ + int require = 0; + require += info_compiler[argc]; + require += info_platform[argc]; + require += info_arch[argc]; +#ifdef COMPILER_VERSION_MAJOR + require += info_version[argc]; +#endif +#ifdef COMPILER_VERSION_INTERNAL + require += info_version_internal[argc]; +#endif +#ifdef SIMULATE_ID + require += info_simulate[argc]; +#endif +#ifdef SIMULATE_VERSION_MAJOR + require += info_simulate_version[argc]; +#endif +#if defined(__CRAYXE) || defined(__CRAYXC) + require += info_cray[argc]; +#endif + require += info_language_dialect_default[argc]; + (void)argv; + return require; +} +#endif diff --git a/src/libs/DSPatch/CMakeFiles/3.10.1/CompilerIdCXX/CMakeCXXCompilerId.cpp b/src/libs/DSPatch/CMakeFiles/3.10.1/CompilerIdCXX/CMakeCXXCompilerId.cpp new file mode 100644 index 0000000..2d66298 --- /dev/null +++ b/src/libs/DSPatch/CMakeFiles/3.10.1/CompilerIdCXX/CMakeCXXCompilerId.cpp @@ -0,0 +1,576 @@ +/* This source file must have a .cpp extension so that all C++ compilers + recognize the extension without flags. Borland does not know .cxx for + example. */ +#ifndef __cplusplus +# error "A C compiler has been selected for C++." +#endif + + +/* Version number components: V=Version, R=Revision, P=Patch + Version date components: YYYY=Year, MM=Month, DD=Day */ + +#if defined(__COMO__) +# define COMPILER_ID "Comeau" + /* __COMO_VERSION__ = VRR */ +# define COMPILER_VERSION_MAJOR DEC(__COMO_VERSION__ / 100) +# define COMPILER_VERSION_MINOR DEC(__COMO_VERSION__ % 100) + +#elif defined(__INTEL_COMPILER) || defined(__ICC) +# define COMPILER_ID "Intel" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif + /* __INTEL_COMPILER = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) +# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) +# if defined(__INTEL_COMPILER_UPDATE) +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) +# else +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) +# endif +# if defined(__INTEL_COMPILER_BUILD_DATE) + /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ +# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) +# endif +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif + +#elif defined(__PATHCC__) +# define COMPILER_ID "PathScale" +# define COMPILER_VERSION_MAJOR DEC(__PATHCC__) +# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) +# if defined(__PATHCC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) +# endif + +#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) +# define COMPILER_ID "Embarcadero" +# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) +# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) +# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) + +#elif defined(__BORLANDC__) +# define COMPILER_ID "Borland" + /* __BORLANDC__ = 0xVRR */ +# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) +# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) + +#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 +# define COMPILER_ID "Watcom" + /* __WATCOMC__ = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__WATCOMC__) +# define COMPILER_ID "OpenWatcom" + /* __WATCOMC__ = VVRP + 1100 */ +# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__SUNPRO_CC) +# define COMPILER_ID "SunPro" +# if __SUNPRO_CC >= 0x5100 + /* __SUNPRO_CC = 0xVRRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) +# else + /* __SUNPRO_CC = 0xVRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) +# endif + +#elif defined(__HP_aCC) +# define COMPILER_ID "HP" + /* __HP_aCC = VVRRPP */ +# define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000) +# define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100) +# define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100) + +#elif defined(__DECCXX) +# define COMPILER_ID "Compaq" + /* __DECCXX_VER = VVRRTPPPP */ +# define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000) +# define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100) +# define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000) + +#elif defined(__IBMCPP__) && defined(__COMPILER_VER__) +# define COMPILER_ID "zOS" + /* __IBMCPP__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) + +#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800 +# define COMPILER_ID "XL" + /* __IBMCPP__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) + +#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ < 800 +# define COMPILER_ID "VisualAge" + /* __IBMCPP__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) + +#elif defined(__PGI) +# define COMPILER_ID "PGI" +# define COMPILER_VERSION_MAJOR DEC(__PGIC__) +# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) +# if defined(__PGIC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) +# endif + +#elif defined(_CRAYC) +# define COMPILER_ID "Cray" +# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) +# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) + +#elif defined(__TI_COMPILER_VERSION__) +# define COMPILER_ID "TI" + /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ +# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) +# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) +# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) + +#elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version) +# define COMPILER_ID "Fujitsu" + +#elif defined(__SCO_VERSION__) +# define COMPILER_ID "SCO" + +#elif defined(__clang__) && defined(__apple_build_version__) +# define COMPILER_ID "AppleClang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) + +#elif defined(__clang__) +# define COMPILER_ID "Clang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif + +#elif defined(__GNUC__) || defined(__GNUG__) +# define COMPILER_ID "GNU" +# if defined(__GNUC__) +# define COMPILER_VERSION_MAJOR DEC(__GNUC__) +# else +# define COMPILER_VERSION_MAJOR DEC(__GNUG__) +# endif +# if defined(__GNUC_MINOR__) +# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) +# endif +# if defined(__GNUC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif + +#elif defined(_MSC_VER) +# define COMPILER_ID "MSVC" + /* _MSC_VER = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) +# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) +# if defined(_MSC_FULL_VER) +# if _MSC_VER >= 1400 + /* _MSC_FULL_VER = VVRRPPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) +# else + /* _MSC_FULL_VER = VVRRPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) +# endif +# endif +# if defined(_MSC_BUILD) +# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) +# endif + +#elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) +# define COMPILER_ID "ADSP" +#if defined(__VISUALDSPVERSION__) + /* __VISUALDSPVERSION__ = 0xVVRRPP00 */ +# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24) +# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF) +#endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# define COMPILER_ID "IAR" +# if defined(__VER__) +# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) +# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) +# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) +# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) +# endif + +#elif defined(__ARMCC_VERSION) +# define COMPILER_ID "ARMCC" +#if __ARMCC_VERSION >= 1000000 + /* __ARMCC_VERSION = VRRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#else + /* __ARMCC_VERSION = VRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#endif + + +#elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION) +# define COMPILER_ID "MIPSpro" +# if defined(_SGI_COMPILER_VERSION) + /* _SGI_COMPILER_VERSION = VRP */ +# define COMPILER_VERSION_MAJOR DEC(_SGI_COMPILER_VERSION/100) +# define COMPILER_VERSION_MINOR DEC(_SGI_COMPILER_VERSION/10 % 10) +# define COMPILER_VERSION_PATCH DEC(_SGI_COMPILER_VERSION % 10) +# else + /* _COMPILER_VERSION = VRP */ +# define COMPILER_VERSION_MAJOR DEC(_COMPILER_VERSION/100) +# define COMPILER_VERSION_MINOR DEC(_COMPILER_VERSION/10 % 10) +# define COMPILER_VERSION_PATCH DEC(_COMPILER_VERSION % 10) +# endif + + +/* These compilers are either not known or too old to define an + identification macro. Try to identify the platform and guess that + it is the native compiler. */ +#elif defined(__sgi) +# define COMPILER_ID "MIPSpro" + +#elif defined(__hpux) || defined(__hpua) +# define COMPILER_ID "HP" + +#else /* unknown compiler */ +# define COMPILER_ID "" +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; +#ifdef SIMULATE_ID +char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; +#endif + +#ifdef __QNXNTO__ +char const* qnxnto = "INFO" ":" "qnxnto[]"; +#endif + +#if defined(__CRAYXE) || defined(__CRAYXC) +char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; +#endif + +#define STRINGIFY_HELPER(X) #X +#define STRINGIFY(X) STRINGIFY_HELPER(X) + +/* Identify known platforms by name. */ +#if defined(__linux) || defined(__linux__) || defined(linux) +# define PLATFORM_ID "Linux" + +#elif defined(__CYGWIN__) +# define PLATFORM_ID "Cygwin" + +#elif defined(__MINGW32__) +# define PLATFORM_ID "MinGW" + +#elif defined(__APPLE__) +# define PLATFORM_ID "Darwin" + +#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) +# define PLATFORM_ID "Windows" + +#elif defined(__FreeBSD__) || defined(__FreeBSD) +# define PLATFORM_ID "FreeBSD" + +#elif defined(__NetBSD__) || defined(__NetBSD) +# define PLATFORM_ID "NetBSD" + +#elif defined(__OpenBSD__) || defined(__OPENBSD) +# define PLATFORM_ID "OpenBSD" + +#elif defined(__sun) || defined(sun) +# define PLATFORM_ID "SunOS" + +#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) +# define PLATFORM_ID "AIX" + +#elif defined(__sgi) || defined(__sgi__) || defined(_SGI) +# define PLATFORM_ID "IRIX" + +#elif defined(__hpux) || defined(__hpux__) +# define PLATFORM_ID "HP-UX" + +#elif defined(__HAIKU__) +# define PLATFORM_ID "Haiku" + +#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) +# define PLATFORM_ID "BeOS" + +#elif defined(__QNX__) || defined(__QNXNTO__) +# define PLATFORM_ID "QNX" + +#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) +# define PLATFORM_ID "Tru64" + +#elif defined(__riscos) || defined(__riscos__) +# define PLATFORM_ID "RISCos" + +#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) +# define PLATFORM_ID "SINIX" + +#elif defined(__UNIX_SV__) +# define PLATFORM_ID "UNIX_SV" + +#elif defined(__bsdos__) +# define PLATFORM_ID "BSDOS" + +#elif defined(_MPRAS) || defined(MPRAS) +# define PLATFORM_ID "MP-RAS" + +#elif defined(__osf) || defined(__osf__) +# define PLATFORM_ID "OSF1" + +#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) +# define PLATFORM_ID "SCO_SV" + +#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) +# define PLATFORM_ID "ULTRIX" + +#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) +# define PLATFORM_ID "Xenix" + +#elif defined(__WATCOMC__) +# if defined(__LINUX__) +# define PLATFORM_ID "Linux" + +# elif defined(__DOS__) +# define PLATFORM_ID "DOS" + +# elif defined(__OS2__) +# define PLATFORM_ID "OS2" + +# elif defined(__WINDOWS__) +# define PLATFORM_ID "Windows3x" + +# else /* unknown platform */ +# define PLATFORM_ID +# endif + +#else /* unknown platform */ +# define PLATFORM_ID + +#endif + +/* For windows compilers MSVC and Intel we can determine + the architecture of the compiler being used. This is because + the compilers do not have flags that can change the architecture, + but rather depend on which compiler is being used +*/ +#if defined(_WIN32) && defined(_MSC_VER) +# if defined(_M_IA64) +# define ARCHITECTURE_ID "IA64" + +# elif defined(_M_X64) || defined(_M_AMD64) +# define ARCHITECTURE_ID "x64" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# elif defined(_M_ARM64) +# define ARCHITECTURE_ID "ARM64" + +# elif defined(_M_ARM) +# if _M_ARM == 4 +# define ARCHITECTURE_ID "ARMV4I" +# elif _M_ARM == 5 +# define ARCHITECTURE_ID "ARMV5I" +# else +# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) +# endif + +# elif defined(_M_MIPS) +# define ARCHITECTURE_ID "MIPS" + +# elif defined(_M_SH) +# define ARCHITECTURE_ID "SHx" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__WATCOMC__) +# if defined(_M_I86) +# define ARCHITECTURE_ID "I86" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# if defined(__ICCARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__ICCAVR__) +# define ARCHITECTURE_ID "AVR" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif +#else +# define ARCHITECTURE_ID +#endif + +/* Convert integer to decimal digit literals. */ +#define DEC(n) \ + ('0' + (((n) / 10000000)%10)), \ + ('0' + (((n) / 1000000)%10)), \ + ('0' + (((n) / 100000)%10)), \ + ('0' + (((n) / 10000)%10)), \ + ('0' + (((n) / 1000)%10)), \ + ('0' + (((n) / 100)%10)), \ + ('0' + (((n) / 10)%10)), \ + ('0' + ((n) % 10)) + +/* Convert integer to hex digit literals. */ +#define HEX(n) \ + ('0' + ((n)>>28 & 0xF)), \ + ('0' + ((n)>>24 & 0xF)), \ + ('0' + ((n)>>20 & 0xF)), \ + ('0' + ((n)>>16 & 0xF)), \ + ('0' + ((n)>>12 & 0xF)), \ + ('0' + ((n)>>8 & 0xF)), \ + ('0' + ((n)>>4 & 0xF)), \ + ('0' + ((n) & 0xF)) + +/* Construct a string literal encoding the version number components. */ +#ifdef COMPILER_VERSION_MAJOR +char const info_version[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', + COMPILER_VERSION_MAJOR, +# ifdef COMPILER_VERSION_MINOR + '.', COMPILER_VERSION_MINOR, +# ifdef COMPILER_VERSION_PATCH + '.', COMPILER_VERSION_PATCH, +# ifdef COMPILER_VERSION_TWEAK + '.', COMPILER_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct a string literal encoding the internal version number. */ +#ifdef COMPILER_VERSION_INTERNAL +char const info_version_internal[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', + 'i','n','t','e','r','n','a','l','[', + COMPILER_VERSION_INTERNAL,']','\0'}; +#endif + +/* Construct a string literal encoding the version number components. */ +#ifdef SIMULATE_VERSION_MAJOR +char const info_simulate_version[] = { + 'I', 'N', 'F', 'O', ':', + 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', + SIMULATE_VERSION_MAJOR, +# ifdef SIMULATE_VERSION_MINOR + '.', SIMULATE_VERSION_MINOR, +# ifdef SIMULATE_VERSION_PATCH + '.', SIMULATE_VERSION_PATCH, +# ifdef SIMULATE_VERSION_TWEAK + '.', SIMULATE_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; +char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; + + + + +#if defined(_MSC_VER) && defined(_MSVC_LANG) +#define CXX_STD _MSVC_LANG +#else +#define CXX_STD __cplusplus +#endif + +const char* info_language_dialect_default = "INFO" ":" "dialect_default[" +#if CXX_STD > 201402L + "17" +#elif CXX_STD >= 201402L + "14" +#elif CXX_STD >= 201103L + "11" +#else + "98" +#endif +"]"; + +/*--------------------------------------------------------------------------*/ + +int main(int argc, char* argv[]) +{ + int require = 0; + require += info_compiler[argc]; + require += info_platform[argc]; +#ifdef COMPILER_VERSION_MAJOR + require += info_version[argc]; +#endif +#ifdef COMPILER_VERSION_INTERNAL + require += info_version_internal[argc]; +#endif +#ifdef SIMULATE_ID + require += info_simulate[argc]; +#endif +#ifdef SIMULATE_VERSION_MAJOR + require += info_simulate_version[argc]; +#endif +#if defined(__CRAYXE) || defined(__CRAYXC) + require += info_cray[argc]; +#endif + require += info_language_dialect_default[argc]; + (void)argv; + return require; +} diff --git a/src/libs/DSPatch/CMakeFiles/CMakeDirectoryInformation.cmake b/src/libs/DSPatch/CMakeFiles/CMakeDirectoryInformation.cmake new file mode 100644 index 0000000..1560f02 --- /dev/null +++ b/src/libs/DSPatch/CMakeFiles/CMakeDirectoryInformation.cmake @@ -0,0 +1,16 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.10 + +# Relative path conversion top directories. +set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/Users/benjamin/orchestra/src/libs/DSPatch") +set(CMAKE_RELATIVE_PATH_TOP_BINARY "/Users/benjamin/orchestra/src/libs/DSPatch") + +# Force unix paths in dependencies. +set(CMAKE_FORCE_UNIX_PATHS 1) + + +# The C and CXX include file regular expressions for this directory. +set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") +set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") +set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) +set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) diff --git a/src/libs/DSPatch/CMakeFiles/CMakeOutput.log b/src/libs/DSPatch/CMakeFiles/CMakeOutput.log new file mode 100644 index 0000000..18509e0 --- /dev/null +++ b/src/libs/DSPatch/CMakeFiles/CMakeOutput.log @@ -0,0 +1,528 @@ +The system is: Darwin - 17.3.0 - x86_64 +Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded. +Compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc +Build flags: +Id flags: + +The output was: +0 + + +Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "a.out" + +The C compiler identification is AppleClang, found in "/Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles/3.10.1/CompilerIdC/a.out" + +Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded. +Compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ +Build flags: ;-Wall;-Wextra;-Wnon-virtual-dtor;-fPIC;-pthread +Id flags: + +The output was: +0 + + +Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "a.out" + +The CXX compiler identification is AppleClang, found in "/Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles/3.10.1/CompilerIdCXX/a.out" + +Determining if the C compiler works passed with the following output: +Change Dir: /Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_5ef27/fast" +/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_5ef27.dir/build.make CMakeFiles/cmTC_5ef27.dir/build +Building C object CMakeFiles/cmTC_5ef27.dir/testCCompiler.c.o +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -o CMakeFiles/cmTC_5ef27.dir/testCCompiler.c.o -c /Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles/CMakeTmp/testCCompiler.c +Linking C executable cmTC_5ef27 +/usr/local/Cellar/cmake/3.10.1/bin/cmake -E cmake_link_script CMakeFiles/cmTC_5ef27.dir/link.txt --verbose=1 +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_5ef27.dir/testCCompiler.c.o -o cmTC_5ef27 + + +Detecting C compiler ABI info compiled with the following output: +Change Dir: /Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_afa4b/fast" +/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_afa4b.dir/build.make CMakeFiles/cmTC_afa4b.dir/build +Building C object CMakeFiles/cmTC_afa4b.dir/CMakeCCompilerABI.c.o +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -o CMakeFiles/cmTC_afa4b.dir/CMakeCCompilerABI.c.o -c /usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeCCompilerABI.c +Linking C executable cmTC_afa4b +/usr/local/Cellar/cmake/3.10.1/bin/cmake -E cmake_link_script CMakeFiles/cmTC_afa4b.dir/link.txt --verbose=1 +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -v -Wl,-v CMakeFiles/cmTC_afa4b.dir/CMakeCCompilerABI.c.o -o cmTC_afa4b +Apple LLVM version 9.0.0 (clang-900.0.39.2) +Target: x86_64-apple-darwin17.3.0 +Thread model: posix +InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin + "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch x86_64 -macosx_version_min 10.13.0 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -o cmTC_afa4b -search_paths_first -headerpad_max_install_names -v CMakeFiles/cmTC_afa4b.dir/CMakeCCompilerABI.c.o -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/lib/darwin/libclang_rt.osx.a +@(#)PROGRAM:ld PROJECT:ld64-305 +configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em (tvOS) +Library search paths: + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/lib +Framework search paths: + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/ + + +Parsed C implicit link information from above output: + link line regex: [^( *|.*[/\])(ld|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\]+-)?ld|collect2)[^/\]*( |$)] + ignore line: [Change Dir: /Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles/CMakeTmp] + ignore line: [] + ignore line: [Run Build Command:"/usr/bin/make" "cmTC_afa4b/fast"] + ignore line: [/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_afa4b.dir/build.make CMakeFiles/cmTC_afa4b.dir/build] + ignore line: [Building C object CMakeFiles/cmTC_afa4b.dir/CMakeCCompilerABI.c.o] + ignore line: [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -o CMakeFiles/cmTC_afa4b.dir/CMakeCCompilerABI.c.o -c /usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeCCompilerABI.c] + ignore line: [Linking C executable cmTC_afa4b] + ignore line: [/usr/local/Cellar/cmake/3.10.1/bin/cmake -E cmake_link_script CMakeFiles/cmTC_afa4b.dir/link.txt --verbose=1] + ignore line: [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -v -Wl,-v CMakeFiles/cmTC_afa4b.dir/CMakeCCompilerABI.c.o -o cmTC_afa4b ] + ignore line: [Apple LLVM version 9.0.0 (clang-900.0.39.2)] + ignore line: [Target: x86_64-apple-darwin17.3.0] + ignore line: [Thread model: posix] + ignore line: [InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin] + link line: [ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch x86_64 -macosx_version_min 10.13.0 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -o cmTC_afa4b -search_paths_first -headerpad_max_install_names -v CMakeFiles/cmTC_afa4b.dir/CMakeCCompilerABI.c.o -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/lib/darwin/libclang_rt.osx.a] + arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld] ==> ignore + arg [-demangle] ==> ignore + arg [-lto_library] ==> ignore, skip following value + arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib] ==> skip value of -lto_library + arg [-dynamic] ==> ignore + arg [-arch] ==> ignore + arg [x86_64] ==> ignore + arg [-macosx_version_min] ==> ignore + arg [10.13.0] ==> ignore + arg [-syslibroot] ==> ignore + arg [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk] ==> ignore + arg [-o] ==> ignore + arg [cmTC_afa4b] ==> ignore + arg [-search_paths_first] ==> ignore + arg [-headerpad_max_install_names] ==> ignore + arg [-v] ==> ignore + arg [CMakeFiles/cmTC_afa4b.dir/CMakeCCompilerABI.c.o] ==> ignore + arg [-lSystem] ==> lib [System] + arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/lib/darwin/libclang_rt.osx.a] ==> lib [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/lib/darwin/libclang_rt.osx.a] + Library search paths: [;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/lib] + Framework search paths: [;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/] + remove lib [System] + remove lib [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/lib/darwin/libclang_rt.osx.a] + collapse library dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/lib] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/lib] + collapse framework dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks] + implicit libs: [] + implicit dirs: [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/lib] + implicit fwks: [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks] + + + + +Detecting C [-std=c11] compiler features compiled with the following output: +Change Dir: /Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_c7b3f/fast" +/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_c7b3f.dir/build.make CMakeFiles/cmTC_c7b3f.dir/build +Building C object CMakeFiles/cmTC_c7b3f.dir/feature_tests.c.o +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -std=c11 -o CMakeFiles/cmTC_c7b3f.dir/feature_tests.c.o -c /Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles/feature_tests.c +Linking C executable cmTC_c7b3f +/usr/local/Cellar/cmake/3.10.1/bin/cmake -E cmake_link_script CMakeFiles/cmTC_c7b3f.dir/link.txt --verbose=1 +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_c7b3f.dir/feature_tests.c.o -o cmTC_c7b3f + + + Feature record: C_FEATURE:1c_function_prototypes + Feature record: C_FEATURE:1c_restrict + Feature record: C_FEATURE:1c_static_assert + Feature record: C_FEATURE:1c_variadic_macros + + +Detecting C [-std=c99] compiler features compiled with the following output: +Change Dir: /Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_557db/fast" +/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_557db.dir/build.make CMakeFiles/cmTC_557db.dir/build +Building C object CMakeFiles/cmTC_557db.dir/feature_tests.c.o +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -std=c99 -o CMakeFiles/cmTC_557db.dir/feature_tests.c.o -c /Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles/feature_tests.c +Linking C executable cmTC_557db +/usr/local/Cellar/cmake/3.10.1/bin/cmake -E cmake_link_script CMakeFiles/cmTC_557db.dir/link.txt --verbose=1 +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_557db.dir/feature_tests.c.o -o cmTC_557db + + + Feature record: C_FEATURE:1c_function_prototypes + Feature record: C_FEATURE:1c_restrict + Feature record: C_FEATURE:0c_static_assert + Feature record: C_FEATURE:1c_variadic_macros + + +Detecting C [-std=c90] compiler features compiled with the following output: +Change Dir: /Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_dcdd1/fast" +/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_dcdd1.dir/build.make CMakeFiles/cmTC_dcdd1.dir/build +Building C object CMakeFiles/cmTC_dcdd1.dir/feature_tests.c.o +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -std=c90 -o CMakeFiles/cmTC_dcdd1.dir/feature_tests.c.o -c /Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles/feature_tests.c +Linking C executable cmTC_dcdd1 +/usr/local/Cellar/cmake/3.10.1/bin/cmake -E cmake_link_script CMakeFiles/cmTC_dcdd1.dir/link.txt --verbose=1 +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_dcdd1.dir/feature_tests.c.o -o cmTC_dcdd1 + + + Feature record: C_FEATURE:1c_function_prototypes + Feature record: C_FEATURE:0c_restrict + Feature record: C_FEATURE:0c_static_assert + Feature record: C_FEATURE:0c_variadic_macros +Determining if the CXX compiler works passed with the following output: +Change Dir: /Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_32d0f/fast" +/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_32d0f.dir/build.make CMakeFiles/cmTC_32d0f.dir/build +Building CXX object CMakeFiles/cmTC_32d0f.dir/testCXXCompiler.cxx.o +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -o CMakeFiles/cmTC_32d0f.dir/testCXXCompiler.cxx.o -c /Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles/CMakeTmp/testCXXCompiler.cxx +Linking CXX executable cmTC_32d0f +/usr/local/Cellar/cmake/3.10.1/bin/cmake -E cmake_link_script CMakeFiles/cmTC_32d0f.dir/link.txt --verbose=1 +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_32d0f.dir/testCXXCompiler.cxx.o -o cmTC_32d0f + + +Detecting CXX compiler ABI info compiled with the following output: +Change Dir: /Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_129de/fast" +/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_129de.dir/build.make CMakeFiles/cmTC_129de.dir/build +Building CXX object CMakeFiles/cmTC_129de.dir/CMakeCXXCompilerABI.cpp.o +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -o CMakeFiles/cmTC_129de.dir/CMakeCXXCompilerABI.cpp.o -c /usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeCXXCompilerABI.cpp +Linking CXX executable cmTC_129de +/usr/local/Cellar/cmake/3.10.1/bin/cmake -E cmake_link_script CMakeFiles/cmTC_129de.dir/link.txt --verbose=1 +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -v -Wl,-v CMakeFiles/cmTC_129de.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_129de +Apple LLVM version 9.0.0 (clang-900.0.39.2) +Target: x86_64-apple-darwin17.3.0 +Thread model: posix +InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin + "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch x86_64 -macosx_version_min 10.13.0 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -o cmTC_129de -search_paths_first -headerpad_max_install_names -v CMakeFiles/cmTC_129de.dir/CMakeCXXCompilerABI.cpp.o -lc++ -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/lib/darwin/libclang_rt.osx.a +@(#)PROGRAM:ld PROJECT:ld64-305 +configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em (tvOS) +Library search paths: + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/lib +Framework search paths: + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/ + + +Parsed CXX implicit link information from above output: + link line regex: [^( *|.*[/\])(ld|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\]+-)?ld|collect2)[^/\]*( |$)] + ignore line: [Change Dir: /Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles/CMakeTmp] + ignore line: [] + ignore line: [Run Build Command:"/usr/bin/make" "cmTC_129de/fast"] + ignore line: [/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_129de.dir/build.make CMakeFiles/cmTC_129de.dir/build] + ignore line: [Building CXX object CMakeFiles/cmTC_129de.dir/CMakeCXXCompilerABI.cpp.o] + ignore line: [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -o CMakeFiles/cmTC_129de.dir/CMakeCXXCompilerABI.cpp.o -c /usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeCXXCompilerABI.cpp] + ignore line: [Linking CXX executable cmTC_129de] + ignore line: [/usr/local/Cellar/cmake/3.10.1/bin/cmake -E cmake_link_script CMakeFiles/cmTC_129de.dir/link.txt --verbose=1] + ignore line: [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -v -Wl,-v CMakeFiles/cmTC_129de.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_129de ] + ignore line: [Apple LLVM version 9.0.0 (clang-900.0.39.2)] + ignore line: [Target: x86_64-apple-darwin17.3.0] + ignore line: [Thread model: posix] + ignore line: [InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin] + link line: [ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch x86_64 -macosx_version_min 10.13.0 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -o cmTC_129de -search_paths_first -headerpad_max_install_names -v CMakeFiles/cmTC_129de.dir/CMakeCXXCompilerABI.cpp.o -lc++ -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/lib/darwin/libclang_rt.osx.a] + arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld] ==> ignore + arg [-demangle] ==> ignore + arg [-lto_library] ==> ignore, skip following value + arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib] ==> skip value of -lto_library + arg [-dynamic] ==> ignore + arg [-arch] ==> ignore + arg [x86_64] ==> ignore + arg [-macosx_version_min] ==> ignore + arg [10.13.0] ==> ignore + arg [-syslibroot] ==> ignore + arg [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk] ==> ignore + arg [-o] ==> ignore + arg [cmTC_129de] ==> ignore + arg [-search_paths_first] ==> ignore + arg [-headerpad_max_install_names] ==> ignore + arg [-v] ==> ignore + arg [CMakeFiles/cmTC_129de.dir/CMakeCXXCompilerABI.cpp.o] ==> ignore + arg [-lc++] ==> lib [c++] + arg [-lSystem] ==> lib [System] + arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/lib/darwin/libclang_rt.osx.a] ==> lib [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/lib/darwin/libclang_rt.osx.a] + Library search paths: [;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/lib] + Framework search paths: [;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/] + remove lib [System] + remove lib [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/lib/darwin/libclang_rt.osx.a] + collapse library dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/lib] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/lib] + collapse framework dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks] + implicit libs: [c++] + implicit dirs: [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/lib] + implicit fwks: [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks] + + + + +Detecting CXX [-std=c++1z] compiler features compiled with the following output: +Change Dir: /Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_6996e/fast" +/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_6996e.dir/build.make CMakeFiles/cmTC_6996e.dir/build +Building CXX object CMakeFiles/cmTC_6996e.dir/feature_tests.cxx.o +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -std=c++1z -o CMakeFiles/cmTC_6996e.dir/feature_tests.cxx.o -c /Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles/feature_tests.cxx +Linking CXX executable cmTC_6996e +/usr/local/Cellar/cmake/3.10.1/bin/cmake -E cmake_link_script CMakeFiles/cmTC_6996e.dir/link.txt --verbose=1 +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_6996e.dir/feature_tests.cxx.o -o cmTC_6996e + + + Feature record: CXX_FEATURE:1cxx_aggregate_default_initializers + Feature record: CXX_FEATURE:1cxx_alias_templates + Feature record: CXX_FEATURE:1cxx_alignas + Feature record: CXX_FEATURE:1cxx_alignof + Feature record: CXX_FEATURE:1cxx_attributes + Feature record: CXX_FEATURE:1cxx_attribute_deprecated + Feature record: CXX_FEATURE:1cxx_auto_type + Feature record: CXX_FEATURE:1cxx_binary_literals + Feature record: CXX_FEATURE:1cxx_constexpr + Feature record: CXX_FEATURE:1cxx_contextual_conversions + Feature record: CXX_FEATURE:1cxx_decltype + Feature record: CXX_FEATURE:1cxx_decltype_auto + Feature record: CXX_FEATURE:1cxx_decltype_incomplete_return_types + Feature record: CXX_FEATURE:1cxx_default_function_template_args + Feature record: CXX_FEATURE:1cxx_defaulted_functions + Feature record: CXX_FEATURE:1cxx_defaulted_move_initializers + Feature record: CXX_FEATURE:1cxx_delegating_constructors + Feature record: CXX_FEATURE:1cxx_deleted_functions + Feature record: CXX_FEATURE:1cxx_digit_separators + Feature record: CXX_FEATURE:1cxx_enum_forward_declarations + Feature record: CXX_FEATURE:1cxx_explicit_conversions + Feature record: CXX_FEATURE:1cxx_extended_friend_declarations + Feature record: CXX_FEATURE:1cxx_extern_templates + Feature record: CXX_FEATURE:1cxx_final + Feature record: CXX_FEATURE:1cxx_func_identifier + Feature record: CXX_FEATURE:1cxx_generalized_initializers + Feature record: CXX_FEATURE:1cxx_generic_lambdas + Feature record: CXX_FEATURE:1cxx_inheriting_constructors + Feature record: CXX_FEATURE:1cxx_inline_namespaces + Feature record: CXX_FEATURE:1cxx_lambdas + Feature record: CXX_FEATURE:1cxx_lambda_init_captures + Feature record: CXX_FEATURE:1cxx_local_type_template_args + Feature record: CXX_FEATURE:1cxx_long_long_type + Feature record: CXX_FEATURE:1cxx_noexcept + Feature record: CXX_FEATURE:1cxx_nonstatic_member_init + Feature record: CXX_FEATURE:1cxx_nullptr + Feature record: CXX_FEATURE:1cxx_override + Feature record: CXX_FEATURE:1cxx_range_for + Feature record: CXX_FEATURE:1cxx_raw_string_literals + Feature record: CXX_FEATURE:1cxx_reference_qualified_functions + Feature record: CXX_FEATURE:1cxx_relaxed_constexpr + Feature record: CXX_FEATURE:1cxx_return_type_deduction + Feature record: CXX_FEATURE:1cxx_right_angle_brackets + Feature record: CXX_FEATURE:1cxx_rvalue_references + Feature record: CXX_FEATURE:1cxx_sizeof_member + Feature record: CXX_FEATURE:1cxx_static_assert + Feature record: CXX_FEATURE:1cxx_strong_enums + Feature record: CXX_FEATURE:1cxx_template_template_parameters + Feature record: CXX_FEATURE:1cxx_thread_local + Feature record: CXX_FEATURE:1cxx_trailing_return_types + Feature record: CXX_FEATURE:1cxx_unicode_literals + Feature record: CXX_FEATURE:1cxx_uniform_initialization + Feature record: CXX_FEATURE:1cxx_unrestricted_unions + Feature record: CXX_FEATURE:1cxx_user_literals + Feature record: CXX_FEATURE:1cxx_variable_templates + Feature record: CXX_FEATURE:1cxx_variadic_macros + Feature record: CXX_FEATURE:1cxx_variadic_templates + + +Detecting CXX [-std=c++14] compiler features compiled with the following output: +Change Dir: /Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_bc7bf/fast" +/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_bc7bf.dir/build.make CMakeFiles/cmTC_bc7bf.dir/build +Building CXX object CMakeFiles/cmTC_bc7bf.dir/feature_tests.cxx.o +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -std=c++14 -o CMakeFiles/cmTC_bc7bf.dir/feature_tests.cxx.o -c /Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles/feature_tests.cxx +Linking CXX executable cmTC_bc7bf +/usr/local/Cellar/cmake/3.10.1/bin/cmake -E cmake_link_script CMakeFiles/cmTC_bc7bf.dir/link.txt --verbose=1 +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_bc7bf.dir/feature_tests.cxx.o -o cmTC_bc7bf + + + Feature record: CXX_FEATURE:1cxx_aggregate_default_initializers + Feature record: CXX_FEATURE:1cxx_alias_templates + Feature record: CXX_FEATURE:1cxx_alignas + Feature record: CXX_FEATURE:1cxx_alignof + Feature record: CXX_FEATURE:1cxx_attributes + Feature record: CXX_FEATURE:1cxx_attribute_deprecated + Feature record: CXX_FEATURE:1cxx_auto_type + Feature record: CXX_FEATURE:1cxx_binary_literals + Feature record: CXX_FEATURE:1cxx_constexpr + Feature record: CXX_FEATURE:1cxx_contextual_conversions + Feature record: CXX_FEATURE:1cxx_decltype + Feature record: CXX_FEATURE:1cxx_decltype_auto + Feature record: CXX_FEATURE:1cxx_decltype_incomplete_return_types + Feature record: CXX_FEATURE:1cxx_default_function_template_args + Feature record: CXX_FEATURE:1cxx_defaulted_functions + Feature record: CXX_FEATURE:1cxx_defaulted_move_initializers + Feature record: CXX_FEATURE:1cxx_delegating_constructors + Feature record: CXX_FEATURE:1cxx_deleted_functions + Feature record: CXX_FEATURE:1cxx_digit_separators + Feature record: CXX_FEATURE:1cxx_enum_forward_declarations + Feature record: CXX_FEATURE:1cxx_explicit_conversions + Feature record: CXX_FEATURE:1cxx_extended_friend_declarations + Feature record: CXX_FEATURE:1cxx_extern_templates + Feature record: CXX_FEATURE:1cxx_final + Feature record: CXX_FEATURE:1cxx_func_identifier + Feature record: CXX_FEATURE:1cxx_generalized_initializers + Feature record: CXX_FEATURE:1cxx_generic_lambdas + Feature record: CXX_FEATURE:1cxx_inheriting_constructors + Feature record: CXX_FEATURE:1cxx_inline_namespaces + Feature record: CXX_FEATURE:1cxx_lambdas + Feature record: CXX_FEATURE:1cxx_lambda_init_captures + Feature record: CXX_FEATURE:1cxx_local_type_template_args + Feature record: CXX_FEATURE:1cxx_long_long_type + Feature record: CXX_FEATURE:1cxx_noexcept + Feature record: CXX_FEATURE:1cxx_nonstatic_member_init + Feature record: CXX_FEATURE:1cxx_nullptr + Feature record: CXX_FEATURE:1cxx_override + Feature record: CXX_FEATURE:1cxx_range_for + Feature record: CXX_FEATURE:1cxx_raw_string_literals + Feature record: CXX_FEATURE:1cxx_reference_qualified_functions + Feature record: CXX_FEATURE:1cxx_relaxed_constexpr + Feature record: CXX_FEATURE:1cxx_return_type_deduction + Feature record: CXX_FEATURE:1cxx_right_angle_brackets + Feature record: CXX_FEATURE:1cxx_rvalue_references + Feature record: CXX_FEATURE:1cxx_sizeof_member + Feature record: CXX_FEATURE:1cxx_static_assert + Feature record: CXX_FEATURE:1cxx_strong_enums + Feature record: CXX_FEATURE:1cxx_template_template_parameters + Feature record: CXX_FEATURE:1cxx_thread_local + Feature record: CXX_FEATURE:1cxx_trailing_return_types + Feature record: CXX_FEATURE:1cxx_unicode_literals + Feature record: CXX_FEATURE:1cxx_uniform_initialization + Feature record: CXX_FEATURE:1cxx_unrestricted_unions + Feature record: CXX_FEATURE:1cxx_user_literals + Feature record: CXX_FEATURE:1cxx_variable_templates + Feature record: CXX_FEATURE:1cxx_variadic_macros + Feature record: CXX_FEATURE:1cxx_variadic_templates + + +Detecting CXX [-std=c++11] compiler features compiled with the following output: +Change Dir: /Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_823ec/fast" +/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_823ec.dir/build.make CMakeFiles/cmTC_823ec.dir/build +Building CXX object CMakeFiles/cmTC_823ec.dir/feature_tests.cxx.o +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -std=c++11 -o CMakeFiles/cmTC_823ec.dir/feature_tests.cxx.o -c /Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles/feature_tests.cxx +Linking CXX executable cmTC_823ec +/usr/local/Cellar/cmake/3.10.1/bin/cmake -E cmake_link_script CMakeFiles/cmTC_823ec.dir/link.txt --verbose=1 +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_823ec.dir/feature_tests.cxx.o -o cmTC_823ec + + + Feature record: CXX_FEATURE:0cxx_aggregate_default_initializers + Feature record: CXX_FEATURE:1cxx_alias_templates + Feature record: CXX_FEATURE:1cxx_alignas + Feature record: CXX_FEATURE:1cxx_alignof + Feature record: CXX_FEATURE:1cxx_attributes + Feature record: CXX_FEATURE:0cxx_attribute_deprecated + Feature record: CXX_FEATURE:1cxx_auto_type + Feature record: CXX_FEATURE:0cxx_binary_literals + Feature record: CXX_FEATURE:1cxx_constexpr + Feature record: CXX_FEATURE:0cxx_contextual_conversions + Feature record: CXX_FEATURE:1cxx_decltype + Feature record: CXX_FEATURE:0cxx_decltype_auto + Feature record: CXX_FEATURE:1cxx_decltype_incomplete_return_types + Feature record: CXX_FEATURE:1cxx_default_function_template_args + Feature record: CXX_FEATURE:1cxx_defaulted_functions + Feature record: CXX_FEATURE:1cxx_defaulted_move_initializers + Feature record: CXX_FEATURE:1cxx_delegating_constructors + Feature record: CXX_FEATURE:1cxx_deleted_functions + Feature record: CXX_FEATURE:0cxx_digit_separators + Feature record: CXX_FEATURE:1cxx_enum_forward_declarations + Feature record: CXX_FEATURE:1cxx_explicit_conversions + Feature record: CXX_FEATURE:1cxx_extended_friend_declarations + Feature record: CXX_FEATURE:1cxx_extern_templates + Feature record: CXX_FEATURE:1cxx_final + Feature record: CXX_FEATURE:1cxx_func_identifier + Feature record: CXX_FEATURE:1cxx_generalized_initializers + Feature record: CXX_FEATURE:0cxx_generic_lambdas + Feature record: CXX_FEATURE:1cxx_inheriting_constructors + Feature record: CXX_FEATURE:1cxx_inline_namespaces + Feature record: CXX_FEATURE:1cxx_lambdas + Feature record: CXX_FEATURE:0cxx_lambda_init_captures + Feature record: CXX_FEATURE:1cxx_local_type_template_args + Feature record: CXX_FEATURE:1cxx_long_long_type + Feature record: CXX_FEATURE:1cxx_noexcept + Feature record: CXX_FEATURE:1cxx_nonstatic_member_init + Feature record: CXX_FEATURE:1cxx_nullptr + Feature record: CXX_FEATURE:1cxx_override + Feature record: CXX_FEATURE:1cxx_range_for + Feature record: CXX_FEATURE:1cxx_raw_string_literals + Feature record: CXX_FEATURE:1cxx_reference_qualified_functions + Feature record: CXX_FEATURE:0cxx_relaxed_constexpr + Feature record: CXX_FEATURE:0cxx_return_type_deduction + Feature record: CXX_FEATURE:1cxx_right_angle_brackets + Feature record: CXX_FEATURE:1cxx_rvalue_references + Feature record: CXX_FEATURE:1cxx_sizeof_member + Feature record: CXX_FEATURE:1cxx_static_assert + Feature record: CXX_FEATURE:1cxx_strong_enums + Feature record: CXX_FEATURE:1cxx_template_template_parameters + Feature record: CXX_FEATURE:1cxx_thread_local + Feature record: CXX_FEATURE:1cxx_trailing_return_types + Feature record: CXX_FEATURE:1cxx_unicode_literals + Feature record: CXX_FEATURE:1cxx_uniform_initialization + Feature record: CXX_FEATURE:1cxx_unrestricted_unions + Feature record: CXX_FEATURE:1cxx_user_literals + Feature record: CXX_FEATURE:0cxx_variable_templates + Feature record: CXX_FEATURE:1cxx_variadic_macros + Feature record: CXX_FEATURE:1cxx_variadic_templates + + +Detecting CXX [-std=c++98] compiler features compiled with the following output: +Change Dir: /Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_bda98/fast" +/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_bda98.dir/build.make CMakeFiles/cmTC_bda98.dir/build +Building CXX object CMakeFiles/cmTC_bda98.dir/feature_tests.cxx.o +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -std=c++98 -o CMakeFiles/cmTC_bda98.dir/feature_tests.cxx.o -c /Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles/feature_tests.cxx +Linking CXX executable cmTC_bda98 +/usr/local/Cellar/cmake/3.10.1/bin/cmake -E cmake_link_script CMakeFiles/cmTC_bda98.dir/link.txt --verbose=1 +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_bda98.dir/feature_tests.cxx.o -o cmTC_bda98 + + + Feature record: CXX_FEATURE:0cxx_aggregate_default_initializers + Feature record: CXX_FEATURE:0cxx_alias_templates + Feature record: CXX_FEATURE:0cxx_alignas + Feature record: CXX_FEATURE:0cxx_alignof + Feature record: CXX_FEATURE:0cxx_attributes + Feature record: CXX_FEATURE:0cxx_attribute_deprecated + Feature record: CXX_FEATURE:0cxx_auto_type + Feature record: CXX_FEATURE:0cxx_binary_literals + Feature record: CXX_FEATURE:0cxx_constexpr + Feature record: CXX_FEATURE:0cxx_contextual_conversions + Feature record: CXX_FEATURE:0cxx_decltype + Feature record: CXX_FEATURE:0cxx_decltype_auto + Feature record: CXX_FEATURE:0cxx_decltype_incomplete_return_types + Feature record: CXX_FEATURE:0cxx_default_function_template_args + Feature record: CXX_FEATURE:0cxx_defaulted_functions + Feature record: CXX_FEATURE:0cxx_defaulted_move_initializers + Feature record: CXX_FEATURE:0cxx_delegating_constructors + Feature record: CXX_FEATURE:0cxx_deleted_functions + Feature record: CXX_FEATURE:0cxx_digit_separators + Feature record: CXX_FEATURE:0cxx_enum_forward_declarations + Feature record: CXX_FEATURE:0cxx_explicit_conversions + Feature record: CXX_FEATURE:0cxx_extended_friend_declarations + Feature record: CXX_FEATURE:0cxx_extern_templates + Feature record: CXX_FEATURE:0cxx_final + Feature record: CXX_FEATURE:0cxx_func_identifier + Feature record: CXX_FEATURE:0cxx_generalized_initializers + Feature record: CXX_FEATURE:0cxx_generic_lambdas + Feature record: CXX_FEATURE:0cxx_inheriting_constructors + Feature record: CXX_FEATURE:0cxx_inline_namespaces + Feature record: CXX_FEATURE:0cxx_lambdas + Feature record: CXX_FEATURE:0cxx_lambda_init_captures + Feature record: CXX_FEATURE:0cxx_local_type_template_args + Feature record: CXX_FEATURE:0cxx_long_long_type + Feature record: CXX_FEATURE:0cxx_noexcept + Feature record: CXX_FEATURE:0cxx_nonstatic_member_init + Feature record: CXX_FEATURE:0cxx_nullptr + Feature record: CXX_FEATURE:0cxx_override + Feature record: CXX_FEATURE:0cxx_range_for + Feature record: CXX_FEATURE:0cxx_raw_string_literals + Feature record: CXX_FEATURE:0cxx_reference_qualified_functions + Feature record: CXX_FEATURE:0cxx_relaxed_constexpr + Feature record: CXX_FEATURE:0cxx_return_type_deduction + Feature record: CXX_FEATURE:0cxx_right_angle_brackets + Feature record: CXX_FEATURE:0cxx_rvalue_references + Feature record: CXX_FEATURE:0cxx_sizeof_member + Feature record: CXX_FEATURE:0cxx_static_assert + Feature record: CXX_FEATURE:0cxx_strong_enums + Feature record: CXX_FEATURE:1cxx_template_template_parameters + Feature record: CXX_FEATURE:0cxx_thread_local + Feature record: CXX_FEATURE:0cxx_trailing_return_types + Feature record: CXX_FEATURE:0cxx_unicode_literals + Feature record: CXX_FEATURE:0cxx_uniform_initialization + Feature record: CXX_FEATURE:0cxx_unrestricted_unions + Feature record: CXX_FEATURE:0cxx_user_literals + Feature record: CXX_FEATURE:0cxx_variable_templates + Feature record: CXX_FEATURE:0cxx_variadic_macros + Feature record: CXX_FEATURE:0cxx_variadic_templates diff --git a/src/libs/DSPatch/CMakeFiles/DSPatch.dir/CXX.includecache b/src/libs/DSPatch/CMakeFiles/DSPatch.dir/CXX.includecache new file mode 100644 index 0000000..ffb562d --- /dev/null +++ b/src/libs/DSPatch/CMakeFiles/DSPatch.dir/CXX.includecache @@ -0,0 +1,184 @@ +#IncludeRegexLine: ^[ ]*[#%][ ]*(include|import)[ ]*[<"]([^">]+)([">]) + +#IncludeRegexScan: ^.*$ + +#IncludeRegexComplain: ^$ + +#IncludeRegexTransform: + +/Users/benjamin/orchestra/src/libs/DSPatch/src/DSPatch.cpp +DSPatch.h +- + +/Users/benjamin/orchestra/src/libs/DSPatch/src/DspCircuit.cpp +dspatch/DspCircuit.h +- +dspatch/DspCircuitThread.h +- +dspatch/DspWire.h +- + +/Users/benjamin/orchestra/src/libs/DSPatch/src/DspCircuitThread.cpp +dspatch/DspCircuitThread.h +- +dspatch/DspComponent.h +- + +/Users/benjamin/orchestra/src/libs/DSPatch/src/DspComponent.cpp +DSPatch.h +- +dspatch/DspCircuit.h +- +dspatch/DspComponent.h +- +dspatch/DspComponentThread.h +- +dspatch/DspWire.h +- + +/Users/benjamin/orchestra/src/libs/DSPatch/src/DspComponentThread.cpp +dspatch/DspComponentThread.h +- +dspatch/DspComponent.h +- + +/Users/benjamin/orchestra/src/libs/DSPatch/src/DspParameter.cpp +dspatch/DspParameter.h +- + +/Users/benjamin/orchestra/src/libs/DSPatch/src/DspPlugin.cpp +dspatch/DspPlugin.h +- + +/Users/benjamin/orchestra/src/libs/DSPatch/src/DspPluginLoader.cpp +dspatch/DspPluginLoader.h +- +windows.h +- +dlfcn.h +- + +/Users/benjamin/orchestra/src/libs/DSPatch/src/DspSignal.cpp +dspatch/DspSignal.h +- + +/Users/benjamin/orchestra/src/libs/DSPatch/src/DspSignalBus.cpp +dspatch/DspSignalBus.h +- + +/Users/benjamin/orchestra/src/libs/DSPatch/src/DspWireBus.cpp +dspatch/DspWireBus.h +- +dspatch/DspComponent.h +- +dspatch/DspWire.h +- + +include/DSPatch.h +dspatch/DspCircuit.h +- +dspatch/DspPluginLoader.h +- +DSPatch.h +- +components.h +- + +include/dspatch/DspCircuit.h +dspatch/DspComponent.h +- +dspatch/DspWireBus.h +- +dspatch/DspCircuitThread.h +- + +include/dspatch/DspCircuitThread.h +vector +- +dspatch/DspThread.h +- + +include/dspatch/DspComponent.h +dspatch/DspSignalBus.h +- +dspatch/DspWireBus.h +- +dspatch/DspComponentThread.h +- +dspatch/DspParameter.h +- + +include/dspatch/DspComponentThread.h +dspatch/DspThread.h +- + +include/dspatch/DspParameter.h +dspatch/DspThread.h +- +string +- +vector +- + +include/dspatch/DspPlugin.h +dspatch/DspComponent.h +- +map +- +string +- + +include/dspatch/DspPluginLoader.h +dspatch/DspPlugin.h +- + +include/dspatch/DspRunType.h +utility +- +typeinfo +- + +include/dspatch/DspSignal.h +string +- +vector +- +dspatch/DspRunType.h +- +dspatch/DspThread.h +- + +include/dspatch/DspSignalBus.h +dspatch/DspSignal.h +- + +include/dspatch/DspThread.h +dspatch/DspThreadWin.h +- +dspatch/DspThreadNull.h +- +dspatch/DspThreadUnix.h +- + +include/dspatch/DspThreadNull.h + +include/dspatch/DspThreadUnix.h +pthread.h +- +unistd.h +- + +include/dspatch/DspThreadWin.h +windows.h +- + +include/dspatch/DspWire.h + +include/dspatch/DspWireBus.h +vector +- +dspatch/DspWire.h +- +dspatch/DspThread.h +- + diff --git a/src/libs/DSPatch/CMakeFiles/DSPatch.dir/DependInfo.cmake b/src/libs/DSPatch/CMakeFiles/DSPatch.dir/DependInfo.cmake new file mode 100644 index 0000000..cb30d8a --- /dev/null +++ b/src/libs/DSPatch/CMakeFiles/DSPatch.dir/DependInfo.cmake @@ -0,0 +1,31 @@ +# The set of languages for which implicit dependencies are needed: +set(CMAKE_DEPENDS_LANGUAGES + "CXX" + ) +# The set of files for implicit dependencies of each language: +set(CMAKE_DEPENDS_CHECK_CXX + "/Users/benjamin/orchestra/src/libs/DSPatch/src/DSPatch.cpp" "/Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles/DSPatch.dir/src/DSPatch.cpp.o" + "/Users/benjamin/orchestra/src/libs/DSPatch/src/DspCircuit.cpp" "/Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles/DSPatch.dir/src/DspCircuit.cpp.o" + "/Users/benjamin/orchestra/src/libs/DSPatch/src/DspCircuitThread.cpp" "/Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles/DSPatch.dir/src/DspCircuitThread.cpp.o" + "/Users/benjamin/orchestra/src/libs/DSPatch/src/DspComponent.cpp" "/Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles/DSPatch.dir/src/DspComponent.cpp.o" + "/Users/benjamin/orchestra/src/libs/DSPatch/src/DspComponentThread.cpp" "/Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles/DSPatch.dir/src/DspComponentThread.cpp.o" + "/Users/benjamin/orchestra/src/libs/DSPatch/src/DspParameter.cpp" "/Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles/DSPatch.dir/src/DspParameter.cpp.o" + "/Users/benjamin/orchestra/src/libs/DSPatch/src/DspPlugin.cpp" "/Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles/DSPatch.dir/src/DspPlugin.cpp.o" + "/Users/benjamin/orchestra/src/libs/DSPatch/src/DspPluginLoader.cpp" "/Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles/DSPatch.dir/src/DspPluginLoader.cpp.o" + "/Users/benjamin/orchestra/src/libs/DSPatch/src/DspSignal.cpp" "/Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles/DSPatch.dir/src/DspSignal.cpp.o" + "/Users/benjamin/orchestra/src/libs/DSPatch/src/DspSignalBus.cpp" "/Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles/DSPatch.dir/src/DspSignalBus.cpp.o" + "/Users/benjamin/orchestra/src/libs/DSPatch/src/DspWireBus.cpp" "/Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles/DSPatch.dir/src/DspWireBus.cpp.o" + ) +set(CMAKE_CXX_COMPILER_ID "Clang") + +# The include file search paths: +set(CMAKE_CXX_TARGET_INCLUDE_PATH + "include" + ) + +# Targets to which this target links. +set(CMAKE_TARGET_LINKED_INFO_FILES + ) + +# Fortran module output directory. +set(CMAKE_Fortran_TARGET_MODULE_DIR "") diff --git a/src/libs/DSPatch/CMakeFiles/DSPatch.dir/build.make b/src/libs/DSPatch/CMakeFiles/DSPatch.dir/build.make new file mode 100644 index 0000000..9d5816d --- /dev/null +++ b/src/libs/DSPatch/CMakeFiles/DSPatch.dir/build.make @@ -0,0 +1,383 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.10 + +# Delete rule output on recipe failure. +.DELETE_ON_ERROR: + + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + + +# Remove some rules from gmake that .SUFFIXES does not remove. +SUFFIXES = + +.SUFFIXES: .hpux_make_needs_suffix_list + + +# Suppress display of executed commands. +$(VERBOSE).SILENT: + + +# A target that is always out of date. +cmake_force: + +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/local/Cellar/cmake/3.10.1/bin/cmake + +# The command to remove a file. +RM = /usr/local/Cellar/cmake/3.10.1/bin/cmake -E remove -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /Users/benjamin/orchestra/src/libs/DSPatch + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /Users/benjamin/orchestra/src/libs/DSPatch + +# Include any dependencies generated for this target. +include CMakeFiles/DSPatch.dir/depend.make + +# Include the progress variables for this target. +include CMakeFiles/DSPatch.dir/progress.make + +# Include the compile flags for this target's objects. +include CMakeFiles/DSPatch.dir/flags.make + +CMakeFiles/DSPatch.dir/src/DSPatch.cpp.o: CMakeFiles/DSPatch.dir/flags.make +CMakeFiles/DSPatch.dir/src/DSPatch.cpp.o: src/DSPatch.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building CXX object CMakeFiles/DSPatch.dir/src/DSPatch.cpp.o" + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/DSPatch.dir/src/DSPatch.cpp.o -c /Users/benjamin/orchestra/src/libs/DSPatch/src/DSPatch.cpp + +CMakeFiles/DSPatch.dir/src/DSPatch.cpp.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/DSPatch.dir/src/DSPatch.cpp.i" + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /Users/benjamin/orchestra/src/libs/DSPatch/src/DSPatch.cpp > CMakeFiles/DSPatch.dir/src/DSPatch.cpp.i + +CMakeFiles/DSPatch.dir/src/DSPatch.cpp.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/DSPatch.dir/src/DSPatch.cpp.s" + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /Users/benjamin/orchestra/src/libs/DSPatch/src/DSPatch.cpp -o CMakeFiles/DSPatch.dir/src/DSPatch.cpp.s + +CMakeFiles/DSPatch.dir/src/DSPatch.cpp.o.requires: + +.PHONY : CMakeFiles/DSPatch.dir/src/DSPatch.cpp.o.requires + +CMakeFiles/DSPatch.dir/src/DSPatch.cpp.o.provides: CMakeFiles/DSPatch.dir/src/DSPatch.cpp.o.requires + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/src/DSPatch.cpp.o.provides.build +.PHONY : CMakeFiles/DSPatch.dir/src/DSPatch.cpp.o.provides + +CMakeFiles/DSPatch.dir/src/DSPatch.cpp.o.provides.build: CMakeFiles/DSPatch.dir/src/DSPatch.cpp.o + + +CMakeFiles/DSPatch.dir/src/DspCircuit.cpp.o: CMakeFiles/DSPatch.dir/flags.make +CMakeFiles/DSPatch.dir/src/DspCircuit.cpp.o: src/DspCircuit.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Building CXX object CMakeFiles/DSPatch.dir/src/DspCircuit.cpp.o" + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/DSPatch.dir/src/DspCircuit.cpp.o -c /Users/benjamin/orchestra/src/libs/DSPatch/src/DspCircuit.cpp + +CMakeFiles/DSPatch.dir/src/DspCircuit.cpp.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/DSPatch.dir/src/DspCircuit.cpp.i" + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /Users/benjamin/orchestra/src/libs/DSPatch/src/DspCircuit.cpp > CMakeFiles/DSPatch.dir/src/DspCircuit.cpp.i + +CMakeFiles/DSPatch.dir/src/DspCircuit.cpp.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/DSPatch.dir/src/DspCircuit.cpp.s" + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /Users/benjamin/orchestra/src/libs/DSPatch/src/DspCircuit.cpp -o CMakeFiles/DSPatch.dir/src/DspCircuit.cpp.s + +CMakeFiles/DSPatch.dir/src/DspCircuit.cpp.o.requires: + +.PHONY : CMakeFiles/DSPatch.dir/src/DspCircuit.cpp.o.requires + +CMakeFiles/DSPatch.dir/src/DspCircuit.cpp.o.provides: CMakeFiles/DSPatch.dir/src/DspCircuit.cpp.o.requires + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/src/DspCircuit.cpp.o.provides.build +.PHONY : CMakeFiles/DSPatch.dir/src/DspCircuit.cpp.o.provides + +CMakeFiles/DSPatch.dir/src/DspCircuit.cpp.o.provides.build: CMakeFiles/DSPatch.dir/src/DspCircuit.cpp.o + + +CMakeFiles/DSPatch.dir/src/DspCircuitThread.cpp.o: CMakeFiles/DSPatch.dir/flags.make +CMakeFiles/DSPatch.dir/src/DspCircuitThread.cpp.o: src/DspCircuitThread.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles --progress-num=$(CMAKE_PROGRESS_3) "Building CXX object CMakeFiles/DSPatch.dir/src/DspCircuitThread.cpp.o" + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/DSPatch.dir/src/DspCircuitThread.cpp.o -c /Users/benjamin/orchestra/src/libs/DSPatch/src/DspCircuitThread.cpp + +CMakeFiles/DSPatch.dir/src/DspCircuitThread.cpp.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/DSPatch.dir/src/DspCircuitThread.cpp.i" + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /Users/benjamin/orchestra/src/libs/DSPatch/src/DspCircuitThread.cpp > CMakeFiles/DSPatch.dir/src/DspCircuitThread.cpp.i + +CMakeFiles/DSPatch.dir/src/DspCircuitThread.cpp.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/DSPatch.dir/src/DspCircuitThread.cpp.s" + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /Users/benjamin/orchestra/src/libs/DSPatch/src/DspCircuitThread.cpp -o CMakeFiles/DSPatch.dir/src/DspCircuitThread.cpp.s + +CMakeFiles/DSPatch.dir/src/DspCircuitThread.cpp.o.requires: + +.PHONY : CMakeFiles/DSPatch.dir/src/DspCircuitThread.cpp.o.requires + +CMakeFiles/DSPatch.dir/src/DspCircuitThread.cpp.o.provides: CMakeFiles/DSPatch.dir/src/DspCircuitThread.cpp.o.requires + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/src/DspCircuitThread.cpp.o.provides.build +.PHONY : CMakeFiles/DSPatch.dir/src/DspCircuitThread.cpp.o.provides + +CMakeFiles/DSPatch.dir/src/DspCircuitThread.cpp.o.provides.build: CMakeFiles/DSPatch.dir/src/DspCircuitThread.cpp.o + + +CMakeFiles/DSPatch.dir/src/DspComponent.cpp.o: CMakeFiles/DSPatch.dir/flags.make +CMakeFiles/DSPatch.dir/src/DspComponent.cpp.o: src/DspComponent.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles --progress-num=$(CMAKE_PROGRESS_4) "Building CXX object CMakeFiles/DSPatch.dir/src/DspComponent.cpp.o" + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/DSPatch.dir/src/DspComponent.cpp.o -c /Users/benjamin/orchestra/src/libs/DSPatch/src/DspComponent.cpp + +CMakeFiles/DSPatch.dir/src/DspComponent.cpp.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/DSPatch.dir/src/DspComponent.cpp.i" + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /Users/benjamin/orchestra/src/libs/DSPatch/src/DspComponent.cpp > CMakeFiles/DSPatch.dir/src/DspComponent.cpp.i + +CMakeFiles/DSPatch.dir/src/DspComponent.cpp.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/DSPatch.dir/src/DspComponent.cpp.s" + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /Users/benjamin/orchestra/src/libs/DSPatch/src/DspComponent.cpp -o CMakeFiles/DSPatch.dir/src/DspComponent.cpp.s + +CMakeFiles/DSPatch.dir/src/DspComponent.cpp.o.requires: + +.PHONY : CMakeFiles/DSPatch.dir/src/DspComponent.cpp.o.requires + +CMakeFiles/DSPatch.dir/src/DspComponent.cpp.o.provides: CMakeFiles/DSPatch.dir/src/DspComponent.cpp.o.requires + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/src/DspComponent.cpp.o.provides.build +.PHONY : CMakeFiles/DSPatch.dir/src/DspComponent.cpp.o.provides + +CMakeFiles/DSPatch.dir/src/DspComponent.cpp.o.provides.build: CMakeFiles/DSPatch.dir/src/DspComponent.cpp.o + + +CMakeFiles/DSPatch.dir/src/DspComponentThread.cpp.o: CMakeFiles/DSPatch.dir/flags.make +CMakeFiles/DSPatch.dir/src/DspComponentThread.cpp.o: src/DspComponentThread.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles --progress-num=$(CMAKE_PROGRESS_5) "Building CXX object CMakeFiles/DSPatch.dir/src/DspComponentThread.cpp.o" + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/DSPatch.dir/src/DspComponentThread.cpp.o -c /Users/benjamin/orchestra/src/libs/DSPatch/src/DspComponentThread.cpp + +CMakeFiles/DSPatch.dir/src/DspComponentThread.cpp.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/DSPatch.dir/src/DspComponentThread.cpp.i" + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /Users/benjamin/orchestra/src/libs/DSPatch/src/DspComponentThread.cpp > CMakeFiles/DSPatch.dir/src/DspComponentThread.cpp.i + +CMakeFiles/DSPatch.dir/src/DspComponentThread.cpp.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/DSPatch.dir/src/DspComponentThread.cpp.s" + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /Users/benjamin/orchestra/src/libs/DSPatch/src/DspComponentThread.cpp -o CMakeFiles/DSPatch.dir/src/DspComponentThread.cpp.s + +CMakeFiles/DSPatch.dir/src/DspComponentThread.cpp.o.requires: + +.PHONY : CMakeFiles/DSPatch.dir/src/DspComponentThread.cpp.o.requires + +CMakeFiles/DSPatch.dir/src/DspComponentThread.cpp.o.provides: CMakeFiles/DSPatch.dir/src/DspComponentThread.cpp.o.requires + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/src/DspComponentThread.cpp.o.provides.build +.PHONY : CMakeFiles/DSPatch.dir/src/DspComponentThread.cpp.o.provides + +CMakeFiles/DSPatch.dir/src/DspComponentThread.cpp.o.provides.build: CMakeFiles/DSPatch.dir/src/DspComponentThread.cpp.o + + +CMakeFiles/DSPatch.dir/src/DspParameter.cpp.o: CMakeFiles/DSPatch.dir/flags.make +CMakeFiles/DSPatch.dir/src/DspParameter.cpp.o: src/DspParameter.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles --progress-num=$(CMAKE_PROGRESS_6) "Building CXX object CMakeFiles/DSPatch.dir/src/DspParameter.cpp.o" + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/DSPatch.dir/src/DspParameter.cpp.o -c /Users/benjamin/orchestra/src/libs/DSPatch/src/DspParameter.cpp + +CMakeFiles/DSPatch.dir/src/DspParameter.cpp.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/DSPatch.dir/src/DspParameter.cpp.i" + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /Users/benjamin/orchestra/src/libs/DSPatch/src/DspParameter.cpp > CMakeFiles/DSPatch.dir/src/DspParameter.cpp.i + +CMakeFiles/DSPatch.dir/src/DspParameter.cpp.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/DSPatch.dir/src/DspParameter.cpp.s" + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /Users/benjamin/orchestra/src/libs/DSPatch/src/DspParameter.cpp -o CMakeFiles/DSPatch.dir/src/DspParameter.cpp.s + +CMakeFiles/DSPatch.dir/src/DspParameter.cpp.o.requires: + +.PHONY : CMakeFiles/DSPatch.dir/src/DspParameter.cpp.o.requires + +CMakeFiles/DSPatch.dir/src/DspParameter.cpp.o.provides: CMakeFiles/DSPatch.dir/src/DspParameter.cpp.o.requires + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/src/DspParameter.cpp.o.provides.build +.PHONY : CMakeFiles/DSPatch.dir/src/DspParameter.cpp.o.provides + +CMakeFiles/DSPatch.dir/src/DspParameter.cpp.o.provides.build: CMakeFiles/DSPatch.dir/src/DspParameter.cpp.o + + +CMakeFiles/DSPatch.dir/src/DspPlugin.cpp.o: CMakeFiles/DSPatch.dir/flags.make +CMakeFiles/DSPatch.dir/src/DspPlugin.cpp.o: src/DspPlugin.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles --progress-num=$(CMAKE_PROGRESS_7) "Building CXX object CMakeFiles/DSPatch.dir/src/DspPlugin.cpp.o" + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/DSPatch.dir/src/DspPlugin.cpp.o -c /Users/benjamin/orchestra/src/libs/DSPatch/src/DspPlugin.cpp + +CMakeFiles/DSPatch.dir/src/DspPlugin.cpp.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/DSPatch.dir/src/DspPlugin.cpp.i" + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /Users/benjamin/orchestra/src/libs/DSPatch/src/DspPlugin.cpp > CMakeFiles/DSPatch.dir/src/DspPlugin.cpp.i + +CMakeFiles/DSPatch.dir/src/DspPlugin.cpp.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/DSPatch.dir/src/DspPlugin.cpp.s" + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /Users/benjamin/orchestra/src/libs/DSPatch/src/DspPlugin.cpp -o CMakeFiles/DSPatch.dir/src/DspPlugin.cpp.s + +CMakeFiles/DSPatch.dir/src/DspPlugin.cpp.o.requires: + +.PHONY : CMakeFiles/DSPatch.dir/src/DspPlugin.cpp.o.requires + +CMakeFiles/DSPatch.dir/src/DspPlugin.cpp.o.provides: CMakeFiles/DSPatch.dir/src/DspPlugin.cpp.o.requires + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/src/DspPlugin.cpp.o.provides.build +.PHONY : CMakeFiles/DSPatch.dir/src/DspPlugin.cpp.o.provides + +CMakeFiles/DSPatch.dir/src/DspPlugin.cpp.o.provides.build: CMakeFiles/DSPatch.dir/src/DspPlugin.cpp.o + + +CMakeFiles/DSPatch.dir/src/DspPluginLoader.cpp.o: CMakeFiles/DSPatch.dir/flags.make +CMakeFiles/DSPatch.dir/src/DspPluginLoader.cpp.o: src/DspPluginLoader.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles --progress-num=$(CMAKE_PROGRESS_8) "Building CXX object CMakeFiles/DSPatch.dir/src/DspPluginLoader.cpp.o" + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/DSPatch.dir/src/DspPluginLoader.cpp.o -c /Users/benjamin/orchestra/src/libs/DSPatch/src/DspPluginLoader.cpp + +CMakeFiles/DSPatch.dir/src/DspPluginLoader.cpp.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/DSPatch.dir/src/DspPluginLoader.cpp.i" + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /Users/benjamin/orchestra/src/libs/DSPatch/src/DspPluginLoader.cpp > CMakeFiles/DSPatch.dir/src/DspPluginLoader.cpp.i + +CMakeFiles/DSPatch.dir/src/DspPluginLoader.cpp.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/DSPatch.dir/src/DspPluginLoader.cpp.s" + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /Users/benjamin/orchestra/src/libs/DSPatch/src/DspPluginLoader.cpp -o CMakeFiles/DSPatch.dir/src/DspPluginLoader.cpp.s + +CMakeFiles/DSPatch.dir/src/DspPluginLoader.cpp.o.requires: + +.PHONY : CMakeFiles/DSPatch.dir/src/DspPluginLoader.cpp.o.requires + +CMakeFiles/DSPatch.dir/src/DspPluginLoader.cpp.o.provides: CMakeFiles/DSPatch.dir/src/DspPluginLoader.cpp.o.requires + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/src/DspPluginLoader.cpp.o.provides.build +.PHONY : CMakeFiles/DSPatch.dir/src/DspPluginLoader.cpp.o.provides + +CMakeFiles/DSPatch.dir/src/DspPluginLoader.cpp.o.provides.build: CMakeFiles/DSPatch.dir/src/DspPluginLoader.cpp.o + + +CMakeFiles/DSPatch.dir/src/DspSignal.cpp.o: CMakeFiles/DSPatch.dir/flags.make +CMakeFiles/DSPatch.dir/src/DspSignal.cpp.o: src/DspSignal.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles --progress-num=$(CMAKE_PROGRESS_9) "Building CXX object CMakeFiles/DSPatch.dir/src/DspSignal.cpp.o" + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/DSPatch.dir/src/DspSignal.cpp.o -c /Users/benjamin/orchestra/src/libs/DSPatch/src/DspSignal.cpp + +CMakeFiles/DSPatch.dir/src/DspSignal.cpp.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/DSPatch.dir/src/DspSignal.cpp.i" + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /Users/benjamin/orchestra/src/libs/DSPatch/src/DspSignal.cpp > CMakeFiles/DSPatch.dir/src/DspSignal.cpp.i + +CMakeFiles/DSPatch.dir/src/DspSignal.cpp.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/DSPatch.dir/src/DspSignal.cpp.s" + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /Users/benjamin/orchestra/src/libs/DSPatch/src/DspSignal.cpp -o CMakeFiles/DSPatch.dir/src/DspSignal.cpp.s + +CMakeFiles/DSPatch.dir/src/DspSignal.cpp.o.requires: + +.PHONY : CMakeFiles/DSPatch.dir/src/DspSignal.cpp.o.requires + +CMakeFiles/DSPatch.dir/src/DspSignal.cpp.o.provides: CMakeFiles/DSPatch.dir/src/DspSignal.cpp.o.requires + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/src/DspSignal.cpp.o.provides.build +.PHONY : CMakeFiles/DSPatch.dir/src/DspSignal.cpp.o.provides + +CMakeFiles/DSPatch.dir/src/DspSignal.cpp.o.provides.build: CMakeFiles/DSPatch.dir/src/DspSignal.cpp.o + + +CMakeFiles/DSPatch.dir/src/DspSignalBus.cpp.o: CMakeFiles/DSPatch.dir/flags.make +CMakeFiles/DSPatch.dir/src/DspSignalBus.cpp.o: src/DspSignalBus.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles --progress-num=$(CMAKE_PROGRESS_10) "Building CXX object CMakeFiles/DSPatch.dir/src/DspSignalBus.cpp.o" + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/DSPatch.dir/src/DspSignalBus.cpp.o -c /Users/benjamin/orchestra/src/libs/DSPatch/src/DspSignalBus.cpp + +CMakeFiles/DSPatch.dir/src/DspSignalBus.cpp.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/DSPatch.dir/src/DspSignalBus.cpp.i" + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /Users/benjamin/orchestra/src/libs/DSPatch/src/DspSignalBus.cpp > CMakeFiles/DSPatch.dir/src/DspSignalBus.cpp.i + +CMakeFiles/DSPatch.dir/src/DspSignalBus.cpp.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/DSPatch.dir/src/DspSignalBus.cpp.s" + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /Users/benjamin/orchestra/src/libs/DSPatch/src/DspSignalBus.cpp -o CMakeFiles/DSPatch.dir/src/DspSignalBus.cpp.s + +CMakeFiles/DSPatch.dir/src/DspSignalBus.cpp.o.requires: + +.PHONY : CMakeFiles/DSPatch.dir/src/DspSignalBus.cpp.o.requires + +CMakeFiles/DSPatch.dir/src/DspSignalBus.cpp.o.provides: CMakeFiles/DSPatch.dir/src/DspSignalBus.cpp.o.requires + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/src/DspSignalBus.cpp.o.provides.build +.PHONY : CMakeFiles/DSPatch.dir/src/DspSignalBus.cpp.o.provides + +CMakeFiles/DSPatch.dir/src/DspSignalBus.cpp.o.provides.build: CMakeFiles/DSPatch.dir/src/DspSignalBus.cpp.o + + +CMakeFiles/DSPatch.dir/src/DspWireBus.cpp.o: CMakeFiles/DSPatch.dir/flags.make +CMakeFiles/DSPatch.dir/src/DspWireBus.cpp.o: src/DspWireBus.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles --progress-num=$(CMAKE_PROGRESS_11) "Building CXX object CMakeFiles/DSPatch.dir/src/DspWireBus.cpp.o" + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/DSPatch.dir/src/DspWireBus.cpp.o -c /Users/benjamin/orchestra/src/libs/DSPatch/src/DspWireBus.cpp + +CMakeFiles/DSPatch.dir/src/DspWireBus.cpp.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/DSPatch.dir/src/DspWireBus.cpp.i" + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /Users/benjamin/orchestra/src/libs/DSPatch/src/DspWireBus.cpp > CMakeFiles/DSPatch.dir/src/DspWireBus.cpp.i + +CMakeFiles/DSPatch.dir/src/DspWireBus.cpp.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/DSPatch.dir/src/DspWireBus.cpp.s" + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /Users/benjamin/orchestra/src/libs/DSPatch/src/DspWireBus.cpp -o CMakeFiles/DSPatch.dir/src/DspWireBus.cpp.s + +CMakeFiles/DSPatch.dir/src/DspWireBus.cpp.o.requires: + +.PHONY : CMakeFiles/DSPatch.dir/src/DspWireBus.cpp.o.requires + +CMakeFiles/DSPatch.dir/src/DspWireBus.cpp.o.provides: CMakeFiles/DSPatch.dir/src/DspWireBus.cpp.o.requires + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/src/DspWireBus.cpp.o.provides.build +.PHONY : CMakeFiles/DSPatch.dir/src/DspWireBus.cpp.o.provides + +CMakeFiles/DSPatch.dir/src/DspWireBus.cpp.o.provides.build: CMakeFiles/DSPatch.dir/src/DspWireBus.cpp.o + + +# Object files for target DSPatch +DSPatch_OBJECTS = \ +"CMakeFiles/DSPatch.dir/src/DSPatch.cpp.o" \ +"CMakeFiles/DSPatch.dir/src/DspCircuit.cpp.o" \ +"CMakeFiles/DSPatch.dir/src/DspCircuitThread.cpp.o" \ +"CMakeFiles/DSPatch.dir/src/DspComponent.cpp.o" \ +"CMakeFiles/DSPatch.dir/src/DspComponentThread.cpp.o" \ +"CMakeFiles/DSPatch.dir/src/DspParameter.cpp.o" \ +"CMakeFiles/DSPatch.dir/src/DspPlugin.cpp.o" \ +"CMakeFiles/DSPatch.dir/src/DspPluginLoader.cpp.o" \ +"CMakeFiles/DSPatch.dir/src/DspSignal.cpp.o" \ +"CMakeFiles/DSPatch.dir/src/DspSignalBus.cpp.o" \ +"CMakeFiles/DSPatch.dir/src/DspWireBus.cpp.o" + +# External object files for target DSPatch +DSPatch_EXTERNAL_OBJECTS = + +libDSPatch.dylib: CMakeFiles/DSPatch.dir/src/DSPatch.cpp.o +libDSPatch.dylib: CMakeFiles/DSPatch.dir/src/DspCircuit.cpp.o +libDSPatch.dylib: CMakeFiles/DSPatch.dir/src/DspCircuitThread.cpp.o +libDSPatch.dylib: CMakeFiles/DSPatch.dir/src/DspComponent.cpp.o +libDSPatch.dylib: CMakeFiles/DSPatch.dir/src/DspComponentThread.cpp.o +libDSPatch.dylib: CMakeFiles/DSPatch.dir/src/DspParameter.cpp.o +libDSPatch.dylib: CMakeFiles/DSPatch.dir/src/DspPlugin.cpp.o +libDSPatch.dylib: CMakeFiles/DSPatch.dir/src/DspPluginLoader.cpp.o +libDSPatch.dylib: CMakeFiles/DSPatch.dir/src/DspSignal.cpp.o +libDSPatch.dylib: CMakeFiles/DSPatch.dir/src/DspSignalBus.cpp.o +libDSPatch.dylib: CMakeFiles/DSPatch.dir/src/DspWireBus.cpp.o +libDSPatch.dylib: CMakeFiles/DSPatch.dir/build.make +libDSPatch.dylib: CMakeFiles/DSPatch.dir/link.txt + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles --progress-num=$(CMAKE_PROGRESS_12) "Linking CXX shared library libDSPatch.dylib" + $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/DSPatch.dir/link.txt --verbose=$(VERBOSE) + +# Rule to build all files generated by this target. +CMakeFiles/DSPatch.dir/build: libDSPatch.dylib + +.PHONY : CMakeFiles/DSPatch.dir/build + +CMakeFiles/DSPatch.dir/requires: CMakeFiles/DSPatch.dir/src/DSPatch.cpp.o.requires +CMakeFiles/DSPatch.dir/requires: CMakeFiles/DSPatch.dir/src/DspCircuit.cpp.o.requires +CMakeFiles/DSPatch.dir/requires: CMakeFiles/DSPatch.dir/src/DspCircuitThread.cpp.o.requires +CMakeFiles/DSPatch.dir/requires: CMakeFiles/DSPatch.dir/src/DspComponent.cpp.o.requires +CMakeFiles/DSPatch.dir/requires: CMakeFiles/DSPatch.dir/src/DspComponentThread.cpp.o.requires +CMakeFiles/DSPatch.dir/requires: CMakeFiles/DSPatch.dir/src/DspParameter.cpp.o.requires +CMakeFiles/DSPatch.dir/requires: CMakeFiles/DSPatch.dir/src/DspPlugin.cpp.o.requires +CMakeFiles/DSPatch.dir/requires: CMakeFiles/DSPatch.dir/src/DspPluginLoader.cpp.o.requires +CMakeFiles/DSPatch.dir/requires: CMakeFiles/DSPatch.dir/src/DspSignal.cpp.o.requires +CMakeFiles/DSPatch.dir/requires: CMakeFiles/DSPatch.dir/src/DspSignalBus.cpp.o.requires +CMakeFiles/DSPatch.dir/requires: CMakeFiles/DSPatch.dir/src/DspWireBus.cpp.o.requires + +.PHONY : CMakeFiles/DSPatch.dir/requires + +CMakeFiles/DSPatch.dir/clean: + $(CMAKE_COMMAND) -P CMakeFiles/DSPatch.dir/cmake_clean.cmake +.PHONY : CMakeFiles/DSPatch.dir/clean + +CMakeFiles/DSPatch.dir/depend: + cd /Users/benjamin/orchestra/src/libs/DSPatch && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /Users/benjamin/orchestra/src/libs/DSPatch /Users/benjamin/orchestra/src/libs/DSPatch /Users/benjamin/orchestra/src/libs/DSPatch /Users/benjamin/orchestra/src/libs/DSPatch /Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles/DSPatch.dir/DependInfo.cmake --color=$(COLOR) +.PHONY : CMakeFiles/DSPatch.dir/depend + diff --git a/src/libs/DSPatch/CMakeFiles/DSPatch.dir/cmake_clean.cmake b/src/libs/DSPatch/CMakeFiles/DSPatch.dir/cmake_clean.cmake new file mode 100644 index 0000000..43b3465 --- /dev/null +++ b/src/libs/DSPatch/CMakeFiles/DSPatch.dir/cmake_clean.cmake @@ -0,0 +1,20 @@ +file(REMOVE_RECURSE + "CMakeFiles/DSPatch.dir/src/DSPatch.cpp.o" + "CMakeFiles/DSPatch.dir/src/DspCircuit.cpp.o" + "CMakeFiles/DSPatch.dir/src/DspCircuitThread.cpp.o" + "CMakeFiles/DSPatch.dir/src/DspComponent.cpp.o" + "CMakeFiles/DSPatch.dir/src/DspComponentThread.cpp.o" + "CMakeFiles/DSPatch.dir/src/DspParameter.cpp.o" + "CMakeFiles/DSPatch.dir/src/DspPlugin.cpp.o" + "CMakeFiles/DSPatch.dir/src/DspPluginLoader.cpp.o" + "CMakeFiles/DSPatch.dir/src/DspSignal.cpp.o" + "CMakeFiles/DSPatch.dir/src/DspSignalBus.cpp.o" + "CMakeFiles/DSPatch.dir/src/DspWireBus.cpp.o" + "libDSPatch.pdb" + "libDSPatch.dylib" +) + +# Per-language clean rules from dependency scanning. +foreach(lang CXX) + include(CMakeFiles/DSPatch.dir/cmake_clean_${lang}.cmake OPTIONAL) +endforeach() diff --git a/src/libs/DSPatch/CMakeFiles/DSPatch.dir/depend.internal b/src/libs/DSPatch/CMakeFiles/DSPatch.dir/depend.internal new file mode 100644 index 0000000..265d830 --- /dev/null +++ b/src/libs/DSPatch/CMakeFiles/DSPatch.dir/depend.internal @@ -0,0 +1,155 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.10 + +CMakeFiles/DSPatch.dir/src/DSPatch.cpp.o + /Users/benjamin/orchestra/src/libs/DSPatch/src/DSPatch.cpp + include/DSPatch.h + include/dspatch/DspCircuit.h + include/dspatch/DspCircuitThread.h + include/dspatch/DspComponent.h + include/dspatch/DspComponentThread.h + include/dspatch/DspParameter.h + include/dspatch/DspPlugin.h + include/dspatch/DspPluginLoader.h + include/dspatch/DspRunType.h + include/dspatch/DspSignal.h + include/dspatch/DspSignalBus.h + include/dspatch/DspThread.h + include/dspatch/DspThreadNull.h + include/dspatch/DspThreadUnix.h + include/dspatch/DspThreadWin.h + include/dspatch/DspWire.h + include/dspatch/DspWireBus.h +CMakeFiles/DSPatch.dir/src/DspCircuit.cpp.o + /Users/benjamin/orchestra/src/libs/DSPatch/src/DspCircuit.cpp + include/dspatch/DspCircuit.h + include/dspatch/DspCircuitThread.h + include/dspatch/DspComponent.h + include/dspatch/DspComponentThread.h + include/dspatch/DspParameter.h + include/dspatch/DspRunType.h + include/dspatch/DspSignal.h + include/dspatch/DspSignalBus.h + include/dspatch/DspThread.h + include/dspatch/DspThreadNull.h + include/dspatch/DspThreadUnix.h + include/dspatch/DspThreadWin.h + include/dspatch/DspWire.h + include/dspatch/DspWireBus.h +CMakeFiles/DSPatch.dir/src/DspCircuitThread.cpp.o + /Users/benjamin/orchestra/src/libs/DSPatch/src/DspCircuitThread.cpp + include/dspatch/DspCircuitThread.h + include/dspatch/DspComponent.h + include/dspatch/DspComponentThread.h + include/dspatch/DspParameter.h + include/dspatch/DspRunType.h + include/dspatch/DspSignal.h + include/dspatch/DspSignalBus.h + include/dspatch/DspThread.h + include/dspatch/DspThreadNull.h + include/dspatch/DspThreadUnix.h + include/dspatch/DspThreadWin.h + include/dspatch/DspWire.h + include/dspatch/DspWireBus.h +CMakeFiles/DSPatch.dir/src/DspComponent.cpp.o + /Users/benjamin/orchestra/src/libs/DSPatch/src/DspComponent.cpp + include/DSPatch.h + include/dspatch/DspCircuit.h + include/dspatch/DspCircuitThread.h + include/dspatch/DspComponent.h + include/dspatch/DspComponentThread.h + include/dspatch/DspParameter.h + include/dspatch/DspPlugin.h + include/dspatch/DspPluginLoader.h + include/dspatch/DspRunType.h + include/dspatch/DspSignal.h + include/dspatch/DspSignalBus.h + include/dspatch/DspThread.h + include/dspatch/DspThreadNull.h + include/dspatch/DspThreadUnix.h + include/dspatch/DspThreadWin.h + include/dspatch/DspWire.h + include/dspatch/DspWireBus.h +CMakeFiles/DSPatch.dir/src/DspComponentThread.cpp.o + /Users/benjamin/orchestra/src/libs/DSPatch/src/DspComponentThread.cpp + include/dspatch/DspComponent.h + include/dspatch/DspComponentThread.h + include/dspatch/DspParameter.h + include/dspatch/DspRunType.h + include/dspatch/DspSignal.h + include/dspatch/DspSignalBus.h + include/dspatch/DspThread.h + include/dspatch/DspThreadNull.h + include/dspatch/DspThreadUnix.h + include/dspatch/DspThreadWin.h + include/dspatch/DspWire.h + include/dspatch/DspWireBus.h +CMakeFiles/DSPatch.dir/src/DspParameter.cpp.o + /Users/benjamin/orchestra/src/libs/DSPatch/src/DspParameter.cpp + include/dspatch/DspParameter.h + include/dspatch/DspThread.h + include/dspatch/DspThreadNull.h + include/dspatch/DspThreadUnix.h + include/dspatch/DspThreadWin.h +CMakeFiles/DSPatch.dir/src/DspPlugin.cpp.o + /Users/benjamin/orchestra/src/libs/DSPatch/src/DspPlugin.cpp + include/dspatch/DspComponent.h + include/dspatch/DspComponentThread.h + include/dspatch/DspParameter.h + include/dspatch/DspPlugin.h + include/dspatch/DspRunType.h + include/dspatch/DspSignal.h + include/dspatch/DspSignalBus.h + include/dspatch/DspThread.h + include/dspatch/DspThreadNull.h + include/dspatch/DspThreadUnix.h + include/dspatch/DspThreadWin.h + include/dspatch/DspWire.h + include/dspatch/DspWireBus.h +CMakeFiles/DSPatch.dir/src/DspPluginLoader.cpp.o + /Users/benjamin/orchestra/src/libs/DSPatch/src/DspPluginLoader.cpp + include/dspatch/DspComponent.h + include/dspatch/DspComponentThread.h + include/dspatch/DspParameter.h + include/dspatch/DspPlugin.h + include/dspatch/DspPluginLoader.h + include/dspatch/DspRunType.h + include/dspatch/DspSignal.h + include/dspatch/DspSignalBus.h + include/dspatch/DspThread.h + include/dspatch/DspThreadNull.h + include/dspatch/DspThreadUnix.h + include/dspatch/DspThreadWin.h + include/dspatch/DspWire.h + include/dspatch/DspWireBus.h +CMakeFiles/DSPatch.dir/src/DspSignal.cpp.o + /Users/benjamin/orchestra/src/libs/DSPatch/src/DspSignal.cpp + include/dspatch/DspRunType.h + include/dspatch/DspSignal.h + include/dspatch/DspThread.h + include/dspatch/DspThreadNull.h + include/dspatch/DspThreadUnix.h + include/dspatch/DspThreadWin.h +CMakeFiles/DSPatch.dir/src/DspSignalBus.cpp.o + /Users/benjamin/orchestra/src/libs/DSPatch/src/DspSignalBus.cpp + include/dspatch/DspRunType.h + include/dspatch/DspSignal.h + include/dspatch/DspSignalBus.h + include/dspatch/DspThread.h + include/dspatch/DspThreadNull.h + include/dspatch/DspThreadUnix.h + include/dspatch/DspThreadWin.h +CMakeFiles/DSPatch.dir/src/DspWireBus.cpp.o + /Users/benjamin/orchestra/src/libs/DSPatch/src/DspWireBus.cpp + include/dspatch/DspComponent.h + include/dspatch/DspComponentThread.h + include/dspatch/DspParameter.h + include/dspatch/DspRunType.h + include/dspatch/DspSignal.h + include/dspatch/DspSignalBus.h + include/dspatch/DspThread.h + include/dspatch/DspThreadNull.h + include/dspatch/DspThreadUnix.h + include/dspatch/DspThreadWin.h + include/dspatch/DspWire.h + include/dspatch/DspWireBus.h diff --git a/src/libs/DSPatch/CMakeFiles/DSPatch.dir/depend.make b/src/libs/DSPatch/CMakeFiles/DSPatch.dir/depend.make new file mode 100644 index 0000000..199afb1 --- /dev/null +++ b/src/libs/DSPatch/CMakeFiles/DSPatch.dir/depend.make @@ -0,0 +1,155 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.10 + +CMakeFiles/DSPatch.dir/src/DSPatch.cpp.o: src/DSPatch.cpp +CMakeFiles/DSPatch.dir/src/DSPatch.cpp.o: include/DSPatch.h +CMakeFiles/DSPatch.dir/src/DSPatch.cpp.o: include/dspatch/DspCircuit.h +CMakeFiles/DSPatch.dir/src/DSPatch.cpp.o: include/dspatch/DspCircuitThread.h +CMakeFiles/DSPatch.dir/src/DSPatch.cpp.o: include/dspatch/DspComponent.h +CMakeFiles/DSPatch.dir/src/DSPatch.cpp.o: include/dspatch/DspComponentThread.h +CMakeFiles/DSPatch.dir/src/DSPatch.cpp.o: include/dspatch/DspParameter.h +CMakeFiles/DSPatch.dir/src/DSPatch.cpp.o: include/dspatch/DspPlugin.h +CMakeFiles/DSPatch.dir/src/DSPatch.cpp.o: include/dspatch/DspPluginLoader.h +CMakeFiles/DSPatch.dir/src/DSPatch.cpp.o: include/dspatch/DspRunType.h +CMakeFiles/DSPatch.dir/src/DSPatch.cpp.o: include/dspatch/DspSignal.h +CMakeFiles/DSPatch.dir/src/DSPatch.cpp.o: include/dspatch/DspSignalBus.h +CMakeFiles/DSPatch.dir/src/DSPatch.cpp.o: include/dspatch/DspThread.h +CMakeFiles/DSPatch.dir/src/DSPatch.cpp.o: include/dspatch/DspThreadNull.h +CMakeFiles/DSPatch.dir/src/DSPatch.cpp.o: include/dspatch/DspThreadUnix.h +CMakeFiles/DSPatch.dir/src/DSPatch.cpp.o: include/dspatch/DspThreadWin.h +CMakeFiles/DSPatch.dir/src/DSPatch.cpp.o: include/dspatch/DspWire.h +CMakeFiles/DSPatch.dir/src/DSPatch.cpp.o: include/dspatch/DspWireBus.h + +CMakeFiles/DSPatch.dir/src/DspCircuit.cpp.o: src/DspCircuit.cpp +CMakeFiles/DSPatch.dir/src/DspCircuit.cpp.o: include/dspatch/DspCircuit.h +CMakeFiles/DSPatch.dir/src/DspCircuit.cpp.o: include/dspatch/DspCircuitThread.h +CMakeFiles/DSPatch.dir/src/DspCircuit.cpp.o: include/dspatch/DspComponent.h +CMakeFiles/DSPatch.dir/src/DspCircuit.cpp.o: include/dspatch/DspComponentThread.h +CMakeFiles/DSPatch.dir/src/DspCircuit.cpp.o: include/dspatch/DspParameter.h +CMakeFiles/DSPatch.dir/src/DspCircuit.cpp.o: include/dspatch/DspRunType.h +CMakeFiles/DSPatch.dir/src/DspCircuit.cpp.o: include/dspatch/DspSignal.h +CMakeFiles/DSPatch.dir/src/DspCircuit.cpp.o: include/dspatch/DspSignalBus.h +CMakeFiles/DSPatch.dir/src/DspCircuit.cpp.o: include/dspatch/DspThread.h +CMakeFiles/DSPatch.dir/src/DspCircuit.cpp.o: include/dspatch/DspThreadNull.h +CMakeFiles/DSPatch.dir/src/DspCircuit.cpp.o: include/dspatch/DspThreadUnix.h +CMakeFiles/DSPatch.dir/src/DspCircuit.cpp.o: include/dspatch/DspThreadWin.h +CMakeFiles/DSPatch.dir/src/DspCircuit.cpp.o: include/dspatch/DspWire.h +CMakeFiles/DSPatch.dir/src/DspCircuit.cpp.o: include/dspatch/DspWireBus.h + +CMakeFiles/DSPatch.dir/src/DspCircuitThread.cpp.o: src/DspCircuitThread.cpp +CMakeFiles/DSPatch.dir/src/DspCircuitThread.cpp.o: include/dspatch/DspCircuitThread.h +CMakeFiles/DSPatch.dir/src/DspCircuitThread.cpp.o: include/dspatch/DspComponent.h +CMakeFiles/DSPatch.dir/src/DspCircuitThread.cpp.o: include/dspatch/DspComponentThread.h +CMakeFiles/DSPatch.dir/src/DspCircuitThread.cpp.o: include/dspatch/DspParameter.h +CMakeFiles/DSPatch.dir/src/DspCircuitThread.cpp.o: include/dspatch/DspRunType.h +CMakeFiles/DSPatch.dir/src/DspCircuitThread.cpp.o: include/dspatch/DspSignal.h +CMakeFiles/DSPatch.dir/src/DspCircuitThread.cpp.o: include/dspatch/DspSignalBus.h +CMakeFiles/DSPatch.dir/src/DspCircuitThread.cpp.o: include/dspatch/DspThread.h +CMakeFiles/DSPatch.dir/src/DspCircuitThread.cpp.o: include/dspatch/DspThreadNull.h +CMakeFiles/DSPatch.dir/src/DspCircuitThread.cpp.o: include/dspatch/DspThreadUnix.h +CMakeFiles/DSPatch.dir/src/DspCircuitThread.cpp.o: include/dspatch/DspThreadWin.h +CMakeFiles/DSPatch.dir/src/DspCircuitThread.cpp.o: include/dspatch/DspWire.h +CMakeFiles/DSPatch.dir/src/DspCircuitThread.cpp.o: include/dspatch/DspWireBus.h + +CMakeFiles/DSPatch.dir/src/DspComponent.cpp.o: src/DspComponent.cpp +CMakeFiles/DSPatch.dir/src/DspComponent.cpp.o: include/DSPatch.h +CMakeFiles/DSPatch.dir/src/DspComponent.cpp.o: include/dspatch/DspCircuit.h +CMakeFiles/DSPatch.dir/src/DspComponent.cpp.o: include/dspatch/DspCircuitThread.h +CMakeFiles/DSPatch.dir/src/DspComponent.cpp.o: include/dspatch/DspComponent.h +CMakeFiles/DSPatch.dir/src/DspComponent.cpp.o: include/dspatch/DspComponentThread.h +CMakeFiles/DSPatch.dir/src/DspComponent.cpp.o: include/dspatch/DspParameter.h +CMakeFiles/DSPatch.dir/src/DspComponent.cpp.o: include/dspatch/DspPlugin.h +CMakeFiles/DSPatch.dir/src/DspComponent.cpp.o: include/dspatch/DspPluginLoader.h +CMakeFiles/DSPatch.dir/src/DspComponent.cpp.o: include/dspatch/DspRunType.h +CMakeFiles/DSPatch.dir/src/DspComponent.cpp.o: include/dspatch/DspSignal.h +CMakeFiles/DSPatch.dir/src/DspComponent.cpp.o: include/dspatch/DspSignalBus.h +CMakeFiles/DSPatch.dir/src/DspComponent.cpp.o: include/dspatch/DspThread.h +CMakeFiles/DSPatch.dir/src/DspComponent.cpp.o: include/dspatch/DspThreadNull.h +CMakeFiles/DSPatch.dir/src/DspComponent.cpp.o: include/dspatch/DspThreadUnix.h +CMakeFiles/DSPatch.dir/src/DspComponent.cpp.o: include/dspatch/DspThreadWin.h +CMakeFiles/DSPatch.dir/src/DspComponent.cpp.o: include/dspatch/DspWire.h +CMakeFiles/DSPatch.dir/src/DspComponent.cpp.o: include/dspatch/DspWireBus.h + +CMakeFiles/DSPatch.dir/src/DspComponentThread.cpp.o: src/DspComponentThread.cpp +CMakeFiles/DSPatch.dir/src/DspComponentThread.cpp.o: include/dspatch/DspComponent.h +CMakeFiles/DSPatch.dir/src/DspComponentThread.cpp.o: include/dspatch/DspComponentThread.h +CMakeFiles/DSPatch.dir/src/DspComponentThread.cpp.o: include/dspatch/DspParameter.h +CMakeFiles/DSPatch.dir/src/DspComponentThread.cpp.o: include/dspatch/DspRunType.h +CMakeFiles/DSPatch.dir/src/DspComponentThread.cpp.o: include/dspatch/DspSignal.h +CMakeFiles/DSPatch.dir/src/DspComponentThread.cpp.o: include/dspatch/DspSignalBus.h +CMakeFiles/DSPatch.dir/src/DspComponentThread.cpp.o: include/dspatch/DspThread.h +CMakeFiles/DSPatch.dir/src/DspComponentThread.cpp.o: include/dspatch/DspThreadNull.h +CMakeFiles/DSPatch.dir/src/DspComponentThread.cpp.o: include/dspatch/DspThreadUnix.h +CMakeFiles/DSPatch.dir/src/DspComponentThread.cpp.o: include/dspatch/DspThreadWin.h +CMakeFiles/DSPatch.dir/src/DspComponentThread.cpp.o: include/dspatch/DspWire.h +CMakeFiles/DSPatch.dir/src/DspComponentThread.cpp.o: include/dspatch/DspWireBus.h + +CMakeFiles/DSPatch.dir/src/DspParameter.cpp.o: src/DspParameter.cpp +CMakeFiles/DSPatch.dir/src/DspParameter.cpp.o: include/dspatch/DspParameter.h +CMakeFiles/DSPatch.dir/src/DspParameter.cpp.o: include/dspatch/DspThread.h +CMakeFiles/DSPatch.dir/src/DspParameter.cpp.o: include/dspatch/DspThreadNull.h +CMakeFiles/DSPatch.dir/src/DspParameter.cpp.o: include/dspatch/DspThreadUnix.h +CMakeFiles/DSPatch.dir/src/DspParameter.cpp.o: include/dspatch/DspThreadWin.h + +CMakeFiles/DSPatch.dir/src/DspPlugin.cpp.o: src/DspPlugin.cpp +CMakeFiles/DSPatch.dir/src/DspPlugin.cpp.o: include/dspatch/DspComponent.h +CMakeFiles/DSPatch.dir/src/DspPlugin.cpp.o: include/dspatch/DspComponentThread.h +CMakeFiles/DSPatch.dir/src/DspPlugin.cpp.o: include/dspatch/DspParameter.h +CMakeFiles/DSPatch.dir/src/DspPlugin.cpp.o: include/dspatch/DspPlugin.h +CMakeFiles/DSPatch.dir/src/DspPlugin.cpp.o: include/dspatch/DspRunType.h +CMakeFiles/DSPatch.dir/src/DspPlugin.cpp.o: include/dspatch/DspSignal.h +CMakeFiles/DSPatch.dir/src/DspPlugin.cpp.o: include/dspatch/DspSignalBus.h +CMakeFiles/DSPatch.dir/src/DspPlugin.cpp.o: include/dspatch/DspThread.h +CMakeFiles/DSPatch.dir/src/DspPlugin.cpp.o: include/dspatch/DspThreadNull.h +CMakeFiles/DSPatch.dir/src/DspPlugin.cpp.o: include/dspatch/DspThreadUnix.h +CMakeFiles/DSPatch.dir/src/DspPlugin.cpp.o: include/dspatch/DspThreadWin.h +CMakeFiles/DSPatch.dir/src/DspPlugin.cpp.o: include/dspatch/DspWire.h +CMakeFiles/DSPatch.dir/src/DspPlugin.cpp.o: include/dspatch/DspWireBus.h + +CMakeFiles/DSPatch.dir/src/DspPluginLoader.cpp.o: src/DspPluginLoader.cpp +CMakeFiles/DSPatch.dir/src/DspPluginLoader.cpp.o: include/dspatch/DspComponent.h +CMakeFiles/DSPatch.dir/src/DspPluginLoader.cpp.o: include/dspatch/DspComponentThread.h +CMakeFiles/DSPatch.dir/src/DspPluginLoader.cpp.o: include/dspatch/DspParameter.h +CMakeFiles/DSPatch.dir/src/DspPluginLoader.cpp.o: include/dspatch/DspPlugin.h +CMakeFiles/DSPatch.dir/src/DspPluginLoader.cpp.o: include/dspatch/DspPluginLoader.h +CMakeFiles/DSPatch.dir/src/DspPluginLoader.cpp.o: include/dspatch/DspRunType.h +CMakeFiles/DSPatch.dir/src/DspPluginLoader.cpp.o: include/dspatch/DspSignal.h +CMakeFiles/DSPatch.dir/src/DspPluginLoader.cpp.o: include/dspatch/DspSignalBus.h +CMakeFiles/DSPatch.dir/src/DspPluginLoader.cpp.o: include/dspatch/DspThread.h +CMakeFiles/DSPatch.dir/src/DspPluginLoader.cpp.o: include/dspatch/DspThreadNull.h +CMakeFiles/DSPatch.dir/src/DspPluginLoader.cpp.o: include/dspatch/DspThreadUnix.h +CMakeFiles/DSPatch.dir/src/DspPluginLoader.cpp.o: include/dspatch/DspThreadWin.h +CMakeFiles/DSPatch.dir/src/DspPluginLoader.cpp.o: include/dspatch/DspWire.h +CMakeFiles/DSPatch.dir/src/DspPluginLoader.cpp.o: include/dspatch/DspWireBus.h + +CMakeFiles/DSPatch.dir/src/DspSignal.cpp.o: src/DspSignal.cpp +CMakeFiles/DSPatch.dir/src/DspSignal.cpp.o: include/dspatch/DspRunType.h +CMakeFiles/DSPatch.dir/src/DspSignal.cpp.o: include/dspatch/DspSignal.h +CMakeFiles/DSPatch.dir/src/DspSignal.cpp.o: include/dspatch/DspThread.h +CMakeFiles/DSPatch.dir/src/DspSignal.cpp.o: include/dspatch/DspThreadNull.h +CMakeFiles/DSPatch.dir/src/DspSignal.cpp.o: include/dspatch/DspThreadUnix.h +CMakeFiles/DSPatch.dir/src/DspSignal.cpp.o: include/dspatch/DspThreadWin.h + +CMakeFiles/DSPatch.dir/src/DspSignalBus.cpp.o: src/DspSignalBus.cpp +CMakeFiles/DSPatch.dir/src/DspSignalBus.cpp.o: include/dspatch/DspRunType.h +CMakeFiles/DSPatch.dir/src/DspSignalBus.cpp.o: include/dspatch/DspSignal.h +CMakeFiles/DSPatch.dir/src/DspSignalBus.cpp.o: include/dspatch/DspSignalBus.h +CMakeFiles/DSPatch.dir/src/DspSignalBus.cpp.o: include/dspatch/DspThread.h +CMakeFiles/DSPatch.dir/src/DspSignalBus.cpp.o: include/dspatch/DspThreadNull.h +CMakeFiles/DSPatch.dir/src/DspSignalBus.cpp.o: include/dspatch/DspThreadUnix.h +CMakeFiles/DSPatch.dir/src/DspSignalBus.cpp.o: include/dspatch/DspThreadWin.h + +CMakeFiles/DSPatch.dir/src/DspWireBus.cpp.o: src/DspWireBus.cpp +CMakeFiles/DSPatch.dir/src/DspWireBus.cpp.o: include/dspatch/DspComponent.h +CMakeFiles/DSPatch.dir/src/DspWireBus.cpp.o: include/dspatch/DspComponentThread.h +CMakeFiles/DSPatch.dir/src/DspWireBus.cpp.o: include/dspatch/DspParameter.h +CMakeFiles/DSPatch.dir/src/DspWireBus.cpp.o: include/dspatch/DspRunType.h +CMakeFiles/DSPatch.dir/src/DspWireBus.cpp.o: include/dspatch/DspSignal.h +CMakeFiles/DSPatch.dir/src/DspWireBus.cpp.o: include/dspatch/DspSignalBus.h +CMakeFiles/DSPatch.dir/src/DspWireBus.cpp.o: include/dspatch/DspThread.h +CMakeFiles/DSPatch.dir/src/DspWireBus.cpp.o: include/dspatch/DspThreadNull.h +CMakeFiles/DSPatch.dir/src/DspWireBus.cpp.o: include/dspatch/DspThreadUnix.h +CMakeFiles/DSPatch.dir/src/DspWireBus.cpp.o: include/dspatch/DspThreadWin.h +CMakeFiles/DSPatch.dir/src/DspWireBus.cpp.o: include/dspatch/DspWire.h +CMakeFiles/DSPatch.dir/src/DspWireBus.cpp.o: include/dspatch/DspWireBus.h + diff --git a/src/libs/DSPatch/CMakeFiles/DSPatch.dir/flags.make b/src/libs/DSPatch/CMakeFiles/DSPatch.dir/flags.make new file mode 100644 index 0000000..e931730 --- /dev/null +++ b/src/libs/DSPatch/CMakeFiles/DSPatch.dir/flags.make @@ -0,0 +1,10 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.10 + +# compile CXX with /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ +CXX_FLAGS = -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -fPIC + +CXX_DEFINES = -DDSPatch_EXPORTS + +CXX_INCLUDES = -I/Users/benjamin/orchestra/src/libs/DSPatch/include + diff --git a/src/libs/DSPatch/CMakeFiles/DSPatch.dir/link.txt b/src/libs/DSPatch/CMakeFiles/DSPatch.dir/link.txt new file mode 100644 index 0000000..516ca54 --- /dev/null +++ b/src/libs/DSPatch/CMakeFiles/DSPatch.dir/link.txt @@ -0,0 +1 @@ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -dynamiclib -Wl,-headerpad_max_install_names -o libDSPatch.dylib -install_name /Users/benjamin/orchestra/src/libs/DSPatch/libDSPatch.dylib CMakeFiles/DSPatch.dir/src/DSPatch.cpp.o CMakeFiles/DSPatch.dir/src/DspCircuit.cpp.o CMakeFiles/DSPatch.dir/src/DspCircuitThread.cpp.o CMakeFiles/DSPatch.dir/src/DspComponent.cpp.o CMakeFiles/DSPatch.dir/src/DspComponentThread.cpp.o CMakeFiles/DSPatch.dir/src/DspParameter.cpp.o CMakeFiles/DSPatch.dir/src/DspPlugin.cpp.o CMakeFiles/DSPatch.dir/src/DspPluginLoader.cpp.o CMakeFiles/DSPatch.dir/src/DspSignal.cpp.o CMakeFiles/DSPatch.dir/src/DspSignalBus.cpp.o CMakeFiles/DSPatch.dir/src/DspWireBus.cpp.o -static-libstdc++ -lpthread -ldl diff --git a/src/libs/DSPatch/CMakeFiles/DSPatch.dir/progress.make b/src/libs/DSPatch/CMakeFiles/DSPatch.dir/progress.make new file mode 100644 index 0000000..5d4d464 --- /dev/null +++ b/src/libs/DSPatch/CMakeFiles/DSPatch.dir/progress.make @@ -0,0 +1,13 @@ +CMAKE_PROGRESS_1 = 1 +CMAKE_PROGRESS_2 = 2 +CMAKE_PROGRESS_3 = 3 +CMAKE_PROGRESS_4 = 4 +CMAKE_PROGRESS_5 = 5 +CMAKE_PROGRESS_6 = 6 +CMAKE_PROGRESS_7 = 7 +CMAKE_PROGRESS_8 = 8 +CMAKE_PROGRESS_9 = 9 +CMAKE_PROGRESS_10 = 10 +CMAKE_PROGRESS_11 = 11 +CMAKE_PROGRESS_12 = 12 + diff --git a/src/libs/DSPatch/CMakeFiles/Makefile.cmake b/src/libs/DSPatch/CMakeFiles/Makefile.cmake new file mode 100644 index 0000000..6451258 --- /dev/null +++ b/src/libs/DSPatch/CMakeFiles/Makefile.cmake @@ -0,0 +1,122 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.10 + +# The generator used is: +set(CMAKE_DEPENDS_GENERATOR "Unix Makefiles") + +# The top level Makefile was generated from the following files: +set(CMAKE_MAKEFILE_DEPENDS + "CMakeCache.txt" + "CMakeFiles/3.10.1/CMakeCCompiler.cmake" + "CMakeFiles/3.10.1/CMakeCXXCompiler.cmake" + "CMakeFiles/3.10.1/CMakeSystem.cmake" + "CMakeFiles/feature_tests.c" + "CMakeFiles/feature_tests.cxx" + "CMakeLists.txt" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeCCompiler.cmake.in" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeCCompilerABI.c" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeCInformation.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeCXXCompiler.cmake.in" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeCXXCompilerABI.cpp" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeCXXInformation.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeCommonLanguageInclude.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeCompilerIdDetection.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeDetermineCCompiler.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeDetermineCXXCompiler.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeDetermineCompileFeatures.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeDetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeDetermineCompilerABI.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeDetermineCompilerId.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeDetermineSystem.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeFindBinUtils.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeGenericSystem.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeLanguageInformation.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeParseImplicitLinkInfo.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeSystem.cmake.in" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeSystemSpecificInformation.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeSystemSpecificInitialize.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeTestCCompiler.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeTestCXXCompiler.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeTestCompilerCommon.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeUnixFindMake.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/ADSP-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/ARMCC-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/AppleClang-C-FeatureTests.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/AppleClang-C.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/AppleClang-CXX-FeatureTests.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/AppleClang-CXX.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/AppleClang-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/Borland-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/Bruce-C-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/CMakeCommonCompilerMacros.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/Clang-CXX-TestableFeatures.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/Clang-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/Clang-DetermineCompilerInternal.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/Clang.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/Comeau-CXX-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/Compaq-C-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/Compaq-CXX-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/Cray-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/Embarcadero-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/Fujitsu-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/GHS-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/GNU-C-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/GNU-CXX-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/GNU.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/HP-C-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/HP-CXX-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/IAR-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/IBMCPP-C-DetermineVersionInternal.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/IBMCPP-CXX-DetermineVersionInternal.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/Intel-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/MIPSpro-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/MSVC-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/NVIDIA-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/OpenWatcom-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/PGI-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/PathScale-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/SCO-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/SDCC-C-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/SunPro-C-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/SunPro-CXX-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/TI-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/TinyCC-C-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/VisualAge-C-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/VisualAge-CXX-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/Watcom-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/XL-C-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/XL-CXX-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/zOS-C-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/zOS-CXX-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Internal/FeatureTesting.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Platform/Darwin-AppleClang-C.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Platform/Darwin-AppleClang-CXX.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Platform/Darwin-Clang-C.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Platform/Darwin-Clang-CXX.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Platform/Darwin-Clang.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Platform/Darwin-Determine-CXX.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Platform/Darwin-Initialize.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Platform/Darwin.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Platform/UnixPaths.cmake" + ) + +# The corresponding makefile is: +set(CMAKE_MAKEFILE_OUTPUTS + "Makefile" + "CMakeFiles/cmake.check_cache" + ) + +# Byproducts of CMake generate step: +set(CMAKE_MAKEFILE_PRODUCTS + "CMakeFiles/3.10.1/CMakeSystem.cmake" + "CMakeFiles/3.10.1/CMakeCCompiler.cmake" + "CMakeFiles/3.10.1/CMakeCXXCompiler.cmake" + "CMakeFiles/3.10.1/CMakeCCompiler.cmake" + "CMakeFiles/3.10.1/CMakeCXXCompiler.cmake" + "CMakeFiles/CMakeDirectoryInformation.cmake" + ) + +# Dependency information for all targets: +set(CMAKE_DEPEND_INFO_FILES + "CMakeFiles/DSPatch.dir/DependInfo.cmake" + ) diff --git a/src/libs/DSPatch/CMakeFiles/Makefile2 b/src/libs/DSPatch/CMakeFiles/Makefile2 new file mode 100644 index 0000000..0fcd7ee --- /dev/null +++ b/src/libs/DSPatch/CMakeFiles/Makefile2 @@ -0,0 +1,108 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.10 + +# Default target executed when no arguments are given to make. +default_target: all + +.PHONY : default_target + +# The main recursive all target +all: + +.PHONY : all + +# The main recursive preinstall target +preinstall: + +.PHONY : preinstall + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + + +# Remove some rules from gmake that .SUFFIXES does not remove. +SUFFIXES = + +.SUFFIXES: .hpux_make_needs_suffix_list + + +# Suppress display of executed commands. +$(VERBOSE).SILENT: + + +# A target that is always out of date. +cmake_force: + +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/local/Cellar/cmake/3.10.1/bin/cmake + +# The command to remove a file. +RM = /usr/local/Cellar/cmake/3.10.1/bin/cmake -E remove -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /Users/benjamin/orchestra/src/libs/DSPatch + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /Users/benjamin/orchestra/src/libs/DSPatch + +#============================================================================= +# Target rules for target CMakeFiles/DSPatch.dir + +# All Build rule for target. +CMakeFiles/DSPatch.dir/all: + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/depend + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/build + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles --progress-num=1,2,3,4,5,6,7,8,9,10,11,12 "Built target DSPatch" +.PHONY : CMakeFiles/DSPatch.dir/all + +# Include target in all. +all: CMakeFiles/DSPatch.dir/all + +.PHONY : all + +# Build rule for subdir invocation for target. +CMakeFiles/DSPatch.dir/rule: cmake_check_build_system + $(CMAKE_COMMAND) -E cmake_progress_start /Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles 12 + $(MAKE) -f CMakeFiles/Makefile2 CMakeFiles/DSPatch.dir/all + $(CMAKE_COMMAND) -E cmake_progress_start /Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles 0 +.PHONY : CMakeFiles/DSPatch.dir/rule + +# Convenience name for target. +DSPatch: CMakeFiles/DSPatch.dir/rule + +.PHONY : DSPatch + +# clean rule for target. +CMakeFiles/DSPatch.dir/clean: + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/clean +.PHONY : CMakeFiles/DSPatch.dir/clean + +# clean rule for target. +clean: CMakeFiles/DSPatch.dir/clean + +.PHONY : clean + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system + diff --git a/src/libs/DSPatch/CMakeFiles/TargetDirectories.txt b/src/libs/DSPatch/CMakeFiles/TargetDirectories.txt new file mode 100644 index 0000000..c3abbd7 --- /dev/null +++ b/src/libs/DSPatch/CMakeFiles/TargetDirectories.txt @@ -0,0 +1,7 @@ +/Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles/install/local.dir +/Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles/install/strip.dir +/Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles/install.dir +/Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles/list_install_components.dir +/Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles/rebuild_cache.dir +/Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles/edit_cache.dir +/Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles/DSPatch.dir diff --git a/src/libs/DSPatch/CMakeFiles/cmake.check_cache b/src/libs/DSPatch/CMakeFiles/cmake.check_cache new file mode 100644 index 0000000..3dccd73 --- /dev/null +++ b/src/libs/DSPatch/CMakeFiles/cmake.check_cache @@ -0,0 +1 @@ +# This file is generated by cmake for dependency checking of the CMakeCache.txt file diff --git a/src/libs/DSPatch/CMakeFiles/feature_tests.bin b/src/libs/DSPatch/CMakeFiles/feature_tests.bin new file mode 100755 index 0000000000000000000000000000000000000000..db4ec2ccd460dcfc9b77cbc0f0177213944b8529 GIT binary patch literal 8376 zcmeHM&5ImG6t9g5#w2EQii!cpkBBC?y8*$)lTk-E7&OEUECDHMs^82OR#%VJ)w{ET z5Dz&lD8!Q<1^Ygf!GrdG ztL^>DfqaDHHRI`#c)sfAz|TAGF`SGQzGk zv?I>cn&6r44X21(#I@#MKz`Ti=Y>;C2$tiRp2k=Q&)+-1{1)bu7}qeE*gg-I<@`+g z1N*<|G^AP>r!ZEl(yv<6SKLc|p0p;AS2ht={KKCHeLt&PY48*(@8Z`aT@91et(*>s=20f3^1b=; zl*y6CLZQ6ap+gEFBg^$-TyNMb@s$oms!~`G*;?q>^h}T?^_5p?Bjl=Fb_>6&e1;Ox zmL=0!Kn|_Zu(vQ*$S1js!}10XhuTEhj6qId*F}BV*~~K9(q!a<=^9GZR*xJPBz74$ zhZgO)C~35`D(_^ejb+?6d003!BgR?dNII2M*;hKXd*?bCF2qo!R(;fHQoYdFEW8&E zD@XIj?Nq&YigA>27`aM}SfXIRqXyPzHrDoV_sQpBArnem=qPHYFUg=LM zBudrqC|mIXQ%9K)DN&C_w+43BPmQ}OOY(`#03gmP@7ZbFm-wa`-5KKt-u5}ph}7v3 zwmqo~6@r4A4J3GFP|LkTPRq&}U1YQ%WspF=^YIppr^~Fv%Awwof6XTvl#=&A1y~mN z+EL!94pKBiVj84)9Y>jrYg=hwED{(S!L84|)^mLQgC=M0X>!l=b<8||sr#S&%stvu z&^!~h!LXSniT?T#nQu!Pkj9-Xw~+?&;`v+|C(aL>yLVTkIBeGsuYo^}wNZbZ#g><1 wM>bkN8~I@@qgXMsSfmy@= 400 +"1" +#else +"0" +#endif +"c_function_prototypes\n" +"C_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +"1" +#else +"0" +#endif +"c_restrict\n" +"C_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L +"1" +#else +"0" +#endif +"c_static_assert\n" +"C_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +"1" +#else +"0" +#endif +"c_variadic_macros\n" + +}; + +int main(int argc, char** argv) { (void)argv; return features[argc]; } diff --git a/src/libs/DSPatch/CMakeFiles/feature_tests.cxx b/src/libs/DSPatch/CMakeFiles/feature_tests.cxx new file mode 100644 index 0000000..34d2e8c --- /dev/null +++ b/src/libs/DSPatch/CMakeFiles/feature_tests.cxx @@ -0,0 +1,405 @@ + + const char features[] = {"\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_aggregate_nsdmi) +"1" +#else +"0" +#endif +"cxx_aggregate_default_initializers\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_alias_templates) +"1" +#else +"0" +#endif +"cxx_alias_templates\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_alignas) +"1" +#else +"0" +#endif +"cxx_alignas\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_alignas) +"1" +#else +"0" +#endif +"cxx_alignof\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_attributes) +"1" +#else +"0" +#endif +"cxx_attributes\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 501 && __cplusplus > 201103L +"1" +#else +"0" +#endif +"cxx_attribute_deprecated\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_auto_type) +"1" +#else +"0" +#endif +"cxx_auto_type\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_binary_literals) +"1" +#else +"0" +#endif +"cxx_binary_literals\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_constexpr) +"1" +#else +"0" +#endif +"cxx_constexpr\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_contextual_conversions) +"1" +#else +"0" +#endif +"cxx_contextual_conversions\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_decltype) +"1" +#else +"0" +#endif +"cxx_decltype\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 501 && __cplusplus > 201103L +"1" +#else +"0" +#endif +"cxx_decltype_auto\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_decltype_incomplete_return_types) +"1" +#else +"0" +#endif +"cxx_decltype_incomplete_return_types\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_default_function_template_args) +"1" +#else +"0" +#endif +"cxx_default_function_template_args\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_defaulted_functions) +"1" +#else +"0" +#endif +"cxx_defaulted_functions\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_defaulted_functions) +"1" +#else +"0" +#endif +"cxx_defaulted_move_initializers\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_delegating_constructors) +"1" +#else +"0" +#endif +"cxx_delegating_constructors\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_deleted_functions) +"1" +#else +"0" +#endif +"cxx_deleted_functions\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 501 && __cplusplus > 201103L +"1" +#else +"0" +#endif +"cxx_digit_separators\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __cplusplus >= 201103L +"1" +#else +"0" +#endif +"cxx_enum_forward_declarations\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_explicit_conversions) +"1" +#else +"0" +#endif +"cxx_explicit_conversions\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __cplusplus >= 201103L +"1" +#else +"0" +#endif +"cxx_extended_friend_declarations\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __cplusplus >= 201103L +"1" +#else +"0" +#endif +"cxx_extern_templates\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_override_control) +"1" +#else +"0" +#endif +"cxx_final\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __cplusplus >= 201103L +"1" +#else +"0" +#endif +"cxx_func_identifier\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_generalized_initializers) +"1" +#else +"0" +#endif +"cxx_generalized_initializers\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 501 && __cplusplus > 201103L +"1" +#else +"0" +#endif +"cxx_generic_lambdas\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_inheriting_constructors) +"1" +#else +"0" +#endif +"cxx_inheriting_constructors\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __cplusplus >= 201103L +"1" +#else +"0" +#endif +"cxx_inline_namespaces\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_lambdas) +"1" +#else +"0" +#endif +"cxx_lambdas\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_init_captures) +"1" +#else +"0" +#endif +"cxx_lambda_init_captures\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_local_type_template_args) +"1" +#else +"0" +#endif +"cxx_local_type_template_args\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __cplusplus >= 201103L +"1" +#else +"0" +#endif +"cxx_long_long_type\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_noexcept) +"1" +#else +"0" +#endif +"cxx_noexcept\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_nonstatic_member_init) +"1" +#else +"0" +#endif +"cxx_nonstatic_member_init\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_nullptr) +"1" +#else +"0" +#endif +"cxx_nullptr\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_override_control) +"1" +#else +"0" +#endif +"cxx_override\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_range_for) +"1" +#else +"0" +#endif +"cxx_range_for\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_raw_string_literals) +"1" +#else +"0" +#endif +"cxx_raw_string_literals\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_reference_qualified_functions) +"1" +#else +"0" +#endif +"cxx_reference_qualified_functions\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_relaxed_constexpr) +"1" +#else +"0" +#endif +"cxx_relaxed_constexpr\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_return_type_deduction) +"1" +#else +"0" +#endif +"cxx_return_type_deduction\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __cplusplus >= 201103L +"1" +#else +"0" +#endif +"cxx_right_angle_brackets\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_rvalue_references) +"1" +#else +"0" +#endif +"cxx_rvalue_references\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __cplusplus >= 201103L +"1" +#else +"0" +#endif +"cxx_sizeof_member\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_static_assert) +"1" +#else +"0" +#endif +"cxx_static_assert\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_strong_enums) +"1" +#else +"0" +#endif +"cxx_strong_enums\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __cplusplus >= 199711L +"1" +#else +"0" +#endif +"cxx_template_template_parameters\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_thread_local) +"1" +#else +"0" +#endif +"cxx_thread_local\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_trailing_return) +"1" +#else +"0" +#endif +"cxx_trailing_return_types\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_unicode_literals) +"1" +#else +"0" +#endif +"cxx_unicode_literals\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_generalized_initializers) +"1" +#else +"0" +#endif +"cxx_uniform_initialization\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_unrestricted_unions) +"1" +#else +"0" +#endif +"cxx_unrestricted_unions\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_user_literals) +"1" +#else +"0" +#endif +"cxx_user_literals\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_variable_templates) +"1" +#else +"0" +#endif +"cxx_variable_templates\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __cplusplus >= 201103L +"1" +#else +"0" +#endif +"cxx_variadic_macros\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_variadic_templates) +"1" +#else +"0" +#endif +"cxx_variadic_templates\n" + +}; + +int main(int argc, char** argv) { (void)argv; return features[argc]; } diff --git a/src/libs/DSPatch/CMakeFiles/progress.marks b/src/libs/DSPatch/CMakeFiles/progress.marks new file mode 100644 index 0000000..48082f7 --- /dev/null +++ b/src/libs/DSPatch/CMakeFiles/progress.marks @@ -0,0 +1 @@ +12 diff --git a/src/libs/DSPatch/CMakeLists.txt b/src/libs/DSPatch/CMakeLists.txt new file mode 100755 index 0000000..b9e1b13 --- /dev/null +++ b/src/libs/DSPatch/CMakeLists.txt @@ -0,0 +1,71 @@ +cmake_minimum_required(VERSION 2.8) + +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wnon-virtual-dtor") + +if(UNIX) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -pthread") +endif(UNIX) + +if(CYGWIN OR MINGW) + string(REGEX REPLACE "-Wl,--out-implib,[^ ]+ " " " CMAKE_C_CREATE_SHARED_LIBRARY "${CMAKE_C_CREATE_SHARED_LIBRARY}") + string(REGEX REPLACE "-Wl,--out-implib,[^ ]+ " " " CMAKE_CXX_CREATE_SHARED_LIBRARY "${CMAKE_CXX_CREATE_SHARED_LIBRARY}") +endif(CYGWIN OR MINGW) + +project(DSPatch) + +file(GLOB srcs src/*.cpp) +file(GLOB hdrs include/*.h) +file(GLOB in_hdrs include/dspatch/*.h) + +include_directories( + ${CMAKE_SOURCE_DIR}/include +) + +# Build shared (LGPL) +add_library( + ${PROJECT_NAME} SHARED + ${srcs} + ${hdrs} + ${in_hdrs} +) + +target_link_libraries( + ${PROJECT_NAME} + -static-libstdc++ +) + +# Link pthread and dl on Unix +if(UNIX) + target_link_libraries( + ${PROJECT_NAME} + pthread + dl + ) +endif(UNIX) + +install( + TARGETS ${PROJECT_NAME} + DESTINATION lib +) + +install( + FILES ${hdrs} + DESTINATION include +) + +install( + FILES ${in_hdrs} + DESTINATION include/dspatch +) + +option(BUILD_EXAMPLES "Build Examples" OFF) +option(BUILD_DOC "Build Documentation" OFF) + +if(${BUILD_EXAMPLES}) + add_subdirectory(example) + add_subdirectory(tutorial) +endif(${BUILD_EXAMPLES}) + +if(${BUILD_DOC}) + add_subdirectory(doc) +endif(${BUILD_DOC}) diff --git a/src/libs/DSPatch/LGPLv3.txt b/src/libs/DSPatch/LGPLv3.txt new file mode 100755 index 0000000..b14ca0a --- /dev/null +++ b/src/libs/DSPatch/LGPLv3.txt @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/src/libs/DSPatch/Makefile b/src/libs/DSPatch/Makefile new file mode 100644 index 0000000..5d40e7b --- /dev/null +++ b/src/libs/DSPatch/Makefile @@ -0,0 +1,528 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.10 + +# Default target executed when no arguments are given to make. +default_target: all + +.PHONY : default_target + +# Allow only one "make -f Makefile2" at a time, but pass parallelism. +.NOTPARALLEL: + + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + + +# Remove some rules from gmake that .SUFFIXES does not remove. +SUFFIXES = + +.SUFFIXES: .hpux_make_needs_suffix_list + + +# Suppress display of executed commands. +$(VERBOSE).SILENT: + + +# A target that is always out of date. +cmake_force: + +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/local/Cellar/cmake/3.10.1/bin/cmake + +# The command to remove a file. +RM = /usr/local/Cellar/cmake/3.10.1/bin/cmake -E remove -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /Users/benjamin/orchestra/src/libs/DSPatch + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /Users/benjamin/orchestra/src/libs/DSPatch + +#============================================================================= +# Targets provided globally by CMake. + +# Special rule for the target install/local +install/local: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake +.PHONY : install/local + +# Special rule for the target install/local +install/local/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake +.PHONY : install/local/fast + +# Special rule for the target install/strip +install/strip: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake +.PHONY : install/strip + +# Special rule for the target install/strip +install/strip/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake +.PHONY : install/strip/fast + +# Special rule for the target install +install: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -P cmake_install.cmake +.PHONY : install + +# Special rule for the target install +install/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -P cmake_install.cmake +.PHONY : install/fast + +# Special rule for the target list_install_components +list_install_components: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\"" +.PHONY : list_install_components + +# Special rule for the target list_install_components +list_install_components/fast: list_install_components + +.PHONY : list_install_components/fast + +# Special rule for the target rebuild_cache +rebuild_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : rebuild_cache + +# Special rule for the target rebuild_cache +rebuild_cache/fast: rebuild_cache + +.PHONY : rebuild_cache/fast + +# Special rule for the target edit_cache +edit_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." + /usr/local/Cellar/cmake/3.10.1/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : edit_cache + +# Special rule for the target edit_cache +edit_cache/fast: edit_cache + +.PHONY : edit_cache/fast + +# The main all target +all: cmake_check_build_system + $(CMAKE_COMMAND) -E cmake_progress_start /Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles /Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles/progress.marks + $(MAKE) -f CMakeFiles/Makefile2 all + $(CMAKE_COMMAND) -E cmake_progress_start /Users/benjamin/orchestra/src/libs/DSPatch/CMakeFiles 0 +.PHONY : all + +# The main clean target +clean: + $(MAKE) -f CMakeFiles/Makefile2 clean +.PHONY : clean + +# The main clean target +clean/fast: clean + +.PHONY : clean/fast + +# Prepare targets for installation. +preinstall: all + $(MAKE) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall + +# Prepare targets for installation. +preinstall/fast: + $(MAKE) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall/fast + +# clear depends +depend: + $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 +.PHONY : depend + +#============================================================================= +# Target rules for targets named DSPatch + +# Build rule for target. +DSPatch: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 DSPatch +.PHONY : DSPatch + +# fast build rule for target. +DSPatch/fast: + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/build +.PHONY : DSPatch/fast + +src/DSPatch.o: src/DSPatch.cpp.o + +.PHONY : src/DSPatch.o + +# target to build an object file +src/DSPatch.cpp.o: + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/src/DSPatch.cpp.o +.PHONY : src/DSPatch.cpp.o + +src/DSPatch.i: src/DSPatch.cpp.i + +.PHONY : src/DSPatch.i + +# target to preprocess a source file +src/DSPatch.cpp.i: + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/src/DSPatch.cpp.i +.PHONY : src/DSPatch.cpp.i + +src/DSPatch.s: src/DSPatch.cpp.s + +.PHONY : src/DSPatch.s + +# target to generate assembly for a file +src/DSPatch.cpp.s: + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/src/DSPatch.cpp.s +.PHONY : src/DSPatch.cpp.s + +src/DspCircuit.o: src/DspCircuit.cpp.o + +.PHONY : src/DspCircuit.o + +# target to build an object file +src/DspCircuit.cpp.o: + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/src/DspCircuit.cpp.o +.PHONY : src/DspCircuit.cpp.o + +src/DspCircuit.i: src/DspCircuit.cpp.i + +.PHONY : src/DspCircuit.i + +# target to preprocess a source file +src/DspCircuit.cpp.i: + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/src/DspCircuit.cpp.i +.PHONY : src/DspCircuit.cpp.i + +src/DspCircuit.s: src/DspCircuit.cpp.s + +.PHONY : src/DspCircuit.s + +# target to generate assembly for a file +src/DspCircuit.cpp.s: + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/src/DspCircuit.cpp.s +.PHONY : src/DspCircuit.cpp.s + +src/DspCircuitThread.o: src/DspCircuitThread.cpp.o + +.PHONY : src/DspCircuitThread.o + +# target to build an object file +src/DspCircuitThread.cpp.o: + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/src/DspCircuitThread.cpp.o +.PHONY : src/DspCircuitThread.cpp.o + +src/DspCircuitThread.i: src/DspCircuitThread.cpp.i + +.PHONY : src/DspCircuitThread.i + +# target to preprocess a source file +src/DspCircuitThread.cpp.i: + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/src/DspCircuitThread.cpp.i +.PHONY : src/DspCircuitThread.cpp.i + +src/DspCircuitThread.s: src/DspCircuitThread.cpp.s + +.PHONY : src/DspCircuitThread.s + +# target to generate assembly for a file +src/DspCircuitThread.cpp.s: + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/src/DspCircuitThread.cpp.s +.PHONY : src/DspCircuitThread.cpp.s + +src/DspComponent.o: src/DspComponent.cpp.o + +.PHONY : src/DspComponent.o + +# target to build an object file +src/DspComponent.cpp.o: + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/src/DspComponent.cpp.o +.PHONY : src/DspComponent.cpp.o + +src/DspComponent.i: src/DspComponent.cpp.i + +.PHONY : src/DspComponent.i + +# target to preprocess a source file +src/DspComponent.cpp.i: + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/src/DspComponent.cpp.i +.PHONY : src/DspComponent.cpp.i + +src/DspComponent.s: src/DspComponent.cpp.s + +.PHONY : src/DspComponent.s + +# target to generate assembly for a file +src/DspComponent.cpp.s: + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/src/DspComponent.cpp.s +.PHONY : src/DspComponent.cpp.s + +src/DspComponentThread.o: src/DspComponentThread.cpp.o + +.PHONY : src/DspComponentThread.o + +# target to build an object file +src/DspComponentThread.cpp.o: + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/src/DspComponentThread.cpp.o +.PHONY : src/DspComponentThread.cpp.o + +src/DspComponentThread.i: src/DspComponentThread.cpp.i + +.PHONY : src/DspComponentThread.i + +# target to preprocess a source file +src/DspComponentThread.cpp.i: + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/src/DspComponentThread.cpp.i +.PHONY : src/DspComponentThread.cpp.i + +src/DspComponentThread.s: src/DspComponentThread.cpp.s + +.PHONY : src/DspComponentThread.s + +# target to generate assembly for a file +src/DspComponentThread.cpp.s: + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/src/DspComponentThread.cpp.s +.PHONY : src/DspComponentThread.cpp.s + +src/DspParameter.o: src/DspParameter.cpp.o + +.PHONY : src/DspParameter.o + +# target to build an object file +src/DspParameter.cpp.o: + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/src/DspParameter.cpp.o +.PHONY : src/DspParameter.cpp.o + +src/DspParameter.i: src/DspParameter.cpp.i + +.PHONY : src/DspParameter.i + +# target to preprocess a source file +src/DspParameter.cpp.i: + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/src/DspParameter.cpp.i +.PHONY : src/DspParameter.cpp.i + +src/DspParameter.s: src/DspParameter.cpp.s + +.PHONY : src/DspParameter.s + +# target to generate assembly for a file +src/DspParameter.cpp.s: + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/src/DspParameter.cpp.s +.PHONY : src/DspParameter.cpp.s + +src/DspPlugin.o: src/DspPlugin.cpp.o + +.PHONY : src/DspPlugin.o + +# target to build an object file +src/DspPlugin.cpp.o: + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/src/DspPlugin.cpp.o +.PHONY : src/DspPlugin.cpp.o + +src/DspPlugin.i: src/DspPlugin.cpp.i + +.PHONY : src/DspPlugin.i + +# target to preprocess a source file +src/DspPlugin.cpp.i: + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/src/DspPlugin.cpp.i +.PHONY : src/DspPlugin.cpp.i + +src/DspPlugin.s: src/DspPlugin.cpp.s + +.PHONY : src/DspPlugin.s + +# target to generate assembly for a file +src/DspPlugin.cpp.s: + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/src/DspPlugin.cpp.s +.PHONY : src/DspPlugin.cpp.s + +src/DspPluginLoader.o: src/DspPluginLoader.cpp.o + +.PHONY : src/DspPluginLoader.o + +# target to build an object file +src/DspPluginLoader.cpp.o: + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/src/DspPluginLoader.cpp.o +.PHONY : src/DspPluginLoader.cpp.o + +src/DspPluginLoader.i: src/DspPluginLoader.cpp.i + +.PHONY : src/DspPluginLoader.i + +# target to preprocess a source file +src/DspPluginLoader.cpp.i: + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/src/DspPluginLoader.cpp.i +.PHONY : src/DspPluginLoader.cpp.i + +src/DspPluginLoader.s: src/DspPluginLoader.cpp.s + +.PHONY : src/DspPluginLoader.s + +# target to generate assembly for a file +src/DspPluginLoader.cpp.s: + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/src/DspPluginLoader.cpp.s +.PHONY : src/DspPluginLoader.cpp.s + +src/DspSignal.o: src/DspSignal.cpp.o + +.PHONY : src/DspSignal.o + +# target to build an object file +src/DspSignal.cpp.o: + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/src/DspSignal.cpp.o +.PHONY : src/DspSignal.cpp.o + +src/DspSignal.i: src/DspSignal.cpp.i + +.PHONY : src/DspSignal.i + +# target to preprocess a source file +src/DspSignal.cpp.i: + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/src/DspSignal.cpp.i +.PHONY : src/DspSignal.cpp.i + +src/DspSignal.s: src/DspSignal.cpp.s + +.PHONY : src/DspSignal.s + +# target to generate assembly for a file +src/DspSignal.cpp.s: + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/src/DspSignal.cpp.s +.PHONY : src/DspSignal.cpp.s + +src/DspSignalBus.o: src/DspSignalBus.cpp.o + +.PHONY : src/DspSignalBus.o + +# target to build an object file +src/DspSignalBus.cpp.o: + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/src/DspSignalBus.cpp.o +.PHONY : src/DspSignalBus.cpp.o + +src/DspSignalBus.i: src/DspSignalBus.cpp.i + +.PHONY : src/DspSignalBus.i + +# target to preprocess a source file +src/DspSignalBus.cpp.i: + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/src/DspSignalBus.cpp.i +.PHONY : src/DspSignalBus.cpp.i + +src/DspSignalBus.s: src/DspSignalBus.cpp.s + +.PHONY : src/DspSignalBus.s + +# target to generate assembly for a file +src/DspSignalBus.cpp.s: + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/src/DspSignalBus.cpp.s +.PHONY : src/DspSignalBus.cpp.s + +src/DspWireBus.o: src/DspWireBus.cpp.o + +.PHONY : src/DspWireBus.o + +# target to build an object file +src/DspWireBus.cpp.o: + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/src/DspWireBus.cpp.o +.PHONY : src/DspWireBus.cpp.o + +src/DspWireBus.i: src/DspWireBus.cpp.i + +.PHONY : src/DspWireBus.i + +# target to preprocess a source file +src/DspWireBus.cpp.i: + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/src/DspWireBus.cpp.i +.PHONY : src/DspWireBus.cpp.i + +src/DspWireBus.s: src/DspWireBus.cpp.s + +.PHONY : src/DspWireBus.s + +# target to generate assembly for a file +src/DspWireBus.cpp.s: + $(MAKE) -f CMakeFiles/DSPatch.dir/build.make CMakeFiles/DSPatch.dir/src/DspWireBus.cpp.s +.PHONY : src/DspWireBus.cpp.s + +# Help Target +help: + @echo "The following are some of the valid targets for this Makefile:" + @echo "... all (the default if no target is provided)" + @echo "... clean" + @echo "... depend" + @echo "... install/local" + @echo "... install/strip" + @echo "... install" + @echo "... list_install_components" + @echo "... rebuild_cache" + @echo "... edit_cache" + @echo "... DSPatch" + @echo "... src/DSPatch.o" + @echo "... src/DSPatch.i" + @echo "... src/DSPatch.s" + @echo "... src/DspCircuit.o" + @echo "... src/DspCircuit.i" + @echo "... src/DspCircuit.s" + @echo "... src/DspCircuitThread.o" + @echo "... src/DspCircuitThread.i" + @echo "... src/DspCircuitThread.s" + @echo "... src/DspComponent.o" + @echo "... src/DspComponent.i" + @echo "... src/DspComponent.s" + @echo "... src/DspComponentThread.o" + @echo "... src/DspComponentThread.i" + @echo "... src/DspComponentThread.s" + @echo "... src/DspParameter.o" + @echo "... src/DspParameter.i" + @echo "... src/DspParameter.s" + @echo "... src/DspPlugin.o" + @echo "... src/DspPlugin.i" + @echo "... src/DspPlugin.s" + @echo "... src/DspPluginLoader.o" + @echo "... src/DspPluginLoader.i" + @echo "... src/DspPluginLoader.s" + @echo "... src/DspSignal.o" + @echo "... src/DspSignal.i" + @echo "... src/DspSignal.s" + @echo "... src/DspSignalBus.o" + @echo "... src/DspSignalBus.i" + @echo "... src/DspSignalBus.s" + @echo "... src/DspWireBus.o" + @echo "... src/DspWireBus.i" + @echo "... src/DspWireBus.s" +.PHONY : help + + + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system + diff --git a/src/libs/DSPatch/build.sh b/src/libs/DSPatch/build.sh new file mode 100755 index 0000000..841f6af --- /dev/null +++ b/src/libs/DSPatch/build.sh @@ -0,0 +1,17 @@ +#!/bin/bash +src_dir=$(dirname $(readlink -f "$0")) +build_dir=${src_dir}/build + +if [ -f "/usr/bin/ninja" ] ; then + GENERATOR="Ninja" + BUILD_COMMAND="ninja" +else + GENERATOR="Unix Makefiles" + BUILD_COMMAND="make" +fi + +rm -r -f ${build_dir} +mkdir -p ${build_dir} +cd ${build_dir} +cmake ${src_dir} -G "${GENERATOR}" +${BUILD_COMMAND} diff --git a/src/libs/DSPatch/cmake_install.cmake b/src/libs/DSPatch/cmake_install.cmake new file mode 100644 index 0000000..42c9340 --- /dev/null +++ b/src/libs/DSPatch/cmake_install.cmake @@ -0,0 +1,82 @@ +# Install script for directory: /Users/benjamin/orchestra/src/libs/DSPatch + +# Set the install prefix +if(NOT DEFINED CMAKE_INSTALL_PREFIX) + set(CMAKE_INSTALL_PREFIX "/usr/local") +endif() +string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") + +# Set the install configuration name. +if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) + if(BUILD_TYPE) + string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" + CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") + else() + set(CMAKE_INSTALL_CONFIG_NAME "") + endif() + message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") +endif() + +# Set the component getting installed. +if(NOT CMAKE_INSTALL_COMPONENT) + if(COMPONENT) + message(STATUS "Install component: \"${COMPONENT}\"") + set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") + else() + set(CMAKE_INSTALL_COMPONENT) + endif() +endif() + +# Is this installation the result of a crosscompile? +if(NOT DEFINED CMAKE_CROSSCOMPILING) + set(CMAKE_CROSSCOMPILING "FALSE") +endif() + +if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" OR NOT CMAKE_INSTALL_COMPONENT) + file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" TYPE SHARED_LIBRARY FILES "/Users/benjamin/orchestra/src/libs/DSPatch/libDSPatch.dylib") + if(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libDSPatch.dylib" AND + NOT IS_SYMLINK "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libDSPatch.dylib") + execute_process(COMMAND "/usr/bin/install_name_tool" + -id "libDSPatch.dylib" + "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libDSPatch.dylib") + if(CMAKE_INSTALL_DO_STRIP) + execute_process(COMMAND "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip" "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libDSPatch.dylib") + endif() + endif() +endif() + +if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" OR NOT CMAKE_INSTALL_COMPONENT) + file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/include" TYPE FILE FILES "/Users/benjamin/orchestra/src/libs/DSPatch/include/DSPatch.h") +endif() + +if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" OR NOT CMAKE_INSTALL_COMPONENT) + file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/include/dspatch" TYPE FILE FILES + "/Users/benjamin/orchestra/src/libs/DSPatch/include/dspatch/DspCircuit.h" + "/Users/benjamin/orchestra/src/libs/DSPatch/include/dspatch/DspCircuitThread.h" + "/Users/benjamin/orchestra/src/libs/DSPatch/include/dspatch/DspComponent.h" + "/Users/benjamin/orchestra/src/libs/DSPatch/include/dspatch/DspComponentThread.h" + "/Users/benjamin/orchestra/src/libs/DSPatch/include/dspatch/DspParameter.h" + "/Users/benjamin/orchestra/src/libs/DSPatch/include/dspatch/DspPlugin.h" + "/Users/benjamin/orchestra/src/libs/DSPatch/include/dspatch/DspPluginLoader.h" + "/Users/benjamin/orchestra/src/libs/DSPatch/include/dspatch/DspRunType.h" + "/Users/benjamin/orchestra/src/libs/DSPatch/include/dspatch/DspSignal.h" + "/Users/benjamin/orchestra/src/libs/DSPatch/include/dspatch/DspSignalBus.h" + "/Users/benjamin/orchestra/src/libs/DSPatch/include/dspatch/DspThread.h" + "/Users/benjamin/orchestra/src/libs/DSPatch/include/dspatch/DspThreadNull.h" + "/Users/benjamin/orchestra/src/libs/DSPatch/include/dspatch/DspThreadUnix.h" + "/Users/benjamin/orchestra/src/libs/DSPatch/include/dspatch/DspThreadWin.h" + "/Users/benjamin/orchestra/src/libs/DSPatch/include/dspatch/DspWire.h" + "/Users/benjamin/orchestra/src/libs/DSPatch/include/dspatch/DspWireBus.h" + ) +endif() + +if(CMAKE_INSTALL_COMPONENT) + set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt") +else() + set(CMAKE_INSTALL_MANIFEST "install_manifest.txt") +endif() + +string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT + "${CMAKE_INSTALL_MANIFEST_FILES}") +file(WRITE "/Users/benjamin/orchestra/src/libs/DSPatch/${CMAKE_INSTALL_MANIFEST}" + "${CMAKE_INSTALL_MANIFEST_CONTENT}") diff --git a/src/libs/DSPatch/doc/CMakeLists.txt b/src/libs/DSPatch/doc/CMakeLists.txt new file mode 100755 index 0000000..b91ce6d --- /dev/null +++ b/src/libs/DSPatch/doc/CMakeLists.txt @@ -0,0 +1,12 @@ +find_package(Doxygen) + +if(DOXYGEN_FOUND) + + add_custom_target( + doc ALL + ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMENT "Generating API documentation with Doxygen" VERBATIM + ) + +endif(DOXYGEN_FOUND) diff --git a/src/libs/DSPatch/doc/Doxyfile b/src/libs/DSPatch/doc/Doxyfile new file mode 100755 index 0000000..6a02095 --- /dev/null +++ b/src/libs/DSPatch/doc/Doxyfile @@ -0,0 +1,1835 @@ +# Doxyfile 1.8.0 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project +# +# All text after a hash (#) is considered a comment and will be ignored +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" ") + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or sequence of words) that should +# identify the project. Note that if you do not use Doxywizard you need +# to put quotes around the project name if it contains spaces. + +PROJECT_NAME = DSPatch + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = v.3.00 + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer +# a quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = "C++ Cross-Platform, Object-Oriented, Flow-Based Programming Library" + +# With the PROJECT_LOGO tag one can specify an logo or icon that is +# included in the documentation. The maximum height of the logo should not +# exceed 55 pixels and the maximum width should not exceed 200 pixels. +# Doxygen will copy the logo to the output directory. + +PROJECT_LOGO = heartbeat.png + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, +# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English +# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, +# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, +# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = NO + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful if your file system +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# This tag can be used to specify a number of word-keyword mappings (TCL only). +# A mapping has the form "name=value". For example adding +# "class=itcl::class" will allow you to use the command class in the +# itcl::class meaning. + +TCL_SUBST = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given extension. +# Doxygen has a built-in mapping, but you can override or extend it using this +# tag. The format is ext=language, where ext is a file extension, and language +# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, +# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make +# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C +# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions +# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all +# comments according to the Markdown format, which allows for more readable +# documentation. See http://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you +# can mix doxygen, HTML, and XML commands with Markdown formatting. +# Disable only in case of backward compatibilities issues. + +MARKDOWN_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also makes the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate getter +# and setter methods for a property. Setting this option to YES (the default) +# will make doxygen replace the get and set methods by a property in the +# documentation. This will only work if the methods are indeed getting or +# setting a simple type. If this is not the case, or you want to show the +# methods anyway, you should set this option to NO. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and +# unions are shown inside the group in which they are included (e.g. using +# @ingroup) instead of on a separate page (for HTML and Man pages) or +# section (for LaTeX and RTF). + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and +# unions with only public data fields will be shown inline in the documentation +# of the scope in which they are defined (i.e. file, namespace, or group +# documentation), provided this scope is documented. If set to NO (the default), +# structs, classes, and unions are shown on a separate page (for HTML and Man +# pages) or section (for LaTeX and RTF). + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = NO + +# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to +# determine which symbols to keep in memory and which to flush to disk. +# When the cache is full, less often used symbols will be written to disk. +# For small to medium size projects (<1000 input files) the default value is +# probably good enough. For larger projects a too small cache size can cause +# doxygen to be busy swapping symbols to and from disk most of the time +# causing a significant performance penalty. +# If the system has enough physical memory increasing the cache will improve the +# performance by keeping more symbols in memory. Note that the value works on +# a logarithmic scale so increasing the size by one will roughly double the +# memory usage. The cache size is given by this formula: +# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols. + +SYMBOL_CACHE_SIZE = 0 + +# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be +# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given +# their name and scope. Since this can be an expensive process and often the +# same symbol appear multiple times in the code, doxygen keeps a cache of +# pre-resolved symbols. If the cache is too small doxygen will become slower. +# If the cache is too large, memory is wasted. The cache size is given by this +# formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols. + +LOOKUP_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = NO + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal +# scope will be included in the documentation. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespaces are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = YES + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = NO + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen +# will list include files with double quotes in the documentation +# rather than with sharp brackets. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen +# will sort the (brief and detailed) documentation of class members so that +# constructors and destructors are listed first. If set to NO (the default) +# the constructors will appear in the respective orders defined by +# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. +# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO +# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to +# do proper type resolution of all parameters of a function it will reject a +# match between the prototype and the implementation of a member function even +# if there is only one candidate or it is obvious which candidate to choose +# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen +# will still accept a match between prototype and implementation in such cases. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or macro consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and macros in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is NO. + +SHOW_DIRECTORIES = NO + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. +# This will remove the Files entry from the Quick Index and from the +# Folder Tree View (if specified). The default is YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Namespaces page. This will remove the Namespaces entry from the Quick Index +# and from the Folder Tree View (if specified). The default is YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. The create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. +# You can optionally specify a file name after the option, if omitted +# DoxygenLayout.xml will be used as the name of the layout file. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files +# containing the references data. This must be a list of .bib files. The +# .bib extension is automatically appended if omitted. Using this command +# requires the bibtex tool to be installed. See also +# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style +# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this +# feature you need bibtex and perl available in the search path. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = NO + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# The WARN_NO_PARAMDOC option can be enabled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = ../ + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh +# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py +# *.f90 *.f *.for *.vhd *.vhdl + +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.d \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.idl \ + *.odl \ + *.cs \ + *.php \ + *.php3 \ + *.inc \ + *.m \ + *.mm \ + *.dox \ + *.py \ + *.f90 \ + *.f \ + *.for \ + *.vhd \ + *.vhdl + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = ../src/DspThreadUnix.h \ + ../src/DspThreadWin.h \ + ../example \ + ../tutorial + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = * + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty or if +# non of the patterns match the file name, INPUT_FILTER is applied. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) +# and it is also possible to disable source filtering for a specific pattern +# using *.ext= (so without naming a filter). This option only has effect when +# FILTER_SOURCE_FILES is enabled. + +FILTER_SOURCE_PATTERNS = + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. Otherwise they will link to the documentation. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = NO + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. Note that when using a custom header you are responsible +# for the proper inclusion of any scripts and style sheets that doxygen +# needs, which is dependent on the configuration options used. +# It is advised to generate a default header using "doxygen -w html +# header.html footer.html stylesheet.css YourConfigFile" and then modify +# that header. Note that the header is subject to change so you typically +# have to redo this when upgrading to a newer version of doxygen or when +# changing the value of configuration settings such as GENERATE_TREEVIEW! + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# style sheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that +# the files will be copied as-is; there are no commands or markers available. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. +# Doxygen will adjust the colors in the style sheet and background images +# according to this color. Hue is specified as an angle on a colorwheel, +# see http://en.wikipedia.org/wiki/Hue for more information. +# For instance the value 0 represents red, 60 is yellow, 120 is green, +# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. +# The allowed range is 0 to 359. + +HTML_COLORSTYLE_HUE = 238 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of +# the colors in the HTML output. For a value of 0 the output will use +# grayscales only. A value of 255 will produce the most vivid colors. + +HTML_COLORSTYLE_SAT = 61 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to +# the luminance component of the colors in the HTML output. Values below +# 100 gradually make the output lighter, whereas values above 100 make +# the output darker. The value divided by 100 is the actual gamma applied, +# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, +# and 100 does not change the gamma. + +HTML_COLORSTYLE_GAMMA = 135 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting +# this to NO can help when comparing the output of multiple runs. + +HTML_TIMESTAMP = YES + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = NO + +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. +# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING +# is used to encode HtmlHelp index (hhk), content (hhc) and project file +# content. + +CHM_INDEX_ENCODING = + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated +# that can be used as input for Qt's qhelpgenerator to generate a +# Qt Compressed Help (.qch) of the generated HTML documentation. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can +# be used to specify the file name of the resulting .qch file. +# The path specified is relative to the HTML output folder. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#namespace + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#virtual-folders + +QHP_VIRTUAL_FOLDER = doc + +# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to +# add. For more information please see +# http://doc.trolltech.com/qthelpproject.html#custom-filters + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see +# +# Qt Help Project / Custom Filters. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's +# filter section matches. +# +# Qt Help Project / Filter Attributes. + +QHP_SECT_FILTER_ATTRS = + +# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can +# be used to specify the location of Qt's qhelpgenerator. +# If non-empty doxygen will try to run qhelpgenerator on the generated +# .qhp file. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files +# will be generated, which together with the HTML files, form an Eclipse help +# plugin. To install this plugin and make it available under the help contents +# menu in Eclipse, the contents of the directory containing the HTML and XML +# files needs to be copied into the plugins directory of eclipse. The name of +# the directory within the plugins directory should be the same as +# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before +# the help appears. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have +# this name. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) +# at top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. Since the tabs have the same information as the +# navigation tree you can set this option to NO if you already set +# GENERATE_TREEVIEW to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. +# If the tag value is set to YES, a side panel will be generated +# containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). +# Windows users are probably better off using the HTML help feature. +# Since the tree basically has the same information as the tab index you +# could consider to set DISABLE_INDEX to NO when enabling this option. + +GENERATE_TREEVIEW = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values +# (range [0,1..20]) that doxygen will group on one line in the generated HTML +# documentation. Note that a value of 0 will completely suppress the enum +# values from appearing in the overview section. + +ENUM_VALUES_PER_LINE = 4 + +# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, +# and Class Hierarchy pages using a tree view instead of an ordered list. + +USE_INLINE_TREES = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open +# links to external symbols imported via tag files in a separate window. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of Latex formulas included +# as images in the HTML documentation. The default is 10. Note that +# when you change the font size after a successful doxygen run you need +# to manually remove any form_*.png images from the HTML output directory +# to force them to be regenerated. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are +# not supported properly for IE 6.0, but are supported on all modern browsers. +# Note that when changing this option you need to delete any form_*.png files +# in the HTML output before the changes have effect. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax +# (see http://www.mathjax.org) which uses client side Javascript for the +# rendering instead of using prerendered bitmaps. Use this if you do not +# have LaTeX installed or if you want to formulas look prettier in the HTML +# output. When enabled you may also need to install MathJax separately and +# configure the path to it using the MATHJAX_RELPATH option. + +USE_MATHJAX = NO + +# When MathJax is enabled you need to specify the location relative to the +# HTML output directory using the MATHJAX_RELPATH option. The destination +# directory should contain the MathJax.js script. For instance, if the mathjax +# directory is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to +# the MathJax Content Delivery Network so you can quickly see the result without +# installing MathJax. However, it is strongly recommended to install a local +# copy of MathJax from http://www.mathjax.org before deployment. + +MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest + +# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension +# names that should be enabled during MathJax rendering. + +MATHJAX_EXTENSIONS = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box +# for the HTML output. The underlying search engine uses javascript +# and DHTML and should work on any modern browser. Note that when using +# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets +# (GENERATE_DOCSET) there is already a search function so this one should +# typically be disabled. For large projects the javascript based search engine +# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. + +SEARCHENGINE = YES + +# When the SERVER_BASED_SEARCH tag is enabled the search engine will be +# implemented using a PHP enabled web server instead of at the web client +# using Javascript. Doxygen will generate the search PHP script and index +# file to put on the web server. The advantage of the server +# based approach is that it scales better to large projects and allows +# full text search. The disadvantages are that it is more difficult to setup +# and does not have live searching capabilities. + +SERVER_BASED_SEARCH = NO + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. +# Note that when enabling USE_PDFLATEX this option is only used for +# generating bitmaps for formulas in the HTML output, but not in the +# Makefile that is written to the output directory. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4 + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for +# the generated latex document. The footer should contain everything after +# the last chapter. If it is left blank doxygen will generate a +# standard footer. Notice: only use this tag if you know what you are doing! + +LATEX_FOOTER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = NO + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = YES + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +# If LATEX_SOURCE_CODE is set to YES then doxygen will include +# source code with syntax highlighting in the LaTeX output. +# Note that which sources are shown also depends on other settings +# such as SOURCE_BROWSER. + +LATEX_SOURCE_CODE = NO + +# The LATEX_BIB_STYLE tag can be used to specify the style to use for the +# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See +# http://en.wikipedia.org/wiki/BibTeX for more info. + +LATEX_BIB_STYLE = plain + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load style sheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. This is useful +# if you want to understand what is going on. On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# pointed to by INCLUDE_PATH will be searched when a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = XT_WIN + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition that +# overrules the definition found in the source code. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all references to function-like macros +# that are alone on a line, have an all uppercase name, and do not end with a +# semicolon, because these will confuse the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. For each +# tag file the location of the external documentation should be added. The +# format of a tag file without this location is as follows: +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths +# or URLs. Note that each tag file must have a unique name (where the name does +# NOT include the path). If a tag file is not located in the directory in which +# doxygen is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option also works with HAVE_DOT disabled, but it is recommended to +# install and use dot, since it yields more powerful graphs. + +CLASS_DIAGRAMS = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = NO + +# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is +# allowed to run in parallel. When set to 0 (the default) doxygen will +# base this on the number of processors available in the system. You can set it +# explicitly to a value larger than 0 to get control over the balance +# between CPU load and processing speed. + +DOT_NUM_THREADS = 0 + +# By default doxygen will use the Helvetica font for all dot files that +# doxygen generates. When you want a differently looking font you can specify +# the font name using DOT_FONTNAME. You need to make sure dot is able to find +# the font, which can be done by putting it in a standard location or by setting +# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the +# directory containing the font. + +DOT_FONTNAME = Helvetica + +# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. +# The default size is 10pt. + +DOT_FONTSIZE = 10 + +# By default doxygen will tell dot to use the Helvetica font. +# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to +# set the path where dot can find it. + +DOT_FONTPATH = + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If the UML_LOOK tag is enabled, the fields and methods are shown inside +# the class node. If there are many fields or methods and many nodes the +# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS +# threshold limits the number of items for each type to make the size more +# managable. Set this to 0 for no limit. Note that the threshold may be +# exceeded by 50% before the limit is enforced. + +UML_LIMIT_NUM_FIELDS = 10 + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs +# for selected functions only using the \callgraph command. + +CALL_GRAPH = YES + +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller +# graphs for selected functions only using the \callergraph command. + +CALLER_GRAPH = YES + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will generate a graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are svg, png, jpg, or gif. +# If left blank png will be used. If you choose svg you need to set +# HTML_FILE_EXTENSION to xhtml in order to make the SVG files +# visible in IE 9+ (other browsers do not have this requirement). + +DOT_IMAGE_FORMAT = png + +# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to +# enable generation of interactive SVG images that allow zooming and panning. +# Note that this requires a modern browser other than Internet Explorer. +# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you +# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files +# visible. Older versions of IE do not have SVG support. + +INTERACTIVE_SVG = NO + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MSCFILE_DIRS tag can be used to specify one or more directories that +# contain msc files that are included in the documentation (see the +# \mscfile command). + +MSCFILE_DIRS = + +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the +# number of direct children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 50 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 0 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, because dot on Windows does not +# seem to support this out of the box. Warning: Depending on the platform used, +# enabling this option may lead to badly anti-aliased labels on the edges of +# a graph (i.e. they become hard to read). + +DOT_TRANSPARENT = NO + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = NO + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES diff --git a/src/libs/DSPatch/doc/heartbeat.png b/src/libs/DSPatch/doc/heartbeat.png new file mode 100755 index 0000000000000000000000000000000000000000..e349eb4c631561c947917addabec49d0738d6988 GIT binary patch literal 10339 zcmV-pD4f@cP)004&%004{+008|`004nN004b?008NW002DY000@xb3BE2000U( zX+uL$P-t&-Z*ypGa3D!TLm+T+Z)Rz1WdHz3$DNjUR8-d%htIutdZEoQ0#b(FyTAa_ zdy`&8VVD_UC<6{NG_fI~0ue<-nj%P0#DLLIBvwSR5EN9f2P6n6F&ITuEN@2Ei>|D^ z_ww@lRz|vC zuzLs)$;-`!o*{AqUjza0dRV*yaMRE;fKCVhpQKsoe1Yhg01=zBIT!&C1$=TK@rP|Ibo3vKKm@PqnO#LJhq6%Ij6Hz*<$V$@wQAMN5qJ)hzm2h zoGcOF60t^#FqJFfH{#e-4l@G)6iI9sa9D{VHW4w29}?su;^hF~NC{tY+*d5%WDCTX za!E_i;d2ub1#}&jF5T4HnnCyEWTkKf0>c0%E1Ah>(_PY1)0w;+02c53Su*0<(nUqK zG_|(0G&D0Z{i;y^b@OjZ+}lNZ8Th$p5Uu}MTtq^NHl*T1?CO*}7&0ztZsv2j*bmJyf3G7=Z`5B*PvzoDiKdLpOAxi2$L0#SX*@cY z_n(^h55xYX#km%V()bZjV~l{*bt*u9?FT3d5g^g~#a;iSZ@&02Abxq_DwB(I|L-^b zXThc7C4-yrInE_0gw7K3GZ**7&k~>k0Z0NWkO#^@9q0fwx1%qj zZ=)yBuQ3=54Wo^*!gyjLF-e%Um=erBOdIALW)L%unZshS@>qSW9o8Sq#0s#5*edK% z>{;v(b^`kbN5rY%%y90wC>#%$kE_5P!JWYk;U;klcqzOl-UjcFXXA75rT9jCH~u<) z0>40zCTJ7v2qAyk54cquI@7b&LHdZ`+zlTss6bJ7%PQ)z$cROu4wBhpu-r)01) zS~6}jY?%U?gEALn#wiFzo#H}aQ8rT=DHkadR18&{>P1bW7E`~Y4p3)hWn`DhhRJ5j z*2tcg9i<^OEt(fCg;q*CP8+7ZTcWhYX$fb^_9d-LhL+6BEtPYWVlfKTBusSTASKKb%HuWJzl+By+?gkLq)?+BTu761 zjmyXF)a;mc^>(B7bo*HQ1NNg1st!zt28YLv>W*y3CdWx9U8f|cqfXDAO`Q48?auQq zHZJR2&bcD49Ip>EY~kKEPV6Wm+eXFV)D)_R=tM0@&p?(!V*Qu1PXHG9o^ zTY0bZ?)4%01p8F`JoeS|<@=<@RE7GY07EYX@lwd>4oW|Yi!o+Su@M`;WuSK z8LKk71XR(_RKHM1xJ5XYX`fk>`6eqY>qNG6HZQwBM=xi4&Sb88?zd}EYguc1@>KIS z<&CX#T35dwS|7K*XM_5Nf(;WJJvJWRMA($P>8E^?{IdL4o5MGE7bq2MEEwP7v8AO@ zqL5!WvekBL-8R%V?zVyL=G&{be=K4bT`e{#t|)$A!YaA?jp;X)-+bB;zhj`(vULAW z%ue3U;av{94wp%n<(7@__S@Z2PA@Mif3+uO&y|X06?J#oSi8M;ejj_^(0<4Lt#wLu#dYrva1Y$6_o(k^&}yhSh&h;f@JVA>W8b%o zZ=0JGnu?n~9O4}sJsfnnx7n(>`H13?(iXTy*fM=I`sj`CT)*pTHEgYKqqP+u1IL8N zo_-(u{qS+0<2@%BCt82d{Gqm;(q7a7b>wu+b|!X?c13m#p7cK1({0<`{-e>4hfb-U zsyQuty7Ua;Ou?B?XLHZaol8GAb3Wnxcu!2v{R_`T4=x`(GvqLI{-*2AOSimk zUAw*F_TX^n@STz9kDQ z$NC=!KfXWC8h`dn#xL(D3Z9UkR7|Q&Hcy#Notk!^zVUSB(}`#4&lYA1f0h2V_PNgU zAAWQEt$#LRcH#y9#i!p(Udq2b^lI6wp1FXzN3T;~FU%Lck$-deE#qz9yYP3D3t8{6 z?<+s(e(3(_^YOu_)K8!O1p}D#{JO;G(*OVf32;bRa{vGi!~g&e!~vBn4jTXf9h6B# zK~#8N-CbLZRp)tK=giER`<(#>%z(MW;FOCKQeSdWn&8+`RJB#ost;A0hg69oHEN{v zp-R)YKJ=k|h*~L?QunD+Q>9Ugoj6t?F}4ZV5U{y}fiV~c=6dFO=5nTMedqhOH)G;p zbB;&pNL%}yefD+j_1)I@|BzYWAC}-xS1rx~^IT8Q08`Vz#3V2>4h#0F5RUGVum0tx`7Nqt>ShR z-~J)%uURYou0O5p^=si%EDaS(_p+oQW(1Zal9&Ux6%DNbaRCcNE`ARn^|Jx0{Rwz- zt|ef_l7Xm)Hr55B95-z=(7PUptY|-rdv$iCO6%IpN>mR ze+g{)gYb!I<^_QAVFF^FYXug4w?!B@(B|$8oQ(NIvs?iz@byKwI(YvtL0rtdbmUwh zY6)lpaTb{4wizz7{5JRx%}b_zpmN02OIr%BSauNSWv+U7`7ZZi0#A#9$MrNT zlW_tz#q|W&0&jAPYk?^cRmr5xIV;q}z+ZE>Wq*kG_$JDFeLcATsyv{IeFDS)Bsc!^B`s%j}Kh~}@v zK0cLvpFV4?pdoX$`k26t3p|20I?7skq-55z$f~LW=8BUT7#hYe4qUe;C0-eo*F0QT+Z!g$HB4 z|HX@pK=VNaoU($b=aA`&HDSUE9P)cpB$Z5A!A8sM+ydV0>%-|&H*oZ54Njk#u;14{ zP=yVfb9m@O%kkibCahTAfw|cX8VQ;JG!O}d^+qq=x;93Zp2FrWtI*n3ZB>i~3ZAM)z{u~3aSl}ael3t`-zaQK z!QB4Reo?1h8 zLY4R{D~RC}#Q=dgr;<))Et5_s)Jk`_=mFc>ix^=);Lr;farBj19Q^4xCPs(R-P3@5 zPp!bGKHZ7#mGpu2DHAffTsq{wphp z5m1t{&npyTq=57CPTvLMjM5!$6POK*y2auQhDRsy`iTJ?czzJiKYNL%?7{EsU4e%m zzQ}Z^2ite_VuXHE%$5%n^W+=F%qFt5hCnLy5yCiq6-1eg%r$OWpDoC6 zEx#CogBUs~5G6JcXql`f+!7sl4gpeKLp70!_RkNT#=m~&b@catl!%XE{iaL!voCGI zhjy=H)2e~)x0=Ugjd4nQ8VH=Cw}OutYmAg>6HMLTZw(U#VrYL>wWxye+Sx=1)yE#a z1+2P#!PZENRQ@TlG_?R-D}YlcPvht>$MEvuHk>$o6Ln2f*tsW%eV<*8-riO$U(t^0 zOs)A$r9)z+bpzdJRx5%lpR9m@d*4jFLn}}duwSczHX6)U01ON1$r!a66XleC?oUE*sNk>v% zp)}{dQqXk08j(3I|69%&sfWG<$et9tIAhg@NnDnfyq%s{zU+0fa!s+cs+v_yS0i?P zco}x>Cf(+5VtjHn4jsB-ER1v~f``dxI+0(y+(E@|`MuQ6i&+;ShKZ?!164Hl!!K4U;eJ;T?E-utEwrIabxJaUcj$j&Ew#~xA4Y=S=2X?ZQJVb@a}5tdAJ)Zx*J$C zx9~PHrX^Y;PQX-G3pAC6Nl;N__NqtsTZyXWu1rjW7^a#q&KpUlUZ+4*(6E%omF+y>H@mEL8hHzvb}(x{G<_we{qq3P7$z1Jod3}?Ap_bWgSgqmNMqL zWcY}ZYUPNvVjH8dSZKG`4gLzl_q=b9NomlMEe_8-FEfBQVH^?i;zUqHw5Q~0ZId>FfTtwU>P zD}{`#okMKPIIB#YaFC)h3E*^Y`#s7&<%eoj@O~>=_C*?!L^PS>+f6oOj{)iaP5bM? zBvlCfBx$&{P;)5dCAAId1o8;K70g! z{ufksdbgwRDpeo03>2XRmU6tv_bd^2fW*Y8m90+pq&n1Zg?lMHkz`jQM@*t~fEX7s z0QC&cGHY`Z5Jg*=q?l;F%>#o>Ro^4p+HtB5RL(WbVsLN}Cr{p@_*%q~mnL!T%2hnj z^C0&9em6ey@GQ1$sl~FcH4GdSDOev{P*5-+DD?ziqHDsgsEHjg6B|MXQ;8?FMu4W| zurTGck`rCYSl^F{n>mMYAg3$9EI?>c0B|!D3oZE-0|g-0N=1x~rp%=J92x+U8O4no z!}#G3&f=FxS_x1)ayXB@A8W&tPpxO5=%nA0t>sGPAI~AS)rnnP3qTWH1)2v20ja7Z zm}rcXn+u57+LL$jb5Wk9bGWF1t;w#pt`ZM( zH0K3&@Mdt0+Ti7jgZSYO&)~}WTC99x^#leat_ zv4NWc(Q4?Df3p-N%+-}@`|eq~-G?MIW$cl#i=hre{1$*lX&MSPg5=6&Fk|x`tl&ooxjC~(+tJe zB6@di#hyJiSifN$YuEMgB{g8+R_SF~gDT`I$ylxr2Gb%r7Lb{UkOa57H?3Tb!h z1y3>&)^GAnif}{212}Q~296!C!)qt=xPJX6`y`E6y`~P^dskx9)>d?M)DY|(kIPvi zEq`jkL7=D#;iB&XD5R_qQX_Z>AnmWRP1lZu*+B6+INGK5u;)Z(bp&8wu__nR5c4_+%>{VS{O9cRK~u2BtPMOl^uj z^jCLZ!w1drCUT_*NCh65jjpG+EGsYt+5<-9a}javLAaybk^)Sap4glW26eMm^&$|1 zIfg|r*3S`u==>I~jcOjv9rS1~gy?G`i07#K993L=HV~Cao20L*!qsO1sUaS6-mkrO z0bl=GA9BsBtt=}PMhI378Ap??s-wwOQGQxrlZoq=3|g9N$x1fcn-*A#%`?rJ<}!n( zX8zt(#g=F-+B=rH(|WYx8N_>I*E> z3apvOQP(_!&Xrkouc*VS)r~9z8_>C|8C}a-ZOX+$W|nMZrA)N4q)AP6BmHXD*b##S z1aLBN%0=H~h@S&%7U8T7vroE+4yrNV(<`|h>*sh=%o2ModKP~HcbIcTW~DGH+vFPs zpaP4UOqM4qFO-uO;-1tdzKj>LXz6Ate>lnkH$x1`BO`f?3{GHZbdE1#mW`YFD7OskSsC*YjALH=}CGb6|T86%ihS4PXaTf`$OJeho8`q{}F? z*0Z|bOqdu_e$>bUOL?43+Iq%Xd!SIz(Z!?6F$KrXEM%}4+^UNuoi`T-q68Gv=XmhK z{1n|tDN&uLDd^m@vsD=3Se$|WJV!`Ou&x%%rkC|uE zuab#RR^*Llbd&T&xkibZ$`QRrPWmCdA2HGd1+BS{OeW04%0mwr zG518rCfz>&T|pthzN5sHNyyj9$`w^pK_TfKD=kvK=xh0C1-)?&Et?!4=IpCH#>ZyJ z=y@`~Xw04HW+a#0V+w|v$4-ew_t2qX#wPtoJR=LshP3h^T(IAeXd9AU?cBu#xa`x)S7 z>6fluxrR%ZrZ~WgqcJ!RNI5Ddk!;mNL?vbh{xDWy7QbMDtNH8)uE0~i;IpgE8Rq5u-( zLM`{tdT0}fdAu?KX_3t>z^{%S!~P%L!uj*taQVV@RM(!vAAeyNwy@E^rl*VfXB7(o z`atq7?#(g@m)|VK@r)wILMD|A571{}m83YqvcweA8-jJt%rqnKcAPnTr>fx@<|?3_ zkpe>I5YsH=J53>%FBFghN^1eh&+5lSBAtw$Ab2`oj*Q7|)!Yr)N3YTg#WB>1_^%7)JnsdJFUll8iJIn@@t0p7!&kogc|Ld}ZgCurDj|C?_gmIN zm3HatC`$!sXp|-@aDRcTfFW?L1Qg(IZD|EOEHGKWmtiFL%EZX+BJYco#DakPIBPkm zCKs35*Wb_Q?a=#f$8b4A>`K7)=GGkENgHTdYGZP>J>fpQwh zB~lquTUE@lBv@r3feBSS8eC?MF8CUF@{6W2xZo?MiFIE6=xgYOR*|?L40iw8M%BGC z>|XYZ@=WGn5!C~P&EMmq8C9x%RU+yJCnyyS4o-2f(j<-@W6R;_5Qg*3=;*A&ri~-m zw{I)fZ*E}H+hzwT(1fW9xTL|QAfXyt{!Z)gbzUCYd>02y8AJ%Y>Hf+)7?uj00pi^- zC_57^msF~fN|ePuYc~);&Eb<1@4J2t7tT%K zU=lU1{Gd$;lE|Cq1MtBwo;{6k{`EY@W+b$p!xNv`hK*a7VZ}-o`}NgKc$@4P%{;IK zm;gkF(59pLxNKDsNzia#82V;3^$o-nqtYNnt{3Zj0qk!3xU~3w4}X{A6d=qKm)^eE zX%E1S^=uhjIDeBxe~yYu9re2ftXT_=f>4`*0Ft@m^mkSf_#H;yB(4}js^Q})NYd@o zcVChobSlawJ($$F?+1ahGcm>`%1lBKkU86|Dz#r}&P5j5Z@$%!lg9_~@=JNVbZCN+ zx)$4at;Fv>I)q0b>%fMMTQD$4_70cKPk|!p*Dz<>W~z+qd@^zOi_w0KG$l&37*cXS zpuNL)RwBho8edABT_u-!Dk9rNNiM2dvQ_ge+2+~s&odfd#rOa75-y(KWR7jknv?j_ zm$u`vPp)Md*>1D3lv7&aPoQjeK&sYF{G$VEinWqvCDMGM$vkNyAYjY+S9T`q=8_c0 zg#pVA`B?zQ0Cx$?He*0y1plPhwX}1Vz=_we|Cw7j^2%zQJJ!!%ZeZW%*5MPM?&83J z4z#s25CryR$Y^Co(L_?MOFf}9%ZdPMghq^2jIlhCx-9mS_X}u6Knw}YS|`dA#Yj)8 zBe~X)l#&8nN_kAm;<}FVm3kTzW4Cbq#yk%EYykiJg8}A?c{H?i63iAn{`f418?Qri zTRSHP@t+{#H6qoBr2 zjAvQDX*QKj>Gen+Gpj7g{%rx#Oj@B?Dvo+2E^%2osQl5j!AQo#Z)&KXr9(9Pm=7oy zpg;M%rwcf;3snV7bd2dAN zQjEB`TjlY7nOPAg#@kNMIyFHyKy*-(nO1JJ#JSNe5AlC{KuOn@TQken~5|0RqY;1tM8E zO7IkYwXM2F{o(?yy_v`9(*romfBN7uRht3_h_6{&i;q3l%yHgDPB>rB5fF{myH~Yh z4R>!a+0-u1F06mBg9Dx#*odkk z+tg$#r8mk0)z0KdkW!;bT{?Xhh#`Yn3fIqLgfX zm+7l!CT#`=OM{#K_FG%=>3v%`Y`Kg6tr3|b5#!JZRU~c9E8E!J;}|9z>S6!bhO0dG zFO^8rmn@cg(sBZ*$NWG+OngYFDsu1wFa@R!UvV*4OjD&j$B|(Ya+RJ4IOTt>s&MG{ zRa8U%dQ3@V~?H|}s(@AD57wBwEw>ZlQ;F2*hVWe272bC$iNGfL9KN%Pj z8qv*g2lahz9-sW2e4Ya*G1izT6ZXDJXo@i@NY{(BrkqLkk~1-h(xEeoj7rE;G)V+h zYGE;EI;P&nKj{)8gU#hrYd}8G)$16=k@m&qX5o@Eu{6KI8{*-h14Wv1)+dx?Y2OxE z)rgW_=slG9Yz-=IGgeFX3PD!q6sQ$;S`|M1yTA7sUl`HZ*jd6g8Pcq8S(?8E**&SgDF!^ZpxWyK!&7GAQOh^j$LGpARi;Nti`#AiIoO$ zNzGXgoHXDRiBo1B{xSdvFl`?J? zjYkyCyEC&)2^MDJp1#-&P +#include + +//================================================================================================= +/// System-wide DSPatch functionality + +/** +At the core of the DSPatch framework is what's known as the "global circuit". The DSPatch class and +hence, the global circuit provides a transparent workspace for "global scoped components" +(components not within a DspCircuit) to benefit from circuit parallel processing. As it is not +required that components be explicitly added to a DspCircuit in order to be routed etc., in order +for these global scoped components to benefit from the multi threading associated with the circuit +scheduler, they are automatically added to the DSPatch global circuit when parallel processing is +required (i.e. StartAutoTick() is called). Although global circuit operations are automatic and +transparent to the user, if required, the user is may set the number of threads used by the global +circuit by calling SetGlobalThreadCount(). + +Lastly, the Finalize() method must be called on application exit in order for DSPatch to perform +the necessary memory cleanup. +*/ + +class DLLEXPORT DSPatch +{ +public: + static void SetGlobalThreadCount(int threadCount); + static void Finalize(); + +private: + static bool _IsThisGlobalCircuit(DspComponent const* thisComponent); + + static bool _AddGlobalComponent(DspComponent* component); + static void _RemoveGlobalComponent(DspComponent const* component); + + static int _GetGlobalComponentCount(); + + static void _StartGlobalAutoTick(); + static void _StopGlobalAutoTick(); + +private: + friend class DspComponent; + + static DspCircuit* _globalCircuit; +}; + +//================================================================================================= + +#endif // DSPATCH_H + +//================================================================================================= + +/** + +\mainpage Welcome! + ** NOTE ** : A graphical tool for creating and routing DSPatch circuits can be found + here. + +\section intro_sec Introduction + DSPatch, pronounced "dispatch", is a powerful C++ flow-based programming library that allows + you to create and route (or "patch") high performance data processing circuits. DSPatch is not + limited to any particular type of circuit or signal, its generic object-oriented API allows you + to create almost any system imaginable, from simple logic circuits to high performance audio + process chains and electronics simulation. DSPatch's simple framework makes development quick + and easy, allowing you to hit the ground running on every project. + + DSPatch is designed around the concept of a "circuit" containing "components", interconnected + via "wires" that transfer "signals" to and from input and output "buses". For more detail on + how DSPatch works, check out the DSPatch Design Specification. + + The two most important classes to consider are DspComponent and DspCircuit. In order to route + data to and from DspComponents they can either be added to an DspCircuit, where they can be + wired together (recommended), or they can be wired directly via public DspComponent methods. + + The DSPatch engine takes care of data transfer between interconnected components, when data is + ready for a component to process, a callback: "Process_()" is executed in that component. For a + component to form part of the DSPatch framework, designers simply have to derive their + component from the DspComponent base class, configure the component's IO buses, and implement + the virtual Process_() callback method. + +\n + +\section features_sec Features + - Automatic branch synchronization - The result of data diverging across parallel + branches is guaranteed to arrive synchronized at a converging point. + - Component plugins - Package components into plugins to be dynamically loaded into + DSPatch host applications. + - Dynamic thread count adjustment - Specify at run-time, the number of threads in which + you require a circuit to process. + - Easy-to-use object-oriented API - DSPatch is modeled around real-world circuit + entities and concepts, making code more readable and easy to understand. + - Feedback loops - Create true closed-circuit systems by feeding resultant signals back + into previous component inputs. + - High performance parallel processing - Circuits use advanced multi-threaded scheduling + to maximize data flow efficiency. + - Integrated circuits - Build circuits within circuits to encapsulate complex component + networks into single circuit components. + - Non-threaded platform support - Develop for (or port to) platforms without + multi-threading support and process complex circuit systems in a single thread. + - Run-time circuit wiring - Connect and disconnect wires on the fly whilst maintaining + steady data flow through the system. + - Run-time adaptive signal types - Component inputs can accept values of run-time + varying types allowing you to create more flexible, multi-purpose component processes. + +\n + +\section install_sec Getting Started + +\subsection step1 Step 1: Download DSPatch + The DSPatch library can be downloaded from the + SourceForge project page. + Download the project archive and extract the contents anywhere you like. + +\subsection step2 Step 2: Read the Tutorials + The "Tutorials" section below covers 2 vital aspects to developing with DSPatch: + 1. Creating a DspComponent - This tutorial is a start to finish demonstration of how to + create a DSPatch component. + 2. Building a DspCircuit - In this tutorial you will learn how to use the DSPatch framework + to interconnect and process DspComponent networks using the DspCircuit interface. + +\subsection step3 Step 3: Check out the example project + In the "example" folder (in the DSPatch root directory) you will find a DSPatch demo project, + written to assist developers in understanding the DSPatch API as well as to demonstrate how it + could be used to build audio process chains. This project uses the open-source library RtAudio + in order to stream sound to your computer's audio device -Linux users will need to install + "libasound2-dev" (ALSA) before attempting to build. + +\subsection step4 Step 4: Make your own DspComponents + A fast way to create your own DspComponent could be to copy an existing component to another + destination, rename it, and edit the contents to satisfy your component's required behavior. + In the "example" folder (from Step 3) you will find 2 source files: "DspAdder.h" and + "DspAdder.cpp". These files make up a very simple DspComponent that receives 2 floating-point + buffers into it's 2 inputs, adds each buffer element of the 1st buffer to the corresponding + element of the 2nd buffer, then passes the resultant buffer to the output. Alternatively, you + could just copy / reference the source code from the "Creating a DspComponent" tutorial + (found under the "tutorial" folder in the root directory). + +\subsection step5 Step 5: Roll your own DSPatch projects + As DSPatch is not reliant on any non-standard 3rd party sources, getting a DSPatch project to + compile and run is relatively painless. All you need to do from your project is include + "DSPatch.h" from the "include" folder (in the DSPatch root directory), and link to the + DSPatch library (either by including all DSPatch source or by linking to a compiled library + file). To speed things up you may want to copy, rename, and edit the example project from + step 3 to get up and running faster. + +\subsection step6 Step 6: Refer to the documentation + Between the example project, the DspAdder component template, and the documentation found + here, you should have enough resources to get started with DSPatch straight away. If you have + any questions or wish to report a bug, feel free to email me at marcus@adaptaudio.com. + +\n + +\section tutorial_sec Tutorials + +\subsection create_component 1. Creating a DspComponent + In order to create a new DspComponent, we must derive our component class from the + DspComponent base class, configure component IO, and implement the inherited virtual + "Process_()" method. + + Lets take a look at how we would go about creating a boolean logic "AND" component. This + component will accept 2 boolean input values and output the result of: input 1 && input 2. + + We begin by deriving our new "DspAnd" component from DspComponent: + + \code +// 1. Derive component class from DspComponent +// =========================================== +class DspAnd : public DspComponent +{ + \endcode + + The next step is to configure our component's input and output buses. This is achieved by + calling the base protected methods AddInput_() and AddOutput_() respectively from our + component's constructor. Each method must be called once per input / output required. In our + component's case, we require 2 inputs and 1 output, therefore our constructor code will look + like this: + + \code +public: + // 2. Configure component IO buses + // =============================== + DspAnd() + { + // add 2 inputs + AddInput_("input1"); + AddInput_("input2"); + + // add 1 output + AddOutput_("output"); + } + \endcode + + The string values passed into the AddInput_() and AddOutput_() method calls are signal names + / IDs. As component IO can be referenced by either string ID or index, IO signal names are + optional. If we do not require a signal to have a string ID associated with it, we can simply + leave the parenthesis empty. + + Lastly, our component must implement the DspComponent virtual Process_() method. This is + where our component does it's work. The Process_() method provides us with 2 arguments: the + input bus and the output bus. It is our duty as the component designer to pull the inputs we + require out of the input bus, process them accordingly, and populate the output bus with the + results. Our component's process method will look something like this: + + \code +protected: + // 3. Implement virtual Process_() method + // ====================================== + virtual void Process_(DspSignalBus& inputs, DspSignalBus& outputs) + { + // create local stack variables to hold input values + bool bool1 = false; + bool bool2 = false; + + // get values from inputs bus (GetValue() returns true if successful) + if(inputs.GetValue(0, bool1) && //OR inputs.GetValue("input1", bool1); + inputs.GetValue(1, bool2)) //OR inputs.GetValue("input2", bool2); + { + // set output as the result of bool1 AND bool2 + outputs.SetValue(0, bool1 && bool2); //OR outputs.SetValue("output", bool1 && bool2); + } + } +}; + \endcode + + And that's it! Our component is now ready to form part of the DSPatch framework. Next we'll + look at how we can add our component to a DspCircuit and route it to and from other + DspComponents. + +\n + +\subsection use_component 2. Building a DspCircuit + In order for us to get any real use out of our DspComponents, we need them to interact with + each other. This is where the DspCircuit class comes in. A DspCircuit is a workspace for + adding and routing DspComponents. In this section we will have a look at how to create a + simple DSPatch application that generates random boolean pairs, performs a logic AND on each + pair, then prints the result to screen. + + First we must include the DSPatch header and any other headers that contain DspComponents we + wish to use in our application: + + \code +#include +#include + \endcode + + Next, we must instantiate our DspCircuit object and all DspComponent objects needed for our + circuit. Lets say we had 2 other components included with "DspAnd" (from the first tutorial): + "DspRandBool" (generates a random boolean value then outputs the result) and "DspPrintBool" + (receives a boolean value and outputs it to the console): + + \code +void main() +{ + // 1. Create a DspCircuit where we can route our components + // ======================================================== + DspCircuit circuit; + + // 2. Create instances of the components needed for our circuit + // ============================================================ + DspRandBool randBoolGen1; + DspRandBool randBoolGen2; + DspAnd logicAnd; + DspPrintBool boolPrinter; + \endcode + + Now that we have a circuit and some components, lets add all of our components to the circuit: + + \code + // 3. Add component instances to circuit + // ===================================== + circuit.AddComponent(randBoolGen1, "Bool Generator 1"); + circuit.AddComponent(randBoolGen2, "Bool Generator 2"); + circuit.AddComponent(logicAnd, "Logic AND"); + circuit.AddComponent(boolPrinter, "Bool Printer"); + \endcode + + The string values passed into the AddComponent() method calls are component names / IDs. + Although we still have the option of referencing a component via it's pointer in a circuit, + component string IDs can allow circuit objects to be entirely self-contained. This could give + us the ability to pass circuits around by reference, allowing the receiver access to all + circuit components via their string IDs, without having to manage both component and circuit + references everywhere. + + We are now ready to begin wiring the circuit: + + \code + // 4. Wire up the components inside the circuit + // ============================================ + + circuit.ConnectOutToIn(randBoolGen1, 0, logicAnd, 0); + //OR circuit.ConnectOutToIn("Bool Generator 1", 0, "Logic AND", 0); + //OR circuit.ConnectOutToIn("Bool Generator 1", 0, "Logic AND", "input1"); + + circuit.ConnectOutToIn(randBoolGen2, 0, logicAnd, 1); + //OR circuit.ConnectOutToIn("Bool Generator 2", 0, "Logic AND", 1); + //OR circuit.ConnectOutToIn("Bool Generator 2", 0, "Logic AND", "input2"); + + circuit.ConnectOutToIn(logicAnd, 0, boolPrinter, 0); + //OR circuit.ConnectOutToIn("Logic AND", 0, "Bool Printer", 0); + //OR circuit.ConnectOutToIn("Logic AND", "output", "Bool Printer", 0); + \endcode + + The code above results in the following wiring configuration: + \code + ___________ + ["Bool Generator 1"] 0 ---> 0 | | + |"Logic AND"| 0 ---> 0 ["Bool Printer"] + ["Bool Generator 2"] 0 ---> 1 |___________| + \endcode + + *N.B. Each component input can only accept one wire at a time. When another wire is connected + to an input that already has a connected wire, that wire is replaced with the new one. One + output, on the other hand, can be distributed to multiple inputs. + + Lastly, in order for our circuit to do any work it must be ticked over. This is performed by + repeatedly calling the circuit's Tick() and Reset() methods. These methods can be called + manually in a loop from the main application thread, or alternatively, by calling + StartAutoTick(), a seperate thread will spawn, automatically calling Tick() and Reset() + continuously. A circuit's thread count can be adjusted at runtime, allowing us to increase / + decrease the number of threads use by the circuit as required during execution: + + \code + // 5. Tick the circuit + // =================== + + // Circuit tick method 1: Manual + for(int i = 0; i < 10; i++) + { + circuit.Tick(); + circuit.Reset(); + } + + // Circuit tick method 2: Automatic + std::cout << "Press any key to begin circuit auto-tick."; + getchar(); + circuit.StartAutoTick(); + + // Increase circuit thread count for higher performance + getchar(); + circuit.SetThreadCount(4); + + // Press any key to quit + getchar(); + \endcode + + Lastly, the DSPatch::Finalize() method must be called on application exit in order for DSPatch + to perform its own internal memory cleanup. + + \code + // 6. Clean up + // =========== + DSPatch::Finalize(); +} + \endcode + + (All the source code from these tutorials can be found under the "tutorial" folder in the DSPatch root directory). + +\n + +\section changelog Changelog + +\subsection v300 v.3.00 (07 April 2015) + - Reference parameters by index for better performance. + - Cleaned up code formatting and class interfaces. + - DisconnectComponent fixed to also remove outgoing wires. + - ResumeAutoTick() resumes only once called for every PauseAutoTick(). + - Updates to support DSPatcher (http://sourceforge.net/p/dspatcher) + +\subsection v270 v.2.70 (21 December 2014) + - Added support for DspComponent plugins (DspPlugin + DspPluginLoader). + - Fixed build and install scripts. + +\subsection v262 v.2.62 (18 August 2014) + - Added alternative Get* methods returning const pointers. + - Increased build warning level and fixed all issues. + - Uninitialised variable fix for DspParameter. + - Fixed GetInput/Output/ParameterName() empty string return bug. + +\subsection v261 v.2.61 (16 June 2014) + - Introduced component parameters (DspParameter). + - Added DspComponent user callback mechanism. + - Improved const-correctness and code style. + - Added ability to remove single IO pins. + +\subsection v260 v.2.60 (19 January 2014) + - Replaced project files with more flexible CMakeLists. + - DspWaveStreamer fix (don't assume standard type sizes). + - Reduced size of distributable. + +\subsection v251 v.2.51 (13 September 2013) + - Fixed Unix thread detach error. + - Improved overall encapsulation. + - Replaced "Clear" with "Remove" for I/O removal. + +\subsection v250 v.2.50 (14 July 2013) + - Reduced size of distributable. + - Removed closed source dependency from example project. + - Added Linux makefiles. + +\subsection v243 v.2.43 (30 June 2013) + - Simplified platform selection macros. + +\subsection v242 v.2.42 (24 June 2013) + - Added vs2008 and vs2010 versions of dspdemo. + - Code style and performance improvements. + +\subsection v241 v.2.41 (07 February 2013) + - Fixed VS2010 dspdemo linker errors. + +\subsection v240 v.2.40 (04 February 2013) + - Optimized DspRunType. + - Added Stop() method to DspThread. + - Reduced pointer dereferencing and temporaries. + +\subsection v233 v.2.33 (01 February 2013) + - Signal reading / writing optimized. + - Code cleaned up and re-formatted. + +\subsection v232 v.2.32 (24 January 2013) + - Reduced component thread mutex locking. + - Fixed DspCircuit AddInput() run-time error. + - Documentation updates. + +\subsection v231 v.2.31 (19 December 2012) + - Improved synchronization in AddComponent(). + - Component routing upgraded to template methods. + +\subsection v230 v.2.30 (15 December 2012) + - Circuit routing simplified. + - Completed "circuit-less" component processing. + - Component names now optional. + - DspCircuit no longer deletes external memory. + - Optimized circuit-in-circuit processing. + +\subsection v22 v.2.2 (08 December 2012) + - A component can no longer exist in multiple circuits. + - Added coding tutorials + - Cleaned up project directory structure. + - Comments and documentation updates. + - Resolved component / circuit thread count clash. + +\subsection v21 v.2.1 (06 November 2012) + - Removed DspSafePointer class. + - Greatly improved overall performance. + - Added commenting for doxygen. + +\subsection v20 v.2.0 (02 November 2012) + - Re-licensed DSPatch to LGPL. + - Added support for non-threaded platforms. + - Circuit routing upgraded to more flexible template methods. + +\subsection v12 v.1.2 (20 October 2012) + - Ported to Unix-based OS's. + - Completed circuit-in-circuit logic. + +\subsection v11 v.1.1 (17 October 2012) + - Various bug fixes. + - Added 2 more components to the dspdemo project. + - Optimized threaded circuit processing. + - AddComponent() updated to accept pre-constructed DspComponents. + +\subsection v10 v.1.0 (14 October 2012) + - Extracted routing engine behind "Crosstalk" to form: "DSPatch". + +\page spec_page DSPatch Design Specification + +1. The Circuit Concept: +----------------------- + +A circuit is comprised of a collection of interconnected components. Each +component has 2 signal buses, on one end of the component there are input +pins (input bus), and on the other end there are output pins (output bus). +Components within the circuit are connected to each other via wires. Each +wire carries a signal from one component's output pin to another component's +input pin. A circuit can also comprise of interconnected circuits (E.g. ICs). +In this case a circuit acts as a component within another circuit. + +______________________________________________________________________________ + +2. The DSPatch Circuit System: +------------------------------ + +**2.1 Structure:** + +The nouns above are the classes we require in order to model our circuit in +code. Each component will contain an array of input wires. Each wire contains +references to the source component, the source output signal, and the +destination input signal. The signal bus class will contain an array of +signals, and lastly, the circuit class is derived from component and will +contain an array of internal components. + +**2.2 Behavior:** + +**2.2.1 Component:** + +The component class will have a Tick() method responsible for acquiring its +next set of inputs from its input wires and populating the component's input +bus. To insure that these inputs are up-to-date, the dependent component +first calls all of its input components' Tick() methods -hence recursively +called in all components going backward through the circuit. The acquired +input bus is then passed into a virtual method: Process() -it is the +responsibility of the (derived) component creator to implement this virtual +function. The Process() method has 2 input arguments: the input bus and the +output bus. This method's purpose is to pull its required inputs out of the +input bus, process these inputs, and populate the output bus with the results. +These resultant outputs in the output bus are then acquired by dependent +components via their Tick() functions. + +Component input and output buses (signal count, string IDs etc.) will be +configurable by derived component classes via protected base methods, whilst +input wires to a component will be routable via public component class +methods. + +The component class will also have a Reset() method. For optimization as well +as to avoid feedback deadlocks, a component needs to be aware of whether or +not it has already ticked during a circuit traversal so that if called to +Tick() again, it can ignore the call. The Reset() method informs the +component that the last circuit traversal has completed and hence can execute +the next Tick() request. + +When a component is instantiated within a circuit, a unique string ID is +optional. This name can be used to identify the component in the circuit's +component collection. + +**1.2.2 Circuit:** + +In order to satisfy the statement above ("circuit acts as a component"), the +circuit class is derived from the component class. This means that the +circuit class has both Tick() and Process() methods. The Tick() method will +execute as normal, acquiring inputs for the circuit to process. This allows +us to expose the IO we require for internal components via the circuit's +input and output buses. Circuit IO-to-component wires, and +component-to-component wires, will be publicly routable via circuit class +methods. The circuit class' virtual Process() method is implemented as such: + +* All internal components are Reset()ed. +* Inputs from the circuit's input bus are copied into their respective +internal component input buses. +* All internal components are Tick()ed. +* The circuit output bus is populated with the respective internal component +outputs. + +All actions in respect to the circuit and the components within the circuit +will be made available via public functions in the circuit class. The circuit +object user will be able to add/remove components, connect/disconnect wires, +set/get circuit IO, set/get individual component IO, and acquire a handle to +any component within the circuit. This means only ever requiring one object +to perform all circuit actions. + +**1.2.3 Signal:** + +When it comes to transferring signals between components we require the same +level of abstraction for the data being moved around: + +The base component class needs to supply its child class with any number of +inputs and outputs via the virtual Process() method. These inputs and outputs +may also need to be of different types. This requires a generic way of +containing variables of different types in a single collection -the signal +bus. + +The signal class will hold a variable that can be dynamically typed at +run-time, which I've named "run-type". The run-type and signal classes make +use of template methods to allow object users to set and get the contained +variable as any type they wish. The run-type (and hence, a signal) has the +ability to change type at any point during program execution -this can be +useful for inputs that can accept a number of different types of data (E.g. +Varying sample size in an audio buffer: array of byte / int / float) + +From the Process() method, a derived component can get and set the signals +it requires of the provided signal buses via public methods. As the component +creator is responsible for configuring the component's IO buses, the types +held within those buses can be assumed, and hence, read and written to +accordingly. Built-in typecasting and error checking prevents critical +run-time errors from occurring when signal types are mismatched. + +When a signal is instantiated, an optional unique string ID can be assigned. +This name can be used to identify the signal in collections (E.g. a signal +bus). Alternatively, signals are referred to via index. + +______________________________________________________________________________ + +3. Parallel Circuit Processing: +------------------------------- + +The multi-threading aspect of DSPatch is designed to allow the library user the +ability to specify the number of threads in which he/she required the circuit +to process, rather than the thread count growing as the system does. So for +example, an application running on a quad core CPU could be limited to 4 +threads in order to allow each core to handle just one thread. + +**3.1 The Circuit Thread:** + +Circuit threads are threads that traverse entire circuits. The circuit runs +through its array of components, calling each components' process method in a +single thread (circuit thread) loop. As each component is done processing, it +hands over control to the next waiting circuit thread. Therefore, if you had 5 +components in a process chain, and 5 circuit threads, at any point in time you +could have one thread per component processing in parallel. With this in place, +you now also have the option to select 0 circuit threads. In this state, the +circuit's Tick() and Reset() methods will block the calling thread while all +components in the circuit are processed, whereas with circuit threads enabled, +the calling thread will block only if all circuit threads are busy. (A null +thread class that implements stub thread methods allows for DSPatch to compile +on platforms with no native thread support) + +**3.2 The Component Thread:** + +The component thread simply ticks a single component over and over. As the +circuit class inherits from component, we use it's component thread to +"auto-tick" the circuit whilst freeing up the main application thread for +control. In a circuit-less system of interconnected DspComponents, each +component must be auto-ticked in order for the component network to be parallel +processed. Again, for non-threaded systems, a component's Tick() and Reset() +methods can simply be called in a loop from the main application thread.*/ diff --git a/src/libs/DSPatch/include/dspatch/DspCircuit.h b/src/libs/DSPatch/include/dspatch/DspCircuit.h new file mode 100755 index 0000000..e0af6b6 --- /dev/null +++ b/src/libs/DSPatch/include/dspatch/DspCircuit.h @@ -0,0 +1,321 @@ +/************************************************************************ +DSPatch - Cross-Platform, Object-Oriented, Flow-Based Programming Library +Copyright (c) 2012-2015 Marcus Tomlinson + +This file is part of DSPatch. + +GNU Lesser General Public License Usage +This file may be used under the terms of the GNU Lesser General Public +License version 3.0 as published by the Free Software Foundation and +appearing in the file LGPLv3.txt included in the packaging of this +file. Please review the following information to ensure the GNU Lesser +General Public License version 3.0 requirements will be met: +http://www.gnu.org/copyleft/lgpl.html. + +Other Usage +Alternatively, this file may be used in accordance with the terms and +conditions contained in a signed written agreement between you and +Marcus Tomlinson. + +DSPatch is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +************************************************************************/ + +#ifndef DSPCIRCUIT_H +#define DSPCIRCUIT_H + +//------------------------------------------------------------------------------------------------- + +#include +#include +#include + +//================================================================================================= +/// Workspace for adding and routing components + +/** +DspComponents can be added to a DspCircuit and routed to and from other DspComponents. When a +DspComponent is added to a DspCircuit, a unique string ID is optional. This name can be used to +identify the component within the circuit's component collection. ConnectOutToIn and +DisconnectOutToIn provide a means of routing component outputs to other component inputs, while +ConnectInToIn / DisconnectInToIn and ConnectOutToOut / DisconnectOutToOut route the circuit's IO +signals to and from it's internal components. + +*N.B. Each component input can only accept one wire at a time. When another wire is connected to an +input that already has a connected wire, that wire is replaced with the new one. One output, on the +other hand, can be distributed to multiple inputs. + +For process intensive circuits, multi-threaded processing can be enabled via the SetThreadCount() +method. DspCircuit allows the user to specify the number of threads in which he/she requires the +circuit to process (0 threads: multi-threading disabled). A circuit's thread count can be adjusted +at runtime, allowing the user to increase / decrease the number of threads as required during +execution. + +DspCircuit is derived from DspComponent and therefore inherits all DspComponent behavior. This +means that a DspCircuit can be added to, and routed within another DspCircuit as a component. This +also means a circuit object needs to be Tick()ed and Reset()ed as a component (see DspComponent). +The DspCircuit Process_() method simply runs through it's internal array of components and calls each +component's Tick() and Reset() methods. +*/ + +class DLLEXPORT DspCircuit : public DspComponent +{ +public: + DspCircuit(int threadCount = 0); + ~DspCircuit(); + + void SetThreadCount(int threadCount); + int GetThreadCount() const; + + bool AddComponent(DspComponent* component, std::string const& componentName = ""); + bool AddComponent(DspComponent& component, std::string const& componentName = ""); + + void RemoveComponent(DspComponent const* component); + void RemoveComponent(DspComponent const& component); + void RemoveComponent(std::string const& componentName); + + void RemoveAllComponents(); + + template + ComponentType* GetComponent(std::string const& componentName); + + int GetComponentCount() const; + + // component output to component input + template + bool ConnectOutToIn(FromComponentType& fromComponent, FromOutputId const& fromOutput, ToComponentType& toComponent, ToInputId const& toInput); + + // circuit input to component input + template + bool ConnectInToIn(FromInputId const& fromInput, ToComponentType& toComponent, ToInputId const& toInput); + + // component output to circuit output + template + bool ConnectOutToOut(FromComponentType& fromComponent, FromOutputId const& fromOutput, ToOutputId const& toOutput); + + // component output to component input + template + void DisconnectOutToIn(FromComponentType const& fromComponent, FromOutputId const& fromOutput, ToComponentType const& toComponent, ToInputId const& toInput); + + // circuit input to component input + template + bool DisconnectInToIn(FromInputId const& fromInput, ToComponentType const& toComponent, ToInputId const& toInput); + + // component output to circuit output + template + bool DisconnectOutToOut(FromComponentType const& fromComponent, FromOutputId const& fromOutput, ToOutputId const& toOutput); + + void DisconnectComponent(std::string const& component); + + bool AddInput(std::string const& inputName = ""); + bool AddOutput(std::string const& outputName = ""); + + void RemoveInput(); + void RemoveOutput(); + + void RemoveAllInputs(); + void RemoveAllOutputs(); + +protected: + virtual void Process_(DspSignalBus& inputs, DspSignalBus& outputs); + +private: + virtual void _PauseAutoTick(); + + bool _FindComponent(DspComponent const* component, int& returnIndex) const; + bool _FindComponent(DspComponent const& component, int& returnIndex) const; + bool _FindComponent(std::string const& componentName, int& returnIndex) const; + bool _FindComponent(int componentIndex, int& returnIndex) const; + + void _DisconnectComponent(int componentIndex); + void _RemoveComponent(int componentIndex); + +private: + std::vector _components; + + std::vector _circuitThreads; + int _currentThreadIndex; + + DspWireBus _inToInWires; + DspWireBus _outToOutWires; +}; + +//================================================================================================= + +template +ComponentType* DspCircuit::GetComponent(std::string const& componentName) +{ + int componentIndex; + + if (_FindComponent(componentName, componentIndex)) + { + return static_cast(_components[componentIndex]); + } + else + { + return NULL; + } +} + +//------------------------------------------------------------------------------------------------- + +template +bool DspCircuit::ConnectOutToIn(FromComponentType& fromComponent, + FromOutputId const& fromOutput, + ToComponentType& toComponent, + ToInputId const& toInput) +{ + int fromComponentIndex; + int toComponentIndex; + + // only interconnect components that have been added to this system + if (!_FindComponent(fromComponent, fromComponentIndex) || !_FindComponent(toComponent, toComponentIndex)) + { + return false; + } + + PauseAutoTick(); + + bool result = _components[toComponentIndex]->ConnectInput(_components[fromComponentIndex], fromOutput, toInput); + + ResumeAutoTick(); + + return result; +} + +//------------------------------------------------------------------------------------------------- + +template +bool DspCircuit::ConnectInToIn(FromInputId const& fromInput, ToComponentType& toComponent, ToInputId const& toInput) +{ + int fromInputIndex; + int toComponentIndex; + int toInputIndex; + + // only interconnect components that have been added to this system + if (!_FindInput(fromInput, fromInputIndex) || !_FindComponent(toComponent, toComponentIndex) || + !_components[toComponentIndex]->_FindInput(toInput, toInputIndex)) + { + return false; + } + + PauseAutoTick(); + + bool result = _inToInWires.AddWire(_components[toComponentIndex], fromInputIndex, toInputIndex); + + ResumeAutoTick(); + + return result; +} + +//------------------------------------------------------------------------------------------------- + +template +bool DspCircuit::ConnectOutToOut(FromComponentType& fromComponent, + FromOutputId const& fromOutput, + ToOutputId const& toOutput) +{ + int fromComponentIndex; + int fromOutputIndex; + int toOutputIndex; + + // only interconnect components that have been added to this system + if (!_FindComponent(fromComponent, fromComponentIndex) || + !_components[fromComponentIndex]->_FindOutput(fromOutput, fromOutputIndex) || + !_FindOutput(toOutput, toOutputIndex)) + { + return false; + } + + PauseAutoTick(); + + bool result = _outToOutWires.AddWire(_components[fromComponentIndex], fromOutputIndex, toOutputIndex); + + ResumeAutoTick(); + + return result; +} + +//------------------------------------------------------------------------------------------------- + +template +void DspCircuit::DisconnectOutToIn(FromComponentType const& fromComponent, + FromOutputId const& fromOutput, + ToComponentType const& toComponent, + ToInputId const& toInput) +{ + int fromComponentIndex; + int toComponentIndex; + + // only interconnect components that have been added to this system + if (!_FindComponent(fromComponent, fromComponentIndex) || !_FindComponent(toComponent, toComponentIndex)) + { + return; + } + + PauseAutoTick(); + + _components[toComponentIndex]->DisconnectInput(_components[fromComponentIndex], fromOutput, toInput); + + ResumeAutoTick(); +} + +//------------------------------------------------------------------------------------------------- + +template +bool DspCircuit::DisconnectInToIn(FromInputId const& fromInput, + ToComponentType const& toComponent, + ToInputId const& toInput) +{ + int fromInputIndex; + int toComponentIndex; + int toInputIndex; + + // only interconnect components that have been added to this system + if (!_FindInput(fromInput, fromInputIndex) || !_FindComponent(toComponent, toComponentIndex) || + !_components[toComponentIndex]->_FindInput(toInput, toInputIndex)) + { + return false; + } + + PauseAutoTick(); + + bool result = _inToInWires.RemoveWire(_components[toComponentIndex], fromInputIndex, toInputIndex); + + ResumeAutoTick(); + + return result; +} + +//------------------------------------------------------------------------------------------------- + +template +bool DspCircuit::DisconnectOutToOut(FromComponentType const& fromComponent, + FromOutputId const& fromOutput, + ToOutputId const& toOutput) +{ + int fromComponentIndex; + int fromOutputIndex; + int toOutputIndex; + + // only interconnect components that have been added to this system + if (!_FindComponent(fromComponent, fromComponentIndex) || + !_components[fromComponentIndex]->_FindOutput(fromOutput, fromOutputIndex) || + !_FindOutput(toOutput, toOutputIndex)) + { + return false; + } + + PauseAutoTick(); + + bool result = _outToOutWires.RemoveWire(_components[fromComponentIndex], fromOutputIndex, toOutputIndex); + + ResumeAutoTick(); + + return result; +} + +//================================================================================================= + +#endif // DSPCIRCUIT_H diff --git a/src/libs/DSPatch/include/dspatch/DspCircuitThread.h b/src/libs/DSPatch/include/dspatch/DspCircuitThread.h new file mode 100755 index 0000000..99d4741 --- /dev/null +++ b/src/libs/DSPatch/include/dspatch/DspCircuitThread.h @@ -0,0 +1,89 @@ +/************************************************************************ +DSPatch - Cross-Platform, Object-Oriented, Flow-Based Programming Library +Copyright (c) 2012-2015 Marcus Tomlinson + +This file is part of DSPatch. + +GNU Lesser General Public License Usage +This file may be used under the terms of the GNU Lesser General Public +License version 3.0 as published by the Free Software Foundation and +appearing in the file LGPLv3.txt included in the packaging of this +file. Please review the following information to ensure the GNU Lesser +General Public License version 3.0 requirements will be met: +http://www.gnu.org/copyleft/lgpl.html. + +Other Usage +Alternatively, this file may be used in accordance with the terms and +conditions contained in a signed written agreement between you and +Marcus Tomlinson. + +DSPatch is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +************************************************************************/ + +#ifndef DSPCIRCUITTHREAD_H +#define DSPCIRCUITTHREAD_H + +//------------------------------------------------------------------------------------------------- + +#include + +#include + +class DspComponent; + +//================================================================================================= +/// Thread class for ticking and reseting circuit components + +/** +A DspCircuitThread is responsible for ticking and reseting all components in a DspCircuit. +On construction, a reference to the vector of circuit components must be provided for the thread +_Run() method to loop through. Each DspCircuitThread has a thread number (threadNo), which also +can be provided on construction. When creating multiple DspCircuitThreads, each thread must have +their own unique thread number, beginning at 0 and incrementing by 1 for every thread added. This +thread number corresponds with the DspComponent's buffer number when calling it's ThreadTick() and +ThreadReset() methods in the DspCircuitThread's component loop. Hence, for every circuit thread +created, each component's buffer count within that circuit must be incremented to match. + +The Resume() method causes the DspCircuitThread to tick and reset all circuit components once, +after which the thread will wait until instructed to resume again. As each component is done +processing it hands over control to the next waiting circuit thread, therefore, from an external +control loop (I.e. DspCircuit's Process_() method) we simply loop through our array of +DspCircuitThreads calling Resume() on each. If a circuit thread is busy processing, a call to +Resume() will block momentarily until processing is complete, then begin the next iteration +immediately upon unblocking the calling thread. + +The Sync() method, when called, will block the calling thread until the circuit thread is done +processing. If the circuit thread is already awaiting the next Resume() request, this method will +return immediately. +*/ + +class DLLEXPORT DspCircuitThread : public DspThread +{ +public: + DspCircuitThread(); + ~DspCircuitThread(); + + void Initialise(std::vector* components, int threadNo); + + void Start(Priority priority = TimeCriticalPriority); + void Stop(); + void Sync(); + void Resume(); + +private: + std::vector* _components; + int _threadNo; + bool _stop; + bool _stopped; + bool _gotResume, _gotSync; + DspMutex _resumeMutex; + DspWaitCondition _resumeCondt, _syncCondt; + + virtual void _Run(); +}; + +//================================================================================================= + +#endif // DSPCIRCUITTHREAD_H diff --git a/src/libs/DSPatch/include/dspatch/DspComponent.h b/src/libs/DSPatch/include/dspatch/DspComponent.h new file mode 100755 index 0000000..5362fd7 --- /dev/null +++ b/src/libs/DSPatch/include/dspatch/DspComponent.h @@ -0,0 +1,282 @@ +/************************************************************************ +DSPatch - Cross-Platform, Object-Oriented, Flow-Based Programming Library +Copyright (c) 2012-2015 Marcus Tomlinson + +This file is part of DSPatch. + +GNU Lesser General Public License Usage +This file may be used under the terms of the GNU Lesser General Public +License version 3.0 as published by the Free Software Foundation and +appearing in the file LGPLv3.txt included in the packaging of this +file. Please review the following information to ensure the GNU Lesser +General Public License version 3.0 requirements will be met: +http://www.gnu.org/copyleft/lgpl.html. + +Other Usage +Alternatively, this file may be used in accordance with the terms and +conditions contained in a signed written agreement between you and +Marcus Tomlinson. + +DSPatch is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +************************************************************************/ + +#ifndef DSPCOMPONENT_H +#define DSPCOMPONENT_H + +//------------------------------------------------------------------------------------------------- + +#include +#include +#include +#include + +class DspCircuit; + +//================================================================================================= +/// Abstract base class for all DSPatch components + +/** +Classes derived from DspComponent can be added to a DspCircuit and routed to and from other +DspComponents. + +On construction, derived classes must configure the component's IO buses by calling AddInput_() and +AddOutput_() respectively, as well as populate the component's parameter map via AddParameter_() +(see DspParameter). + +Derived classes must also implement the virtual method: Process_(). The Process_() method is a +callback from the DSPatch engine that occurs when a new set of input signals is ready for +processing. The Process_() method has 2 arguments: the input bus, and the output bus. This +method's purpose is to pull its required inputs out of the input bus, process these inputs, and +populate the output bus with the results (see DspSignalBus). + +Derived classes that expose parameters will also need to implement the virtual ParameterUpdating_() +method. The ParameterUpdating_() method is a callback from the DSPatch engine that occurs when an +update to a component parameter has been requested via the public SetParameter() method. +ParameterUpdating_() has 2 arguments: the parameter name, and the new parameter value to be set. +This method's purpose is to: 1. validate that the new value is legal, 2. make the necessary +internal changes associated with that parameter change, and 3. update the target parameter itself +by calling the protected SetParameter_() method. If the new parameter value is legal and the update +was successful, ParameterUpdating_() should return true, otherwise, it should return false. + +In order for a component to do any work it must be ticked over. This is performed by repeatedly +calling the Tick() and Reset() methods. The Tick() method is responsible for acquiring the next set +of input signals from component input wires and populating the component's input bus. To insure +that these inputs are up-to-date, the dependent component first calls all of its input components' +Tick() methods -hence recursively called in all components going backward through the circuit (This +is what's classified as a "pull system"). The acquired input bus is then passed to the Process_() +method. The Reset() method then informs the component that the last circuit traversal has completed +and hence can execute the next Tick() request. A component's Tick() and Reset() methods can be +called in a loop from the main application thread, or alternatively, by calling StartAutoTick(), a +separate thread will spawn, automatically calling Tick() and Reset() methods continuously (This is +most commonly used to tick over an instance of DspCircuit). +*/ + +class DLLEXPORT DspComponent +{ +public: + enum CallbackType + { + InputAdded, + InputRemoved, + OutputAdded, + OutputRemoved, + ParameterAdded, + ParameterRemoved, + ParameterUpdated + }; + typedef void (*Callback_t)(DspComponent* component, CallbackType const& callbackType, int index, void* userData); + + DspComponent(); + virtual ~DspComponent(); + + void SetCallback(Callback_t const& callback, void* userData = NULL); + + void SetComponentName(std::string const& componentName); + std::string GetComponentName() const; + + template + bool ConnectInput(DspComponent* fromComponent, FromOutputId const& fromOutput, ToInputId const& toInput); + + template + bool ConnectInput(DspComponent& fromComponent, FromOutputId const& fromOutput, ToInputId const& toInput); + + template + void DisconnectInput(DspComponent const* fromComponent, FromOutputId const& fromOutput, ToInputId const& toInput); + + template + void DisconnectInput(DspComponent const& fromComponent, FromOutputId const& fromOutput, ToInputId const& toInput); + + void DisconnectInput(int inputIndex); + void DisconnectInput(std::string const& inputName); + void DisconnectInput(DspComponent const* inputComponent); + void DisconnectAllInputs(); + + int GetInputCount(); + int GetOutputCount(); + int GetParameterCount(); + + std::string GetInputName(int index); + std::string GetOutputName(int index); + std::string GetParameterName(int index); + + bool GetParameter(int index, DspParameter& param); + DspParameter const* GetParameter(int index); + bool SetParameter(int index, DspParameter const& param); + + void Tick(); + void Reset(); + + void StartAutoTick(); + void StopAutoTick(); + void PauseAutoTick(); + void ResumeAutoTick(); + +protected: + virtual void Process_(DspSignalBus&, DspSignalBus&); + virtual bool ParameterUpdating_(int, DspParameter const&); + + bool AddInput_(std::string const& inputName = ""); + bool AddOutput_(std::string const& outputName = ""); + int AddParameter_(std::string const& paramName, DspParameter const& param); + + bool RemoveInput_(); + bool RemoveOutput_(); + bool RemoveParameter_(); + + void RemoveAllInputs_(); + void RemoveAllOutputs_(); + void RemoveAllParameters_(); + + int GetInputCount_(); + int GetOutputCount_(); + int GetParameterCount_(); + + DspParameter const* GetParameter_(int index) const; + bool SetParameter_(int index, DspParameter const& param); + +private: + virtual void _PauseAutoTick(); + + void _SetParentCircuit(DspCircuit* parentCircuit); + DspCircuit* _GetParentCircuit(); + + bool _FindInput(std::string const& signalName, int& returnIndex) const; + bool _FindInput(int signalIndex, int& returnIndex) const; + bool _FindOutput(std::string const& signalName, int& returnIndex) const; + bool _FindOutput(int signalIndex, int& returnIndex) const; + + void _SetBufferCount(int bufferCount); + int _GetBufferCount() const; + + void _ThreadTick(int threadNo); + void _ThreadReset(int threadNo); + + bool _SetInputSignal(int inputIndex, DspSignal const* newSignal); + bool _SetInputSignal(int inputIndex, int threadIndex, DspSignal const* newSignal); + DspSignal* _GetOutputSignal(int outputIndex); + DspSignal* _GetOutputSignal(int outputIndex, int threadIndex); + + void _WaitForRelease(int threadNo); + void _ReleaseThread(int threadNo); + +private: + friend class DspCircuit; + friend class DspCircuitThread; + + DspCircuit* _parentCircuit; + + int _bufferCount; + + DspSignalBus _inputBus; + DspSignalBus _outputBus; + + std::vector _inputBuses; + std::vector _outputBuses; + + std::vector< std::pair > _parameters; + + std::string _componentName; + bool _isAutoTickRunning; + bool _isAutoTickPaused; + int _pauseCount; + + DspWireBus _inputWires; + + bool _hasTicked; + + DspComponentThread _componentThread; + + std::vector _hasTickeds; // bool pointers ensure that parallel threads will only read from this vector + std::vector _gotReleases; // bool pointers not used here as only 1 thread writes to this vector at a time + std::vector _releaseMutexes; + std::vector _releaseCondts; + + Callback_t _callback; + void* _userData; +}; + +//================================================================================================= + +template +bool DspComponent::ConnectInput(DspComponent* fromComponent, FromOutputId const& fromOutput, ToInputId const& toInput) +{ + int fromOutputIndex; + int toInputIndex; + + if (!fromComponent->_outputBus.FindSignal(fromOutput, fromOutputIndex) || + !_inputBus.FindSignal(toInput, toInputIndex)) + { + return false; + } + + PauseAutoTick(); + _inputWires.AddWire(fromComponent, fromOutputIndex, toInputIndex); + ResumeAutoTick(); + + return true; +} + +//------------------------------------------------------------------------------------------------- + +template +bool DspComponent::ConnectInput(DspComponent& fromComponent, FromOutputId const& fromOutput, ToInputId const& toInput) +{ + return ConnectInput(&fromComponent, fromOutput, toInput); +} + +//------------------------------------------------------------------------------------------------- + +template +void DspComponent::DisconnectInput(DspComponent const* fromComponent, + FromOutputId const& fromOutput, + ToInputId const& toInput) +{ + int fromOutputIndex; + int toInputIndex; + + if (!fromComponent->_outputBus.FindSignal(fromOutput, fromOutputIndex) || + !_inputBus.FindSignal(toInput, toInputIndex)) + { + return; + } + + PauseAutoTick(); + _inputWires.RemoveWire(fromComponent, fromOutputIndex, toInputIndex); + ResumeAutoTick(); +} + +//------------------------------------------------------------------------------------------------- + +template +void DspComponent::DisconnectInput(DspComponent const& fromComponent, + FromOutputId const& fromOutput, + ToInputId const& toInput) +{ + DisconnectInput(&fromComponent, fromOutput, toInput); +} + +//================================================================================================= + +#endif // DSPCOMPONENT_H diff --git a/src/libs/DSPatch/include/dspatch/DspComponentThread.h b/src/libs/DSPatch/include/dspatch/DspComponentThread.h new file mode 100755 index 0000000..92a5371 --- /dev/null +++ b/src/libs/DSPatch/include/dspatch/DspComponentThread.h @@ -0,0 +1,72 @@ +/************************************************************************ +DSPatch - Cross-Platform, Object-Oriented, Flow-Based Programming Library +Copyright (c) 2012-2015 Marcus Tomlinson + +This file is part of DSPatch. + +GNU Lesser General Public License Usage +This file may be used under the terms of the GNU Lesser General Public +License version 3.0 as published by the Free Software Foundation and +appearing in the file LGPLv3.txt included in the packaging of this +file. Please review the following information to ensure the GNU Lesser +General Public License version 3.0 requirements will be met: +http://www.gnu.org/copyleft/lgpl.html. + +Other Usage +Alternatively, this file may be used in accordance with the terms and +conditions contained in a signed written agreement between you and +Marcus Tomlinson. + +DSPatch is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +************************************************************************/ + +#ifndef DSPCOMPONENTTHREAD_H +#define DSPCOMPONENTTHREAD_H + +//------------------------------------------------------------------------------------------------- + +#include + +class DspComponent; + +//================================================================================================= +/// Thread class for ticking and reseting a single component + +/** +A DspComponentThread is responsible for ticking and reseting a single component continuously in +a separate free-running thread. On construction, a reference to the component must be provided for +the DspThread's _Run() method to use. Once Start() has been called, the thread will begin +repeatedly executing the _Run() method. On each thread iteration, DspComponentThread simply calls +the reference component's Tick() and Reset() methods. The Pause() method causes DspComponentThread +to wait until instructed to Resume() again. +*/ + +class DLLEXPORT DspComponentThread : public DspThread +{ +public: + DspComponentThread(); + ~DspComponentThread(); + + void Initialise(DspComponent* component); + bool IsStopped() const; + + void Start(Priority priority = TimeCriticalPriority); + void Stop(); + void Pause(); + void Resume(); + +private: + DspComponent* _component; + bool _stop, _pause; + bool _stopped; + DspMutex _resumeMutex; + DspWaitCondition _resumeCondt, _pauseCondt; + + virtual void _Run(); +}; + +//================================================================================================= + +#endif // DSPCOMPONENTTHREAD_H diff --git a/src/libs/DSPatch/include/dspatch/DspParameter.h b/src/libs/DSPatch/include/dspatch/DspParameter.h new file mode 100755 index 0000000..d7566b4 --- /dev/null +++ b/src/libs/DSPatch/include/dspatch/DspParameter.h @@ -0,0 +1,111 @@ +/************************************************************************ +DSPatch - Cross-Platform, Object-Oriented, Flow-Based Programming Library +Copyright (c) 2012-2015 Marcus Tomlinson + +This file is part of DSPatch. + +GNU Lesser General Public License Usage +This file may be used under the terms of the GNU Lesser General Public +License version 3.0 as published by the Free Software Foundation and +appearing in the file LGPLv3.txt included in the packaging of this +file. Please review the following information to ensure the GNU Lesser +General Public License version 3.0 requirements will be met: +http://www.gnu.org/copyleft/lgpl.html. + +Other Usage +Alternatively, this file may be used in accordance with the terms and +conditions contained in a signed written agreement between you and +Marcus Tomlinson. + +DSPatch is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +************************************************************************/ + +#ifndef DSPPARAMETER_H +#define DSPPARAMETER_H + +//------------------------------------------------------------------------------------------------- + +#include +#include +#include + +//================================================================================================= +/// Value container used to hold non-transient component IO + +/** +DspParameters are similar to DspSignals in that they provide a generic means of inputting and +outputting data to and from DspComponents. However, unlike signals, parameters are non-transient +inputs and outputs (such as enable / disable, bias, offset, etc.) that allow for a component's +behaviour to be manipulated via direct set / get methods. The parameter type (ParamType) must be +specified on construction of a DspParameter. Any type mismatches on subsequent set / get calls will +immediatly return false. + +NOTE: Abstracting component parameters behind the generic DspParameter container allows a +component to be entirely controllable via the DspComponent base class. +*/ + +class DLLEXPORT DspParameter +{ +public: + enum ParamType + { + Null, + Bool, + Int, + Float, + String, + FilePath, // this is essentially just a string, but helps when determining an appropriate user input method + List, // this type acts as a vector (available items), an int (index selected), and a string (item selected) + Trigger // this type has no value, SetParam(triggerParam) simply represents a trigger. E.g. a button press + }; + + DspParameter(); + DspParameter(ParamType const& type); + DspParameter(ParamType const& type, int const& initValue, std::pair const& valueRange = std::make_pair(-1, -1)); + DspParameter(ParamType const& type, float const& initValue, std::pair const& valueRange = std::make_pair(-1.0f, -1.0f)); + DspParameter(ParamType const& type, std::string const& initValue); + DspParameter(ParamType const& type, std::vector const& initValue); + + ParamType Type() const; + bool IsSet() const; + + bool const* GetBool() const; + int const* GetInt() const; + std::pair const* GetIntRange() const; + float const* GetFloat() const; + std::pair const* GetFloatRange() const; + std::string const* GetString() const; + std::vector const* GetList() const; + + bool SetBool(bool const& value); + bool SetInt(int const& value); + bool SetIntRange(std::pair const& intRange); + bool SetFloat(float const& value); + bool SetFloatRange(std::pair const& floatRange); + bool SetString(std::string const& value); + bool SetList(std::vector const& value); + + bool SetParam(DspParameter const& param); + +private: + ParamType _type; + bool _isSet; + bool _isRangeSet; + + bool _boolValue; + + std::pair _intRange; + int _intValue; + + std::pair _floatRange; + float _floatValue; + + std::string _stringValue; + std::vector _listValue; +}; + +//================================================================================================= + +#endif // DSPPARAMETER_H diff --git a/src/libs/DSPatch/include/dspatch/DspPlugin.h b/src/libs/DSPatch/include/dspatch/DspPlugin.h new file mode 100755 index 0000000..b35114e --- /dev/null +++ b/src/libs/DSPatch/include/dspatch/DspPlugin.h @@ -0,0 +1,95 @@ +/************************************************************************ +DSPatch - Cross-Platform, Object-Oriented, Flow-Based Programming Library +Copyright (c) 2012-2015 Marcus Tomlinson + +This file is part of DSPatch. + +GNU Lesser General Public License Usage +This file may be used under the terms of the GNU Lesser General Public +License version 3.0 as published by the Free Software Foundation and +appearing in the file LGPLv3.txt included in the packaging of this +file. Please review the following information to ensure the GNU Lesser +General Public License version 3.0 requirements will be met: +http://www.gnu.org/copyleft/lgpl.html. + +Other Usage +Alternatively, this file may be used in accordance with the terms and +conditions contained in a signed written agreement between you and +Marcus Tomlinson. + +DSPatch is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +************************************************************************/ + +#ifndef DSPPLUGIN_H +#define DSPPLUGIN_H + +//------------------------------------------------------------------------------------------------- + +#include + +#include +#include + +//================================================================================================= +/// Abstract base class for DspComponent plugins + +/** +A DspComponent can be packaged into a shared library (.so / .dylib / .dll) and dynamically loaded +from a DSPatch application at runtime. This allows DSPatch applications and components to be built +and released independently of each other, resulting in a highly flexible developer (and end-user) +experience. Now, in order for a DspComponent to be packaged into a plugin (shared library), the +plugin needs to expose some details about itself to the outside world. This is achieved via the +DspPlugin abstract base class. + +A DspComponent plugin project must contain 2 classes: 1. A class derived from DspComponent that +implements the component logic, and 2. A class derived from DspPlugin that implements the component +construction logic. + +Classes derived from DspPlugin must (at least) implement the pure virtual method: Create(). If the +DspComponent does not require any construction parameters, Create() should simply return a pointer +to a new instantiation of that DspComponent. If a DspComponent does require construction parameters +to be instantiated, the derived class must also implement the virtual GetCreateParams() method. +This method should return a map of parameter name-to-DspParameter pairs. The plugin host can then +assign values to this parameter map and return them via the Create() call. + +Once both DspComponent and DspPlugin classes have been implemented, add the line +"EXPORT_DSPPLUGIN(MyPlugin)" anywhere after the declaration of your DspPlugin class, where +"MyPlugin" is the name of your DspPlugin class. Then compile the project into a shared library. + +The plugin is now ready to be loaded into a DSPatch host application (see DspPluginLoader). +*/ + +class DLLEXPORT DspPlugin +{ +public: + virtual ~DspPlugin(); + virtual std::map GetCreateParams() const = 0; + virtual DspComponent* Create(std::map& params) const = 0; +}; + +//================================================================================================= + +#define EXPORT_DSPPLUGIN(Plugin) \ +extern "C" \ +{ \ + DLLEXPORT std::map GetCreateParams() \ + { \ + DspPlugin* plugin = new Plugin(); \ + std::map params = plugin->GetCreateParams(); \ + delete plugin; \ + return params; \ + } \ + DLLEXPORT DspComponent* Create(std::map& params) \ + { \ + DspPlugin* plugin = new Plugin(); \ + DspComponent* component = plugin->Create(params); \ + delete plugin; \ + return component; \ + } \ +} + +//================================================================================================= + +#endif // DSPPLUGIN_H diff --git a/src/libs/DSPatch/include/dspatch/DspPluginLoader.h b/src/libs/DSPatch/include/dspatch/DspPluginLoader.h new file mode 100755 index 0000000..1c87d16 --- /dev/null +++ b/src/libs/DSPatch/include/dspatch/DspPluginLoader.h @@ -0,0 +1,75 @@ +/************************************************************************ +DSPatch - Cross-Platform, Object-Oriented, Flow-Based Programming Library +Copyright (c) 2012-2015 Marcus Tomlinson + +This file is part of DSPatch. + +GNU Lesser General Public License Usage +This file may be used under the terms of the GNU Lesser General Public +License version 3.0 as published by the Free Software Foundation and +appearing in the file LGPLv3.txt included in the packaging of this +file. Please review the following information to ensure the GNU Lesser +General Public License version 3.0 requirements will be met: +http://www.gnu.org/copyleft/lgpl.html. + +Other Usage +Alternatively, this file may be used in accordance with the terms and +conditions contained in a signed written agreement between you and +Marcus Tomlinson. + +DSPatch is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +************************************************************************/ + +#ifndef DSPPLUGINLOADER_H +#define DSPPLUGINLOADER_H + +//------------------------------------------------------------------------------------------------- + +#include + +//================================================================================================= +/// Plugin loader for DspPlugin host applications + +/** +A DspComponent packaged into a shared library (.so / .dylib / .dll) and exported via the DspPlugin +class can be dynamically loaded from a DSPatch application at runtime using a DspPluginLoader. A +DspPluginLoader represents exactly one DspPlugin in a host application. + +A DspPluginLoader should be constructed with the absolute path of the plugin (shared library) to be +loaded. Once instantiated you should check that the plugin was successfully loaded by calling +IsLoaded(). Thereafter, the contained DspComponent can be instantiated via the GetCreateParams() +and Create() methods accordingly (For more detail on the structure of a plugin, see DspPlugin). +*/ + +class DLLEXPORT DspPluginLoader : public DspPlugin +{ +public: + DspPluginLoader(std::string const& pluginPath); + DspPluginLoader(DspPluginLoader const& other); + DspPluginLoader& operator=(const DspPluginLoader& other); + ~DspPluginLoader(); + + bool IsLoaded() const; + + std::map GetCreateParams() const; + DspComponent* Create(std::map& params) const; + +private: + DspPluginLoader(); + void _LoadPlugin(std::string const& pluginPath); + +private: + typedef std::map(*GetCreateParams_t)(); + typedef DspComponent* (*Create_t)(std::map&); + + std::string _pluginPath; + void* _handle; + GetCreateParams_t _getCreateParams; + Create_t _create; +}; + +//================================================================================================= + +#endif // DSPPLUGINLOADER_H diff --git a/src/libs/DSPatch/include/dspatch/DspRunType.h b/src/libs/DSPatch/include/dspatch/DspRunType.h new file mode 100755 index 0000000..5ceac68 --- /dev/null +++ b/src/libs/DSPatch/include/dspatch/DspRunType.h @@ -0,0 +1,204 @@ +/************************************************************************ +DSPatch - Cross-Platform, Object-Oriented, Flow-Based Programming Library +Copyright (c) 2012-2015 Marcus Tomlinson + +This file is part of DSPatch. + +GNU Lesser General Public License Usage +This file may be used under the terms of the GNU Lesser General Public +License version 3.0 as published by the Free Software Foundation and +appearing in the file LGPLv3.txt included in the packaging of this +file. Please review the following information to ensure the GNU Lesser +General Public License version 3.0 requirements will be met: +http://www.gnu.org/copyleft/lgpl.html. + +Other Usage +Alternatively, this file may be used in accordance with the terms and +conditions contained in a signed written agreement between you and +Marcus Tomlinson. + +DSPatch is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +************************************************************************/ + +#ifndef DSPRUNTYPE_H +#define DSPRUNTYPE_H + +//------------------------------------------------------------------------------------------------- + +#include +#include + +//================================================================================================= +/// Dynamically typed variable + +/** +DspRunType holds a variable that can be dynamically typed at run-time (hence the name). The +DspRunType class makes use of an internal template class and public template methods to allow +users to get and set the contained variable as any type they wish. A DspRunType object also has the +ability to change type at any point during program execution. Built-in typecasting and error +checking (via the RunTypeCast() method) prevents critical runtime errors from occurring when signal +types are mismatched. +*/ + +class DspRunType +{ +public: + DspRunType() + : _valueHolder(NULL) + { + } + + template + DspRunType(ValueType const& value) + { + _valueHolder = new _DspRtValue(value); + } + + DspRunType(DspRunType const& other) + { + if (other._valueHolder != NULL) + { + _valueHolder = other._valueHolder->GetCopy(); + } + else + { + _valueHolder = NULL; + } + } + + virtual ~DspRunType() + { + delete _valueHolder; + } + +public: + DspRunType& MoveTo(DspRunType& rhs) + { + std::swap(_valueHolder, rhs._valueHolder); + return *this; + } + + void CopyFrom(DspRunType const& rhs) + { + if (_valueHolder != NULL && rhs._valueHolder != NULL && _valueHolder->GetType() == rhs._valueHolder->GetType()) + { + _valueHolder->SetValue(rhs._valueHolder); + } + else + { + *this = rhs; + } + } + + template + DspRunType& operator=(ValueType const& rhs) + { + if (typeid(rhs) == GetType()) + { + ((_DspRtValue*)_valueHolder)->_value = rhs; + } + else + { + DspRunType(rhs).MoveTo(*this); + } + return *this; + } + + DspRunType& operator=(DspRunType rhs) + { + rhs.MoveTo(*this); + return *this; + } + +public: + bool IsEmpty() const + { + return !_valueHolder; + } + + std::type_info const& GetType() const + { + if (_valueHolder != NULL) + { + return _valueHolder->GetType(); + } + else + { + return typeid(void); + } + } + + template + static ValueType* RunTypeCast(DspRunType* operand) + { + if (operand != NULL && operand->GetType() == typeid(ValueType)) + { + return &static_cast*>(operand->_valueHolder)->_value; + } + else + { + return NULL; + } + } + + template + static inline ValueType const* RunTypeCast(DspRunType const* operand) + { + return RunTypeCast(const_cast(operand)); + } + +private: + class _DspRtValueHolder + { + public: + virtual ~_DspRtValueHolder() + { + } + + public: + virtual std::type_info const& GetType() const = 0; + virtual _DspRtValueHolder* GetCopy() const = 0; + virtual void SetValue(_DspRtValueHolder* valueHolder) = 0; + }; + + template + class _DspRtValue : public _DspRtValueHolder + { + public: + _DspRtValue(ValueType const& value) + : _value(value) + { + } + + public: + virtual std::type_info const& GetType() const + { + return typeid(ValueType); + } + + virtual _DspRtValueHolder* GetCopy() const + { + return new _DspRtValue(_value); + } + + void SetValue(_DspRtValueHolder* valueHolder) + { + _value = ((_DspRtValue*)valueHolder)->_value; + } + + public: + ValueType _value; + + private: + _DspRtValue& operator=(_DspRtValue const&); // disable copy-assignment + }; + +private: + _DspRtValueHolder* _valueHolder; +}; + +//================================================================================================= + +#endif // DSPRUNTYPE_H diff --git a/src/libs/DSPatch/include/dspatch/DspSignal.h b/src/libs/DSPatch/include/dspatch/DspSignal.h new file mode 100755 index 0000000..c960473 --- /dev/null +++ b/src/libs/DSPatch/include/dspatch/DspSignal.h @@ -0,0 +1,130 @@ +/************************************************************************ +DSPatch - Cross-Platform, Object-Oriented, Flow-Based Programming Library +Copyright (c) 2012-2015 Marcus Tomlinson + +This file is part of DSPatch. + +GNU Lesser General Public License Usage +This file may be used under the terms of the GNU Lesser General Public +License version 3.0 as published by the Free Software Foundation and +appearing in the file LGPLv3.txt included in the packaging of this +file. Please review the following information to ensure the GNU Lesser +General Public License version 3.0 requirements will be met: +http://www.gnu.org/copyleft/lgpl.html. + +Other Usage +Alternatively, this file may be used in accordance with the terms and +conditions contained in a signed written agreement between you and +Marcus Tomlinson. + +DSPatch is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +************************************************************************/ + +#ifndef DSPSIGNAL_H +#define DSPSIGNAL_H + +//------------------------------------------------------------------------------------------------- + +#include +#include + +#include +#include + +//================================================================================================= +/// Value container used to carry data between components + +/** +DspComponents process and transfer data between each other in the form of "signals" via +interconnecting wires. The DspSignal class holds a single value that can be dynamically typed at +runtime. Furthermore, a DspSignal has the ability to change it's data type at any point during +program execution. This is designed such that a signal bus can hold any number of different typed +variables, as well as to allow for a variable to dynamically change it's type when needed -this can +be useful for inputs that accept a number of different data types (E.g. Varying sample size in an +audio buffer: array of byte / int / float). +*/ + +class DLLEXPORT DspSignal +{ +public: + DspSignal(std::string signalName = ""); + + virtual ~DspSignal(); + + template + bool SetValue(ValueType const& newValue); + + template + bool GetValue(ValueType& returnValue) const; + + template + ValueType const* GetValue() const; + + bool SetSignal(DspSignal const* newSignal); + + void ClearValue(); + + std::type_info const& GetSignalType() const; + + std::string GetSignalName() const; + +private: + DspRunType _signalValue; + std::string _signalName; + bool _valueAvailable; +}; + +//================================================================================================= + +template +bool DspSignal::SetValue(ValueType const& newValue) +{ + _signalValue = newValue; + _valueAvailable = true; + return true; +} + +//------------------------------------------------------------------------------------------------- + +template +bool DspSignal::GetValue(ValueType& returnValue) const +{ + if (_valueAvailable) + { + ValueType const* returnValuePtr = DspRunType::RunTypeCast(&_signalValue); + if (returnValuePtr != NULL) + { + returnValue = *returnValuePtr; + return true; + } + else + { + return false; // incorrect type matching + } + } + else + { + return false; // no value available + } +} + +//------------------------------------------------------------------------------------------------- + +template +ValueType const* DspSignal::GetValue() const +{ + if (_valueAvailable) + { + return DspRunType::RunTypeCast(&_signalValue); + } + else + { + return NULL; // no value available + } +} + +//================================================================================================= + +#endif // DSPSIGNAL_H diff --git a/src/libs/DSPatch/include/dspatch/DspSignalBus.h b/src/libs/DSPatch/include/dspatch/DspSignalBus.h new file mode 100755 index 0000000..ae7e480 --- /dev/null +++ b/src/libs/DSPatch/include/dspatch/DspSignalBus.h @@ -0,0 +1,192 @@ +/************************************************************************ +DSPatch - Cross-Platform, Object-Oriented, Flow-Based Programming Library +Copyright (c) 2012-2015 Marcus Tomlinson + +This file is part of DSPatch. + +GNU Lesser General Public License Usage +This file may be used under the terms of the GNU Lesser General Public +License version 3.0 as published by the Free Software Foundation and +appearing in the file LGPLv3.txt included in the packaging of this +file. Please review the following information to ensure the GNU Lesser +General Public License version 3.0 requirements will be met: +http://www.gnu.org/copyleft/lgpl.html. + +Other Usage +Alternatively, this file may be used in accordance with the terms and +conditions contained in a signed written agreement between you and +Marcus Tomlinson. + +DSPatch is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +************************************************************************/ + +#ifndef DSPSIGNALBUS_H +#define DSPSIGNALBUS_H + +//------------------------------------------------------------------------------------------------- + +#include + +//================================================================================================= +/// DspSignal container + +/** +A DspSignalBus contains DspSignals (see DspSignal). Via the Process_() method, a DspComponent +receives signals into it's "inputs" DspSignalBus and provides signals to it's "outputs" +DspSignalBus. Although DspSignals can be acquired from a DspSignalBus, the DspSignalBus class +provides public getters and setters for manipulating it's internal DspSignal values directly, +abstracting the need to retrieve and interface with the contained DspSignals themself. +*/ + +class DLLEXPORT DspSignalBus +{ +public: + virtual ~DspSignalBus(); + + bool SetSignal(int signalIndex, DspSignal const* newSignal); + bool SetSignal(std::string const& signalName, DspSignal const* newSignal); + + DspSignal* GetSignal(int signalIndex); + DspSignal* GetSignal(std::string const& signalName); + + bool FindSignal(std::string const& signalName, int& returnIndex) const; + bool FindSignal(int signalIndex, int& returnIndex) const; + + int GetSignalCount() const; + + template + bool SetValue(int signalIndex, ValueType const& newValue); + + template + bool SetValue(std::string const& signalName, ValueType const& newValue); + + template + bool GetValue(int signalIndex, ValueType& returnValue) const; + + template + bool GetValue(std::string const& signalName, ValueType& returnValue) const; + + template + ValueType const* GetValue(int signalIndex) const; + + template + ValueType const* GetValue(std::string const& signalName) const; + + void ClearValue(int signalIndex); + void ClearValue(std::string const& signalName); + + void ClearAllValues(); + +private: + bool _AddSignal(std::string const& signalName = ""); + + bool _RemoveSignal(); + void _RemoveAllSignals(); + +private: + friend class DspComponent; + + std::vector _signals; +}; + +//================================================================================================= + +template +bool DspSignalBus::SetValue(int signalIndex, ValueType const& newValue) +{ + if ((size_t)signalIndex < _signals.size()) + { + return _signals[signalIndex].SetValue(newValue); + } + else + { + return false; + } +} + +//------------------------------------------------------------------------------------------------- + +template +bool DspSignalBus::SetValue(std::string const& signalName, ValueType const& newValue) +{ + int signalIndex; + + if (FindSignal(signalName, signalIndex)) + { + return _signals[signalIndex].SetValue(newValue); + } + else + { + return false; + } +} + +//------------------------------------------------------------------------------------------------- + +template +bool DspSignalBus::GetValue(int signalIndex, ValueType& returnValue) const +{ + if ((size_t)signalIndex < _signals.size()) + { + return _signals[signalIndex].GetValue(returnValue); + } + else + { + return false; + } +} + +//------------------------------------------------------------------------------------------------- + +template +bool DspSignalBus::GetValue(std::string const& signalName, ValueType& returnValue) const +{ + int signalIndex; + + if (FindSignal(signalName, signalIndex)) + { + return _signals[signalIndex].GetValue(returnValue); + } + else + { + return false; + } +} + +//------------------------------------------------------------------------------------------------- + +template +ValueType const* DspSignalBus::GetValue(int signalIndex) const +{ + if (signalIndex < _signals.size()) + { + return _signals[signalIndex].GetValue(); + } + else + { + return NULL; + } +} + +//------------------------------------------------------------------------------------------------- + +template +ValueType const* DspSignalBus::GetValue(std::string const& signalName) const +{ + int signalIndex; + + if (FindSignal(signalName, signalIndex)) + { + return _signals[signalIndex].GetValue(); + } + else + { + return NULL; + } +} + +//================================================================================================= + +#endif // DSPSIGNALBUS_H diff --git a/src/libs/DSPatch/include/dspatch/DspThread.h b/src/libs/DSPatch/include/dspatch/DspThread.h new file mode 100755 index 0000000..e062517 --- /dev/null +++ b/src/libs/DSPatch/include/dspatch/DspThread.h @@ -0,0 +1,45 @@ +/************************************************************************ +DSPatch - Cross-Platform, Object-Oriented, Flow-Based Programming Library +Copyright (c) 2012-2015 Marcus Tomlinson + +This file is part of DSPatch. + +GNU Lesser General Public License Usage +This file may be used under the terms of the GNU Lesser General Public +License version 3.0 as published by the Free Software Foundation and +appearing in the file LGPLv3.txt included in the packaging of this +file. Please review the following information to ensure the GNU Lesser +General Public License version 3.0 requirements will be met: +http://www.gnu.org/copyleft/lgpl.html. + +Other Usage +Alternatively, this file may be used in accordance with the terms and +conditions contained in a signed written agreement between you and +Marcus Tomlinson. + +DSPatch is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +************************************************************************/ + +#ifdef _WIN32 + +#define DLLEXPORT __declspec(dllexport) +#include + +#ifdef _MSC_VER + #pragma warning(disable : 4251) // disable class needs to have dll-interface warning + #pragma warning(disable : 4275) // disable non dll-interface class used as base warning +#endif + +#elif DSP_NOTHREADS + +#define DLLEXPORT +#include + +#else + +#define DLLEXPORT +#include + +#endif diff --git a/src/libs/DSPatch/include/dspatch/DspThreadNull.h b/src/libs/DSPatch/include/dspatch/DspThreadNull.h new file mode 100755 index 0000000..f612b70 --- /dev/null +++ b/src/libs/DSPatch/include/dspatch/DspThreadNull.h @@ -0,0 +1,135 @@ +/************************************************************************ +DSPatch - Cross-Platform, Object-Oriented, Flow-Based Programming Library +Copyright (c) 2012-2015 Marcus Tomlinson + +This file is part of DSPatch. + +GNU Lesser General Public License Usage +This file may be used under the terms of the GNU Lesser General Public +License version 3.0 as published by the Free Software Foundation and +appearing in the file LGPLv3.txt included in the packaging of this +file. Please review the following information to ensure the GNU Lesser +General Public License version 3.0 requirements will be met: +http://www.gnu.org/copyleft/lgpl.html. + +Other Usage +Alternatively, this file may be used in accordance with the terms and +conditions contained in a signed written agreement between you and +Marcus Tomlinson. + +DSPatch is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +************************************************************************/ + +#ifndef DSPTHREADNULL_H +#define DSPTHREADNULL_H + +//================================================================================================= +/// Cross-platform, object-oriented thread + +/** +An class that is required to run actions in a parallel thread can be derived from DspThread in +order to inherit multi-threading abilities. The Start() method initiates a parallel thread and +executes the private virtual _Run() method in that thread. The derived class must override this +_Run() method with one that executes the required parallel actions. Other threads may use the +static MsSleep() and SetPriority() methods without having to derive from, or create an instance of +DspThread. Priority for the created thread, or calling threads (via SetPriority()), may be selected +from the public enumeration: Priority. +*/ + +class DspThread +{ +public: + DspThread() + { + } + + virtual ~DspThread() + { + } + + enum Priority + { + IdlePriority, + + LowestPriority, + LowPriority, + NormalPriority, + HighPriority, + HighestPriority, + + TimeCriticalPriority + }; + + virtual void Start(Priority priority) + { + } + virtual void Stop(); + static void SetPriority(Priority priority) + { + } + static void MsSleep(int milliseconds) + { + } +}; + +//================================================================================================= +/// Cross-platform, object-oriented mutex + +/** +DspMutex is a simple mutex that can lock a critical section of code for exclusive access by +the calling thread. Other threads attempting to acquire a lock while another has acquired it +will wait at the Lock() method call until the thread that owns the mutex calls Unlock(). +*/ + +class DspMutex +{ +public: + DspMutex() + { + } + + virtual ~DspMutex() + { + } + + static void Lock() + { + } + static void Unlock() + { + } +}; + +//================================================================================================= +/// Cross-platform, object-oriented conditional wait + +/** +A wait condition works like an indefinite sleep. When a thread calls the Wait() function it +is put to sleep until it is woken by the WakeAll() function of the same DspWaitCondition object. +This is used to synchronize actions between threads. +*/ + +class DspWaitCondition +{ +public: + DspWaitCondition() + { + } + + virtual ~DspWaitCondition() + { + } + + static void Wait(DspMutex& mutex) + { + } + static void WakeAll() + { + } +}; + +//================================================================================================= + +#endif // DSPTHREADNULL_H diff --git a/src/libs/DSPatch/include/dspatch/DspThreadUnix.h b/src/libs/DSPatch/include/dspatch/DspThreadUnix.h new file mode 100755 index 0000000..8896ff5 --- /dev/null +++ b/src/libs/DSPatch/include/dspatch/DspThreadUnix.h @@ -0,0 +1,177 @@ +/************************************************************************ +DSPatch - Cross-Platform, Object-Oriented, Flow-Based Programming Library +Copyright (c) 2012-2015 Marcus Tomlinson + +This file is part of DSPatch. + +GNU Lesser General Public License Usage +This file may be used under the terms of the GNU Lesser General Public +License version 3.0 as published by the Free Software Foundation and +appearing in the file LGPLv3.txt included in the packaging of this +file. Please review the following information to ensure the GNU Lesser +General Public License version 3.0 requirements will be met: +http://www.gnu.org/copyleft/lgpl.html. + +Other Usage +Alternatively, this file may be used in accordance with the terms and +conditions contained in a signed written agreement between you and +Marcus Tomlinson. + +DSPatch is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +************************************************************************/ + +#ifndef DSPTHREADUNIX_H +#define DSPTHREADUNIX_H + +//------------------------------------------------------------------------------------------------- + +#include +#include + +//================================================================================================= + +class DspThread +{ +public: + DspThread() + : _threadAttatched(false) + { + } + + virtual ~DspThread() + { + Stop(); + } + + enum Priority + { + IdlePriority, + + LowestPriority, + LowPriority, + NormalPriority, + HighPriority, + HighestPriority, + + TimeCriticalPriority + }; + + virtual void Start(Priority priority = NormalPriority) + { + pthread_create(&_thread, NULL, _ThreadFunc, this); + _threadAttatched = true; + + _SetPriority(_thread, priority); + } + + virtual void Stop() + { + if (_threadAttatched) + { + pthread_detach(_thread); + _threadAttatched = false; + } + } + + static void SetPriority(Priority priority) + { + _SetPriority(pthread_self(), priority); + } + + static void MsSleep(int milliseconds) + { + usleep(milliseconds); + } + +private: + static void* _ThreadFunc(void* pv) + { + (reinterpret_cast(pv))->_Run(); + return NULL; + } + + virtual void _Run() = 0; + + static void _SetPriority(pthread_t threadID, Priority priority) + { + int policy; + struct sched_param param; + + pthread_getschedparam(threadID, &policy, ¶m); + + policy = SCHED_FIFO; + param.sched_priority = ((priority - IdlePriority) * (99 - 1) / TimeCriticalPriority) + 1; + + pthread_setschedparam(threadID, policy, ¶m); + } + +private: + pthread_t _thread; + bool _threadAttatched; +}; + +//================================================================================================= + +class DspMutex +{ +public: + DspMutex() + { + pthread_mutex_init(&_mutex, NULL); + } + + virtual ~DspMutex() + { + pthread_mutex_destroy(&_mutex); + } + + void Lock() + { + pthread_mutex_lock(&_mutex); + } + + void Unlock() + { + pthread_mutex_unlock(&_mutex); + } + +private: + friend class DspWaitCondition; + + pthread_mutex_t _mutex; +}; + +//================================================================================================= + +class DspWaitCondition +{ +public: + DspWaitCondition() + { + pthread_cond_init(&_cond, NULL); + } + + virtual ~DspWaitCondition() + { + pthread_cond_destroy(&_cond); + } + + void Wait(DspMutex& mutex) + { + pthread_cond_wait(&_cond, &(mutex._mutex)); + } + + void WakeAll() + { + pthread_cond_broadcast(&_cond); + } + +private: + pthread_cond_t _cond; +}; + +//================================================================================================= + +#endif // DSPTHREADUNIX_H diff --git a/src/libs/DSPatch/include/dspatch/DspThreadWin.h b/src/libs/DSPatch/include/dspatch/DspThreadWin.h new file mode 100755 index 0000000..8f6a44b --- /dev/null +++ b/src/libs/DSPatch/include/dspatch/DspThreadWin.h @@ -0,0 +1,178 @@ +/************************************************************************ +DSPatch - Cross-Platform, Object-Oriented, Flow-Based Programming Library +Copyright (c) 2012-2015 Marcus Tomlinson + +This file is part of DSPatch. + +GNU Lesser General Public License Usage +This file may be used under the terms of the GNU Lesser General Public +License version 3.0 as published by the Free Software Foundation and +appearing in the file LGPLv3.txt included in the packaging of this +file. Please review the following information to ensure the GNU Lesser +General Public License version 3.0 requirements will be met: +http://www.gnu.org/copyleft/lgpl.html. + +Other Usage +Alternatively, this file may be used in accordance with the terms and +conditions contained in a signed written agreement between you and +Marcus Tomlinson. + +DSPatch is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +************************************************************************/ + +#ifndef DSPTHREADWIN_H +#define DSPTHREADWIN_H + +//------------------------------------------------------------------------------------------------- + +#include + +//================================================================================================= + +class DspThread +{ +public: + DspThread() + : _threadHandle(NULL) + { + } + + DspThread(DspThread const&) + : _threadHandle(NULL) + { + } + + virtual ~DspThread() + { + Stop(); + } + + enum Priority + { + IdlePriority = -15, + + LowestPriority = -2, + LowPriority = -1, + NormalPriority = 0, + HighPriority = 1, + HighestPriority = 2, + + TimeCriticalPriority = 15 + }; + + virtual void Start(Priority priority = NormalPriority) + { + DWORD threadId; + _threadHandle = CreateThread(NULL, 0, _ThreadFunc, this, CREATE_SUSPENDED, &threadId); + SetThreadPriority(_threadHandle, priority); + ResumeThread(_threadHandle); + } + + virtual void Stop() + { + CloseHandle(_threadHandle); + _threadHandle = NULL; + } + + static void SetPriority(Priority priority) + { + SetThreadPriority(GetCurrentThread(), priority); + } + + static void MsSleep(int milliseconds) + { + Sleep(milliseconds); + } + +private: + static DWORD WINAPI _ThreadFunc(LPVOID pv) + { + (reinterpret_cast(pv))->_Run(); + return 0; + } + + virtual void _Run() = 0; + +private: + HANDLE _threadHandle; +}; + +//================================================================================================= + +class DspMutex +{ +public: + DspMutex() + { + InitializeCriticalSection(&_cs); + } + + DspMutex(DspMutex const&) + { + InitializeCriticalSection(&_cs); + } + + virtual ~DspMutex() + { + DeleteCriticalSection(&_cs); + } + + void Lock() + { + EnterCriticalSection(&_cs); + } + + void Unlock() + { + LeaveCriticalSection(&_cs); + } + +private: + CRITICAL_SECTION _cs; +}; + +//================================================================================================= + +class DspWaitCondition +{ +public: + DspWaitCondition() + { + _hEvent = CreateEventA(NULL, TRUE, FALSE, NULL); + } + + DspWaitCondition(DspWaitCondition const&) + { + _hEvent = CreateEventA(NULL, TRUE, FALSE, NULL); + } + + virtual ~DspWaitCondition() + { + CloseHandle(_hEvent); + } + + void Wait(DspMutex& mutex) + { + ResetEvent(_hEvent); + + mutex.Unlock(); + + WaitForSingleObject(_hEvent, INFINITE); + + mutex.Lock(); + } + + void WakeAll() + { + SetEvent(_hEvent); + } + +private: + HANDLE _hEvent; +}; + +//================================================================================================= + +#endif // DSPTHREADWIN_H diff --git a/src/libs/DSPatch/include/dspatch/DspWire.h b/src/libs/DSPatch/include/dspatch/DspWire.h new file mode 100755 index 0000000..17ef595 --- /dev/null +++ b/src/libs/DSPatch/include/dspatch/DspWire.h @@ -0,0 +1,58 @@ +/************************************************************************ +DSPatch - Cross-Platform, Object-Oriented, Flow-Based Programming Library +Copyright (c) 2012-2015 Marcus Tomlinson + +This file is part of DSPatch. + +GNU Lesser General Public License Usage +This file may be used under the terms of the GNU Lesser General Public +License version 3.0 as published by the Free Software Foundation and +appearing in the file LGPLv3.txt included in the packaging of this +file. Please review the following information to ensure the GNU Lesser +General Public License version 3.0 requirements will be met: +http://www.gnu.org/copyleft/lgpl.html. + +Other Usage +Alternatively, this file may be used in accordance with the terms and +conditions contained in a signed written agreement between you and +Marcus Tomlinson. + +DSPatch is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +************************************************************************/ + +#ifndef DSPWIRE_H +#define DSPWIRE_H + +//------------------------------------------------------------------------------------------------- + +class DspComponent; + +//================================================================================================= +/// Connection between two components + +/** +DspComponents process and transfer data between each other in the form of signals via +interconnecting "wires". Each wire contains references to the linked component, the source output +signal, and the destination input signal. The DspWire struct simply stores these references for use +in retrieving and providing signals across component connections. +*/ + +struct DspWire +{ + DspWire(DspComponent* newLinkedComponent, int newFromSignalIndex, int newToSignalIndex) + : linkedComponent(newLinkedComponent) + , fromSignalIndex(newFromSignalIndex) + , toSignalIndex(newToSignalIndex) + { + } + + DspComponent* linkedComponent; + int fromSignalIndex; + int toSignalIndex; +}; + +//================================================================================================= + +#endif // DSPWIRE_H diff --git a/src/libs/DSPatch/include/dspatch/DspWireBus.h b/src/libs/DSPatch/include/dspatch/DspWireBus.h new file mode 100755 index 0000000..d9d00e5 --- /dev/null +++ b/src/libs/DSPatch/include/dspatch/DspWireBus.h @@ -0,0 +1,71 @@ +/************************************************************************ +DSPatch - Cross-Platform, Object-Oriented, Flow-Based Programming Library +Copyright (c) 2012-2015 Marcus Tomlinson + +This file is part of DSPatch. + +GNU Lesser General Public License Usage +This file may be used under the terms of the GNU Lesser General Public +License version 3.0 as published by the Free Software Foundation and +appearing in the file LGPLv3.txt included in the packaging of this +file. Please review the following information to ensure the GNU Lesser +General Public License version 3.0 requirements will be met: +http://www.gnu.org/copyleft/lgpl.html. + +Other Usage +Alternatively, this file may be used in accordance with the terms and +conditions contained in a signed written agreement between you and +Marcus Tomlinson. + +DSPatch is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +************************************************************************/ + +#ifndef DSPWIREBUS_H +#define DSPWIREBUS_H + +//------------------------------------------------------------------------------------------------- + +#include + +#include +#include + +class DspComponent; + +//================================================================================================= +/// DspWire container + +/** +A DspWireBus contains DspWires (see DspWire). Each component contains an input wire bus. Via +the Tick() method, a DspComponent uses it's input wire bus to retrieve it's input signals from +incoming linked components, as mapped out in each DspWire. The DspCircuit class has an additional 2 +wire buses use to connect the circuit's IO signals to and from it's internal components. +*/ + +class DLLEXPORT DspWireBus +{ +public: + DspWireBus(bool isLinkedComponentReceivingSignals = false); + virtual ~DspWireBus(); + + bool AddWire(DspComponent* linkedComponent, int fromSignalIndex, int toSignalIndex); + + bool RemoveWire(int wireIndex); + bool RemoveWire(DspComponent const* linkedComponent, int fromSignalIndex, int toSignalIndex); + + void RemoveAllWires(); + + DspWire* GetWire(int wireIndex); + + int GetWireCount() const; + +private: + bool _isLinkedComponentReceivingSignals; + std::vector _wires; +}; + +//================================================================================================= + +#endif // DSPWIREBUS_H diff --git a/src/libs/DSPatch/index.html b/src/libs/DSPatch/index.html new file mode 100755 index 0000000..568f47a --- /dev/null +++ b/src/libs/DSPatch/index.html @@ -0,0 +1,5 @@ + + + + + diff --git a/src/libs/DSPatch/install.sh b/src/libs/DSPatch/install.sh new file mode 100755 index 0000000..a160e65 --- /dev/null +++ b/src/libs/DSPatch/install.sh @@ -0,0 +1,13 @@ +#!/bin/bash +src_dir=$(dirname $(readlink -f "$0")) +build_dir=${src_dir}/build + +if [ -f "/usr/bin/ninja" ] ; then + BUILD_COMMAND="ninja" +else + BUILD_COMMAND="make" +fi + +${src_dir}/build.sh +cd ${build_dir} +sudo ${BUILD_COMMAND} install diff --git a/src/libs/DSPatch/install_manifest.txt b/src/libs/DSPatch/install_manifest.txt new file mode 100644 index 0000000..ce16f16 --- /dev/null +++ b/src/libs/DSPatch/install_manifest.txt @@ -0,0 +1,18 @@ +/usr/local/lib/libDSPatch.dylib +/usr/local/include/DSPatch.h +/usr/local/include/dspatch/DspCircuit.h +/usr/local/include/dspatch/DspCircuitThread.h +/usr/local/include/dspatch/DspComponent.h +/usr/local/include/dspatch/DspComponentThread.h +/usr/local/include/dspatch/DspParameter.h +/usr/local/include/dspatch/DspPlugin.h +/usr/local/include/dspatch/DspPluginLoader.h +/usr/local/include/dspatch/DspRunType.h +/usr/local/include/dspatch/DspSignal.h +/usr/local/include/dspatch/DspSignalBus.h +/usr/local/include/dspatch/DspThread.h +/usr/local/include/dspatch/DspThreadNull.h +/usr/local/include/dspatch/DspThreadUnix.h +/usr/local/include/dspatch/DspThreadWin.h +/usr/local/include/dspatch/DspWire.h +/usr/local/include/dspatch/DspWireBus.h \ No newline at end of file diff --git a/src/libs/DSPatch/src/DSPatch.cpp b/src/libs/DSPatch/src/DSPatch.cpp new file mode 100755 index 0000000..273c71e --- /dev/null +++ b/src/libs/DSPatch/src/DSPatch.cpp @@ -0,0 +1,115 @@ +/************************************************************************ +DSPatch - Cross-Platform, Object-Oriented, Flow-Based Programming Library +Copyright (c) 2012-2015 Marcus Tomlinson + +This file is part of DSPatch. + +GNU Lesser General Public License Usage +This file may be used under the terms of the GNU Lesser General Public +License version 3.0 as published by the Free Software Foundation and +appearing in the file LGPLv3.txt included in the packaging of this +file. Please review the following information to ensure the GNU Lesser +General Public License version 3.0 requirements will be met: +http://www.gnu.org/copyleft/lgpl.html. + +Other Usage +Alternatively, this file may be used in accordance with the terms and +conditions contained in a signed written agreement between you and +Marcus Tomlinson. + +DSPatch is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +************************************************************************/ + +#include + +//================================================================================================= + +DspCircuit* DSPatch::_globalCircuit = new DspCircuit(); + +//================================================================================================= + +void DSPatch::SetGlobalThreadCount(int threadCount) +{ + if (_globalCircuit != NULL) + { + _globalCircuit->SetThreadCount(threadCount); + } +} + +//------------------------------------------------------------------------------------------------- + +void DSPatch::Finalize() +{ + delete _globalCircuit; + _globalCircuit = NULL; +} + +//================================================================================================= + +bool DSPatch::_IsThisGlobalCircuit(DspComponent const* thisComponent) +{ + if (_globalCircuit != NULL) + { + return _globalCircuit == thisComponent; + } + + return false; +} + +//------------------------------------------------------------------------------------------------- + +bool DSPatch::_AddGlobalComponent(DspComponent* component) +{ + if (_globalCircuit != NULL) + { + return _globalCircuit->AddComponent(component); + } + + return false; +} + +//------------------------------------------------------------------------------------------------- + +void DSPatch::_RemoveGlobalComponent(DspComponent const* component) +{ + if (_globalCircuit != NULL) + { + return _globalCircuit->RemoveComponent(component); + } +} + +//------------------------------------------------------------------------------------------------- + +int DSPatch::_GetGlobalComponentCount() +{ + if (_globalCircuit != NULL) + { + return _globalCircuit->GetComponentCount(); + } + + return 0; +} + +//------------------------------------------------------------------------------------------------- + +void DSPatch::_StartGlobalAutoTick() +{ + if (_globalCircuit != NULL) + { + _globalCircuit->StartAutoTick(); + } +} + +//------------------------------------------------------------------------------------------------- + +void DSPatch::_StopGlobalAutoTick() +{ + if (_globalCircuit != NULL) + { + _globalCircuit->StopAutoTick(); + } +} + +//================================================================================================= diff --git a/src/libs/DSPatch/src/DspCircuit.cpp b/src/libs/DSPatch/src/DspCircuit.cpp new file mode 100755 index 0000000..639a25a --- /dev/null +++ b/src/libs/DSPatch/src/DspCircuit.cpp @@ -0,0 +1,462 @@ +/************************************************************************ +DSPatch - Cross-Platform, Object-Oriented, Flow-Based Programming Library +Copyright (c) 2012-2015 Marcus Tomlinson + +This file is part of DSPatch. + +GNU Lesser General Public License Usage +This file may be used under the terms of the GNU Lesser General Public +License version 3.0 as published by the Free Software Foundation and +appearing in the file LGPLv3.txt included in the packaging of this +file. Please review the following information to ensure the GNU Lesser +General Public License version 3.0 requirements will be met: +http://www.gnu.org/copyleft/lgpl.html. + +Other Usage +Alternatively, this file may be used in accordance with the terms and +conditions contained in a signed written agreement between you and +Marcus Tomlinson. + +DSPatch is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +************************************************************************/ + +#include +#include +#include + +//================================================================================================= + +DspCircuit::DspCircuit(int threadCount) + : _currentThreadIndex(0) + , _inToInWires(true) + , _outToOutWires(false) +{ + SetThreadCount(threadCount); +} + +//------------------------------------------------------------------------------------------------- + +DspCircuit::~DspCircuit() +{ + StopAutoTick(); + RemoveAllComponents(); + SetThreadCount(0); +} + +//================================================================================================= + +void DspCircuit::SetThreadCount(int threadCount) +{ + if ((size_t)threadCount != _circuitThreads.size()) + { + PauseAutoTick(); + + // stop all threads + for (size_t i = 0; i < _circuitThreads.size(); i++) + { + _circuitThreads[i].Stop(); + } + + // resize thread array + _circuitThreads.resize(threadCount); + + // initialise and start all threads + for (size_t i = 0; i < _circuitThreads.size(); i++) + { + _circuitThreads[i].Initialise(&_components, i); + _circuitThreads[i].Start(); + } + + // set all components to the new thread count + for (size_t i = 0; i < _components.size(); i++) + { + _components[i]->_SetBufferCount(threadCount); + } + + ResumeAutoTick(); + } +} + +//------------------------------------------------------------------------------------------------- + +int DspCircuit::GetThreadCount() const +{ + return _circuitThreads.size(); +} + +//------------------------------------------------------------------------------------------------- + +bool DspCircuit::AddComponent(DspComponent* component, std::string const& componentName) +{ + if (component != this && component != NULL) + { + std::string compName = componentName; + + // if the component has a name already + if (component->GetComponentName() != "" && compName == "") + { + compName = component->GetComponentName(); + } + + int componentIndex; + + if (component->_GetParentCircuit() != NULL) + { + return false; // if the component is already part of another circuit + } + if (_FindComponent(component, componentIndex)) + { + return false; // if the component is already in the array + } + if (_FindComponent(compName, componentIndex)) + { + return false; // if the component name is already in the array + } + + // components within the circuit need to have as many buffers as there are threads in the circuit + component->_SetParentCircuit(this); + component->_SetBufferCount(_circuitThreads.size()); + component->SetComponentName(compName); + + PauseAutoTick(); + _components.push_back(component); + ResumeAutoTick(); + + return true; + } + + return false; +} + +//------------------------------------------------------------------------------------------------- + +bool DspCircuit::AddComponent(DspComponent& component, std::string const& componentName) +{ + return AddComponent(&component, componentName); +} + +//------------------------------------------------------------------------------------------------- + +void DspCircuit::RemoveComponent(DspComponent const* component) +{ + int componentIndex; + + if (_FindComponent(component, componentIndex)) + { + PauseAutoTick(); + _RemoveComponent(componentIndex); + ResumeAutoTick(); + } +} + +//------------------------------------------------------------------------------------------------- + +void DspCircuit::RemoveComponent(DspComponent const& component) +{ + RemoveComponent(&component); +} + +//------------------------------------------------------------------------------------------------- + +void DspCircuit::RemoveComponent(std::string const& componentName) +{ + int componentIndex; + + if (_FindComponent(componentName, componentIndex)) + { + PauseAutoTick(); + _RemoveComponent(componentIndex); + ResumeAutoTick(); + } +} + +//------------------------------------------------------------------------------------------------- + +void DspCircuit::RemoveAllComponents() +{ + for (size_t i = 0; i < _components.size(); i++) + { + PauseAutoTick(); + _RemoveComponent(i--); // size drops as one is removed + ResumeAutoTick(); + } +} + +//------------------------------------------------------------------------------------------------- + +int DspCircuit::GetComponentCount() const +{ + return _components.size(); +} + +//------------------------------------------------------------------------------------------------- + +void DspCircuit::DisconnectComponent(std::string const& component) +{ + int componentIndex; + + if (!_FindComponent(component, componentIndex)) // verify component exists + { + return; + } + + PauseAutoTick(); + _DisconnectComponent(componentIndex); + ResumeAutoTick(); +} + +//------------------------------------------------------------------------------------------------- + +bool DspCircuit::AddInput(std::string const& inputName) +{ + PauseAutoTick(); + bool result = AddInput_(inputName); + ResumeAutoTick(); + return result; +} + +//------------------------------------------------------------------------------------------------- + +bool DspCircuit::AddOutput(std::string const& outputName) +{ + PauseAutoTick(); + bool result = AddOutput_(outputName); + ResumeAutoTick(); + return result; +} + +//------------------------------------------------------------------------------------------------- + +void DspCircuit::RemoveInput() +{ + PauseAutoTick(); + RemoveInput_(); + ResumeAutoTick(); +} + +//------------------------------------------------------------------------------------------------- + +void DspCircuit::RemoveOutput() +{ + PauseAutoTick(); + RemoveOutput_(); + ResumeAutoTick(); +} + +//------------------------------------------------------------------------------------------------- + +void DspCircuit::RemoveAllInputs() +{ + PauseAutoTick(); + RemoveAllInputs_(); + ResumeAutoTick(); +} + +//------------------------------------------------------------------------------------------------- + +void DspCircuit::RemoveAllOutputs() +{ + PauseAutoTick(); + RemoveAllOutputs_(); + ResumeAutoTick(); +} + +//================================================================================================= + +void DspCircuit::Process_(DspSignalBus& inputs, DspSignalBus& outputs) +{ + DspWire* wire; + DspSignal* signal; + + // process in a single thread if this circuit has no threads + // ========================================================= + if (_circuitThreads.size() == 0) + { + // set all internal component inputs from connected circuit inputs + for (int i = 0; i < _inToInWires.GetWireCount(); i++) + { + wire = _inToInWires.GetWire(i); + signal = inputs.GetSignal(wire->fromSignalIndex); + wire->linkedComponent->_SetInputSignal(wire->toSignalIndex, signal); + } + + // tick all internal components + for (size_t i = 0; i < _components.size(); i++) + { + _components[i]->Tick(); + } + + // reset all internal components + for (size_t i = 0; i < _components.size(); i++) + { + _components[i]->Reset(); + } + + // set all circuit outputs from connected internal component outputs + for (int i = 0; i < _outToOutWires.GetWireCount(); i++) + { + wire = _outToOutWires.GetWire(i); + signal = wire->linkedComponent->_GetOutputSignal(wire->fromSignalIndex); + outputs.SetSignal(wire->toSignalIndex, signal); + } + } + // process in multiple thread if this circuit has threads + // ====================================================== + else + { + _circuitThreads[_currentThreadIndex].Sync(); // sync with thread x + + // set all circuit outputs from connected internal component outputs + for (int i = 0; i < _outToOutWires.GetWireCount(); i++) + { + wire = _outToOutWires.GetWire(i); + signal = wire->linkedComponent->_GetOutputSignal(wire->fromSignalIndex, _currentThreadIndex); + outputs.SetSignal(wire->toSignalIndex, signal); + } + + // set all internal component inputs from connected circuit inputs + for (int i = 0; i < _inToInWires.GetWireCount(); i++) + { + wire = _inToInWires.GetWire(i); + signal = inputs.GetSignal(wire->fromSignalIndex); + wire->linkedComponent->_SetInputSignal(wire->toSignalIndex, _currentThreadIndex, signal); + } + + _circuitThreads[_currentThreadIndex].Resume(); // resume thread x + + if ((size_t)++_currentThreadIndex >= _circuitThreads.size()) // shift to thread x+1 + { + _currentThreadIndex = 0; + } + } +} + +//================================================================================================= + +void DspCircuit::_PauseAutoTick() +{ + // pause auto tick + DspComponent::_PauseAutoTick(); + + // manually tick until 0 + while (_currentThreadIndex != 0) + { + Tick(); + Reset(); + } + + // sync all threads + for (size_t i = 0; i < _circuitThreads.size(); i++) + { + _circuitThreads[i].Sync(); + } +} + +//------------------------------------------------------------------------------------------------- + +bool DspCircuit::_FindComponent(DspComponent const* component, int& returnIndex) const +{ + for (size_t i = 0; i < _components.size(); i++) + { + if (_components[i] == component) + { + returnIndex = i; + return true; + } + } + + return false; +} + +//------------------------------------------------------------------------------------------------- + +bool DspCircuit::_FindComponent(DspComponent const& component, int& returnIndex) const +{ + return _FindComponent(&component, returnIndex); +} + +//------------------------------------------------------------------------------------------------- + +bool DspCircuit::_FindComponent(std::string const& componentName, int& returnIndex) const +{ + for (size_t i = 0; i < _components.size(); i++) + { + if (_components[i]->GetComponentName() != "" && _components[i]->GetComponentName() == componentName) + { + returnIndex = i; + return true; + } + } + + return false; +} + +//------------------------------------------------------------------------------------------------- + +bool DspCircuit::_FindComponent(int componentIndex, int& returnIndex) const +{ + if ((size_t)componentIndex < _components.size()) + { + returnIndex = componentIndex; + return true; + } + + return false; +} + +//------------------------------------------------------------------------------------------------- + +void DspCircuit::_DisconnectComponent(int componentIndex) +{ + // remove component from _inputComponents and _inputWires + _components[componentIndex]->DisconnectAllInputs(); + + // remove any connections this component has to other components + for (size_t i = 0; i < _components.size(); ++i) + { + _components[i]->DisconnectInput(_components[componentIndex]); + } + + // remove component from _inToInWires + DspWire* wire; + for (int i = 0; i < _inToInWires.GetWireCount(); i++) + { + wire = _inToInWires.GetWire(i); + if (wire->linkedComponent == _components[componentIndex]) + { + _inToInWires.RemoveWire(i); + } + } + + // remove component from _outToOutWires + for (int i = 0; i < _outToOutWires.GetWireCount(); i++) + { + wire = _outToOutWires.GetWire(i); + if (wire->linkedComponent == _components[componentIndex]) + { + _outToOutWires.RemoveWire(i); + } + } +} + +//------------------------------------------------------------------------------------------------- + +void DspCircuit::_RemoveComponent(int componentIndex) +{ + _DisconnectComponent(componentIndex); + + // set the removed component's parent circuit to NULL + if (_components[componentIndex]->_GetParentCircuit() != NULL) + { + _components[componentIndex]->_SetParentCircuit(NULL); + } + // setting a component's parent to NULL (above) calls _RemoveComponent (hence the following code will run) + else if (_components.size() != 0) + { + _components.erase(_components.begin() + componentIndex); + } +} + +//================================================================================================= diff --git a/src/libs/DSPatch/src/DspCircuitThread.cpp b/src/libs/DSPatch/src/DspCircuitThread.cpp new file mode 100755 index 0000000..a47bc30 --- /dev/null +++ b/src/libs/DSPatch/src/DspCircuitThread.cpp @@ -0,0 +1,152 @@ +/************************************************************************ +DSPatch - Cross-Platform, Object-Oriented, Flow-Based Programming Library +Copyright (c) 2012-2015 Marcus Tomlinson + +This file is part of DSPatch. + +GNU Lesser General Public License Usage +This file may be used under the terms of the GNU Lesser General Public +License version 3.0 as published by the Free Software Foundation and +appearing in the file LGPLv3.txt included in the packaging of this +file. Please review the following information to ensure the GNU Lesser +General Public License version 3.0 requirements will be met: +http://www.gnu.org/copyleft/lgpl.html. + +Other Usage +Alternatively, this file may be used in accordance with the terms and +conditions contained in a signed written agreement between you and +Marcus Tomlinson. + +DSPatch is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +************************************************************************/ + +#include +#include + +//================================================================================================= + +DspCircuitThread::DspCircuitThread() + : _components(NULL) + , _threadNo(0) + , _stop(false) + , _stopped(true) + , _gotResume(false) + , _gotSync(false) +{ +} + +//------------------------------------------------------------------------------------------------- + +DspCircuitThread::~DspCircuitThread() +{ + Stop(); +} + +//================================================================================================= + +void DspCircuitThread::Initialise(std::vector* components, int threadNo) +{ + _components = components; + _threadNo = threadNo; +} + +//------------------------------------------------------------------------------------------------- + +void DspCircuitThread::Start(Priority priority) +{ + if (_stopped) + { + _stop = false; + _stopped = false; + _gotResume = false; + _gotSync = true; + DspThread::Start(priority); + } +} + +//------------------------------------------------------------------------------------------------- + +void DspCircuitThread::Stop() +{ + _stop = true; + + while (_stopped != true) + { + _syncCondt.WakeAll(); + _resumeCondt.WakeAll(); + MsSleep(1); + } + + DspThread::Stop(); +} + +//------------------------------------------------------------------------------------------------- + +void DspCircuitThread::Sync() +{ + _resumeMutex.Lock(); + + if (!_gotSync) // if haven't already got sync + { + _syncCondt.Wait(_resumeMutex); // wait for sync + } + + _resumeMutex.Unlock(); +} + +//------------------------------------------------------------------------------------------------- + +void DspCircuitThread::Resume() +{ + _resumeMutex.Lock(); + + _gotSync = false; // reset the sync flag + + _gotResume = true; // set the resume flag + _resumeCondt.WakeAll(); + + _resumeMutex.Unlock(); +} + +//================================================================================================= + +void DspCircuitThread::_Run() +{ + if (_components != NULL) + { + while (!_stop) + { + _resumeMutex.Lock(); + + _gotSync = true; // set the sync flag + + _syncCondt.WakeAll(); + + if (!_gotResume) // if haven't already got resume + { + _resumeCondt.Wait(_resumeMutex); // wait for resume + } + _gotResume = false; // reset the resume flag + + _resumeMutex.Unlock(); + + if (!_stop) + { + for (size_t i = 0; i < _components->size(); i++) + { + (*_components)[i]->_ThreadTick(_threadNo); + } + for (size_t i = 0; i < _components->size(); i++) + { + (*_components)[i]->_ThreadReset(_threadNo); + } + } + } + } + + _stopped = true; +} + +//================================================================================================= diff --git a/src/libs/DSPatch/src/DspComponent.cpp b/src/libs/DSPatch/src/DspComponent.cpp new file mode 100755 index 0000000..c217c8c --- /dev/null +++ b/src/libs/DSPatch/src/DspComponent.cpp @@ -0,0 +1,847 @@ +/************************************************************************ +DSPatch - Cross-Platform, Object-Oriented, Flow-Based Programming Library +Copyright (c) 2012-2015 Marcus Tomlinson + +This file is part of DSPatch. + +GNU Lesser General Public License Usage +This file may be used under the terms of the GNU Lesser General Public +License version 3.0 as published by the Free Software Foundation and +appearing in the file LGPLv3.txt included in the packaging of this +file. Please review the following information to ensure the GNU Lesser +General Public License version 3.0 requirements will be met: +http://www.gnu.org/copyleft/lgpl.html. + +Other Usage +Alternatively, this file may be used in accordance with the terms and +conditions contained in a signed written agreement between you and +Marcus Tomlinson. + +DSPatch is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +************************************************************************/ + +#include + +#include +#include +#include +#include + +//================================================================================================= + +DspComponent::DspComponent() + : _parentCircuit(NULL) + , _bufferCount(0) + , _componentName("") + , _isAutoTickRunning(false) + , _isAutoTickPaused(false) + , _pauseCount(0) + , _hasTicked(false) + , _callback(NULL) + , _userData(NULL) +{ + _componentThread.Initialise(this); +} + +//------------------------------------------------------------------------------------------------- + +DspComponent::~DspComponent() +{ + if (_parentCircuit != NULL) + { + _parentCircuit->RemoveComponent(this); + } + + StopAutoTick(); + _SetBufferCount(0); + DisconnectAllInputs(); +} + +//================================================================================================= + +void DspComponent::SetCallback(Callback_t const& callback, void* userData) +{ + PauseAutoTick(); + _callback = callback; + _userData = userData; + ResumeAutoTick(); +} + +//------------------------------------------------------------------------------------------------- + +void DspComponent::SetComponentName(std::string const& componentName) +{ + _componentName = componentName; +} + +//------------------------------------------------------------------------------------------------- + +std::string DspComponent::GetComponentName() const +{ + return _componentName; +} + +//------------------------------------------------------------------------------------------------- + +void DspComponent::DisconnectInput(int inputIndex) +{ + PauseAutoTick(); + + // remove inputComponent from _inputWires + for (int i = 0; i < _inputWires.GetWireCount(); i++) + { + DspWire* wire = _inputWires.GetWire(i); + if (wire->toSignalIndex == inputIndex) + { + _inputWires.RemoveWire(i); + break; + } + } + + ResumeAutoTick(); +} + +//------------------------------------------------------------------------------------------------- + +void DspComponent::DisconnectInput(std::string const& inputName) +{ + int inputIndex; + + PauseAutoTick(); + + if (_FindInput(inputName, inputIndex)) + { + DisconnectInput(inputIndex); + } + + ResumeAutoTick(); +} + +//------------------------------------------------------------------------------------------------- + +void DspComponent::DisconnectInput(DspComponent const* inputComponent) +{ + PauseAutoTick(); + + // remove inputComponent from _inputWires + for (int i = 0; i < _inputWires.GetWireCount(); i++) + { + DspWire* wire = _inputWires.GetWire(i); + if (wire->linkedComponent == inputComponent) + { + _inputWires.RemoveWire(i); + } + } + + ResumeAutoTick(); +} + +//------------------------------------------------------------------------------------------------- + +void DspComponent::DisconnectAllInputs() +{ + PauseAutoTick(); + _inputWires.RemoveAllWires(); + ResumeAutoTick(); +} + +//------------------------------------------------------------------------------------------------- + +int DspComponent::GetInputCount() +{ + PauseAutoTick(); + int inputCount = GetInputCount_(); + ResumeAutoTick(); + return inputCount; +} + +//------------------------------------------------------------------------------------------------- + +int DspComponent::GetOutputCount() +{ + PauseAutoTick(); + int outputCount = GetOutputCount_(); + ResumeAutoTick(); + return outputCount; +} + +//------------------------------------------------------------------------------------------------- + +int DspComponent::GetParameterCount() +{ + PauseAutoTick(); + int parameterCount = GetParameterCount_(); + ResumeAutoTick(); + return parameterCount; +} + +//------------------------------------------------------------------------------------------------- + +std::string DspComponent::GetInputName(int index) +{ + std::string inputName; + + PauseAutoTick(); + + if (index < _inputBus.GetSignalCount()) + { + inputName = _inputBus.GetSignal(index)->GetSignalName(); + } + + ResumeAutoTick(); + return inputName; +} + +//------------------------------------------------------------------------------------------------- + +std::string DspComponent::GetOutputName(int index) +{ + std::string outputName; + + PauseAutoTick(); + + if (index < _outputBus.GetSignalCount()) + { + outputName = _outputBus.GetSignal(index)->GetSignalName(); + } + + ResumeAutoTick(); + return outputName; +} + +//------------------------------------------------------------------------------------------------- + +std::string DspComponent::GetParameterName(int index) +{ + std::string parameterName; + + PauseAutoTick(); + + if ((size_t)index < _parameters.size()) + { + parameterName = _parameters[index].first; + } + + ResumeAutoTick(); + return parameterName; +} + +//------------------------------------------------------------------------------------------------- + +bool DspComponent::GetParameter(int index, DspParameter& param) +{ + bool result = false; + PauseAutoTick(); + + DspParameter const* paramPtr = GetParameter_(index); + if (paramPtr) + { + result = param.SetParam(*paramPtr); + } + + ResumeAutoTick(); + return result; +} + +//------------------------------------------------------------------------------------------------- + +DspParameter const* DspComponent::GetParameter(int index) +{ + PauseAutoTick(); + DspParameter const* result = GetParameter_(index); + ResumeAutoTick(); + return result; +} + +//------------------------------------------------------------------------------------------------- + +bool DspComponent::SetParameter(int index, DspParameter const& param) +{ + PauseAutoTick(); + bool result = ParameterUpdating_(index, param); + ResumeAutoTick(); + return result; +} + +//------------------------------------------------------------------------------------------------- + +void DspComponent::Tick() +{ + // continue only if this component has not already been ticked + if (!_hasTicked) + { + // 1. set _hasTicked flag + _hasTicked = true; + + // 2. get outputs required from input components + for (int i = 0; i < _inputWires.GetWireCount(); i++) + { + DspWire* wire = _inputWires.GetWire(i); + wire->linkedComponent->Tick(); + + DspSignal* signal = wire->linkedComponent->_outputBus.GetSignal(wire->fromSignalIndex); + _inputBus.SetSignal(wire->toSignalIndex, signal); + } + + // 3. clear all outputs + _outputBus.ClearAllValues(); + + // 4. call Process_() with newly aquired inputs + Process_(_inputBus, _outputBus); + } +} + +//------------------------------------------------------------------------------------------------- + +void DspComponent::Reset() +{ + // clear all inputs + _inputBus.ClearAllValues(); + + // reset _hasTicked flag + _hasTicked = false; +} + +//------------------------------------------------------------------------------------------------- + +void DspComponent::StartAutoTick() +{ + // Global scoped components (components not within a circuit) are added to the "global circuit" in + // order to be auto-ticked. Technically it is only the global circuit that auto-ticks -This in turn + // auto-ticks all components contained. + + // if this is the global circuit + if (DSPatch::_IsThisGlobalCircuit(this)) + { + if (_componentThread.IsStopped()) + { + _componentThread.Start(); + + _isAutoTickRunning = true; + _isAutoTickPaused = false; + } + else + { + ResumeAutoTick(); + } + } + // else if this component has no parent or it's parent is the global circuit + else if (_parentCircuit == NULL || DSPatch::_IsThisGlobalCircuit(_parentCircuit)) + { + DSPatch::_AddGlobalComponent(this); + DSPatch::_StartGlobalAutoTick(); + } +} + +//------------------------------------------------------------------------------------------------- + +void DspComponent::StopAutoTick() +{ + // If a component is part of the global circuit, a call to StopAutoTick() removes it from the + // global circuit as to stop it from being auto-ticked. When all components are removed, the + // global circuit auto-ticking is stopped. + + // if this is the global circuit + if (DSPatch::_IsThisGlobalCircuit(this) && !_componentThread.IsStopped()) + { + _componentThread.Stop(); + + _isAutoTickRunning = false; + _isAutoTickPaused = false; + } + // else if this component's parent is the global circuit + else if (DSPatch::_IsThisGlobalCircuit(_parentCircuit)) + { + DSPatch::_RemoveGlobalComponent(this); + + if (DSPatch::_GetGlobalComponentCount() == 0) + { + DSPatch::_StopGlobalAutoTick(); + } + } +} + +//------------------------------------------------------------------------------------------------- + +void DspComponent::PauseAutoTick() +{ + _PauseAutoTick(); +} + +//------------------------------------------------------------------------------------------------- + +void DspComponent::ResumeAutoTick() +{ + // A call to ResumeAutoTick() recursively traverses it's parent circuits until it reaches the + // global circuit. When the global circuit is reached, it's auto-tick is resumed. + + // if this is the global circuit + if (DSPatch::_IsThisGlobalCircuit(this) && _isAutoTickPaused && --_pauseCount == 0) + { + _componentThread.Resume(); + _isAutoTickPaused = false; + _isAutoTickRunning = true; + } + else if (_parentCircuit != NULL) + { + _parentCircuit->ResumeAutoTick(); // recursive call to find the global circuit + } +} + +//================================================================================================= + +void DspComponent::Process_(DspSignalBus&, DspSignalBus&) +{ +} + +//------------------------------------------------------------------------------------------------- + +bool DspComponent::ParameterUpdating_(int, DspParameter const&) +{ + return false; +} + +//------------------------------------------------------------------------------------------------- + +bool DspComponent::AddInput_(std::string const& inputName) +{ + for (size_t i = 0; i < _inputBuses.size(); i++) + { + _inputBuses[i]._AddSignal(inputName); + } + if (_inputBus._AddSignal(inputName)) + { + if (_callback) + { + _callback(this, InputAdded, _inputBus.GetSignalCount() - 1, _userData); + } + return true; + } + return false; +} + +//------------------------------------------------------------------------------------------------- + +bool DspComponent::AddOutput_(std::string const& outputName) +{ + for (size_t i = 0; i < _outputBuses.size(); i++) + { + _outputBuses[i]._AddSignal(outputName); + } + if (_outputBus._AddSignal(outputName)) + { + if (_callback) + { + _callback(this, OutputAdded, _outputBus.GetSignalCount() - 1, _userData); + } + return true; + } + return false; +} + +//------------------------------------------------------------------------------------------------- + +int DspComponent::AddParameter_(std::string const& paramName, DspParameter const& param) +{ + _parameters.push_back(std::make_pair(paramName, param)); + if (_callback) + { + _callback(this, ParameterAdded, _parameters.size() - 1, _userData); + } + return _parameters.size() - 1; +} + +//------------------------------------------------------------------------------------------------- + +bool DspComponent::RemoveInput_() +{ + if (_inputBus._RemoveSignal()) + { + if (_callback) + { + _callback(this, InputRemoved, _inputBus.GetSignalCount(), _userData); + } + return true; + } + return false; +} + +//------------------------------------------------------------------------------------------------- + +bool DspComponent::RemoveOutput_() +{ + if (_outputBus._RemoveSignal()) + { + if (_callback) + { + _callback(this, OutputRemoved, _outputBus.GetSignalCount(), _userData); + } + return true; + } + return false; +} + +//------------------------------------------------------------------------------------------------- + +bool DspComponent::RemoveParameter_() +{ + if (!_parameters.empty()) + { + _parameters.pop_back(); + if (_callback) + { + _callback(this, ParameterRemoved, _parameters.size(), _userData); + } + return true; + } + return false; +} + +//------------------------------------------------------------------------------------------------- + +void DspComponent::RemoveAllInputs_() +{ + for (size_t i = 0; i < _inputBuses.size(); i++) + { + _inputBuses[i]._RemoveAllSignals(); + } + _inputBus._RemoveAllSignals(); + if (_callback) + { + _callback(this, InputRemoved, -1, _userData); + } +} + +//------------------------------------------------------------------------------------------------- + +void DspComponent::RemoveAllOutputs_() +{ + for (size_t i = 0; i < _outputBuses.size(); i++) + { + _outputBuses[i]._RemoveAllSignals(); + } + _outputBus._RemoveAllSignals(); + if (_callback) + { + _callback(this, OutputRemoved, -1, _userData); + } +} + +//------------------------------------------------------------------------------------------------- + +void DspComponent::RemoveAllParameters_() +{ + _parameters.clear(); + if (_callback) + { + _callback(this, ParameterRemoved, -1, _userData); + } +} + +//------------------------------------------------------------------------------------------------- + +int DspComponent::GetInputCount_() +{ + return _inputBus.GetSignalCount(); +} + +//------------------------------------------------------------------------------------------------- + +int DspComponent::GetOutputCount_() +{ + return _outputBus.GetSignalCount(); +} + +//------------------------------------------------------------------------------------------------- + +int DspComponent::GetParameterCount_() +{ + return _parameters.size(); +} + +//------------------------------------------------------------------------------------------------- + +DspParameter const* DspComponent::GetParameter_(int index) const +{ + if ((size_t)index < _parameters.size()) + { + return &_parameters[index].second; + } + return NULL; +} + +//------------------------------------------------------------------------------------------------- + +bool DspComponent::SetParameter_(int index, DspParameter const& param) +{ + if ((size_t)index < _parameters.size()) + { + if (_parameters[index].second.SetParam(param)) + { + if (_callback) + { + _callback(this, ParameterUpdated, index, _userData); + } + return true; + } + } + return false; +} + +//================================================================================================= + +void DspComponent::_PauseAutoTick() +{ + // A call to PauseAutoTick() recursively traverses it's parent circuits until it reaches the + // global circuit. When the global circuit is reached, it's auto-tick is paused. + + // if this is the global circuit + if (DSPatch::_IsThisGlobalCircuit(this) && !_componentThread.IsStopped()) + { + if (_isAutoTickRunning) + { + ++_pauseCount; + _componentThread.Pause(); + _isAutoTickPaused = true; + _isAutoTickRunning = false; + } + } + else if (_parentCircuit != NULL) + { + _parentCircuit->PauseAutoTick(); // recursive call to find the global circuit + } +} + +//------------------------------------------------------------------------------------------------- + +void DspComponent::_SetParentCircuit(DspCircuit* parentCircuit) +{ + if (_parentCircuit != parentCircuit && parentCircuit != this) + { + DspCircuit* currentParent = _parentCircuit; + _parentCircuit = NULL; + + // if this component is part of another circuit, remove it from that circuit first + if (currentParent != NULL) + { + currentParent->RemoveComponent(this); + } + + _parentCircuit = parentCircuit; + + // this method is called from within AddComponent() so don't call AddComponent() here + } +} + +//------------------------------------------------------------------------------------------------- + +DspCircuit* DspComponent::_GetParentCircuit() +{ + return _parentCircuit; +} + +//------------------------------------------------------------------------------------------------- + +bool DspComponent::_FindInput(std::string const& signalName, int& returnIndex) const +{ + return _inputBus.FindSignal(signalName, returnIndex); +} + +//------------------------------------------------------------------------------------------------- + +bool DspComponent::_FindInput(int signalIndex, int& returnIndex) const +{ + if (signalIndex < _inputBus.GetSignalCount()) + { + returnIndex = signalIndex; + return true; + } + + return false; +} + +//------------------------------------------------------------------------------------------------- + +bool DspComponent::_FindOutput(std::string const& signalName, int& returnIndex) const +{ + return _outputBus.FindSignal(signalName, returnIndex); +} + +//------------------------------------------------------------------------------------------------- + +bool DspComponent::_FindOutput(int signalIndex, int& returnIndex) const +{ + if (signalIndex < _outputBus.GetSignalCount()) + { + returnIndex = signalIndex; + return true; + } + + return false; +} + +//------------------------------------------------------------------------------------------------- + +void DspComponent::_SetBufferCount(int bufferCount) +{ + // _bufferCount is the current thread count / bufferCount is new thread count + + // delete excess _hasTickeds (if new buffer count is less than current) + for (int i = _bufferCount - 1; i >= (int)bufferCount; i--) + { + delete _hasTickeds[i]; + } + + // resize local buffer array + _hasTickeds.resize(bufferCount); + + // create excess _hasTickeds (if new buffer count is more than current) + for (int i = _bufferCount; i < bufferCount; i++) + { + _hasTickeds[i] = new bool(); + } + + _inputBuses.resize(bufferCount); + _outputBuses.resize(bufferCount); + + _gotReleases.resize(bufferCount); + _releaseMutexes.resize(bufferCount); + _releaseCondts.resize(bufferCount); + + for (int i = _bufferCount; i < bufferCount; i++) + { + *_hasTickeds[i] = false; + _gotReleases[i] = false; + + for (int j = 0; j < _inputBus.GetSignalCount(); j++) + { + _inputBuses[i]._AddSignal(_inputBus.GetSignal(j)->GetSignalName()); + } + + for (int j = 0; j < _outputBus.GetSignalCount(); j++) + { + _outputBuses[i]._AddSignal(_outputBus.GetSignal(j)->GetSignalName()); + } + } + + if (bufferCount > 0) + { + _gotReleases[0] = true; + } + + _bufferCount = bufferCount; +} + +//------------------------------------------------------------------------------------------------- + +int DspComponent::_GetBufferCount() const +{ + return _bufferCount; +} + +//------------------------------------------------------------------------------------------------- + +void DspComponent::_ThreadTick(int threadNo) +{ + // continue only if this component has not already been ticked + if (*_hasTickeds[threadNo] == false) + { + // 1. set _hasTicked flag + *_hasTickeds[threadNo] = true; + + // 2. get outputs required from input components + for (int i = 0; i < _inputWires.GetWireCount(); i++) + { + DspWire* wire = _inputWires.GetWire(i); + wire->linkedComponent->_ThreadTick(threadNo); + + DspSignal* signal = wire->linkedComponent->_outputBuses[threadNo].GetSignal(wire->fromSignalIndex); + _inputBuses[threadNo].SetSignal(wire->toSignalIndex, signal); + } + + // 3. clear all outputs + _outputBuses[threadNo].ClearAllValues(); + + // 4. wait for your turn to process. + _WaitForRelease(threadNo); + + // 5. call Process_() with newly aquired inputs + Process_(_inputBuses[threadNo], _outputBuses[threadNo]); + + // 6. signal that you're done processing. + _ReleaseThread(threadNo); + } +} + +//------------------------------------------------------------------------------------------------- + +void DspComponent::_ThreadReset(int threadNo) +{ + // clear all inputs + _inputBuses[threadNo].ClearAllValues(); + + // reset _hasTicked flag + *_hasTickeds[threadNo] = false; +} + +//------------------------------------------------------------------------------------------------- + +bool DspComponent::_SetInputSignal(int inputIndex, DspSignal const* newSignal) +{ + return _inputBus.SetSignal(inputIndex, newSignal); +} + +//------------------------------------------------------------------------------------------------- + +bool DspComponent::_SetInputSignal(int inputIndex, int threadIndex, DspSignal const* newSignal) +{ + return _inputBuses[threadIndex].SetSignal(inputIndex, newSignal); +} + +//------------------------------------------------------------------------------------------------- + +DspSignal* DspComponent::_GetOutputSignal(int outputIndex) +{ + return _outputBus.GetSignal(outputIndex); +} + +//------------------------------------------------------------------------------------------------- + +DspSignal* DspComponent::_GetOutputSignal(int outputIndex, int threadIndex) +{ + return _outputBuses[threadIndex].GetSignal(outputIndex); +} + +//------------------------------------------------------------------------------------------------- + +void DspComponent::_WaitForRelease(int threadNo) +{ + _releaseMutexes[threadNo].Lock(); + if (!_gotReleases[threadNo]) + { + _releaseCondts[threadNo].Wait(_releaseMutexes[threadNo]); // wait for resume + } + _gotReleases[threadNo] = false; // reset the release flag + _releaseMutexes[threadNo].Unlock(); +} + +//------------------------------------------------------------------------------------------------- + +void DspComponent::_ReleaseThread(int threadNo) +{ + int nextThread = threadNo + 1; + + if (nextThread >= _bufferCount) + { + nextThread = 0; + } + + _releaseMutexes[nextThread].Lock(); + _gotReleases[nextThread] = true; + _releaseCondts[nextThread].WakeAll(); + _releaseMutexes[nextThread].Unlock(); +} + +//================================================================================================= diff --git a/src/libs/DSPatch/src/DspComponentThread.cpp b/src/libs/DSPatch/src/DspComponentThread.cpp new file mode 100755 index 0000000..b8381f3 --- /dev/null +++ b/src/libs/DSPatch/src/DspComponentThread.cpp @@ -0,0 +1,137 @@ +/************************************************************************ +DSPatch - Cross-Platform, Object-Oriented, Flow-Based Programming Library +Copyright (c) 2012-2015 Marcus Tomlinson + +This file is part of DSPatch. + +GNU Lesser General Public License Usage +This file may be used under the terms of the GNU Lesser General Public +License version 3.0 as published by the Free Software Foundation and +appearing in the file LGPLv3.txt included in the packaging of this +file. Please review the following information to ensure the GNU Lesser +General Public License version 3.0 requirements will be met: +http://www.gnu.org/copyleft/lgpl.html. + +Other Usage +Alternatively, this file may be used in accordance with the terms and +conditions contained in a signed written agreement between you and +Marcus Tomlinson. + +DSPatch is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +************************************************************************/ + +#include +#include + +//================================================================================================= + +DspComponentThread::DspComponentThread() + : _component(NULL) + , _stop(false) + , _pause(false) + , _stopped(true) +{ +} + +//------------------------------------------------------------------------------------------------- + +DspComponentThread::~DspComponentThread() +{ + Stop(); +} + +//================================================================================================= + +void DspComponentThread::Initialise(DspComponent* component) +{ + _component = component; +} + +//------------------------------------------------------------------------------------------------- + +bool DspComponentThread::IsStopped() const +{ + return _stopped; +} + +//------------------------------------------------------------------------------------------------- + +void DspComponentThread::Start(Priority priority) +{ + if (_stopped) + { + _stop = false; + _stopped = false; + _pause = false; + DspThread::Start(priority); + } +} + +//------------------------------------------------------------------------------------------------- + +void DspComponentThread::Stop() +{ + _stop = true; + + while (_stopped != true) + { + _pauseCondt.WakeAll(); + _resumeCondt.WakeAll(); + MsSleep(1); + } + + DspThread::Stop(); +} + +//------------------------------------------------------------------------------------------------- + +void DspComponentThread::Pause() +{ + _resumeMutex.Lock(); + + _pause = true; + _pauseCondt.Wait(_resumeMutex); // wait for resume + _pause = false; + + _resumeMutex.Unlock(); +} + +//------------------------------------------------------------------------------------------------- + +void DspComponentThread::Resume() +{ + _resumeMutex.Lock(); + _resumeCondt.WakeAll(); + _resumeMutex.Unlock(); +} + +//================================================================================================= + +void DspComponentThread::_Run() +{ + if (_component != NULL) + { + while (!_stop) + { + _component->Tick(); + _component->Reset(); + + if (_pause) + { + _resumeMutex.Lock(); + + _pauseCondt.WakeAll(); + + _resumeCondt.Wait(_resumeMutex); // wait for resume + + _resumeMutex.Unlock(); + } + } + } + + _stopped = true; +} + +//================================================================================================= diff --git a/src/libs/DSPatch/src/DspParameter.cpp b/src/libs/DSPatch/src/DspParameter.cpp new file mode 100755 index 0000000..d8c7a40 --- /dev/null +++ b/src/libs/DSPatch/src/DspParameter.cpp @@ -0,0 +1,473 @@ +/************************************************************************ +DSPatch - Cross-Platform, Object-Oriented, Flow-Based Programming Library +Copyright (c) 2012-2015 Marcus Tomlinson + +This file is part of DSPatch. + +GNU Lesser General Public License Usage +This file may be used under the terms of the GNU Lesser General Public +License version 3.0 as published by the Free Software Foundation and +appearing in the file LGPLv3.txt included in the packaging of this +file. Please review the following information to ensure the GNU Lesser +General Public License version 3.0 requirements will be met: +http://www.gnu.org/copyleft/lgpl.html. + +Other Usage +Alternatively, this file may be used in accordance with the terms and +conditions contained in a signed written agreement between you and +Marcus Tomlinson. + +DSPatch is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +************************************************************************/ + +#include + +//================================================================================================= + +DspParameter::DspParameter() + : _type(Null) + , _isSet(false) + , _isRangeSet(false) +{ +} + +//------------------------------------------------------------------------------------------------- + +DspParameter::DspParameter(ParamType const& type) + : _type(type) + , _isSet(false) + , _isRangeSet(false) +{ +} + +//------------------------------------------------------------------------------------------------- + +DspParameter::DspParameter(ParamType const& type, int const& initValue, std::pair const& valueRange) + : _type(type) + , _isSet(false) + , _isRangeSet(false) +{ + if (type == Bool) + { + if (!SetBool(initValue != 0)) + { + _type = Null; + } + } + else if (type == Float) + { + if (!SetFloatRange(std::make_pair((float)valueRange.first, (float)valueRange.second)) || + !SetFloat((float)initValue)) + { + _type = Null; + } + } + else + { + if (!SetIntRange(valueRange) || !SetInt(initValue)) + { + _type = Null; + } + } +} + +//------------------------------------------------------------------------------------------------- + +DspParameter::DspParameter(ParamType const& type, float const& initValue, std::pair const& valueRange) + : _type(type) + , _isSet(false) + , _isRangeSet(false) +{ + if (!SetFloatRange(valueRange) || !SetFloat(initValue)) + { + _type = Null; + } +} + +//------------------------------------------------------------------------------------------------- + +DspParameter::DspParameter(ParamType const& type, std::string const& initValue) + : _type(type) + , _isSet(false) + , _isRangeSet(false) +{ + if (!SetString(initValue)) + { + _type = Null; + } +} + +//------------------------------------------------------------------------------------------------- + +DspParameter::DspParameter(ParamType const& type, std::vector const& initValue) + : _type(type) + , _isSet(false) + , _isRangeSet(false) +{ + if (!SetList(initValue)) + { + _type = Null; + } +} + +//================================================================================================= + +DspParameter::ParamType DspParameter::Type() const +{ + return _type; +} + +//------------------------------------------------------------------------------------------------- + +bool DspParameter::IsSet() const +{ + return _isSet; +} + +//------------------------------------------------------------------------------------------------- + +bool const* DspParameter::GetBool() const +{ + if (!_isSet) + { + return NULL; + } + + if (_type == Bool) + { + return &_boolValue; + } + + return NULL; +} + +//------------------------------------------------------------------------------------------------- + +int const* DspParameter::GetInt() const +{ + if (!_isSet) + { + return NULL; + } + + if (_type == Int || _type == List) + { + return &_intValue; + } + + return NULL; +} + +//------------------------------------------------------------------------------------------------- + +std::pair const* DspParameter::GetIntRange() const +{ + if (!_isRangeSet) + { + return NULL; + } + + if (_type == Int || _type == List) + { + return &_intRange; + } + + return NULL; +} + +//------------------------------------------------------------------------------------------------- + +float const* DspParameter::GetFloat() const +{ + if (!_isSet) + { + return NULL; + } + + if (_type == Float) + { + return &_floatValue; + } + + return NULL; +} + +//------------------------------------------------------------------------------------------------- + +std::pair const* DspParameter::GetFloatRange() const +{ + if (!_isRangeSet) + { + return NULL; + } + + if (_type == Float) + { + return &_floatRange; + } + + return NULL; +} + +//------------------------------------------------------------------------------------------------- + +std::string const* DspParameter::GetString() const +{ + if (!_isSet) + { + return NULL; + } + + if (_type == String || _type == FilePath) + { + return &_stringValue; + } + else if (_type == List) + { + return &_listValue[_intValue]; + } + + return NULL; +} + +//------------------------------------------------------------------------------------------------- + +std::vector const* DspParameter::GetList() const +{ + if (!_isSet) + { + return NULL; + } + + if (_type == List) + { + return &_listValue; + } + + return NULL; +} + +//------------------------------------------------------------------------------------------------- + +bool DspParameter::SetBool(bool const& value) +{ + if (_type == Bool) + { + _boolValue = value; + _isSet = true; + return true; + } + + return false; +} + +//------------------------------------------------------------------------------------------------- + +bool DspParameter::SetInt(int const& value) +{ + if (_type == Int || _type == List) + { + if (_isRangeSet) + { + _intValue = value < _intRange.first ? _intRange.first : value; + _intValue = value > _intRange.second ? _intRange.second : value; + } + else + { + _intValue = value; + } + _isSet = true; + return true; + } + + return false; +} + +//------------------------------------------------------------------------------------------------- + +bool DspParameter::SetIntRange(std::pair const& intRange) +{ + if (_type == Int) + { + _intRange = intRange; + + if (intRange.first == intRange.second && intRange.first == -1) + { + _isRangeSet = false; + } + else + { + if (_isSet) + { + _intValue = _intValue < intRange.first ? intRange.first : _intValue; + _intValue = _intValue > intRange.second ? intRange.second : _intValue; + } + _isRangeSet = true; + } + return true; + } + + return false; +} + +//------------------------------------------------------------------------------------------------- + +bool DspParameter::SetFloat(float const& value) +{ + if (_type == Float) + { + if (_isRangeSet) + { + _floatValue = value < _floatRange.first ? _floatRange.first : value; + _floatValue = value > _floatRange.second ? _floatRange.second : value; + } + else + { + _floatValue = value; + } + _isSet = true; + return true; + } + + return false; +} + +//------------------------------------------------------------------------------------------------- + +bool DspParameter::SetFloatRange(std::pair const& floatRange) +{ + if (_type == Float) + { + _floatRange = floatRange; + + if (floatRange.first == floatRange.second && floatRange.first == -1) + { + _isRangeSet = false; + } + else + { + if (_isSet) + { + _floatValue = _floatValue < floatRange.first ? floatRange.first : _floatValue; + _floatValue = _floatValue > floatRange.second ? floatRange.second : _floatValue; + } + _isRangeSet = true; + } + return true; + } + + return false; +} + +//------------------------------------------------------------------------------------------------- + +bool DspParameter::SetString(std::string const& value) +{ + if (_type == String || _type == FilePath) + { + _stringValue = value; + _isSet = true; + return true; + } + else if (_type == List) + { + for (size_t i = 0; i < _listValue.size(); ++i) + { + if (_listValue[i] == value) + { + _intValue = i; + _isSet = true; + return true; + } + } + } + + return false; +} + +//------------------------------------------------------------------------------------------------- + +bool DspParameter::SetList(std::vector const& value) +{ + if (_type == List) + { + _listValue = value; + + _intRange.first = 0; + _intRange.second = value.size() - 1; + _isRangeSet = true; + + _intValue = 0; + _isSet = true; + return true; + } + + return false; +} + +//------------------------------------------------------------------------------------------------- + +bool DspParameter::SetParam(DspParameter const& param) +{ + if (_type == Null) + { + _type = param.Type(); + } + + if (param.Type() == Bool) + { + if (param.GetBool()) + { + return SetBool(*param.GetBool()); + } + } + else if (param.Type() == Int) + { + if (param.GetIntRange() && param.GetInt()) + { + return SetIntRange(*param.GetIntRange()) && SetInt(*param.GetInt()); + } + else if (param.GetInt()) + { + return SetInt(*param.GetInt()); + } + } + else if (param.Type() == Float) + { + if (param.GetFloatRange() && param.GetFloat()) + { + return SetFloatRange(*param.GetFloatRange()) && SetFloat(*param.GetFloat()); + } + if (param.GetFloat()) + { + return SetFloat(*param.GetFloat()); + } + } + else if (param.Type() == String || param.Type() == FilePath) + { + if (param.GetString()) + { + return SetString(*param.GetString()); + } + } + else if (param.Type() == Trigger) + { + if (_type == Trigger) + { + return true; + } + } + else if (param.Type() == List) + { + if (param.GetList()) + { + return SetList(*param.GetList()); + } + } + + return false; +} + +//================================================================================================= diff --git a/src/libs/DSPatch/src/DspPlugin.cpp b/src/libs/DSPatch/src/DspPlugin.cpp new file mode 100755 index 0000000..334b0d2 --- /dev/null +++ b/src/libs/DSPatch/src/DspPlugin.cpp @@ -0,0 +1,33 @@ +/************************************************************************ +DSPatch - Cross-Platform, Object-Oriented, Flow-Based Programming Library +Copyright (c) 2012-2015 Marcus Tomlinson + +This file is part of DSPatch. + +GNU Lesser General Public License Usage +This file may be used under the terms of the GNU Lesser General Public +License version 3.0 as published by the Free Software Foundation and +appearing in the file LGPLv3.txt included in the packaging of this +file. Please review the following information to ensure the GNU Lesser +General Public License version 3.0 requirements will be met: +http://www.gnu.org/copyleft/lgpl.html. + +Other Usage +Alternatively, this file may be used in accordance with the terms and +conditions contained in a signed written agreement between you and +Marcus Tomlinson. + +DSPatch is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +************************************************************************/ + +#include + +//================================================================================================= + +DspPlugin::~DspPlugin() +{ +} + +//================================================================================================= diff --git a/src/libs/DSPatch/src/DspPluginLoader.cpp b/src/libs/DSPatch/src/DspPluginLoader.cpp new file mode 100755 index 0000000..e765a40 --- /dev/null +++ b/src/libs/DSPatch/src/DspPluginLoader.cpp @@ -0,0 +1,146 @@ +/************************************************************************ +DSPatch - Cross-Platform, Object-Oriented, Flow-Based Programming Library +Copyright (c) 2012-2015 Marcus Tomlinson + +This file is part of DSPatch. + +GNU Lesser General Public License Usage +This file may be used under the terms of the GNU Lesser General Public +License version 3.0 as published by the Free Software Foundation and +appearing in the file LGPLv3.txt included in the packaging of this +file. Please review the following information to ensure the GNU Lesser +General Public License version 3.0 requirements will be met: +http://www.gnu.org/copyleft/lgpl.html. + +Other Usage +Alternatively, this file may be used in accordance with the terms and +conditions contained in a signed written agreement between you and +Marcus Tomlinson. + +DSPatch is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +************************************************************************/ + +#include + +#ifdef _WIN32 +#include +#else +#include +#endif + +//================================================================================================= + +DspPluginLoader::DspPluginLoader(std::string const& pluginPath) + : _pluginPath(pluginPath) + , _handle(NULL) +{ + _LoadPlugin(_pluginPath); +} + +//------------------------------------------------------------------------------------------------- + +DspPluginLoader::DspPluginLoader(DspPluginLoader const& other) + : _pluginPath(other._pluginPath) + , _handle(NULL) +{ + _LoadPlugin(_pluginPath); +} + +//------------------------------------------------------------------------------------------------- + +DspPluginLoader& DspPluginLoader::operator=(const DspPluginLoader& other) +{ + _pluginPath = other._pluginPath; + _handle = NULL; + _LoadPlugin(_pluginPath); + return *this; +} + +//------------------------------------------------------------------------------------------------- + +DspPluginLoader::~DspPluginLoader() +{ + // close library + if (_handle) + { +#ifdef _WIN32 + FreeLibrary((HMODULE)_handle); +#else + dlclose(_handle); +#endif + } +} + +//================================================================================================= + +bool DspPluginLoader::IsLoaded() const +{ + return _handle ? true : false; +} + +//------------------------------------------------------------------------------------------------- + +std::map DspPluginLoader::GetCreateParams() const +{ + if (_handle) + { + return _getCreateParams(); + } + return std::map(); +} + +//------------------------------------------------------------------------------------------------- + +DspComponent* DspPluginLoader::Create(std::map& params) const +{ + if (_handle) + { + return _create(params); + } + return NULL; +} + +//================================================================================================= + +DspPluginLoader::DspPluginLoader() +{ +} + +//------------------------------------------------------------------------------------------------- + +void DspPluginLoader::_LoadPlugin(std::string const& pluginPath) +{ + // open library + #ifdef _WIN32 + _handle = LoadLibrary(pluginPath.c_str()); + #else + _handle = dlopen(pluginPath.c_str(), RTLD_NOW); + #endif + + if (_handle) + { + // load symbols + #ifdef _WIN32 + _getCreateParams = (GetCreateParams_t)GetProcAddress((HMODULE)_handle, "GetCreateParams"); + _create = (Create_t)GetProcAddress((HMODULE)_handle, "Create"); + #else + _getCreateParams = (GetCreateParams_t)dlsym(_handle, "GetCreateParams"); + _create = (Create_t)dlsym(_handle, "Create"); + #endif + + if (!_getCreateParams || !_create) + { + #ifdef _WIN32 + FreeLibrary((HMODULE)_handle); + #else + dlclose(_handle); + #endif + + _handle = NULL; + } + } +} + +//================================================================================================= diff --git a/src/libs/DSPatch/src/DspSignal.cpp b/src/libs/DSPatch/src/DspSignal.cpp new file mode 100755 index 0000000..71fce1b --- /dev/null +++ b/src/libs/DSPatch/src/DspSignal.cpp @@ -0,0 +1,85 @@ +/************************************************************************ +DSPatch - Cross-Platform, Object-Oriented, Flow-Based Programming Library +Copyright (c) 2012-2015 Marcus Tomlinson + +This file is part of DSPatch. + +GNU Lesser General Public License Usage +This file may be used under the terms of the GNU Lesser General Public +License version 3.0 as published by the Free Software Foundation and +appearing in the file LGPLv3.txt included in the packaging of this +file. Please review the following information to ensure the GNU Lesser +General Public License version 3.0 requirements will be met: +http://www.gnu.org/copyleft/lgpl.html. + +Other Usage +Alternatively, this file may be used in accordance with the terms and +conditions contained in a signed written agreement between you and +Marcus Tomlinson. + +DSPatch is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +************************************************************************/ + +#include + +//================================================================================================= + +DspSignal::DspSignal(std::string signalName) + : _signalName(signalName) + , _valueAvailable(false) +{ +} + +//------------------------------------------------------------------------------------------------- + +DspSignal::~DspSignal() +{ +} + +//================================================================================================= + +bool DspSignal::SetSignal(DspSignal const* newSignal) +{ + if (newSignal != NULL) + { + if (newSignal->_valueAvailable == false) + { + return false; + } + else + { + _signalValue.CopyFrom(newSignal->_signalValue); + _valueAvailable = true; + return true; + } + } + else + { + return false; + } +} + +//------------------------------------------------------------------------------------------------- + +void DspSignal::ClearValue() +{ + _valueAvailable = false; +} + +//------------------------------------------------------------------------------------------------- + +const std::type_info& DspSignal::GetSignalType() const +{ + return _signalValue.GetType(); +} + +//------------------------------------------------------------------------------------------------- + +std::string DspSignal::GetSignalName() const +{ + return _signalName; +} + +//================================================================================================= diff --git a/src/libs/DSPatch/src/DspSignalBus.cpp b/src/libs/DSPatch/src/DspSignalBus.cpp new file mode 100755 index 0000000..df21f5c --- /dev/null +++ b/src/libs/DSPatch/src/DspSignalBus.cpp @@ -0,0 +1,203 @@ +/************************************************************************ +DSPatch - Cross-Platform, Object-Oriented, Flow-Based Programming Library +Copyright (c) 2012-2015 Marcus Tomlinson + +This file is part of DSPatch. + +GNU Lesser General Public License Usage +This file may be used under the terms of the GNU Lesser General Public +License version 3.0 as published by the Free Software Foundation and +appearing in the file LGPLv3.txt included in the packaging of this +file. Please review the following information to ensure the GNU Lesser +General Public License version 3.0 requirements will be met: +http://www.gnu.org/copyleft/lgpl.html. + +Other Usage +Alternatively, this file may be used in accordance with the terms and +conditions contained in a signed written agreement between you and +Marcus Tomlinson. + +DSPatch is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +************************************************************************/ + +#include + +//================================================================================================= + +DspSignalBus::~DspSignalBus() +{ +} + +//================================================================================================= + +bool DspSignalBus::SetSignal(int signalIndex, DspSignal const* newSignal) +{ + if ((size_t)signalIndex < _signals.size() && newSignal != NULL) + { + return _signals[signalIndex].SetSignal(newSignal); + } + else + { + return false; + } +} + +//------------------------------------------------------------------------------------------------- + +bool DspSignalBus::SetSignal(std::string const& signalName, DspSignal const* newSignal) +{ + int signalIndex; + + if (FindSignal(signalName, signalIndex) && newSignal != NULL) + { + return _signals[signalIndex].SetSignal(newSignal); + } + else + { + return false; + } +} + +//------------------------------------------------------------------------------------------------- + +DspSignal* DspSignalBus::GetSignal(int signalIndex) +{ + if ((size_t)signalIndex < _signals.size()) + { + return &_signals[signalIndex]; + } + else + { + return NULL; + } +} + +//------------------------------------------------------------------------------------------------- + +DspSignal* DspSignalBus::GetSignal(std::string const& signalName) +{ + int signalIndex; + + if (FindSignal(signalName, signalIndex)) + { + return &_signals[signalIndex]; + } + else + { + return NULL; + } +} + +//------------------------------------------------------------------------------------------------- + +bool DspSignalBus::FindSignal(std::string const& signalName, int& returnIndex) const +{ + if (signalName == "") + { + return false; + } + + for (size_t i = 0; i < _signals.size(); i++) + { + if (_signals[i].GetSignalName() == signalName) + { + returnIndex = i; + return true; + } + } + // if you get here the variable was not found. + return false; +} + +//------------------------------------------------------------------------------------------------- + +bool DspSignalBus::FindSignal(int signalIndex, int& returnIndex) const +{ + if ((size_t)signalIndex < _signals.size()) + { + returnIndex = signalIndex; + return true; + } + + return false; +} + +//------------------------------------------------------------------------------------------------- + +int DspSignalBus::GetSignalCount() const +{ + return _signals.size(); +} + +//------------------------------------------------------------------------------------------------- + +void DspSignalBus::ClearValue(int signalIndex) +{ + if ((size_t)signalIndex < _signals.size()) + { + return _signals[signalIndex].ClearValue(); + } +} + +//------------------------------------------------------------------------------------------------- + +void DspSignalBus::ClearValue(std::string const& signalName) +{ + int signalIndex; + + if (FindSignal(signalName, signalIndex)) + { + return _signals[signalIndex].ClearValue(); + } +} + +//------------------------------------------------------------------------------------------------- + +void DspSignalBus::ClearAllValues() +{ + for (size_t i = 0; i < _signals.size(); i++) + { + _signals[i].ClearValue(); + } +} + +//================================================================================================= + +bool DspSignalBus::_AddSignal(std::string const& signalName) +{ + if (signalName != "") + { + int signalIndex; + if (FindSignal(signalName, signalIndex)) // if the name already exists + { + return false; + } + } + + _signals.push_back(DspSignal(signalName)); + + return true; +} + +//------------------------------------------------------------------------------------------------- + +bool DspSignalBus::_RemoveSignal() +{ + if (_signals.size() > 0) + { + _signals.pop_back(); + return true; + } + return false; +} + +//------------------------------------------------------------------------------------------------- + +void DspSignalBus::_RemoveAllSignals() +{ + _signals.clear(); +} + +//================================================================================================= diff --git a/src/libs/DSPatch/src/DspWireBus.cpp b/src/libs/DSPatch/src/DspWireBus.cpp new file mode 100755 index 0000000..6a05e53 --- /dev/null +++ b/src/libs/DSPatch/src/DspWireBus.cpp @@ -0,0 +1,138 @@ +/************************************************************************ +DSPatch - Cross-Platform, Object-Oriented, Flow-Based Programming Library +Copyright (c) 2012-2015 Marcus Tomlinson + +This file is part of DSPatch. + +GNU Lesser General Public License Usage +This file may be used under the terms of the GNU Lesser General Public +License version 3.0 as published by the Free Software Foundation and +appearing in the file LGPLv3.txt included in the packaging of this +file. Please review the following information to ensure the GNU Lesser +General Public License version 3.0 requirements will be met: +http://www.gnu.org/copyleft/lgpl.html. + +Other Usage +Alternatively, this file may be used in accordance with the terms and +conditions contained in a signed written agreement between you and +Marcus Tomlinson. + +DSPatch is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +************************************************************************/ + +#include +#include +#include + +//================================================================================================= + +DspWireBus::DspWireBus(bool isLinkedComponentReceivingSignals) + : _isLinkedComponentReceivingSignals(isLinkedComponentReceivingSignals) +{ +} + +//------------------------------------------------------------------------------------------------- + +DspWireBus::~DspWireBus() +{ + RemoveAllWires(); +} + +//================================================================================================= + +bool DspWireBus::AddWire(DspComponent* linkedComponent, int fromSignalIndex, int toSignalIndex) +{ + for (size_t i = 0; i < _wires.size(); i++) + { + if (_wires[i].linkedComponent == linkedComponent && _wires[i].fromSignalIndex == fromSignalIndex && + _wires[i].toSignalIndex == toSignalIndex) + { + return false; // wire already exists + } + } + + for (size_t i = 0; i < _wires.size(); i++) + { + if (_isLinkedComponentReceivingSignals && _wires[i].linkedComponent == linkedComponent && + _wires[i].toSignalIndex == toSignalIndex) // if there's a wire to the receiving component's input already + { + RemoveWire(i); // remove the wire (only one wire can connect to an input at a time) + break; + } + else if (!_isLinkedComponentReceivingSignals && _wires[i].toSignalIndex == toSignalIndex) + { + RemoveWire(i); // remove the wire (only one wire can connect to an input at a time) + break; + } + } + + _wires.push_back(DspWire(linkedComponent, fromSignalIndex, toSignalIndex)); + + return true; +} + +//------------------------------------------------------------------------------------------------- + +bool DspWireBus::RemoveWire(DspComponent const* linkedComponent, int fromSignalIndex, int toSignalIndex) +{ + for (size_t i = 0; i < _wires.size(); i++) + { + if (_wires[i].linkedComponent == linkedComponent && _wires[i].fromSignalIndex == fromSignalIndex && + _wires[i].toSignalIndex == toSignalIndex) + { + RemoveWire(i); + return true; + } + } + + return false; +} + +//------------------------------------------------------------------------------------------------- + +bool DspWireBus::RemoveWire(int wireIndex) +{ + if ((size_t)wireIndex > _wires.size()) + { + return false; + } + + _wires.erase(_wires.begin() + wireIndex); + + return true; +} + +//------------------------------------------------------------------------------------------------- + +void DspWireBus::RemoveAllWires() +{ + for (size_t i = 0; i < _wires.size(); i++) + { + RemoveWire(i); + } +} + +//------------------------------------------------------------------------------------------------- + +DspWire* DspWireBus::GetWire(int wireIndex) +{ + if ((size_t)wireIndex < _wires.size()) + { + return &_wires[wireIndex]; + } + else + { + return NULL; + } +} + +//------------------------------------------------------------------------------------------------- + +int DspWireBus::GetWireCount() const +{ + return _wires.size(); +} + +//================================================================================================= diff --git a/src/mockDataSimulator/CMakeLists.txt b/src/mockDataSimulator/CMakeLists.txt new file mode 100644 index 0000000..af4e01a --- /dev/null +++ b/src/mockDataSimulator/CMakeLists.txt @@ -0,0 +1,2 @@ +set(SIMUL_SOURCE_FILES main.cpp main.cpp MockSensor.cpp MockSensor.h) +add_executable(simulator ${SIMUL_SOURCE_FILES}) \ No newline at end of file diff --git a/src/mockDataSimulator/MockSensor.cpp b/src/mockDataSimulator/MockSensor.cpp new file mode 100644 index 0000000..28d3f9c --- /dev/null +++ b/src/mockDataSimulator/MockSensor.cpp @@ -0,0 +1,42 @@ +// +// Created by Benjamin Rozière on 09/01/2018. +// + +#include +#include +#include +#include + +#include "MockSensor.h" + +std::mutex cout_mu; + +int MockSensor::NEXT_INT = 0; + +void MockSensor::run() { + thread_local std::random_device rd; + + thread_local std::mt19937 engine(rd()); + + thread_local std::uniform_int_distribution dist(0, 10); + + while (true) { + int val = dist(engine); + cout_mu.lock(); + this->output << this->id << ";" << val << std::endl; + cout_mu.unlock(); + std::this_thread::sleep_for(std::chrono::seconds(val)); + } +} + +int MockSensor::getId() { + return this->id; +} + +MockSensor::MockSensor() : MockSensor(NEXT_INT++, std::cout) {} + +MockSensor::MockSensor(int id) : MockSensor(id, std::cout) {} + +MockSensor::MockSensor(int id, std::ostream& str) : id(id), output(str) {} + +MockSensor::MockSensor(std::ostream& str) : MockSensor(NEXT_INT++, str) {} diff --git a/src/mockDataSimulator/MockSensor.h b/src/mockDataSimulator/MockSensor.h new file mode 100644 index 0000000..8009186 --- /dev/null +++ b/src/mockDataSimulator/MockSensor.h @@ -0,0 +1,29 @@ +// +// Created by Benjamin Rozière on 09/01/2018. +// + +#ifndef ORCHESTRA_MOCKSENSOR_H +#define ORCHESTRA_MOCKSENSOR_H + +#include + +class MockSensor { + +private: + static int NEXT_INT; + + int id; + std::ostream& output; + +public: + explicit MockSensor(); + explicit MockSensor(int); + explicit MockSensor(std::ostream&); + MockSensor(int, std::ostream&); + + int getId(); + void run(); +}; + + +#endif //ORCHESTRA_MOCKSENSOR_H diff --git a/src/mockDataSimulator/main.cpp b/src/mockDataSimulator/main.cpp new file mode 100644 index 0000000..ede572f --- /dev/null +++ b/src/mockDataSimulator/main.cpp @@ -0,0 +1,38 @@ +// +// Created by Benjamin Rozière on 09/01/2018. +// + +#include +#include + +#include "MockSensor.h" + +#define DEFAULT_SENSOR 2 +#define MAX_MOCK_SENSOR 50 + +int main(int argc, char **argv) { + + std::vector sensors; + std::vector threads; + + int nbSensors = DEFAULT_SENSOR; + + if (argc > 1) { + nbSensors = atoi(argv[1]); + } + + for (int i = 0; i < nbSensors; i++) { + + auto *s = new MockSensor(std::cerr); + + sensors.push_back(s); + + auto *t = new std::thread(&MockSensor::run, *s); + + threads.push_back(t); + } + + getchar(); + + return 0; +} \ No newline at end of file diff --git a/src/orchestra/CMakeLists.txt b/src/orchestra/CMakeLists.txt new file mode 100644 index 0000000..25574d3 --- /dev/null +++ b/src/orchestra/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.8) + +set(CMAKE_CXX_STANDARD 11) + +set(SOURCE_FILES main.cpp component/OrchAdderComponent.cpp component/OrchAdderComponent.h component/OrchSumComponent.cpp component/OrchSumComponent.h component/OrchStreamReaderComponent.cpp component/OrchStreamReaderComponent.h component/OrchStreamWriterComponent.cpp component/OrchStreamWriterComponent.h) + +add_executable(orchestra ${SOURCE_FILES}) + +target_link_libraries(orchestra DSPatch) \ No newline at end of file diff --git a/src/orchestra/component/OrchAdderComponent.cpp b/src/orchestra/component/OrchAdderComponent.cpp new file mode 100644 index 0000000..a991c47 --- /dev/null +++ b/src/orchestra/component/OrchAdderComponent.cpp @@ -0,0 +1,23 @@ +// +// Created by Benjamin Rozière on 10/01/2018. +// + +#include "OrchAdderComponent.h" + +OrchAdderComponent::OrchAdderComponent() { + AddInput_("Input1"); + AddInput_("Input2"); + + AddOutput_("Output1"); +} + +void OrchAdderComponent::Process_(DspSignalBus &inputs, DspSignalBus &outputs) { + + int input1 = 0; + int input2 = 0; + + if (inputs.GetValue("Input1", input1) && inputs.GetValue("Input2", input2)) { + outputs.SetValue("Output1", input1 + input2); + } + +} diff --git a/src/orchestra/component/OrchAdderComponent.h b/src/orchestra/component/OrchAdderComponent.h new file mode 100644 index 0000000..a3b011f --- /dev/null +++ b/src/orchestra/component/OrchAdderComponent.h @@ -0,0 +1,22 @@ +// +// Created by Benjamin Rozière on 10/01/2018. +// + +#ifndef ORCHESTRA_ORCHADDERCOMPONENT_H +#define ORCHESTRA_ORCHADDERCOMPONENT_H + + +#include + +class OrchAdderComponent : public DspComponent { + + +public: + OrchAdderComponent(); + +protected: + void Process_(DspSignalBus &, DspSignalBus &) override; +}; + + +#endif //ORCHESTRA_ORCHADDERCOMPONENT_H diff --git a/src/orchestra/component/OrchStreamReaderComponent.cpp b/src/orchestra/component/OrchStreamReaderComponent.cpp new file mode 100644 index 0000000..a9c9c78 --- /dev/null +++ b/src/orchestra/component/OrchStreamReaderComponent.cpp @@ -0,0 +1,21 @@ +// +// Created by Benjamin Rozière on 10/01/2018. +// + +#include "OrchStreamReaderComponent.h" + +OrchStreamReaderComponent::OrchStreamReaderComponent(std::istream &inputStream) : inputStream(inputStream) { + AddOutput_(); +} + +void OrchStreamReaderComponent::Process_(DspSignalBus &, DspSignalBus &outputs) { + + std::string line; + std::getline(inputStream, line); + + std::string token = line.substr(line.find(';'), line.size()); + + outputs.SetValue(0, std::stoi(token)); +} + + diff --git a/src/orchestra/component/OrchStreamReaderComponent.h b/src/orchestra/component/OrchStreamReaderComponent.h new file mode 100644 index 0000000..db63aa1 --- /dev/null +++ b/src/orchestra/component/OrchStreamReaderComponent.h @@ -0,0 +1,25 @@ +// +// Created by Benjamin Rozière on 10/01/2018. +// + +#ifndef ORCHESTRA_ORCHSTREAMREADERCOMPONENT_H +#define ORCHESTRA_ORCHSTREAMREADERCOMPONENT_H + + +#include +#include + +class OrchStreamReaderComponent : public DspComponent { + +public: + OrchStreamReaderComponent(std::istream &); + +protected: + void Process_(DspSignalBus &bus, DspSignalBus &signalBus) override; + +private: + std::istream& inputStream; +}; + + +#endif //ORCHESTRA_ORCHSTREAMREADERCOMPONENT_H diff --git a/src/orchestra/component/OrchStreamWriterComponent.cpp b/src/orchestra/component/OrchStreamWriterComponent.cpp new file mode 100644 index 0000000..da4b6f9 --- /dev/null +++ b/src/orchestra/component/OrchStreamWriterComponent.cpp @@ -0,0 +1,19 @@ +// +// Created by Benjamin Rozière on 10/01/2018. +// + +#include "OrchStreamWriterComponent.h" + +OrchStreamWriterComponent::OrchStreamWriterComponent(std::ostream &outputStream) : outputStream(outputStream) { + AddInput_(); +} + +void OrchStreamWriterComponent::Process_(DspSignalBus &inputs, DspSignalBus &) { + + std::string val; + + if (inputs.GetValue(0, val)) { + this->outputStream << val << std::endl; + } +} + diff --git a/src/orchestra/component/OrchStreamWriterComponent.h b/src/orchestra/component/OrchStreamWriterComponent.h new file mode 100644 index 0000000..0bb1df9 --- /dev/null +++ b/src/orchestra/component/OrchStreamWriterComponent.h @@ -0,0 +1,26 @@ +// +// Created by Benjamin Rozière on 10/01/2018. +// + +#ifndef ORCHESTRA_ORCHSTREAMWRITERCOMPONENT_H +#define ORCHESTRA_ORCHSTREAMWRITERCOMPONENT_H + + +#include +#include +#include + +class OrchStreamWriterComponent : public DspComponent { + +public: + OrchStreamWriterComponent(std::ostream&); + +protected: + void Process_(DspSignalBus &bus, DspSignalBus &signalBus) override; + +private: + std::ostream& outputStream; +}; + + +#endif //ORCHESTRA_ORCHSTREAMWRITERCOMPONENT_H diff --git a/src/orchestra/component/OrchSumComponent.cpp b/src/orchestra/component/OrchSumComponent.cpp new file mode 100644 index 0000000..6657239 --- /dev/null +++ b/src/orchestra/component/OrchSumComponent.cpp @@ -0,0 +1,23 @@ +// +// Created by Benjamin Rozière on 10/01/2018. +// + +#include "OrchSumComponent.h" + +OrchSumComponent::OrchSumComponent() : sum(0) { + AddInput_(); + + AddOutput_(); +} + +void OrchSumComponent::Process_(DspSignalBus &inputs, DspSignalBus &outputs) { + + int value; + + if (!inputs.GetValue(0, value)) { + this->sum += value; + outputs.SetValue(0, this->sum); + } + +} + diff --git a/src/orchestra/component/OrchSumComponent.h b/src/orchestra/component/OrchSumComponent.h new file mode 100644 index 0000000..faa959e --- /dev/null +++ b/src/orchestra/component/OrchSumComponent.h @@ -0,0 +1,25 @@ +// +// Created by Benjamin Rozière on 10/01/2018. +// + +#ifndef ORCHESTRA_ORCHSUMCOMPONENT_H +#define ORCHESTRA_ORCHSUMCOMPONENT_H + + +#include + +class OrchSumComponent : public DspComponent { + +public: + OrchSumComponent(); + +protected: + void Process_(DspSignalBus &bus, DspSignalBus &signalBus) override; + +private: + long int sum; + +}; + + +#endif //ORCHESTRA_ORCHSUMCOMPONENT_H diff --git a/src/orchestra/main.cpp b/src/orchestra/main.cpp new file mode 100644 index 0000000..4795fe5 --- /dev/null +++ b/src/orchestra/main.cpp @@ -0,0 +1,39 @@ +// +// Created by Benjamin Rozière on 09/01/2018. +// + +#include + +#include + +#include "component/OrchSumComponent.h" +#include "component/OrchStreamReaderComponent.h" +#include "component/OrchStreamWriterComponent.h" + +int main() { + + DspCircuit circuit; + + OrchStreamReaderComponent reader(std::cin); + + OrchSumComponent sum; + + OrchStreamWriterComponent writer(std::cout); + + circuit.AddComponent(reader, "Reader"); + circuit.AddComponent(sum, "Sum"); + circuit.AddComponent(writer, "Writer"); + + circuit.ConnectOutToIn(reader, 0, sum, 0); + circuit.ConnectOutToIn(sum, 0, writer, 0); + + for (int i = 0; i < 10; i++) { + circuit.Tick(); + } + + getchar(); + + DSPatch::Finalize(); + + return EXIT_SUCCESS; +} From f208adb9023eae52edde9099d823971c2fdb8cab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Rozie=CC=80re?= Date: Wed, 17 Jan 2018 11:19:20 +0100 Subject: [PATCH 02/12] Fix bad header --- src/orchestra/component/OrchStreamReaderComponent.cpp | 2 +- src/orchestra/component/OrchStreamReaderComponent.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/orchestra/component/OrchStreamReaderComponent.cpp b/src/orchestra/component/OrchStreamReaderComponent.cpp index a9c9c78..4514fd6 100644 --- a/src/orchestra/component/OrchStreamReaderComponent.cpp +++ b/src/orchestra/component/OrchStreamReaderComponent.cpp @@ -1,7 +1,7 @@ // // Created by Benjamin Rozière on 10/01/2018. // - +#include #include "OrchStreamReaderComponent.h" OrchStreamReaderComponent::OrchStreamReaderComponent(std::istream &inputStream) : inputStream(inputStream) { diff --git a/src/orchestra/component/OrchStreamReaderComponent.h b/src/orchestra/component/OrchStreamReaderComponent.h index db63aa1..13174ba 100644 --- a/src/orchestra/component/OrchStreamReaderComponent.h +++ b/src/orchestra/component/OrchStreamReaderComponent.h @@ -6,7 +6,6 @@ #define ORCHESTRA_ORCHSTREAMREADERCOMPONENT_H -#include #include class OrchStreamReaderComponent : public DspComponent { From 48feabb8e74f966526c612d9d165e3d9dc50c727 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Rozie=CC=80re?= Date: Tue, 23 Jan 2018 14:46:29 +0100 Subject: [PATCH 03/12] Add mosquitto lib and component --- CMakeLists.txt | 7 + src/libs/mosquitto/CMakeCache.txt | 422 ++++ .../CMakeFiles/3.10.1/CMakeCCompiler.cmake | 73 + .../CMakeFiles/3.10.1/CMakeCXXCompiler.cmake | 75 + .../3.10.1/CMakeDetermineCompilerABI_C.bin | Bin 0 -> 4304 bytes .../3.10.1/CMakeDetermineCompilerABI_CXX.bin | Bin 0 -> 4288 bytes .../CMakeFiles/3.10.1/CMakeSystem.cmake | 15 + .../3.10.1/CompilerIdC/CMakeCCompilerId.c | 598 ++++++ .../CompilerIdCXX/CMakeCXXCompilerId.cpp | 576 ++++++ .../CMakeDirectoryInformation.cmake | 16 + src/libs/mosquitto/CMakeFiles/CMakeError.log | 16 + src/libs/mosquitto/CMakeFiles/CMakeOutput.log | 528 +++++ src/libs/mosquitto/CMakeFiles/Makefile.cmake | 65 + src/libs/mosquitto/CMakeFiles/Makefile2 | 350 ++++ .../CMakeFiles/TargetDirectories.txt | 41 + .../mosquitto/CMakeFiles/cmake.check_cache | 1 + .../mosquitto/CMakeFiles/feature_tests.bin | Bin 0 -> 8376 bytes src/libs/mosquitto/CMakeFiles/feature_tests.c | 34 + .../mosquitto/CMakeFiles/feature_tests.cxx | 405 ++++ src/libs/mosquitto/CMakeFiles/progress.marks | 1 + src/libs/mosquitto/CMakeLists.txt | 95 + src/libs/mosquitto/CONTRIBUTING.md | 91 + src/libs/mosquitto/ChangeLog.txt | 1542 ++++++++++++++ src/libs/mosquitto/LICENSE.txt | 2 + src/libs/mosquitto/Makefile | 254 +++ src/libs/mosquitto/about.html | 41 + src/libs/mosquitto/aclfile.example | 9 + .../CMakeDirectoryInformation.cmake | 16 + .../mosquitto_pub.dir/C.includecache | 60 + .../mosquitto_pub.dir/DependInfo.cmake | 31 + .../CMakeFiles/mosquitto_pub.dir/build.make | 141 ++ .../mosquitto_pub.dir/cmake_clean.cmake | 11 + .../mosquitto_pub.dir/depend.internal | 11 + .../CMakeFiles/mosquitto_pub.dir/depend.make | 11 + .../CMakeFiles/mosquitto_pub.dir/flags.make | 10 + .../CMakeFiles/mosquitto_pub.dir/link.txt | 1 + .../mosquitto_pub.dir/progress.make | 4 + .../mosquitto_sub.dir/C.includecache | 60 + .../mosquitto_sub.dir/DependInfo.cmake | 31 + .../CMakeFiles/mosquitto_sub.dir/build.make | 141 ++ .../mosquitto_sub.dir/cmake_clean.cmake | 11 + .../mosquitto_sub.dir/depend.internal | 11 + .../CMakeFiles/mosquitto_sub.dir/depend.make | 11 + .../CMakeFiles/mosquitto_sub.dir/flags.make | 10 + .../CMakeFiles/mosquitto_sub.dir/link.txt | 1 + .../mosquitto_sub.dir/progress.make | 4 + .../client/CMakeFiles/progress.marks | 1 + src/libs/mosquitto/client/CMakeLists.txt | 18 + src/libs/mosquitto/client/Makefile | 309 +++ src/libs/mosquitto/client/client_shared.c | 973 +++++++++ src/libs/mosquitto/client/client_shared.h | 97 + src/libs/mosquitto/client/cmake_install.cmake | 72 + src/libs/mosquitto/client/mosquitto_pub | Bin 0 -> 37740 bytes src/libs/mosquitto/client/mosquitto_sub | Bin 0 -> 37212 bytes src/libs/mosquitto/client/pub_client.c | 447 ++++ src/libs/mosquitto/client/sub_client.c | 277 +++ src/libs/mosquitto/cmake_install.cmake | 62 + src/libs/mosquitto/compiling.txt | 19 + src/libs/mosquitto/config.h | 30 + src/libs/mosquitto/config.mk | 255 +++ src/libs/mosquitto/edl-v10 | 31 + src/libs/mosquitto/epl-v10 | 221 ++ .../mosquitto/examples/mysql_log/Makefile | 15 + .../mosquitto/examples/mysql_log/mysql_log.c | 118 ++ .../examples/temperature_conversion/Makefile | 18 + .../examples/temperature_conversion/main.cpp | 23 + .../temperature_conversion/readme.txt | 6 + .../temperature_conversion.cpp | 49 + .../temperature_conversion.h | 17 + src/libs/mosquitto/install_manifest.txt | 24 + .../mosquitto/installer/mosquitto-cygwin.nsi | 137 ++ src/libs/mosquitto/installer/mosquitto.nsi | 163 ++ .../CMakeDirectoryInformation.cmake | 16 + .../libmosquitto.dir/C.includecache | 588 ++++++ .../libmosquitto.dir/DependInfo.cmake | 54 + .../CMakeFiles/libmosquitto.dir/build.make | 552 +++++ .../libmosquitto.dir/cmake_clean.cmake | 28 + .../libmosquitto.dir/depend.internal | 188 ++ .../CMakeFiles/libmosquitto.dir/depend.make | 188 ++ .../CMakeFiles/libmosquitto.dir/flags.make | 10 + .../lib/CMakeFiles/libmosquitto.dir/link.txt | 1 + .../CMakeFiles/libmosquitto.dir/progress.make | 19 + .../mosquitto/lib/CMakeFiles/progress.marks | 1 + src/libs/mosquitto/lib/CMakeLists.txt | 86 + src/libs/mosquitto/lib/Makefile | 710 +++++++ src/libs/mosquitto/lib/cmake_install.cmake | 77 + .../CMakeDirectoryInformation.cmake | 16 + .../mosquittopp.dir/CXX.includecache | 28 + .../mosquittopp.dir/DependInfo.cmake | 38 + .../cpp/CMakeFiles/mosquittopp.dir/build.make | 121 ++ .../mosquittopp.dir/cmake_clean.cmake | 12 + .../mosquittopp.dir/depend.internal | 7 + .../CMakeFiles/mosquittopp.dir/depend.make | 7 + .../cpp/CMakeFiles/mosquittopp.dir/flags.make | 10 + .../cpp/CMakeFiles/mosquittopp.dir/link.txt | 1 + .../CMakeFiles/mosquittopp.dir/progress.make | 3 + .../lib/cpp/CMakeFiles/progress.marks | 1 + src/libs/mosquitto/lib/cpp/CMakeLists.txt | 18 + src/libs/mosquitto/lib/cpp/Makefile | 230 +++ .../mosquitto/lib/cpp/cmake_install.cmake | 72 + src/libs/mosquitto/lib/cpp/mosquittopp.cpp | 308 +++ src/libs/mosquitto/lib/cpp/mosquittopp.h | 106 + src/libs/mosquitto/lib/dummypthread.h | 13 + src/libs/mosquitto/lib/linker.version | 80 + src/libs/mosquitto/lib/logging_mosq.c | 56 + src/libs/mosquitto/lib/logging_mosq.h | 23 + src/libs/mosquitto/lib/memory_mosq.c | 124 ++ src/libs/mosquitto/lib/memory_mosq.h | 37 + src/libs/mosquitto/lib/messages_mosq.c | 399 ++++ src/libs/mosquitto/lib/messages_mosq.h | 31 + src/libs/mosquitto/lib/mosquitto.c | 1431 +++++++++++++ src/libs/mosquitto/lib/mosquitto.h | 1535 ++++++++++++++ src/libs/mosquitto/lib/mosquitto_internal.h | 279 +++ src/libs/mosquitto/lib/mqtt3_protocol.h | 53 + src/libs/mosquitto/lib/net_mosq.c | 1307 ++++++++++++ src/libs/mosquitto/lib/net_mosq.h | 95 + src/libs/mosquitto/lib/read_handle.c | 155 ++ src/libs/mosquitto/lib/read_handle.h | 38 + src/libs/mosquitto/lib/read_handle_client.c | 60 + src/libs/mosquitto/lib/read_handle_shared.c | 242 +++ src/libs/mosquitto/lib/send_client_mosq.c | 246 +++ src/libs/mosquitto/lib/send_mosq.c | 282 +++ src/libs/mosquitto/lib/send_mosq.h | 37 + src/libs/mosquitto/lib/socks_mosq.c | 396 ++++ src/libs/mosquitto/lib/socks_mosq.h | 23 + src/libs/mosquitto/lib/srv_mosq.c | 100 + src/libs/mosquitto/lib/thread_mosq.c | 116 ++ src/libs/mosquitto/lib/time_mosq.c | 82 + src/libs/mosquitto/lib/time_mosq.h | 22 + src/libs/mosquitto/lib/tls_mosq.c | 167 ++ src/libs/mosquitto/lib/tls_mosq.h | 42 + src/libs/mosquitto/lib/util_mosq.c | 420 ++++ src/libs/mosquitto/lib/util_mosq.h | 41 + src/libs/mosquitto/lib/will_mosq.c | 101 + src/libs/mosquitto/lib/will_mosq.h | 26 + .../mosquitto/logo/legacy/mosquitto-14x14.png | Bin 0 -> 513 bytes .../mosquitto/logo/legacy/mosquitto-16x16.png | Bin 0 -> 566 bytes src/libs/mosquitto/logo/legacy/mosquitto.svg | 182 ++ .../mosquitto/logo/mosquitto-logo-min.svg | 65 + .../mosquitto/logo/mosquitto-logo-only.svg | 60 + .../mosquitto/logo/mosquitto-text-below.svg | 66 + .../mosquitto/logo/mosquitto-text-side.svg | 66 + src/libs/mosquitto/logo/mosquitto.ico | Bin 0 -> 34572 bytes .../CMakeDirectoryInformation.cmake | 16 + .../mosquitto/man/CMakeFiles/progress.marks | 1 + src/libs/mosquitto/man/CMakeLists.txt | 5 + src/libs/mosquitto/man/Makefile | 184 ++ src/libs/mosquitto/man/cmake_install.cmake | 61 + src/libs/mosquitto/man/html.xsl | 12 + src/libs/mosquitto/man/libmosquitto.3 | 250 +++ src/libs/mosquitto/man/libmosquitto.3.xml | 475 +++++ src/libs/mosquitto/man/manpage.xsl | 14 + src/libs/mosquitto/man/mosquitto-tls.7 | 164 ++ src/libs/mosquitto/man/mosquitto-tls.7.xml | 100 + src/libs/mosquitto/man/mosquitto.8 | 470 +++++ src/libs/mosquitto/man/mosquitto.8.xml | 548 +++++ src/libs/mosquitto/man/mosquitto.conf.5 | 1162 +++++++++++ src/libs/mosquitto/man/mosquitto.conf.5.xml | 1468 +++++++++++++ src/libs/mosquitto/man/mosquitto_passwd.1 | 125 ++ src/libs/mosquitto/man/mosquitto_passwd.1.xml | 158 ++ src/libs/mosquitto/man/mosquitto_pub.1 | 430 ++++ src/libs/mosquitto/man/mosquitto_pub.1.xml | 522 +++++ src/libs/mosquitto/man/mosquitto_sub.1 | 410 ++++ src/libs/mosquitto/man/mosquitto_sub.1.xml | 555 +++++ src/libs/mosquitto/man/mqtt.7 | 293 +++ src/libs/mosquitto/man/mqtt.7.xml | 187 ++ .../misc/currentcost/cc128_log_mysql.pl | 55 + .../mosquitto/misc/currentcost/cc128_parse.pl | 45 + .../mosquitto/misc/currentcost/cc128_read.pl | 23 + .../mosquitto/misc/currentcost/cc128_read.py | 22 + .../gnome-panel/CurrentCostMQTT.py | 65 + .../gnome-panel/CurrentCostMQTT.server | 28 + .../currentcost/gnome-panel/currentcost.png | Bin 0 -> 5316 bytes src/libs/mosquitto/mosquitto.conf | 837 ++++++++ src/libs/mosquitto/notice.html | 108 + src/libs/mosquitto/pskfile.example | 2 + src/libs/mosquitto/pwfile.example | 3 + src/libs/mosquitto/readme-windows.txt | 70 + src/libs/mosquitto/readme.md | 79 + .../mosquitto/security/mosquitto.apparmor | 27 + .../mosquitto/service/monit/mosquitto.monit | 4 + src/libs/mosquitto/service/svscan/run | 3 + .../mosquitto/service/upstart/mosquitto.conf | 8 + .../CMakeDirectoryInformation.cmake | 16 + .../CMakeFiles/mosquitto.dir/C.includecache | 908 ++++++++ .../CMakeFiles/mosquitto.dir/DependInfo.cmake | 62 + .../src/CMakeFiles/mosquitto.dir/build.make | 815 ++++++++ .../mosquitto.dir/cmake_clean.cmake | 36 + .../CMakeFiles/mosquitto.dir/depend.internal | 382 ++++ .../src/CMakeFiles/mosquitto.dir/depend.make | 382 ++++ .../src/CMakeFiles/mosquitto.dir/flags.make | 10 + .../src/CMakeFiles/mosquitto.dir/link.txt | 1 + .../CMakeFiles/mosquitto.dir/progress.make | 29 + .../mosquitto_passwd.dir/DependInfo.cmake | 40 + .../mosquitto_passwd.dir/build.make | 115 ++ .../mosquitto_passwd.dir/cmake_clean.cmake | 10 + .../mosquitto_passwd.dir/depend.make | 2 + .../mosquitto_passwd.dir/flags.make | 10 + .../CMakeFiles/mosquitto_passwd.dir/link.txt | 1 + .../mosquitto_passwd.dir/progress.make | 3 + .../mosquitto/src/CMakeFiles/progress.marks | 1 + src/libs/mosquitto/src/CMakeLists.txt | 146 ++ src/libs/mosquitto/src/Makefile | 1010 +++++++++ src/libs/mosquitto/src/bridge.c | 429 ++++ src/libs/mosquitto/src/cmake_install.cmake | 55 + src/libs/mosquitto/src/conf.c | 1835 +++++++++++++++++ src/libs/mosquitto/src/context.c | 233 +++ src/libs/mosquitto/src/database.c | 946 +++++++++ src/libs/mosquitto/src/db_dump/Makefile | 16 + src/libs/mosquitto/src/db_dump/db_dump.c | 426 ++++ src/libs/mosquitto/src/lib_load.h | 37 + src/libs/mosquitto/src/linker-macosx.syms | 1 + src/libs/mosquitto/src/linker.syms | 3 + src/libs/mosquitto/src/logging.c | 276 +++ src/libs/mosquitto/src/loop.c | 556 +++++ src/libs/mosquitto/src/mosquitto | Bin 0 -> 213200 bytes src/libs/mosquitto/src/mosquitto.c | 488 +++++ src/libs/mosquitto/src/mosquitto_broker.h | 517 +++++ src/libs/mosquitto/src/mosquitto_passwd.c | 513 +++++ src/libs/mosquitto/src/mosquitto_plugin.h | 228 ++ src/libs/mosquitto/src/net.c | 532 +++++ src/libs/mosquitto/src/persist.c | 929 +++++++++ src/libs/mosquitto/src/persist.h | 35 + src/libs/mosquitto/src/read_handle.c | 283 +++ src/libs/mosquitto/src/read_handle_client.c | 114 + src/libs/mosquitto/src/read_handle_server.c | 811 ++++++++ src/libs/mosquitto/src/security.c | 274 +++ src/libs/mosquitto/src/security_default.c | 851 ++++++++ src/libs/mosquitto/src/send_server.c | 76 + src/libs/mosquitto/src/service.c | 143 ++ src/libs/mosquitto/src/subs.c | 766 +++++++ src/libs/mosquitto/src/sys_tree.c | 333 +++ src/libs/mosquitto/src/uthash.h | 948 +++++++++ src/libs/mosquitto/src/websockets.c | 693 +++++++ src/libs/mosquitto/test/Makefile | 91 + .../test/broker/01-connect-anon-denied.conf | 3 + .../test/broker/01-connect-anon-denied.pwfile | 1 + .../test/broker/01-connect-anon-denied.py | 32 + .../broker/01-connect-invalid-id-0-311.py | 32 + .../test/broker/01-connect-invalid-id-0.py | 32 + .../broker/01-connect-invalid-id-missing.py | 31 + .../broker/01-connect-invalid-protonum.py | 34 + .../broker/01-connect-invalid-reserved.py | 33 + .../test/broker/01-connect-success.py | 34 + .../01-connect-uname-no-password-denied.conf | 3 + ...01-connect-uname-no-password-denied.pwfile | 1 + .../01-connect-uname-no-password-denied.py | 33 + .../01-connect-uname-password-denied.conf | 3 + .../01-connect-uname-password-denied.pwfile | 1 + .../01-connect-uname-password-denied.py | 34 + ...connect-uname-password-success-no-tls.conf | 3 + ...nnect-uname-password-success-no-tls.pwfile | 1 + ...1-connect-uname-password-success-no-tls.py | 34 + .../01-connect-uname-password-success.conf | 3 + .../01-connect-uname-password-success.pwfile | 1 + .../01-connect-uname-password-success.py | 34 + .../mosquitto/test/broker/02-subpub-qos0.py | 46 + .../mosquitto/test/broker/02-subpub-qos1.py | 53 + .../mosquitto/test/broker/02-subpub-qos2.py | 64 + .../test/broker/02-subscribe-qos0.py | 44 + .../test/broker/02-subscribe-qos1.py | 41 + .../test/broker/02-subscribe-qos2.py | 41 + .../test/broker/02-unsubscribe-qos0.py | 42 + .../test/broker/02-unsubscribe-qos1.py | 41 + .../test/broker/02-unsubscribe-qos2.py | 41 + .../test/broker/03-pattern-matching-helper.py | 24 + .../test/broker/03-pattern-matching.py | 89 + .../03-publish-b2c-disconnect-qos1-helper.py | 29 + .../03-publish-b2c-disconnect-qos1.conf | 3 + .../broker/03-publish-b2c-disconnect-qos1.py | 69 + .../03-publish-b2c-disconnect-qos2-helper.py | 36 + .../03-publish-b2c-disconnect-qos2.conf | 3 + .../broker/03-publish-b2c-disconnect-qos2.py | 73 + .../03-publish-b2c-timeout-qos1-helper.py | 31 + .../broker/03-publish-b2c-timeout-qos1.conf | 3 + .../broker/03-publish-b2c-timeout-qos1.py | 57 + .../03-publish-b2c-timeout-qos2-helper.py | 36 + .../broker/03-publish-b2c-timeout-qos2.conf | 3 + .../broker/03-publish-b2c-timeout-qos2.py | 66 + .../03-publish-c2b-disconnect-qos2.conf | 2 + .../broker/03-publish-c2b-disconnect-qos2.py | 67 + .../broker/03-publish-c2b-timeout-qos2.conf | 2 + .../broker/03-publish-c2b-timeout-qos2.py | 50 + .../mosquitto/test/broker/03-publish-qos1.py | 41 + .../mosquitto/test/broker/03-publish-qos2.py | 46 + .../test/broker/04-retain-qos0-clear.py | 72 + .../test/broker/04-retain-qos0-fresh.py | 46 + .../test/broker/04-retain-qos0-repeated.py | 55 + .../mosquitto/test/broker/04-retain-qos0.py | 43 + .../test/broker/04-retain-qos1-qos0.py | 50 + .../broker/05-clean-session-qos1-helper.py | 31 + .../test/broker/05-clean-session-qos1.py | 59 + .../06-bridge-b2br-disconnect-qos1.conf | 9 + .../broker/06-bridge-b2br-disconnect-qos1.py | 90 + .../06-bridge-b2br-disconnect-qos2.conf | 11 + .../broker/06-bridge-b2br-disconnect-qos2.py | 107 + .../06-bridge-br2b-disconnect-qos1-helper.py | 29 + .../06-bridge-br2b-disconnect-qos1.conf | 10 + .../broker/06-bridge-br2b-disconnect-qos1.py | 87 + .../06-bridge-br2b-disconnect-qos2-helper.py | 34 + .../06-bridge-br2b-disconnect-qos2.conf | 11 + .../broker/06-bridge-br2b-disconnect-qos2.py | 109 + .../06-bridge-fail-persist-resend-qos1.conf | 11 + .../06-bridge-fail-persist-resend-qos1.py | 77 + .../06-bridge-fail-persist-resend-qos2.conf | 11 + .../06-bridge-fail-persist-resend-qos2.py | 90 + .../06-bridge-reconnect-local-out-helper.py | 31 + .../broker/06-bridge-reconnect-local-out.conf | 9 + .../broker/06-bridge-reconnect-local-out.py | 91 + .../test/broker/07-will-null-helper.py | 23 + .../test/broker/07-will-null-topic.py | 33 + .../mosquitto/test/broker/07-will-null.py | 48 + .../test/broker/07-will-qos0-helper.py | 23 + .../mosquitto/test/broker/07-will-qos0.py | 49 + .../test/broker/08-ssl-bridge-helper.py | 25 + .../mosquitto/test/broker/08-ssl-bridge.conf | 12 + .../mosquitto/test/broker/08-ssl-bridge.py | 67 + .../broker/08-ssl-connect-cert-auth-crl.conf | 9 + .../broker/08-ssl-connect-cert-auth-crl.py | 45 + .../08-ssl-connect-cert-auth-expired.conf | 8 + .../08-ssl-connect-cert-auth-expired.py | 51 + .../08-ssl-connect-cert-auth-revoked.conf | 9 + .../08-ssl-connect-cert-auth-revoked.py | 50 + .../08-ssl-connect-cert-auth-without.conf | 8 + .../08-ssl-connect-cert-auth-without.py | 50 + .../test/broker/08-ssl-connect-cert-auth.conf | 9 + .../test/broker/08-ssl-connect-cert-auth.py | 47 + .../test/broker/08-ssl-connect-identity.conf | 10 + .../test/broker/08-ssl-connect-identity.py | 48 + .../08-ssl-connect-no-auth-wrong-ca.conf | 7 + .../broker/08-ssl-connect-no-auth-wrong-ca.py | 47 + .../test/broker/08-ssl-connect-no-auth.conf | 7 + .../test/broker/08-ssl-connect-no-auth.py | 47 + .../broker/08-ssl-connect-no-identity.conf | 9 + .../test/broker/08-ssl-connect-no-identity.py | 48 + .../test/broker/08-tls-psk-bridge.conf | 12 + .../test/broker/08-tls-psk-bridge.conf2 | 13 + .../test/broker/08-tls-psk-bridge.psk | 1 + .../test/broker/08-tls-psk-bridge.py | 80 + .../mosquitto/test/broker/08-tls-psk-pub.conf | 14 + .../mosquitto/test/broker/08-tls-psk-pub.psk | 1 + .../mosquitto/test/broker/08-tls-psk-pub.py | 66 + .../broker/09-plugin-auth-unpwd-fail.conf | 3 + .../test/broker/09-plugin-auth-unpwd-fail.py | 34 + .../broker/09-plugin-auth-unpwd-success.conf | 3 + .../broker/09-plugin-auth-unpwd-success.py | 34 + .../broker/10-listener-mount-point-helper.py | 24 + .../test/broker/10-listener-mount-point.conf | 7 + .../test/broker/10-listener-mount-point.py | 47 + src/libs/mosquitto/test/broker/Makefile | 102 + .../test/broker/c/08-tls-psk-bridge.c | 63 + .../mosquitto/test/broker/c/08-tls-psk-pub.c | 67 + src/libs/mosquitto/test/broker/c/Makefile | 23 + .../mosquitto/test/broker/c/auth_plugin.c | 55 + src/libs/mosquitto/test/broker/readme.txt | 14 + src/libs/mosquitto/test/fake_user.c | 114 + .../test/lib/01-con-discon-success.py | 63 + .../test/lib/01-keepalive-pingreq.py | 68 + .../mosquitto/test/lib/01-no-clean-session.py | 54 + src/libs/mosquitto/test/lib/01-unpwd-set.py | 54 + src/libs/mosquitto/test/lib/01-will-set.py | 56 + .../mosquitto/test/lib/01-will-unpwd-set.py | 58 + .../mosquitto/test/lib/02-subscribe-qos0.py | 73 + .../mosquitto/test/lib/02-subscribe-qos1.py | 73 + .../mosquitto/test/lib/02-subscribe-qos2.py | 73 + src/libs/mosquitto/test/lib/02-unsubscribe.py | 63 + .../mosquitto/test/lib/03-publish-b2c-qos1.py | 81 + .../mosquitto/test/lib/03-publish-b2c-qos2.py | 94 + .../lib/03-publish-c2b-qos1-disconnect.py | 75 + .../test/lib/03-publish-c2b-qos1-timeout.py | 81 + .../lib/03-publish-c2b-qos2-disconnect.py | 90 + .../test/lib/03-publish-c2b-qos2-timeout.py | 91 + .../mosquitto/test/lib/03-publish-c2b-qos2.py | 87 + .../test/lib/03-publish-qos0-no-payload.py | 67 + .../mosquitto/test/lib/03-publish-qos0.py | 67 + src/libs/mosquitto/test/lib/04-retain-qos0.py | 57 + .../mosquitto/test/lib/08-ssl-bad-cacert.py | 34 + .../test/lib/08-ssl-connect-cert-auth-enc.py | 71 + .../test/lib/08-ssl-connect-cert-auth.py | 71 + .../test/lib/08-ssl-connect-no-auth.py | 68 + .../mosquitto/test/lib/08-ssl-fake-cacert.py | 60 + .../test/lib/09-util-topic-matching.py | 29 + .../test/lib/09-util-topic-tokenise.py | 26 + src/libs/mosquitto/test/lib/Makefile | 53 + .../test/lib/c/01-con-discon-success.c | 41 + .../test/lib/c/01-keepalive-pingreq.c | 33 + .../test/lib/c/01-no-clean-session.c | 25 + src/libs/mosquitto/test/lib/c/01-unpwd-set.c | 26 + src/libs/mosquitto/test/lib/c/01-will-set.c | 26 + .../mosquitto/test/lib/c/01-will-unpwd-set.c | 27 + .../mosquitto/test/lib/c/02-subscribe-qos0.c | 47 + .../mosquitto/test/lib/c/02-subscribe-qos1.c | 47 + .../mosquitto/test/lib/c/02-subscribe-qos2.c | 47 + .../mosquitto/test/lib/c/02-unsubscribe.c | 47 + .../test/lib/c/03-publish-b2c-qos1.c | 64 + .../test/lib/c/03-publish-b2c-qos2.c | 66 + .../lib/c/03-publish-c2b-qos1-disconnect.c | 57 + .../test/lib/c/03-publish-c2b-qos1-timeout.c | 49 + .../lib/c/03-publish-c2b-qos2-disconnect.c | 57 + .../test/lib/c/03-publish-c2b-qos2-timeout.c | 49 + .../test/lib/c/03-publish-c2b-qos2.c | 48 + .../test/lib/c/03-publish-qos0-no-payload.c | 48 + .../mosquitto/test/lib/c/03-publish-qos0.c | 48 + .../mosquitto/test/lib/c/04-retain-qos0.c | 36 + .../mosquitto/test/lib/c/08-ssl-bad-cacert.c | 21 + .../test/lib/c/08-ssl-connect-cert-auth-enc.c | 53 + .../test/lib/c/08-ssl-connect-cert-auth.c | 44 + .../test/lib/c/08-ssl-connect-no-auth.c | 45 + .../mosquitto/test/lib/c/08-ssl-fake-cacert.c | 35 + .../test/lib/c/09-util-topic-matching.c | 58 + .../test/lib/c/09-util-topic-tokenise.c | 130 ++ src/libs/mosquitto/test/lib/c/Makefile | 105 + .../test/lib/cpp/01-con-discon-success.cpp | 53 + .../test/lib/cpp/01-keepalive-pingreq.cpp | 41 + .../test/lib/cpp/01-no-clean-session.cpp | 33 + .../mosquitto/test/lib/cpp/01-unpwd-set.cpp | 34 + .../mosquitto/test/lib/cpp/01-will-set.cpp | 37 + .../test/lib/cpp/01-will-unpwd-set.cpp | 35 + .../test/lib/cpp/02-subscribe-qos0.cpp | 55 + .../test/lib/cpp/02-subscribe-qos1.cpp | 56 + .../test/lib/cpp/02-subscribe-qos2.cpp | 56 + .../mosquitto/test/lib/cpp/02-unsubscribe.cpp | 55 + .../test/lib/cpp/03-publish-b2c-qos1.cpp | 76 + .../test/lib/cpp/03-publish-b2c-qos2.cpp | 78 + .../cpp/03-publish-c2b-qos1-disconnect.cpp | 68 + .../lib/cpp/03-publish-c2b-qos1-timeout.cpp | 60 + .../cpp/03-publish-c2b-qos2-disconnect.cpp | 68 + .../lib/cpp/03-publish-c2b-qos2-timeout.cpp | 60 + .../test/lib/cpp/03-publish-c2b-qos2.cpp | 59 + .../lib/cpp/03-publish-qos0-no-payload.cpp | 56 + .../test/lib/cpp/03-publish-qos0.cpp | 56 + .../mosquitto/test/lib/cpp/04-retain-qos0.cpp | 45 + .../test/lib/cpp/08-ssl-bad-cacert.cpp | 31 + .../lib/cpp/08-ssl-connect-cert-auth-enc.cpp | 62 + .../test/lib/cpp/08-ssl-connect-cert-auth.cpp | 53 + .../test/lib/cpp/08-ssl-connect-no-auth.cpp | 53 + .../test/lib/cpp/08-ssl-fake-cacert.cpp | 42 + .../test/lib/cpp/09-util-topic-matching.cpp | 47 + .../test/lib/cpp/09-util-topic-tokenise.cpp | 129 ++ src/libs/mosquitto/test/lib/cpp/Makefile | 105 + src/libs/mosquitto/test/mosq_test.py | 401 ++++ src/libs/mosquitto/test/msgsps_common.h | 3 + src/libs/mosquitto/test/msgsps_pub.c | 135 ++ src/libs/mosquitto/test/msgsps_sub.c | 86 + src/libs/mosquitto/test/packet-gen.c | 53 + src/libs/mosquitto/test/qos.c | 186 ++ src/libs/mosquitto/test/random_client.c | 198 ++ src/libs/mosquitto/test/ssl/all-ca.crt | 75 + .../mosquitto/test/ssl/client-encrypted.crt | 59 + .../mosquitto/test/ssl/client-encrypted.key | 18 + .../mosquitto/test/ssl/client-expired.crt | 61 + .../mosquitto/test/ssl/client-revoked.crt | 61 + .../mosquitto/test/ssl/client-revoked.csr | 12 + .../mosquitto/test/ssl/client-revoked.key | 15 + src/libs/mosquitto/test/ssl/client.crt | 61 + src/libs/mosquitto/test/ssl/client.csr | 12 + src/libs/mosquitto/test/ssl/client.key | 15 + src/libs/mosquitto/test/ssl/crl.pem | 10 + src/libs/mosquitto/test/ssl/demoCA/crlnumber | 1 + src/libs/mosquitto/test/ssl/demoCA/index.txt | 1 + .../mosquitto/test/ssl/demoCA/index.txt.attr | 1 + src/libs/mosquitto/test/ssl/demoCA/serial | 1 + src/libs/mosquitto/test/ssl/gen.sh | 75 + src/libs/mosquitto/test/ssl/openssl.cnf | 406 ++++ src/libs/mosquitto/test/ssl/readme.txt | 2 + src/libs/mosquitto/test/ssl/rootCA/crlnumber | 1 + src/libs/mosquitto/test/ssl/rootCA/index.txt | 2 + .../mosquitto/test/ssl/rootCA/index.txt.attr | 1 + src/libs/mosquitto/test/ssl/rootCA/serial | 1 + .../mosquitto/test/ssl/server-expired.crt | 0 src/libs/mosquitto/test/ssl/server.crt | 60 + src/libs/mosquitto/test/ssl/server.csr | 12 + src/libs/mosquitto/test/ssl/server.key | 15 + .../mosquitto/test/ssl/signingCA/crlnumber | 1 + .../mosquitto/test/ssl/signingCA/index.txt | 5 + .../test/ssl/signingCA/index.txt.attr | 1 + src/libs/mosquitto/test/ssl/signingCA/serial | 1 + src/libs/mosquitto/test/ssl/test-alt-ca.crt | 58 + src/libs/mosquitto/test/ssl/test-alt-ca.key | 15 + .../mosquitto/test/ssl/test-bad-root-ca.crt | 17 + .../mosquitto/test/ssl/test-bad-root-ca.key | 15 + src/libs/mosquitto/test/ssl/test-ca.srl | 1 + .../mosquitto/test/ssl/test-fake-root-ca.crt | 17 + .../mosquitto/test/ssl/test-fake-root-ca.key | 15 + src/libs/mosquitto/test/ssl/test-root-ca.crt | 17 + src/libs/mosquitto/test/ssl/test-root-ca.key | 15 + .../mosquitto/test/ssl/test-signing-ca.crt | 58 + .../mosquitto/test/ssl/test-signing-ca.key | 15 + src/libs/mosquitto/test/to-test | 7 + src/orchestra/CMakeLists.txt | 5 +- .../component/OrchMqttSourceComponent.cpp | 65 + .../component/OrchMqttSourceComponent.h | 51 + src/orchestra/main.cpp | 23 +- 493 files changed, 59129 insertions(+), 12 deletions(-) create mode 100644 src/libs/mosquitto/CMakeCache.txt create mode 100644 src/libs/mosquitto/CMakeFiles/3.10.1/CMakeCCompiler.cmake create mode 100644 src/libs/mosquitto/CMakeFiles/3.10.1/CMakeCXXCompiler.cmake create mode 100755 src/libs/mosquitto/CMakeFiles/3.10.1/CMakeDetermineCompilerABI_C.bin create mode 100755 src/libs/mosquitto/CMakeFiles/3.10.1/CMakeDetermineCompilerABI_CXX.bin create mode 100644 src/libs/mosquitto/CMakeFiles/3.10.1/CMakeSystem.cmake create mode 100644 src/libs/mosquitto/CMakeFiles/3.10.1/CompilerIdC/CMakeCCompilerId.c create mode 100644 src/libs/mosquitto/CMakeFiles/3.10.1/CompilerIdCXX/CMakeCXXCompilerId.cpp create mode 100644 src/libs/mosquitto/CMakeFiles/CMakeDirectoryInformation.cmake create mode 100644 src/libs/mosquitto/CMakeFiles/CMakeError.log create mode 100644 src/libs/mosquitto/CMakeFiles/CMakeOutput.log create mode 100644 src/libs/mosquitto/CMakeFiles/Makefile.cmake create mode 100644 src/libs/mosquitto/CMakeFiles/Makefile2 create mode 100644 src/libs/mosquitto/CMakeFiles/TargetDirectories.txt create mode 100644 src/libs/mosquitto/CMakeFiles/cmake.check_cache create mode 100755 src/libs/mosquitto/CMakeFiles/feature_tests.bin create mode 100644 src/libs/mosquitto/CMakeFiles/feature_tests.c create mode 100644 src/libs/mosquitto/CMakeFiles/feature_tests.cxx create mode 100644 src/libs/mosquitto/CMakeFiles/progress.marks create mode 100644 src/libs/mosquitto/CMakeLists.txt create mode 100644 src/libs/mosquitto/CONTRIBUTING.md create mode 100644 src/libs/mosquitto/ChangeLog.txt create mode 100644 src/libs/mosquitto/LICENSE.txt create mode 100644 src/libs/mosquitto/Makefile create mode 100644 src/libs/mosquitto/about.html create mode 100644 src/libs/mosquitto/aclfile.example create mode 100644 src/libs/mosquitto/client/CMakeFiles/CMakeDirectoryInformation.cmake create mode 100644 src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/C.includecache create mode 100644 src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/DependInfo.cmake create mode 100644 src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/build.make create mode 100644 src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/cmake_clean.cmake create mode 100644 src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/depend.internal create mode 100644 src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/depend.make create mode 100644 src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/flags.make create mode 100644 src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/link.txt create mode 100644 src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/progress.make create mode 100644 src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/C.includecache create mode 100644 src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/DependInfo.cmake create mode 100644 src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/build.make create mode 100644 src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/cmake_clean.cmake create mode 100644 src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/depend.internal create mode 100644 src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/depend.make create mode 100644 src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/flags.make create mode 100644 src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/link.txt create mode 100644 src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/progress.make create mode 100644 src/libs/mosquitto/client/CMakeFiles/progress.marks create mode 100644 src/libs/mosquitto/client/CMakeLists.txt create mode 100644 src/libs/mosquitto/client/Makefile create mode 100644 src/libs/mosquitto/client/client_shared.c create mode 100644 src/libs/mosquitto/client/client_shared.h create mode 100644 src/libs/mosquitto/client/cmake_install.cmake create mode 100755 src/libs/mosquitto/client/mosquitto_pub create mode 100755 src/libs/mosquitto/client/mosquitto_sub create mode 100644 src/libs/mosquitto/client/pub_client.c create mode 100644 src/libs/mosquitto/client/sub_client.c create mode 100644 src/libs/mosquitto/cmake_install.cmake create mode 100644 src/libs/mosquitto/compiling.txt create mode 100644 src/libs/mosquitto/config.h create mode 100644 src/libs/mosquitto/config.mk create mode 100644 src/libs/mosquitto/edl-v10 create mode 100644 src/libs/mosquitto/epl-v10 create mode 100644 src/libs/mosquitto/examples/mysql_log/Makefile create mode 100644 src/libs/mosquitto/examples/mysql_log/mysql_log.c create mode 100644 src/libs/mosquitto/examples/temperature_conversion/Makefile create mode 100644 src/libs/mosquitto/examples/temperature_conversion/main.cpp create mode 100644 src/libs/mosquitto/examples/temperature_conversion/readme.txt create mode 100644 src/libs/mosquitto/examples/temperature_conversion/temperature_conversion.cpp create mode 100644 src/libs/mosquitto/examples/temperature_conversion/temperature_conversion.h create mode 100644 src/libs/mosquitto/install_manifest.txt create mode 100644 src/libs/mosquitto/installer/mosquitto-cygwin.nsi create mode 100644 src/libs/mosquitto/installer/mosquitto.nsi create mode 100644 src/libs/mosquitto/lib/CMakeFiles/CMakeDirectoryInformation.cmake create mode 100644 src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/C.includecache create mode 100644 src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/DependInfo.cmake create mode 100644 src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/build.make create mode 100644 src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/cmake_clean.cmake create mode 100644 src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/depend.internal create mode 100644 src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/depend.make create mode 100644 src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/flags.make create mode 100644 src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/link.txt create mode 100644 src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/progress.make create mode 100644 src/libs/mosquitto/lib/CMakeFiles/progress.marks create mode 100644 src/libs/mosquitto/lib/CMakeLists.txt create mode 100644 src/libs/mosquitto/lib/Makefile create mode 100644 src/libs/mosquitto/lib/cmake_install.cmake create mode 100644 src/libs/mosquitto/lib/cpp/CMakeFiles/CMakeDirectoryInformation.cmake create mode 100644 src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/CXX.includecache create mode 100644 src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/DependInfo.cmake create mode 100644 src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/build.make create mode 100644 src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/cmake_clean.cmake create mode 100644 src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/depend.internal create mode 100644 src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/depend.make create mode 100644 src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/flags.make create mode 100644 src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/link.txt create mode 100644 src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/progress.make create mode 100644 src/libs/mosquitto/lib/cpp/CMakeFiles/progress.marks create mode 100644 src/libs/mosquitto/lib/cpp/CMakeLists.txt create mode 100644 src/libs/mosquitto/lib/cpp/Makefile create mode 100644 src/libs/mosquitto/lib/cpp/cmake_install.cmake create mode 100644 src/libs/mosquitto/lib/cpp/mosquittopp.cpp create mode 100644 src/libs/mosquitto/lib/cpp/mosquittopp.h create mode 100644 src/libs/mosquitto/lib/dummypthread.h create mode 100644 src/libs/mosquitto/lib/linker.version create mode 100644 src/libs/mosquitto/lib/logging_mosq.c create mode 100644 src/libs/mosquitto/lib/logging_mosq.h create mode 100644 src/libs/mosquitto/lib/memory_mosq.c create mode 100644 src/libs/mosquitto/lib/memory_mosq.h create mode 100644 src/libs/mosquitto/lib/messages_mosq.c create mode 100644 src/libs/mosquitto/lib/messages_mosq.h create mode 100644 src/libs/mosquitto/lib/mosquitto.c create mode 100644 src/libs/mosquitto/lib/mosquitto.h create mode 100644 src/libs/mosquitto/lib/mosquitto_internal.h create mode 100644 src/libs/mosquitto/lib/mqtt3_protocol.h create mode 100644 src/libs/mosquitto/lib/net_mosq.c create mode 100644 src/libs/mosquitto/lib/net_mosq.h create mode 100644 src/libs/mosquitto/lib/read_handle.c create mode 100644 src/libs/mosquitto/lib/read_handle.h create mode 100644 src/libs/mosquitto/lib/read_handle_client.c create mode 100644 src/libs/mosquitto/lib/read_handle_shared.c create mode 100644 src/libs/mosquitto/lib/send_client_mosq.c create mode 100644 src/libs/mosquitto/lib/send_mosq.c create mode 100644 src/libs/mosquitto/lib/send_mosq.h create mode 100644 src/libs/mosquitto/lib/socks_mosq.c create mode 100644 src/libs/mosquitto/lib/socks_mosq.h create mode 100644 src/libs/mosquitto/lib/srv_mosq.c create mode 100644 src/libs/mosquitto/lib/thread_mosq.c create mode 100644 src/libs/mosquitto/lib/time_mosq.c create mode 100644 src/libs/mosquitto/lib/time_mosq.h create mode 100644 src/libs/mosquitto/lib/tls_mosq.c create mode 100644 src/libs/mosquitto/lib/tls_mosq.h create mode 100644 src/libs/mosquitto/lib/util_mosq.c create mode 100644 src/libs/mosquitto/lib/util_mosq.h create mode 100644 src/libs/mosquitto/lib/will_mosq.c create mode 100644 src/libs/mosquitto/lib/will_mosq.h create mode 100644 src/libs/mosquitto/logo/legacy/mosquitto-14x14.png create mode 100644 src/libs/mosquitto/logo/legacy/mosquitto-16x16.png create mode 100644 src/libs/mosquitto/logo/legacy/mosquitto.svg create mode 100644 src/libs/mosquitto/logo/mosquitto-logo-min.svg create mode 100644 src/libs/mosquitto/logo/mosquitto-logo-only.svg create mode 100644 src/libs/mosquitto/logo/mosquitto-text-below.svg create mode 100644 src/libs/mosquitto/logo/mosquitto-text-side.svg create mode 100644 src/libs/mosquitto/logo/mosquitto.ico create mode 100644 src/libs/mosquitto/man/CMakeFiles/CMakeDirectoryInformation.cmake create mode 100644 src/libs/mosquitto/man/CMakeFiles/progress.marks create mode 100644 src/libs/mosquitto/man/CMakeLists.txt create mode 100644 src/libs/mosquitto/man/Makefile create mode 100644 src/libs/mosquitto/man/cmake_install.cmake create mode 100644 src/libs/mosquitto/man/html.xsl create mode 100644 src/libs/mosquitto/man/libmosquitto.3 create mode 100644 src/libs/mosquitto/man/libmosquitto.3.xml create mode 100644 src/libs/mosquitto/man/manpage.xsl create mode 100644 src/libs/mosquitto/man/mosquitto-tls.7 create mode 100644 src/libs/mosquitto/man/mosquitto-tls.7.xml create mode 100644 src/libs/mosquitto/man/mosquitto.8 create mode 100644 src/libs/mosquitto/man/mosquitto.8.xml create mode 100644 src/libs/mosquitto/man/mosquitto.conf.5 create mode 100644 src/libs/mosquitto/man/mosquitto.conf.5.xml create mode 100644 src/libs/mosquitto/man/mosquitto_passwd.1 create mode 100644 src/libs/mosquitto/man/mosquitto_passwd.1.xml create mode 100644 src/libs/mosquitto/man/mosquitto_pub.1 create mode 100644 src/libs/mosquitto/man/mosquitto_pub.1.xml create mode 100644 src/libs/mosquitto/man/mosquitto_sub.1 create mode 100644 src/libs/mosquitto/man/mosquitto_sub.1.xml create mode 100644 src/libs/mosquitto/man/mqtt.7 create mode 100644 src/libs/mosquitto/man/mqtt.7.xml create mode 100755 src/libs/mosquitto/misc/currentcost/cc128_log_mysql.pl create mode 100755 src/libs/mosquitto/misc/currentcost/cc128_parse.pl create mode 100755 src/libs/mosquitto/misc/currentcost/cc128_read.pl create mode 100755 src/libs/mosquitto/misc/currentcost/cc128_read.py create mode 100755 src/libs/mosquitto/misc/currentcost/gnome-panel/CurrentCostMQTT.py create mode 100644 src/libs/mosquitto/misc/currentcost/gnome-panel/CurrentCostMQTT.server create mode 100644 src/libs/mosquitto/misc/currentcost/gnome-panel/currentcost.png create mode 100644 src/libs/mosquitto/mosquitto.conf create mode 100644 src/libs/mosquitto/notice.html create mode 100644 src/libs/mosquitto/pskfile.example create mode 100644 src/libs/mosquitto/pwfile.example create mode 100644 src/libs/mosquitto/readme-windows.txt create mode 100644 src/libs/mosquitto/readme.md create mode 100644 src/libs/mosquitto/security/mosquitto.apparmor create mode 100644 src/libs/mosquitto/service/monit/mosquitto.monit create mode 100755 src/libs/mosquitto/service/svscan/run create mode 100644 src/libs/mosquitto/service/upstart/mosquitto.conf create mode 100644 src/libs/mosquitto/src/CMakeFiles/CMakeDirectoryInformation.cmake create mode 100644 src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/C.includecache create mode 100644 src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/DependInfo.cmake create mode 100644 src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/build.make create mode 100644 src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/cmake_clean.cmake create mode 100644 src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/depend.internal create mode 100644 src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/depend.make create mode 100644 src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/flags.make create mode 100644 src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/link.txt create mode 100644 src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/progress.make create mode 100644 src/libs/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/DependInfo.cmake create mode 100644 src/libs/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/build.make create mode 100644 src/libs/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/cmake_clean.cmake create mode 100644 src/libs/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/depend.make create mode 100644 src/libs/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/flags.make create mode 100644 src/libs/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/link.txt create mode 100644 src/libs/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/progress.make create mode 100644 src/libs/mosquitto/src/CMakeFiles/progress.marks create mode 100644 src/libs/mosquitto/src/CMakeLists.txt create mode 100644 src/libs/mosquitto/src/Makefile create mode 100644 src/libs/mosquitto/src/bridge.c create mode 100644 src/libs/mosquitto/src/cmake_install.cmake create mode 100644 src/libs/mosquitto/src/conf.c create mode 100644 src/libs/mosquitto/src/context.c create mode 100644 src/libs/mosquitto/src/database.c create mode 100644 src/libs/mosquitto/src/db_dump/Makefile create mode 100644 src/libs/mosquitto/src/db_dump/db_dump.c create mode 100644 src/libs/mosquitto/src/lib_load.h create mode 100644 src/libs/mosquitto/src/linker-macosx.syms create mode 100644 src/libs/mosquitto/src/linker.syms create mode 100644 src/libs/mosquitto/src/logging.c create mode 100644 src/libs/mosquitto/src/loop.c create mode 100755 src/libs/mosquitto/src/mosquitto create mode 100644 src/libs/mosquitto/src/mosquitto.c create mode 100644 src/libs/mosquitto/src/mosquitto_broker.h create mode 100644 src/libs/mosquitto/src/mosquitto_passwd.c create mode 100644 src/libs/mosquitto/src/mosquitto_plugin.h create mode 100644 src/libs/mosquitto/src/net.c create mode 100644 src/libs/mosquitto/src/persist.c create mode 100644 src/libs/mosquitto/src/persist.h create mode 100644 src/libs/mosquitto/src/read_handle.c create mode 100644 src/libs/mosquitto/src/read_handle_client.c create mode 100644 src/libs/mosquitto/src/read_handle_server.c create mode 100644 src/libs/mosquitto/src/security.c create mode 100644 src/libs/mosquitto/src/security_default.c create mode 100644 src/libs/mosquitto/src/send_server.c create mode 100644 src/libs/mosquitto/src/service.c create mode 100644 src/libs/mosquitto/src/subs.c create mode 100644 src/libs/mosquitto/src/sys_tree.c create mode 100644 src/libs/mosquitto/src/uthash.h create mode 100644 src/libs/mosquitto/src/websockets.c create mode 100644 src/libs/mosquitto/test/Makefile create mode 100644 src/libs/mosquitto/test/broker/01-connect-anon-denied.conf create mode 100644 src/libs/mosquitto/test/broker/01-connect-anon-denied.pwfile create mode 100755 src/libs/mosquitto/test/broker/01-connect-anon-denied.py create mode 100755 src/libs/mosquitto/test/broker/01-connect-invalid-id-0-311.py create mode 100755 src/libs/mosquitto/test/broker/01-connect-invalid-id-0.py create mode 100755 src/libs/mosquitto/test/broker/01-connect-invalid-id-missing.py create mode 100755 src/libs/mosquitto/test/broker/01-connect-invalid-protonum.py create mode 100755 src/libs/mosquitto/test/broker/01-connect-invalid-reserved.py create mode 100755 src/libs/mosquitto/test/broker/01-connect-success.py create mode 100644 src/libs/mosquitto/test/broker/01-connect-uname-no-password-denied.conf create mode 100644 src/libs/mosquitto/test/broker/01-connect-uname-no-password-denied.pwfile create mode 100755 src/libs/mosquitto/test/broker/01-connect-uname-no-password-denied.py create mode 100644 src/libs/mosquitto/test/broker/01-connect-uname-password-denied.conf create mode 100644 src/libs/mosquitto/test/broker/01-connect-uname-password-denied.pwfile create mode 100755 src/libs/mosquitto/test/broker/01-connect-uname-password-denied.py create mode 100644 src/libs/mosquitto/test/broker/01-connect-uname-password-success-no-tls.conf create mode 100644 src/libs/mosquitto/test/broker/01-connect-uname-password-success-no-tls.pwfile create mode 100755 src/libs/mosquitto/test/broker/01-connect-uname-password-success-no-tls.py create mode 100644 src/libs/mosquitto/test/broker/01-connect-uname-password-success.conf create mode 100644 src/libs/mosquitto/test/broker/01-connect-uname-password-success.pwfile create mode 100755 src/libs/mosquitto/test/broker/01-connect-uname-password-success.py create mode 100755 src/libs/mosquitto/test/broker/02-subpub-qos0.py create mode 100755 src/libs/mosquitto/test/broker/02-subpub-qos1.py create mode 100755 src/libs/mosquitto/test/broker/02-subpub-qos2.py create mode 100755 src/libs/mosquitto/test/broker/02-subscribe-qos0.py create mode 100755 src/libs/mosquitto/test/broker/02-subscribe-qos1.py create mode 100755 src/libs/mosquitto/test/broker/02-subscribe-qos2.py create mode 100755 src/libs/mosquitto/test/broker/02-unsubscribe-qos0.py create mode 100755 src/libs/mosquitto/test/broker/02-unsubscribe-qos1.py create mode 100755 src/libs/mosquitto/test/broker/02-unsubscribe-qos2.py create mode 100755 src/libs/mosquitto/test/broker/03-pattern-matching-helper.py create mode 100755 src/libs/mosquitto/test/broker/03-pattern-matching.py create mode 100755 src/libs/mosquitto/test/broker/03-publish-b2c-disconnect-qos1-helper.py create mode 100644 src/libs/mosquitto/test/broker/03-publish-b2c-disconnect-qos1.conf create mode 100755 src/libs/mosquitto/test/broker/03-publish-b2c-disconnect-qos1.py create mode 100755 src/libs/mosquitto/test/broker/03-publish-b2c-disconnect-qos2-helper.py create mode 100644 src/libs/mosquitto/test/broker/03-publish-b2c-disconnect-qos2.conf create mode 100755 src/libs/mosquitto/test/broker/03-publish-b2c-disconnect-qos2.py create mode 100755 src/libs/mosquitto/test/broker/03-publish-b2c-timeout-qos1-helper.py create mode 100644 src/libs/mosquitto/test/broker/03-publish-b2c-timeout-qos1.conf create mode 100755 src/libs/mosquitto/test/broker/03-publish-b2c-timeout-qos1.py create mode 100755 src/libs/mosquitto/test/broker/03-publish-b2c-timeout-qos2-helper.py create mode 100644 src/libs/mosquitto/test/broker/03-publish-b2c-timeout-qos2.conf create mode 100755 src/libs/mosquitto/test/broker/03-publish-b2c-timeout-qos2.py create mode 100644 src/libs/mosquitto/test/broker/03-publish-c2b-disconnect-qos2.conf create mode 100755 src/libs/mosquitto/test/broker/03-publish-c2b-disconnect-qos2.py create mode 100644 src/libs/mosquitto/test/broker/03-publish-c2b-timeout-qos2.conf create mode 100755 src/libs/mosquitto/test/broker/03-publish-c2b-timeout-qos2.py create mode 100755 src/libs/mosquitto/test/broker/03-publish-qos1.py create mode 100755 src/libs/mosquitto/test/broker/03-publish-qos2.py create mode 100755 src/libs/mosquitto/test/broker/04-retain-qos0-clear.py create mode 100755 src/libs/mosquitto/test/broker/04-retain-qos0-fresh.py create mode 100755 src/libs/mosquitto/test/broker/04-retain-qos0-repeated.py create mode 100755 src/libs/mosquitto/test/broker/04-retain-qos0.py create mode 100755 src/libs/mosquitto/test/broker/04-retain-qos1-qos0.py create mode 100755 src/libs/mosquitto/test/broker/05-clean-session-qos1-helper.py create mode 100755 src/libs/mosquitto/test/broker/05-clean-session-qos1.py create mode 100644 src/libs/mosquitto/test/broker/06-bridge-b2br-disconnect-qos1.conf create mode 100755 src/libs/mosquitto/test/broker/06-bridge-b2br-disconnect-qos1.py create mode 100644 src/libs/mosquitto/test/broker/06-bridge-b2br-disconnect-qos2.conf create mode 100755 src/libs/mosquitto/test/broker/06-bridge-b2br-disconnect-qos2.py create mode 100755 src/libs/mosquitto/test/broker/06-bridge-br2b-disconnect-qos1-helper.py create mode 100644 src/libs/mosquitto/test/broker/06-bridge-br2b-disconnect-qos1.conf create mode 100755 src/libs/mosquitto/test/broker/06-bridge-br2b-disconnect-qos1.py create mode 100755 src/libs/mosquitto/test/broker/06-bridge-br2b-disconnect-qos2-helper.py create mode 100644 src/libs/mosquitto/test/broker/06-bridge-br2b-disconnect-qos2.conf create mode 100755 src/libs/mosquitto/test/broker/06-bridge-br2b-disconnect-qos2.py create mode 100644 src/libs/mosquitto/test/broker/06-bridge-fail-persist-resend-qos1.conf create mode 100755 src/libs/mosquitto/test/broker/06-bridge-fail-persist-resend-qos1.py create mode 100644 src/libs/mosquitto/test/broker/06-bridge-fail-persist-resend-qos2.conf create mode 100755 src/libs/mosquitto/test/broker/06-bridge-fail-persist-resend-qos2.py create mode 100755 src/libs/mosquitto/test/broker/06-bridge-reconnect-local-out-helper.py create mode 100644 src/libs/mosquitto/test/broker/06-bridge-reconnect-local-out.conf create mode 100755 src/libs/mosquitto/test/broker/06-bridge-reconnect-local-out.py create mode 100755 src/libs/mosquitto/test/broker/07-will-null-helper.py create mode 100755 src/libs/mosquitto/test/broker/07-will-null-topic.py create mode 100755 src/libs/mosquitto/test/broker/07-will-null.py create mode 100755 src/libs/mosquitto/test/broker/07-will-qos0-helper.py create mode 100755 src/libs/mosquitto/test/broker/07-will-qos0.py create mode 100755 src/libs/mosquitto/test/broker/08-ssl-bridge-helper.py create mode 100644 src/libs/mosquitto/test/broker/08-ssl-bridge.conf create mode 100755 src/libs/mosquitto/test/broker/08-ssl-bridge.py create mode 100644 src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-crl.conf create mode 100755 src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-crl.py create mode 100644 src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-expired.conf create mode 100755 src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-expired.py create mode 100644 src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-revoked.conf create mode 100755 src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-revoked.py create mode 100644 src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-without.conf create mode 100755 src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-without.py create mode 100644 src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth.conf create mode 100755 src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth.py create mode 100644 src/libs/mosquitto/test/broker/08-ssl-connect-identity.conf create mode 100755 src/libs/mosquitto/test/broker/08-ssl-connect-identity.py create mode 100644 src/libs/mosquitto/test/broker/08-ssl-connect-no-auth-wrong-ca.conf create mode 100755 src/libs/mosquitto/test/broker/08-ssl-connect-no-auth-wrong-ca.py create mode 100644 src/libs/mosquitto/test/broker/08-ssl-connect-no-auth.conf create mode 100755 src/libs/mosquitto/test/broker/08-ssl-connect-no-auth.py create mode 100644 src/libs/mosquitto/test/broker/08-ssl-connect-no-identity.conf create mode 100755 src/libs/mosquitto/test/broker/08-ssl-connect-no-identity.py create mode 100644 src/libs/mosquitto/test/broker/08-tls-psk-bridge.conf create mode 100644 src/libs/mosquitto/test/broker/08-tls-psk-bridge.conf2 create mode 100644 src/libs/mosquitto/test/broker/08-tls-psk-bridge.psk create mode 100755 src/libs/mosquitto/test/broker/08-tls-psk-bridge.py create mode 100644 src/libs/mosquitto/test/broker/08-tls-psk-pub.conf create mode 100644 src/libs/mosquitto/test/broker/08-tls-psk-pub.psk create mode 100755 src/libs/mosquitto/test/broker/08-tls-psk-pub.py create mode 100644 src/libs/mosquitto/test/broker/09-plugin-auth-unpwd-fail.conf create mode 100755 src/libs/mosquitto/test/broker/09-plugin-auth-unpwd-fail.py create mode 100644 src/libs/mosquitto/test/broker/09-plugin-auth-unpwd-success.conf create mode 100755 src/libs/mosquitto/test/broker/09-plugin-auth-unpwd-success.py create mode 100755 src/libs/mosquitto/test/broker/10-listener-mount-point-helper.py create mode 100644 src/libs/mosquitto/test/broker/10-listener-mount-point.conf create mode 100755 src/libs/mosquitto/test/broker/10-listener-mount-point.py create mode 100644 src/libs/mosquitto/test/broker/Makefile create mode 100644 src/libs/mosquitto/test/broker/c/08-tls-psk-bridge.c create mode 100644 src/libs/mosquitto/test/broker/c/08-tls-psk-pub.c create mode 100644 src/libs/mosquitto/test/broker/c/Makefile create mode 100644 src/libs/mosquitto/test/broker/c/auth_plugin.c create mode 100644 src/libs/mosquitto/test/broker/readme.txt create mode 100644 src/libs/mosquitto/test/fake_user.c create mode 100755 src/libs/mosquitto/test/lib/01-con-discon-success.py create mode 100755 src/libs/mosquitto/test/lib/01-keepalive-pingreq.py create mode 100755 src/libs/mosquitto/test/lib/01-no-clean-session.py create mode 100755 src/libs/mosquitto/test/lib/01-unpwd-set.py create mode 100755 src/libs/mosquitto/test/lib/01-will-set.py create mode 100755 src/libs/mosquitto/test/lib/01-will-unpwd-set.py create mode 100755 src/libs/mosquitto/test/lib/02-subscribe-qos0.py create mode 100755 src/libs/mosquitto/test/lib/02-subscribe-qos1.py create mode 100755 src/libs/mosquitto/test/lib/02-subscribe-qos2.py create mode 100755 src/libs/mosquitto/test/lib/02-unsubscribe.py create mode 100755 src/libs/mosquitto/test/lib/03-publish-b2c-qos1.py create mode 100755 src/libs/mosquitto/test/lib/03-publish-b2c-qos2.py create mode 100755 src/libs/mosquitto/test/lib/03-publish-c2b-qos1-disconnect.py create mode 100755 src/libs/mosquitto/test/lib/03-publish-c2b-qos1-timeout.py create mode 100755 src/libs/mosquitto/test/lib/03-publish-c2b-qos2-disconnect.py create mode 100755 src/libs/mosquitto/test/lib/03-publish-c2b-qos2-timeout.py create mode 100755 src/libs/mosquitto/test/lib/03-publish-c2b-qos2.py create mode 100755 src/libs/mosquitto/test/lib/03-publish-qos0-no-payload.py create mode 100755 src/libs/mosquitto/test/lib/03-publish-qos0.py create mode 100755 src/libs/mosquitto/test/lib/04-retain-qos0.py create mode 100755 src/libs/mosquitto/test/lib/08-ssl-bad-cacert.py create mode 100755 src/libs/mosquitto/test/lib/08-ssl-connect-cert-auth-enc.py create mode 100755 src/libs/mosquitto/test/lib/08-ssl-connect-cert-auth.py create mode 100755 src/libs/mosquitto/test/lib/08-ssl-connect-no-auth.py create mode 100755 src/libs/mosquitto/test/lib/08-ssl-fake-cacert.py create mode 100755 src/libs/mosquitto/test/lib/09-util-topic-matching.py create mode 100755 src/libs/mosquitto/test/lib/09-util-topic-tokenise.py create mode 100644 src/libs/mosquitto/test/lib/Makefile create mode 100644 src/libs/mosquitto/test/lib/c/01-con-discon-success.c create mode 100644 src/libs/mosquitto/test/lib/c/01-keepalive-pingreq.c create mode 100644 src/libs/mosquitto/test/lib/c/01-no-clean-session.c create mode 100644 src/libs/mosquitto/test/lib/c/01-unpwd-set.c create mode 100644 src/libs/mosquitto/test/lib/c/01-will-set.c create mode 100644 src/libs/mosquitto/test/lib/c/01-will-unpwd-set.c create mode 100644 src/libs/mosquitto/test/lib/c/02-subscribe-qos0.c create mode 100644 src/libs/mosquitto/test/lib/c/02-subscribe-qos1.c create mode 100644 src/libs/mosquitto/test/lib/c/02-subscribe-qos2.c create mode 100644 src/libs/mosquitto/test/lib/c/02-unsubscribe.c create mode 100644 src/libs/mosquitto/test/lib/c/03-publish-b2c-qos1.c create mode 100644 src/libs/mosquitto/test/lib/c/03-publish-b2c-qos2.c create mode 100644 src/libs/mosquitto/test/lib/c/03-publish-c2b-qos1-disconnect.c create mode 100644 src/libs/mosquitto/test/lib/c/03-publish-c2b-qos1-timeout.c create mode 100644 src/libs/mosquitto/test/lib/c/03-publish-c2b-qos2-disconnect.c create mode 100644 src/libs/mosquitto/test/lib/c/03-publish-c2b-qos2-timeout.c create mode 100644 src/libs/mosquitto/test/lib/c/03-publish-c2b-qos2.c create mode 100644 src/libs/mosquitto/test/lib/c/03-publish-qos0-no-payload.c create mode 100644 src/libs/mosquitto/test/lib/c/03-publish-qos0.c create mode 100644 src/libs/mosquitto/test/lib/c/04-retain-qos0.c create mode 100644 src/libs/mosquitto/test/lib/c/08-ssl-bad-cacert.c create mode 100644 src/libs/mosquitto/test/lib/c/08-ssl-connect-cert-auth-enc.c create mode 100644 src/libs/mosquitto/test/lib/c/08-ssl-connect-cert-auth.c create mode 100644 src/libs/mosquitto/test/lib/c/08-ssl-connect-no-auth.c create mode 100644 src/libs/mosquitto/test/lib/c/08-ssl-fake-cacert.c create mode 100644 src/libs/mosquitto/test/lib/c/09-util-topic-matching.c create mode 100644 src/libs/mosquitto/test/lib/c/09-util-topic-tokenise.c create mode 100644 src/libs/mosquitto/test/lib/c/Makefile create mode 100644 src/libs/mosquitto/test/lib/cpp/01-con-discon-success.cpp create mode 100644 src/libs/mosquitto/test/lib/cpp/01-keepalive-pingreq.cpp create mode 100644 src/libs/mosquitto/test/lib/cpp/01-no-clean-session.cpp create mode 100644 src/libs/mosquitto/test/lib/cpp/01-unpwd-set.cpp create mode 100644 src/libs/mosquitto/test/lib/cpp/01-will-set.cpp create mode 100644 src/libs/mosquitto/test/lib/cpp/01-will-unpwd-set.cpp create mode 100644 src/libs/mosquitto/test/lib/cpp/02-subscribe-qos0.cpp create mode 100644 src/libs/mosquitto/test/lib/cpp/02-subscribe-qos1.cpp create mode 100644 src/libs/mosquitto/test/lib/cpp/02-subscribe-qos2.cpp create mode 100644 src/libs/mosquitto/test/lib/cpp/02-unsubscribe.cpp create mode 100644 src/libs/mosquitto/test/lib/cpp/03-publish-b2c-qos1.cpp create mode 100644 src/libs/mosquitto/test/lib/cpp/03-publish-b2c-qos2.cpp create mode 100644 src/libs/mosquitto/test/lib/cpp/03-publish-c2b-qos1-disconnect.cpp create mode 100644 src/libs/mosquitto/test/lib/cpp/03-publish-c2b-qos1-timeout.cpp create mode 100644 src/libs/mosquitto/test/lib/cpp/03-publish-c2b-qos2-disconnect.cpp create mode 100644 src/libs/mosquitto/test/lib/cpp/03-publish-c2b-qos2-timeout.cpp create mode 100644 src/libs/mosquitto/test/lib/cpp/03-publish-c2b-qos2.cpp create mode 100644 src/libs/mosquitto/test/lib/cpp/03-publish-qos0-no-payload.cpp create mode 100644 src/libs/mosquitto/test/lib/cpp/03-publish-qos0.cpp create mode 100644 src/libs/mosquitto/test/lib/cpp/04-retain-qos0.cpp create mode 100644 src/libs/mosquitto/test/lib/cpp/08-ssl-bad-cacert.cpp create mode 100644 src/libs/mosquitto/test/lib/cpp/08-ssl-connect-cert-auth-enc.cpp create mode 100644 src/libs/mosquitto/test/lib/cpp/08-ssl-connect-cert-auth.cpp create mode 100644 src/libs/mosquitto/test/lib/cpp/08-ssl-connect-no-auth.cpp create mode 100644 src/libs/mosquitto/test/lib/cpp/08-ssl-fake-cacert.cpp create mode 100644 src/libs/mosquitto/test/lib/cpp/09-util-topic-matching.cpp create mode 100644 src/libs/mosquitto/test/lib/cpp/09-util-topic-tokenise.cpp create mode 100644 src/libs/mosquitto/test/lib/cpp/Makefile create mode 100644 src/libs/mosquitto/test/mosq_test.py create mode 100644 src/libs/mosquitto/test/msgsps_common.h create mode 100644 src/libs/mosquitto/test/msgsps_pub.c create mode 100644 src/libs/mosquitto/test/msgsps_sub.c create mode 100644 src/libs/mosquitto/test/packet-gen.c create mode 100644 src/libs/mosquitto/test/qos.c create mode 100644 src/libs/mosquitto/test/random_client.c create mode 100644 src/libs/mosquitto/test/ssl/all-ca.crt create mode 100644 src/libs/mosquitto/test/ssl/client-encrypted.crt create mode 100644 src/libs/mosquitto/test/ssl/client-encrypted.key create mode 100644 src/libs/mosquitto/test/ssl/client-expired.crt create mode 100644 src/libs/mosquitto/test/ssl/client-revoked.crt create mode 100644 src/libs/mosquitto/test/ssl/client-revoked.csr create mode 100644 src/libs/mosquitto/test/ssl/client-revoked.key create mode 100644 src/libs/mosquitto/test/ssl/client.crt create mode 100644 src/libs/mosquitto/test/ssl/client.csr create mode 100644 src/libs/mosquitto/test/ssl/client.key create mode 100644 src/libs/mosquitto/test/ssl/crl.pem create mode 100644 src/libs/mosquitto/test/ssl/demoCA/crlnumber create mode 100644 src/libs/mosquitto/test/ssl/demoCA/index.txt create mode 100644 src/libs/mosquitto/test/ssl/demoCA/index.txt.attr create mode 100644 src/libs/mosquitto/test/ssl/demoCA/serial create mode 100755 src/libs/mosquitto/test/ssl/gen.sh create mode 100644 src/libs/mosquitto/test/ssl/openssl.cnf create mode 100644 src/libs/mosquitto/test/ssl/readme.txt create mode 100644 src/libs/mosquitto/test/ssl/rootCA/crlnumber create mode 100644 src/libs/mosquitto/test/ssl/rootCA/index.txt create mode 100644 src/libs/mosquitto/test/ssl/rootCA/index.txt.attr create mode 100644 src/libs/mosquitto/test/ssl/rootCA/serial create mode 100644 src/libs/mosquitto/test/ssl/server-expired.crt create mode 100644 src/libs/mosquitto/test/ssl/server.crt create mode 100644 src/libs/mosquitto/test/ssl/server.csr create mode 100644 src/libs/mosquitto/test/ssl/server.key create mode 100644 src/libs/mosquitto/test/ssl/signingCA/crlnumber create mode 100644 src/libs/mosquitto/test/ssl/signingCA/index.txt create mode 100644 src/libs/mosquitto/test/ssl/signingCA/index.txt.attr create mode 100644 src/libs/mosquitto/test/ssl/signingCA/serial create mode 100644 src/libs/mosquitto/test/ssl/test-alt-ca.crt create mode 100644 src/libs/mosquitto/test/ssl/test-alt-ca.key create mode 100644 src/libs/mosquitto/test/ssl/test-bad-root-ca.crt create mode 100644 src/libs/mosquitto/test/ssl/test-bad-root-ca.key create mode 100644 src/libs/mosquitto/test/ssl/test-ca.srl create mode 100644 src/libs/mosquitto/test/ssl/test-fake-root-ca.crt create mode 100644 src/libs/mosquitto/test/ssl/test-fake-root-ca.key create mode 100644 src/libs/mosquitto/test/ssl/test-root-ca.crt create mode 100644 src/libs/mosquitto/test/ssl/test-root-ca.key create mode 100644 src/libs/mosquitto/test/ssl/test-signing-ca.crt create mode 100644 src/libs/mosquitto/test/ssl/test-signing-ca.key create mode 100644 src/libs/mosquitto/test/to-test create mode 100644 src/orchestra/component/OrchMqttSourceComponent.cpp create mode 100644 src/orchestra/component/OrchMqttSourceComponent.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 66c8b72..94d6d8a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,13 @@ endmacro(ADD_SUBLIB) ADD_SUBLIB(DSPatch) +set(WITH_SRV OFF) +set(WITH_TLS OFF) +add_subdirectory(src/libs/mosquitto) +include_directories(src/libs/mosquitto/lib/cpp/) +include_directories(src/libs/mosquitto/lib) + + add_subdirectory(src/orchestra) add_subdirectory(src/mockDataSimulator) diff --git a/src/libs/mosquitto/CMakeCache.txt b/src/libs/mosquitto/CMakeCache.txt new file mode 100644 index 0000000..8987ebd --- /dev/null +++ b/src/libs/mosquitto/CMakeCache.txt @@ -0,0 +1,422 @@ +# This is the CMakeCache file. +# For build in directory: /Users/benjamin/orchestra/src/libs/mosquitto +# It was generated by CMake: /usr/local/Cellar/cmake/3.10.1/bin/cmake +# You can edit this file to change values found and used by cmake. +# If you do not want to change any of the values, simply exit the editor. +# If you do want to change a value, simply edit, save, and exit the editor. +# The syntax for the file is as follows: +# KEY:TYPE=VALUE +# KEY is the name of a variable in the cache. +# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!. +# VALUE is the current value for the KEY. + +######################## +# EXTERNAL cache entries +######################## + +//Path to a file. +ARES_HEADER:PATH=/usr/local/include + +//Path to a program. +CMAKE_AR:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar + +//Choose the type of build, options are: None(CMAKE_CXX_FLAGS or +// CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel. +CMAKE_BUILD_TYPE:STRING= + +//Enable/Disable color output during build. +CMAKE_COLOR_MAKEFILE:BOOL=ON + +//CXX compiler +CMAKE_CXX_COMPILER:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ + +//Flags used by the compiler during all build types. +CMAKE_CXX_FLAGS:STRING= + +//Flags used by the compiler during debug builds. +CMAKE_CXX_FLAGS_DEBUG:STRING=-g + +//Flags used by the compiler during release builds for minimum +// size. +CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG + +//Flags used by the compiler during release builds. +CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG + +//Flags used by the compiler during release builds with debug info. +CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG + +//C compiler +CMAKE_C_COMPILER:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc + +//Flags used by the compiler during all build types. +CMAKE_C_FLAGS:STRING= + +//Flags used by the compiler during debug builds. +CMAKE_C_FLAGS_DEBUG:STRING=-g + +//Flags used by the compiler during release builds for minimum +// size. +CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG + +//Flags used by the compiler during release builds. +CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG + +//Flags used by the compiler during release builds with debug info. +CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG + +//Flags used by the linker. +CMAKE_EXE_LINKER_FLAGS:STRING= + +//Flags used by the linker during debug builds. +CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during release minsize builds. +CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during release builds. +CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during Release with Debug Info builds. +CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Enable/Disable output of compile commands during generation. +CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=OFF + +//Path to a program. +CMAKE_INSTALL_NAME_TOOL:FILEPATH=/usr/bin/install_name_tool + +//Install path prefix, prepended onto install directories. +CMAKE_INSTALL_PREFIX:PATH=/usr/local + +//Path to a program. +CMAKE_LINKER:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld + +//Path to a program. +CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make + +//Flags used by the linker during the creation of modules. +CMAKE_MODULE_LINKER_FLAGS:STRING= + +//Flags used by the linker during debug builds. +CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during release minsize builds. +CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during release builds. +CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during Release with Debug Info builds. +CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Path to a program. +CMAKE_NM:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm + +//Path to a program. +CMAKE_OBJCOPY:FILEPATH=CMAKE_OBJCOPY-NOTFOUND + +//Path to a program. +CMAKE_OBJDUMP:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/objdump + +//Build architectures for OSX +CMAKE_OSX_ARCHITECTURES:STRING= + +//Minimum OS X version to target for deployment (at runtime); newer +// APIs weak linked. Set to empty string for default value. +CMAKE_OSX_DEPLOYMENT_TARGET:STRING= + +//The product will be built against the headers and libraries located +// inside the indicated SDK. +CMAKE_OSX_SYSROOT:PATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk + +//Value Computed by CMake +CMAKE_PROJECT_NAME:STATIC=mosquitto + +//Path to a program. +CMAKE_RANLIB:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib + +//Flags used by the linker during the creation of dll's. +CMAKE_SHARED_LINKER_FLAGS:STRING= + +//Flags used by the linker during debug builds. +CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during release minsize builds. +CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during release builds. +CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during Release with Debug Info builds. +CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//If set, runtime paths are not added when installing shared libraries, +// but are added when building. +CMAKE_SKIP_INSTALL_RPATH:BOOL=NO + +//If set, runtime paths are not added when using shared libraries. +CMAKE_SKIP_RPATH:BOOL=NO + +//Flags used by the linker during the creation of static libraries. +CMAKE_STATIC_LINKER_FLAGS:STRING= + +//Flags used by the linker during debug builds. +CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during release minsize builds. +CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during release builds. +CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during Release with Debug Info builds. +CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Path to a program. +CMAKE_STRIP:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip + +//If this value is on, makefiles will be generated without the +// .SILENT directive, and all commands will be echoed to the console +// during the make. This is useful for debugging only. With Visual +// Studio IDE projects all commands are done without /nologo. +CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE + +//Include bridge support for connecting to other brokers? +INC_BRIDGE_SUPPORT:BOOL=ON + +//Include database upgrade support? (recommended) +INC_DB_UPGRADE:BOOL=ON + +//Include memory tracking support? +INC_MEMTRACK:BOOL=ON + +//Path to a library. +LIBPTHREAD:FILEPATH=/usr/lib/libpthread.dylib + +//Path to a library. +OPENSSL_CRYPTO_LIBRARY:FILEPATH=/usr/lib/libcrypto.dylib + +//Path to a file. +OPENSSL_INCLUDE_DIR:PATH=/usr/local/include + +//Path to a library. +OPENSSL_SSL_LIBRARY:FILEPATH=/usr/lib/libssl.dylib + +//pkg-config executable +PKG_CONFIG_EXECUTABLE:FILEPATH=/usr/local/bin/pkg-config + +//Include tcp-wrappers support? +USE_LIBWRAP:BOOL=OFF + +//Include Elliptic Curve support (requires WITH_TLS)? +WITH_EC:BOOL=ON + +//Include persistence support? +WITH_PERSISTENCE:BOOL=ON + +//Include SOCKS5 support? +WITH_SOCKS:BOOL=ON + +//Include SRV lookup support? +WITH_SRV:BOOL=OFF + +//Include $SYS tree support? +WITH_SYS_TREE:BOOL=ON + +//Include client library threading support? +WITH_THREADING:BOOL=ON + +//Include SSL/TLS support? +WITH_TLS:BOOL=OFF + +//Include TLS-PSK support (requires WITH_TLS)? +WITH_TLS_PSK:BOOL=ON + +//Include websockets support? +WITH_WEBSOCKETS:BOOL=OFF + +//Dependencies for the target +libmosquitto_LIB_DEPENDS:STATIC=general;pthread; + +//Value Computed by CMake +mosquitto_BINARY_DIR:STATIC=/Users/benjamin/orchestra/src/libs/mosquitto + +//Value Computed by CMake +mosquitto_SOURCE_DIR:STATIC=/Users/benjamin/orchestra/src/libs/mosquitto + +//Dependencies for the target +mosquittopp_LIB_DEPENDS:STATIC=general;libmosquitto; + + +######################## +# INTERNAL cache entries +######################## + +//ADVANCED property for variable: CMAKE_AR +CMAKE_AR-ADVANCED:INTERNAL=1 +//This is the directory where this CMakeCache.txt was created +CMAKE_CACHEFILE_DIR:INTERNAL=/Users/benjamin/orchestra/src/libs/mosquitto +//Major version of cmake used to create the current loaded cache +CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3 +//Minor version of cmake used to create the current loaded cache +CMAKE_CACHE_MINOR_VERSION:INTERNAL=10 +//Patch version of cmake used to create the current loaded cache +CMAKE_CACHE_PATCH_VERSION:INTERNAL=1 +//ADVANCED property for variable: CMAKE_COLOR_MAKEFILE +CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1 +//Path to CMake executable. +CMAKE_COMMAND:INTERNAL=/usr/local/Cellar/cmake/3.10.1/bin/cmake +//Path to cpack program executable. +CMAKE_CPACK_COMMAND:INTERNAL=/usr/local/Cellar/cmake/3.10.1/bin/cpack +//Path to ctest program executable. +CMAKE_CTEST_COMMAND:INTERNAL=/usr/local/Cellar/cmake/3.10.1/bin/ctest +//ADVANCED property for variable: CMAKE_CXX_COMPILER +CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS +CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG +CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL +CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE +CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO +CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_COMPILER +CMAKE_C_COMPILER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS +CMAKE_C_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG +CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL +CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE +CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO +CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//Path to cache edit program executable. +CMAKE_EDIT_COMMAND:INTERNAL=/usr/local/Cellar/cmake/3.10.1/bin/ccmake +//Executable file format +CMAKE_EXECUTABLE_FORMAT:INTERNAL=Unknown +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS +CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG +CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL +CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE +CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS +CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1 +//Name of external makefile project generator. +CMAKE_EXTRA_GENERATOR:INTERNAL= +//Name of generator. +CMAKE_GENERATOR:INTERNAL=Unix Makefiles +//Name of generator platform. +CMAKE_GENERATOR_PLATFORM:INTERNAL= +//Name of generator toolset. +CMAKE_GENERATOR_TOOLSET:INTERNAL= +//Source directory with the top level CMakeLists.txt file for this +// project +CMAKE_HOME_DIRECTORY:INTERNAL=/Users/benjamin/orchestra/src/libs/mosquitto +//ADVANCED property for variable: CMAKE_INSTALL_NAME_TOOL +CMAKE_INSTALL_NAME_TOOL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_LINKER +CMAKE_LINKER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MAKE_PROGRAM +CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS +CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG +CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL +CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE +CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_NM +CMAKE_NM-ADVANCED:INTERNAL=1 +//number of local generators +CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=6 +//ADVANCED property for variable: CMAKE_OBJCOPY +CMAKE_OBJCOPY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_OBJDUMP +CMAKE_OBJDUMP-ADVANCED:INTERNAL=1 +//Platform information initialized +CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_RANLIB +CMAKE_RANLIB-ADVANCED:INTERNAL=1 +//Path to CMake installation. +CMAKE_ROOT:INTERNAL=/usr/local/Cellar/cmake/3.10.1/share/cmake +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS +CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG +CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL +CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE +CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH +CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SKIP_RPATH +CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS +CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG +CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL +CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE +CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STRIP +CMAKE_STRIP-ADVANCED:INTERNAL=1 +//uname command +CMAKE_UNAME:INTERNAL=/usr/bin/uname +//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE +CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 +//Details about finding OpenSSL +FIND_PACKAGE_MESSAGE_DETAILS_OpenSSL:INTERNAL=[/usr/lib/libcrypto.dylib][/usr/local/include][v1.0.2n()] +//Have library anl +HAVE_GETADDRINFO_A:INTERNAL= +//ADVANCED property for variable: OPENSSL_CRYPTO_LIBRARY +OPENSSL_CRYPTO_LIBRARY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: OPENSSL_INCLUDE_DIR +OPENSSL_INCLUDE_DIR-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: OPENSSL_SSL_LIBRARY +OPENSSL_SSL_LIBRARY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: PKG_CONFIG_EXECUTABLE +PKG_CONFIG_EXECUTABLE-ADVANCED:INTERNAL=1 +_OPENSSL_CFLAGS:INTERNAL= +_OPENSSL_CFLAGS_I:INTERNAL= +_OPENSSL_CFLAGS_OTHER:INTERNAL= +_OPENSSL_FOUND:INTERNAL= +_OPENSSL_INCLUDEDIR:INTERNAL= +_OPENSSL_LIBDIR:INTERNAL= +_OPENSSL_LIBS:INTERNAL= +_OPENSSL_LIBS_L:INTERNAL= +_OPENSSL_LIBS_OTHER:INTERNAL= +_OPENSSL_LIBS_PATHS:INTERNAL= +_OPENSSL_PREFIX:INTERNAL= +_OPENSSL_STATIC_CFLAGS:INTERNAL= +_OPENSSL_STATIC_CFLAGS_I:INTERNAL= +_OPENSSL_STATIC_CFLAGS_OTHER:INTERNAL= +_OPENSSL_STATIC_LIBDIR:INTERNAL= +_OPENSSL_STATIC_LIBS:INTERNAL= +_OPENSSL_STATIC_LIBS_L:INTERNAL= +_OPENSSL_STATIC_LIBS_OTHER:INTERNAL= +_OPENSSL_STATIC_LIBS_PATHS:INTERNAL= +_OPENSSL_VERSION:INTERNAL= +_OPENSSL_openssl_INCLUDEDIR:INTERNAL= +_OPENSSL_openssl_LIBDIR:INTERNAL= +_OPENSSL_openssl_PREFIX:INTERNAL= +_OPENSSL_openssl_VERSION:INTERNAL= +__pkg_config_checked__OPENSSL:INTERNAL=1 + diff --git a/src/libs/mosquitto/CMakeFiles/3.10.1/CMakeCCompiler.cmake b/src/libs/mosquitto/CMakeFiles/3.10.1/CMakeCCompiler.cmake new file mode 100644 index 0000000..8f3239e --- /dev/null +++ b/src/libs/mosquitto/CMakeFiles/3.10.1/CMakeCCompiler.cmake @@ -0,0 +1,73 @@ +set(CMAKE_C_COMPILER "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc") +set(CMAKE_C_COMPILER_ARG1 "") +set(CMAKE_C_COMPILER_ID "AppleClang") +set(CMAKE_C_COMPILER_VERSION "9.0.0.9000039") +set(CMAKE_C_COMPILER_VERSION_INTERNAL "") +set(CMAKE_C_COMPILER_WRAPPER "") +set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "11") +set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert") +set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes") +set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros") +set(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert") + +set(CMAKE_C_PLATFORM_ID "Darwin") +set(CMAKE_C_SIMULATE_ID "") +set(CMAKE_C_SIMULATE_VERSION "") + + + +set(CMAKE_AR "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar") +set(CMAKE_C_COMPILER_AR "") +set(CMAKE_RANLIB "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib") +set(CMAKE_C_COMPILER_RANLIB "") +set(CMAKE_LINKER "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld") +set(CMAKE_COMPILER_IS_GNUCC ) +set(CMAKE_C_COMPILER_LOADED 1) +set(CMAKE_C_COMPILER_WORKS TRUE) +set(CMAKE_C_ABI_COMPILED TRUE) +set(CMAKE_COMPILER_IS_MINGW ) +set(CMAKE_COMPILER_IS_CYGWIN ) +if(CMAKE_COMPILER_IS_CYGWIN) + set(CYGWIN 1) + set(UNIX 1) +endif() + +set(CMAKE_C_COMPILER_ENV_VAR "CC") + +if(CMAKE_COMPILER_IS_MINGW) + set(MINGW 1) +endif() +set(CMAKE_C_COMPILER_ID_RUN 1) +set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m) +set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) +set(CMAKE_C_LINKER_PREFERENCE 10) + +# Save compiler ABI information. +set(CMAKE_C_SIZEOF_DATA_PTR "8") +set(CMAKE_C_COMPILER_ABI "") +set(CMAKE_C_LIBRARY_ARCHITECTURE "") + +if(CMAKE_C_SIZEOF_DATA_PTR) + set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") +endif() + +if(CMAKE_C_COMPILER_ABI) + set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") +endif() + +if(CMAKE_C_LIBRARY_ARCHITECTURE) + set(CMAKE_LIBRARY_ARCHITECTURE "") +endif() + +set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "") +if(CMAKE_C_CL_SHOWINCLUDES_PREFIX) + set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}") +endif() + + + + + +set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "") +set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/lib") +set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks") diff --git a/src/libs/mosquitto/CMakeFiles/3.10.1/CMakeCXXCompiler.cmake b/src/libs/mosquitto/CMakeFiles/3.10.1/CMakeCXXCompiler.cmake new file mode 100644 index 0000000..7cc5def --- /dev/null +++ b/src/libs/mosquitto/CMakeFiles/3.10.1/CMakeCXXCompiler.cmake @@ -0,0 +1,75 @@ +set(CMAKE_CXX_COMPILER "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++") +set(CMAKE_CXX_COMPILER_ARG1 "") +set(CMAKE_CXX_COMPILER_ID "AppleClang") +set(CMAKE_CXX_COMPILER_VERSION "9.0.0.9000039") +set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "") +set(CMAKE_CXX_COMPILER_WRAPPER "") +set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "98") +set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17") +set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters") +set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates") +set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates") +set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17") + +set(CMAKE_CXX_PLATFORM_ID "Darwin") +set(CMAKE_CXX_SIMULATE_ID "") +set(CMAKE_CXX_SIMULATE_VERSION "") + + + +set(CMAKE_AR "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar") +set(CMAKE_CXX_COMPILER_AR "") +set(CMAKE_RANLIB "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib") +set(CMAKE_CXX_COMPILER_RANLIB "") +set(CMAKE_LINKER "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld") +set(CMAKE_COMPILER_IS_GNUCXX ) +set(CMAKE_CXX_COMPILER_LOADED 1) +set(CMAKE_CXX_COMPILER_WORKS TRUE) +set(CMAKE_CXX_ABI_COMPILED TRUE) +set(CMAKE_COMPILER_IS_MINGW ) +set(CMAKE_COMPILER_IS_CYGWIN ) +if(CMAKE_COMPILER_IS_CYGWIN) + set(CYGWIN 1) + set(UNIX 1) +endif() + +set(CMAKE_CXX_COMPILER_ENV_VAR "CXX") + +if(CMAKE_COMPILER_IS_MINGW) + set(MINGW 1) +endif() +set(CMAKE_CXX_COMPILER_ID_RUN 1) +set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) +set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;mm;CPP) +set(CMAKE_CXX_LINKER_PREFERENCE 30) +set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) + +# Save compiler ABI information. +set(CMAKE_CXX_SIZEOF_DATA_PTR "8") +set(CMAKE_CXX_COMPILER_ABI "") +set(CMAKE_CXX_LIBRARY_ARCHITECTURE "") + +if(CMAKE_CXX_SIZEOF_DATA_PTR) + set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") +endif() + +if(CMAKE_CXX_COMPILER_ABI) + set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") +endif() + +if(CMAKE_CXX_LIBRARY_ARCHITECTURE) + set(CMAKE_LIBRARY_ARCHITECTURE "") +endif() + +set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "") +if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX) + set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}") +endif() + + + + + +set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "c++") +set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/lib") +set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks") diff --git a/src/libs/mosquitto/CMakeFiles/3.10.1/CMakeDetermineCompilerABI_C.bin b/src/libs/mosquitto/CMakeFiles/3.10.1/CMakeDetermineCompilerABI_C.bin new file mode 100755 index 0000000000000000000000000000000000000000..58c16c4f805a10f141c5b69901d07303a28eb994 GIT binary patch literal 4304 zcmeHKL2DC16rLE1MXM=DMNu?}NL5Gzu^6-m6<0S@+M*RiDPxn}(uHOt*Kdj+?ruDEtxd@Ct{rnHcC0?+?`8rQTe0kn9vx# zi6JOjQX*ySuf!U_Y_Inqhsz*d)?0{o54IDmnNZ4lGmHiWx7XXy^~Q7(ajKqK48D{} z_$UZH8H9^Xh12(aqwA4V3Nd-#Ne2AitWHlk*Q$N)z)y-d&DSSgh`gzFjZflzOFJE6 z#!-j8v8Th(Szz9G9riNpKE|M?@NKB(dFJ~6eEx5F=m@l!M6Kd-P%CUFsSOzQumI2FvWq=IaaXVk# z=R*^4H=SRMblO{PC;7hVbcx)0vXy%~S<1G%op$$`)1806Zc26f`pm^Bc#pmPrY@AS4@Bvi9#ayO06tTxc#0d81Xv}3;@Ab&_0u+|6 ek~}8pzk5;BbgB!fy5pcIqd2L_8fI=ZE&c#Pn3SIY literal 0 HcmV?d00001 diff --git a/src/libs/mosquitto/CMakeFiles/3.10.1/CMakeDetermineCompilerABI_CXX.bin b/src/libs/mosquitto/CMakeFiles/3.10.1/CMakeDetermineCompilerABI_CXX.bin new file mode 100755 index 0000000000000000000000000000000000000000..fe6fd4c917168015de6aef6ee96f2b04544961ee GIT binary patch literal 4288 zcmeHKO=}ZT6n)bg{HjeiilRsq6>Tv|@q-|OD2^sr+M*FkOSv}5lnykBBr})_fg-pV zMChWp6c^$zaN$Y>7hSq_=|XoATvieBoR=3eQ$KJmbK%T==gqzM-FM#VzWet1$9AQx zL8Vp)lu}7x2IQeiVWrdoAP`Zo;UueJDpIc3n*D-X>pe5|_L?N}NWE||tVR6V zJ-1d7x3*Z&d;Q5pH>sI3BG3=owrS|O780~TH!A|17%;Woqjpt+m{?oeeTtnMd|7@IJ z9ve%Kr_qF4(tYK^@#-Vwh{oSqX?jjIeZ{08TB#EN`^)091OAlZ)HAkNfmnf9fmnf9 zfmnf9fmnf9fmnh6Q-Rz0;8Xr_;v89kP7c-%P%~m>q0)f_CST z-I;&87Pi9VwW$kD_r6nKl*(PNF_+EFGmo>@AueEH&zXiZ&slh4-ON8+b4D9N=7`P) zVHry>Uk^xiNt~8b_B}_IoP~u{xdi__r4_}80{8J4uV!wq}e tr+K%RUa#;B)0V=d{Og&b&*b>24 & 0x00FF) +# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) +# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) + +#elif defined(__BORLANDC__) +# define COMPILER_ID "Borland" + /* __BORLANDC__ = 0xVRR */ +# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) +# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) + +#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 +# define COMPILER_ID "Watcom" + /* __WATCOMC__ = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__WATCOMC__) +# define COMPILER_ID "OpenWatcom" + /* __WATCOMC__ = VVRP + 1100 */ +# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__SUNPRO_C) +# define COMPILER_ID "SunPro" +# if __SUNPRO_C >= 0x5100 + /* __SUNPRO_C = 0xVRRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) +# else + /* __SUNPRO_CC = 0xVRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) +# endif + +#elif defined(__HP_cc) +# define COMPILER_ID "HP" + /* __HP_cc = VVRRPP */ +# define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000) +# define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100) +# define COMPILER_VERSION_PATCH DEC(__HP_cc % 100) + +#elif defined(__DECC) +# define COMPILER_ID "Compaq" + /* __DECC_VER = VVRRTPPPP */ +# define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000) +# define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100) +# define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000) + +#elif defined(__IBMC__) && defined(__COMPILER_VER__) +# define COMPILER_ID "zOS" + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) + +#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800 +# define COMPILER_ID "XL" + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) + +#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ < 800 +# define COMPILER_ID "VisualAge" + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) + +#elif defined(__PGI) +# define COMPILER_ID "PGI" +# define COMPILER_VERSION_MAJOR DEC(__PGIC__) +# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) +# if defined(__PGIC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) +# endif + +#elif defined(_CRAYC) +# define COMPILER_ID "Cray" +# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) +# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) + +#elif defined(__TI_COMPILER_VERSION__) +# define COMPILER_ID "TI" + /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ +# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) +# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) +# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) + +#elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version) +# define COMPILER_ID "Fujitsu" + +#elif defined(__TINYC__) +# define COMPILER_ID "TinyCC" + +#elif defined(__BCC__) +# define COMPILER_ID "Bruce" + +#elif defined(__SCO_VERSION__) +# define COMPILER_ID "SCO" + +#elif defined(__clang__) && defined(__apple_build_version__) +# define COMPILER_ID "AppleClang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) + +#elif defined(__clang__) +# define COMPILER_ID "Clang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif + +#elif defined(__GNUC__) +# define COMPILER_ID "GNU" +# define COMPILER_VERSION_MAJOR DEC(__GNUC__) +# if defined(__GNUC_MINOR__) +# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) +# endif +# if defined(__GNUC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif + +#elif defined(_MSC_VER) +# define COMPILER_ID "MSVC" + /* _MSC_VER = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) +# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) +# if defined(_MSC_FULL_VER) +# if _MSC_VER >= 1400 + /* _MSC_FULL_VER = VVRRPPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) +# else + /* _MSC_FULL_VER = VVRRPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) +# endif +# endif +# if defined(_MSC_BUILD) +# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) +# endif + +#elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) +# define COMPILER_ID "ADSP" +#if defined(__VISUALDSPVERSION__) + /* __VISUALDSPVERSION__ = 0xVVRRPP00 */ +# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24) +# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF) +#endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# define COMPILER_ID "IAR" +# if defined(__VER__) +# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) +# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) +# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) +# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) +# endif + +#elif defined(__ARMCC_VERSION) +# define COMPILER_ID "ARMCC" +#if __ARMCC_VERSION >= 1000000 + /* __ARMCC_VERSION = VRRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#else + /* __ARMCC_VERSION = VRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#endif + + +#elif defined(__SDCC_VERSION_MAJOR) || defined(SDCC) +# define COMPILER_ID "SDCC" +# if defined(__SDCC_VERSION_MAJOR) +# define COMPILER_VERSION_MAJOR DEC(__SDCC_VERSION_MAJOR) +# define COMPILER_VERSION_MINOR DEC(__SDCC_VERSION_MINOR) +# define COMPILER_VERSION_PATCH DEC(__SDCC_VERSION_PATCH) +# else + /* SDCC = VRP */ +# define COMPILER_VERSION_MAJOR DEC(SDCC/100) +# define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10) +# define COMPILER_VERSION_PATCH DEC(SDCC % 10) +# endif + +#elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION) +# define COMPILER_ID "MIPSpro" +# if defined(_SGI_COMPILER_VERSION) + /* _SGI_COMPILER_VERSION = VRP */ +# define COMPILER_VERSION_MAJOR DEC(_SGI_COMPILER_VERSION/100) +# define COMPILER_VERSION_MINOR DEC(_SGI_COMPILER_VERSION/10 % 10) +# define COMPILER_VERSION_PATCH DEC(_SGI_COMPILER_VERSION % 10) +# else + /* _COMPILER_VERSION = VRP */ +# define COMPILER_VERSION_MAJOR DEC(_COMPILER_VERSION/100) +# define COMPILER_VERSION_MINOR DEC(_COMPILER_VERSION/10 % 10) +# define COMPILER_VERSION_PATCH DEC(_COMPILER_VERSION % 10) +# endif + + +/* These compilers are either not known or too old to define an + identification macro. Try to identify the platform and guess that + it is the native compiler. */ +#elif defined(__sgi) +# define COMPILER_ID "MIPSpro" + +#elif defined(__hpux) || defined(__hpua) +# define COMPILER_ID "HP" + +#else /* unknown compiler */ +# define COMPILER_ID "" +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; +#ifdef SIMULATE_ID +char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; +#endif + +#ifdef __QNXNTO__ +char const* qnxnto = "INFO" ":" "qnxnto[]"; +#endif + +#if defined(__CRAYXE) || defined(__CRAYXC) +char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; +#endif + +#define STRINGIFY_HELPER(X) #X +#define STRINGIFY(X) STRINGIFY_HELPER(X) + +/* Identify known platforms by name. */ +#if defined(__linux) || defined(__linux__) || defined(linux) +# define PLATFORM_ID "Linux" + +#elif defined(__CYGWIN__) +# define PLATFORM_ID "Cygwin" + +#elif defined(__MINGW32__) +# define PLATFORM_ID "MinGW" + +#elif defined(__APPLE__) +# define PLATFORM_ID "Darwin" + +#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) +# define PLATFORM_ID "Windows" + +#elif defined(__FreeBSD__) || defined(__FreeBSD) +# define PLATFORM_ID "FreeBSD" + +#elif defined(__NetBSD__) || defined(__NetBSD) +# define PLATFORM_ID "NetBSD" + +#elif defined(__OpenBSD__) || defined(__OPENBSD) +# define PLATFORM_ID "OpenBSD" + +#elif defined(__sun) || defined(sun) +# define PLATFORM_ID "SunOS" + +#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) +# define PLATFORM_ID "AIX" + +#elif defined(__sgi) || defined(__sgi__) || defined(_SGI) +# define PLATFORM_ID "IRIX" + +#elif defined(__hpux) || defined(__hpux__) +# define PLATFORM_ID "HP-UX" + +#elif defined(__HAIKU__) +# define PLATFORM_ID "Haiku" + +#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) +# define PLATFORM_ID "BeOS" + +#elif defined(__QNX__) || defined(__QNXNTO__) +# define PLATFORM_ID "QNX" + +#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) +# define PLATFORM_ID "Tru64" + +#elif defined(__riscos) || defined(__riscos__) +# define PLATFORM_ID "RISCos" + +#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) +# define PLATFORM_ID "SINIX" + +#elif defined(__UNIX_SV__) +# define PLATFORM_ID "UNIX_SV" + +#elif defined(__bsdos__) +# define PLATFORM_ID "BSDOS" + +#elif defined(_MPRAS) || defined(MPRAS) +# define PLATFORM_ID "MP-RAS" + +#elif defined(__osf) || defined(__osf__) +# define PLATFORM_ID "OSF1" + +#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) +# define PLATFORM_ID "SCO_SV" + +#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) +# define PLATFORM_ID "ULTRIX" + +#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) +# define PLATFORM_ID "Xenix" + +#elif defined(__WATCOMC__) +# if defined(__LINUX__) +# define PLATFORM_ID "Linux" + +# elif defined(__DOS__) +# define PLATFORM_ID "DOS" + +# elif defined(__OS2__) +# define PLATFORM_ID "OS2" + +# elif defined(__WINDOWS__) +# define PLATFORM_ID "Windows3x" + +# else /* unknown platform */ +# define PLATFORM_ID +# endif + +#else /* unknown platform */ +# define PLATFORM_ID + +#endif + +/* For windows compilers MSVC and Intel we can determine + the architecture of the compiler being used. This is because + the compilers do not have flags that can change the architecture, + but rather depend on which compiler is being used +*/ +#if defined(_WIN32) && defined(_MSC_VER) +# if defined(_M_IA64) +# define ARCHITECTURE_ID "IA64" + +# elif defined(_M_X64) || defined(_M_AMD64) +# define ARCHITECTURE_ID "x64" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# elif defined(_M_ARM64) +# define ARCHITECTURE_ID "ARM64" + +# elif defined(_M_ARM) +# if _M_ARM == 4 +# define ARCHITECTURE_ID "ARMV4I" +# elif _M_ARM == 5 +# define ARCHITECTURE_ID "ARMV5I" +# else +# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) +# endif + +# elif defined(_M_MIPS) +# define ARCHITECTURE_ID "MIPS" + +# elif defined(_M_SH) +# define ARCHITECTURE_ID "SHx" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__WATCOMC__) +# if defined(_M_I86) +# define ARCHITECTURE_ID "I86" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# if defined(__ICCARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__ICCAVR__) +# define ARCHITECTURE_ID "AVR" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif +#else +# define ARCHITECTURE_ID +#endif + +/* Convert integer to decimal digit literals. */ +#define DEC(n) \ + ('0' + (((n) / 10000000)%10)), \ + ('0' + (((n) / 1000000)%10)), \ + ('0' + (((n) / 100000)%10)), \ + ('0' + (((n) / 10000)%10)), \ + ('0' + (((n) / 1000)%10)), \ + ('0' + (((n) / 100)%10)), \ + ('0' + (((n) / 10)%10)), \ + ('0' + ((n) % 10)) + +/* Convert integer to hex digit literals. */ +#define HEX(n) \ + ('0' + ((n)>>28 & 0xF)), \ + ('0' + ((n)>>24 & 0xF)), \ + ('0' + ((n)>>20 & 0xF)), \ + ('0' + ((n)>>16 & 0xF)), \ + ('0' + ((n)>>12 & 0xF)), \ + ('0' + ((n)>>8 & 0xF)), \ + ('0' + ((n)>>4 & 0xF)), \ + ('0' + ((n) & 0xF)) + +/* Construct a string literal encoding the version number components. */ +#ifdef COMPILER_VERSION_MAJOR +char const info_version[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', + COMPILER_VERSION_MAJOR, +# ifdef COMPILER_VERSION_MINOR + '.', COMPILER_VERSION_MINOR, +# ifdef COMPILER_VERSION_PATCH + '.', COMPILER_VERSION_PATCH, +# ifdef COMPILER_VERSION_TWEAK + '.', COMPILER_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct a string literal encoding the internal version number. */ +#ifdef COMPILER_VERSION_INTERNAL +char const info_version_internal[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', + 'i','n','t','e','r','n','a','l','[', + COMPILER_VERSION_INTERNAL,']','\0'}; +#endif + +/* Construct a string literal encoding the version number components. */ +#ifdef SIMULATE_VERSION_MAJOR +char const info_simulate_version[] = { + 'I', 'N', 'F', 'O', ':', + 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', + SIMULATE_VERSION_MAJOR, +# ifdef SIMULATE_VERSION_MINOR + '.', SIMULATE_VERSION_MINOR, +# ifdef SIMULATE_VERSION_PATCH + '.', SIMULATE_VERSION_PATCH, +# ifdef SIMULATE_VERSION_TWEAK + '.', SIMULATE_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; +char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; + + + + +#if !defined(__STDC__) +# if defined(_MSC_VER) && !defined(__clang__) +# define C_DIALECT "90" +# else +# define C_DIALECT +# endif +#elif __STDC_VERSION__ >= 201000L +# define C_DIALECT "11" +#elif __STDC_VERSION__ >= 199901L +# define C_DIALECT "99" +#else +# define C_DIALECT "90" +#endif +const char* info_language_dialect_default = + "INFO" ":" "dialect_default[" C_DIALECT "]"; + +/*--------------------------------------------------------------------------*/ + +#ifdef ID_VOID_MAIN +void main() {} +#else +# if defined(__CLASSIC_C__) +int main(argc, argv) int argc; char *argv[]; +# else +int main(int argc, char* argv[]) +# endif +{ + int require = 0; + require += info_compiler[argc]; + require += info_platform[argc]; + require += info_arch[argc]; +#ifdef COMPILER_VERSION_MAJOR + require += info_version[argc]; +#endif +#ifdef COMPILER_VERSION_INTERNAL + require += info_version_internal[argc]; +#endif +#ifdef SIMULATE_ID + require += info_simulate[argc]; +#endif +#ifdef SIMULATE_VERSION_MAJOR + require += info_simulate_version[argc]; +#endif +#if defined(__CRAYXE) || defined(__CRAYXC) + require += info_cray[argc]; +#endif + require += info_language_dialect_default[argc]; + (void)argv; + return require; +} +#endif diff --git a/src/libs/mosquitto/CMakeFiles/3.10.1/CompilerIdCXX/CMakeCXXCompilerId.cpp b/src/libs/mosquitto/CMakeFiles/3.10.1/CompilerIdCXX/CMakeCXXCompilerId.cpp new file mode 100644 index 0000000..2d66298 --- /dev/null +++ b/src/libs/mosquitto/CMakeFiles/3.10.1/CompilerIdCXX/CMakeCXXCompilerId.cpp @@ -0,0 +1,576 @@ +/* This source file must have a .cpp extension so that all C++ compilers + recognize the extension without flags. Borland does not know .cxx for + example. */ +#ifndef __cplusplus +# error "A C compiler has been selected for C++." +#endif + + +/* Version number components: V=Version, R=Revision, P=Patch + Version date components: YYYY=Year, MM=Month, DD=Day */ + +#if defined(__COMO__) +# define COMPILER_ID "Comeau" + /* __COMO_VERSION__ = VRR */ +# define COMPILER_VERSION_MAJOR DEC(__COMO_VERSION__ / 100) +# define COMPILER_VERSION_MINOR DEC(__COMO_VERSION__ % 100) + +#elif defined(__INTEL_COMPILER) || defined(__ICC) +# define COMPILER_ID "Intel" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif + /* __INTEL_COMPILER = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) +# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) +# if defined(__INTEL_COMPILER_UPDATE) +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) +# else +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) +# endif +# if defined(__INTEL_COMPILER_BUILD_DATE) + /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ +# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) +# endif +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif + +#elif defined(__PATHCC__) +# define COMPILER_ID "PathScale" +# define COMPILER_VERSION_MAJOR DEC(__PATHCC__) +# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) +# if defined(__PATHCC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) +# endif + +#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) +# define COMPILER_ID "Embarcadero" +# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) +# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) +# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) + +#elif defined(__BORLANDC__) +# define COMPILER_ID "Borland" + /* __BORLANDC__ = 0xVRR */ +# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) +# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) + +#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 +# define COMPILER_ID "Watcom" + /* __WATCOMC__ = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__WATCOMC__) +# define COMPILER_ID "OpenWatcom" + /* __WATCOMC__ = VVRP + 1100 */ +# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__SUNPRO_CC) +# define COMPILER_ID "SunPro" +# if __SUNPRO_CC >= 0x5100 + /* __SUNPRO_CC = 0xVRRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) +# else + /* __SUNPRO_CC = 0xVRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) +# endif + +#elif defined(__HP_aCC) +# define COMPILER_ID "HP" + /* __HP_aCC = VVRRPP */ +# define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000) +# define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100) +# define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100) + +#elif defined(__DECCXX) +# define COMPILER_ID "Compaq" + /* __DECCXX_VER = VVRRTPPPP */ +# define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000) +# define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100) +# define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000) + +#elif defined(__IBMCPP__) && defined(__COMPILER_VER__) +# define COMPILER_ID "zOS" + /* __IBMCPP__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) + +#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800 +# define COMPILER_ID "XL" + /* __IBMCPP__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) + +#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ < 800 +# define COMPILER_ID "VisualAge" + /* __IBMCPP__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) + +#elif defined(__PGI) +# define COMPILER_ID "PGI" +# define COMPILER_VERSION_MAJOR DEC(__PGIC__) +# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) +# if defined(__PGIC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) +# endif + +#elif defined(_CRAYC) +# define COMPILER_ID "Cray" +# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) +# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) + +#elif defined(__TI_COMPILER_VERSION__) +# define COMPILER_ID "TI" + /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ +# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) +# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) +# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) + +#elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version) +# define COMPILER_ID "Fujitsu" + +#elif defined(__SCO_VERSION__) +# define COMPILER_ID "SCO" + +#elif defined(__clang__) && defined(__apple_build_version__) +# define COMPILER_ID "AppleClang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) + +#elif defined(__clang__) +# define COMPILER_ID "Clang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif + +#elif defined(__GNUC__) || defined(__GNUG__) +# define COMPILER_ID "GNU" +# if defined(__GNUC__) +# define COMPILER_VERSION_MAJOR DEC(__GNUC__) +# else +# define COMPILER_VERSION_MAJOR DEC(__GNUG__) +# endif +# if defined(__GNUC_MINOR__) +# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) +# endif +# if defined(__GNUC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif + +#elif defined(_MSC_VER) +# define COMPILER_ID "MSVC" + /* _MSC_VER = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) +# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) +# if defined(_MSC_FULL_VER) +# if _MSC_VER >= 1400 + /* _MSC_FULL_VER = VVRRPPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) +# else + /* _MSC_FULL_VER = VVRRPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) +# endif +# endif +# if defined(_MSC_BUILD) +# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) +# endif + +#elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) +# define COMPILER_ID "ADSP" +#if defined(__VISUALDSPVERSION__) + /* __VISUALDSPVERSION__ = 0xVVRRPP00 */ +# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24) +# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF) +#endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# define COMPILER_ID "IAR" +# if defined(__VER__) +# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) +# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) +# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) +# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) +# endif + +#elif defined(__ARMCC_VERSION) +# define COMPILER_ID "ARMCC" +#if __ARMCC_VERSION >= 1000000 + /* __ARMCC_VERSION = VRRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#else + /* __ARMCC_VERSION = VRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#endif + + +#elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION) +# define COMPILER_ID "MIPSpro" +# if defined(_SGI_COMPILER_VERSION) + /* _SGI_COMPILER_VERSION = VRP */ +# define COMPILER_VERSION_MAJOR DEC(_SGI_COMPILER_VERSION/100) +# define COMPILER_VERSION_MINOR DEC(_SGI_COMPILER_VERSION/10 % 10) +# define COMPILER_VERSION_PATCH DEC(_SGI_COMPILER_VERSION % 10) +# else + /* _COMPILER_VERSION = VRP */ +# define COMPILER_VERSION_MAJOR DEC(_COMPILER_VERSION/100) +# define COMPILER_VERSION_MINOR DEC(_COMPILER_VERSION/10 % 10) +# define COMPILER_VERSION_PATCH DEC(_COMPILER_VERSION % 10) +# endif + + +/* These compilers are either not known or too old to define an + identification macro. Try to identify the platform and guess that + it is the native compiler. */ +#elif defined(__sgi) +# define COMPILER_ID "MIPSpro" + +#elif defined(__hpux) || defined(__hpua) +# define COMPILER_ID "HP" + +#else /* unknown compiler */ +# define COMPILER_ID "" +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; +#ifdef SIMULATE_ID +char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; +#endif + +#ifdef __QNXNTO__ +char const* qnxnto = "INFO" ":" "qnxnto[]"; +#endif + +#if defined(__CRAYXE) || defined(__CRAYXC) +char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; +#endif + +#define STRINGIFY_HELPER(X) #X +#define STRINGIFY(X) STRINGIFY_HELPER(X) + +/* Identify known platforms by name. */ +#if defined(__linux) || defined(__linux__) || defined(linux) +# define PLATFORM_ID "Linux" + +#elif defined(__CYGWIN__) +# define PLATFORM_ID "Cygwin" + +#elif defined(__MINGW32__) +# define PLATFORM_ID "MinGW" + +#elif defined(__APPLE__) +# define PLATFORM_ID "Darwin" + +#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) +# define PLATFORM_ID "Windows" + +#elif defined(__FreeBSD__) || defined(__FreeBSD) +# define PLATFORM_ID "FreeBSD" + +#elif defined(__NetBSD__) || defined(__NetBSD) +# define PLATFORM_ID "NetBSD" + +#elif defined(__OpenBSD__) || defined(__OPENBSD) +# define PLATFORM_ID "OpenBSD" + +#elif defined(__sun) || defined(sun) +# define PLATFORM_ID "SunOS" + +#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) +# define PLATFORM_ID "AIX" + +#elif defined(__sgi) || defined(__sgi__) || defined(_SGI) +# define PLATFORM_ID "IRIX" + +#elif defined(__hpux) || defined(__hpux__) +# define PLATFORM_ID "HP-UX" + +#elif defined(__HAIKU__) +# define PLATFORM_ID "Haiku" + +#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) +# define PLATFORM_ID "BeOS" + +#elif defined(__QNX__) || defined(__QNXNTO__) +# define PLATFORM_ID "QNX" + +#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) +# define PLATFORM_ID "Tru64" + +#elif defined(__riscos) || defined(__riscos__) +# define PLATFORM_ID "RISCos" + +#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) +# define PLATFORM_ID "SINIX" + +#elif defined(__UNIX_SV__) +# define PLATFORM_ID "UNIX_SV" + +#elif defined(__bsdos__) +# define PLATFORM_ID "BSDOS" + +#elif defined(_MPRAS) || defined(MPRAS) +# define PLATFORM_ID "MP-RAS" + +#elif defined(__osf) || defined(__osf__) +# define PLATFORM_ID "OSF1" + +#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) +# define PLATFORM_ID "SCO_SV" + +#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) +# define PLATFORM_ID "ULTRIX" + +#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) +# define PLATFORM_ID "Xenix" + +#elif defined(__WATCOMC__) +# if defined(__LINUX__) +# define PLATFORM_ID "Linux" + +# elif defined(__DOS__) +# define PLATFORM_ID "DOS" + +# elif defined(__OS2__) +# define PLATFORM_ID "OS2" + +# elif defined(__WINDOWS__) +# define PLATFORM_ID "Windows3x" + +# else /* unknown platform */ +# define PLATFORM_ID +# endif + +#else /* unknown platform */ +# define PLATFORM_ID + +#endif + +/* For windows compilers MSVC and Intel we can determine + the architecture of the compiler being used. This is because + the compilers do not have flags that can change the architecture, + but rather depend on which compiler is being used +*/ +#if defined(_WIN32) && defined(_MSC_VER) +# if defined(_M_IA64) +# define ARCHITECTURE_ID "IA64" + +# elif defined(_M_X64) || defined(_M_AMD64) +# define ARCHITECTURE_ID "x64" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# elif defined(_M_ARM64) +# define ARCHITECTURE_ID "ARM64" + +# elif defined(_M_ARM) +# if _M_ARM == 4 +# define ARCHITECTURE_ID "ARMV4I" +# elif _M_ARM == 5 +# define ARCHITECTURE_ID "ARMV5I" +# else +# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) +# endif + +# elif defined(_M_MIPS) +# define ARCHITECTURE_ID "MIPS" + +# elif defined(_M_SH) +# define ARCHITECTURE_ID "SHx" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__WATCOMC__) +# if defined(_M_I86) +# define ARCHITECTURE_ID "I86" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# if defined(__ICCARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__ICCAVR__) +# define ARCHITECTURE_ID "AVR" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif +#else +# define ARCHITECTURE_ID +#endif + +/* Convert integer to decimal digit literals. */ +#define DEC(n) \ + ('0' + (((n) / 10000000)%10)), \ + ('0' + (((n) / 1000000)%10)), \ + ('0' + (((n) / 100000)%10)), \ + ('0' + (((n) / 10000)%10)), \ + ('0' + (((n) / 1000)%10)), \ + ('0' + (((n) / 100)%10)), \ + ('0' + (((n) / 10)%10)), \ + ('0' + ((n) % 10)) + +/* Convert integer to hex digit literals. */ +#define HEX(n) \ + ('0' + ((n)>>28 & 0xF)), \ + ('0' + ((n)>>24 & 0xF)), \ + ('0' + ((n)>>20 & 0xF)), \ + ('0' + ((n)>>16 & 0xF)), \ + ('0' + ((n)>>12 & 0xF)), \ + ('0' + ((n)>>8 & 0xF)), \ + ('0' + ((n)>>4 & 0xF)), \ + ('0' + ((n) & 0xF)) + +/* Construct a string literal encoding the version number components. */ +#ifdef COMPILER_VERSION_MAJOR +char const info_version[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', + COMPILER_VERSION_MAJOR, +# ifdef COMPILER_VERSION_MINOR + '.', COMPILER_VERSION_MINOR, +# ifdef COMPILER_VERSION_PATCH + '.', COMPILER_VERSION_PATCH, +# ifdef COMPILER_VERSION_TWEAK + '.', COMPILER_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct a string literal encoding the internal version number. */ +#ifdef COMPILER_VERSION_INTERNAL +char const info_version_internal[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', + 'i','n','t','e','r','n','a','l','[', + COMPILER_VERSION_INTERNAL,']','\0'}; +#endif + +/* Construct a string literal encoding the version number components. */ +#ifdef SIMULATE_VERSION_MAJOR +char const info_simulate_version[] = { + 'I', 'N', 'F', 'O', ':', + 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', + SIMULATE_VERSION_MAJOR, +# ifdef SIMULATE_VERSION_MINOR + '.', SIMULATE_VERSION_MINOR, +# ifdef SIMULATE_VERSION_PATCH + '.', SIMULATE_VERSION_PATCH, +# ifdef SIMULATE_VERSION_TWEAK + '.', SIMULATE_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; +char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; + + + + +#if defined(_MSC_VER) && defined(_MSVC_LANG) +#define CXX_STD _MSVC_LANG +#else +#define CXX_STD __cplusplus +#endif + +const char* info_language_dialect_default = "INFO" ":" "dialect_default[" +#if CXX_STD > 201402L + "17" +#elif CXX_STD >= 201402L + "14" +#elif CXX_STD >= 201103L + "11" +#else + "98" +#endif +"]"; + +/*--------------------------------------------------------------------------*/ + +int main(int argc, char* argv[]) +{ + int require = 0; + require += info_compiler[argc]; + require += info_platform[argc]; +#ifdef COMPILER_VERSION_MAJOR + require += info_version[argc]; +#endif +#ifdef COMPILER_VERSION_INTERNAL + require += info_version_internal[argc]; +#endif +#ifdef SIMULATE_ID + require += info_simulate[argc]; +#endif +#ifdef SIMULATE_VERSION_MAJOR + require += info_simulate_version[argc]; +#endif +#if defined(__CRAYXE) || defined(__CRAYXC) + require += info_cray[argc]; +#endif + require += info_language_dialect_default[argc]; + (void)argv; + return require; +} diff --git a/src/libs/mosquitto/CMakeFiles/CMakeDirectoryInformation.cmake b/src/libs/mosquitto/CMakeFiles/CMakeDirectoryInformation.cmake new file mode 100644 index 0000000..8cf4b23 --- /dev/null +++ b/src/libs/mosquitto/CMakeFiles/CMakeDirectoryInformation.cmake @@ -0,0 +1,16 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.10 + +# Relative path conversion top directories. +set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/Users/benjamin/orchestra/src/libs/mosquitto") +set(CMAKE_RELATIVE_PATH_TOP_BINARY "/Users/benjamin/orchestra/src/libs/mosquitto") + +# Force unix paths in dependencies. +set(CMAKE_FORCE_UNIX_PATHS 1) + + +# The C and CXX include file regular expressions for this directory. +set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") +set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") +set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) +set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) diff --git a/src/libs/mosquitto/CMakeFiles/CMakeError.log b/src/libs/mosquitto/CMakeFiles/CMakeError.log new file mode 100644 index 0000000..d118db5 --- /dev/null +++ b/src/libs/mosquitto/CMakeFiles/CMakeError.log @@ -0,0 +1,16 @@ +Determining if the function getaddrinfo_a exists in the anl failed with the following output: +Change Dir: /Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_a3792/fast" +/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_a3792.dir/build.make CMakeFiles/cmTC_a3792.dir/build +Building C object CMakeFiles/cmTC_a3792.dir/CheckFunctionExists.c.o +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -DCHECK_FUNCTION_EXISTS=getaddrinfo_a -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -o CMakeFiles/cmTC_a3792.dir/CheckFunctionExists.c.o -c /usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CheckFunctionExists.c +Linking C executable cmTC_a3792 +/usr/local/Cellar/cmake/3.10.1/bin/cmake -E cmake_link_script CMakeFiles/cmTC_a3792.dir/link.txt --verbose=1 +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -DCHECK_FUNCTION_EXISTS=getaddrinfo_a -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_a3792.dir/CheckFunctionExists.c.o -o cmTC_a3792 -lanl +ld: library not found for -lanl +clang: error: linker command failed with exit code 1 (use -v to see invocation) +make[1]: *** [cmTC_a3792] Error 1 +make: *** [cmTC_a3792/fast] Error 2 + + diff --git a/src/libs/mosquitto/CMakeFiles/CMakeOutput.log b/src/libs/mosquitto/CMakeFiles/CMakeOutput.log new file mode 100644 index 0000000..fe88354 --- /dev/null +++ b/src/libs/mosquitto/CMakeFiles/CMakeOutput.log @@ -0,0 +1,528 @@ +The system is: Darwin - 17.3.0 - x86_64 +Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded. +Compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc +Build flags: +Id flags: + +The output was: +0 + + +Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "a.out" + +The C compiler identification is AppleClang, found in "/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles/3.10.1/CompilerIdC/a.out" + +Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded. +Compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ +Build flags: +Id flags: + +The output was: +0 + + +Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "a.out" + +The CXX compiler identification is AppleClang, found in "/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles/3.10.1/CompilerIdCXX/a.out" + +Determining if the C compiler works passed with the following output: +Change Dir: /Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_102d4/fast" +/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_102d4.dir/build.make CMakeFiles/cmTC_102d4.dir/build +Building C object CMakeFiles/cmTC_102d4.dir/testCCompiler.c.o +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -o CMakeFiles/cmTC_102d4.dir/testCCompiler.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles/CMakeTmp/testCCompiler.c +Linking C executable cmTC_102d4 +/usr/local/Cellar/cmake/3.10.1/bin/cmake -E cmake_link_script CMakeFiles/cmTC_102d4.dir/link.txt --verbose=1 +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_102d4.dir/testCCompiler.c.o -o cmTC_102d4 + + +Detecting C compiler ABI info compiled with the following output: +Change Dir: /Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_695e8/fast" +/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_695e8.dir/build.make CMakeFiles/cmTC_695e8.dir/build +Building C object CMakeFiles/cmTC_695e8.dir/CMakeCCompilerABI.c.o +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -o CMakeFiles/cmTC_695e8.dir/CMakeCCompilerABI.c.o -c /usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeCCompilerABI.c +Linking C executable cmTC_695e8 +/usr/local/Cellar/cmake/3.10.1/bin/cmake -E cmake_link_script CMakeFiles/cmTC_695e8.dir/link.txt --verbose=1 +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -v -Wl,-v CMakeFiles/cmTC_695e8.dir/CMakeCCompilerABI.c.o -o cmTC_695e8 +Apple LLVM version 9.0.0 (clang-900.0.39.2) +Target: x86_64-apple-darwin17.3.0 +Thread model: posix +InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin + "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch x86_64 -macosx_version_min 10.13.0 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -o cmTC_695e8 -search_paths_first -headerpad_max_install_names -v CMakeFiles/cmTC_695e8.dir/CMakeCCompilerABI.c.o -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/lib/darwin/libclang_rt.osx.a +@(#)PROGRAM:ld PROJECT:ld64-305 +configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em (tvOS) +Library search paths: + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/lib +Framework search paths: + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/ + + +Parsed C implicit link information from above output: + link line regex: [^( *|.*[/\])(ld|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\]+-)?ld|collect2)[^/\]*( |$)] + ignore line: [Change Dir: /Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles/CMakeTmp] + ignore line: [] + ignore line: [Run Build Command:"/usr/bin/make" "cmTC_695e8/fast"] + ignore line: [/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_695e8.dir/build.make CMakeFiles/cmTC_695e8.dir/build] + ignore line: [Building C object CMakeFiles/cmTC_695e8.dir/CMakeCCompilerABI.c.o] + ignore line: [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -o CMakeFiles/cmTC_695e8.dir/CMakeCCompilerABI.c.o -c /usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeCCompilerABI.c] + ignore line: [Linking C executable cmTC_695e8] + ignore line: [/usr/local/Cellar/cmake/3.10.1/bin/cmake -E cmake_link_script CMakeFiles/cmTC_695e8.dir/link.txt --verbose=1] + ignore line: [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -v -Wl,-v CMakeFiles/cmTC_695e8.dir/CMakeCCompilerABI.c.o -o cmTC_695e8 ] + ignore line: [Apple LLVM version 9.0.0 (clang-900.0.39.2)] + ignore line: [Target: x86_64-apple-darwin17.3.0] + ignore line: [Thread model: posix] + ignore line: [InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin] + link line: [ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch x86_64 -macosx_version_min 10.13.0 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -o cmTC_695e8 -search_paths_first -headerpad_max_install_names -v CMakeFiles/cmTC_695e8.dir/CMakeCCompilerABI.c.o -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/lib/darwin/libclang_rt.osx.a] + arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld] ==> ignore + arg [-demangle] ==> ignore + arg [-lto_library] ==> ignore, skip following value + arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib] ==> skip value of -lto_library + arg [-dynamic] ==> ignore + arg [-arch] ==> ignore + arg [x86_64] ==> ignore + arg [-macosx_version_min] ==> ignore + arg [10.13.0] ==> ignore + arg [-syslibroot] ==> ignore + arg [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk] ==> ignore + arg [-o] ==> ignore + arg [cmTC_695e8] ==> ignore + arg [-search_paths_first] ==> ignore + arg [-headerpad_max_install_names] ==> ignore + arg [-v] ==> ignore + arg [CMakeFiles/cmTC_695e8.dir/CMakeCCompilerABI.c.o] ==> ignore + arg [-lSystem] ==> lib [System] + arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/lib/darwin/libclang_rt.osx.a] ==> lib [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/lib/darwin/libclang_rt.osx.a] + Library search paths: [;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/lib] + Framework search paths: [;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/] + remove lib [System] + remove lib [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/lib/darwin/libclang_rt.osx.a] + collapse library dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/lib] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/lib] + collapse framework dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks] + implicit libs: [] + implicit dirs: [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/lib] + implicit fwks: [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks] + + + + +Detecting C [-std=c11] compiler features compiled with the following output: +Change Dir: /Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_b5f8d/fast" +/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_b5f8d.dir/build.make CMakeFiles/cmTC_b5f8d.dir/build +Building C object CMakeFiles/cmTC_b5f8d.dir/feature_tests.c.o +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -std=c11 -o CMakeFiles/cmTC_b5f8d.dir/feature_tests.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles/feature_tests.c +Linking C executable cmTC_b5f8d +/usr/local/Cellar/cmake/3.10.1/bin/cmake -E cmake_link_script CMakeFiles/cmTC_b5f8d.dir/link.txt --verbose=1 +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_b5f8d.dir/feature_tests.c.o -o cmTC_b5f8d + + + Feature record: C_FEATURE:1c_function_prototypes + Feature record: C_FEATURE:1c_restrict + Feature record: C_FEATURE:1c_static_assert + Feature record: C_FEATURE:1c_variadic_macros + + +Detecting C [-std=c99] compiler features compiled with the following output: +Change Dir: /Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_01e64/fast" +/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_01e64.dir/build.make CMakeFiles/cmTC_01e64.dir/build +Building C object CMakeFiles/cmTC_01e64.dir/feature_tests.c.o +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -std=c99 -o CMakeFiles/cmTC_01e64.dir/feature_tests.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles/feature_tests.c +Linking C executable cmTC_01e64 +/usr/local/Cellar/cmake/3.10.1/bin/cmake -E cmake_link_script CMakeFiles/cmTC_01e64.dir/link.txt --verbose=1 +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_01e64.dir/feature_tests.c.o -o cmTC_01e64 + + + Feature record: C_FEATURE:1c_function_prototypes + Feature record: C_FEATURE:1c_restrict + Feature record: C_FEATURE:0c_static_assert + Feature record: C_FEATURE:1c_variadic_macros + + +Detecting C [-std=c90] compiler features compiled with the following output: +Change Dir: /Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_50896/fast" +/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_50896.dir/build.make CMakeFiles/cmTC_50896.dir/build +Building C object CMakeFiles/cmTC_50896.dir/feature_tests.c.o +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -std=c90 -o CMakeFiles/cmTC_50896.dir/feature_tests.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles/feature_tests.c +Linking C executable cmTC_50896 +/usr/local/Cellar/cmake/3.10.1/bin/cmake -E cmake_link_script CMakeFiles/cmTC_50896.dir/link.txt --verbose=1 +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_50896.dir/feature_tests.c.o -o cmTC_50896 + + + Feature record: C_FEATURE:1c_function_prototypes + Feature record: C_FEATURE:0c_restrict + Feature record: C_FEATURE:0c_static_assert + Feature record: C_FEATURE:0c_variadic_macros +Determining if the CXX compiler works passed with the following output: +Change Dir: /Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_7e402/fast" +/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_7e402.dir/build.make CMakeFiles/cmTC_7e402.dir/build +Building CXX object CMakeFiles/cmTC_7e402.dir/testCXXCompiler.cxx.o +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -o CMakeFiles/cmTC_7e402.dir/testCXXCompiler.cxx.o -c /Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles/CMakeTmp/testCXXCompiler.cxx +Linking CXX executable cmTC_7e402 +/usr/local/Cellar/cmake/3.10.1/bin/cmake -E cmake_link_script CMakeFiles/cmTC_7e402.dir/link.txt --verbose=1 +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_7e402.dir/testCXXCompiler.cxx.o -o cmTC_7e402 + + +Detecting CXX compiler ABI info compiled with the following output: +Change Dir: /Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_aaaef/fast" +/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_aaaef.dir/build.make CMakeFiles/cmTC_aaaef.dir/build +Building CXX object CMakeFiles/cmTC_aaaef.dir/CMakeCXXCompilerABI.cpp.o +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -o CMakeFiles/cmTC_aaaef.dir/CMakeCXXCompilerABI.cpp.o -c /usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeCXXCompilerABI.cpp +Linking CXX executable cmTC_aaaef +/usr/local/Cellar/cmake/3.10.1/bin/cmake -E cmake_link_script CMakeFiles/cmTC_aaaef.dir/link.txt --verbose=1 +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -v -Wl,-v CMakeFiles/cmTC_aaaef.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_aaaef +Apple LLVM version 9.0.0 (clang-900.0.39.2) +Target: x86_64-apple-darwin17.3.0 +Thread model: posix +InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin + "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch x86_64 -macosx_version_min 10.13.0 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -o cmTC_aaaef -search_paths_first -headerpad_max_install_names -v CMakeFiles/cmTC_aaaef.dir/CMakeCXXCompilerABI.cpp.o -lc++ -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/lib/darwin/libclang_rt.osx.a +@(#)PROGRAM:ld PROJECT:ld64-305 +configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em (tvOS) +Library search paths: + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/lib +Framework search paths: + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/ + + +Parsed CXX implicit link information from above output: + link line regex: [^( *|.*[/\])(ld|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\]+-)?ld|collect2)[^/\]*( |$)] + ignore line: [Change Dir: /Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles/CMakeTmp] + ignore line: [] + ignore line: [Run Build Command:"/usr/bin/make" "cmTC_aaaef/fast"] + ignore line: [/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_aaaef.dir/build.make CMakeFiles/cmTC_aaaef.dir/build] + ignore line: [Building CXX object CMakeFiles/cmTC_aaaef.dir/CMakeCXXCompilerABI.cpp.o] + ignore line: [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -o CMakeFiles/cmTC_aaaef.dir/CMakeCXXCompilerABI.cpp.o -c /usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeCXXCompilerABI.cpp] + ignore line: [Linking CXX executable cmTC_aaaef] + ignore line: [/usr/local/Cellar/cmake/3.10.1/bin/cmake -E cmake_link_script CMakeFiles/cmTC_aaaef.dir/link.txt --verbose=1] + ignore line: [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -v -Wl,-v CMakeFiles/cmTC_aaaef.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_aaaef ] + ignore line: [Apple LLVM version 9.0.0 (clang-900.0.39.2)] + ignore line: [Target: x86_64-apple-darwin17.3.0] + ignore line: [Thread model: posix] + ignore line: [InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin] + link line: [ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch x86_64 -macosx_version_min 10.13.0 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -o cmTC_aaaef -search_paths_first -headerpad_max_install_names -v CMakeFiles/cmTC_aaaef.dir/CMakeCXXCompilerABI.cpp.o -lc++ -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/lib/darwin/libclang_rt.osx.a] + arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld] ==> ignore + arg [-demangle] ==> ignore + arg [-lto_library] ==> ignore, skip following value + arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib] ==> skip value of -lto_library + arg [-dynamic] ==> ignore + arg [-arch] ==> ignore + arg [x86_64] ==> ignore + arg [-macosx_version_min] ==> ignore + arg [10.13.0] ==> ignore + arg [-syslibroot] ==> ignore + arg [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk] ==> ignore + arg [-o] ==> ignore + arg [cmTC_aaaef] ==> ignore + arg [-search_paths_first] ==> ignore + arg [-headerpad_max_install_names] ==> ignore + arg [-v] ==> ignore + arg [CMakeFiles/cmTC_aaaef.dir/CMakeCXXCompilerABI.cpp.o] ==> ignore + arg [-lc++] ==> lib [c++] + arg [-lSystem] ==> lib [System] + arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/lib/darwin/libclang_rt.osx.a] ==> lib [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/lib/darwin/libclang_rt.osx.a] + Library search paths: [;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/lib] + Framework search paths: [;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/] + remove lib [System] + remove lib [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/lib/darwin/libclang_rt.osx.a] + collapse library dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/lib] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/lib] + collapse framework dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks] + implicit libs: [c++] + implicit dirs: [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/lib] + implicit fwks: [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks] + + + + +Detecting CXX [-std=c++1z] compiler features compiled with the following output: +Change Dir: /Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_b6865/fast" +/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_b6865.dir/build.make CMakeFiles/cmTC_b6865.dir/build +Building CXX object CMakeFiles/cmTC_b6865.dir/feature_tests.cxx.o +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -std=c++1z -o CMakeFiles/cmTC_b6865.dir/feature_tests.cxx.o -c /Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles/feature_tests.cxx +Linking CXX executable cmTC_b6865 +/usr/local/Cellar/cmake/3.10.1/bin/cmake -E cmake_link_script CMakeFiles/cmTC_b6865.dir/link.txt --verbose=1 +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_b6865.dir/feature_tests.cxx.o -o cmTC_b6865 + + + Feature record: CXX_FEATURE:1cxx_aggregate_default_initializers + Feature record: CXX_FEATURE:1cxx_alias_templates + Feature record: CXX_FEATURE:1cxx_alignas + Feature record: CXX_FEATURE:1cxx_alignof + Feature record: CXX_FEATURE:1cxx_attributes + Feature record: CXX_FEATURE:1cxx_attribute_deprecated + Feature record: CXX_FEATURE:1cxx_auto_type + Feature record: CXX_FEATURE:1cxx_binary_literals + Feature record: CXX_FEATURE:1cxx_constexpr + Feature record: CXX_FEATURE:1cxx_contextual_conversions + Feature record: CXX_FEATURE:1cxx_decltype + Feature record: CXX_FEATURE:1cxx_decltype_auto + Feature record: CXX_FEATURE:1cxx_decltype_incomplete_return_types + Feature record: CXX_FEATURE:1cxx_default_function_template_args + Feature record: CXX_FEATURE:1cxx_defaulted_functions + Feature record: CXX_FEATURE:1cxx_defaulted_move_initializers + Feature record: CXX_FEATURE:1cxx_delegating_constructors + Feature record: CXX_FEATURE:1cxx_deleted_functions + Feature record: CXX_FEATURE:1cxx_digit_separators + Feature record: CXX_FEATURE:1cxx_enum_forward_declarations + Feature record: CXX_FEATURE:1cxx_explicit_conversions + Feature record: CXX_FEATURE:1cxx_extended_friend_declarations + Feature record: CXX_FEATURE:1cxx_extern_templates + Feature record: CXX_FEATURE:1cxx_final + Feature record: CXX_FEATURE:1cxx_func_identifier + Feature record: CXX_FEATURE:1cxx_generalized_initializers + Feature record: CXX_FEATURE:1cxx_generic_lambdas + Feature record: CXX_FEATURE:1cxx_inheriting_constructors + Feature record: CXX_FEATURE:1cxx_inline_namespaces + Feature record: CXX_FEATURE:1cxx_lambdas + Feature record: CXX_FEATURE:1cxx_lambda_init_captures + Feature record: CXX_FEATURE:1cxx_local_type_template_args + Feature record: CXX_FEATURE:1cxx_long_long_type + Feature record: CXX_FEATURE:1cxx_noexcept + Feature record: CXX_FEATURE:1cxx_nonstatic_member_init + Feature record: CXX_FEATURE:1cxx_nullptr + Feature record: CXX_FEATURE:1cxx_override + Feature record: CXX_FEATURE:1cxx_range_for + Feature record: CXX_FEATURE:1cxx_raw_string_literals + Feature record: CXX_FEATURE:1cxx_reference_qualified_functions + Feature record: CXX_FEATURE:1cxx_relaxed_constexpr + Feature record: CXX_FEATURE:1cxx_return_type_deduction + Feature record: CXX_FEATURE:1cxx_right_angle_brackets + Feature record: CXX_FEATURE:1cxx_rvalue_references + Feature record: CXX_FEATURE:1cxx_sizeof_member + Feature record: CXX_FEATURE:1cxx_static_assert + Feature record: CXX_FEATURE:1cxx_strong_enums + Feature record: CXX_FEATURE:1cxx_template_template_parameters + Feature record: CXX_FEATURE:1cxx_thread_local + Feature record: CXX_FEATURE:1cxx_trailing_return_types + Feature record: CXX_FEATURE:1cxx_unicode_literals + Feature record: CXX_FEATURE:1cxx_uniform_initialization + Feature record: CXX_FEATURE:1cxx_unrestricted_unions + Feature record: CXX_FEATURE:1cxx_user_literals + Feature record: CXX_FEATURE:1cxx_variable_templates + Feature record: CXX_FEATURE:1cxx_variadic_macros + Feature record: CXX_FEATURE:1cxx_variadic_templates + + +Detecting CXX [-std=c++14] compiler features compiled with the following output: +Change Dir: /Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_4e46c/fast" +/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_4e46c.dir/build.make CMakeFiles/cmTC_4e46c.dir/build +Building CXX object CMakeFiles/cmTC_4e46c.dir/feature_tests.cxx.o +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -std=c++14 -o CMakeFiles/cmTC_4e46c.dir/feature_tests.cxx.o -c /Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles/feature_tests.cxx +Linking CXX executable cmTC_4e46c +/usr/local/Cellar/cmake/3.10.1/bin/cmake -E cmake_link_script CMakeFiles/cmTC_4e46c.dir/link.txt --verbose=1 +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_4e46c.dir/feature_tests.cxx.o -o cmTC_4e46c + + + Feature record: CXX_FEATURE:1cxx_aggregate_default_initializers + Feature record: CXX_FEATURE:1cxx_alias_templates + Feature record: CXX_FEATURE:1cxx_alignas + Feature record: CXX_FEATURE:1cxx_alignof + Feature record: CXX_FEATURE:1cxx_attributes + Feature record: CXX_FEATURE:1cxx_attribute_deprecated + Feature record: CXX_FEATURE:1cxx_auto_type + Feature record: CXX_FEATURE:1cxx_binary_literals + Feature record: CXX_FEATURE:1cxx_constexpr + Feature record: CXX_FEATURE:1cxx_contextual_conversions + Feature record: CXX_FEATURE:1cxx_decltype + Feature record: CXX_FEATURE:1cxx_decltype_auto + Feature record: CXX_FEATURE:1cxx_decltype_incomplete_return_types + Feature record: CXX_FEATURE:1cxx_default_function_template_args + Feature record: CXX_FEATURE:1cxx_defaulted_functions + Feature record: CXX_FEATURE:1cxx_defaulted_move_initializers + Feature record: CXX_FEATURE:1cxx_delegating_constructors + Feature record: CXX_FEATURE:1cxx_deleted_functions + Feature record: CXX_FEATURE:1cxx_digit_separators + Feature record: CXX_FEATURE:1cxx_enum_forward_declarations + Feature record: CXX_FEATURE:1cxx_explicit_conversions + Feature record: CXX_FEATURE:1cxx_extended_friend_declarations + Feature record: CXX_FEATURE:1cxx_extern_templates + Feature record: CXX_FEATURE:1cxx_final + Feature record: CXX_FEATURE:1cxx_func_identifier + Feature record: CXX_FEATURE:1cxx_generalized_initializers + Feature record: CXX_FEATURE:1cxx_generic_lambdas + Feature record: CXX_FEATURE:1cxx_inheriting_constructors + Feature record: CXX_FEATURE:1cxx_inline_namespaces + Feature record: CXX_FEATURE:1cxx_lambdas + Feature record: CXX_FEATURE:1cxx_lambda_init_captures + Feature record: CXX_FEATURE:1cxx_local_type_template_args + Feature record: CXX_FEATURE:1cxx_long_long_type + Feature record: CXX_FEATURE:1cxx_noexcept + Feature record: CXX_FEATURE:1cxx_nonstatic_member_init + Feature record: CXX_FEATURE:1cxx_nullptr + Feature record: CXX_FEATURE:1cxx_override + Feature record: CXX_FEATURE:1cxx_range_for + Feature record: CXX_FEATURE:1cxx_raw_string_literals + Feature record: CXX_FEATURE:1cxx_reference_qualified_functions + Feature record: CXX_FEATURE:1cxx_relaxed_constexpr + Feature record: CXX_FEATURE:1cxx_return_type_deduction + Feature record: CXX_FEATURE:1cxx_right_angle_brackets + Feature record: CXX_FEATURE:1cxx_rvalue_references + Feature record: CXX_FEATURE:1cxx_sizeof_member + Feature record: CXX_FEATURE:1cxx_static_assert + Feature record: CXX_FEATURE:1cxx_strong_enums + Feature record: CXX_FEATURE:1cxx_template_template_parameters + Feature record: CXX_FEATURE:1cxx_thread_local + Feature record: CXX_FEATURE:1cxx_trailing_return_types + Feature record: CXX_FEATURE:1cxx_unicode_literals + Feature record: CXX_FEATURE:1cxx_uniform_initialization + Feature record: CXX_FEATURE:1cxx_unrestricted_unions + Feature record: CXX_FEATURE:1cxx_user_literals + Feature record: CXX_FEATURE:1cxx_variable_templates + Feature record: CXX_FEATURE:1cxx_variadic_macros + Feature record: CXX_FEATURE:1cxx_variadic_templates + + +Detecting CXX [-std=c++11] compiler features compiled with the following output: +Change Dir: /Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_bfa30/fast" +/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_bfa30.dir/build.make CMakeFiles/cmTC_bfa30.dir/build +Building CXX object CMakeFiles/cmTC_bfa30.dir/feature_tests.cxx.o +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -std=c++11 -o CMakeFiles/cmTC_bfa30.dir/feature_tests.cxx.o -c /Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles/feature_tests.cxx +Linking CXX executable cmTC_bfa30 +/usr/local/Cellar/cmake/3.10.1/bin/cmake -E cmake_link_script CMakeFiles/cmTC_bfa30.dir/link.txt --verbose=1 +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_bfa30.dir/feature_tests.cxx.o -o cmTC_bfa30 + + + Feature record: CXX_FEATURE:0cxx_aggregate_default_initializers + Feature record: CXX_FEATURE:1cxx_alias_templates + Feature record: CXX_FEATURE:1cxx_alignas + Feature record: CXX_FEATURE:1cxx_alignof + Feature record: CXX_FEATURE:1cxx_attributes + Feature record: CXX_FEATURE:0cxx_attribute_deprecated + Feature record: CXX_FEATURE:1cxx_auto_type + Feature record: CXX_FEATURE:0cxx_binary_literals + Feature record: CXX_FEATURE:1cxx_constexpr + Feature record: CXX_FEATURE:0cxx_contextual_conversions + Feature record: CXX_FEATURE:1cxx_decltype + Feature record: CXX_FEATURE:0cxx_decltype_auto + Feature record: CXX_FEATURE:1cxx_decltype_incomplete_return_types + Feature record: CXX_FEATURE:1cxx_default_function_template_args + Feature record: CXX_FEATURE:1cxx_defaulted_functions + Feature record: CXX_FEATURE:1cxx_defaulted_move_initializers + Feature record: CXX_FEATURE:1cxx_delegating_constructors + Feature record: CXX_FEATURE:1cxx_deleted_functions + Feature record: CXX_FEATURE:0cxx_digit_separators + Feature record: CXX_FEATURE:1cxx_enum_forward_declarations + Feature record: CXX_FEATURE:1cxx_explicit_conversions + Feature record: CXX_FEATURE:1cxx_extended_friend_declarations + Feature record: CXX_FEATURE:1cxx_extern_templates + Feature record: CXX_FEATURE:1cxx_final + Feature record: CXX_FEATURE:1cxx_func_identifier + Feature record: CXX_FEATURE:1cxx_generalized_initializers + Feature record: CXX_FEATURE:0cxx_generic_lambdas + Feature record: CXX_FEATURE:1cxx_inheriting_constructors + Feature record: CXX_FEATURE:1cxx_inline_namespaces + Feature record: CXX_FEATURE:1cxx_lambdas + Feature record: CXX_FEATURE:0cxx_lambda_init_captures + Feature record: CXX_FEATURE:1cxx_local_type_template_args + Feature record: CXX_FEATURE:1cxx_long_long_type + Feature record: CXX_FEATURE:1cxx_noexcept + Feature record: CXX_FEATURE:1cxx_nonstatic_member_init + Feature record: CXX_FEATURE:1cxx_nullptr + Feature record: CXX_FEATURE:1cxx_override + Feature record: CXX_FEATURE:1cxx_range_for + Feature record: CXX_FEATURE:1cxx_raw_string_literals + Feature record: CXX_FEATURE:1cxx_reference_qualified_functions + Feature record: CXX_FEATURE:0cxx_relaxed_constexpr + Feature record: CXX_FEATURE:0cxx_return_type_deduction + Feature record: CXX_FEATURE:1cxx_right_angle_brackets + Feature record: CXX_FEATURE:1cxx_rvalue_references + Feature record: CXX_FEATURE:1cxx_sizeof_member + Feature record: CXX_FEATURE:1cxx_static_assert + Feature record: CXX_FEATURE:1cxx_strong_enums + Feature record: CXX_FEATURE:1cxx_template_template_parameters + Feature record: CXX_FEATURE:1cxx_thread_local + Feature record: CXX_FEATURE:1cxx_trailing_return_types + Feature record: CXX_FEATURE:1cxx_unicode_literals + Feature record: CXX_FEATURE:1cxx_uniform_initialization + Feature record: CXX_FEATURE:1cxx_unrestricted_unions + Feature record: CXX_FEATURE:1cxx_user_literals + Feature record: CXX_FEATURE:0cxx_variable_templates + Feature record: CXX_FEATURE:1cxx_variadic_macros + Feature record: CXX_FEATURE:1cxx_variadic_templates + + +Detecting CXX [-std=c++98] compiler features compiled with the following output: +Change Dir: /Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_8323f/fast" +/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_8323f.dir/build.make CMakeFiles/cmTC_8323f.dir/build +Building CXX object CMakeFiles/cmTC_8323f.dir/feature_tests.cxx.o +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -std=c++98 -o CMakeFiles/cmTC_8323f.dir/feature_tests.cxx.o -c /Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles/feature_tests.cxx +Linking CXX executable cmTC_8323f +/usr/local/Cellar/cmake/3.10.1/bin/cmake -E cmake_link_script CMakeFiles/cmTC_8323f.dir/link.txt --verbose=1 +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_8323f.dir/feature_tests.cxx.o -o cmTC_8323f + + + Feature record: CXX_FEATURE:0cxx_aggregate_default_initializers + Feature record: CXX_FEATURE:0cxx_alias_templates + Feature record: CXX_FEATURE:0cxx_alignas + Feature record: CXX_FEATURE:0cxx_alignof + Feature record: CXX_FEATURE:0cxx_attributes + Feature record: CXX_FEATURE:0cxx_attribute_deprecated + Feature record: CXX_FEATURE:0cxx_auto_type + Feature record: CXX_FEATURE:0cxx_binary_literals + Feature record: CXX_FEATURE:0cxx_constexpr + Feature record: CXX_FEATURE:0cxx_contextual_conversions + Feature record: CXX_FEATURE:0cxx_decltype + Feature record: CXX_FEATURE:0cxx_decltype_auto + Feature record: CXX_FEATURE:0cxx_decltype_incomplete_return_types + Feature record: CXX_FEATURE:0cxx_default_function_template_args + Feature record: CXX_FEATURE:0cxx_defaulted_functions + Feature record: CXX_FEATURE:0cxx_defaulted_move_initializers + Feature record: CXX_FEATURE:0cxx_delegating_constructors + Feature record: CXX_FEATURE:0cxx_deleted_functions + Feature record: CXX_FEATURE:0cxx_digit_separators + Feature record: CXX_FEATURE:0cxx_enum_forward_declarations + Feature record: CXX_FEATURE:0cxx_explicit_conversions + Feature record: CXX_FEATURE:0cxx_extended_friend_declarations + Feature record: CXX_FEATURE:0cxx_extern_templates + Feature record: CXX_FEATURE:0cxx_final + Feature record: CXX_FEATURE:0cxx_func_identifier + Feature record: CXX_FEATURE:0cxx_generalized_initializers + Feature record: CXX_FEATURE:0cxx_generic_lambdas + Feature record: CXX_FEATURE:0cxx_inheriting_constructors + Feature record: CXX_FEATURE:0cxx_inline_namespaces + Feature record: CXX_FEATURE:0cxx_lambdas + Feature record: CXX_FEATURE:0cxx_lambda_init_captures + Feature record: CXX_FEATURE:0cxx_local_type_template_args + Feature record: CXX_FEATURE:0cxx_long_long_type + Feature record: CXX_FEATURE:0cxx_noexcept + Feature record: CXX_FEATURE:0cxx_nonstatic_member_init + Feature record: CXX_FEATURE:0cxx_nullptr + Feature record: CXX_FEATURE:0cxx_override + Feature record: CXX_FEATURE:0cxx_range_for + Feature record: CXX_FEATURE:0cxx_raw_string_literals + Feature record: CXX_FEATURE:0cxx_reference_qualified_functions + Feature record: CXX_FEATURE:0cxx_relaxed_constexpr + Feature record: CXX_FEATURE:0cxx_return_type_deduction + Feature record: CXX_FEATURE:0cxx_right_angle_brackets + Feature record: CXX_FEATURE:0cxx_rvalue_references + Feature record: CXX_FEATURE:0cxx_sizeof_member + Feature record: CXX_FEATURE:0cxx_static_assert + Feature record: CXX_FEATURE:0cxx_strong_enums + Feature record: CXX_FEATURE:1cxx_template_template_parameters + Feature record: CXX_FEATURE:0cxx_thread_local + Feature record: CXX_FEATURE:0cxx_trailing_return_types + Feature record: CXX_FEATURE:0cxx_unicode_literals + Feature record: CXX_FEATURE:0cxx_uniform_initialization + Feature record: CXX_FEATURE:0cxx_unrestricted_unions + Feature record: CXX_FEATURE:0cxx_user_literals + Feature record: CXX_FEATURE:0cxx_variable_templates + Feature record: CXX_FEATURE:0cxx_variadic_macros + Feature record: CXX_FEATURE:0cxx_variadic_templates diff --git a/src/libs/mosquitto/CMakeFiles/Makefile.cmake b/src/libs/mosquitto/CMakeFiles/Makefile.cmake new file mode 100644 index 0000000..7db1acb --- /dev/null +++ b/src/libs/mosquitto/CMakeFiles/Makefile.cmake @@ -0,0 +1,65 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.10 + +# The generator used is: +set(CMAKE_DEPENDS_GENERATOR "Unix Makefiles") + +# The top level Makefile was generated from the following files: +set(CMAKE_MAKEFILE_DEPENDS + "CMakeCache.txt" + "CMakeFiles/3.10.1/CMakeCCompiler.cmake" + "CMakeFiles/3.10.1/CMakeCXXCompiler.cmake" + "CMakeFiles/3.10.1/CMakeSystem.cmake" + "CMakeLists.txt" + "client/CMakeLists.txt" + "lib/CMakeLists.txt" + "lib/cpp/CMakeLists.txt" + "man/CMakeLists.txt" + "src/CMakeLists.txt" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeCInformation.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeCXXInformation.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeCommonLanguageInclude.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeGenericSystem.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeLanguageInformation.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeSystemSpecificInformation.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeSystemSpecificInitialize.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CheckLibraryExists.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/AppleClang-C.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/AppleClang-CXX.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/CMakeCommonCompilerMacros.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/Clang.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Compiler/GNU.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Platform/Darwin-AppleClang-C.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Platform/Darwin-AppleClang-CXX.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Platform/Darwin-Clang-C.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Platform/Darwin-Clang-CXX.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Platform/Darwin-Clang.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Platform/Darwin-Initialize.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Platform/Darwin.cmake" + "/usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/Platform/UnixPaths.cmake" + ) + +# The corresponding makefile is: +set(CMAKE_MAKEFILE_OUTPUTS + "Makefile" + "CMakeFiles/cmake.check_cache" + ) + +# Byproducts of CMake generate step: +set(CMAKE_MAKEFILE_PRODUCTS + "CMakeFiles/CMakeDirectoryInformation.cmake" + "lib/CMakeFiles/CMakeDirectoryInformation.cmake" + "lib/cpp/CMakeFiles/CMakeDirectoryInformation.cmake" + "client/CMakeFiles/CMakeDirectoryInformation.cmake" + "src/CMakeFiles/CMakeDirectoryInformation.cmake" + "man/CMakeFiles/CMakeDirectoryInformation.cmake" + ) + +# Dependency information for all targets: +set(CMAKE_DEPEND_INFO_FILES + "lib/CMakeFiles/libmosquitto.dir/DependInfo.cmake" + "lib/cpp/CMakeFiles/mosquittopp.dir/DependInfo.cmake" + "client/CMakeFiles/mosquitto_sub.dir/DependInfo.cmake" + "client/CMakeFiles/mosquitto_pub.dir/DependInfo.cmake" + "src/CMakeFiles/mosquitto.dir/DependInfo.cmake" + ) diff --git a/src/libs/mosquitto/CMakeFiles/Makefile2 b/src/libs/mosquitto/CMakeFiles/Makefile2 new file mode 100644 index 0000000..25998cd --- /dev/null +++ b/src/libs/mosquitto/CMakeFiles/Makefile2 @@ -0,0 +1,350 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.10 + +# Default target executed when no arguments are given to make. +default_target: all + +.PHONY : default_target + +# The main recursive all target +all: + +.PHONY : all + +# The main recursive preinstall target +preinstall: + +.PHONY : preinstall + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + + +# Remove some rules from gmake that .SUFFIXES does not remove. +SUFFIXES = + +.SUFFIXES: .hpux_make_needs_suffix_list + + +# Suppress display of executed commands. +$(VERBOSE).SILENT: + + +# A target that is always out of date. +cmake_force: + +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/local/Cellar/cmake/3.10.1/bin/cmake + +# The command to remove a file. +RM = /usr/local/Cellar/cmake/3.10.1/bin/cmake -E remove -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /Users/benjamin/orchestra/src/libs/mosquitto + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /Users/benjamin/orchestra/src/libs/mosquitto + +#============================================================================= +# Directory level rules for directory lib + +# Convenience name for "all" pass in the directory. +lib/all: lib/CMakeFiles/libmosquitto.dir/all +lib/all: lib/cpp/all + +.PHONY : lib/all + +# Convenience name for "clean" pass in the directory. +lib/clean: lib/CMakeFiles/libmosquitto.dir/clean +lib/clean: lib/cpp/clean + +.PHONY : lib/clean + +# Convenience name for "preinstall" pass in the directory. +lib/preinstall: lib/cpp/preinstall + +.PHONY : lib/preinstall + +#============================================================================= +# Target rules for target lib/CMakeFiles/libmosquitto.dir + +# All Build rule for target. +lib/CMakeFiles/libmosquitto.dir/all: + $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/depend + $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/build + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18 "Built target libmosquitto" +.PHONY : lib/CMakeFiles/libmosquitto.dir/all + +# Include target in all. +all: lib/CMakeFiles/libmosquitto.dir/all + +.PHONY : all + +# Build rule for subdir invocation for target. +lib/CMakeFiles/libmosquitto.dir/rule: cmake_check_build_system + $(CMAKE_COMMAND) -E cmake_progress_start /Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles 18 + $(MAKE) -f CMakeFiles/Makefile2 lib/CMakeFiles/libmosquitto.dir/all + $(CMAKE_COMMAND) -E cmake_progress_start /Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles 0 +.PHONY : lib/CMakeFiles/libmosquitto.dir/rule + +# Convenience name for target. +libmosquitto: lib/CMakeFiles/libmosquitto.dir/rule + +.PHONY : libmosquitto + +# clean rule for target. +lib/CMakeFiles/libmosquitto.dir/clean: + $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/clean +.PHONY : lib/CMakeFiles/libmosquitto.dir/clean + +# clean rule for target. +clean: lib/CMakeFiles/libmosquitto.dir/clean + +.PHONY : clean + +#============================================================================= +# Directory level rules for directory lib/cpp + +# Convenience name for "all" pass in the directory. +lib/cpp/all: lib/cpp/CMakeFiles/mosquittopp.dir/all + +.PHONY : lib/cpp/all + +# Convenience name for "clean" pass in the directory. +lib/cpp/clean: lib/cpp/CMakeFiles/mosquittopp.dir/clean + +.PHONY : lib/cpp/clean + +# Convenience name for "preinstall" pass in the directory. +lib/cpp/preinstall: + +.PHONY : lib/cpp/preinstall + +#============================================================================= +# Target rules for target lib/cpp/CMakeFiles/mosquittopp.dir + +# All Build rule for target. +lib/cpp/CMakeFiles/mosquittopp.dir/all: lib/CMakeFiles/libmosquitto.dir/all + $(MAKE) -f lib/cpp/CMakeFiles/mosquittopp.dir/build.make lib/cpp/CMakeFiles/mosquittopp.dir/depend + $(MAKE) -f lib/cpp/CMakeFiles/mosquittopp.dir/build.make lib/cpp/CMakeFiles/mosquittopp.dir/build + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=53,54 "Built target mosquittopp" +.PHONY : lib/cpp/CMakeFiles/mosquittopp.dir/all + +# Include target in all. +all: lib/cpp/CMakeFiles/mosquittopp.dir/all + +.PHONY : all + +# Build rule for subdir invocation for target. +lib/cpp/CMakeFiles/mosquittopp.dir/rule: cmake_check_build_system + $(CMAKE_COMMAND) -E cmake_progress_start /Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles 20 + $(MAKE) -f CMakeFiles/Makefile2 lib/cpp/CMakeFiles/mosquittopp.dir/all + $(CMAKE_COMMAND) -E cmake_progress_start /Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles 0 +.PHONY : lib/cpp/CMakeFiles/mosquittopp.dir/rule + +# Convenience name for target. +mosquittopp: lib/cpp/CMakeFiles/mosquittopp.dir/rule + +.PHONY : mosquittopp + +# clean rule for target. +lib/cpp/CMakeFiles/mosquittopp.dir/clean: + $(MAKE) -f lib/cpp/CMakeFiles/mosquittopp.dir/build.make lib/cpp/CMakeFiles/mosquittopp.dir/clean +.PHONY : lib/cpp/CMakeFiles/mosquittopp.dir/clean + +# clean rule for target. +clean: lib/cpp/CMakeFiles/mosquittopp.dir/clean + +.PHONY : clean + +#============================================================================= +# Directory level rules for directory client + +# Convenience name for "all" pass in the directory. +client/all: client/CMakeFiles/mosquitto_sub.dir/all +client/all: client/CMakeFiles/mosquitto_pub.dir/all + +.PHONY : client/all + +# Convenience name for "clean" pass in the directory. +client/clean: client/CMakeFiles/mosquitto_sub.dir/clean +client/clean: client/CMakeFiles/mosquitto_pub.dir/clean + +.PHONY : client/clean + +# Convenience name for "preinstall" pass in the directory. +client/preinstall: + +.PHONY : client/preinstall + +#============================================================================= +# Target rules for target client/CMakeFiles/mosquitto_sub.dir + +# All Build rule for target. +client/CMakeFiles/mosquitto_sub.dir/all: lib/CMakeFiles/libmosquitto.dir/all + $(MAKE) -f client/CMakeFiles/mosquitto_sub.dir/build.make client/CMakeFiles/mosquitto_sub.dir/depend + $(MAKE) -f client/CMakeFiles/mosquitto_sub.dir/build.make client/CMakeFiles/mosquitto_sub.dir/build + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=50,51,52 "Built target mosquitto_sub" +.PHONY : client/CMakeFiles/mosquitto_sub.dir/all + +# Include target in all. +all: client/CMakeFiles/mosquitto_sub.dir/all + +.PHONY : all + +# Build rule for subdir invocation for target. +client/CMakeFiles/mosquitto_sub.dir/rule: cmake_check_build_system + $(CMAKE_COMMAND) -E cmake_progress_start /Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles 21 + $(MAKE) -f CMakeFiles/Makefile2 client/CMakeFiles/mosquitto_sub.dir/all + $(CMAKE_COMMAND) -E cmake_progress_start /Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles 0 +.PHONY : client/CMakeFiles/mosquitto_sub.dir/rule + +# Convenience name for target. +mosquitto_sub: client/CMakeFiles/mosquitto_sub.dir/rule + +.PHONY : mosquitto_sub + +# clean rule for target. +client/CMakeFiles/mosquitto_sub.dir/clean: + $(MAKE) -f client/CMakeFiles/mosquitto_sub.dir/build.make client/CMakeFiles/mosquitto_sub.dir/clean +.PHONY : client/CMakeFiles/mosquitto_sub.dir/clean + +# clean rule for target. +clean: client/CMakeFiles/mosquitto_sub.dir/clean + +.PHONY : clean + +#============================================================================= +# Target rules for target client/CMakeFiles/mosquitto_pub.dir + +# All Build rule for target. +client/CMakeFiles/mosquitto_pub.dir/all: lib/CMakeFiles/libmosquitto.dir/all + $(MAKE) -f client/CMakeFiles/mosquitto_pub.dir/build.make client/CMakeFiles/mosquitto_pub.dir/depend + $(MAKE) -f client/CMakeFiles/mosquitto_pub.dir/build.make client/CMakeFiles/mosquitto_pub.dir/build + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=47,48,49 "Built target mosquitto_pub" +.PHONY : client/CMakeFiles/mosquitto_pub.dir/all + +# Include target in all. +all: client/CMakeFiles/mosquitto_pub.dir/all + +.PHONY : all + +# Build rule for subdir invocation for target. +client/CMakeFiles/mosquitto_pub.dir/rule: cmake_check_build_system + $(CMAKE_COMMAND) -E cmake_progress_start /Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles 21 + $(MAKE) -f CMakeFiles/Makefile2 client/CMakeFiles/mosquitto_pub.dir/all + $(CMAKE_COMMAND) -E cmake_progress_start /Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles 0 +.PHONY : client/CMakeFiles/mosquitto_pub.dir/rule + +# Convenience name for target. +mosquitto_pub: client/CMakeFiles/mosquitto_pub.dir/rule + +.PHONY : mosquitto_pub + +# clean rule for target. +client/CMakeFiles/mosquitto_pub.dir/clean: + $(MAKE) -f client/CMakeFiles/mosquitto_pub.dir/build.make client/CMakeFiles/mosquitto_pub.dir/clean +.PHONY : client/CMakeFiles/mosquitto_pub.dir/clean + +# clean rule for target. +clean: client/CMakeFiles/mosquitto_pub.dir/clean + +.PHONY : clean + +#============================================================================= +# Directory level rules for directory src + +# Convenience name for "all" pass in the directory. +src/all: src/CMakeFiles/mosquitto.dir/all + +.PHONY : src/all + +# Convenience name for "clean" pass in the directory. +src/clean: src/CMakeFiles/mosquitto.dir/clean + +.PHONY : src/clean + +# Convenience name for "preinstall" pass in the directory. +src/preinstall: + +.PHONY : src/preinstall + +#============================================================================= +# Target rules for target src/CMakeFiles/mosquitto.dir + +# All Build rule for target. +src/CMakeFiles/mosquitto.dir/all: + $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/depend + $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/build + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46 "Built target mosquitto" +.PHONY : src/CMakeFiles/mosquitto.dir/all + +# Include target in all. +all: src/CMakeFiles/mosquitto.dir/all + +.PHONY : all + +# Build rule for subdir invocation for target. +src/CMakeFiles/mosquitto.dir/rule: cmake_check_build_system + $(CMAKE_COMMAND) -E cmake_progress_start /Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles 28 + $(MAKE) -f CMakeFiles/Makefile2 src/CMakeFiles/mosquitto.dir/all + $(CMAKE_COMMAND) -E cmake_progress_start /Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles 0 +.PHONY : src/CMakeFiles/mosquitto.dir/rule + +# Convenience name for target. +mosquitto: src/CMakeFiles/mosquitto.dir/rule + +.PHONY : mosquitto + +# clean rule for target. +src/CMakeFiles/mosquitto.dir/clean: + $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/clean +.PHONY : src/CMakeFiles/mosquitto.dir/clean + +# clean rule for target. +clean: src/CMakeFiles/mosquitto.dir/clean + +.PHONY : clean + +#============================================================================= +# Directory level rules for directory man + +# Convenience name for "all" pass in the directory. +man/all: + +.PHONY : man/all + +# Convenience name for "clean" pass in the directory. +man/clean: + +.PHONY : man/clean + +# Convenience name for "preinstall" pass in the directory. +man/preinstall: + +.PHONY : man/preinstall + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system + diff --git a/src/libs/mosquitto/CMakeFiles/TargetDirectories.txt b/src/libs/mosquitto/CMakeFiles/TargetDirectories.txt new file mode 100644 index 0000000..1e6f459 --- /dev/null +++ b/src/libs/mosquitto/CMakeFiles/TargetDirectories.txt @@ -0,0 +1,41 @@ +/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles/install/local.dir +/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles/install/strip.dir +/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles/install.dir +/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles/list_install_components.dir +/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles/rebuild_cache.dir +/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles/edit_cache.dir +/Users/benjamin/orchestra/src/libs/mosquitto/lib/CMakeFiles/install/local.dir +/Users/benjamin/orchestra/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir +/Users/benjamin/orchestra/src/libs/mosquitto/lib/CMakeFiles/rebuild_cache.dir +/Users/benjamin/orchestra/src/libs/mosquitto/lib/CMakeFiles/edit_cache.dir +/Users/benjamin/orchestra/src/libs/mosquitto/lib/CMakeFiles/install/strip.dir +/Users/benjamin/orchestra/src/libs/mosquitto/lib/CMakeFiles/install.dir +/Users/benjamin/orchestra/src/libs/mosquitto/lib/CMakeFiles/list_install_components.dir +/Users/benjamin/orchestra/src/libs/mosquitto/lib/cpp/CMakeFiles/install/local.dir +/Users/benjamin/orchestra/src/libs/mosquitto/lib/cpp/CMakeFiles/install/strip.dir +/Users/benjamin/orchestra/src/libs/mosquitto/lib/cpp/CMakeFiles/install.dir +/Users/benjamin/orchestra/src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir +/Users/benjamin/orchestra/src/libs/mosquitto/lib/cpp/CMakeFiles/list_install_components.dir +/Users/benjamin/orchestra/src/libs/mosquitto/lib/cpp/CMakeFiles/rebuild_cache.dir +/Users/benjamin/orchestra/src/libs/mosquitto/lib/cpp/CMakeFiles/edit_cache.dir +/Users/benjamin/orchestra/src/libs/mosquitto/client/CMakeFiles/install/local.dir +/Users/benjamin/orchestra/src/libs/mosquitto/client/CMakeFiles/install/strip.dir +/Users/benjamin/orchestra/src/libs/mosquitto/client/CMakeFiles/install.dir +/Users/benjamin/orchestra/src/libs/mosquitto/client/CMakeFiles/list_install_components.dir +/Users/benjamin/orchestra/src/libs/mosquitto/client/CMakeFiles/rebuild_cache.dir +/Users/benjamin/orchestra/src/libs/mosquitto/client/CMakeFiles/edit_cache.dir +/Users/benjamin/orchestra/src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir +/Users/benjamin/orchestra/src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir +/Users/benjamin/orchestra/src/libs/mosquitto/src/CMakeFiles/install/local.dir +/Users/benjamin/orchestra/src/libs/mosquitto/src/CMakeFiles/rebuild_cache.dir +/Users/benjamin/orchestra/src/libs/mosquitto/src/CMakeFiles/edit_cache.dir +/Users/benjamin/orchestra/src/libs/mosquitto/src/CMakeFiles/install/strip.dir +/Users/benjamin/orchestra/src/libs/mosquitto/src/CMakeFiles/install.dir +/Users/benjamin/orchestra/src/libs/mosquitto/src/CMakeFiles/list_install_components.dir +/Users/benjamin/orchestra/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir +/Users/benjamin/orchestra/src/libs/mosquitto/man/CMakeFiles/install/local.dir +/Users/benjamin/orchestra/src/libs/mosquitto/man/CMakeFiles/install/strip.dir +/Users/benjamin/orchestra/src/libs/mosquitto/man/CMakeFiles/install.dir +/Users/benjamin/orchestra/src/libs/mosquitto/man/CMakeFiles/list_install_components.dir +/Users/benjamin/orchestra/src/libs/mosquitto/man/CMakeFiles/rebuild_cache.dir +/Users/benjamin/orchestra/src/libs/mosquitto/man/CMakeFiles/edit_cache.dir diff --git a/src/libs/mosquitto/CMakeFiles/cmake.check_cache b/src/libs/mosquitto/CMakeFiles/cmake.check_cache new file mode 100644 index 0000000..3dccd73 --- /dev/null +++ b/src/libs/mosquitto/CMakeFiles/cmake.check_cache @@ -0,0 +1 @@ +# This file is generated by cmake for dependency checking of the CMakeCache.txt file diff --git a/src/libs/mosquitto/CMakeFiles/feature_tests.bin b/src/libs/mosquitto/CMakeFiles/feature_tests.bin new file mode 100755 index 0000000000000000000000000000000000000000..db4ec2ccd460dcfc9b77cbc0f0177213944b8529 GIT binary patch literal 8376 zcmeHM&5ImG6t9g5#w2EQii!cpkBBC?y8*$)lTk-E7&OEUECDHMs^82OR#%VJ)w{ET z5Dz&lD8!Q<1^Ygf!GrdG ztL^>DfqaDHHRI`#c)sfAz|TAGF`SGQzGk zv?I>cn&6r44X21(#I@#MKz`Ti=Y>;C2$tiRp2k=Q&)+-1{1)bu7}qeE*gg-I<@`+g z1N*<|G^AP>r!ZEl(yv<6SKLc|p0p;AS2ht={KKCHeLt&PY48*(@8Z`aT@91et(*>s=20f3^1b=; zl*y6CLZQ6ap+gEFBg^$-TyNMb@s$oms!~`G*;?q>^h}T?^_5p?Bjl=Fb_>6&e1;Ox zmL=0!Kn|_Zu(vQ*$S1js!}10XhuTEhj6qId*F}BV*~~K9(q!a<=^9GZR*xJPBz74$ zhZgO)C~35`D(_^ejb+?6d003!BgR?dNII2M*;hKXd*?bCF2qo!R(;fHQoYdFEW8&E zD@XIj?Nq&YigA>27`aM}SfXIRqXyPzHrDoV_sQpBArnem=qPHYFUg=LM zBudrqC|mIXQ%9K)DN&C_w+43BPmQ}OOY(`#03gmP@7ZbFm-wa`-5KKt-u5}ph}7v3 zwmqo~6@r4A4J3GFP|LkTPRq&}U1YQ%WspF=^YIppr^~Fv%Awwof6XTvl#=&A1y~mN z+EL!94pKBiVj84)9Y>jrYg=hwED{(S!L84|)^mLQgC=M0X>!l=b<8||sr#S&%stvu z&^!~h!LXSniT?T#nQu!Pkj9-Xw~+?&;`v+|C(aL>yLVTkIBeGsuYo^}wNZbZ#g><1 wM>bkN8~I@@qgXMsSfmy@= 400 +"1" +#else +"0" +#endif +"c_function_prototypes\n" +"C_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +"1" +#else +"0" +#endif +"c_restrict\n" +"C_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L +"1" +#else +"0" +#endif +"c_static_assert\n" +"C_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +"1" +#else +"0" +#endif +"c_variadic_macros\n" + +}; + +int main(int argc, char** argv) { (void)argv; return features[argc]; } diff --git a/src/libs/mosquitto/CMakeFiles/feature_tests.cxx b/src/libs/mosquitto/CMakeFiles/feature_tests.cxx new file mode 100644 index 0000000..34d2e8c --- /dev/null +++ b/src/libs/mosquitto/CMakeFiles/feature_tests.cxx @@ -0,0 +1,405 @@ + + const char features[] = {"\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_aggregate_nsdmi) +"1" +#else +"0" +#endif +"cxx_aggregate_default_initializers\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_alias_templates) +"1" +#else +"0" +#endif +"cxx_alias_templates\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_alignas) +"1" +#else +"0" +#endif +"cxx_alignas\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_alignas) +"1" +#else +"0" +#endif +"cxx_alignof\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_attributes) +"1" +#else +"0" +#endif +"cxx_attributes\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 501 && __cplusplus > 201103L +"1" +#else +"0" +#endif +"cxx_attribute_deprecated\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_auto_type) +"1" +#else +"0" +#endif +"cxx_auto_type\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_binary_literals) +"1" +#else +"0" +#endif +"cxx_binary_literals\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_constexpr) +"1" +#else +"0" +#endif +"cxx_constexpr\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_contextual_conversions) +"1" +#else +"0" +#endif +"cxx_contextual_conversions\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_decltype) +"1" +#else +"0" +#endif +"cxx_decltype\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 501 && __cplusplus > 201103L +"1" +#else +"0" +#endif +"cxx_decltype_auto\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_decltype_incomplete_return_types) +"1" +#else +"0" +#endif +"cxx_decltype_incomplete_return_types\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_default_function_template_args) +"1" +#else +"0" +#endif +"cxx_default_function_template_args\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_defaulted_functions) +"1" +#else +"0" +#endif +"cxx_defaulted_functions\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_defaulted_functions) +"1" +#else +"0" +#endif +"cxx_defaulted_move_initializers\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_delegating_constructors) +"1" +#else +"0" +#endif +"cxx_delegating_constructors\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_deleted_functions) +"1" +#else +"0" +#endif +"cxx_deleted_functions\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 501 && __cplusplus > 201103L +"1" +#else +"0" +#endif +"cxx_digit_separators\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __cplusplus >= 201103L +"1" +#else +"0" +#endif +"cxx_enum_forward_declarations\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_explicit_conversions) +"1" +#else +"0" +#endif +"cxx_explicit_conversions\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __cplusplus >= 201103L +"1" +#else +"0" +#endif +"cxx_extended_friend_declarations\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __cplusplus >= 201103L +"1" +#else +"0" +#endif +"cxx_extern_templates\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_override_control) +"1" +#else +"0" +#endif +"cxx_final\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __cplusplus >= 201103L +"1" +#else +"0" +#endif +"cxx_func_identifier\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_generalized_initializers) +"1" +#else +"0" +#endif +"cxx_generalized_initializers\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 501 && __cplusplus > 201103L +"1" +#else +"0" +#endif +"cxx_generic_lambdas\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_inheriting_constructors) +"1" +#else +"0" +#endif +"cxx_inheriting_constructors\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __cplusplus >= 201103L +"1" +#else +"0" +#endif +"cxx_inline_namespaces\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_lambdas) +"1" +#else +"0" +#endif +"cxx_lambdas\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_init_captures) +"1" +#else +"0" +#endif +"cxx_lambda_init_captures\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_local_type_template_args) +"1" +#else +"0" +#endif +"cxx_local_type_template_args\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __cplusplus >= 201103L +"1" +#else +"0" +#endif +"cxx_long_long_type\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_noexcept) +"1" +#else +"0" +#endif +"cxx_noexcept\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_nonstatic_member_init) +"1" +#else +"0" +#endif +"cxx_nonstatic_member_init\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_nullptr) +"1" +#else +"0" +#endif +"cxx_nullptr\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_override_control) +"1" +#else +"0" +#endif +"cxx_override\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_range_for) +"1" +#else +"0" +#endif +"cxx_range_for\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_raw_string_literals) +"1" +#else +"0" +#endif +"cxx_raw_string_literals\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_reference_qualified_functions) +"1" +#else +"0" +#endif +"cxx_reference_qualified_functions\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_relaxed_constexpr) +"1" +#else +"0" +#endif +"cxx_relaxed_constexpr\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_return_type_deduction) +"1" +#else +"0" +#endif +"cxx_return_type_deduction\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __cplusplus >= 201103L +"1" +#else +"0" +#endif +"cxx_right_angle_brackets\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_rvalue_references) +"1" +#else +"0" +#endif +"cxx_rvalue_references\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __cplusplus >= 201103L +"1" +#else +"0" +#endif +"cxx_sizeof_member\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_static_assert) +"1" +#else +"0" +#endif +"cxx_static_assert\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_strong_enums) +"1" +#else +"0" +#endif +"cxx_strong_enums\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __cplusplus >= 199711L +"1" +#else +"0" +#endif +"cxx_template_template_parameters\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_thread_local) +"1" +#else +"0" +#endif +"cxx_thread_local\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_trailing_return) +"1" +#else +"0" +#endif +"cxx_trailing_return_types\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_unicode_literals) +"1" +#else +"0" +#endif +"cxx_unicode_literals\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_generalized_initializers) +"1" +#else +"0" +#endif +"cxx_uniform_initialization\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_unrestricted_unions) +"1" +#else +"0" +#endif +"cxx_unrestricted_unions\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_user_literals) +"1" +#else +"0" +#endif +"cxx_user_literals\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_variable_templates) +"1" +#else +"0" +#endif +"cxx_variable_templates\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __cplusplus >= 201103L +"1" +#else +"0" +#endif +"cxx_variadic_macros\n" +"CXX_FEATURE:" +#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_variadic_templates) +"1" +#else +"0" +#endif +"cxx_variadic_templates\n" + +}; + +int main(int argc, char** argv) { (void)argv; return features[argc]; } diff --git a/src/libs/mosquitto/CMakeFiles/progress.marks b/src/libs/mosquitto/CMakeFiles/progress.marks new file mode 100644 index 0000000..fb1e7bc --- /dev/null +++ b/src/libs/mosquitto/CMakeFiles/progress.marks @@ -0,0 +1 @@ +54 diff --git a/src/libs/mosquitto/CMakeLists.txt b/src/libs/mosquitto/CMakeLists.txt new file mode 100644 index 0000000..6d5d720 --- /dev/null +++ b/src/libs/mosquitto/CMakeLists.txt @@ -0,0 +1,95 @@ +# This is a cmake script. Process it with the CMake gui or command line utility +# to produce makefiles / Visual Studio project files on Mac OS X and Windows. +# +# To configure the build options either use the CMake gui, or run the command +# line utility including the "-i" option. + +set(CMAKE_LEGACY_CYGWIN_WIN32 0) + +project(mosquitto) + +cmake_minimum_required(VERSION 2.8) +# Only for version 3 and up. cmake_policy(SET CMP0042 NEW) + +set (VERSION 1.4.14) + +if (WIN32) + execute_process(COMMAND cmd /c echo %DATE% %TIME% OUTPUT_VARIABLE TIMESTAMP + OUTPUT_STRIP_TRAILING_WHITESPACE) +else (WIN32) + execute_process(COMMAND date "+%F %T%z" OUTPUT_VARIABLE TIMESTAMP + OUTPUT_STRIP_TRAILING_WHITESPACE) +endif (WIN32) + +add_definitions (-DCMAKE -DVERSION=\"${VERSION}\" -DTIMESTAMP=\"${TIMESTAMP}\") + +if (WIN32) + set (BINDIR .) + set (SBINDIR .) + set (SYSCONFDIR .) + set (LIBDIR .) + set (INCLUDEDIR include) + set (DATAROOTDIR share) + set (MANDIR man) + set (SHAREDEST .) + add_definitions("-D_CRT_SECURE_NO_WARNINGS") + add_definitions("-D_CRT_NONSTDC_NO_DEPRECATE") +else (WIN32) + set (BINDIR bin) + set (SBINDIR sbin) + if ("${CMAKE_INSTALL_PREFIX}" STREQUAL /usr) + set (SYSCONFDIR /etc/mosquitto) + else ("${CMAKE_INSTALL_PREFIX}" STREQUAL /usr) + set (SYSCONFDIR etc/mosquitto) + endif ("${CMAKE_INSTALL_PREFIX}" STREQUAL /usr) + + set (LIBDIR lib${LIB_SUFFIX}) + set (CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIBDIR}") + set (INCLUDEDIR include) + set (DATAROOTDIR share) + set (MANDIR "${DATAROOTDIR}/man") + set (SHAREDIR "${DATAROOTDIR}/mosquitto") +endif (WIN32) + +option(WITH_TLS + "Include SSL/TLS support?" ON) +option(WITH_TLS_PSK + "Include TLS-PSK support (requires WITH_TLS)?" ON) +option(WITH_EC + "Include Elliptic Curve support (requires WITH_TLS)?" ON) +if (${WITH_TLS} STREQUAL ON) + find_package(OpenSSL REQUIRED) + add_definitions("-DWITH_TLS") + + if (${WITH_TLS_PSK} STREQUAL ON) + add_definitions("-DWITH_TLS_PSK") + endif (${WITH_TLS_PSK} STREQUAL ON) + + if (${WITH_EC} STREQUAL ON) + add_definitions("-DWITH_EC") + endif (${WITH_EC} STREQUAL ON) +else (${WITH_TLS} STREQUAL ON) + set (OPENSSL_INCLUDE_DIR "") +endif (${WITH_TLS} STREQUAL ON) + +option(WITH_SOCKS "Include SOCKS5 support?" ON) +if (${WITH_SOCKS} STREQUAL ON) + add_definitions("-DWITH_SOCKS") +endif (${WITH_SOCKS} STREQUAL ON) + +option(WITH_SRV "Include SRV lookup support?" ON) + +# ======================================== +# Include projects +# ======================================== + +add_subdirectory(lib) +add_subdirectory(client) +add_subdirectory(src) +add_subdirectory(man) + +# ======================================== +# Install config file +# ======================================== + +install(FILES mosquitto.conf aclfile.example pskfile.example pwfile.example DESTINATION "${SYSCONFDIR}") diff --git a/src/libs/mosquitto/CONTRIBUTING.md b/src/libs/mosquitto/CONTRIBUTING.md new file mode 100644 index 0000000..91ee855 --- /dev/null +++ b/src/libs/mosquitto/CONTRIBUTING.md @@ -0,0 +1,91 @@ +Contributing to Mosquitto +========================= + +Thank you for your interest in this project. + +Project description: +-------------------- + +The Mosquitto project has been created to provide a light weight, open-source +implementation, of an MQTT broker to allow new, existing, and emerging +applications for Machine-to-Machine (M2M) and Internet of Things (IoT). + +- +- + + +Source +------ + +The Mosquitto code is stored in a git repository. + +- http://github.com/eclipse/mosquitto + +You can contribute bugfixes and new features by sending pull requests through GitHub. + + +## Legal + +In order for your contribution to be accepted, it must comply with the Eclipse +Foundation IP policy. + +Please read the [Eclipse Foundation policy on accepting contributions via Git](http://wiki.eclipse.org/Development_Resources/Contributing_via_Git). + +1. Sign the [Eclipse CLA](http://www.eclipse.org/legal/CLA.php) + 1. Register for an Eclipse Foundation User ID. You can register [here](https://dev.eclipse.org/site_login/createaccount.php). + 2. Log into the [Projects Portal](https://projects.eclipse.org/), and click on the '[Eclipse CLA](https://projects.eclipse.org/user/sign/cla)' link. +2. Go to your [account settings](https://dev.eclipse.org/site_login/myaccount.php#open_tab_accountsettings) and add your GitHub username to your account. +3. Make sure that you _sign-off_ your Git commits in the following format: + ``` Signed-off-by: John Smith ``` This is usually at the bottom of the commit message. You can automate this by adding the '-s' flag when you make the commits. e.g. ```git commit -s -m "Adding a cool feature"``` +4. Ensure that the email address that you make your commits with is the same one you used to sign up to the Eclipse Foundation website with. + +## Contributing a change + +1. [Fork the repository on GitHub](https://github.com/eclipse/mosquitto/fork) +2. Clone the forked repository onto your computer: ``` git clone + https://github.com//mosquitto.git ``` +3. If you are adding a new feature, then create a new branch from the latest + ```develop``` branch with ```git checkout -b YOUR_BRANCH_NAME + origin/develop``` +4. If you are fixing a bug, then create a new branch from the latest + ```fixes``` branch with ```git checkout -b YOUR_BRANCH_NAME origin/fixes``` +5. Make your changes +6. Ensure that all new and existing tests pass. +7. Commit the changes into the branch: ``` git commit -s ``` Make sure that + your commit message is meaningful and describes your changes correctly. +8. If you have a lot of commits for the change, squash them into a single / few + commits. +9. Push the changes in your branch to your forked repository. +10. Finally, go to + [https://github.com/eclipse/mosquitto](https://github.com/eclipse/mosquitto) + and create a pull request from your "YOUR_BRANCH_NAME" branch to the + ```develop``` or ```fixes``` branch as appropriate to request review and + merge of the commits in your pushed branch. + +What happens next depends on the content of the patch. If it is 100% authored +by the contributor and is less than 1000 lines (and meets the needs of the +project), then it can be pulled into the main repository. If not, more steps +are required. These are detailed in the +[legal process poster](http://www.eclipse.org/legal/EclipseLegalProcessPoster.pdf). + + + +Contact: +-------- + +Contact the project developers via the project's development +[mailing list](https://dev.eclipse.org/mailman/listinfo/mosquitto-dev). + +Search for bugs: +---------------- + +This project uses [Github](https://github.com/eclipse/mosquitto/issues) +to track ongoing development and issues. + +Create a new bug: +----------------- + +Be sure to search for existing bugs before you create another one. Remember +that contributions are always welcome! + +- [Create new Paho bug](https://github.com/eclipse/mosquitto/issues) diff --git a/src/libs/mosquitto/ChangeLog.txt b/src/libs/mosquitto/ChangeLog.txt new file mode 100644 index 0000000..becbb44 --- /dev/null +++ b/src/libs/mosquitto/ChangeLog.txt @@ -0,0 +1,1542 @@ +1.4.14 - 20170710 +================= + +Broker: +- Fix regression from 1.4.13 where persistence data was not being saved. + + +1.4.13 - 20170627 +================= + +Security: +- Fix CVE-2017-9868. The persistence file was readable by all local users, + potentially allowing sensitive information to be leaked. + This can also be fixed administratively, by restricting access to the + directory in which the persistence file is stored. + +Broker: +- Fix for poor websockets performance. +- Fix lazy bridges not timing out for idle_timeout. Closes #417. +- Fix problems with large retained messages over websockets. Closes #427. +- Set persistence file to only be readable by owner, except on Windows. Closes + #468. +- Fix CONNECT check for reserved=0, as per MQTT v3.1.1 check MQTT-3.1.2-3. +- When the broker stop, wills for any connected clients are now "sent". Closes + #477. +- Auth plugins can be configured to disable the check for +# in + usernames/client ids with the auth_plugin_deny_special_chars option. + Partially closes #462. +- Restrictions for CVE-2017-7650 have been relaxed - '/' is allowed in + usernames/client ids. Remainder of fix for #462. + +Clients: +- Don't use / in auto-generated client ids. + + +1.4.12 - 20170528 +================= + +Security: +- Fix CVE-2017-7650, which allows clients with username or client id set to + '#' or '+' to bypass pattern based ACLs or third party plugins. The fix + denies message sending or receiving of messages for clients with a '#' or + '+' in their username or client id and if the message is subject to a + pattern ACL check or plugin check. + Patches for other versions are available at + https://mosquitto.org/files/cve/2017-7650/ + +Broker: +- Fix mosquitto.db from becoming corrupted due to client messages being + persisted with no stored message. Closes #424. +- Fix bridge not restarting properly. Closes #428. +- Fix unitialized memory in gets_quiet on Windows. Closes #426. +- Fix building with WITH_ADNS=no for systems that don't use glibc. Closes + #415. +- Fixes to readme.md. +- Fix deprecation warning for OpenSSL 1.1. PR #416. +- Don't segfault on duplicate bridge names. Closes #446. +- Fix CVE-2017-7650. + + +1.4.11 - 20170220 +================= + +Broker: +- Fix crash when "lazy" type bridge attempts to reconnect. Closes #259. +- maximum_connections now applies to websockets listeners. Closes #271. +- Allow bridges to use TLS with IPv6. +- Don't error on zero length persistence files. Closes #316. +- For http only websockets clients, close files served over http in all cases + when the client disconnects. Closes #354. +- Fix error message when websockets http_dir directory does not exist. +- Improve password utility error message. Closes #379. + +Clients: +- Use of --ciphers no longer requires you to also pass --tls-version. + Closes #380. + +Client library: +- Clients can now use TLS with IPv6. +- Fix potential socket leakage when reconnecting. Closes #304. +- Fix potential negative timeout being passed to pselect. Closes #329. + + +1.4.10 - 20160816 +================= + +Broker: +- Fix TLS operation with websockets listeners and libwebsockts 2.x. Closes + #186. +- Don't disconnect client on HUP before reading the pending data. Closes #7. +- Fix some $SYS messages being incorrectly persisted. Closes #191. +- Support OpenSSL 1.1.0. +- Call fsync after persisting data to ensure it is correctly written. Closes + #189. +- Fix persistence saving of subscription QoS on big-endian machines. +- Fix will retained flag handling on Windows. Closes #222. +- Broker now displays an error if it is unable to open the log file. Closes + #234. + +Client library: +- Support OpenSSL 1.1.0. +- Fixed the C++ library not allowing SOCKS support to be used. Closes #198. +- Fix memory leak when verifying a server certificate with a subjectAltName + section. Closes #237. + +Build: +- Don't attempt to install docs when WITH_DOCS=no. Closes #184. + + +1.4.9 - 20160603 +================ + +Broker: +- Ensure websockets clients that previously connected with clean session set + to false have their queued messages delivered immediately on reconnecting. + Closes #476314. +- Reconnecting client with clean session set to false doesn't start with mid=1 + again. +- Will topic isn't truncated by one byte when using a mount_point any more. +- Network errors are printed correctly on Windows. +- Fix incorrect $SYS heap memory reporting when using ACLs. +- Bridge config parameters couldn't contain a space, this has been fixed. + Closes #150. +- Fix saving of persistence messages that start with a '/'. Closes #151. +- Fix reconnecting for bridges that use TLS on Windows. Closes #154. +- Broker and bridges can now cope with unknown incoming PUBACK, PUBREC, + PUBREL, PUBCOMP without disconnecting. Closes #57. +- Fix websockets listeners not being able to bind to an IP address. Closes + #170. +- mosquitto_passwd utility now correctly deals with unknown command line + arguments in all cases. Closes #169. +- Fix publishing of $SYS/broker/clients/maximum +- Fix order of #includes in lib/send_mosq.c to ensure struct mosquitto doesn't + differ between source files when websockets is being used. Closes #180. +- Fix possible rare crash when writing out persistence file and a client has + incomplete messages inflight that it has been denied the right to publish. + +Client library: +- Fix the case where a message received just before the keepalive timer + expired would cause the client to miss the keepalive timer. +- Return value of pthread_create is now checked. +- _mosquitto_destroy should not cancel threads that weren't created by + libmosquitto. Closes #166. +- Clients can now cope with unknown incoming PUBACK, PUBREC, PUBREL, PUBCOMP + without disconnecting. Closes #57. +- Fix mosquitto_topic_matches_sub() reporting matches on some invalid + subscriptions. + +Clients: +- Handle some unchecked malloc() calls. Closes #1. + +Build: +- Fix string quoting in CMakeLists.txt. Closes #4. +- Fix building on Visual Studio 2015. Closes #136. + + +1.4.8 - 20160214 +================ + +Broker: +- Wills published by clients connected to a listener with mount_point defined + now correctly obey the mount point. This was a potential security risk + because it allowed clients to publish messages outside of their restricted + mount point. This is only affects brokers where the mount_point option is in + use. Closes #487178. +- Fix detection of broken connections on Windows. Closes #485143. +- Close stdin etc. when daemonised. Closes #485589. +- Fix incorrect detection of FreeBSD and OpenBSD. Closes #485131. + +Client library: +- mosq->want_write should be cleared immediately before a call to SSL_write, + to allow clients using mosquitto_want_write() to get accurate results. + + +1.4.7 - 20151221 +================ + +Broker: +- Fix support for libwebsockets 1.22. + + +1.4.6 - 20151220 +================ + +Broker: +- Add support for libwebsockets 1.6. + +Client library: +- Fix _mosquitto_socketpair() on Windows, reducing the chance of delays when + publishing. Closes #483979. + +Clients: +- Fix "mosquitto_pub -l" stripping the final character on a line. Closes + #483981. + + +1.4.5 - 20151108 +================ + +Broker: +- Fix possible memory leak if bridge using SSL attempts to connect to a + host that is not up. +- Free unused topic tree elements (fix in 1.4.3 was incomplete). Closes + #468987. + +Clients: +- "mosquitto_pub -l" now no longer limited to 1024 byte lines. Closes #478917. + + +1.4.4 - 20150916 +================ + +Broker: +- Don't leak sockets when outgoing bridge with multiple addresses cannot + connect. Closes #477571. +- Fix cross compiling of websockets. Closes #475807. +- Fix memory free related crashes on openwrt. Closes #475707. +- Fix excessive calls to message retry check. + + +1.4.3 - 20150818 +================ + +Broker: +- Fix incorrect bridge notification on initial connection. Closes #467096. +- Build fixes for OpenBSD. +- Fix incorrect behaviour for autosave_interval, most noticable for + autosave_interval=1. Closes #465438. +- Fix handling of outgoing QoS>0 messages for bridges that could not be sent + because the bridge connection was down. +- Free unused topic tree elements. Closes #468987. +- Fix some potential memory leaks. Closes #470253. +- Fix potential crash on libwebsockets error. + +Client library: +- Add missing error strings to mosquitto_strerror. +- Handle fragmented TLS packets without a delay. Closes #470660. +- Fix incorrect loop timeout being chosen when using threaded interface and + keepalive = 0. Closes #471334. +- Increment inflight messages count correctly. Closes #474935. + +Clients: +- Report error string on connection failure rather than error code. + + +1.4.2 - 20150507 +================ + +Broker: +- Fix bridge prefixes only working for the first outgoing message. Closes + #464437. +- Fix incorrect bridge connection notifications on local broker. +- Fix persistent db writing on Windows. Closes #464779. +- ACLs are now checked before sending a will message. +- Fix possible crash when using bridges on Windows. Closes #465384. +- Fix parsing of auth_opt_ arguments with extra spaces/tabs. +- Broker will return CONNACK rc=5 when a username/password is not authorised. + This was being incorrectly set as rc=4. +- Fix handling of payload lengths>4096 with websockets. + +Client library: +- Inflight message count wasn't being decreased for outgoing messages using + QoS 2, meaning that only up to 20 QoS 2 messages could be sent. This has + been fixed. Closes #464436. +- Fix CMake dependencies for C++ wrapper building. Closes #463884. +- Fix possibility of select() being called with a socket that is >FD_SETSIZE. + This is a fix for #464632 that will be followed up by removing the select() + call in a future version. +- Fix calls to mosquitto_connect*_async() not completing. + + +1.4.1 - 20150403 +================ + +Broker: +- Fix possible crash under heavy network load. Closes #463241. +- Fix possible crash when using pattern ACLs. +- Fix problems parsing config strings with multiple leading spaces. Closes + #462154. +- Websockets clients are now periodically disconnected if they have not + maintained their keepalive timer. Closes #461619. +- Fix possible minor memory leak on acl parsing. + +Client library: +- Inflight limits should only apply to outgoing messages. Closes #461620. +- Fix reconnect bug on Windows. Closes #463000. +- Return -1 on error from mosquitto_socket(). Closes #461705. +- Fix crash on multiple calls to mosquitto_lib_init/mosquitto_lib_cleanup. + Closes #462780. +- Allow longer paths on Windows. Closes #462781. +- Make _mosquitto_mid_generate() thread safe. Closes #463479. + + +1.4 - 20150218 +============== + +Important changes: +- Websockets support in the broker. +- Bridge behaviour on the local broker has changed due to the introduction of + the local_* options. This may affect you if you are using authentication + and/or ACLs with bridges. +- The default TLS behaviour has changed to accept all of TLS v1.2, v1.1 and + v1.0, rather than only only one version of the protocol. It is still + possible to restrict a listener to a single version of TLS. +- The Python client has been removed now that the Eclipse Paho Python client + has had a release. +- When a durable client reconnects, its queued messages are now checked + against ACLs in case of a change in username/ACL state since it last + connected. +- New use_username_as_clientid option on the broker, for preventing hijacking + of a client id. +- The client library and clients now have experimental SOCKS5 support. +- Wildcard TLS certificates are now supported for bridges and clients. +- The clients have support for config files with default options. +- Client and client libraries have support for MQTT v3.1.1. +- Bridge support for MQTT v3.1.1. + + +Broker: +- Websockets support in the broker. +- Add local_clientid, local_username, local_password for bridge connections to + authenticate to the local broker. +- Default TLS mode now accepts TLS v1.2, v1.1 and v1.0. +- Support for ECDHE-ECDSA family ciphers. +- Fix bug #1324411, which could have had unexpected consequences for delayed + messages in rare circumstances. +- Add support for "session present" in CONNACK messages for MQTT v3.1.1. +- Remove strict protocol #ifdefs. +- Change $SYS/broker/clients/active -> $SYS/broker/clients/connected +- Change $SYS/broker/clients/inactive -> $SYS/broker/clients/disconnected +- When a durable client reconnects, its queued messages are now checked + against ACLs in case of a change in username/ACL state since it last + connected. +- libuuid is used to generate client ids, where it is available, when an MQTT + v3.1.1 client connects with a zero length client id. +- Anonymous clients are no longer accidently disconnected from the broker + after a SIGHUP. +- mosquitto_passwd now supports -b (batch mode) to allow the password to be + provided at the command line. +- Removed $SYS/broker/changeset. This was intended for use with debugging, but + in practice is of no use. +- Add support for use_username_as_clientid which can be used with + authentication to restrict ownership of client ids and hence prevent one + client disconnecting another by using the same client id. +- When "require_certificate" was false, the broker was incorrectly asking for + a certificate (but not checking it). This caused problems with some clients + and has been fixed so the broker no longer asks. +- When using syslog logging on non-Windows OSs, it is now possible to specify + the logging facility to one of local0-7 instead of the default "daemon". +- The bridge_attempt_unsubscribe option has been added, to allow the sending + of UNSUBSCRIBE requests to be disabled for topics with "out" direction. + Closes bug #456899. +- Wildcard TLS certificates are now supported for bridges. +- Support for "hour" client expiration lengths for the + persistent_client_expiration option. Closes bug #425835. +- Bridge support for MQTT v3.1.1. +- Root privileges are now dropped after starting listeners and loading + certificates/private keys, to allow private keys to have their permissions + restricted to the root user only. Closes bug #452914. +- Usernames and topics given in ACL files can now include a space. Closes bug + #431780. +- Fix hang if pattern acl contains a %u but an anonymous client connect. + Closes bug #455402. +- Fix man page installation with cmake. Closes bug #458843. +- When using "log_dest file" the output file is now flushed periodically. + +Clients: +- Both clients can now load default configuration options from a file. +- Add -C option to mosquitto_sub to allow the client to quit after receiving a + certain count of messages. Closes bug #453850. +- Add --proxy SOCKS5 support for both clients. +- Pub client supports setting its keepalive. Closes bug #454852. +- Add support for config files with default options. +- Add support for MQTT v3.1.1. + +Client library: +- Add experimental SOCKS5 support. +- mosquitto_loop_forever now quits after a fatal error, rather than blindly + retrying. +- SRV support is now not compiled in by default. +- Wildcard TLS certificates are now supported. +- mosquittopp now has a virtual destructor. Closes bug #452915. +- Add support for MQTT v3.1.1. +- Don't quit mosquitto_loop_forever() if broker not available on first + connect. Closes bug #453293, but requires more work. + + +1.3.5 - 20141008 +================ + +Broker: +- Fix possible memory leak when using a topic that has a leading slash. Fixes + bug #1360985. +- Fix saving persistent database on Windows. +- Temporarily disable ACL checks on subscriptions when using MQTT v3.1.1. This + is due to the complexity of checking wildcard ACLs against wildcard + subscriptions. This does not have a negative impact on security because + checks are still made before a message is sent to a client. + Fixes bug #1374291. +- When using -v and the broker receives a SIGHUP, verbose logging was being + disabled. This has been fixed. + +Client library: +- Fix mutex being incorrectly passed by value. Fixes bug #1373785. + +1.3.4 - 20140806 +================ + +Broker: +- Don't ask client for certificate when require_certificate is false. +- Backout incomplete functionality that was incorrectly included in 1.3.2. + +1.3.3 - 20140801 +================ + +Broker: +- Fix incorrect handling of anonymous bridges on the local broker. + +1.3.2 - 20140713 +================ + +Broker: +- Don't allow access to clients when authenticating if a security plugin + returns an application error. Fixes bug #1340782. +- Ensure that bridges verify certificates by default when using TLS. +- Fix possible crash when using pattern ACLs that do not include a %u and + clients that connect without a username. +- Fix subscriptions being deleted when clients subscribed to a topic beginning + with a $ but that is not $SYS. +- When a durable client reconnects, its queued messages are now checked + against ACLs in case of a change in username/ACL state since it last + connected. +- Fix bug #1324411, which could have had unexpected consequences for delayed + messages in rare circumstances. +- Anonymous clients are no longer accidently disconnected from the broker + after a SIGHUP. + +Client library: +- Fix topic matching edge case. +- Fix callback deadlocks after calling mosquitto_disconnect(), when using the + threaded interfaces. Closes bug #1313725. +- Fix SRV support when building with CMake. +- Remove strict protocol #ifdefs. + +General: +- Use $(STRIP) for stripping binaries when installing, to allow easier cross + compilation. + +1.3.1 - 20140324 +================ + +Broker: +- Prevent possible crash on client reconnect. Closes bug #1294108. +- Don't accept zero length unsubscription strings (MQTT v3.1.1 fix) +- Don't accept QoS 3 (MQTT v3.1.1 fix) +- Don't disconnect clients immediately on HUP to give chance for all data to + be read. +- Reject invalid un/subscriptions e.g. foo/+bar #/bar. +- Take more care not to disconnect clients that are sending large messages. + +Client library: +- Fix socketpair code on the Mac. +- Fix compilation for WITH_THREADING=no. +- Break out of select() when calling mosquitto_loop_stop(). +- Reject invalid un/subscriptions e.g. foo/+bar #/bar. +- Add mosquitto_threaded_set(). + +Clients: +- Fix keepalive value on mosquitto_pub. +- Fix possibility of mosquitto_pub not exiting after sending messages when + using -l. + +1.3 - 20140316 +============== + +Broker: +- The broker no longer ignores the auth_plugin_init() return value. +- Accept SSLv2/SSLv3 HELLOs when using TLSv1, whilst keeping SSLv2 and SSLv3 + disabled. This increases client compatibility without sacrificing security. +- The $SYS tree can now be disabled at runtime as well as at compile time. +- When remapping bridged topics, only check for matches when the message + direction is correct. This allows two identical topics to be remapped + differently for both in and out. +- Change "$SYS/broker/heap/current size" to "$SYS/broker/heap/current" for + easier parsing. +- Change "$SYS/broker/heap/maximum size" to "$SYS/broker/heap/maximum" for + easier parsing. +- Topics are no longer normalised from e.g a///topic to a/topic. This matches + the behaviour as clarified by the Oasis MQTT spec. This will lead to + unexpected behaviour if you were using topics of this form. +- Log when outgoing messages for a client begin to drop off the end of the + queue. +- Bridge clients are recognised as bridges even after reloading from + persistence. +- Basic support for MQTT v3.1.1. This does not include being able to bridge to + an MQTT v3.1.1 broker. +- Username is displayed in log if present when a client connects. +- Support for 0 length client ids (v3.1.1 only) that result in automatically + generated client ids on the broker (see option allow_zero_length_clientid). +- Ability to set the prefix of automatically generated client ids (see option + auto_id_prefix). +- Add support for TLS session resumption. +- When using TLS, the server now chooses the cipher to use when negotiating + with the client. +- Weak TLS ciphers are now disabled by default. + +Client library: +- Fix support for Python 2.6, 3.0, 3.1. +- Add support for un/subscribing to multiple topics at once in un/subscribe(). +- Clients now close their socket after sending DISCONNECT. +- Python client now contains its version number. +- C library mosquitto_want_write() now supports TLS clients. +- Fix possible memory leak in C/C++ library when communicating with + a broker that doesn't follow the spec. +- Return strerror() through mosquitto_strerror() to make error printing + easier. +- Topics are no longer normalised from e.g a///topic to a/topic. This matches + the behaviour as clarified by the Oasis MQTT spec. This will lead to + unexpected behaviour if you were using topics of this form. +- Add support for SRV lookups. +- Break out of select() on publish(), subscribe() etc. when using the threaded + interface. Fixes bug #1270062. +- Handle incoming and outgoing messages separately. Fixes bug #1263172. +- Don't terminate threads on mosquitto_destroy() when a client is not using + the threaded interface but does use their own thread. Fixes bug #1291473. + +Clients: +- Add --ciphers to allow specifying which TLS ciphers to support. +- Add support for SRV lookups. +- Add -N to sub client to suppress printing of EOL after the payload. +- Add -T to sub client to suppress printing of a topic hierarchy. + +1.2.3 - 20131202 +================ + +Broker: +- Don't always attempt to call read() for SSL clients, irrespective of whether + they were ready to read or not. Reduces syscalls significantly. +- Possible memory leak fixes. +- Further fix for bug #1226040: multiple retained messages being delivered for + subscriptions ending in #. +- Fix bridge reconnections when using multiple bridge addresses. + +Client library: +- Fix possible memory leak in C/C++ library when communicating with + a broker that doesn't follow the spec. +- Block in Python loop_stop() until all messages are sent, as the + documentation states should happen. +- Fix for asynchronous connections on Windows. Closes bug #1249202. +- Module version is now available in mosquitto.py. + +Clients: +- mosquitto_sub now uses fwrite() instead of printf() to output messages, so + messages with NULL characters aren't truncated. + +1.2.2 - 20131021 +================ + +Broker: +- Fix compliance with max_inflight_messages when a non-clean session client + reconnects. Closes one of the issues on bug #1237389. + +Client library: +- Fix incorrect inflight message accounting, which caused messages to go + unsent. Partial fix for bug #1237351. +- Fix potential memory corruption when sending QoS>0 messages at a high rate + using the threaded interface. Further fix for #1237351. +- Fix incorrect delay scaling when exponential_backoff=true in + mosquitto_reconnect_delay_set(). +- Some pep8 fixes for Python. + +1.2.1 - 20130918 +================ + +Broker: +- The broker no longer ignores the auth_plugin_init() return value. Closes + bug #1215084. +- Use RTLD_GLOBAL when opening authentication plugins on posix systems. Fixes + resolving of symbols in libraries used by authentication plugins. +- Add/fix some config documentation. +- Fix ACLs for topics with $SYS. +- Clients loaded from the persistence file on startup were not being added to + the client hash, causing subtle problems when the client reconnected, + including ACLs failing. This has been fixed. +- Add note to mosquitto-tls man page stating that certificates need to be + unique. Closes bug #1221285. +- Fix incorrect retained message delivery when using wildcard subs in some + circumstances. Fixes bug #1226040. + +Client library: +- Fix support for Python 2.6, 3.0, 3.1. +- Fix TLS subjectAltName verification and segfaults. +- Handle EAGAIN in Python on Windows. Closes bug #1220004. +- Fix compilation when using WITH_TLS=no. +- Don't fail reconnecting in Python when broker is temporarily unavailable. + +1.2 - 20130708 +============== + +Broker: +- Replace O(n) username lookup on CONNECT with a roughly O(1) hashtable version. +- It is now possible to disable $SYS at compile time. +- Add dropped publish messages to load tree in $SYS. Closes bug #1183318. +- Add support for logging SUBSCRIBE/UNSUBSCRIBE events. +- Add "log_dest file" logging support. +- Auth plugin ACL check function now passes the client id as well as username + and password. +- The queue_qos0_messages option wasn't working correctly, this has now been + fixed. Closes bug #1125200. +- Don't drop all messages for disconnected durable clients when + max_queued_messages=0. +- Add support for "log_type all". +- Add support for "-v" option on the command line to provide the equivalent of + "log_type all" without needing a config file. +- Add the "upgrade_outgoing_qos" option, a non-standard feature. +- Persistence data is now written to a temporary file which is atomically + renamed on completion, so a crash during writing will not produce a corrupt + file. +- mosquitto.conf is now installed as mosquitto.conf.example +- Configuration file errors are now reported with filename and line number. +- The broker now uses a monotonic clock if available, to avoid changes in time + causing client disconnections or message retries. +- Clean session and keepalive status are now display the log when a client + connects. +- Add support for TLSv1.2 and TLSv1.1. +- Clients that connect with zero length will topics are now rejected. +- Add the ability to set a maximum allowed PUBLISH payload size. +- Fix an ACL with topic "#" incorrectly granting access to $SYS. +- Fix retained messages incorrectly being set on wildcard topics, leading to + duplicate retained messages being sent on subscription. Closes bug #1116233. +- Don't discard listener values when no "port" option given. Closes bug + #1131406. +- Client password check was always failing when security was being reapplied + after a config reload. This meant that all clients were being disconnected. + This has been fixed. +- Fix build when WITH_TLS=no. Closes bug #1174971. +- Fix single outgoing packets not being sent in a timely fashion if they were + not sent in one call to write(). Closes bug #1176796. +- Fix remapping of messages for clients connected to a listener with + mount_point set. Closes bug #1180765. +- Fix duplicate retained messages being sent for some wildcard patterns. +- If a client connects with a will topic to which they do not have write + access, they are now disconnected with CONNACK "not authorised". +- Fix retained messages on topic foo being incorrectly delivered to + subscriptions of /# +- Fix handling of SSL errors on SSL_accept(). +- Fix handling of QoS 2 messages on client reconnect. +- Drop privileges now sets supplementary groups correctly. +- Fix load reporting interval (is now 60s). +- Be strict with malformed PUBLISH packets - clients are now disconnected + rather than the packet discarded. This goes inline with future OASIS spec + changes and makes other changes more straightforward. +- Process incoming messages denied by ACL properly so that clients don't keep + resending them. + +- Add support for round_robin bridge option. +- Add bridge support for verifying remote server certificate subject against + the remote hostname. +- Fix problem with out of order calls to free() when restarting a lazy bridge. +- The broker now attempts to resolve bind_address and bridge addresses + immediately when parsing the config file in order to detect invalid hosts. +- Bridges now set their notification state before attempting to connect, so if + they fail to connect the state can still be seen. +- Fix bridge notification payload length - no need to send a null byte. + +- mosquitto_passwd utility now reports errors more clearly. +- Fix "mosquitto_passwd -U". + +Client library: +- Add support for TLSv1.2 and TLSv1.1, except for on the Python module. +- Add support for verifying remote server certificate subject against the + remote hostname. +- Add mosquitto_reconnect_async() support and make asynchronous connections + truely asynchronous rather than simply deferred. DNS lookups are still + blocking, so asynchronous connections require an IP address instead of + hostname. +- Allow control of reconnection timeouts in mosquitto_loop_forever() and after + mosquitto_loop_start() by using mosquitto_reconnect_delay_set(). +- Fix building on Android NDK. +- Re-raise unhandled errors in Python so as not to provide confusing error + messages later on. +- Python module supports IPv6 connections. +- mosquitto_sub_topic_tokenise() was behaving incorrectly if the last topic + hierarchy had only a single character. This has been fixed. Closes bug + #1163348. +- Fix possible crash after disconnects when using the threaded interface with + TLS. +- Allow build/install without Python. Closes bug #1174972. +- Add support for binding connection to a local interface. +- Implement maximum inflight messages handling. +- Fix Python client not handling will_payload==None. +- Fix potential memory leak when setting username/password. +- Fix handling of QoS 2 messages on reconnect. +- Improve handling of mosquitto_disconnect() with threaded mode. + + +Clients: +- Add support for TLSv1.2 and TLSv1.1. +- Sub client can now suppress printing of messages with the retain bit set. +- Add support for binding connection to a local interface. +- Implement maximum inflight messages handling for the pub client. + +1.1.3 - 20130211 +================ + +Broker: +- mosquitto_passwd utility now uses tmpfile() to generate its temporary data + storage file. It also creates a backup file that can be used to recover data + if an errors occur. + +Other: +- Build script fixes to help packaging on Debian. + +1.1.2 - 20130130 +================ + +Client library: +- Fix tls_cert_reqs not being set to SSL_VERIFY_PEER by default. This meant + that clients were not verifying the server certificate when connecting over + TLS. This affects the C, C++ and Python libraries. + +1.1.1 - 20130116 +================ + +Broker: +- Fix crash on reload if using acl patterns. + +Client library: +- Fix static C++ functions not being exported on Windows. Fixes bug #1098256. + +1.1 - 20121219 +============== + +Broker: +- Add $SYS/broker/messages/dropped +- Add $SYS/broker/clients/expired +- Replace $SYS/broker/+/per second/+ with moving average versions published at + $SYS/broker/load/# +- Add $SYS/broker/load/sockets/+ and $SYS/broker/load/connections/+ +- Documentation on password file format has been fixed. +- Disable SSL compression. This reduces memory usage significantly and removes + the possibility of CRIME type attacks. +- Enable SSL_MODE_RELEASE_BUFFERS mode to reduce SSL memory usage further. +- Add allow_duplicate_messages option. +- ACL files can now have comment lines with # as the first character. +- Display message on startup about which config is being loaded. +- Fix max_inflight_messages and max_queued_messages not being applied. +- Fix documentation error in mosquitto.conf. +- Ensure that QoS 2 queued messages are sent out in a timely manner. +- Local bridges now act on clean_session correctly. +- Local bridges with clean_session==false now remove unused subscriptions on + broker restart. +- The $SYS/broker/heap/# messages now no longer include "bytes" as part of the + string for ease of use. + +Client library: +- Free memory used by OpenSSL in mosquitto_lib_cleanup() where possible. +- Change WebSocket subprotocol name to mqttv3.1 to make future changes easier + and for compatibility with other implementations. +- mosquitto_loop_read() and mosquitto_loop_write() now handle errors + themselves rather than having mosquitto_loop() handle their errors. This + makes using them in a separate event loop more straightforward. +- Add mosquitto_loop_forever() / loop_forever() function call to make simple + clients easier. +- Disable SSL compression. This reduces memory usage significantly and removes + the possibility of CRIME type attacks. +- Enable SSL_MODE_RELEASE_BUFFERS mode to reduce SSL memory usage further. +- mosquitto_tls_set() will now return an error or raise an exception + immediately if the CA certificate or client certificate/key cannot be + accessed. +- Fix potential memory leaks on connection failures. +- Don't produce return error from mosquitto_loop() if a system call is + interrupted. This prevents disconnects/reconnects in threaded mode and + simplifies non-threaded client handling. +- Ignore SIGPIPE to prevent unnecessary client quits in threaded mode. +- Fix document error for mosquitto_message_retry_set(). +- Fix mosquitto_topic_matches_sub() for subscriptions with + as the final + character. Fixes bug #1085797. +- Rename all "obj" parameters to "userdata" for consistency with other + libraries. +- Reset errno before network read/write to ensure EAGAIN isn't mistakenly + returned. +- The message queue length is now tracked and used to determine the maximum + number of packets to process at once. This removes the need for the + max_packets parameter which is now unused. +- Fix incorrect error value in Python error_string() function. Fixes bug + #1086777. +- Reset last message in/out timer in Python module when we send a PINGREQ. + Fixes too-early disconnects. + +Clients: +- Clients now display their own version number and library version number in + their help messages. +- Fix "mosquitto_pub -l -q 2" disconnecting before all messages were + transmitted. +- Fix potential out-of-bounds array access with client ids. Fixes bug + #1083182. + +Other: +- mosquitto_passwd can now convert password files with plain text files to + hashed versions. + +1.0.5 - 20121103 +================ + +Broker: +- Fix crash when the broker has use_identity_as_username set to true but a + client connects without a certificate. +- mosquitto_passwd should only be installed if WITH_TLS=yes. + +Library: +- Use symbolic errno values rather than numbers in Python module to avoid + cross platform issues (incorrect errno on Mac OS). + +Other: +- Build script fixes for FreeBSD. + +1.0.4 - 20121017 +================ + +Broker: +- Deal with poll() POLLIN/POLLOUT before POLL[RD]HUP to correctly handle the + case where a client sends data and immediately closes its socket. + +Library: +- Fix memory leak with messages of QoS=2. Fixes bug #1064981. +- Fix potential thread synchronisation problem with outgoing packets in the + Python module. Fixes bug #1064977. + +Clients: +- Fix "mosquitto_sub -l" incorrectly only sending one message per second. + +1.0.3 - 20120927 +================ + +Broker: +- Fix loading of psk files. +- Don't return an error when reloading config if an ACL file isn't defined. + This was preventing psk files being reloaded. +- Clarify meaning of $SYS/broker/clients/total in mosquitto(8) man page. +- Clarify meaning of $SYS/broker/messages/stored in mosquitto(8) man page. +- Fix non-retained message delivery when subscribing to #. +- Fix retained message delivery for subs to foo/# with retained messages at + foo. +- Include the filename in password/acl file loading errors. + +Library: +- Fix possible AttributeError when self._sock == None in Python module. +- Fix reconnecting after a timeout in Python module. +- Fix reconnecting when there were outgoing packets in the queue in the Python + module. +- Fix problem with mutex initialisation causing crashes on some Windows + installations. + +1.0.2 - 20120919 +================ + +Broker: +- If the broker was configured for persistence, a durable client had a + subscription to topics in $SYS/# and had messages in its queue when the + broker restarted, then the persistent database would have messages missing + and so the broker would not restart properly. This has been fixed. + +Library: +- Fix threading problem on some systems. + +Tests: +- Close socket after 08-ssl-connect-no-auth-wrong-ca.py test to prevent + subsequent tests having problems. + +Build scripts: +- Install pskfile.example in CMake. Fixes bug #1037504. + +Other: +- Fix db_dump parameter printing message store and sub chunks. + +1.0.1 - 20120815 +================ + +Broker: +- Fix default log_dest when running as a Windows service. + +Client library: +- Fix incorrect parameters in Python on_log() callback call. Fixes bug + #1036818. + +Clients: +- Clients now don't display TLS/TLS-PSK usage help if they don't support it. + +Build scripts: +- Fix TLS-PSK support in the CMake build files. +- Fix man page installation in the CMake build files. +- Fix SYSCONFDIR in cmake on *nix when installing to /usr. Fixes bug #1036908. + +Documentation: +- Fix mqtt/MQTT capitalisation in man pages. +- Update compiling.txt. +- Fix incorrect callback docs in mosquitto.py. Fixes bug #1036607. +- Fix various doc typos and remove obsolete script. Fixes bug #1037088. + +1.0 - 20120814 +============== + +Broker: + +- Add SSL/TLS support. +- Add TLS-PSK support, providing a simpler encryption method for constrained + devices. +- Passwords are now salted+hashed if compiled with WITH_TLS (recommended). +- Add mosquitto_passwd for handling password files. +- Add $SYS/broker/publish/messages/{sent|received} to show the number of + PUBLISH messages sent/received. +- Add $SYS/broker/publish/bytes/{sent|received} to show the number of + PUBLISH bytes sent/received. +- Add reload parameter for security init/cleanup functions. +- Add option for expiring disconnected persistent clients. +- Add option for queueing of QoS 0 messages when persistent clients are + disconnected. +- Enforce client id limits in the broker (only when WITH_STRICT_PROTOCOL is + defined). +- Fix reloading of log configuration. +- Add support for try_private config option for bridge connections. +- Add support for autosave_on_changes config option. +- Add support for include_dir config option. +- Add support for topic remapping. +- Usernames were being lost when a non clean-session client reconnected, + potentially causing problems with ACLs. This has been fixed. +- Significant improvement to memory handling on Windows. +- Bridges with outgoing topics will now set the retain flag correctly so that + messages will be retained on the remote broker. +- Incoming bridge connections are now detected by checking if bit 8 of the + protocol version number is set. This requires support from the remote broker. +- Add support for notification_topic option. +- Add $SYS/broker/subscriptions/count and $SYS/broker/retained messages/count. +- Add restart_timeout to control the amount of time an automatic bridge will + wait before reconnecting. +- Overlapping subscriptions are now handled properly. Fixes bug #928538. +- Fix reloading of persistence_file and persistence_location. +- Fix broker crash on incorrect protocol number. +- Fix missing COMPAT_ECONNRESET define on Windows. +- Clients that had disconnected were not always being detected immediately on + Linux. This has been fixed. +- Don't save $SYS messages to the on-disk persistent db. All $SYS messages + should be reconstructed on a restart. This means bridge connection + notifications will now be correct on a restart. +- Fix reloading of bridge clients from the persistent db. This means that + outgoing bridged topics should always work. +- Local bridges are now no longer restricted by local ACLs. +- Discard publish messages with zero length topics. +- Drop to "mosquitto" user even if no config file specified. +- Don't incorrectly allow topic access if ACL patterns but no normal ACL rules + are defined. + +Client library: + +- Add SSL/TLS support. +- Add TLS-PSK support, providing a simpler encryption method for constrained + devices. +- Add javascript/websockets client library. +- Add "struct mosquitto *mosq" parameter for all callbacks in the client + library. This is a binary incompatible change so the soversion of the + libraries has been incremented. The new parameter should make it easier to + use callbacks in practice. +- Add mosquitto_want_write() for use when using own select() loop with + mosquitto_socket(). +- Add mosquitto_connect_async() to provide a non-blocking connect client call. +- Add mosquitto_user_data_set() to allow user data pointer to be updated. +- Add "int rc" parameter to disconnect callback to indicate whether disconnect + was unexpected or the result of calling mosquitto_disconnect(). +- Add mosquitto_strerror() for obtaining a string description of error numbers. +- Add mosquitto_connack_string() for obtaining a string description of MQTT + connection results. +- Add mosquitto_will_clear() and change mosquitto_will_set() to only set the + will. +- Add mosquitto_sub_topic_tokenise() and mosquitto_sub_topic_tokens_free() + utility functions to tokenise a subscription/topic string into a string + array. +- Add mosquitto_topic_matches_sub() to check whether a topic matches a + subscription. +- Replaced mosquitto_log_init() with mosquitto_log_callback_set() to allow + clients to decide what to do with log messages. +- Client will now disconnect itself from the broker if it doesn't receive a + PINGRESP in the keepalive period after sending a PINGREQ. +- Client will now send a PINGREQ if it has not received a message from the + broker in keepalive seconds. +- mosquitto_new() will now generate a random client id if the id parameter is + NULL. +- Added max_packets to mosquitto_loop(), mosquitto_loop_read() and + mosquitto_loop_write() to control the maximum number of packets that are + handled per call. +- Payload parameters are now void * instead of uint8_t *. +- The clean_session parameter has been moved from mosquitto_connect() to + mosquitto_new() because it is a client parameter rather than a connection + parameter. +- Functions now use int instead of uint*_t where possible. +- mosquitto_new() now sets errno to indicate failure type. +- Return MOSQ_ERR_INVAL on zero length topic. +- Fix automatic client id generation on Windows. +- mosquitto_loop_misq() can now return MOSQ_ERR_NO_CONN. +- Compile static library as well as dynamic library with default makefiles. +- Rename C++ namespace from mosquittopp to mosqpp to remove ambiguity. +- C++ lib_init(), lib_version() and lib_cleanup() are now in the mosqpp + namespace directly, not mosquittopp class members. +- The Python library is now written in pure Python and so no longer depends on + libmosquitto. +- The Python library includes SSL/TLS support. +- The Python library should now be compatible with Python 3. + +Other: + +- Fix db_dump reading of retained messages. +- Add example of logging all messages to mysql. +- Add C++ client example. +- Fix potential buffer overflow in pub/sub clients. +- Add "make binary" target that doesn't make documents. +- Add "--help" arguments to pub/sub clients. +- Fix building on Solaris. + +0.15 - 20120205 +=============== + +- Add support for $SYS/broker/clients/maximum and $SYS/broker/clients/active + topics. +- Add support for $SYS messages/byte per second received/sent topics. +- Updated mosquitto man page - $SYS hierarchy and signal support were out of + date. +- Auto generated pub/sub client ids now include the hostname. +- Tool for dumping persistent DB contents is available in src/db_dump. It isn't + installed by default. +- Enforce topic length checks in client library. +- Implement "once" and "lazy" bridge start types. +- Add new return type MOSQ_ERR_ERRNO to indicate that the errno variable should + be checked for the real error code. +- Add support for connection_messages config option. +- mosquitto_sub will now refuse to run if the -c option (disable clean session) + is given and no client id is provided. +- mosquitto_pub now gives more useful error messages on invalid input or other + error conditions. +- Fix Python will_set() true/True typo. +- Fix messages to topic "a/b" incorrectly matching on a subscription "a" if + another subscription "a/#" exists. + +0.14.4 - 20120106 +================= + +- Fix local bridge notification messages. +- Fix return values for more internal library calls. +- Fix incorrect out of memory checks in library and broker. +- Never time out local bridge connections. + +0.14.3 - 20111210 +================= + +- Fix potential crash when client connects with an invalid CONNECT packet. +- Fix incorrect invalid socket comparison on Windows. +- Server shouldn't crash when a message is published to foo/ when a + subscription to foo/# exists (bug #901697). +- SO_REUSEADDR doesn't work the same on Windows, so don't use it. +- Cygwin builds now support Windows service features. +- Fix $SYS/broker/bytes/sent reporting. + +0.14.2 - 20111123 +================= + +- Add uninstall target for libs. +- Don't try to write packet whilst in a callback. + +0.14.1 - 20111117 +================= + +- Fix Python sytax errors (bug #891673). + +0.14 - 20111116 +=============== + +- Add support for matching ACLs based on client id and username. +- Add a Windows installer file (NSIS based). +- Add native support for running the broker as a Windows service. This is the + default when installed using the new installer. +- Fix client count for listeners. When clients disconnect, decrement the + count. Allow max_connections to work again. +- Attempt to send all packets immediately upon being queued. This will result + in more immediate network communication in many cases. +- Log IP address when reporting CONNACK packets if the client id isn't yet + known. +- Fix payload length calculation in python will_set function. +- Fix Python publish and will_set functions for payload=None. +- Fix keepalive value being lost when reconnecting a client (bug #880863). +- Persistence file writing now uses portable file functions, so the Cygwin + broker build should no longer be necessary. +- Duplicate code between the client and broker side has been reduced. +- Queued messages for clients reconnecting with clean_session=false set were + not being sent until the next message for that client was received. This has + been fixed (bug #890724). +- Fix subscriptions to # incorrectly matching against topics beginning with / + +0.13 - 20110920 +=============== + +- Implement bridge state notification messages. +- Save client last used mid in persistent database (DB version number bumped). +- Expose message id in Python MosquittoMessage. +- It is now possible to set the topic QoS level for bridges. +- Python MosquittoMessage payload parameter is now a Python string, not a + ctypes object which makes it much easier to use. +- Fix queueing of messages for disconnected clients. The max_queued_messages + option is now obeyed. +- C++ library is now in its own namespace, mosquittopp. +- Add support for adding log message timestamps in the broker. +- Fix missing mosquitto_username_pw_set() python binding. +- Fix keepalive timeout for reconnecting non clean-session clients. Prevents + immediate disconnection on reconnection. +- Fix subscription wildcard matching - a subscription of +/+ will now match + against /foo +- Fix subscription wildcard matching - a subscription of foo/# will now match + against foo +- When restoring persistent database, clients should be set to non + clean-session or their subscriptions will be immediately removed. +- Fix SUBACK payload for multiple topic subscriptions. +- Don't send retained messages when a client subscribes to a topic it is + already subscribed to. + +0.12 - 20110725 +=============== + +- Reload (most) configuration on SIGHUP. +- Memory tracking is no longer compiled in the client library. +- Add --help option to mosquitto to display usage. +- Add --id-prefix option to clients to allow easier use with brokers that are + using the clientid_prefix option. +- Fix compilation on QNX. +- Add -P as a synonym argument for --pw in the clients. +- Fix python MosquittoMessage payload parameter. This is now returned as a + pointer to an array of c_uint8 values so binary data is handled correctly. + If a string is needed, use msg.payload_str +- Fix memory leaks on client authentication. +- If password_file is not defined then clients can now connect even if they + use a username/password. +- Add mosquitto_reconnect() to the client library. +- Add option for compiling with liberal protocol compliance support (enabled + by default). +- Fix problems with clients reconnecting and old messages remaining in the + message store. +- Display both ip and client id in the log message when a client connects. + Change the socket connection message to make it more obvious that it is just + a socket connection being made (bug #801135). +- Fix retained message delivery where a subscription contains a +. +- Be more lenient when reloading persistent database to reduce errors with + empty retained messages. + +0.11.3 - 20110707 +================= + +- Don't complain and quit if persistence_file option is given (bug #802423). +- Initialise listeners correctly when clients with duplicate client ids + connect. Bug #801678. +- Memory tracking is now disabled for Symbian builds due to lack of malloc.h. +- Fix memory tracking compilation for kFreeBSD. +- Python callbacks can now be used with class member functions. +- Fix persistent database writing of client message chunks which caused + errors when restoring (bug #798164). + +0.11.2 - 20110626 +================= + +- Don't free contexts in mqtt3_context_disconnect() (bug #799688 / #801678). +- Only free will if present when freeing a client context. + +0.11.1 - 20110620 +================= + +- Fix buffer overrun when checking for + and # in topics (bug #799688). +- Pub client now quits if publish fails. + +0.11 - 20110619 +=============== + +- Removed all old sqlite code. +- Remove client id limit in clients. +- Implemented $SYS/broker/heap/maximum size +- Implemented $SYS/broker/clients/inactive to show the number of disconnected + non-clean session clients. +- $SYS/broker/heap/current size and maximum size messages now include "bytes" + to match rsmb message format. +- Implemented the retained_persistence config file option - a synonym of the + "persistence" option. +- Added security_external.c to broker source to make it easier for third + parties to add support for their existing username/password and ACL database + for security checks. See external_security_checks.txt. +- $SYS messages are now only republished when their value changes. +- Windows native broker now responds to command line arguments. +- Simplify client disconnecting so wills gets sent in all cases (bug #792468). +- Clients now have a --quiet option. +- The on_disconnect() callback will always be called now, even if the client + has disconnected unexpectedly. +- Always close persistent DB file after restoring. +- Return error code when exiting the clients. +- mosquitto_publish() now returns MOSQ_ERR_INVAL if the topic contains + or # +- mosquitto now silently rejects published messages with + or # in the topic. +- max_connections is now a per-listener setting instead of global. +- Connection count is now reduced when clients disconnect (bug #797983). + +0.10.2 - 20110106 +================= + +- Don't abort when connecting if the first connection fails. This is important + on e.g. Windows 7, where IPV6 is offered as the first choice but may not be + available. +- Deal with long logging messages properly (bug #785882). +- Fix library compilation on Symbian - no pselect() available. +- Don't stop processing subscriptions on received messages after a + subscription with # matches. (bug #791206). + +0.10.1 - 20110512 +================= + +- Fix Windows compilation. +- Fix mosquitto.py on Windows - call lib init/cleanup. +- Don't abort when connecting if given an unknown address type (assuming an + IPv4 or IPv6 address is given). + +0.10 - 20110429 +=============== + +- Implement support for the password_file option and accompanying + authentication requirements in the broker. +- Implement topic Access Control Lists. +- mosquitto_will_set() and mosquitto_publish() now return + MOSQ_ERR_PAYLOAD_SIZE if the payload is too large (>268,435,455 bytes). +- Bridge support can now be disabled at compile time. +- Group together network writes for outgoing packets - don't send single byte + writes! +- Add support for clientid_prefixes variable. +- Add support for the clientid config variable for controlling bridge client + ids. +- Remove 32-bit database ID support because htobe64() no longer used. +- Multiple client subscriptions to the same topic result in only a single + subscription. Bug #744077. + +0.9.3 - 20110310 +================ + +- Set retained message status for QoS 2 messages (bug #726535). +- Only abort with an error when opening listening sockets if no address family + is available, rather than aborting when any address family is not available. +- Don't clean queued messages when a non clean session client reconnects. +- Make mosquitto.py compatible with Python <2.6. +- Fix mosquitto.h header includes for Windows. + +0.9.2 - 20110208 +================ + +- Only send a single DISCONNECT command when using -l in the pub client. +- Set QoS=1 on PUBREL commands to meet protocol spec. +- Don't leak sockets on connection failure in the library. +- Install man pages when building under cmake. +- Fix crash bug on malformed CONNECT message. +- Clients are now rejected if their socket peer name cannot be obtained on + connection. +- Fix a number of potential problems caused when a client with a duplicate id + connects. +- Install mosquitto.conf under cmake. + +0.9.1 - 20101203 +================ + +- Add missing code for parsing the "bind_address" configuration option. +- Fix missing include when compiling with tcp-wrappers support. +- Add linker version script for C library to control exported functions. + +0.9 - 20101114 +============== + +- Client and message data is now stored in memory with custom routines rather + than a sqlite database. This removes the dependencies on sqlite, pcre and + sqlite3-pcre. It also means that the persistent database format has had to + be reimplemented in a custom format. Optional support for importing old + sqlite databases is provided. +- Added IPv6 support for mosquitto and the clients. +- Provide username and password support for the clients and client libraries. + This is part of the new MQTT v3.1 spec. +- The broker supports the username and password connection flags, but will not + do anything with the username and password. +- Python callback functions now optionally take an extra argument which will + return the user object passed to the Mosquitto() constructor, or the calling + python object itself if nothing was given to Mosquitto(). +- Remove the mosquitto command line option "-i interface". +- Remove the mosquitto.conf "interface" variable. +- Add support for the listener config variable (replaces the interface + variable) +- Add support for the bind_address config variable. +- Change the port config variable behaviour to match that of rsmb (applies to + the default listener only, can be given just once). +- Fix QoS 2 protocol compliance - stop sending duplicate messages and handle + timeouts correctly. Fixes bug #598290. +- Set retain flag correctly for outgoing messages. It should only be set for + messages sent in response to a subscribe command (ie. stale data). +- Fix bug in returning correct CONNACK result to on_connect client callback. +- Don't send client will if it is disconnected for exceeding its keepalive + timer. +- Fix client library unsubscribe function incorrectly sending a SUBSCRIBE + command when it should be UNSUBSCRIBE. +- Fix max_inflight_messages and max_queued_messages operation. These + parameters now apply only to QoS 1 and 2 messages and are used regardless of + the client connection state. +- mosquitto.conf now installed to /etc/mosquitto/mosquitto.conf instead of + /etc/mosquitto.conf. The /etc/mosquitto/ directory will be used for password + and access control files in the future. +- Give the compile time option of using 32-bit integers for the database IDs + instead of 64-bit integers. This is useful where htobe64()/be64toh() are not + available or for embedded systems for example. +- The DUP bit is now set correctly when resending PUBREL messages. +- A port to Windows native has been partially completed. This currently drops a + number of features, including the ability to change configuration parameters + and persistent storage. + +0.8.3 - 20101004 +================ + +- Fix QoS 2 protocol compliance - stop sending duplicate messages and handle + timeouts correctly. Fixes bug #598290. (backported from future 0.9 code) + +0.8.2 - 20100815 +================ + +- Fix default loop() timeout value in mosquitto.py. Previous value was 0, + causing high cpu load. +- Fix message handling problem in client library when more than one message was + in the client queue. +- Fix the logic used to determine whether a QoS>0 message needs to be retried. +- Fix the Python sub.py example so that it quits on error. + +0.8.1 - 20100812 +================ + +- Improve python interface +- Fix incorrect return value from message delete function +- Use logging function to print error messages in clients. +- Fix python installation script DESTDIR. +- Fix library destination path for 64-bit machines. + +0.8 - 20100807 +============== + +- Topics starting with a / are treated as distinct to those not starting with + a /. For example, /topic/path is different to topic/path. This matches the + behaviour of rsmb. +- Correctly calculate the will QoS on a new client connection (bug #597451). +- Add "addresses" configuration file variable as an alias of "address", for + better rsmb compatibility. +- Bridge clean_session setting is now false, to give more sensible behaviour + and be more compatible with rsmb. +- Add cleansession variable for configuring bridges. +- Add keepalive_interval variable for bridges. +- Remove default topic subscription for mosquitto_sub because the old + behaviour was too confusing. +- Added a C client library, which the pub and sub clients now use. +- Added a C++ client library (bound to the C library). +- Added a Python client library (bound to the C library). +- Added CMake build scripts to allow the library and clients (not the broker) + to be compiled natively on Windows. + +0.7 - 20100615 +============== + +- mosquitto_pub can now send null (zero length) messages. +- Don't store QoS=0 messages for disconnected clients with subscriptions of + QoS>0. +- accept() all available sockets when new clients are connecting, rather than + just one. +- Add option to print debug messages in pub and sub clients. +- hg revision is now exported via $SYS/broker/changeset +- Send Will when client exceeds keepalive timer and is disconnected. +- Check to see if a client has a will before sending it. +- Correctly deal with clients connecting with the same id multiple times. +- Add compile time option to disable heap memory tracking. +- Use poll() instead of select() to allow >1024 clients. +- Implement max_connections. +- Run VACUUM on in-memory database on receiving SIGUSR2. +- Fix bridge keepalive timeouts and reconnects. +- Don't attempt to drop root privileges when running on Windows as this isn't + well supported (bug #586231). + +0.6.1 - 20100506 +================ + +- Fix DB auto upgrade for messages table. + +0.6 - 20100505 +============== + +- Basic support for connecting multiple MQTT brokers together (bridging). +- mosquitto_sub can now subscribe to multiple topics (limited to a global QoS). +- mosquitto_pub can now send a file as a message. +- mosquitto_pub can now read all of stdin and send it as a message. +- mosquitto_pub can now read stdin and send each line as a message. +- mosquitto will now correctly run VACUUM on the persistent database on exit. +- Implement a more efficient database design, so that only one copy of each + message is held in the database, rather than one per subscribed client. +- Add the store_cleanup_interval config option for dealing with the internal + message store. +- Add support for disabling "clean session" for the sub client. +- Add support for automatic upgrading of the mosquitto DB from v1 to v2. +- Add persistence_file config option to allow changing the filename of the + persistence database. This allows multiple mosquitto DBs to be stored in the + same location whilst keeping persistence_location compatible with rsmb. +- Don't store QoS=0 messages for disconnected clients. Fixes bug #572608. This + wasn't correctly fixed in version 0.5. +- Don't disconnect clients if they send a PUBLISH with zero length payload + (bug #573610). +- If a retained message is received with a zero length payload, the retained + message for that topic is deleted. +- Send through zero length messages. +- Produce a warning on unsupported rsmb options instead of quitting. +- Describe clean session flag in the mqtt man page. +- Implement the max_inflight_messages and max_queued_messages features in the + broker. + +0.5.4 - 20100311 +================ + +- Fix memory allocation in mqtt3_fix_sub_topic() (bug #531861). +- Remove accidental limit of 100 client connections. +- Fix mosquitto_pub handling of messages with QoS>0 (bug #537061). + +0.5.3 - 20100303 +================ + +- Will messages are now only sent when a client disconnects unexpectedly. +- Fix all incoming topics/subscriptions that start with a / or contain + multiple / in a row (//). +- Do actually disconnect client when it sends an empty subscription/topic string. +- Add missing $SYS/broker/clients/total to man page. + +0.5.2 - 20100302 +================ + +- Always update last backup time, so that the backup doesn't run every time + through the main loop once autosave_interval has been reached. +- Report $SYS/broker/uptime in the same format as rsmb. +- Make mandatory options obvious in usage output and man page of mosquitto_pub. + Fixes bug #529990. +- Treat subscriptions with a trailing slash correctly. This should fix bugs + #530369 and #530099. + +0.5.1 - 20100227 +================ + +- Must daemonise before pid file is written. + +0.5 - 20100227 +============== + +- No longer store QoS=0 messages for disconnected clients that do not have + clean start set. +- Rename msg_timeout option to retry_interval for better rsmb compatibility. +- Change persistence behaviour. The database is now stored in memory even if + persistence is enabled. It is written to disk when mosquitto exits and also at + periodic intervals as defined by the new autosave_interval option. +- The writing of the persistence database may be forced by sending mosquitto + the SIGUSR1 signal. +- Clients that do not send CONNECT as their first command are now + disconnected. +- Boolean configuration values may now be specified with true/false as well as + 1/0. +- Log message on CONNECT with invalid protocol or protocol version. +- Default sqlite3-pcre path on Linux is now /usr/lib/sqlite3/pcre.so to match + future sqlite3-pcre packages. +- Add mosquitto_sub and mosquitto_pub, simple clients for subscribe/publish. +- Add man pages for clients. +- Add general man page on mqtt. +- Root privileges are now dropped only after attempting to write a pid file + (if configured). This means that the pid file can be written to /var/run/ + directly and should fix bug #523183. + +0.4.2 - 20100203 +================ + +- Fix segfault on client connect with invalid protocol name/version. + +0.4.1 - 20100112 +=============== + +- Fix regex used for finding retained messages to send on new subscription. + +0.4 - 20100105 +============== + +- Added support for wildcard subscriptions using + and #. +- All network operations are now non-blocking and can cope with partial + packets, meaning that networking should be a lot more reliable. +- Total messsages/bytes sent/received are now available in $SYS. +- Improved logging information - use client ip address and id instead of + socket number. +- Broker build timestamp is available in $SYS. +- Keepalive==0 is now correctly treated as "never disconnect". +- Fixed manpage installation. +- Fixed incorrect $SYS hierarchy locations in documentation and code. +- Debug type log messages are no longer sent to "topics". +- Default logging destination no longer includes "topics" to prevent possible + error logging to the db before it is initialised. +- Periodic $SYS messages can now be disabled. +- stdout and stderr are flushed when logging to them to give more timely + updates. +- dup is now set correctly when resending messages. +- Database format bumped due to topic column naming fix. + +0.3 - 20091217 +============== + +- The port option in the configuration file and --port command line argument + may now be given any number of times to make mosquitto listen on multiple + sockets. +- Add new config file and command line option "interface" to specify an + interface to listen on, rather than all interfaces. +- Added host access control through tcp-wrappers support. +- Set SO_REUSEADDR on the listening socket so restart is much quicker. +- Added support for tracking current heap memory usage - this is published on + the topic "$SYS/broker/heap/current size" +- Added code for logging to stderr, stdout, syslog and topics. +- Added logging to numerous places - still plenty of scope for more. + +0.2 - 20091204 +============== + +- Replaced the command line option --foreground with --daemon, swapping the + default behaviour. +- Added the command line option --config-file, to specify a config file to + load. If this is not given, no config file is load and the default options + are used. +- Added the command line option --port for specifying the port to listen on. + This overrides values in the config file. +- Don't use persistence by default. +- Default behaviour is now more sane when run by a normal user with no command + line options (combination of above changes). +- Added option user to config file, defaulting to a value of mosquitto. If + this value isn't blank and mosquitto is started by root, then it will drop + privileges by changing to the user and its primary group. This replaces the + current behaviour of refusing to start if run by root. +- Fix non-persistent mode, which would never work in the previous release. +- Added information on default values of msg_timeout and sys_interval to the + mosquitto.conf man page. (closes bug #492045). diff --git a/src/libs/mosquitto/LICENSE.txt b/src/libs/mosquitto/LICENSE.txt new file mode 100644 index 0000000..56bef4e --- /dev/null +++ b/src/libs/mosquitto/LICENSE.txt @@ -0,0 +1,2 @@ +This project is dual licensed under the Eclipse Public License 1.0 and the +Eclipse Distribution License 1.0 as described in the epl-v10 and edl-v10 files. diff --git a/src/libs/mosquitto/Makefile b/src/libs/mosquitto/Makefile new file mode 100644 index 0000000..75a6a42 --- /dev/null +++ b/src/libs/mosquitto/Makefile @@ -0,0 +1,254 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.10 + +# Default target executed when no arguments are given to make. +default_target: all + +.PHONY : default_target + +# Allow only one "make -f Makefile2" at a time, but pass parallelism. +.NOTPARALLEL: + + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + + +# Remove some rules from gmake that .SUFFIXES does not remove. +SUFFIXES = + +.SUFFIXES: .hpux_make_needs_suffix_list + + +# Suppress display of executed commands. +$(VERBOSE).SILENT: + + +# A target that is always out of date. +cmake_force: + +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/local/Cellar/cmake/3.10.1/bin/cmake + +# The command to remove a file. +RM = /usr/local/Cellar/cmake/3.10.1/bin/cmake -E remove -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /Users/benjamin/orchestra/src/libs/mosquitto + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /Users/benjamin/orchestra/src/libs/mosquitto + +#============================================================================= +# Targets provided globally by CMake. + +# Special rule for the target install/local +install/local: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake +.PHONY : install/local + +# Special rule for the target install/local +install/local/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake +.PHONY : install/local/fast + +# Special rule for the target install/strip +install/strip: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake +.PHONY : install/strip + +# Special rule for the target install/strip +install/strip/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake +.PHONY : install/strip/fast + +# Special rule for the target install +install: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -P cmake_install.cmake +.PHONY : install + +# Special rule for the target install +install/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -P cmake_install.cmake +.PHONY : install/fast + +# Special rule for the target list_install_components +list_install_components: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\"" +.PHONY : list_install_components + +# Special rule for the target list_install_components +list_install_components/fast: list_install_components + +.PHONY : list_install_components/fast + +# Special rule for the target rebuild_cache +rebuild_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : rebuild_cache + +# Special rule for the target rebuild_cache +rebuild_cache/fast: rebuild_cache + +.PHONY : rebuild_cache/fast + +# Special rule for the target edit_cache +edit_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." + /usr/local/Cellar/cmake/3.10.1/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : edit_cache + +# Special rule for the target edit_cache +edit_cache/fast: edit_cache + +.PHONY : edit_cache/fast + +# The main all target +all: cmake_check_build_system + $(CMAKE_COMMAND) -E cmake_progress_start /Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles /Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles/progress.marks + $(MAKE) -f CMakeFiles/Makefile2 all + $(CMAKE_COMMAND) -E cmake_progress_start /Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles 0 +.PHONY : all + +# The main clean target +clean: + $(MAKE) -f CMakeFiles/Makefile2 clean +.PHONY : clean + +# The main clean target +clean/fast: clean + +.PHONY : clean/fast + +# Prepare targets for installation. +preinstall: all + $(MAKE) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall + +# Prepare targets for installation. +preinstall/fast: + $(MAKE) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall/fast + +# clear depends +depend: + $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 +.PHONY : depend + +#============================================================================= +# Target rules for targets named libmosquitto + +# Build rule for target. +libmosquitto: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 libmosquitto +.PHONY : libmosquitto + +# fast build rule for target. +libmosquitto/fast: + $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/build +.PHONY : libmosquitto/fast + +#============================================================================= +# Target rules for targets named mosquittopp + +# Build rule for target. +mosquittopp: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 mosquittopp +.PHONY : mosquittopp + +# fast build rule for target. +mosquittopp/fast: + $(MAKE) -f lib/cpp/CMakeFiles/mosquittopp.dir/build.make lib/cpp/CMakeFiles/mosquittopp.dir/build +.PHONY : mosquittopp/fast + +#============================================================================= +# Target rules for targets named mosquitto_sub + +# Build rule for target. +mosquitto_sub: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 mosquitto_sub +.PHONY : mosquitto_sub + +# fast build rule for target. +mosquitto_sub/fast: + $(MAKE) -f client/CMakeFiles/mosquitto_sub.dir/build.make client/CMakeFiles/mosquitto_sub.dir/build +.PHONY : mosquitto_sub/fast + +#============================================================================= +# Target rules for targets named mosquitto_pub + +# Build rule for target. +mosquitto_pub: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 mosquitto_pub +.PHONY : mosquitto_pub + +# fast build rule for target. +mosquitto_pub/fast: + $(MAKE) -f client/CMakeFiles/mosquitto_pub.dir/build.make client/CMakeFiles/mosquitto_pub.dir/build +.PHONY : mosquitto_pub/fast + +#============================================================================= +# Target rules for targets named mosquitto + +# Build rule for target. +mosquitto: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 mosquitto +.PHONY : mosquitto + +# fast build rule for target. +mosquitto/fast: + $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/build +.PHONY : mosquitto/fast + +# Help Target +help: + @echo "The following are some of the valid targets for this Makefile:" + @echo "... all (the default if no target is provided)" + @echo "... clean" + @echo "... depend" + @echo "... install/local" + @echo "... install/strip" + @echo "... install" + @echo "... list_install_components" + @echo "... rebuild_cache" + @echo "... edit_cache" + @echo "... libmosquitto" + @echo "... mosquittopp" + @echo "... mosquitto_sub" + @echo "... mosquitto_pub" + @echo "... mosquitto" +.PHONY : help + + + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system + diff --git a/src/libs/mosquitto/about.html b/src/libs/mosquitto/about.html new file mode 100644 index 0000000..4e30b1b --- /dev/null +++ b/src/libs/mosquitto/about.html @@ -0,0 +1,41 @@ + + + +About + + +

About This Content

+ +

May 8, 2014

+

License

+ +

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL") and Eclipse Distribution License Version 1.0 ("EDL"). +A copy of the EPL is available at +http://www.eclipse.org/legal/epl-v10.html +and a copy of the EDL is available at +http://www.eclipse.org/org/documents/edl-v10.php. +For purposes of the EPL, "Program" will mean the Content.

+ +

If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

+ + +

Third Party Content

+

The Content includes items that have been sourced from third parties as set out below. If you + did not receive this Content directly from the Eclipse Foundation, the following is provided + for informational purposes only, and you should look to the Redistributor's license for + terms and conditions of use.

+

+ None

+

+

+ + + + diff --git a/src/libs/mosquitto/aclfile.example b/src/libs/mosquitto/aclfile.example new file mode 100644 index 0000000..5c3f3ca --- /dev/null +++ b/src/libs/mosquitto/aclfile.example @@ -0,0 +1,9 @@ +# This affects access control for clients with no username. +topic read $SYS/# + +# This only affects clients with username "roger". +user roger +topic foo/bar + +# This affects all clients. +pattern write $SYS/broker/connection/%c/state diff --git a/src/libs/mosquitto/client/CMakeFiles/CMakeDirectoryInformation.cmake b/src/libs/mosquitto/client/CMakeFiles/CMakeDirectoryInformation.cmake new file mode 100644 index 0000000..8cf4b23 --- /dev/null +++ b/src/libs/mosquitto/client/CMakeFiles/CMakeDirectoryInformation.cmake @@ -0,0 +1,16 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.10 + +# Relative path conversion top directories. +set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/Users/benjamin/orchestra/src/libs/mosquitto") +set(CMAKE_RELATIVE_PATH_TOP_BINARY "/Users/benjamin/orchestra/src/libs/mosquitto") + +# Force unix paths in dependencies. +set(CMAKE_FORCE_UNIX_PATHS 1) + + +# The C and CXX include file regular expressions for this directory. +set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") +set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") +set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) +set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) diff --git a/src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/C.includecache b/src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/C.includecache new file mode 100644 index 0000000..bb00ba9 --- /dev/null +++ b/src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/C.includecache @@ -0,0 +1,60 @@ +#IncludeRegexLine: ^[ ]*[#%][ ]*(include|import)[ ]*[<"]([^">]+)([">]) + +#IncludeRegexScan: ^.*$ + +#IncludeRegexComplain: ^$ + +#IncludeRegexTransform: + +/Users/benjamin/orchestra/src/libs/mosquitto/client/client_shared.c +errno.h +- +fcntl.h +- +stdio.h +- +stdlib.h +- +string.h +- +unistd.h +- +process.h +- +winsock2.h +- +mosquitto.h +- +client_shared.h +/Users/benjamin/orchestra/src/libs/mosquitto/client/client_shared.h + +/Users/benjamin/orchestra/src/libs/mosquitto/client/client_shared.h +stdio.h +- + +/Users/benjamin/orchestra/src/libs/mosquitto/client/pub_client.c +errno.h +- +fcntl.h +- +stdio.h +- +stdlib.h +- +string.h +- +unistd.h +- +process.h +- +winsock2.h +- +mosquitto.h +- +client_shared.h +/Users/benjamin/orchestra/src/libs/mosquitto/client/client_shared.h + +lib/mosquitto.h +stdbool.h +- + diff --git a/src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/DependInfo.cmake b/src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/DependInfo.cmake new file mode 100644 index 0000000..7fc6731 --- /dev/null +++ b/src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/DependInfo.cmake @@ -0,0 +1,31 @@ +# The set of languages for which implicit dependencies are needed: +set(CMAKE_DEPENDS_LANGUAGES + "C" + ) +# The set of files for implicit dependencies of each language: +set(CMAKE_DEPENDS_CHECK_C + "/Users/benjamin/orchestra/src/libs/mosquitto/client/client_shared.c" "/Users/benjamin/orchestra/src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/client_shared.c.o" + "/Users/benjamin/orchestra/src/libs/mosquitto/client/pub_client.c" "/Users/benjamin/orchestra/src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/pub_client.c.o" + ) +set(CMAKE_C_COMPILER_ID "Clang") + +# Preprocessor definitions for this target. +set(CMAKE_TARGET_DEFINITIONS_C + "CMAKE" + "TIMESTAMP=\"2018-01-23 10:58:26+0100\"" + "VERSION=\"1.4.14\"" + "WITH_SOCKS" + ) + +# The include file search paths: +set(CMAKE_C_TARGET_INCLUDE_PATH + "lib" + ) + +# Targets to which this target links. +set(CMAKE_TARGET_LINKED_INFO_FILES + "/Users/benjamin/orchestra/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/DependInfo.cmake" + ) + +# Fortran module output directory. +set(CMAKE_Fortran_TARGET_MODULE_DIR "") diff --git a/src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/build.make b/src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/build.make new file mode 100644 index 0000000..fbd384f --- /dev/null +++ b/src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/build.make @@ -0,0 +1,141 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.10 + +# Delete rule output on recipe failure. +.DELETE_ON_ERROR: + + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + + +# Remove some rules from gmake that .SUFFIXES does not remove. +SUFFIXES = + +.SUFFIXES: .hpux_make_needs_suffix_list + + +# Suppress display of executed commands. +$(VERBOSE).SILENT: + + +# A target that is always out of date. +cmake_force: + +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/local/Cellar/cmake/3.10.1/bin/cmake + +# The command to remove a file. +RM = /usr/local/Cellar/cmake/3.10.1/bin/cmake -E remove -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /Users/benjamin/orchestra/src/libs/mosquitto + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /Users/benjamin/orchestra/src/libs/mosquitto + +# Include any dependencies generated for this target. +include client/CMakeFiles/mosquitto_pub.dir/depend.make + +# Include the progress variables for this target. +include client/CMakeFiles/mosquitto_pub.dir/progress.make + +# Include the compile flags for this target's objects. +include client/CMakeFiles/mosquitto_pub.dir/flags.make + +client/CMakeFiles/mosquitto_pub.dir/pub_client.c.o: client/CMakeFiles/mosquitto_pub.dir/flags.make +client/CMakeFiles/mosquitto_pub.dir/pub_client.c.o: client/pub_client.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building C object client/CMakeFiles/mosquitto_pub.dir/pub_client.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/client && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/mosquitto_pub.dir/pub_client.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/client/pub_client.c + +client/CMakeFiles/mosquitto_pub.dir/pub_client.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/mosquitto_pub.dir/pub_client.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/client && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/client/pub_client.c > CMakeFiles/mosquitto_pub.dir/pub_client.c.i + +client/CMakeFiles/mosquitto_pub.dir/pub_client.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/mosquitto_pub.dir/pub_client.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/client && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/client/pub_client.c -o CMakeFiles/mosquitto_pub.dir/pub_client.c.s + +client/CMakeFiles/mosquitto_pub.dir/pub_client.c.o.requires: + +.PHONY : client/CMakeFiles/mosquitto_pub.dir/pub_client.c.o.requires + +client/CMakeFiles/mosquitto_pub.dir/pub_client.c.o.provides: client/CMakeFiles/mosquitto_pub.dir/pub_client.c.o.requires + $(MAKE) -f client/CMakeFiles/mosquitto_pub.dir/build.make client/CMakeFiles/mosquitto_pub.dir/pub_client.c.o.provides.build +.PHONY : client/CMakeFiles/mosquitto_pub.dir/pub_client.c.o.provides + +client/CMakeFiles/mosquitto_pub.dir/pub_client.c.o.provides.build: client/CMakeFiles/mosquitto_pub.dir/pub_client.c.o + + +client/CMakeFiles/mosquitto_pub.dir/client_shared.c.o: client/CMakeFiles/mosquitto_pub.dir/flags.make +client/CMakeFiles/mosquitto_pub.dir/client_shared.c.o: client/client_shared.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Building C object client/CMakeFiles/mosquitto_pub.dir/client_shared.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/client && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/mosquitto_pub.dir/client_shared.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/client/client_shared.c + +client/CMakeFiles/mosquitto_pub.dir/client_shared.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/mosquitto_pub.dir/client_shared.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/client && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/client/client_shared.c > CMakeFiles/mosquitto_pub.dir/client_shared.c.i + +client/CMakeFiles/mosquitto_pub.dir/client_shared.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/mosquitto_pub.dir/client_shared.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/client && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/client/client_shared.c -o CMakeFiles/mosquitto_pub.dir/client_shared.c.s + +client/CMakeFiles/mosquitto_pub.dir/client_shared.c.o.requires: + +.PHONY : client/CMakeFiles/mosquitto_pub.dir/client_shared.c.o.requires + +client/CMakeFiles/mosquitto_pub.dir/client_shared.c.o.provides: client/CMakeFiles/mosquitto_pub.dir/client_shared.c.o.requires + $(MAKE) -f client/CMakeFiles/mosquitto_pub.dir/build.make client/CMakeFiles/mosquitto_pub.dir/client_shared.c.o.provides.build +.PHONY : client/CMakeFiles/mosquitto_pub.dir/client_shared.c.o.provides + +client/CMakeFiles/mosquitto_pub.dir/client_shared.c.o.provides.build: client/CMakeFiles/mosquitto_pub.dir/client_shared.c.o + + +# Object files for target mosquitto_pub +mosquitto_pub_OBJECTS = \ +"CMakeFiles/mosquitto_pub.dir/pub_client.c.o" \ +"CMakeFiles/mosquitto_pub.dir/client_shared.c.o" + +# External object files for target mosquitto_pub +mosquitto_pub_EXTERNAL_OBJECTS = + +client/mosquitto_pub: client/CMakeFiles/mosquitto_pub.dir/pub_client.c.o +client/mosquitto_pub: client/CMakeFiles/mosquitto_pub.dir/client_shared.c.o +client/mosquitto_pub: client/CMakeFiles/mosquitto_pub.dir/build.make +client/mosquitto_pub: lib/libmosquitto.1.4.14.dylib +client/mosquitto_pub: client/CMakeFiles/mosquitto_pub.dir/link.txt + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_3) "Linking C executable mosquitto_pub" + cd /Users/benjamin/orchestra/src/libs/mosquitto/client && $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/mosquitto_pub.dir/link.txt --verbose=$(VERBOSE) + +# Rule to build all files generated by this target. +client/CMakeFiles/mosquitto_pub.dir/build: client/mosquitto_pub + +.PHONY : client/CMakeFiles/mosquitto_pub.dir/build + +client/CMakeFiles/mosquitto_pub.dir/requires: client/CMakeFiles/mosquitto_pub.dir/pub_client.c.o.requires +client/CMakeFiles/mosquitto_pub.dir/requires: client/CMakeFiles/mosquitto_pub.dir/client_shared.c.o.requires + +.PHONY : client/CMakeFiles/mosquitto_pub.dir/requires + +client/CMakeFiles/mosquitto_pub.dir/clean: + cd /Users/benjamin/orchestra/src/libs/mosquitto/client && $(CMAKE_COMMAND) -P CMakeFiles/mosquitto_pub.dir/cmake_clean.cmake +.PHONY : client/CMakeFiles/mosquitto_pub.dir/clean + +client/CMakeFiles/mosquitto_pub.dir/depend: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /Users/benjamin/orchestra/src/libs/mosquitto /Users/benjamin/orchestra/src/libs/mosquitto/client /Users/benjamin/orchestra/src/libs/mosquitto /Users/benjamin/orchestra/src/libs/mosquitto/client /Users/benjamin/orchestra/src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/DependInfo.cmake --color=$(COLOR) +.PHONY : client/CMakeFiles/mosquitto_pub.dir/depend + diff --git a/src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/cmake_clean.cmake b/src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/cmake_clean.cmake new file mode 100644 index 0000000..9d9e7ab --- /dev/null +++ b/src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/cmake_clean.cmake @@ -0,0 +1,11 @@ +file(REMOVE_RECURSE + "CMakeFiles/mosquitto_pub.dir/pub_client.c.o" + "CMakeFiles/mosquitto_pub.dir/client_shared.c.o" + "mosquitto_pub.pdb" + "mosquitto_pub" +) + +# Per-language clean rules from dependency scanning. +foreach(lang C) + include(CMakeFiles/mosquitto_pub.dir/cmake_clean_${lang}.cmake OPTIONAL) +endforeach() diff --git a/src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/depend.internal b/src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/depend.internal new file mode 100644 index 0000000..b8b9128 --- /dev/null +++ b/src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/depend.internal @@ -0,0 +1,11 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.10 + +client/CMakeFiles/mosquitto_pub.dir/client_shared.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/client/client_shared.c + /Users/benjamin/orchestra/src/libs/mosquitto/client/client_shared.h + lib/mosquitto.h +client/CMakeFiles/mosquitto_pub.dir/pub_client.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/client/client_shared.h + /Users/benjamin/orchestra/src/libs/mosquitto/client/pub_client.c + lib/mosquitto.h diff --git a/src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/depend.make b/src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/depend.make new file mode 100644 index 0000000..168c133 --- /dev/null +++ b/src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/depend.make @@ -0,0 +1,11 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.10 + +client/CMakeFiles/mosquitto_pub.dir/client_shared.c.o: client/client_shared.c +client/CMakeFiles/mosquitto_pub.dir/client_shared.c.o: client/client_shared.h +client/CMakeFiles/mosquitto_pub.dir/client_shared.c.o: lib/mosquitto.h + +client/CMakeFiles/mosquitto_pub.dir/pub_client.c.o: client/client_shared.h +client/CMakeFiles/mosquitto_pub.dir/pub_client.c.o: client/pub_client.c +client/CMakeFiles/mosquitto_pub.dir/pub_client.c.o: lib/mosquitto.h + diff --git a/src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/flags.make b/src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/flags.make new file mode 100644 index 0000000..86a2957 --- /dev/null +++ b/src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/flags.make @@ -0,0 +1,10 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.10 + +# compile C with /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc +C_FLAGS = -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk + +C_DEFINES = -DCMAKE -DTIMESTAMP="\"2018-01-23 10:58:26+0100\"" -DVERSION=\"1.4.14\" -DWITH_SOCKS + +C_INCLUDES = -I/Users/benjamin/orchestra/src/libs/mosquitto/lib + diff --git a/src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/link.txt b/src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/link.txt new file mode 100644 index 0000000..a4c832a --- /dev/null +++ b/src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/link.txt @@ -0,0 +1 @@ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/mosquitto_pub.dir/pub_client.c.o CMakeFiles/mosquitto_pub.dir/client_shared.c.o -o mosquitto_pub -L/Users/benjamin/orchestra/src/libs/mosquitto/lib -Wl,-rpath,/Users/benjamin/orchestra/src/libs/mosquitto/lib ../lib/libmosquitto.1.4.14.dylib -lpthread diff --git a/src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/progress.make b/src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/progress.make new file mode 100644 index 0000000..3575c37 --- /dev/null +++ b/src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/progress.make @@ -0,0 +1,4 @@ +CMAKE_PROGRESS_1 = 47 +CMAKE_PROGRESS_2 = 48 +CMAKE_PROGRESS_3 = 49 + diff --git a/src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/C.includecache b/src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/C.includecache new file mode 100644 index 0000000..906c467 --- /dev/null +++ b/src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/C.includecache @@ -0,0 +1,60 @@ +#IncludeRegexLine: ^[ ]*[#%][ ]*(include|import)[ ]*[<"]([^">]+)([">]) + +#IncludeRegexScan: ^.*$ + +#IncludeRegexComplain: ^$ + +#IncludeRegexTransform: + +/Users/benjamin/orchestra/src/libs/mosquitto/client/client_shared.c +errno.h +- +fcntl.h +- +stdio.h +- +stdlib.h +- +string.h +- +unistd.h +- +process.h +- +winsock2.h +- +mosquitto.h +- +client_shared.h +/Users/benjamin/orchestra/src/libs/mosquitto/client/client_shared.h + +/Users/benjamin/orchestra/src/libs/mosquitto/client/client_shared.h +stdio.h +- + +/Users/benjamin/orchestra/src/libs/mosquitto/client/sub_client.c +assert.h +- +errno.h +- +stdio.h +- +stdlib.h +- +string.h +- +unistd.h +- +process.h +- +winsock2.h +- +mosquitto.h +- +client_shared.h +/Users/benjamin/orchestra/src/libs/mosquitto/client/client_shared.h + +lib/mosquitto.h +stdbool.h +- + diff --git a/src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/DependInfo.cmake b/src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/DependInfo.cmake new file mode 100644 index 0000000..5e881f1 --- /dev/null +++ b/src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/DependInfo.cmake @@ -0,0 +1,31 @@ +# The set of languages for which implicit dependencies are needed: +set(CMAKE_DEPENDS_LANGUAGES + "C" + ) +# The set of files for implicit dependencies of each language: +set(CMAKE_DEPENDS_CHECK_C + "/Users/benjamin/orchestra/src/libs/mosquitto/client/client_shared.c" "/Users/benjamin/orchestra/src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/client_shared.c.o" + "/Users/benjamin/orchestra/src/libs/mosquitto/client/sub_client.c" "/Users/benjamin/orchestra/src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/sub_client.c.o" + ) +set(CMAKE_C_COMPILER_ID "Clang") + +# Preprocessor definitions for this target. +set(CMAKE_TARGET_DEFINITIONS_C + "CMAKE" + "TIMESTAMP=\"2018-01-23 10:58:26+0100\"" + "VERSION=\"1.4.14\"" + "WITH_SOCKS" + ) + +# The include file search paths: +set(CMAKE_C_TARGET_INCLUDE_PATH + "lib" + ) + +# Targets to which this target links. +set(CMAKE_TARGET_LINKED_INFO_FILES + "/Users/benjamin/orchestra/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/DependInfo.cmake" + ) + +# Fortran module output directory. +set(CMAKE_Fortran_TARGET_MODULE_DIR "") diff --git a/src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/build.make b/src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/build.make new file mode 100644 index 0000000..3512913 --- /dev/null +++ b/src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/build.make @@ -0,0 +1,141 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.10 + +# Delete rule output on recipe failure. +.DELETE_ON_ERROR: + + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + + +# Remove some rules from gmake that .SUFFIXES does not remove. +SUFFIXES = + +.SUFFIXES: .hpux_make_needs_suffix_list + + +# Suppress display of executed commands. +$(VERBOSE).SILENT: + + +# A target that is always out of date. +cmake_force: + +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/local/Cellar/cmake/3.10.1/bin/cmake + +# The command to remove a file. +RM = /usr/local/Cellar/cmake/3.10.1/bin/cmake -E remove -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /Users/benjamin/orchestra/src/libs/mosquitto + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /Users/benjamin/orchestra/src/libs/mosquitto + +# Include any dependencies generated for this target. +include client/CMakeFiles/mosquitto_sub.dir/depend.make + +# Include the progress variables for this target. +include client/CMakeFiles/mosquitto_sub.dir/progress.make + +# Include the compile flags for this target's objects. +include client/CMakeFiles/mosquitto_sub.dir/flags.make + +client/CMakeFiles/mosquitto_sub.dir/sub_client.c.o: client/CMakeFiles/mosquitto_sub.dir/flags.make +client/CMakeFiles/mosquitto_sub.dir/sub_client.c.o: client/sub_client.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building C object client/CMakeFiles/mosquitto_sub.dir/sub_client.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/client && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/mosquitto_sub.dir/sub_client.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/client/sub_client.c + +client/CMakeFiles/mosquitto_sub.dir/sub_client.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/mosquitto_sub.dir/sub_client.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/client && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/client/sub_client.c > CMakeFiles/mosquitto_sub.dir/sub_client.c.i + +client/CMakeFiles/mosquitto_sub.dir/sub_client.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/mosquitto_sub.dir/sub_client.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/client && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/client/sub_client.c -o CMakeFiles/mosquitto_sub.dir/sub_client.c.s + +client/CMakeFiles/mosquitto_sub.dir/sub_client.c.o.requires: + +.PHONY : client/CMakeFiles/mosquitto_sub.dir/sub_client.c.o.requires + +client/CMakeFiles/mosquitto_sub.dir/sub_client.c.o.provides: client/CMakeFiles/mosquitto_sub.dir/sub_client.c.o.requires + $(MAKE) -f client/CMakeFiles/mosquitto_sub.dir/build.make client/CMakeFiles/mosquitto_sub.dir/sub_client.c.o.provides.build +.PHONY : client/CMakeFiles/mosquitto_sub.dir/sub_client.c.o.provides + +client/CMakeFiles/mosquitto_sub.dir/sub_client.c.o.provides.build: client/CMakeFiles/mosquitto_sub.dir/sub_client.c.o + + +client/CMakeFiles/mosquitto_sub.dir/client_shared.c.o: client/CMakeFiles/mosquitto_sub.dir/flags.make +client/CMakeFiles/mosquitto_sub.dir/client_shared.c.o: client/client_shared.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Building C object client/CMakeFiles/mosquitto_sub.dir/client_shared.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/client && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/mosquitto_sub.dir/client_shared.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/client/client_shared.c + +client/CMakeFiles/mosquitto_sub.dir/client_shared.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/mosquitto_sub.dir/client_shared.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/client && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/client/client_shared.c > CMakeFiles/mosquitto_sub.dir/client_shared.c.i + +client/CMakeFiles/mosquitto_sub.dir/client_shared.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/mosquitto_sub.dir/client_shared.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/client && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/client/client_shared.c -o CMakeFiles/mosquitto_sub.dir/client_shared.c.s + +client/CMakeFiles/mosquitto_sub.dir/client_shared.c.o.requires: + +.PHONY : client/CMakeFiles/mosquitto_sub.dir/client_shared.c.o.requires + +client/CMakeFiles/mosquitto_sub.dir/client_shared.c.o.provides: client/CMakeFiles/mosquitto_sub.dir/client_shared.c.o.requires + $(MAKE) -f client/CMakeFiles/mosquitto_sub.dir/build.make client/CMakeFiles/mosquitto_sub.dir/client_shared.c.o.provides.build +.PHONY : client/CMakeFiles/mosquitto_sub.dir/client_shared.c.o.provides + +client/CMakeFiles/mosquitto_sub.dir/client_shared.c.o.provides.build: client/CMakeFiles/mosquitto_sub.dir/client_shared.c.o + + +# Object files for target mosquitto_sub +mosquitto_sub_OBJECTS = \ +"CMakeFiles/mosquitto_sub.dir/sub_client.c.o" \ +"CMakeFiles/mosquitto_sub.dir/client_shared.c.o" + +# External object files for target mosquitto_sub +mosquitto_sub_EXTERNAL_OBJECTS = + +client/mosquitto_sub: client/CMakeFiles/mosquitto_sub.dir/sub_client.c.o +client/mosquitto_sub: client/CMakeFiles/mosquitto_sub.dir/client_shared.c.o +client/mosquitto_sub: client/CMakeFiles/mosquitto_sub.dir/build.make +client/mosquitto_sub: lib/libmosquitto.1.4.14.dylib +client/mosquitto_sub: client/CMakeFiles/mosquitto_sub.dir/link.txt + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_3) "Linking C executable mosquitto_sub" + cd /Users/benjamin/orchestra/src/libs/mosquitto/client && $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/mosquitto_sub.dir/link.txt --verbose=$(VERBOSE) + +# Rule to build all files generated by this target. +client/CMakeFiles/mosquitto_sub.dir/build: client/mosquitto_sub + +.PHONY : client/CMakeFiles/mosquitto_sub.dir/build + +client/CMakeFiles/mosquitto_sub.dir/requires: client/CMakeFiles/mosquitto_sub.dir/sub_client.c.o.requires +client/CMakeFiles/mosquitto_sub.dir/requires: client/CMakeFiles/mosquitto_sub.dir/client_shared.c.o.requires + +.PHONY : client/CMakeFiles/mosquitto_sub.dir/requires + +client/CMakeFiles/mosquitto_sub.dir/clean: + cd /Users/benjamin/orchestra/src/libs/mosquitto/client && $(CMAKE_COMMAND) -P CMakeFiles/mosquitto_sub.dir/cmake_clean.cmake +.PHONY : client/CMakeFiles/mosquitto_sub.dir/clean + +client/CMakeFiles/mosquitto_sub.dir/depend: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /Users/benjamin/orchestra/src/libs/mosquitto /Users/benjamin/orchestra/src/libs/mosquitto/client /Users/benjamin/orchestra/src/libs/mosquitto /Users/benjamin/orchestra/src/libs/mosquitto/client /Users/benjamin/orchestra/src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/DependInfo.cmake --color=$(COLOR) +.PHONY : client/CMakeFiles/mosquitto_sub.dir/depend + diff --git a/src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/cmake_clean.cmake b/src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/cmake_clean.cmake new file mode 100644 index 0000000..3e39a0d --- /dev/null +++ b/src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/cmake_clean.cmake @@ -0,0 +1,11 @@ +file(REMOVE_RECURSE + "CMakeFiles/mosquitto_sub.dir/sub_client.c.o" + "CMakeFiles/mosquitto_sub.dir/client_shared.c.o" + "mosquitto_sub.pdb" + "mosquitto_sub" +) + +# Per-language clean rules from dependency scanning. +foreach(lang C) + include(CMakeFiles/mosquitto_sub.dir/cmake_clean_${lang}.cmake OPTIONAL) +endforeach() diff --git a/src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/depend.internal b/src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/depend.internal new file mode 100644 index 0000000..9b0e184 --- /dev/null +++ b/src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/depend.internal @@ -0,0 +1,11 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.10 + +client/CMakeFiles/mosquitto_sub.dir/client_shared.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/client/client_shared.c + /Users/benjamin/orchestra/src/libs/mosquitto/client/client_shared.h + lib/mosquitto.h +client/CMakeFiles/mosquitto_sub.dir/sub_client.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/client/client_shared.h + /Users/benjamin/orchestra/src/libs/mosquitto/client/sub_client.c + lib/mosquitto.h diff --git a/src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/depend.make b/src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/depend.make new file mode 100644 index 0000000..0eb2aeb --- /dev/null +++ b/src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/depend.make @@ -0,0 +1,11 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.10 + +client/CMakeFiles/mosquitto_sub.dir/client_shared.c.o: client/client_shared.c +client/CMakeFiles/mosquitto_sub.dir/client_shared.c.o: client/client_shared.h +client/CMakeFiles/mosquitto_sub.dir/client_shared.c.o: lib/mosquitto.h + +client/CMakeFiles/mosquitto_sub.dir/sub_client.c.o: client/client_shared.h +client/CMakeFiles/mosquitto_sub.dir/sub_client.c.o: client/sub_client.c +client/CMakeFiles/mosquitto_sub.dir/sub_client.c.o: lib/mosquitto.h + diff --git a/src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/flags.make b/src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/flags.make new file mode 100644 index 0000000..86a2957 --- /dev/null +++ b/src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/flags.make @@ -0,0 +1,10 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.10 + +# compile C with /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc +C_FLAGS = -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk + +C_DEFINES = -DCMAKE -DTIMESTAMP="\"2018-01-23 10:58:26+0100\"" -DVERSION=\"1.4.14\" -DWITH_SOCKS + +C_INCLUDES = -I/Users/benjamin/orchestra/src/libs/mosquitto/lib + diff --git a/src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/link.txt b/src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/link.txt new file mode 100644 index 0000000..d74a7f9 --- /dev/null +++ b/src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/link.txt @@ -0,0 +1 @@ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/mosquitto_sub.dir/sub_client.c.o CMakeFiles/mosquitto_sub.dir/client_shared.c.o -o mosquitto_sub -L/Users/benjamin/orchestra/src/libs/mosquitto/lib -Wl,-rpath,/Users/benjamin/orchestra/src/libs/mosquitto/lib ../lib/libmosquitto.1.4.14.dylib -lpthread diff --git a/src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/progress.make b/src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/progress.make new file mode 100644 index 0000000..a9e1abb --- /dev/null +++ b/src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/progress.make @@ -0,0 +1,4 @@ +CMAKE_PROGRESS_1 = 50 +CMAKE_PROGRESS_2 = 51 +CMAKE_PROGRESS_3 = 52 + diff --git a/src/libs/mosquitto/client/CMakeFiles/progress.marks b/src/libs/mosquitto/client/CMakeFiles/progress.marks new file mode 100644 index 0000000..a45fd52 --- /dev/null +++ b/src/libs/mosquitto/client/CMakeFiles/progress.marks @@ -0,0 +1 @@ +24 diff --git a/src/libs/mosquitto/client/CMakeLists.txt b/src/libs/mosquitto/client/CMakeLists.txt new file mode 100644 index 0000000..0b6f420 --- /dev/null +++ b/src/libs/mosquitto/client/CMakeLists.txt @@ -0,0 +1,18 @@ +include_directories(${mosquitto_SOURCE_DIR}/lib + ${STDBOOL_H_PATH} ${STDINT_H_PATH}) +link_directories(${mosquitto_BINARY_DIR}/lib) + +set(shared_src client_shared.c client_shared.h) + +if (${WITH_SRV} STREQUAL ON) + add_definitions("-DWITH_SRV") +endif (${WITH_SRV} STREQUAL ON) + +add_executable(mosquitto_pub pub_client.c ${shared_src}) +add_executable(mosquitto_sub sub_client.c ${shared_src}) + +target_link_libraries(mosquitto_pub libmosquitto) +target_link_libraries(mosquitto_sub libmosquitto) + +install(TARGETS mosquitto_pub RUNTIME DESTINATION "${BINDIR}" LIBRARY DESTINATION "${LIBDIR}") +install(TARGETS mosquitto_sub RUNTIME DESTINATION "${BINDIR}" LIBRARY DESTINATION "${LIBDIR}") diff --git a/src/libs/mosquitto/client/Makefile b/src/libs/mosquitto/client/Makefile new file mode 100644 index 0000000..852d1b6 --- /dev/null +++ b/src/libs/mosquitto/client/Makefile @@ -0,0 +1,309 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.10 + +# Default target executed when no arguments are given to make. +default_target: all + +.PHONY : default_target + +# Allow only one "make -f Makefile2" at a time, but pass parallelism. +.NOTPARALLEL: + + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + + +# Remove some rules from gmake that .SUFFIXES does not remove. +SUFFIXES = + +.SUFFIXES: .hpux_make_needs_suffix_list + + +# Suppress display of executed commands. +$(VERBOSE).SILENT: + + +# A target that is always out of date. +cmake_force: + +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/local/Cellar/cmake/3.10.1/bin/cmake + +# The command to remove a file. +RM = /usr/local/Cellar/cmake/3.10.1/bin/cmake -E remove -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /Users/benjamin/orchestra/src/libs/mosquitto + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /Users/benjamin/orchestra/src/libs/mosquitto + +#============================================================================= +# Targets provided globally by CMake. + +# Special rule for the target install/local +install/local: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake +.PHONY : install/local + +# Special rule for the target install/local +install/local/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake +.PHONY : install/local/fast + +# Special rule for the target install/strip +install/strip: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake +.PHONY : install/strip + +# Special rule for the target install/strip +install/strip/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake +.PHONY : install/strip/fast + +# Special rule for the target install +install: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -P cmake_install.cmake +.PHONY : install + +# Special rule for the target install +install/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -P cmake_install.cmake +.PHONY : install/fast + +# Special rule for the target list_install_components +list_install_components: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\"" +.PHONY : list_install_components + +# Special rule for the target list_install_components +list_install_components/fast: list_install_components + +.PHONY : list_install_components/fast + +# Special rule for the target rebuild_cache +rebuild_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : rebuild_cache + +# Special rule for the target rebuild_cache +rebuild_cache/fast: rebuild_cache + +.PHONY : rebuild_cache/fast + +# Special rule for the target edit_cache +edit_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." + /usr/local/Cellar/cmake/3.10.1/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : edit_cache + +# Special rule for the target edit_cache +edit_cache/fast: edit_cache + +.PHONY : edit_cache/fast + +# The main all target +all: cmake_check_build_system + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(CMAKE_COMMAND) -E cmake_progress_start /Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles /Users/benjamin/orchestra/src/libs/mosquitto/client/CMakeFiles/progress.marks + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f CMakeFiles/Makefile2 client/all + $(CMAKE_COMMAND) -E cmake_progress_start /Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles 0 +.PHONY : all + +# The main clean target +clean: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f CMakeFiles/Makefile2 client/clean +.PHONY : clean + +# The main clean target +clean/fast: clean + +.PHONY : clean/fast + +# Prepare targets for installation. +preinstall: all + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f CMakeFiles/Makefile2 client/preinstall +.PHONY : preinstall + +# Prepare targets for installation. +preinstall/fast: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f CMakeFiles/Makefile2 client/preinstall +.PHONY : preinstall/fast + +# clear depends +depend: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 +.PHONY : depend + +# Convenience name for target. +client/CMakeFiles/mosquitto_sub.dir/rule: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f CMakeFiles/Makefile2 client/CMakeFiles/mosquitto_sub.dir/rule +.PHONY : client/CMakeFiles/mosquitto_sub.dir/rule + +# Convenience name for target. +mosquitto_sub: client/CMakeFiles/mosquitto_sub.dir/rule + +.PHONY : mosquitto_sub + +# fast build rule for target. +mosquitto_sub/fast: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f client/CMakeFiles/mosquitto_sub.dir/build.make client/CMakeFiles/mosquitto_sub.dir/build +.PHONY : mosquitto_sub/fast + +# Convenience name for target. +client/CMakeFiles/mosquitto_pub.dir/rule: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f CMakeFiles/Makefile2 client/CMakeFiles/mosquitto_pub.dir/rule +.PHONY : client/CMakeFiles/mosquitto_pub.dir/rule + +# Convenience name for target. +mosquitto_pub: client/CMakeFiles/mosquitto_pub.dir/rule + +.PHONY : mosquitto_pub + +# fast build rule for target. +mosquitto_pub/fast: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f client/CMakeFiles/mosquitto_pub.dir/build.make client/CMakeFiles/mosquitto_pub.dir/build +.PHONY : mosquitto_pub/fast + +client_shared.o: client_shared.c.o + +.PHONY : client_shared.o + +# target to build an object file +client_shared.c.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f client/CMakeFiles/mosquitto_sub.dir/build.make client/CMakeFiles/mosquitto_sub.dir/client_shared.c.o + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f client/CMakeFiles/mosquitto_pub.dir/build.make client/CMakeFiles/mosquitto_pub.dir/client_shared.c.o +.PHONY : client_shared.c.o + +client_shared.i: client_shared.c.i + +.PHONY : client_shared.i + +# target to preprocess a source file +client_shared.c.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f client/CMakeFiles/mosquitto_sub.dir/build.make client/CMakeFiles/mosquitto_sub.dir/client_shared.c.i + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f client/CMakeFiles/mosquitto_pub.dir/build.make client/CMakeFiles/mosquitto_pub.dir/client_shared.c.i +.PHONY : client_shared.c.i + +client_shared.s: client_shared.c.s + +.PHONY : client_shared.s + +# target to generate assembly for a file +client_shared.c.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f client/CMakeFiles/mosquitto_sub.dir/build.make client/CMakeFiles/mosquitto_sub.dir/client_shared.c.s + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f client/CMakeFiles/mosquitto_pub.dir/build.make client/CMakeFiles/mosquitto_pub.dir/client_shared.c.s +.PHONY : client_shared.c.s + +pub_client.o: pub_client.c.o + +.PHONY : pub_client.o + +# target to build an object file +pub_client.c.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f client/CMakeFiles/mosquitto_pub.dir/build.make client/CMakeFiles/mosquitto_pub.dir/pub_client.c.o +.PHONY : pub_client.c.o + +pub_client.i: pub_client.c.i + +.PHONY : pub_client.i + +# target to preprocess a source file +pub_client.c.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f client/CMakeFiles/mosquitto_pub.dir/build.make client/CMakeFiles/mosquitto_pub.dir/pub_client.c.i +.PHONY : pub_client.c.i + +pub_client.s: pub_client.c.s + +.PHONY : pub_client.s + +# target to generate assembly for a file +pub_client.c.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f client/CMakeFiles/mosquitto_pub.dir/build.make client/CMakeFiles/mosquitto_pub.dir/pub_client.c.s +.PHONY : pub_client.c.s + +sub_client.o: sub_client.c.o + +.PHONY : sub_client.o + +# target to build an object file +sub_client.c.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f client/CMakeFiles/mosquitto_sub.dir/build.make client/CMakeFiles/mosquitto_sub.dir/sub_client.c.o +.PHONY : sub_client.c.o + +sub_client.i: sub_client.c.i + +.PHONY : sub_client.i + +# target to preprocess a source file +sub_client.c.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f client/CMakeFiles/mosquitto_sub.dir/build.make client/CMakeFiles/mosquitto_sub.dir/sub_client.c.i +.PHONY : sub_client.c.i + +sub_client.s: sub_client.c.s + +.PHONY : sub_client.s + +# target to generate assembly for a file +sub_client.c.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f client/CMakeFiles/mosquitto_sub.dir/build.make client/CMakeFiles/mosquitto_sub.dir/sub_client.c.s +.PHONY : sub_client.c.s + +# Help Target +help: + @echo "The following are some of the valid targets for this Makefile:" + @echo "... all (the default if no target is provided)" + @echo "... clean" + @echo "... depend" + @echo "... install/local" + @echo "... install/strip" + @echo "... install" + @echo "... list_install_components" + @echo "... rebuild_cache" + @echo "... edit_cache" + @echo "... mosquitto_sub" + @echo "... mosquitto_pub" + @echo "... client_shared.o" + @echo "... client_shared.i" + @echo "... client_shared.s" + @echo "... pub_client.o" + @echo "... pub_client.i" + @echo "... pub_client.s" + @echo "... sub_client.o" + @echo "... sub_client.i" + @echo "... sub_client.s" +.PHONY : help + + + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system + diff --git a/src/libs/mosquitto/client/client_shared.c b/src/libs/mosquitto/client/client_shared.c new file mode 100644 index 0000000..fa3ea18 --- /dev/null +++ b/src/libs/mosquitto/client/client_shared.c @@ -0,0 +1,973 @@ +/* +Copyright (c) 2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + + +#include +#include +#include +#include +#include +#ifndef WIN32 +#include +#else +#include +#include +#define snprintf sprintf_s +#endif + +#include +#include "client_shared.h" + +static int mosquitto__parse_socks_url(struct mosq_config *cfg, char *url); +static int client_config_line_proc(struct mosq_config *cfg, int pub_or_sub, int argc, char *argv[]); + +void init_config(struct mosq_config *cfg) +{ + memset(cfg, 0, sizeof(*cfg)); + cfg->port = 1883; + cfg->max_inflight = 20; + cfg->keepalive = 60; + cfg->clean_session = true; + cfg->eol = true; + cfg->protocol_version = MQTT_PROTOCOL_V31; +} + +void client_config_cleanup(struct mosq_config *cfg) +{ + int i; + free(cfg->id); + free(cfg->id_prefix); + free(cfg->host); + free(cfg->file_input); + free(cfg->message); + free(cfg->topic); + free(cfg->bind_address); + free(cfg->username); + free(cfg->password); + free(cfg->will_topic); + free(cfg->will_payload); +#ifdef WITH_TLS + free(cfg->cafile); + free(cfg->capath); + free(cfg->certfile); + free(cfg->keyfile); + free(cfg->ciphers); + free(cfg->tls_version); +# ifdef WITH_TLS_PSK + free(cfg->psk); + free(cfg->psk_identity); +# endif +#endif + if(cfg->topics){ + for(i=0; itopic_count; i++){ + free(cfg->topics[i]); + } + free(cfg->topics); + } + if(cfg->filter_outs){ + for(i=0; ifilter_out_count; i++){ + free(cfg->filter_outs[i]); + } + free(cfg->filter_outs); + } +#ifdef WITH_SOCKS + free(cfg->socks5_host); + free(cfg->socks5_username); + free(cfg->socks5_password); +#endif +} + +int client_config_load(struct mosq_config *cfg, int pub_or_sub, int argc, char *argv[]) +{ + int rc; + FILE *fptr; + char line[1024]; + int count; + char *loc = NULL; + int len; + char *args[3]; + +#ifndef WIN32 + char *env; +#else + char env[1024]; +#endif + args[0] = NULL; + + init_config(cfg); + + /* Default config file */ +#ifndef WIN32 + env = getenv("XDG_CONFIG_HOME"); + if(env){ + len = strlen(env) + strlen("/mosquitto_pub") + 1; + loc = malloc(len); + if(!loc){ + fprintf(stderr, "Error: Out of memory.\n"); + return 1; + } + if(pub_or_sub == CLIENT_PUB){ + snprintf(loc, len, "%s/mosquitto_pub", env); + }else{ + snprintf(loc, len, "%s/mosquitto_sub", env); + } + loc[len-1] = '\0'; + }else{ + env = getenv("HOME"); + if(env){ + len = strlen(env) + strlen("/.config/mosquitto_pub") + 1; + loc = malloc(len); + if(!loc){ + fprintf(stderr, "Error: Out of memory.\n"); + return 1; + } + if(pub_or_sub == CLIENT_PUB){ + snprintf(loc, len, "%s/.config/mosquitto_pub", env); + }else{ + snprintf(loc, len, "%s/.config/mosquitto_sub", env); + } + loc[len-1] = '\0'; + }else{ + fprintf(stderr, "Warning: Unable to locate configuration directory, default config not loaded.\n"); + } + } + +#else + rc = GetEnvironmentVariable("USERPROFILE", env, 1024); + if(rc > 0 && rc < 1024){ + len = strlen(env) + strlen("\\mosquitto_pub.conf") + 1; + loc = malloc(len); + if(!loc){ + fprintf(stderr, "Error: Out of memory.\n"); + return 1; + } + if(pub_or_sub == CLIENT_PUB){ + snprintf(loc, len, "%s\\mosquitto_pub.conf", env); + }else{ + snprintf(loc, len, "%s\\mosquitto_sub.conf", env); + } + loc[len-1] = '\0'; + }else{ + fprintf(stderr, "Warning: Unable to locate configuration directory, default config not loaded.\n"); + } +#endif + + if(loc){ + fptr = fopen(loc, "rt"); + if(fptr){ + while(fgets(line, 1024, fptr)){ + if(line[0] == '#') continue; /* Comments */ + + while(line[strlen(line)-1] == 10 || line[strlen(line)-1] == 13){ + line[strlen(line)-1] = 0; + } + /* All offset by one "args" here, because real argc/argv has + * program name as the first entry. */ + args[1] = strtok(line, " "); + if(args[1]){ + args[2] = strtok(NULL, " "); + if(args[2]){ + count = 3; + }else{ + count = 2; + } + rc = client_config_line_proc(cfg, pub_or_sub, count, args); + if(rc){ + fclose(fptr); + free(loc); + return rc; + } + } + } + fclose(fptr); + } + free(loc); + } + + /* Deal with real argc/argv */ + rc = client_config_line_proc(cfg, pub_or_sub, argc, argv); + if(rc) return rc; + + if(cfg->will_payload && !cfg->will_topic){ + fprintf(stderr, "Error: Will payload given, but no will topic given.\n"); + return 1; + } + if(cfg->will_retain && !cfg->will_topic){ + fprintf(stderr, "Error: Will retain given, but no will topic given.\n"); + return 1; + } + if(cfg->password && !cfg->username){ + if(!cfg->quiet) fprintf(stderr, "Warning: Not using password since username not set.\n"); + } +#ifdef WITH_TLS + if((cfg->certfile && !cfg->keyfile) || (cfg->keyfile && !cfg->certfile)){ + fprintf(stderr, "Error: Both certfile and keyfile must be provided if one of them is.\n"); + return 1; + } +#endif +#ifdef WITH_TLS_PSK + if((cfg->cafile || cfg->capath) && cfg->psk){ + if(!cfg->quiet) fprintf(stderr, "Error: Only one of --psk or --cafile/--capath may be used at once.\n"); + return 1; + } + if(cfg->psk && !cfg->psk_identity){ + if(!cfg->quiet) fprintf(stderr, "Error: --psk-identity required if --psk used.\n"); + return 1; + } +#endif + + if(pub_or_sub == CLIENT_SUB){ + if(cfg->clean_session == false && (cfg->id_prefix || !cfg->id)){ + if(!cfg->quiet) fprintf(stderr, "Error: You must provide a client id if you are using the -c option.\n"); + return 1; + } + if(cfg->topic_count == 0){ + if(!cfg->quiet) fprintf(stderr, "Error: You must specify a topic to subscribe to.\n"); + return 1; + } + } + + if(!cfg->host){ + cfg->host = "localhost"; + } + return MOSQ_ERR_SUCCESS; +} + +/* Process a tokenised single line from a file or set of real argc/argv */ +int client_config_line_proc(struct mosq_config *cfg, int pub_or_sub, int argc, char *argv[]) +{ + int i; + + for(i=1; iport = atoi(argv[i+1]); + if(cfg->port<1 || cfg->port>65535){ + fprintf(stderr, "Error: Invalid port given: %d\n", cfg->port); + return 1; + } + } + i++; + }else if(!strcmp(argv[i], "-A")){ + if(i==argc-1){ + fprintf(stderr, "Error: -A argument given but no address specified.\n\n"); + return 1; + }else{ + cfg->bind_address = strdup(argv[i+1]); + } + i++; +#ifdef WITH_TLS + }else if(!strcmp(argv[i], "--cafile")){ + if(i==argc-1){ + fprintf(stderr, "Error: --cafile argument given but no file specified.\n\n"); + return 1; + }else{ + cfg->cafile = strdup(argv[i+1]); + } + i++; + }else if(!strcmp(argv[i], "--capath")){ + if(i==argc-1){ + fprintf(stderr, "Error: --capath argument given but no directory specified.\n\n"); + return 1; + }else{ + cfg->capath = strdup(argv[i+1]); + } + i++; + }else if(!strcmp(argv[i], "--cert")){ + if(i==argc-1){ + fprintf(stderr, "Error: --cert argument given but no file specified.\n\n"); + return 1; + }else{ + cfg->certfile = strdup(argv[i+1]); + } + i++; + }else if(!strcmp(argv[i], "--ciphers")){ + if(i==argc-1){ + fprintf(stderr, "Error: --ciphers argument given but no ciphers specified.\n\n"); + return 1; + }else{ + cfg->ciphers = strdup(argv[i+1]); + } + i++; +#endif + }else if(!strcmp(argv[i], "-C")){ + if(pub_or_sub == CLIENT_PUB){ + goto unknown_option; + }else{ + if(i==argc-1){ + fprintf(stderr, "Error: -C argument given but no count specified.\n\n"); + return 1; + }else{ + cfg->msg_count = atoi(argv[i+1]); + if(cfg->msg_count < 1){ + fprintf(stderr, "Error: Invalid message count \"%d\".\n\n", cfg->msg_count); + return 1; + } + } + i++; + } + }else if(!strcmp(argv[i], "-d") || !strcmp(argv[i], "--debug")){ + cfg->debug = true; + }else if(!strcmp(argv[i], "-f") || !strcmp(argv[i], "--file")){ + if(pub_or_sub == CLIENT_SUB){ + goto unknown_option; + } + if(cfg->pub_mode != MSGMODE_NONE){ + fprintf(stderr, "Error: Only one type of message can be sent at once.\n\n"); + return 1; + }else if(i==argc-1){ + fprintf(stderr, "Error: -f argument given but no file specified.\n\n"); + return 1; + }else{ + cfg->pub_mode = MSGMODE_FILE; + cfg->file_input = strdup(argv[i+1]); + } + i++; + }else if(!strcmp(argv[i], "--help")){ + return 2; + }else if(!strcmp(argv[i], "-h") || !strcmp(argv[i], "--host")){ + if(i==argc-1){ + fprintf(stderr, "Error: -h argument given but no host specified.\n\n"); + return 1; + }else{ + cfg->host = strdup(argv[i+1]); + } + i++; +#ifdef WITH_TLS + }else if(!strcmp(argv[i], "--insecure")){ + cfg->insecure = true; +#endif + }else if(!strcmp(argv[i], "-i") || !strcmp(argv[i], "--id")){ + if(cfg->id_prefix){ + fprintf(stderr, "Error: -i and -I argument cannot be used together.\n\n"); + return 1; + } + if(i==argc-1){ + fprintf(stderr, "Error: -i argument given but no id specified.\n\n"); + return 1; + }else{ + cfg->id = strdup(argv[i+1]); + } + i++; + }else if(!strcmp(argv[i], "-I") || !strcmp(argv[i], "--id-prefix")){ + if(cfg->id){ + fprintf(stderr, "Error: -i and -I argument cannot be used together.\n\n"); + return 1; + } + if(i==argc-1){ + fprintf(stderr, "Error: -I argument given but no id prefix specified.\n\n"); + return 1; + }else{ + cfg->id_prefix = strdup(argv[i+1]); + } + i++; + }else if(!strcmp(argv[i], "-k") || !strcmp(argv[i], "--keepalive")){ + if(i==argc-1){ + fprintf(stderr, "Error: -k argument given but no keepalive specified.\n\n"); + return 1; + }else{ + cfg->keepalive = atoi(argv[i+1]); + if(cfg->keepalive>65535){ + fprintf(stderr, "Error: Invalid keepalive given: %d\n", cfg->keepalive); + return 1; + } + } + i++; +#ifdef WITH_TLS + }else if(!strcmp(argv[i], "--key")){ + if(i==argc-1){ + fprintf(stderr, "Error: --key argument given but no file specified.\n\n"); + return 1; + }else{ + cfg->keyfile = strdup(argv[i+1]); + } + i++; +#endif + }else if(!strcmp(argv[i], "-l") || !strcmp(argv[i], "--stdin-line")){ + if(pub_or_sub == CLIENT_SUB){ + goto unknown_option; + } + if(cfg->pub_mode != MSGMODE_NONE){ + fprintf(stderr, "Error: Only one type of message can be sent at once.\n\n"); + return 1; + }else{ + cfg->pub_mode = MSGMODE_STDIN_LINE; + } + }else if(!strcmp(argv[i], "-m") || !strcmp(argv[i], "--message")){ + if(pub_or_sub == CLIENT_SUB){ + goto unknown_option; + } + if(cfg->pub_mode != MSGMODE_NONE){ + fprintf(stderr, "Error: Only one type of message can be sent at once.\n\n"); + return 1; + }else if(i==argc-1){ + fprintf(stderr, "Error: -m argument given but no message specified.\n\n"); + return 1; + }else{ + cfg->message = strdup(argv[i+1]); + cfg->msglen = strlen(cfg->message); + cfg->pub_mode = MSGMODE_CMD; + } + i++; + }else if(!strcmp(argv[i], "-M")){ + if(i==argc-1){ + fprintf(stderr, "Error: -M argument given but max_inflight not specified.\n\n"); + return 1; + }else{ + cfg->max_inflight = atoi(argv[i+1]); + } + i++; + }else if(!strcmp(argv[i], "-n") || !strcmp(argv[i], "--null-message")){ + if(pub_or_sub == CLIENT_SUB){ + goto unknown_option; + } + if(cfg->pub_mode != MSGMODE_NONE){ + fprintf(stderr, "Error: Only one type of message can be sent at once.\n\n"); + return 1; + }else{ + cfg->pub_mode = MSGMODE_NULL; + } + }else if(!strcmp(argv[i], "-V") || !strcmp(argv[i], "--protocol-version")){ + if(i==argc-1){ + fprintf(stderr, "Error: --protocol-version argument given but no version specified.\n\n"); + return 1; + }else{ + if(!strcmp(argv[i+1], "mqttv31")){ + cfg->protocol_version = MQTT_PROTOCOL_V31; + }else if(!strcmp(argv[i+1], "mqttv311")){ + cfg->protocol_version = MQTT_PROTOCOL_V311; + }else{ + fprintf(stderr, "Error: Invalid protocol version argument given.\n\n"); + return 1; + } + i++; + } +#ifdef WITH_SOCKS + }else if(!strcmp(argv[i], "--proxy")){ + if(i==argc-1){ + fprintf(stderr, "Error: --proxy argument given but no proxy url specified.\n\n"); + return 1; + }else{ + if(mosquitto__parse_socks_url(cfg, argv[i+1])){ + return 1; + } + i++; + } +#endif +#ifdef WITH_TLS_PSK + }else if(!strcmp(argv[i], "--psk")){ + if(i==argc-1){ + fprintf(stderr, "Error: --psk argument given but no key specified.\n\n"); + return 1; + }else{ + cfg->psk = strdup(argv[i+1]); + } + i++; + }else if(!strcmp(argv[i], "--psk-identity")){ + if(i==argc-1){ + fprintf(stderr, "Error: --psk-identity argument given but no identity specified.\n\n"); + return 1; + }else{ + cfg->psk_identity = strdup(argv[i+1]); + } + i++; +#endif + }else if(!strcmp(argv[i], "-q") || !strcmp(argv[i], "--qos")){ + if(i==argc-1){ + fprintf(stderr, "Error: -q argument given but no QoS specified.\n\n"); + return 1; + }else{ + cfg->qos = atoi(argv[i+1]); + if(cfg->qos<0 || cfg->qos>2){ + fprintf(stderr, "Error: Invalid QoS given: %d\n", cfg->qos); + return 1; + } + } + i++; + }else if(!strcmp(argv[i], "--quiet")){ + cfg->quiet = true; + }else if(!strcmp(argv[i], "-r") || !strcmp(argv[i], "--retain")){ + if(pub_or_sub == CLIENT_SUB){ + goto unknown_option; + } + cfg->retain = 1; + }else if(!strcmp(argv[i], "-s") || !strcmp(argv[i], "--stdin-file")){ + if(pub_or_sub == CLIENT_SUB){ + goto unknown_option; + } + if(cfg->pub_mode != MSGMODE_NONE){ + fprintf(stderr, "Error: Only one type of message can be sent at once.\n\n"); + return 1; + }else{ + cfg->pub_mode = MSGMODE_STDIN_FILE; + } +#ifdef WITH_SRV + }else if(!strcmp(argv[i], "-S")){ + cfg->use_srv = true; +#endif + }else if(!strcmp(argv[i], "-t") || !strcmp(argv[i], "--topic")){ + if(i==argc-1){ + fprintf(stderr, "Error: -t argument given but no topic specified.\n\n"); + return 1; + }else{ + if(pub_or_sub == CLIENT_PUB){ + if(mosquitto_pub_topic_check(argv[i+1]) == MOSQ_ERR_INVAL){ + fprintf(stderr, "Error: Invalid publish topic '%s', does it contain '+' or '#'?\n", argv[i+1]); + return 1; + } + cfg->topic = strdup(argv[i+1]); + }else{ + if(mosquitto_sub_topic_check(argv[i+1]) == MOSQ_ERR_INVAL){ + fprintf(stderr, "Error: Invalid subscription topic '%s', are all '+' and '#' wildcards correct?\n", argv[i+1]); + return 1; + } + cfg->topic_count++; + cfg->topics = realloc(cfg->topics, cfg->topic_count*sizeof(char *)); + cfg->topics[cfg->topic_count-1] = strdup(argv[i+1]); + } + i++; + } + }else if(!strcmp(argv[i], "-T") || !strcmp(argv[i], "--filter-out")){ + if(pub_or_sub == CLIENT_PUB){ + goto unknown_option; + } + if(i==argc-1){ + fprintf(stderr, "Error: -T argument given but no topic filter specified.\n\n"); + return 1; + }else{ + if(mosquitto_sub_topic_check(argv[i+1]) == MOSQ_ERR_INVAL){ + fprintf(stderr, "Error: Invalid filter topic '%s', are all '+' and '#' wildcards correct?\n", argv[i+1]); + return 1; + } + cfg->filter_out_count++; + cfg->filter_outs = realloc(cfg->filter_outs, cfg->filter_out_count*sizeof(char *)); + cfg->filter_outs[cfg->filter_out_count-1] = strdup(argv[i+1]); + } + i++; +#ifdef WITH_TLS + }else if(!strcmp(argv[i], "--tls-version")){ + if(i==argc-1){ + fprintf(stderr, "Error: --tls-version argument given but no version specified.\n\n"); + return 1; + }else{ + cfg->tls_version = strdup(argv[i+1]); + } + i++; +#endif + }else if(!strcmp(argv[i], "-u") || !strcmp(argv[i], "--username")){ + if(i==argc-1){ + fprintf(stderr, "Error: -u argument given but no username specified.\n\n"); + return 1; + }else{ + cfg->username = strdup(argv[i+1]); + } + i++; + }else if(!strcmp(argv[i], "-P") || !strcmp(argv[i], "--pw")){ + if(i==argc-1){ + fprintf(stderr, "Error: -P argument given but no password specified.\n\n"); + return 1; + }else{ + cfg->password = strdup(argv[i+1]); + } + i++; + }else if(!strcmp(argv[i], "--will-payload")){ + if(i==argc-1){ + fprintf(stderr, "Error: --will-payload argument given but no will payload specified.\n\n"); + return 1; + }else{ + cfg->will_payload = strdup(argv[i+1]); + cfg->will_payloadlen = strlen(cfg->will_payload); + } + i++; + }else if(!strcmp(argv[i], "--will-qos")){ + if(i==argc-1){ + fprintf(stderr, "Error: --will-qos argument given but no will QoS specified.\n\n"); + return 1; + }else{ + cfg->will_qos = atoi(argv[i+1]); + if(cfg->will_qos < 0 || cfg->will_qos > 2){ + fprintf(stderr, "Error: Invalid will QoS %d.\n\n", cfg->will_qos); + return 1; + } + } + i++; + }else if(!strcmp(argv[i], "--will-retain")){ + cfg->will_retain = true; + }else if(!strcmp(argv[i], "--will-topic")){ + if(i==argc-1){ + fprintf(stderr, "Error: --will-topic argument given but no will topic specified.\n\n"); + return 1; + }else{ + if(mosquitto_pub_topic_check(argv[i+1]) == MOSQ_ERR_INVAL){ + fprintf(stderr, "Error: Invalid will topic '%s', does it contain '+' or '#'?\n", argv[i+1]); + return 1; + } + cfg->will_topic = strdup(argv[i+1]); + } + i++; + }else if(!strcmp(argv[i], "-c") || !strcmp(argv[i], "--disable-clean-session")){ + if(pub_or_sub == CLIENT_PUB){ + goto unknown_option; + } + cfg->clean_session = false; + }else if(!strcmp(argv[i], "-N")){ + if(pub_or_sub == CLIENT_PUB){ + goto unknown_option; + } + cfg->eol = false; + }else if(!strcmp(argv[i], "-R")){ + if(pub_or_sub == CLIENT_PUB){ + goto unknown_option; + } + cfg->no_retain = true; + }else if(!strcmp(argv[i], "-v") || !strcmp(argv[i], "--verbose")){ + if(pub_or_sub == CLIENT_PUB){ + goto unknown_option; + } + cfg->verbose = 1; + }else{ + goto unknown_option; + } + } + + return MOSQ_ERR_SUCCESS; + +unknown_option: + fprintf(stderr, "Error: Unknown option '%s'.\n",argv[i]); + return 1; +} + +int client_opts_set(struct mosquitto *mosq, struct mosq_config *cfg) +{ + int rc; + + if(cfg->will_topic && mosquitto_will_set(mosq, cfg->will_topic, + cfg->will_payloadlen, cfg->will_payload, cfg->will_qos, + cfg->will_retain)){ + + if(!cfg->quiet) fprintf(stderr, "Error: Problem setting will.\n"); + mosquitto_lib_cleanup(); + return 1; + } + if(cfg->username && mosquitto_username_pw_set(mosq, cfg->username, cfg->password)){ + if(!cfg->quiet) fprintf(stderr, "Error: Problem setting username and password.\n"); + mosquitto_lib_cleanup(); + return 1; + } +#ifdef WITH_TLS + if((cfg->cafile || cfg->capath) + && mosquitto_tls_set(mosq, cfg->cafile, cfg->capath, cfg->certfile, cfg->keyfile, NULL)){ + + if(!cfg->quiet) fprintf(stderr, "Error: Problem setting TLS options.\n"); + mosquitto_lib_cleanup(); + return 1; + } + if(cfg->insecure && mosquitto_tls_insecure_set(mosq, true)){ + if(!cfg->quiet) fprintf(stderr, "Error: Problem setting TLS insecure option.\n"); + mosquitto_lib_cleanup(); + return 1; + } +# ifdef WITH_TLS_PSK + if(cfg->psk && mosquitto_tls_psk_set(mosq, cfg->psk, cfg->psk_identity, NULL)){ + if(!cfg->quiet) fprintf(stderr, "Error: Problem setting TLS-PSK options.\n"); + mosquitto_lib_cleanup(); + return 1; + } +# endif + if((cfg->tls_version || cfg->ciphers) && mosquitto_tls_opts_set(mosq, 1, cfg->tls_version, cfg->ciphers)){ + if(!cfg->quiet) fprintf(stderr, "Error: Problem setting TLS options.\n"); + mosquitto_lib_cleanup(); + return 1; + } +#endif + mosquitto_max_inflight_messages_set(mosq, cfg->max_inflight); +#ifdef WITH_SOCKS + if(cfg->socks5_host){ + rc = mosquitto_socks5_set(mosq, cfg->socks5_host, cfg->socks5_port, cfg->socks5_username, cfg->socks5_password); + if(rc){ + mosquitto_lib_cleanup(); + return rc; + } + } +#endif + mosquitto_opts_set(mosq, MOSQ_OPT_PROTOCOL_VERSION, &(cfg->protocol_version)); + return MOSQ_ERR_SUCCESS; +} + +int client_id_generate(struct mosq_config *cfg, const char *id_base) +{ + int len; + char hostname[256]; + + if(cfg->id_prefix){ + cfg->id = malloc(strlen(cfg->id_prefix)+10); + if(!cfg->id){ + if(!cfg->quiet) fprintf(stderr, "Error: Out of memory.\n"); + mosquitto_lib_cleanup(); + return 1; + } + snprintf(cfg->id, strlen(cfg->id_prefix)+10, "%s%d", cfg->id_prefix, getpid()); + }else if(!cfg->id){ + hostname[0] = '\0'; + gethostname(hostname, 256); + hostname[255] = '\0'; + len = strlen(id_base) + strlen("|-") + 6 + strlen(hostname); + cfg->id = malloc(len); + if(!cfg->id){ + if(!cfg->quiet) fprintf(stderr, "Error: Out of memory.\n"); + mosquitto_lib_cleanup(); + return 1; + } + snprintf(cfg->id, len, "%s|%d-%s", id_base, getpid(), hostname); + if(strlen(cfg->id) > MOSQ_MQTT_ID_MAX_LENGTH){ + /* Enforce maximum client id length of 23 characters */ + cfg->id[MOSQ_MQTT_ID_MAX_LENGTH] = '\0'; + } + } + return MOSQ_ERR_SUCCESS; +} + +int client_connect(struct mosquitto *mosq, struct mosq_config *cfg) +{ + char err[1024]; + int rc; + +#ifdef WITH_SRV + if(cfg->use_srv){ + rc = mosquitto_connect_srv(mosq, cfg->host, cfg->keepalive, cfg->bind_address); + }else{ + rc = mosquitto_connect_bind(mosq, cfg->host, cfg->port, cfg->keepalive, cfg->bind_address); + } +#else + rc = mosquitto_connect_bind(mosq, cfg->host, cfg->port, cfg->keepalive, cfg->bind_address); +#endif + if(rc>0){ + if(!cfg->quiet){ + if(rc == MOSQ_ERR_ERRNO){ +#ifndef WIN32 + strerror_r(errno, err, 1024); +#else + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, errno, 0, (LPTSTR)&err, 1024, NULL); +#endif + fprintf(stderr, "Error: %s\n", err); + }else{ + fprintf(stderr, "Unable to connect (%s).\n", mosquitto_strerror(rc)); + } + } + mosquitto_lib_cleanup(); + return rc; + } + return MOSQ_ERR_SUCCESS; +} + +#ifdef WITH_SOCKS +/* Convert %25 -> %, %3a, %3A -> :, %40 -> @ */ +static int mosquitto__urldecode(char *str) +{ + int i, j; + int len; + if(!str) return 0; + + if(!strchr(str, '%')) return 0; + + len = strlen(str); + for(i=0; i= len){ + return 1; + } + if(str[i+1] == '2' && str[i+2] == '5'){ + str[i] = '%'; + len -= 2; + for(j=i+1; j start){ + len = i-start; + if(host){ + /* Have already seen a @ , so this must be of form + * socks5h://username[:password]@host:port */ + port = malloc(len + 1); + memcpy(port, &(str[start]), len); + port[len] = '\0'; + }else if(username_or_host){ + /* Haven't seen a @ before, so must be of form + * socks5h://host:port */ + host = username_or_host; + username_or_host = NULL; + port = malloc(len + 1); + memcpy(port, &(str[start]), len); + port[len] = '\0'; + }else{ + host = malloc(len + 1); + if(!host){ + fprintf(stderr, "Error: Out of memory.\n"); + goto cleanup; + } + memcpy(host, &(str[start]), len); + host[len] = '\0'; + } + } + + if(!host){ + fprintf(stderr, "Error: Invalid proxy.\n"); + goto cleanup; + } + + if(mosquitto__urldecode(username)){ + goto cleanup; + } + if(mosquitto__urldecode(password)){ + goto cleanup; + } + if(port){ + port_int = atoi(port); + if(port_int < 1 || port_int > 65535){ + fprintf(stderr, "Error: Invalid proxy port %d\n", port_int); + goto cleanup; + } + free(port); + }else{ + port_int = 1080; + } + + cfg->socks5_username = username; + cfg->socks5_password = password; + cfg->socks5_host = host; + cfg->socks5_port = port_int; + + return 0; +cleanup: + if(username_or_host) free(username_or_host); + if(username) free(username); + if(password) free(password); + if(host) free(host); + if(port) free(port); + return 1; +} + +#endif diff --git a/src/libs/mosquitto/client/client_shared.h b/src/libs/mosquitto/client/client_shared.h new file mode 100644 index 0000000..0a974b1 --- /dev/null +++ b/src/libs/mosquitto/client/client_shared.h @@ -0,0 +1,97 @@ +/* +Copyright (c) 2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#ifndef _CLIENT_CONFIG_H +#define _CLIENT_CONFIG_H + +#include + +/* pub_client.c modes */ +#define MSGMODE_NONE 0 +#define MSGMODE_CMD 1 +#define MSGMODE_STDIN_LINE 2 +#define MSGMODE_STDIN_FILE 3 +#define MSGMODE_FILE 4 +#define MSGMODE_NULL 5 + +#define CLIENT_PUB 1 +#define CLIENT_SUB 2 + +struct mosq_config { + char *id; + char *id_prefix; + int protocol_version; + int keepalive; + char *host; + int port; + int qos; + bool retain; + int pub_mode; /* pub */ + char *file_input; /* pub */ + char *message; /* pub */ + long msglen; /* pub */ + char *topic; /* pub */ + char *bind_address; +#ifdef WITH_SRV + bool use_srv; +#endif + bool debug; + bool quiet; + unsigned int max_inflight; + char *username; + char *password; + char *will_topic; + char *will_payload; + long will_payloadlen; + int will_qos; + bool will_retain; +#ifdef WITH_TLS + char *cafile; + char *capath; + char *certfile; + char *keyfile; + char *ciphers; + bool insecure; + char *tls_version; +# ifdef WITH_TLS_PSK + char *psk; + char *psk_identity; +# endif +#endif + bool clean_session; /* sub */ + char **topics; /* sub */ + int topic_count; /* sub */ + bool no_retain; /* sub */ + char **filter_outs; /* sub */ + int filter_out_count; /* sub */ + bool verbose; /* sub */ + bool eol; /* sub */ + int msg_count; /* sub */ +#ifdef WITH_SOCKS + char *socks5_host; + int socks5_port; + char *socks5_username; + char *socks5_password; +#endif +}; + +int client_config_load(struct mosq_config *config, int pub_or_sub, int argc, char *argv[]); +void client_config_cleanup(struct mosq_config *cfg); +int client_opts_set(struct mosquitto *mosq, struct mosq_config *cfg); +int client_id_generate(struct mosq_config *cfg, const char *id_base); +int client_connect(struct mosquitto *mosq, struct mosq_config *cfg); + +#endif diff --git a/src/libs/mosquitto/client/cmake_install.cmake b/src/libs/mosquitto/client/cmake_install.cmake new file mode 100644 index 0000000..ddbb845 --- /dev/null +++ b/src/libs/mosquitto/client/cmake_install.cmake @@ -0,0 +1,72 @@ +# Install script for directory: /Users/benjamin/orchestra/src/libs/mosquitto/client + +# Set the install prefix +if(NOT DEFINED CMAKE_INSTALL_PREFIX) + set(CMAKE_INSTALL_PREFIX "/usr/local") +endif() +string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") + +# Set the install configuration name. +if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) + if(BUILD_TYPE) + string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" + CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") + else() + set(CMAKE_INSTALL_CONFIG_NAME "") + endif() + message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") +endif() + +# Set the component getting installed. +if(NOT CMAKE_INSTALL_COMPONENT) + if(COMPONENT) + message(STATUS "Install component: \"${COMPONENT}\"") + set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") + else() + set(CMAKE_INSTALL_COMPONENT) + endif() +endif() + +# Is this installation the result of a crosscompile? +if(NOT DEFINED CMAKE_CROSSCOMPILING) + set(CMAKE_CROSSCOMPILING "FALSE") +endif() + +if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" OR NOT CMAKE_INSTALL_COMPONENT) + file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" TYPE EXECUTABLE FILES "/Users/benjamin/orchestra/src/libs/mosquitto/client/mosquitto_pub") + if(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/mosquitto_pub" AND + NOT IS_SYMLINK "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/mosquitto_pub") + execute_process(COMMAND "/usr/bin/install_name_tool" + -change "/Users/benjamin/orchestra/src/libs/mosquitto/lib/libmosquitto.1.dylib" "libmosquitto.1.dylib" + "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/mosquitto_pub") + execute_process(COMMAND /usr/bin/install_name_tool + -delete_rpath "/Users/benjamin/orchestra/src/libs/mosquitto/lib" + "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/mosquitto_pub") + execute_process(COMMAND /usr/bin/install_name_tool + -add_rpath "/usr/local/lib" + "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/mosquitto_pub") + if(CMAKE_INSTALL_DO_STRIP) + execute_process(COMMAND "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip" "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/mosquitto_pub") + endif() + endif() +endif() + +if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" OR NOT CMAKE_INSTALL_COMPONENT) + file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" TYPE EXECUTABLE FILES "/Users/benjamin/orchestra/src/libs/mosquitto/client/mosquitto_sub") + if(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/mosquitto_sub" AND + NOT IS_SYMLINK "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/mosquitto_sub") + execute_process(COMMAND "/usr/bin/install_name_tool" + -change "/Users/benjamin/orchestra/src/libs/mosquitto/lib/libmosquitto.1.dylib" "libmosquitto.1.dylib" + "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/mosquitto_sub") + execute_process(COMMAND /usr/bin/install_name_tool + -delete_rpath "/Users/benjamin/orchestra/src/libs/mosquitto/lib" + "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/mosquitto_sub") + execute_process(COMMAND /usr/bin/install_name_tool + -add_rpath "/usr/local/lib" + "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/mosquitto_sub") + if(CMAKE_INSTALL_DO_STRIP) + execute_process(COMMAND "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip" "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/mosquitto_sub") + endif() + endif() +endif() + diff --git a/src/libs/mosquitto/client/mosquitto_pub b/src/libs/mosquitto/client/mosquitto_pub new file mode 100755 index 0000000000000000000000000000000000000000..f4cff69f1d5162285b26c8f42f6275c5b4483b92 GIT binary patch literal 37740 zcmeHweSB2ao%aneiYQK0RIG2Kf}j#00v16qyo?S?Fe)gDID}+EQj(c4FA!AR;4s}> z#-Xf_>{4sHS?gA`)TXU;Q`cy)mY{tRE%l*Y>Y}CgUdy(zr4%hK&-eQ~=ia$9N$B>E z=lMLJ{V*TyJ?Hm3zqj){zw>tQx#7)E{_8KN8b--r!)P637{*z+Do!zsj1fT2FfPCq z!W9lz&AK^wZ}5)Wh%Nk;6oUOil(P?n;qb!X;)R7I!rxqoGc*j_44=M85e_FKElK9o zuUKAtDJp}aFU?WqgokKaNro7$UN9U^BvZ>1E~;4GOxQ|!bHzx*aA1dFsFnwp$xq1( z*GC$gBXMAgtZi zx~3so8*Yf!#RM*FkL^IRs%&%q2p7vxCF-7U*SWJ6&hnI?{lsPPzx)8pPs40i#GJG( z@!@c^F`QW2v^>@rZcfGl_b<;8$M_(>^P~T-a{#2_@QRoxO!~+x1wZW@sd)$&%bQvt zud(_>_Knr@I;7HuLD(yg^_^ZIueLf_oktYcci$>y-x->O@QKTp10(CmHrf1H!&riJ$R@+6#{h6T@($nG$n)~!x(wGeTm$_o9yJV9 zz0dDVU;?=4-wCNid_rTx@(HzT8*2gccOfp?v0}%S&nK>&c>eRN&Y8RF>!Alm0auF4 z7(Ps{s~wm){KlfD~OrVFEtrbYc4}YUAU^A}7MSmeRT^#s%=SL{JL!Rw9ysZNlO8zffs-CM z>4B3TIO&1E#RH2%<}X9*4{Zid$Xs_cWTtw}MTdHV7KNnO9WwlxkFb)?`YxzOh(vhq9FiLNz1WLM5*re;>HsWyC>X_FP-C!#_k~{%C&I zM|f^l;Pi}N0WfCyx4b&5_5G5d|Jy$cneWXtF9_v^KTrD9zL5E&Y$fi&J=PEA028$A zCa^$74g}?|m%nYkqZPFR0m1)(Bt2sj?iAcTtMvc{@0n-*B50m7KX>sWlmyG)4w`#V z+uifccg@Pz=9+IoMW@xERbcaB^!RQCCASgjb(Z1Zz}g=1%_PpB`96Sb&{7^53XgP{ z!R`LP|2ohx?P_qrBOM-(OnE9uoNw^`Or~}i){@z*&Nll&;hEB<%73xcDW5LoPutw4 zg>qAVtjfRZmR~64?e=t4ZmIGwyXAkHMfp$K+-iaUxGGP(<^Lh&TWu6eQ(2dYz{lqS(@7rn47?vZ(_h zvj_hAl=y3ZDE-<*iYVk?f2e8*P4vBtSO{eyC3rN{lR5CGXu(X9;fRu1*8;%~wO&;f>_Ub@f7CD0`aK z1=f(6*(czP3DWeUH#Arw&0SWcLTG40DBUHN_%k;_?h)TvV1T+y03br1LFa;5CCV&R z`W{F(Ge1zm-@eZodui6L4^jjtZGN$#es7fP?&2h;h8;)w4Fco?Q%N}}A92>G(U zjrTB_3L|=9{<||^esFJ3@R&II{6QE?yUkrMBE`UWH3YyQs@P|J52Va+2!4fm({~A* zaQ%#Pkg#w1H_dg3qaZlqyMP9m!5_Fb3|2OrQeeZqV#997hW`ai&EY!r6c#%l# z0TvQpb0vN-i&ptwSj@z!)liYx?MR%ZB*sKy&XxGa4YV<(B);TI>`)Sy7fAdzXfZK3 z5`PQZq_4}39xH!aoYW4wP^e-L>)J!+o0yi`tq-OHZw3!Q%7M^eNaAq!Ec+E3{5h0DCxoIdPiBM1Fe){3 z^o9rZdSMSu$*nsU%B7Bma*GaIpHO0M#uqBc!vJF)fv|x<)h>l^vx|;pE05021`nIT zL!cO=C{9Na)B|yzLaY?TK_Gkz@rWP}0C8Ap`H~>^1Mv%m_@*HC0r9p%ye^2nKvxSF3P)6mBd!g_&8Va4#ubqu}mSxNQp8Cb-24_qf76CAftO*Q#)@ z3$9Ax8Wrvjf}5{!ixuwlo2fUXaB~%IlHlel+(d<|5nP4BT?Cw&xd8yC0`@KTwpOH0 ze`_zvcS*HM$E05hdeZb{j$tvQk2WL#lOfdXh4N`Q)%h;*1z6bAQ z!kO&HpBCBB02>a0-TvaKq|A&2-^)aozy9JrGMhc-4hsb4k0AU275xyroYk_Gy`gLu zQCXp|9zTuJ&VYn;7w=d_*Gnmz z#vDFX@wF(vdj$%%Ld4y|wo0+JoqGeobQgIB`!kqv4C}5Vs3%rf8?=uPA|O$L^W6%> z@a{~Tj@1^C@$1jL050onlw^mRZ=^pw z!_4i5RCCK~xcfJ75hIgrHbZpUI?v2>O9?m(dl_y=e9yws`L)`O>|t5o=c~k5sMSZ4 zY3obivL_1t+5-9x3~ZopaOrmneJANbj+#T2+j=h${UAEqkxVn{QR3fl4rt(!vks$H zS*ew11nNt@dDIIK3e@!9=TYBMsE`Ns8$s=0CvjxGKB^!0elnQS3h2IZ6>C}0<@gpZ zD=0H~%-#i_^o-ll*ywa;(`aq&ZBpM3r@rYKWs2spL1YL4fOF3U(39x}5jY{01C5zE zj5~Zc(KV6J%yn&t*dH*?#-IM>`cKbv6=;o6SGx()W5nV~Q`-Nie46sBRs zUKzOH9yAi0w*?bE{BiLDCR4LpNQwxIT}$pKDNpSP8%&b|n@m*LXmFLGXT z#F!AHB46msyW4i^S*Iqm)U&o0%kFw<~i^zWy~X3YLC%bHPv6=jlVG zWn<{o8)iOu;4_XL6DYp&XwR&`5>E4yy^j@F*%8Xf%A>p1=YT}_VfJfIwr5r;A`?n>N4Sv+9L zwvskfQ;Fgmc3Yj00n&6g_H2jk9yXna3eOz=NtA#w-PsPt0hDZGiB}0}T_tx8q(rEo zUA2Yr2?N4=HA<0<&mT0|@#=6M7=d?FljAn)Ol;_sEkYjsw_pfXnt{NtN!R{pi&(HbFV42eivLY7)CpFH`=4c|MJ%cBGW~PNQF!Ct2Q~x?!v#=$>hP5XR&Ps)3 z>UwL}kW$00fOT-r574Kqji5fEbEeY)>F)FTb52+>_v@T0j1O?mb2l@ga|VIf>zrm* z?00DKzRvkHEc+|Y*?0||(^%k~3;sIWox)as0_W((zC4S_`hI}Z520CGVS!PS;Y33FdTR+7TU9CfsAoIVR=>;}@ z^a}k@^mX)W;q55FT9;*QnHutak(#ia@W1@1Pgp)4ws8wf+O{mm-M>LC0EESA?n6A> z|M;tla$|<{oO-ZAHtdU8MWxBQUbF4mASw)d4M&;Wlyl`lfD(O~s=qJRAEVsN zY)3ZT#XCe{Y-JOOLm#?I@|#g&X6_@yCSbC{pdRkpt06(0YJY~anr55>GBdLn98PO4 zQlh$naxCbSVi||5=DvoU1w#r{oemoGMv4ffTUuc2jbf{VY1XR}cxtEGCdB8GgZ<`> zv4#C+A%xgmXlQ{)S|5chEcgc$`DG=N56YCtHANz;C~`$!By6mQjfj0m2{6lGBi6+Z z=19do2o~L2Qc6P?)}BhkxzJ!{=2I?MbQi}`W^Z1=#4xE56?TGKR@KynLKy8lhf)6Bwnl}{(81kqd6jRZlOf1 zzEudhRR@6 zPsO+)s#XUI1LW7B*8wuI$dRWjUT+V58S1QWf<>a_3`j(@V*)Yk*?oz(k~pJ@H}un; zA0R=kBdr!<`m5p+RmEdmUP^afc)7q_MpV>vc}PUL*5?KVH*%2A%OV;y)pB zpx7uS!ONN;^Lgb(?BzHOIL-Ib6x!fh?Aq9Y>be6#r#%XK`>We;6kovQYw_~EU?0K& z)VFS*hB2zm2IZ@^K$Ci^)(z>_kP}qxDH8kwDy2E|Rl|Jd)a-m^;lr|o_N8`|Z)uN@!3!bW7L(8wymiHH1!$~mIsoFCG z#MbX8Q?jp}%SDN;qnCPWx6N+UnhRrV2Z(5;IeP??^$(0Fm>hnhgx;!zav;f8jezH# z^vZtPE`{u(9@mN$C!5<-(d`gsRls)xh36&`T&f8&3sF(eSo5F~*jq5xY`#`1{Z+m) zl1dNu8rE*F(M%XK20@(t%QO2}btRQP2eyH%8cG6F6J&l^Xq6UNXw@g>V%52>RZUpH zxn1Z<`#o6EU!ZN9Bz!-Y1q}mqikEMz{j9dWun7-?NC(TAO}wBdYhLw`Nu4`_Dl2&9RTMS*gM5?I(ID<+C-ACZ*@UHh|(JO*#J7icE$TrFq``V&b z`*-NGz7HJ(b?+~d;5kh&;6i+zGJCdb_7k7-xTw`WQ~RT!)vUWgqyl~vlQh0?@;{1B zEKQeg88yhi339n;TA<{=FH?%CWkU8Xc`ToE66y;pcqQl1~{66d*sEvO$9t6*6f(#GudUlJaoZ5er zzXB#S`6L-QIf`Y^^LV759yz9MDQu35MNz(?JCvXgrTh2W(B)pqJmz9Qr6j}G+ZtbnEc^{2yS;@o%8J5_%gf3C;5%jklC*2)W=`yuFbtS`$4#STn$MTYK%2J73P z9>~z=NU%i{3}~pS3@vjFb5^EnSfrE2;)v>a~wYt?VCZ*@b>OA9S?Oe54JcnM=RO9A?q81QF~_cM^e#bTSdS zDX%MCpO=26CeqEMfLDHn1%%r=Rn)o|T5S}1mJlu2Clpokafr0qV2V_-lzK3%?NSef z?b&@9R*~Uuhhe9ZpI<}kX=Aan^taM@Y_*%c_RXh#omzIGSNH6HVW`)$995LnlO7cv{dBFnXInKG!V-dcDq!LafIVlt5R7B8d$Jf z9R;tzp^xJ4Q@X`jzDus6MR-#p=LvWmG-U4BC-3~^yr_Q6c&1P*OtxjHHH(!^cMrpY z&`J%b2sug`GEc?Z9+8s9GrY_^SfLRG@1$-+7er7#i>j!(r35ncDaN~y#RnQN0Xl)? zfkpckj(qxDj8?#4)&^DJbFQv#u^sEvTqknYKhr8&n9b3i`Pq3O%J9V8e05;V`nNOm z!GU+=v5OLr-9ZvCQ3%c(@IaY4gqym_AU88l1Gc~E@rKm%Ngz56+{|5kGYpzt>fD_* zA6yP9_*>LgIoIsk3ZjttM>E4CUDih=OLq^#bqai`3NvjidWS{X9n6PHc9|cUxxLKR zbTP4xo-U=T;lTReaQ@o}e>i^}o+BvdZ-5Ll!&6h%Pm%RHzZFRPhit_@&ac@)1K^^4 zNZ|DrNxGUP*-_6jGq((hwE#lpU`HGeLh#y}{y`;$GOH-FnmxBz_+E!tvcmK8vs)By z;i#c#h3ALSYH89?_Ifk3kP5y&{XwX&xf#&>vX0;8$= z#40=0dXiqkvI?8vP;LtkKj16Q=`eL(b}G6VV7M{|PW`(72GQfYKq`Y{ZdA`Mg#^dk zMk;B1zJyv4sgAkL7XduIV}l>hmjNqYGk1ur@~Mr@72z+8J6yMoWa01VjpB5n;# zmqiB#CLl4L$>0_|U|&N-ZpswsL8tknBp7)XS@7VkFwC71p0p?U2yUlrylZ9>stMxV z^11^UUN>9Ap##9?(Dgn3^mNYx)c^8`q3KVi`7?h63nugF_%2nws*9stj|88=0fs20 zrPp<1N`Mx_UW^iuUK8Ao4^p$iZCLGxYK~eqw!ThRHG|zyhl|_2McYFqdys5nZI_ZN zTiH!`*O0St_BObG79`BY7qKw4&2CWIIxvKD2J1&rYk{H;D8ki8(P7#2@~hf@6}8$B zjw7NnoT^Q!@SNEX%AQWg z0hlV~dB}T^r5%1Bv&!M!d51fGZvJnn;a^}vwY_TO$v~>WLvm5fLpll`~TTKy#%9^nG2xWakU1iHene6X= z4i+}6bqBP{sulJc_AZ6qZA~vgf1T*`x=w`6-HM{q`U67Q47R7&wd05f)+xsNb?xd6 z-jyWDP4Ox9e1C$C#E>0xu={YF5B^Ypr2j6qldkwFaP7Y;9vR;Kk@|03e~7{f~wmBAI? z+CG6|oLa3s*b_WNZhk@@Jc!RP)#!^yo0W&uh%*}JwWLEI!YYh3k7|KvOdR>s^!S8c zo!G%=4yEajuk~kIQA{sN$snBNQ6*FSnL1rU9lM4M9i3ftF#X{mbJ0P3-JX861c#C^ z&4@KJ#fS_my^}I3Hcl?3Q1nKtqHS_12&L~^HV-?hl1d9g4Z9Zhx%zpQNa>&C&pgq; zWwZPn@XS8Xlef9LkImEm@7VlRul~HvlLz$X#Q#^8dE5LdSZU)bz9ELBF%H?!V<6UH zsrFfcrQbb1`XH7`$47r4cT4Uc%Kebse-za=%>eqvU?2+{eoO zYPpY-`*^uel>4=EpDg$5?s4Y$KC1p3%te{|A#;3^U(eIE_PxycF}&EEM(VF- z?k48uGskZi>$zaDuVpUB+*szGW9|~>zQ-KSZ5*%v6?4OwI}Jm)Z7?TscLY0-dTiDV zo7l~wO~(WZWL=Y zp1DcPjbd&NbDv`F4(3Xkt7h&L=9-y1hMrZQX6|>)J;t2H+*8cG%iK4Z+lyQ<9*@PR z1?ELpS2s4)1{$KxspR;;+*l+LSQ|^l1Ibu(LrtJ27EM++L<3{4854-b17ofjgYA}P zy)Bgt#OeY~k)~LDZD37(BpOJ@*WxeCf;Z5dTHe@@s7GlcQN1EE-sPIp*bs>(1JPKL z!lRLzWTbWg<~&nXJeG{r#2Nz;TCK=yVogn{XhThPk}B6UBIc%H3NDGxMP zuWgJ~qml`j77H|1$Hk)23D>HEy5t4i8;OHF5?uk|%0t79_;SYqi=x%b8zZc3tQnQB zYXETh=)~oD{+k?Bf$G56nb%%7b=>4hQ^rl6G9|ElZ8DO$Y5=B4Q*&}{zAUe@Hj<3Q z@rOPmfkeXt5jKQZzx$Ux!)OR9uLfCDGYo86m4xS2BP8pqlki+)quX57PJ;zvQQ?WM zkQy=;s-v}mNJ~Q!))b0gjXylv0Q%91Ks*(VvN-^G|GsEobnSTcZ`d%SeEj6`<&%v? zjEiZ3LQzY~>I3z$L~?0hN!iN4%1ERc(YZQ8usP5ii%Y?(z^Yh+sQA*rgJrtn4+Y8^ z1Gq(bYjUcwE>M24f5y1Fwl@Fi~Zosk()KKe@4CMg0lrQh^lywrjMyDFXFXh~`9MO)Or!bYRJ4Y}7K< zg_o2m$ms++WmQxGoas1JA>tAC`4fq6j>lTo1`@HFm5H)cyfJS`VQZF^@y}PI$pi56 zH1TsFS&v{%C0E24CX^6i0|AX7Wy?=!Xb$MM7$3mjk!2xAp*VW~n)-$sc0@#eU3E>w zX)21;5uG0tFpk9#mp#;XrjWMwnWTlpN=14w|3_@d|k&dLBgAA|^2&c-#SHu-=W=6N{m@>r#zkmm1CM zT^Fm7l>#>Az?*xERe?n>cZ`ubU{`jo^+)Fk)+` zgDW0u3M7)X4bgGZSTq7-8pelsb<%Ad5gw^VkTk**BB}|Zv=nz9Km)MBrMwd5(!A9z z4Na*gSgN|C!=wzpJ$7fHe8RQkg(V6W37G0YG=;%)>;w5};wpzvD4RhUjU>@qSIX#h zqEIQHI(3pTRe=euySkw^f+{+_Juo&N!FYl(Do}a*!i9lJJ`OpKyAt)WRAX&mc?5025h0>HmH>&jar$i= zx)l8g_Ns}Kap+DiQq3eau@9+X3T@)78PJJXr4$JAesG7t6Z_#VFeREJH4SxZrCFW1 z2|l4o;yMUbs|no^CD`?11aU>>@|#l~W#wt)>Ph8X|LAOaq31MKjFu4(Hq2pO92dzo;d||N<@<5(4q|e z{^aUKlM_m^$bc_tpK^mpBj1p-XYa3+vei zsb)%$emU&UNF-37Og2NUJ9&(c#aB#_K@n?o_Cy*h?Bg*j55s^T7~>MlQc+FWV>o0a zATZ@!ykj=2#sIuR_vrkP3`fbHpqRi}{W|5-0<&YBzGQ2`kaEJKDTQg2;eiTaY07bi zW??{Z*4pkqg=KmJQlKJlqZ3w{Ex2jk&Ee2(l|f^) z=TG9Z@`Z>55DwXRbd0)&6?w-xf=%#XoIOBMA zeu{v16E*P$go;cO?()iUPgOjIEg4n{k)+-hN;h@_rl{1d2xHNyBx*A{F}fDFhep?y zjZPT(M%2S&VC-nwuaz|$Wo7Juj&|%(u(eDzaS&GHrgk%l^t2?=?S`-u)8C@&vfiybXYszq&O`D~QcAwKK9@jrAu_m5UlGBOi#VlJ#{Nm(E666JXtnuHL2r z^g69w=z&U?ud+Wr@7`C9B(iMNAz2oMey*-vBg*aq2IGn>-OBX3&Q;N;q(7AyB%SqO zfvI`{XE@6{N2=p7N2|+S7z5HfXh6$ahf^%YI-!s-;0y<{hQP+Tu${_Qp@vuzxk6SA zz|RF!K?RChnC0HKRSzPJvN+_cMU+vNKwh=CbmX!mV3|Bz?a2YOt10G0`tu8UJ~tXO zIxz+l9G@&U$V0yYpC~&1)}y@aCiU2_gmCWQ4u+2-IcDQ|B&WUFn(8=qmNl_B=TkhP zEL(`$pk8=TP=<#MZj~0Euu6*Igr3zT$_0O;O)1#q%s8$^oDch(F&x4|Yw#zy5Ls(n z?y3Q}ow=-tyI@b@3Ms%2AP`Q*Lqfd;DQNoqL!=^sT-*0wHxc&NV%Q}bjTIkSR9Wdn zuV+8mes&G?49^5xU8lzQXMTz;K2;mcShL)qwEf&Y&8fl z?ktZb+zE40bY(QQCaTvy(nYZD$Zs5+N-c`IYka-)aK<966Y`I*osJ`8P<}a9fL0G6 zxVYenJH8r|pEt!D8l%0`FnGM2*NqE>MDl}?Jp-Jj!Yz1;`I~2#}3pVH}e zoqk)V-8y|kr+an!u1+nT{!XXIbb1Po4bZ?+oqkHEqjWl6r&D!0Tc?jNQhZ<1={B8y zQ>QQKbeB%|==5hgJ*d;)==7*g2Wh*`(CK+P4e0c0ole&2Or3^wdWTN$(`lVfn|1nt zPUq`-+@;fHI{l1JlRAA^r)@fYOs7xk^eZ~05AkYEet&agpJX`cfs-CM>4B3TIO&0t z9ysZNlO8zffs-CM>4B3T_#fwivo0UI>^juy?20h|>-y@NmEoHDmEjdBJeo6ZkC$#% z_}WN3-fTDk&eS2#|1BFVspVmw#EQg?)_u;7vt)C8tVje~EN*Nz;u8hLp~ITywbVe| zR0oIGJ`S!z84{Hj>~#({q_D1eb=3`xlu!kHbu!k#{9@$mY8v^p2GBA>kyst`^~~d) zK!QLs0UrD#&_Y0|BG_6&n1>_?wP{G?Z59CUR>ktI0wp7jVnsV4$d5!6^S^$F`TC0Og8vm9ZzoBxr!N5>ph`2a zcwhg;IMUR(Tm&gK2MWn*`QMJm)>42~RN|g6U}5h-h2dfaM++%&vM?+U+ER!fID1e* zEm_(SZ4d{v^(}H<9Ds3iQE6;NAI)2fNn)b1y)T+Ek2ir3yRF|s#n@3;=6wee)^AY~ zVcmM2g|yMg8cOdj#Nx=6%doq!2v6a|@)Q%nAE}XW+tY`Fhjb}+U%w@N{BfX=Og*r4 z47Q32lX17#_7)ZOHSK62h4cJ7+`PsS-#WOUo%xj3DQX*xZjkSOn+c-#Io)C_VFYDO zy$m7k4%j4(xlMz$Dx5krD7J@%p;M!9s70DUgV7o#V7G>oG38`}sYD}Azk%8)2^&7+ zlyFmhIMNcSNhKrUdW;Jg<>ogTReZ-EHo8j0b}->ctg)|z;mh8NBL~L&CF%`&*!Wcm zpU)bD)`pGya2m__d5JMZzmay^$#}LTe~c%OeZEA$lF6gKRnq8*cl@tvgN^pf@EC?y)H99!JV@=BDD-8^V9Z2vdxZLY+3xtlklcE*7m@9mG{A!Pey z9lpTkl8V+Ln|-~fbdKOu~7t@hzN06z0PpyB-*{;h@&X!v8oc$RKy__&4-Y4|jsD(}^B zsfLegc%+7nxYBo-hKFkSN)4Z(;qe+S)$ny19--kG8a`LU3p6}Z!;3W>&@f}kUxJ7I z__4m{;o@I{=pChCxJ}^A__mJavosvIMZvdg_`ppHj%c_vsNmHaZr1YB8m@pM%G>0? zBNY6E1LK7R%iA^F4igFQ&~O#nm+%iYY-oP|2}0W6tjm9|;XNZ2J(=)Nx)6$t(~98p zi{Q~k@RTC><|6psA~;e6$BN)o5xlMlP8Y%G4+ZxBLlOK$5&SPj@H0j5^F{EEBDkvv zexnF}y9oYS5&XV_aaX@%Meqo;ghHwE$wlzZMex!hxU~rWry}^PMewUd@ViCuZ;Id{ zc;V%>?}8$DW)WOj1XmZq4;8_mD}ujX1oJ~Dul}DF!H0`rKgJ&~{S^vEt<>+DB6xBU zd_xgDw+NnJ1oKOJ=yT;SD}oz};8jKN+9LQen0Yy_D{zg%H5wPcCA=EfHMqv%;+QlZ z*92S>ah2n`7S|+Pd|x>Q7xy5a#x)h!^|+?tnvUxRT>LXRGjZLBs{+?7T(fb_!8I2b zhAsocnQ=2NOlihETo~>QOd0&IjEqWL3vk_rs|pv#z&mi=iHomF@v6_b3m0CU8H;i8 zj{w|@3%?2sqsACqm{g7bsdWt);eOURSgZ4sFTJ2~SMEh z?K{h*u&k(LwW6|W0fRjfR!re0Y#G%@XZeK?k^QZih%ZOoQHi^a><3@4z4Mei8%HlHzhmqd>o%k81Uw|( zJz^1BHitzxXIJP&dzQz2q{pzGE1-=v>kVLEY$55uTRsmb_j(>MAL{wdeDUtiL#~6= zE1@`Ui!0>W$aw@|%cSEuuNP;t3U-wq^5Q+4r^wx`IlDA>d* literal 0 HcmV?d00001 diff --git a/src/libs/mosquitto/client/mosquitto_sub b/src/libs/mosquitto/client/mosquitto_sub new file mode 100755 index 0000000000000000000000000000000000000000..9e2109c431e82e76c3e4d5a2dbc2f5b98c482dec GIT binary patch literal 37212 zcmeHw4R}=5x$X`SMf{oAQvYh}6iLCK2_T>dQUfwND8a~&;tw5$$%I6bnPFxE!HNwG z)5AE7O|3t)_1M(oRoY@tTE&xEp;0NM*0#~wUV6$sMWuF+4?QQfmV=hcecx}by=U*q zg!bI$x%auxc`{G-UhDhT_qV?Ft-rn3On&~sA3i+UFe*kGM#l)lFwVqPdy-*f3@>tq zaW1X^u3)f!&UOCV{EKcR*8Qn)gJmJg*$={CaEX7}5;uwP$K5zX!?4Y$)E6m&!BnI@ z#hm(-%Bw#Ql|fN-mMSMaO4CX*%II){!C*4gwlZm>O6Bcds^nd&D`~+N!)PrJE|ZUv z7i@~O#3Kn{O648CS;-qkXX8UyXBA?Qec@y((Hvc+N(adsSf=FdJxdV~c79y4Q4kEa zMb|Y)8-mTz#+bnF_UHkURb`v=L%39iDpB`hyUv@lWR9Z*?I$j)(m1PqHOzKJ%t_ml zA{dOe1e5DqSH@a`@l*nEd3lyN#s~SW5B-0c1t1LuSH&D*GDuz(_-Wrcnul0VW&LS_X?N1hEOV0M3mOIXN|H?i!%tH=o1WvW38>Rs6|sM?|CiH z*%zGcYU#1~i~WAV{Dn98=gqhJY=>@Fucidd&m9~%@L@fjvc_RtnaqL?!x)WZG*V}X zt^m9ZMjhR381-PJO>C2CZgy;A7uDu*Y}qc;KpV8K;kt z>tYKg4xfprDfzllap#A6R^Vb8>v+Z}da1&gv@{t>BqyzmMDGl>Hb*DL65*x@dVFY7 zG7+Xx$w{rT}?@(tqfu@L#kAY{sW?(H{Y{mlx?p8fNUU-4@9Cp}>C-sd=Q0XXZzwdVwKo)``OHwinYq-B4zD z?t{5TuJRZ>LuXh1NnBKSFt?HAvnt;L?8$r-`Ms5|ArH+Pj+%=_+T%)Ede4gGFL^F7 zbiCGD@tR$F*d3Mqf$+P5^oPZ$91m*|mHW_0&)rVh`O}XfZ^rTX-Lh1oGQHt2tU%-= z(oEbDX>bc8Z5sejo{#IN^k(5TbQRzOxojs;fiS%{_En;C^T(S5phG+{W*AszVJ8Et z4wRx`GkOGD;$gveM4_N0(cwDLFsA8;$rJ-$KDHzeC=<6*`=5>4&ZT%GUFQ zY<2}Wb8UxNhg=n``h-;Y6?9KV6*|-`zv;=d$&0M#E7spa1NqoPbJMnf`Jhy(Pc#<$ z;=jOUMP}VM7J?ZZ-w}>If%G0n{U-y3JSvFDI!9aE&xY~v50JtVEf2pyt z#&f}Dm}IDU+IYAZ*+727u|U4yElX4XFd0ari(5MQQ}{PZ6q$t^vW zt2;U`=YKEjKMabGDTV^U&~F{|+E36{0~9+ktp*y14K=f_NN= zw-n+vL39D}nnD~G#3Mkwpb*p0X|n!pKy)j_GC@25#Mc$#Zb5Vcai2o`iy*cFu|Xl; z6a-_gMIpvsO`)5CxLqOU3Zesu>lLDrh|JvxM&K@2xDA49SGaKs_g%rI6z&X#`=#LG z3irV@srj3NYf-qj74C@OniTFeg}btrdK(mOx58}@+zN&Jmco5SaCa!&Lkjn_;Fc-e zCWZS~!7Wj^sKT8zhdSyN?ly%xUvLW)?plSLC%AyZU8Zm;!Oc^+PXd?C)B*@>+|z3q zM!Eh~TR{h8&H>f;F}Y)eJ%+nsEjspPs!&2qZYjoAE<^SOvO5hRIj82CG0()>Ae%W2 z+4L^nF~oCJ4di!GthorUm{q|DPX;f04byuJ1Meq=Wcquxpv+bNasiVWXwIi``XHM* z_Tlm4um#o`g|#rudtc_ z$T21Z)-}v#4ibI4G~Z788TDjE%#q{D_+u*Qj%4Cu-e$gPh7WK1pvbfhl7YJJ{UU0g zLXAIKL@iXP(4UK_HG*;(a6jaigaZ!=KT6TXNk`$YT`5l~O z9>y)bp$|m|P+`w~XM;sW(DQs0dni0SxhqPTPEJ**b6V{_GumVNQzDEEPGAn5<+awHgepuT0~sKdMcR9X zee|h=D!b2oSd@U#-i4G?qIMw;C0$M>i-%GoR8Vr6r6kwW14eUP5$+@Wks{nrcm!e9 zP@W6s71uAL=#a{Pzm5r86PvkRy?;RVx}rEi$+fd zIChG!U~K|(uM=}QWL2YJU*;9ivae#!MXumEiJgu1W3aBBdITz6Z>E5%-Ip0L|^aZiCxSa%x?^Zc#>vEo4%o4>u7A~`XqK<3$f5ewNhB#A9L@6EZOqlO58o0$J17&%lzyh;?q43yr?Me&5(XOLKN#0qwom_ z+XT(FceAK43hOw^B4@@!@YvguvCLlnkV_GxkGri&!siIQyQ z4l>*aOimauZvi1IC2?xuPEKo@aX!ehnPngVhV152C8`&B%Yq&$mT}084>sgX7~)cO zDrnFfDI$<=Z-=c|FFP=CY}xgovH<%~^qY6*GGV{zpXly4OCY4c#ef!gq+=^&;UUkE zB5Rb$uiGLwl!&aS$W=v=u(1g?qU%~pfLQ?>u}HQsYBQ~S3l9Op=-IZ0k3&N?vw(8J zqPsX&w67Nh+`A|*(N*-Uleij{~o>a)Q#QgNn!zgnuDkG!Kr)a60AVh*sX@bm7+JfgmbtWc|EBibd z6rgU?=PLi)P)mM#{2~}=Ew}yq3lD3}xw-@C7dZ1keZTp3HOZF_WaoOBr0>Gh)2*tN z{R11@z39ex&W7ojD$Z0YOvE)*z{-JKy%(B(2qCtn*9$&qk~SzlczO9_WN}sdt;IvUBT;M$`^A;vpKb7t~_J^DqJr z)2tzP8tBV;x&cgx?KflvPEY?3W4c}cR|>weHr)*(@${x{dXvt6j=2g?9$N>x_i80K ztK^D%@!&xoPAzw8=qvmL>+li}e-@|`507Q#3g8?nu#QXzL7yhboGxbh2lm!3t0;^a zEUur_Up;}i?~!1=C9VhJ;7klLmB;tSe*vz>gsg>P$R`)V&8rD}E19U#93J(~alGP%T&rz&1~mZ*E^d{(Rr zED|NBK_Xfk6NpimJDB)F5+^nB<}%&6k_3w^X$=rlu8Q&)Cs%nl*2~H@w~ceS=J`S& zhBUUfyIvK=dYw}Y{2EPbzre^(|Nb->@l%K#DmK1Gf*qP5^A+Vq?BzHOSj~4gXwZE7 zxdfIW=UG(O?g%}F@z7hYZtE3am(6#Nlkb_rVGKZn>sAe8RGW<`R&AjsbyV#JTK+C1 z4plWD30~C%j;dikvugI(RH@mAvV>$8Kj3xLth;bM)RwE+zbU@GHs9k;z8!^+l&#qf zuti7X=wj8PRmuyFsyz$w=GiBx+BOm#fli6kC(&x9wu=@B&BewijBoW_N7; z07SGhJ9jLTjdzW8O%5xR(4SykX-^Jg;kn10vL7#0L3T-x>%jEN=5|!{3f7}W*P~n~ zI+p~eTNPb`iaN%c&nbcKv4#(55UiId`(W59PQ$ti>ogO_j1dr5_}v+UtorU{P`V9l zLq*n?Nw7{6WPa+lN(*#b#TPZO>OonqG0>7&z}a2sk-{6WqFfVBg(mPVxA|r{`L-3l zsjYW6;hP}RfhN;;AlE*_{B;poi)I*r11jhMTvRO&G7c18#q?0pNQdB2GYf7Bwy+`} zv@Ur;`Tc2GJFtdd!dAwv;RA)^TCm&Fg&(k|-)y6$GDC0h%7v}Tvwn@=~a-f+EpIO6;>+PJ#&Dok6h1{;o=lp z&@=W9Wzz3t0;WkXeca)kErlsCsU&i?oI1!q+o^fCWlISrl3<%A7;+&#TABSK zW*IdrcAe*NQAgnn?GJ~^ScoqNkqY?nOwxCaH#}R>iD?7kbNmR;eF!Qp6MsF4$jX&U zK8thp0K3MuBGGBfI>1UGQW0v$=+|tupx>{r6*#_Np;U(g( zsWLq=V$VFc*c_R5KF7IR^PxwN1XE$x=s`|;0)vA2kKi0CHnx!9ZcUJR3?ry(*w)6} zsm7KkWb~#no6m6=!#90}|A2C}3E993xMLfE(hrXG(UG3aELFejmB__PWC{IPzRC4E zb?_xhA*Up_C8gwrqnA z>_xMZVIW)2(z!AZ-_PQ}3vZ5;mv+B0KWdw|sk5wcqb!2l{feM%Aa|eW;FDIoIUDtE zvH!n*l5(zN(b4Hc6Mi4|4%Nm95^U21nTyfJj@{x(Czo&X>%oNX`m~G+Z1OLipdKnHrjsD835GOu ztTOZ|=`W0e+*pU9eAQk!qLsT1om4cmsc7iQgAFw?&Y6FKR2rK3{16U%RgH$#wjCp# zb}XYE(Xw_t2|Detb`?JD?dGF4a#M#=s8@?CF^-lv@*ip6?UsFehOlpwvX9SRRfC2< z>hKef8Wet}WxM_K3DD8L?4~Uc&0P99<}iz%DG1D>Jw#w4okm1{`VytVeq3>Va@!?qG&vm>5jI#qffX zUtB}$Y2z)V2=kZ(5u>NhY2O0c*P~^-z4A|>bB-Ygl%P*5K{Vb$FXQ!};4Qo6Jf2bb zY+1<Pr*Vm$4m z&MEYQm1i+KkUGy};vrodPD0{J--FjOo4<%+yrk!{ALw{or5$9;zMz0w3{gwXc{yt= zFz4NS?^cx0!OM;8%Yp0*e$TT%HlKwZGOEuOi99>Zqmx+QvkECh0;=#AsR{esug`!2 z|3ULyhxs_)>roK`>)P=`W^+(v+19O42Guv2b5E#kywaApwXGIy`^|47wfdv~^};tC z;&bsk%x|F>&VcqG_Miv`_Iozp>L3c_x>-Ooa-F?87szet)7b^Nj(%j#&x^i8=?#Za z35-XEIR%(p-JxvVF`f;DVJakdqrOzB{GaZ{5snwl>B>r!z=A%uryQdk{C-57Rrx4( zlg0A{JPH)Z?%Xf${N!Mee$04=P%BKXeY81=l}-1K!Gh3?olX(E6z|D++atL&p5bNY zi-Cf0y_5PJS{5yOktk=2o(vh;43E&5^N`&qC!$zAb&jTRJx4z4t+zG<&rNi$b~MjI zi0wF3mhYjMJguUIxjgMzked&pOgFRH{B}}&_cVQQAcWmNDj))KJ4pg23c+~;Qf5bS zQ#TXj+05gB3*U2iL+bem5IqKNI6I8DzM$Eg;oUH=1(${L{|D44=Vo_pLvbMcpV`a< z$e6z+S-N)wu9IMjD$HzQk$SYSllef!-s~T<`PZ2Z?_y%Udn#?;DK5`~_3v>0hu9jy z`8%qa(E0a5MmDpV;`Slybbberg`ct&2RT2ylLo*=`;oxw?UL+@OR}?xW!d}+BxV3Y zi zUI$5f7w>r6_ajvuvZ?+fdnhSA!;`rlrRJAT!B-P_Y67Eae&+xc%rNhzm$0llhslFP zF345>;6lTgpPPYh1{kjVGC1|?{;Nb!|Qeh(`C_twE>Wr z&SY@&A1qu#M1Fejr--jy2X!)yE;ZqRn_!qdBRo==gcZX+{|?I5-((4d`Bjz;2N52f z=3hV!pfhmgK2Lg+Pv$?tiOGDHe}{fmmw*F~_@Bf9hA7QQZ|KF8 zAnTH4C;{mu{vBEW_MCq^R{MeQQS+^nL8iNE*53B1AA}{vgamcPmkpQOqKFH)gwxh9 zAPnc1xG}n(5oFC!WkWu$G}|GM3d&{@vXy_`%8tsCpmK|?tWlK7{_cO#9yF`D2wG*; z3VV&hUWM*6XSvY-Omuof4?K8_qUbUIf>6%-yV4uFaKr=a6l3FtE{=|#`#w#Q{Pa$x z{uHG?x0K(UI7Ft5>;rGN1pNxQ0(v6Go30sBLv)5*9frY;9Qx2)h;{)vA_DByAO}K- z1!f>CYf%hiKpARRrFs~KM6hh=HsjEODlqajuHU>v;rfcWJ~N0Mlx?#ZFf?}Lntvj^O zf0*1k|KVBwL!SJ#YV^gU&AP*C^sUBWd+E@Ju?i#2RxJ>Xi6eiS9^c+lCw4r$PpeA5 zf0-xKfns`5N=D!;k1Cn&$u#N`>exGKbaig&q4YZ=vP%!;mL5*OSb;-Hm}bNpnPNnS znSOyXYVVy^MWN`8X6=?~RUnkUZx(piQI*u05NZ?}V4tm@XNi>lsh-SN%Ud?bvl;Vv zk*8>LXpqe_|L@rRZKwXC&C`bT=H&lZmO0z}B3N0#ReD1VNn;!?dKtkIFqR_k`S2a$hU=cDdgr_q*kOkK8-tzDe$EzT?$jkoy+7 z-z)d6a=%aRopQfl?tDXZy!s)zZMOd*uF{+@F{GZn^i$oo}{|SMQPgUfd01LH-jT!)|2G;^WnoNIRP* zBAg3vBgmWPGk1WwCgxsa?u*RzG51a8b~Cq^xo4O=#N4--;}P=$M%3d??6`%8n5$)O zD|12SHZhlDj_;kCzQ*F^BUR$D7_^ZVYoOs+hw=Sfg+RJB_9bnd7#k=?doFWbOv$xV>r$G50g( z)-$(&)iR#<3_S+KXdmm_j~42%pGBl$9q%GQ^u|3Z=a3np;}DwgPV|CbZF2piRZ%&0%jS+Te}j7ll(^ z)ZeR}k@PmFyopFS(!4g3tbvi%Z;pz>wfKqB=2+B=+9leeQT!UQ7m)LpNMU4+`WrLG zm{K#XX38{UDZMlSspFTC7)yRXUH6icRtr0P2?a<_H-ZuOQY&6sw0Y|+z9!e(H#S#t6 zhvx9Hm3^u`p+ul~Xnjj8gtk?wXqN)G(Q>7tOhi(l=IDvU#}l#k_1lu$y1Z3i@>mTf+%IqucouJPgrXIY4Tl1ju{ zyz82p!%bd;&(`WGa@3SUn=1VjN2sh(sG`qTK=3HASM98VJ*UH+hk0xJGHvND&ZeN0$jT z!dBgJD2=90u)}bIEnS2(Ku9DiRyIUdwiR_tX%kANH`7bnD;zzLt?|x_G=|z*Qc2=l zVi>tdBy7!KYi=MOLF8?WC6uf6*yLh#HD1sgipSxDNCSq9RFhbaW)H(}kSC(&v(kw4 zC>p8Q1W*1*u%jB z0~baM#0gp%Ez*!YakVd>EZhrOo0vBmL#s8Q4pFp4gE!WQaSRm!Gs!J_KEs91M3^e0mxP9AC| z#GI8vJVjI>sL=uXQY!RQ;FY*k!wmw>IlI(&>q6_jDAFga&NUIhX?jXf zqk=t%-h#>FQfshHqNU-am8$AipTtNQLO{eCt$I19+_q?>9qwXd7Y9m=t2N&FjncnX zp?j)PRt!>2kA9Arx)dGYu1F$QPHsyix(Xwau98~Gz?ZboQ9Vv)Grc#(7VEB1rg9Ey z9nBac8@*!IrQX)iYS(~9cOU>cCq~r3=bT;OjcCFA zIn%rN#%pd^Je|P{aOt8240Vcw&8;(CE|9r)deh8FlWw;H{PvmFNU^+jImdgh5P;}@u?^bdlpr-7vp5p*Hl{N2NGeZF#HVEncf>!Pj8Jt zEc=~C&yTLf7}vl#4AU}x{~mKNCh(x1z>9=jJ1?7eUGSP47hXI6x?teOIzN`%MZ1G& z5jTR$EwUO+6phWR29pmiAlogW1edupy-U@6jjD0lO`#8ooVJ8=Xak1tFcui=FXc?h zDOwXqKj3;y9GyrRUaP_qZdT9KA-NL1iN;jKt5B1IV&xq%YK8I8Jht%*G1sZN)rur+ z8={y*tN;-!(JPCJZjH5J1jhoTIN<8&W*aqn*P}dyuqaO1Sbf=Zv~E*dh&8H)bO&OD zSQ{Onpw?c@SnjD$#ITHOGZ-GVylzbHB~3?u5R#ECyinw zS_`;|)v~bj#SNd2-NDk1{YNOVs;!knq8i1tn@OZ6iDowGp!gL6Vd1uIjNzMO%bYWW zOuYlSu;G%NWAPQF~wG5H?b_+e9@=7``TG=4fVV#$K?z%Slusq8Yr+4K`=9 z40qU**#clK7kHR85E)z*uZmy*#4f>ZFCUo7wlLybg{y8~-+WQ#Q=2_or$d=5K)|jj zOQfuZ6nlqjOIbaH5jLe;N=fq;shk1V0!_&jHZ?x3XboR0U>yjy-qs=XS^?wsK%LE3 zSB|eW)Xsk+)Y81FiNjZEV@08#&q8b?d^ZDwaYYtVKE2AaRSYUArxJstwK{W|s+UuS zwb-(xTCrkE4yw^ujv$Y?@!asno} z7e&=CTqsAE#iDwZpN?(-PZW(AtS!d z=B^)tyEtLX#>5(vT#tHeAuj9?0y&S`8v<9;>*q(#uvG%N(k@>&5%#xY*e0r$`BJN~ zqSvv;E~$rVniDAg+uuekL-z#5CNPQa43q~psNR9uc({YlX3fddy8IFX9$d|doE zQ@lkm>hZRNN1b{7a4By1Fh3I4Y2d69ZeoiWflhFH6R(r0^RP~j=+s!I@MCm3R;QoT z=|r7grqio*daX|Db$Xjl8+01gX}eB0>2#}3kKL^Fo}}%l(&>3R9k0_GozBqdT%9h^ z>CHM_q0>8cn$qb#I^Ckv`*r$=PM^?ew@#na=^mZ_OsD&G`jEE2OQ+w`=`%XrtVN~um^@cFzkV04-9)?*aO2J81}%h2ZlW`?15nq413`3^}w0qCa$;) z#2={*@?Y2EI9xE?v^uz|4bS6@n-W!>3f~Y(B;tkz;DH0($9|kL zlut#cHXt!kB;(CYB#{axQcunu}AEm55%wCd=@AdTDHWYNev*0IZt#Vb!+?sj((o}CBf*&`w}g5#xN z?sikCr-YVSJtc*ygxxcGONs_d?i)m*PL@(@{}5$^YP{b~sEo%uf7p*o;&nKL9dy%J zPq%~dbyhu0HwB-;T15jR5bMQ`bd+EsV#j{RNWcihaFc3N3v89>>eOI^3bt(;6ek6R zp-ZE1fP|)Q*I+cP1axaS6=P%QPestEG%ACwO~FWeB;1yY1e+pwTc0pywHjB)6UMU@ z3}GJO#jye7w-xFwc+fah!AGpd$n`n#F^iRVh+m4yIbza5WXYeByIM5W70~W?FE99`A9p%QJ5n%ZY z2)q5b4d6KUNT@b4BkWlH-UytmTNQ~$aC#wP;Flvtpl(6q!4W)XXzT`Tb?WUScy_^f z3L*ywM8}BQgD3T#)KSqjvipqwn*Nc< zk34uP{B;iwVDoF;wUg9y+lMvmtyA#R8a5Uym`?UoRN=1RvjjGbIKH#QXP-U|S4~v# z91VA&+AP0G!z%&`j%c{^S_QAw@BqHtL;AFayT>UwOBfH@pT{@ z2TI`EO5oNKxV;2Um%!N)_)8`5S4!Zn68Omyn7{9VKfAuqmcabA0cSbCc;SS9Q3C&_ z1V%`b9)Ifd*An<+(CjRqUIGV7VE!12lfJD4&X&MkCGhhl@arWoe?;9W|6IJRal#Wz z;HygDTT0;85_n??{74D>-4gg0CGbEAd@A~@)4mH7j9RGAgc5ji3C!;gg5RdEErA0i z@RAbvjuJRh0=JgH_?Z|3U+FZ);=(U085~c}#)aPqkoRZk)&{z&f$nK|aeWHcI9wOv z8jp+L0mRT_Ou&U9$G8aB#kelPbtx{6M>V)Gycv^mO~J)=^;BGZ_ck5Z<+!fEH3Qd` zxMt#-h3hI@vvFa3H?GE2i)#+9xwx*uH4m2`7ltn5I$ZeFo`V~{!(?E%G5)*M&1(e9 z%*Xm`HhLzumz^bOnXVi-nb9oRIqO+Cds4&^mf}2*1v%#QpnZZL*)m__A<{Kl6ESG! zC$h{$uhv0&5(iK+i(?z+*en53i$P=@8zco;TO&ZOO%Y-DcF2WMdpkj?ZJo->rcUjc zti6)8OVaxzy)&}6M8QVxg@TQ06J+gvnA+PO0^ILd8=awdI3*?a)}{>JwMB50Tbmgt zs=T!CtzZa1`152x|jj?;NZxgQQsMGvy|M zskJ*`p4$SZvL9fE8-YO&FRXzF!`Wlt@N`;>I9Of4Ry4H{kmy4P0u< G=YInL+>rDD literal 0 HcmV?d00001 diff --git a/src/libs/mosquitto/client/pub_client.c b/src/libs/mosquitto/client/pub_client.c new file mode 100644 index 0000000..c8ca981 --- /dev/null +++ b/src/libs/mosquitto/client/pub_client.c @@ -0,0 +1,447 @@ +/* +Copyright (c) 2009-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + + +#include +#include +#include +#include +#include +#ifndef WIN32 +#include +#else +#include +#include +#define snprintf sprintf_s +#endif + +#include +#include "client_shared.h" + +#define STATUS_CONNECTING 0 +#define STATUS_CONNACK_RECVD 1 +#define STATUS_WAITING 2 + +/* Global variables for use in callbacks. See sub_client.c for an example of + * using a struct to hold variables for use in callbacks. */ +static char *topic = NULL; +static char *message = NULL; +static long msglen = 0; +static int qos = 0; +static int retain = 0; +static int mode = MSGMODE_NONE; +static int status = STATUS_CONNECTING; +static int mid_sent = 0; +static int last_mid = -1; +static int last_mid_sent = -1; +static bool connected = true; +static char *username = NULL; +static char *password = NULL; +static bool disconnect_sent = false; +static bool quiet = false; + +void my_connect_callback(struct mosquitto *mosq, void *obj, int result) +{ + int rc = MOSQ_ERR_SUCCESS; + + if(!result){ + switch(mode){ + case MSGMODE_CMD: + case MSGMODE_FILE: + case MSGMODE_STDIN_FILE: + rc = mosquitto_publish(mosq, &mid_sent, topic, msglen, message, qos, retain); + break; + case MSGMODE_NULL: + rc = mosquitto_publish(mosq, &mid_sent, topic, 0, NULL, qos, retain); + break; + case MSGMODE_STDIN_LINE: + status = STATUS_CONNACK_RECVD; + break; + } + if(rc){ + if(!quiet){ + switch(rc){ + case MOSQ_ERR_INVAL: + fprintf(stderr, "Error: Invalid input. Does your topic contain '+' or '#'?\n"); + break; + case MOSQ_ERR_NOMEM: + fprintf(stderr, "Error: Out of memory when trying to publish message.\n"); + break; + case MOSQ_ERR_NO_CONN: + fprintf(stderr, "Error: Client not connected when trying to publish.\n"); + break; + case MOSQ_ERR_PROTOCOL: + fprintf(stderr, "Error: Protocol error when communicating with broker.\n"); + break; + case MOSQ_ERR_PAYLOAD_SIZE: + fprintf(stderr, "Error: Message payload is too large.\n"); + break; + } + } + mosquitto_disconnect(mosq); + } + }else{ + if(result && !quiet){ + fprintf(stderr, "%s\n", mosquitto_connack_string(result)); + } + } +} + +void my_disconnect_callback(struct mosquitto *mosq, void *obj, int rc) +{ + connected = false; +} + +void my_publish_callback(struct mosquitto *mosq, void *obj, int mid) +{ + last_mid_sent = mid; + if(mode == MSGMODE_STDIN_LINE){ + if(mid == last_mid){ + mosquitto_disconnect(mosq); + disconnect_sent = true; + } + }else if(disconnect_sent == false){ + mosquitto_disconnect(mosq); + disconnect_sent = true; + } +} + +void my_log_callback(struct mosquitto *mosq, void *obj, int level, const char *str) +{ + printf("%s\n", str); +} + +int load_stdin(void) +{ + long pos = 0, rlen; + char buf[1024]; + char *aux_message = NULL; + + mode = MSGMODE_STDIN_FILE; + + while(!feof(stdin)){ + rlen = fread(buf, 1, 1024, stdin); + aux_message = realloc(message, pos+rlen); + if(!aux_message){ + if(!quiet) fprintf(stderr, "Error: Out of memory.\n"); + free(message); + return 1; + } else + { + message = aux_message; + } + memcpy(&(message[pos]), buf, rlen); + pos += rlen; + } + msglen = pos; + + if(!msglen){ + if(!quiet) fprintf(stderr, "Error: Zero length input.\n"); + return 1; + } + + return 0; +} + +int load_file(const char *filename) +{ + long pos, rlen; + FILE *fptr = NULL; + + fptr = fopen(filename, "rb"); + if(!fptr){ + if(!quiet) fprintf(stderr, "Error: Unable to open file \"%s\".\n", filename); + return 1; + } + mode = MSGMODE_FILE; + fseek(fptr, 0, SEEK_END); + msglen = ftell(fptr); + if(msglen > 268435455){ + fclose(fptr); + if(!quiet) fprintf(stderr, "Error: File \"%s\" is too large (>268,435,455 bytes).\n", filename); + return 1; + }else if(msglen == 0){ + fclose(fptr); + if(!quiet) fprintf(stderr, "Error: File \"%s\" is empty.\n", filename); + return 1; + }else if(msglen < 0){ + fclose(fptr); + if(!quiet) fprintf(stderr, "Error: Unable to determine size of file \"%s\".\n", filename); + return 1; + } + fseek(fptr, 0, SEEK_SET); + message = malloc(msglen); + if(!message){ + fclose(fptr); + if(!quiet) fprintf(stderr, "Error: Out of memory.\n"); + return 1; + } + pos = 0; + while(pos < msglen){ + rlen = fread(&(message[pos]), sizeof(char), msglen-pos, fptr); + pos += rlen; + } + fclose(fptr); + return 0; +} + +void print_usage(void) +{ + int major, minor, revision; + + mosquitto_lib_version(&major, &minor, &revision); + printf("mosquitto_pub is a simple mqtt client that will publish a message on a single topic and exit.\n"); + printf("mosquitto_pub version %s running on libmosquitto %d.%d.%d.\n\n", VERSION, major, minor, revision); + printf("Usage: mosquitto_pub [-h host] [-k keepalive] [-p port] [-q qos] [-r] {-f file | -l | -n | -m message} -t topic\n"); +#ifdef WITH_SRV + printf(" [-A bind_address] [-S]\n"); +#else + printf(" [-A bind_address]\n"); +#endif + printf(" [-i id] [-I id_prefix]\n"); + printf(" [-d] [--quiet]\n"); + printf(" [-M max_inflight]\n"); + printf(" [-u username [-P password]]\n"); + printf(" [--will-topic [--will-payload payload] [--will-qos qos] [--will-retain]]\n"); +#ifdef WITH_TLS + printf(" [{--cafile file | --capath dir} [--cert file] [--key file]\n"); + printf(" [--ciphers ciphers] [--insecure]]\n"); +#ifdef WITH_TLS_PSK + printf(" [--psk hex-key --psk-identity identity [--ciphers ciphers]]\n"); +#endif +#endif +#ifdef WITH_SOCKS + printf(" [--proxy socks-url]\n"); +#endif + printf(" mosquitto_pub --help\n\n"); + printf(" -A : bind the outgoing socket to this host/ip address. Use to control which interface\n"); + printf(" the client communicates over.\n"); + printf(" -d : enable debug messages.\n"); + printf(" -f : send the contents of a file as the message.\n"); + printf(" -h : mqtt host to connect to. Defaults to localhost.\n"); + printf(" -i : id to use for this client. Defaults to mosquitto_pub_ appended with the process id.\n"); + printf(" -I : define the client id as id_prefix appended with the process id. Useful for when the\n"); + printf(" broker is using the clientid_prefixes option.\n"); + printf(" -k : keep alive in seconds for this client. Defaults to 60.\n"); + printf(" -l : read messages from stdin, sending a separate message for each line.\n"); + printf(" -m : message payload to send.\n"); + printf(" -M : the maximum inflight messages for QoS 1/2..\n"); + printf(" -n : send a null (zero length) message.\n"); + printf(" -p : network port to connect to. Defaults to 1883.\n"); + printf(" -P : provide a password (requires MQTT 3.1 broker)\n"); + printf(" -q : quality of service level to use for all messages. Defaults to 0.\n"); + printf(" -r : message should be retained.\n"); + printf(" -s : read message from stdin, sending the entire input as a message.\n"); +#ifdef WITH_SRV + printf(" -S : use SRV lookups to determine which host to connect to.\n"); +#endif + printf(" -t : mqtt topic to publish to.\n"); + printf(" -u : provide a username (requires MQTT 3.1 broker)\n"); + printf(" -V : specify the version of the MQTT protocol to use when connecting.\n"); + printf(" Can be mqttv31 or mqttv311. Defaults to mqttv31.\n"); + printf(" --help : display this message.\n"); + printf(" --quiet : don't print error messages.\n"); + printf(" --will-payload : payload for the client Will, which is sent by the broker in case of\n"); + printf(" unexpected disconnection. If not given and will-topic is set, a zero\n"); + printf(" length message will be sent.\n"); + printf(" --will-qos : QoS level for the client Will.\n"); + printf(" --will-retain : if given, make the client Will retained.\n"); + printf(" --will-topic : the topic on which to publish the client Will.\n"); +#ifdef WITH_TLS + printf(" --cafile : path to a file containing trusted CA certificates to enable encrypted\n"); + printf(" communication.\n"); + printf(" --capath : path to a directory containing trusted CA certificates to enable encrypted\n"); + printf(" communication.\n"); + printf(" --cert : client certificate for authentication, if required by server.\n"); + printf(" --key : client private key for authentication, if required by server.\n"); + printf(" --ciphers : openssl compatible list of TLS ciphers to support.\n"); + printf(" --tls-version : TLS protocol version, can be one of tlsv1.2 tlsv1.1 or tlsv1.\n"); + printf(" Defaults to tlsv1.2 if available.\n"); + printf(" --insecure : do not check that the server certificate hostname matches the remote\n"); + printf(" hostname. Using this option means that you cannot be sure that the\n"); + printf(" remote host is the server you wish to connect to and so is insecure.\n"); + printf(" Do not use this option in a production environment.\n"); +# ifdef WITH_TLS_PSK + printf(" --psk : pre-shared-key in hexadecimal (no leading 0x) to enable TLS-PSK mode.\n"); + printf(" --psk-identity : client identity string for TLS-PSK mode.\n"); +# endif +#endif +#ifdef WITH_SOCKS + printf(" --proxy : SOCKS5 proxy URL of the form:\n"); + printf(" socks5h://[username[:password]@]hostname[:port]\n"); + printf(" Only \"none\" and \"username\" authentication is supported.\n"); +#endif + printf("\nSee http://mosquitto.org/ for more information.\n\n"); +} + +int main(int argc, char *argv[]) +{ + struct mosq_config cfg; + struct mosquitto *mosq = NULL; + int rc; + int rc2; + char *buf; + int buf_len = 1024; + int buf_len_actual; + int read_len; + int pos; + + buf = malloc(buf_len); + if(!buf){ + fprintf(stderr, "Error: Out of memory.\n"); + return 1; + } + + memset(&cfg, 0, sizeof(struct mosq_config)); + rc = client_config_load(&cfg, CLIENT_PUB, argc, argv); + if(rc){ + client_config_cleanup(&cfg); + if(rc == 2){ + /* --help */ + print_usage(); + }else{ + fprintf(stderr, "\nUse 'mosquitto_pub --help' to see usage.\n"); + } + return 1; + } + + topic = cfg.topic; + message = cfg.message; + msglen = cfg.msglen; + qos = cfg.qos; + retain = cfg.retain; + mode = cfg.pub_mode; + username = cfg.username; + password = cfg.password; + quiet = cfg.quiet; + + if(cfg.pub_mode == MSGMODE_STDIN_FILE){ + if(load_stdin()){ + fprintf(stderr, "Error loading input from stdin.\n"); + return 1; + } + }else if(cfg.file_input){ + if(load_file(cfg.file_input)){ + fprintf(stderr, "Error loading input file \"%s\".\n", cfg.file_input); + return 1; + } + } + + if(!topic || mode == MSGMODE_NONE){ + fprintf(stderr, "Error: Both topic and message must be supplied.\n"); + print_usage(); + return 1; + } + + + mosquitto_lib_init(); + + if(client_id_generate(&cfg, "mosqpub")){ + return 1; + } + + mosq = mosquitto_new(cfg.id, true, NULL); + if(!mosq){ + switch(errno){ + case ENOMEM: + if(!quiet) fprintf(stderr, "Error: Out of memory.\n"); + break; + case EINVAL: + if(!quiet) fprintf(stderr, "Error: Invalid id.\n"); + break; + } + mosquitto_lib_cleanup(); + return 1; + } + if(cfg.debug){ + mosquitto_log_callback_set(mosq, my_log_callback); + } + mosquitto_connect_callback_set(mosq, my_connect_callback); + mosquitto_disconnect_callback_set(mosq, my_disconnect_callback); + mosquitto_publish_callback_set(mosq, my_publish_callback); + + if(client_opts_set(mosq, &cfg)){ + return 1; + } + rc = client_connect(mosq, &cfg); + if(rc) return rc; + + if(mode == MSGMODE_STDIN_LINE){ + mosquitto_loop_start(mosq); + } + + do{ + if(mode == MSGMODE_STDIN_LINE){ + if(status == STATUS_CONNACK_RECVD){ + pos = 0; + read_len = buf_len; + while(fgets(&buf[pos], read_len, stdin)){ + buf_len_actual = strlen(buf); + if(buf[buf_len_actual-1] == '\n'){ + buf[buf_len_actual-1] = '\0'; + rc2 = mosquitto_publish(mosq, &mid_sent, topic, buf_len_actual-1, buf, qos, retain); + if(rc2){ + if(!quiet) fprintf(stderr, "Error: Publish returned %d, disconnecting.\n", rc2); + mosquitto_disconnect(mosq); + } + break; + }else{ + buf_len += 1024; + pos += 1023; + read_len = 1024; + buf = realloc(buf, buf_len); + if(!buf){ + fprintf(stderr, "Error: Out of memory.\n"); + return 1; + } + } + } + if(feof(stdin)){ + last_mid = mid_sent; + status = STATUS_WAITING; + } + }else if(status == STATUS_WAITING){ + if(last_mid_sent == last_mid && disconnect_sent == false){ + mosquitto_disconnect(mosq); + disconnect_sent = true; + } +#ifdef WIN32 + Sleep(100); +#else + usleep(100000); +#endif + } + rc = MOSQ_ERR_SUCCESS; + }else{ + rc = mosquitto_loop(mosq, -1, 1); + } + }while(rc == MOSQ_ERR_SUCCESS && connected); + + if(mode == MSGMODE_STDIN_LINE){ + mosquitto_loop_stop(mosq, false); + } + + if(message && mode == MSGMODE_FILE){ + free(message); + } + mosquitto_destroy(mosq); + mosquitto_lib_cleanup(); + + if(rc){ + fprintf(stderr, "Error: %s\n", mosquitto_strerror(rc)); + } + return rc; +} diff --git a/src/libs/mosquitto/client/sub_client.c b/src/libs/mosquitto/client/sub_client.c new file mode 100644 index 0000000..3c6c225 --- /dev/null +++ b/src/libs/mosquitto/client/sub_client.c @@ -0,0 +1,277 @@ +/* +Copyright (c) 2009-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include +#include +#include +#include +#include +#ifndef WIN32 +#include +#else +#include +#include +#define snprintf sprintf_s +#endif + +#include +#include "client_shared.h" + +bool process_messages = true; +int msg_count = 0; + +void my_message_callback(struct mosquitto *mosq, void *obj, const struct mosquitto_message *message) +{ + struct mosq_config *cfg; + int i; + bool res; + + if(process_messages == false) return; + + assert(obj); + cfg = (struct mosq_config *)obj; + + if(message->retain && cfg->no_retain) return; + if(cfg->filter_outs){ + for(i=0; ifilter_out_count; i++){ + mosquitto_topic_matches_sub(cfg->filter_outs[i], message->topic, &res); + if(res) return; + } + } + + if(cfg->verbose){ + if(message->payloadlen){ + printf("%s ", message->topic); + fwrite(message->payload, 1, message->payloadlen, stdout); + if(cfg->eol){ + printf("\n"); + } + }else{ + if(cfg->eol){ + printf("%s (null)\n", message->topic); + } + } + fflush(stdout); + }else{ + if(message->payloadlen){ + fwrite(message->payload, 1, message->payloadlen, stdout); + if(cfg->eol){ + printf("\n"); + } + fflush(stdout); + } + } + if(cfg->msg_count>0){ + msg_count++; + if(cfg->msg_count == msg_count){ + process_messages = false; + mosquitto_disconnect(mosq); + } + } +} + +void my_connect_callback(struct mosquitto *mosq, void *obj, int result) +{ + int i; + struct mosq_config *cfg; + + assert(obj); + cfg = (struct mosq_config *)obj; + + if(!result){ + for(i=0; itopic_count; i++){ + mosquitto_subscribe(mosq, NULL, cfg->topics[i], cfg->qos); + } + }else{ + if(result && !cfg->quiet){ + fprintf(stderr, "%s\n", mosquitto_connack_string(result)); + } + } +} + +void my_subscribe_callback(struct mosquitto *mosq, void *obj, int mid, int qos_count, const int *granted_qos) +{ + int i; + struct mosq_config *cfg; + + assert(obj); + cfg = (struct mosq_config *)obj; + + if(!cfg->quiet) printf("Subscribed (mid: %d): %d", mid, granted_qos[0]); + for(i=1; iquiet) printf(", %d", granted_qos[i]); + } + if(!cfg->quiet) printf("\n"); +} + +void my_log_callback(struct mosquitto *mosq, void *obj, int level, const char *str) +{ + printf("%s\n", str); +} + +void print_usage(void) +{ + int major, minor, revision; + + mosquitto_lib_version(&major, &minor, &revision); + printf("mosquitto_sub is a simple mqtt client that will subscribe to a single topic and print all messages it receives.\n"); + printf("mosquitto_sub version %s running on libmosquitto %d.%d.%d.\n\n", VERSION, major, minor, revision); + printf("Usage: mosquitto_sub [-c] [-h host] [-k keepalive] [-p port] [-q qos] [-R] -t topic ...\n"); + printf(" [-C msg_count] [-T filter_out]\n"); +#ifdef WITH_SRV + printf(" [-A bind_address] [-S]\n"); +#else + printf(" [-A bind_address]\n"); +#endif + printf(" [-i id] [-I id_prefix]\n"); + printf(" [-d] [-N] [--quiet] [-v]\n"); + printf(" [-u username [-P password]]\n"); + printf(" [--will-topic [--will-payload payload] [--will-qos qos] [--will-retain]]\n"); +#ifdef WITH_TLS + printf(" [{--cafile file | --capath dir} [--cert file] [--key file]\n"); + printf(" [--ciphers ciphers] [--insecure]]\n"); +#ifdef WITH_TLS_PSK + printf(" [--psk hex-key --psk-identity identity [--ciphers ciphers]]\n"); +#endif +#endif +#ifdef WITH_SOCKS + printf(" [--proxy socks-url]\n"); +#endif + printf(" mosquitto_sub --help\n\n"); + printf(" -A : bind the outgoing socket to this host/ip address. Use to control which interface\n"); + printf(" the client communicates over.\n"); + printf(" -c : disable 'clean session' (store subscription and pending messages when client disconnects).\n"); + printf(" -C : disconnect and exit after receiving the 'msg_count' messages.\n"); + printf(" -d : enable debug messages.\n"); + printf(" -h : mqtt host to connect to. Defaults to localhost.\n"); + printf(" -i : id to use for this client. Defaults to mosquitto_sub_ appended with the process id.\n"); + printf(" -I : define the client id as id_prefix appended with the process id. Useful for when the\n"); + printf(" broker is using the clientid_prefixes option.\n"); + printf(" -k : keep alive in seconds for this client. Defaults to 60.\n"); + printf(" -N : do not add an end of line character when printing the payload.\n"); + printf(" -p : network port to connect to. Defaults to 1883.\n"); + printf(" -P : provide a password (requires MQTT 3.1 broker)\n"); + printf(" -q : quality of service level to use for the subscription. Defaults to 0.\n"); + printf(" -R : do not print stale messages (those with retain set).\n"); +#ifdef WITH_SRV + printf(" -S : use SRV lookups to determine which host to connect to.\n"); +#endif + printf(" -t : mqtt topic to subscribe to. May be repeated multiple times.\n"); + printf(" -T : topic string to filter out of results. May be repeated.\n"); + printf(" -u : provide a username (requires MQTT 3.1 broker)\n"); + printf(" -v : print published messages verbosely.\n"); + printf(" -V : specify the version of the MQTT protocol to use when connecting.\n"); + printf(" Can be mqttv31 or mqttv311. Defaults to mqttv31.\n"); + printf(" --help : display this message.\n"); + printf(" --quiet : don't print error messages.\n"); + printf(" --will-payload : payload for the client Will, which is sent by the broker in case of\n"); + printf(" unexpected disconnection. If not given and will-topic is set, a zero\n"); + printf(" length message will be sent.\n"); + printf(" --will-qos : QoS level for the client Will.\n"); + printf(" --will-retain : if given, make the client Will retained.\n"); + printf(" --will-topic : the topic on which to publish the client Will.\n"); +#ifdef WITH_TLS + printf(" --cafile : path to a file containing trusted CA certificates to enable encrypted\n"); + printf(" certificate based communication.\n"); + printf(" --capath : path to a directory containing trusted CA certificates to enable encrypted\n"); + printf(" communication.\n"); + printf(" --cert : client certificate for authentication, if required by server.\n"); + printf(" --key : client private key for authentication, if required by server.\n"); + printf(" --ciphers : openssl compatible list of TLS ciphers to support.\n"); + printf(" --tls-version : TLS protocol version, can be one of tlsv1.2 tlsv1.1 or tlsv1.\n"); + printf(" Defaults to tlsv1.2 if available.\n"); + printf(" --insecure : do not check that the server certificate hostname matches the remote\n"); + printf(" hostname. Using this option means that you cannot be sure that the\n"); + printf(" remote host is the server you wish to connect to and so is insecure.\n"); + printf(" Do not use this option in a production environment.\n"); +#ifdef WITH_TLS_PSK + printf(" --psk : pre-shared-key in hexadecimal (no leading 0x) to enable TLS-PSK mode.\n"); + printf(" --psk-identity : client identity string for TLS-PSK mode.\n"); +#endif +#endif +#ifdef WITH_SOCKS + printf(" --proxy : SOCKS5 proxy URL of the form:\n"); + printf(" socks5h://[username[:password]@]hostname[:port]\n"); + printf(" Only \"none\" and \"username\" authentication is supported.\n"); +#endif + printf("\nSee http://mosquitto.org/ for more information.\n\n"); +} + +int main(int argc, char *argv[]) +{ + struct mosq_config cfg; + struct mosquitto *mosq = NULL; + int rc; + + rc = client_config_load(&cfg, CLIENT_SUB, argc, argv); + if(rc){ + client_config_cleanup(&cfg); + if(rc == 2){ + /* --help */ + print_usage(); + }else{ + fprintf(stderr, "\nUse 'mosquitto_sub --help' to see usage.\n"); + } + return 1; + } + + mosquitto_lib_init(); + + if(client_id_generate(&cfg, "mosqsub")){ + return 1; + } + + mosq = mosquitto_new(cfg.id, cfg.clean_session, &cfg); + if(!mosq){ + switch(errno){ + case ENOMEM: + if(!cfg.quiet) fprintf(stderr, "Error: Out of memory.\n"); + break; + case EINVAL: + if(!cfg.quiet) fprintf(stderr, "Error: Invalid id and/or clean_session.\n"); + break; + } + mosquitto_lib_cleanup(); + return 1; + } + if(client_opts_set(mosq, &cfg)){ + return 1; + } + if(cfg.debug){ + mosquitto_log_callback_set(mosq, my_log_callback); + mosquitto_subscribe_callback_set(mosq, my_subscribe_callback); + } + mosquitto_connect_callback_set(mosq, my_connect_callback); + mosquitto_message_callback_set(mosq, my_message_callback); + + rc = client_connect(mosq, &cfg); + if(rc) return rc; + + + rc = mosquitto_loop_forever(mosq, -1, 1); + + mosquitto_destroy(mosq); + mosquitto_lib_cleanup(); + + if(cfg.msg_count>0 && rc == MOSQ_ERR_NO_CONN){ + rc = 0; + } + if(rc){ + fprintf(stderr, "Error: %s\n", mosquitto_strerror(rc)); + } + return rc; +} + diff --git a/src/libs/mosquitto/cmake_install.cmake b/src/libs/mosquitto/cmake_install.cmake new file mode 100644 index 0000000..99b91e1 --- /dev/null +++ b/src/libs/mosquitto/cmake_install.cmake @@ -0,0 +1,62 @@ +# Install script for directory: /Users/benjamin/orchestra/src/libs/mosquitto + +# Set the install prefix +if(NOT DEFINED CMAKE_INSTALL_PREFIX) + set(CMAKE_INSTALL_PREFIX "/usr/local") +endif() +string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") + +# Set the install configuration name. +if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) + if(BUILD_TYPE) + string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" + CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") + else() + set(CMAKE_INSTALL_CONFIG_NAME "") + endif() + message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") +endif() + +# Set the component getting installed. +if(NOT CMAKE_INSTALL_COMPONENT) + if(COMPONENT) + message(STATUS "Install component: \"${COMPONENT}\"") + set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") + else() + set(CMAKE_INSTALL_COMPONENT) + endif() +endif() + +# Is this installation the result of a crosscompile? +if(NOT DEFINED CMAKE_CROSSCOMPILING) + set(CMAKE_CROSSCOMPILING "FALSE") +endif() + +if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" OR NOT CMAKE_INSTALL_COMPONENT) + file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/etc/mosquitto" TYPE FILE FILES + "/Users/benjamin/orchestra/src/libs/mosquitto/mosquitto.conf" + "/Users/benjamin/orchestra/src/libs/mosquitto/aclfile.example" + "/Users/benjamin/orchestra/src/libs/mosquitto/pskfile.example" + "/Users/benjamin/orchestra/src/libs/mosquitto/pwfile.example" + ) +endif() + +if(NOT CMAKE_INSTALL_LOCAL_ONLY) + # Include the install script for each subdirectory. + include("/Users/benjamin/orchestra/src/libs/mosquitto/lib/cmake_install.cmake") + include("/Users/benjamin/orchestra/src/libs/mosquitto/client/cmake_install.cmake") + include("/Users/benjamin/orchestra/src/libs/mosquitto/src/cmake_install.cmake") + include("/Users/benjamin/orchestra/src/libs/mosquitto/man/cmake_install.cmake") + +endif() + +if(CMAKE_INSTALL_COMPONENT) + set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt") +else() + set(CMAKE_INSTALL_MANIFEST "install_manifest.txt") +endif() + +string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT + "${CMAKE_INSTALL_MANIFEST_FILES}") +file(WRITE "/Users/benjamin/orchestra/src/libs/mosquitto/${CMAKE_INSTALL_MANIFEST}" + "${CMAKE_INSTALL_MANIFEST_CONTENT}") diff --git a/src/libs/mosquitto/compiling.txt b/src/libs/mosquitto/compiling.txt new file mode 100644 index 0000000..44af79b --- /dev/null +++ b/src/libs/mosquitto/compiling.txt @@ -0,0 +1,19 @@ +The following packages are required for mosquitto: + +* tcp-wrappers (optional, package name libwrap0-dev) +* openssl (version 1.0.0 or greater if TLS-PSK support is needed, can be disabled) +* c-ares (for DNS-SRV support, can be disabled) +* libuuid (from e2fsprogs, can be disabled) +* On Windows, the Redhat pthreads library is required if threading support is + to be included. + +To compile, run "make", but also see the file config.mk for more details on the +various options that can be compiled in. + +Where possible use the Makefiles to compile. This is particularly relevant for +the client libraries as symbol information will be included. Use cmake to +compile on Windows or Mac. + +If you have any questions, problems or suggestions (particularly related to +installing on a more unusual device like a plug-computer) then please get in +touch using the details in readme.txt. diff --git a/src/libs/mosquitto/config.h b/src/libs/mosquitto/config.h new file mode 100644 index 0000000..6af5c28 --- /dev/null +++ b/src/libs/mosquitto/config.h @@ -0,0 +1,30 @@ +/* ============================================================ + * Control compile time options. + * ============================================================ + * + * Compile time options have moved to config.mk. + */ + + +/* ============================================================ + * Compatibility defines + * + * Generally for Windows native support. + * ============================================================ */ +#if defined(_MSC_VER) && _MSC_VER < 1900 +# define snprintf sprintf_s +# define EPROTO ECONNABORTED +#endif + +#ifdef WIN32 +# ifndef strcasecmp +# define strcasecmp strcmpi +# endif +#define strtok_r strtok_s +#define strerror_r(e, b, l) strerror_s(b, l, e) +#endif + + +#define uthash_malloc(sz) _mosquitto_malloc(sz) +#define uthash_free(ptr,sz) _mosquitto_free(ptr) + diff --git a/src/libs/mosquitto/config.mk b/src/libs/mosquitto/config.mk new file mode 100644 index 0000000..71f17e5 --- /dev/null +++ b/src/libs/mosquitto/config.mk @@ -0,0 +1,255 @@ +# ============================================================================= +# User configuration section. +# +# These options control compilation on all systems apart from Windows and Mac +# OS X. Use CMake to compile on Windows and Mac. +# +# Largely, these are options that are designed to make mosquitto run more +# easily in restrictive environments by removing features. +# +# Modify the variable below to enable/disable features. +# +# Can also be overriden at the command line, e.g.: +# +# make WITH_TLS=no +# ============================================================================= + +# Uncomment to compile the broker with tcpd/libwrap support. +#WITH_WRAP:=yes + +# Comment out to disable SSL/TLS support in the broker and client. +# Disabling this will also mean that passwords must be stored in plain text. It +# is strongly recommended that you only disable WITH_TLS if you are not using +# password authentication at all. +WITH_TLS:=yes + +# Comment out to disable TLS/PSK support in the broker and client. Requires +# WITH_TLS=yes. +# This must be disabled if using openssl < 1.0. +WITH_TLS_PSK:=yes + +# Comment out to disable client client threading support. +WITH_THREADING:=yes + +# Comment out to remove bridge support from the broker. This allow the broker +# to connect to other brokers and subscribe/publish to topics. You probably +# want to leave this included unless you want to save a very small amount of +# memory size and CPU time. +WITH_BRIDGE:=yes + +# Comment out to remove persistent database support from the broker. This +# allows the broker to store retained messages and durable subscriptions to a +# file periodically and on shutdown. This is usually desirable (and is +# suggested by the MQTT spec), but it can be disabled if required. +WITH_PERSISTENCE:=yes + +# Comment out to remove memory tracking support from the broker. If disabled, +# mosquitto won't track heap memory usage nor export '$SYS/broker/heap/current +# size', but will use slightly less memory and CPU time. +WITH_MEMORY_TRACKING:=yes + +# Compile with database upgrading support? If disabled, mosquitto won't +# automatically upgrade old database versions. +# Not currently supported. +#WITH_DB_UPGRADE:=yes + +# Comment out to remove publishing of the $SYS topic hierarchy containing +# information about the broker state. +WITH_SYS_TREE:=yes + +# Build with SRV lookup support. +WITH_SRV:=yes + +# Build using libuuid for clientid generation (Linux only - please report if +# supported on your platform). +WITH_UUID:=yes + +# Build with websockets support on the broker. +WITH_WEBSOCKETS:=no + +# Use elliptic keys in broker +WITH_EC:=yes + +# Build man page documentation by default. +WITH_DOCS:=yes + +# Build with client support for SOCK5 proxy. +WITH_SOCKS:=yes + +# Build with async dns lookup support for bridges (temporary). Requires glibc. +#WITH_ADNS:=yes + +# ============================================================================= +# End of user configuration +# ============================================================================= + + +# Also bump lib/mosquitto.h, CMakeLists.txt, +# installer/mosquitto.nsi, installer/mosquitto-cygwin.nsi +VERSION=1.4.14 +TIMESTAMP:=$(shell date "+%F %T%z") + +# Client library SO version. Bump if incompatible API/ABI changes are made. +SOVERSION=1 + +# Man page generation requires xsltproc and docbook-xsl +XSLTPROC=xsltproc +# For html generation +DB_HTML_XSL=man/html.xsl + +#MANCOUNTRIES=en_GB + +UNAME:=$(shell uname -s) + +ifeq ($(UNAME),SunOS) + ifeq ($(CC),cc) + CFLAGS?=-O + else + CFLAGS?=-Wall -ggdb -O2 + endif +else + CFLAGS?=-Wall -ggdb -O2 +endif + +LIB_CFLAGS:=${CFLAGS} ${CPPFLAGS} -I. -I.. -I../lib +LIB_CXXFLAGS:=$(LIB_CFLAGS) ${CPPFLAGS} +LIB_LDFLAGS:=${LDFLAGS} + +BROKER_CFLAGS:=${LIB_CFLAGS} ${CPPFLAGS} -DVERSION="\"${VERSION}\"" -DTIMESTAMP="\"${TIMESTAMP}\"" -DWITH_BROKER +CLIENT_CFLAGS:=${CFLAGS} ${CPPFLAGS} -I../lib -DVERSION="\"${VERSION}\"" + +ifneq ($(or $(findstring $(UNAME),FreeBSD), $(findstring $(UNAME),OpenBSD)),) + BROKER_LIBS:=-lm +else + BROKER_LIBS:=-ldl -lm +endif +LIB_LIBS:= +PASSWD_LIBS:= + +ifeq ($(UNAME),Linux) + BROKER_LIBS:=$(BROKER_LIBS) -lrt -Wl,--dynamic-list=linker.syms + LIB_LIBS:=$(LIB_LIBS) -lrt +endif + +CLIENT_LDFLAGS:=$(LDFLAGS) -L../lib ../lib/libmosquitto.so.${SOVERSION} + +ifeq ($(UNAME),SunOS) + ifeq ($(CC),cc) + LIB_CFLAGS:=$(LIB_CFLAGS) -xc99 -KPIC + else + LIB_CFLAGS:=$(LIB_CFLAGS) -fPIC + endif + + ifeq ($(CXX),CC) + LIB_CXXFLAGS:=$(LIB_CXXFLAGS) -KPIC + else + LIB_CXXFLAGS:=$(LIB_CXXFLAGS) -fPIC + endif +else + LIB_CFLAGS:=$(LIB_CFLAGS) -fPIC + LIB_CXXFLAGS:=$(LIB_CXXFLAGS) -fPIC +endif + +ifneq ($(UNAME),SunOS) + LIB_LDFLAGS:=$(LIB_LDFLAGS) -Wl,--version-script=linker.version -Wl,-soname,libmosquitto.so.$(SOVERSION) +endif + +ifeq ($(UNAME),QNX) + BROKER_LIBS:=$(BROKER_LIBS) -lsocket + LIB_LIBS:=$(LIB_LIBS) -lsocket +endif + +ifeq ($(WITH_WRAP),yes) + BROKER_LIBS:=$(BROKER_LIBS) -lwrap + BROKER_CFLAGS:=$(BROKER_CFLAGS) -DWITH_WRAP +endif + +ifeq ($(WITH_TLS),yes) + BROKER_LIBS:=$(BROKER_LIBS) -lssl -lcrypto + LIB_LIBS:=$(LIB_LIBS) -lssl -lcrypto + BROKER_CFLAGS:=$(BROKER_CFLAGS) -DWITH_TLS + LIB_CFLAGS:=$(LIB_CFLAGS) -DWITH_TLS + PASSWD_LIBS:=-lcrypto + CLIENT_CFLAGS:=$(CLIENT_CFLAGS) -DWITH_TLS + + ifeq ($(WITH_TLS_PSK),yes) + BROKER_CFLAGS:=$(BROKER_CFLAGS) -DWITH_TLS_PSK + LIB_CFLAGS:=$(LIB_CFLAGS) -DWITH_TLS_PSK + CLIENT_CFLAGS:=$(CLIENT_CFLAGS) -DWITH_TLS_PSK + endif +endif + +ifeq ($(WITH_THREADING),yes) + LIB_LIBS:=$(LIB_LIBS) -lpthread + LIB_CFLAGS:=$(LIB_CFLAGS) -DWITH_THREADING +endif + +ifeq ($(WITH_SOCKS),yes) + LIB_CFLAGS:=$(LIB_CFLAGS) -DWITH_SOCKS + CLIENT_CFLAGS:=$(CLIENT_CFLAGS) -DWITH_SOCKS +endif + +ifeq ($(WITH_UUID),yes) + ifeq ($(UNAME),Linux) + BROKER_CFLAGS:=$(BROKER_CFLAGS) -DWITH_UUID + BROKER_LIBS:=$(BROKER_LIBS) -luuid + endif +endif + +ifeq ($(WITH_BRIDGE),yes) + BROKER_CFLAGS:=$(BROKER_CFLAGS) -DWITH_BRIDGE +endif + +ifeq ($(WITH_PERSISTENCE),yes) + BROKER_CFLAGS:=$(BROKER_CFLAGS) -DWITH_PERSISTENCE +endif + +ifeq ($(WITH_MEMORY_TRACKING),yes) + ifneq ($(UNAME),SunOS) + BROKER_CFLAGS:=$(BROKER_CFLAGS) -DWITH_MEMORY_TRACKING + endif +endif + +#ifeq ($(WITH_DB_UPGRADE),yes) +# BROKER_CFLAGS:=$(BROKER_CFLAGS) -DWITH_DB_UPGRADE +#endif + +ifeq ($(WITH_SYS_TREE),yes) + BROKER_CFLAGS:=$(BROKER_CFLAGS) -DWITH_SYS_TREE +endif + +ifeq ($(WITH_SRV),yes) + LIB_CFLAGS:=$(LIB_CFLAGS) -DWITH_SRV + LIB_LIBS:=$(LIB_LIBS) -lcares + CLIENT_CFLAGS:=$(CLIENT_CFLAGS) -DWITH_SRV +endif + +ifeq ($(WITH_WEBSOCKETS),yes) + BROKER_CFLAGS:=$(BROKER_CFLAGS) -DWITH_WEBSOCKETS + BROKER_LIBS:=$(BROKER_LIBS) -lwebsockets +endif + +ifeq ($(UNAME),SunOS) + BROKER_LIBS:=$(BROKER_LIBS) -lsocket -lnsl + LIB_LIBS:=$(LIB_LIBS) -lsocket -lnsl +endif + +ifeq ($(WITH_EC),yes) + BROKER_CFLAGS:=$(BROKER_CFLAGS) -DWITH_EC +endif + +ifeq ($(WITH_ADNS),yes) + BROKER_LIBS:=$(BROKER_LIBS) -lanl + BROKER_CFLAGS:=$(BROKER_CFLAGS) -DWITH_ADNS +endif + +MAKE_ALL:=mosquitto +ifeq ($(WITH_DOCS),yes) + MAKE_ALL:=$(MAKE_ALL) docs +endif + +INSTALL?=install +prefix=/usr/local +mandir=${prefix}/share/man +localedir=${prefix}/share/locale +STRIP?=strip diff --git a/src/libs/mosquitto/edl-v10 b/src/libs/mosquitto/edl-v10 new file mode 100644 index 0000000..0d500b9 --- /dev/null +++ b/src/libs/mosquitto/edl-v10 @@ -0,0 +1,31 @@ +Eclipse Distribution License - v 1.0 + +Copyright (c) 2007, Eclipse Foundation, Inc. and its licensors. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + Neither the name of the Eclipse Foundation, Inc. nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff --git a/src/libs/mosquitto/epl-v10 b/src/libs/mosquitto/epl-v10 new file mode 100644 index 0000000..190869d --- /dev/null +++ b/src/libs/mosquitto/epl-v10 @@ -0,0 +1,221 @@ +Eclipse Public License - v 1.0 + +THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC +LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM +CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. + + +1. DEFINITIONS + +"Contribution" means: + a) in the case of the initial Contributor, the initial code and + documentation distributed under this Agreement, and + + b) in the case of each subsequent Contributor: + + i) changes to the Program, and + ii) additions to the Program; + +where such changes and/or additions to the Program originate from and are +distributed by that particular Contributor. A Contribution 'originates' from a +Contributor if it was added to the Program by such Contributor itself or anyone +acting on such Contributor's behalf. Contributions do not include additions to +the Program which: (i) are separate modules of software distributed in +conjunction with the Program under their own license agreement, and (ii) are +not derivative works of the Program. + +"Contributor" means any person or entity that distributes the Program. + +"Licensed Patents " mean patent claims licensable by a Contributor which are +necessarily infringed by the use or sale of its Contribution alone or when +combined with the Program. + +"Program" means the Contributions distributed in accordance with this Agreement. + +"Recipient" means anyone who receives the Program under this Agreement, +including all Contributors. + + +2. GRANT OF RIGHTS + + a) Subject to the terms of this Agreement, each Contributor hereby grants + Recipient a non-exclusive, worldwide, royalty-free copyright license to + reproduce, prepare derivative works of, publicly display, publicly + perform, distribute and sublicense the Contribution of such Contributor, + if any, and such derivative works, in source code and object code form. + + b) Subject to the terms of this Agreement, each Contributor hereby grants + Recipient a non-exclusive, worldwide, royalty-free patent license under + Licensed Patents to make, use, sell, offer to sell, import and otherwise + transfer the Contribution of such Contributor, if any, in source code and + object code form. This patent license shall apply to the combination of the + Contribution and the Program if, at the time the Contribution is added by the + Contributor, such addition of the Contribution causes such combination to be + covered by the Licensed Patents. The patent license shall not apply to any + other combinations which include the Contribution. No hardware per se is + licensed hereunder. + + c) Recipient understands that although each Contributor grants the licenses + to its Contributions set forth herein, no assurances are provided by any + Contributor that the Program does not infringe the patent or other + intellectual property rights of any other entity. Each Contributor disclaims + any liability to Recipient for claims brought by any other entity based on + infringement of intellectual property rights or otherwise. As a condition to + exercising the rights and licenses granted hereunder, each Recipient hereby + assumes sole responsibility to secure any other intellectual property rights + needed, if any. For example, if a third party patent license is required to + allow Recipient to distribute the Program, it is Recipient's responsibility + to acquire that license before distributing the Program. + + d) Each Contributor represents that to its knowledge it has sufficient + copyright rights in its Contribution, if any, to grant the copyright license + set forth in this Agreement. + + +3. REQUIREMENTS + + A Contributor may choose to distribute the Program in object code form under + its own license agreement, provided that: + + a) it complies with the terms and conditions of this Agreement; and + + b) its license agreement: + + i) effectively disclaims on behalf of all Contributors all warranties and + conditions, express and implied, including warranties or conditions of + title and non-infringement, and implied warranties or conditions of + merchantability and fitness for a particular purpose; + + ii) effectively excludes on behalf of all Contributors all liability for + damages, including direct, indirect, special, incidental and consequential + damages, such as lost profits; + + iii) states that any provisions which differ from this Agreement are offered + by that Contributor alone and not by any other party; and + + iv) states that source code for the Program is available from such + Contributor, and informs licensees how to obtain it in a reasonable manner + on or through a medium customarily used for software exchange. + + When the Program is made available in source code form: + + a) it must be made available under this Agreement; and + + b) a copy of this Agreement must be included with each copy of the Program. + + Contributors may not remove or alter any copyright notices contained within + the Program. + + Each Contributor must identify itself as the originator of its Contribution, + if any, in a manner that reasonably allows subsequent Recipients to identify + the originator of the Contribution. + + +4. COMMERCIAL DISTRIBUTION + + Commercial distributors of software may accept certain responsibilities with + respect to end users, business partners and the like. While this license is + intended to facilitate the commercial use of the Program, the Contributor who + includes the Program in a commercial product offering should do so in a + manner which does not create potential liability for other Contributors. + Therefore, if a Contributor includes the Program in a commercial product + offering, such Contributor ("Commercial Contributor") hereby agrees to defend + and indemnify every other Contributor ("Indemnified Contributor") against any + losses, damages and costs (collectively "Losses") arising from claims, + lawsuits and other legal actions brought by a third party against the + Indemnified Contributor to the extent caused by the acts or omissions of such + Commercial Contributor in connection with its distribution of the Program in + a commercial product offering. The obligations in this section do not apply + to any claims or Losses relating to any actual or alleged intellectual + property infringement. In order to qualify, an Indemnified Contributor must: + a) promptly notify the Commercial Contributor in writing of such claim, and + b) allow the Commercial Contributor to control, and cooperate with the + Commercial Contributor in, the defense and any related settlement + negotiations. The Indemnified Contributor may participate in any such claim + at its own expense. + + For example, a Contributor might include the Program in a commercial product + offering, Product X. That Contributor is then a Commercial Contributor. If + that Commercial Contributor then makes performance claims, or offers + warranties related to Product X, those performance claims and warranties are + such Commercial Contributor's responsibility alone. Under this section, the + Commercial Contributor would have to defend claims against the other + Contributors related to those performance claims and warranties, and if a + court requires any other Contributor to pay any damages as a result, the + Commercial Contributor must pay those damages. + + +5. NO WARRANTY + + EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON + AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER + EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR + CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A + PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the + appropriateness of using and distributing the Program and assumes all risks + associated with its exercise of rights under this Agreement , including but + not limited to the risks and costs of program errors, compliance with + applicable laws, damage to or loss of data, programs or equipment, and + unavailability or interruption of operations. + + +6. DISCLAIMER OF LIABILITY + + EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY + CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION + LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE + EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY + OF SUCH DAMAGES. + + +7. GENERAL + + If any provision of this Agreement is invalid or unenforceable under + applicable law, it shall not affect the validity or enforceability of the + remainder of the terms of this Agreement, and without further action by the + parties hereto, such provision shall be reformed to the minimum extent + necessary to make such provision valid and enforceable. + + If Recipient institutes patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Program itself + (excluding combinations of the Program with other software or hardware) + infringes such Recipient's patent(s), then such Recipient's rights granted + under Section 2(b) shall terminate as of the date such litigation is filed. + + All Recipient's rights under this Agreement shall terminate if it fails to + comply with any of the material terms or conditions of this Agreement and + does not cure such failure in a reasonable period of time after becoming + aware of such noncompliance. If all Recipient's rights under this Agreement + terminate, Recipient agrees to cease use and distribution of the Program as + soon as reasonably practicable. However, Recipient's obligations under this + Agreement and any licenses granted by Recipient relating to the Program shall + continue and survive. + + Everyone is permitted to copy and distribute copies of this Agreement, but in + order to avoid inconsistency the Agreement is copyrighted and may only be + modified in the following manner. The Agreement Steward reserves the right to + publish new versions (including revisions) of this Agreement from time to + time. No one other than the Agreement Steward has the right to modify this + Agreement. The Eclipse Foundation is the initial Agreement Steward. The + Eclipse Foundation may assign the responsibility to serve as the Agreement + Steward to a suitable separate entity. Each new version of the Agreement will + be given a distinguishing version number. The Program (including + Contributions) may always be distributed subject to the version of the + Agreement under which it was received. In addition, after a new version of + the Agreement is published, Contributor may elect to distribute the Program + (including its Contributions) under the new version. Except as expressly + stated in Sections 2(a) and 2(b) above, Recipient receives no rights or + licenses to the intellectual property of any Contributor under this + Agreement, whether expressly, by implication, estoppel or otherwise. All + rights in the Program not expressly granted under this Agreement are + reserved. + + This Agreement is governed by the laws of the State of New York and the + intellectual property laws of the United States of America. No party to this + Agreement will bring a legal action under this Agreement more than one year + after the cause of action arose. Each party waives its rights to a jury trial + in any resulting litigation. + diff --git a/src/libs/mosquitto/examples/mysql_log/Makefile b/src/libs/mosquitto/examples/mysql_log/Makefile new file mode 100644 index 0000000..e8c8b2c --- /dev/null +++ b/src/libs/mosquitto/examples/mysql_log/Makefile @@ -0,0 +1,15 @@ +CFLAGS=-Wall -ggdb +LDFLAGS=../../lib/libmosquitto.so.1 -lmysqlclient + +.PHONY: all clean + +all : mosquitto_mysql_log + +mosquitto_mysql_log : mysql_log.o + ${CC} $^ -o $@ ${LDFLAGS} + +mysql_log.o : mysql_log.c + ${CC} -c $^ -o $@ ${CFLAGS} -I../../lib + +clean : + -rm -f *.o mosquitto_mysql_log diff --git a/src/libs/mosquitto/examples/mysql_log/mysql_log.c b/src/libs/mosquitto/examples/mysql_log/mysql_log.c new file mode 100644 index 0000000..565d7e9 --- /dev/null +++ b/src/libs/mosquitto/examples/mysql_log/mysql_log.c @@ -0,0 +1,118 @@ +#include +#include +#include + +#ifndef WIN32 +# include +#else +# include +# define snprintf sprintf_s +#endif + +#include +#include + +#define db_host "localhost" +#define db_username "mqtt_log" +#define db_password "password" +#define db_database "mqtt_log" +#define db_port 3306 + +#define db_query "INSERT INTO mqtt_log (topic, payload) VALUES (?,?)" + +#define mqtt_host "localhost" +#define mqtt_port 1883 + +static int run = 1; +static MYSQL_STMT *stmt = NULL; + +void handle_signal(int s) +{ + run = 0; +} + +void connect_callback(struct mosquitto *mosq, void *obj, int result) +{ +} + +void message_callback(struct mosquitto *mosq, void *obj, const struct mosquitto_message *message) +{ + MYSQL_BIND bind[2]; + + memset(bind, 0, sizeof(bind)); + + bind[0].buffer_type = MYSQL_TYPE_STRING; + bind[0].buffer = message->topic; + bind[1].buffer_type = MYSQL_TYPE_STRING; + bind[1].buffer = message->payload; + + mysql_stmt_bind_param(stmt, bind); + mysql_stmt_execute(stmt); +} + +int main(int argc, char *argv[]) +{ + MYSQL *connection; + my_bool reconnect = true; + char clientid[24]; + struct mosquitto *mosq; + int rc = 0; + + signal(SIGINT, handle_signal); + signal(SIGTERM, handle_signal); + + mysql_library_init(0, NULL, NULL); + mosquitto_lib_init(); + + connection = mysql_init(NULL); + + if(connection){ + mysql_options(connection, MYSQL_OPT_RECONNECT, &reconnect); + + connection = mysql_real_connect(connection, db_host, db_username, db_password, db_database, db_port, NULL, 0); + + if(connection){ + stmt = mysql_stmt_init(connection); + + mysql_stmt_prepare(stmt, db_query, strlen(db_query)); + + memset(clientid, 0, 24); + snprintf(clientid, 23, "mysql_log_%d", getpid()); + mosq = mosquitto_new(clientid, true, connection); + if(mosq){ + mosquitto_connect_callback_set(mosq, connect_callback); + mosquitto_message_callback_set(mosq, message_callback); + + + rc = mosquitto_connect(mosq, mqtt_host, mqtt_port, 60); + + mosquitto_subscribe(mosq, NULL, "#", 0); + + while(run){ + rc = mosquitto_loop(mosq, -1, 1); + if(run && rc){ + sleep(20); + mosquitto_reconnect(mosq); + } + } + mosquitto_destroy(mosq); + } + mysql_stmt_close(stmt); + + mysql_close(connection); + }else{ + fprintf(stderr, "Error: Unable to connect to database.\n"); + printf("%s\n", mysql_error(connection)); + rc = 1; + } + }else{ + fprintf(stderr, "Error: Unable to start mysql.\n"); + rc = 1; + } + + mysql_library_end(); + mosquitto_lib_cleanup(); + + return rc; +} + diff --git a/src/libs/mosquitto/examples/temperature_conversion/Makefile b/src/libs/mosquitto/examples/temperature_conversion/Makefile new file mode 100644 index 0000000..0f20ac4 --- /dev/null +++ b/src/libs/mosquitto/examples/temperature_conversion/Makefile @@ -0,0 +1,18 @@ +CFLAGS=-Wall -ggdb -I../../lib -I../../lib/cpp +LDFLAGS=-L../../lib ../../lib/cpp/libmosquittopp.so.1 ../../lib/libmosquitto.so.1 + +.PHONY: all clean + +all : mqtt_temperature_conversion + +mqtt_temperature_conversion : main.o temperature_conversion.o + ${CXX} $^ -o $@ ${LDFLAGS} + +main.o : main.cpp + ${CXX} -c $^ -o $@ ${CFLAGS} + +temperature_conversion.o : temperature_conversion.cpp + ${CXX} -c $^ -o $@ ${CFLAGS} + +clean : + -rm -f *.o mqtt_temperature_conversion diff --git a/src/libs/mosquitto/examples/temperature_conversion/main.cpp b/src/libs/mosquitto/examples/temperature_conversion/main.cpp new file mode 100644 index 0000000..2bd90b4 --- /dev/null +++ b/src/libs/mosquitto/examples/temperature_conversion/main.cpp @@ -0,0 +1,23 @@ +#include "temperature_conversion.h" + +int main(int argc, char *argv[]) +{ + class mqtt_tempconv *tempconv; + int rc; + + mosqpp::lib_init(); + + tempconv = new mqtt_tempconv("tempconv", "localhost", 1883); + + while(1){ + rc = tempconv->loop(); + if(rc){ + tempconv->reconnect(); + } + } + + mosqpp::lib_cleanup(); + + return 0; +} + diff --git a/src/libs/mosquitto/examples/temperature_conversion/readme.txt b/src/libs/mosquitto/examples/temperature_conversion/readme.txt new file mode 100644 index 0000000..a706a7c --- /dev/null +++ b/src/libs/mosquitto/examples/temperature_conversion/readme.txt @@ -0,0 +1,6 @@ +This is a simple example of the C++ library mosquittopp. + +It is a client that subscribes to the topic temperature/celsius which should +have temperature data in text form being published to it. It reads this data as +a Celsius temperature, converts to Farenheit and republishes on +temperature/farenheit. diff --git a/src/libs/mosquitto/examples/temperature_conversion/temperature_conversion.cpp b/src/libs/mosquitto/examples/temperature_conversion/temperature_conversion.cpp new file mode 100644 index 0000000..1fa6f55 --- /dev/null +++ b/src/libs/mosquitto/examples/temperature_conversion/temperature_conversion.cpp @@ -0,0 +1,49 @@ +#include +#include + +#include "temperature_conversion.h" +#include + +mqtt_tempconv::mqtt_tempconv(const char *id, const char *host, int port) : mosquittopp(id) +{ + int keepalive = 60; + + /* Connect immediately. This could also be done by calling + * mqtt_tempconv->connect(). */ + connect(host, port, keepalive); +}; + +mqtt_tempconv::~mqtt_tempconv() +{ +} + +void mqtt_tempconv::on_connect(int rc) +{ + printf("Connected with code %d.\n", rc); + if(rc == 0){ + /* Only attempt to subscribe on a successful connect. */ + subscribe(NULL, "temperature/celsius"); + } +} + +void mqtt_tempconv::on_message(const struct mosquitto_message *message) +{ + double temp_celsius, temp_farenheit; + char buf[51]; + + if(!strcmp(message->topic, "temperature/celsius")){ + memset(buf, 0, 51*sizeof(char)); + /* Copy N-1 bytes to ensure always 0 terminated. */ + memcpy(buf, message->payload, 50*sizeof(char)); + temp_celsius = atof(buf); + temp_farenheit = temp_celsius*9.0/5.0 + 32.0; + snprintf(buf, 50, "%f", temp_farenheit); + publish(NULL, "temperature/farenheit", strlen(buf), buf); + } +} + +void mqtt_tempconv::on_subscribe(int mid, int qos_count, const int *granted_qos) +{ + printf("Subscription succeeded.\n"); +} + diff --git a/src/libs/mosquitto/examples/temperature_conversion/temperature_conversion.h b/src/libs/mosquitto/examples/temperature_conversion/temperature_conversion.h new file mode 100644 index 0000000..4d9951f --- /dev/null +++ b/src/libs/mosquitto/examples/temperature_conversion/temperature_conversion.h @@ -0,0 +1,17 @@ +#ifndef TEMPERATURE_CONVERSION_H +#define TEMPERATURE_CONVERSION_H + +#include + +class mqtt_tempconv : public mosqpp::mosquittopp +{ + public: + mqtt_tempconv(const char *id, const char *host, int port); + ~mqtt_tempconv(); + + void on_connect(int rc); + void on_message(const struct mosquitto_message *message); + void on_subscribe(int mid, int qos_count, const int *granted_qos); +}; + +#endif diff --git a/src/libs/mosquitto/install_manifest.txt b/src/libs/mosquitto/install_manifest.txt new file mode 100644 index 0000000..4ef70db --- /dev/null +++ b/src/libs/mosquitto/install_manifest.txt @@ -0,0 +1,24 @@ +/usr/local/etc/mosquitto/mosquitto.conf +/usr/local/etc/mosquitto/aclfile.example +/usr/local/etc/mosquitto/pskfile.example +/usr/local/etc/mosquitto/pwfile.example +/usr/local/lib/libmosquitto.1.4.14.dylib +/usr/local/lib/libmosquitto.1.dylib +/usr/local/lib/libmosquitto.dylib +/usr/local/include/mosquitto.h +/usr/local/lib/libmosquittopp.1.4.14.dylib +/usr/local/lib/libmosquittopp.1.dylib +/usr/local/lib/libmosquittopp.dylib +/usr/local/include/mosquittopp.h +/usr/local/bin/mosquitto_pub +/usr/local/bin/mosquitto_sub +/usr/local/sbin/mosquitto +/usr/local/include/mosquitto_plugin.h +/usr/local/share/man/man1/mosquitto_passwd.1 +/usr/local/share/man/man1/mosquitto_pub.1 +/usr/local/share/man/man1/mosquitto_sub.1 +/usr/local/share/man/man3/libmosquitto.3 +/usr/local/share/man/man5/mosquitto.conf.5 +/usr/local/share/man/man7/mosquitto-tls.7 +/usr/local/share/man/man7/mqtt.7 +/usr/local/share/man/man8/mosquitto.8 \ No newline at end of file diff --git a/src/libs/mosquitto/installer/mosquitto-cygwin.nsi b/src/libs/mosquitto/installer/mosquitto-cygwin.nsi new file mode 100644 index 0000000..354cfca --- /dev/null +++ b/src/libs/mosquitto/installer/mosquitto-cygwin.nsi @@ -0,0 +1,137 @@ +; NSIS installer script for mosquitto + +!include "MUI.nsh" + +; For environment variable code +!include "WinMessages.nsh" +!define env_hklm 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"' + +Name "mosquitto" +!define VERSION 1.4.14 +OutFile "mosquitto-${VERSION}-install-cygwin.exe" + +InstallDir "$PROGRAMFILES\mosquitto" + +;-------------------------------- +; Installer pages +!insertmacro MUI_PAGE_WELCOME +!insertmacro MUI_PAGE_COMPONENTS +!insertmacro MUI_PAGE_DIRECTORY +!insertmacro MUI_PAGE_INSTFILES + +!define MUI_FINISHPAGE_TEXT "mosquitto has been installed on your computer.\n\nTo complete the installation you must install the dependencies described in the following readme.\n\nClick Finish to close this wizard." +!define MUI_FINISHPAGE_SHOWREADME $INSTDIR\readme-dependencies-cygwin.txt +!define MUI_FINISHPAGE_SHOWREADME_TEXT "Show dependencies readme" +!insertmacro MUI_PAGE_FINISH + +;-------------------------------- +; Uninstaller pages +!insertmacro MUI_UNPAGE_WELCOME +!insertmacro MUI_UNPAGE_CONFIRM +!insertmacro MUI_UNPAGE_INSTFILES +!insertmacro MUI_UNPAGE_FINISH + +;-------------------------------- +; Languages + +!insertmacro MUI_LANGUAGE "English" + +;-------------------------------- +; Installer sections + +Section "Files" SecInstall + SectionIn RO + SetOutPath "$INSTDIR" + ;File "c:\cygwin\bin\cygwin1.dll" + ;File "c:\cygwin\bin\cyggcc_s-1.dll" + ;File "c:\cygwin\bin\cygcrypto-1.0.0.dll" + ;File "c:\cygwin\bin\cygssl-1.0.0.dll" + ;File "c:\cygwin\bin\cygz.dll" + File "..\src\mosquitto.exe" + File "..\build\src\Release\mosquitto_passwd.exe" + File "..\build\client\Release\mosquitto_pub.exe" + File "..\build\client\Release\mosquitto_sub.exe" + File "..\build\lib\Release\mosquitto.dll" + File "..\build\lib\cpp\Release\mosquittopp.dll" + File "..\aclfile.example" + File "..\ChangeLog.txt" + File "..\mosquitto.conf" + File "..\pwfile.example" + File "..\readme.md" + File "..\readme-windows.txt" + ;File "C:\pthreads\Pre-built.2\dll\x86\pthreadVC2.dll" + ;File "C:\OpenSSL-Win32\libeay32.dll" + ;File "C:\OpenSSL-Win32\ssleay32.dll" + File "..\edl-v10" + File "..\epl-v10" + + SetOutPath "$INSTDIR\devel" + File "..\lib\mosquitto.h" + File "..\build\lib\Release\mosquitto.lib" + File "..\lib\cpp\mosquittopp.h" + File "..\build\lib\cpp\Release\mosquittopp.lib" + File "..\src\mosquitto_plugin.h" + + WriteUninstaller "$INSTDIR\Uninstall.exe" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MosquittoCygwin" "DisplayName" "Mosquitto MQTT broker" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MosquittoCygwin" "UninstallString" "$\"$INSTDIR\Uninstall.exe$\"" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MosquittoCygwin" "QuietUninstallString" "$\"$INSTDIR\Uninstall.exe$\" /S" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MosquittoCygwin" "HelpLink" "http://mosquitto.org/" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MosquittoCygwin" "URLInfoAbout" "http://mosquitto.org/" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MosquittoCygwin" "DisplayVersion" "${VERSION}" + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MosquittoCygwin" "NoModify" "1" + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MosquittoCygwin" "NoRepair" "1" + + WriteRegExpandStr ${env_hklm} MOSQUITTO_DIR $INSTDIR + SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000 +SectionEnd + +Section "Service" SecService + ExecWait '"$INSTDIR\mosquitto.exe" install' +SectionEnd + +Section "Uninstall" + ExecWait '"$INSTDIR\mosquitto.exe" uninstall' + ;Delete "$INSTDIR\cygwin1.dll" + ;Delete "$INSTDIR\cyggcc_s-1.dll" + ;Delete "$INSTDIR\cygcrypto-1.0.0.dll" + ;Delete "$INSTDIR\cygssl-1.0.0.dll" + ;Delete "$INSTDIR\cygz.dll" + Delete "$INSTDIR\mosquitto.exe" + Delete "$INSTDIR\mosquitto_passwd.exe" + Delete "$INSTDIR\mosquitto_pub.exe" + Delete "$INSTDIR\mosquitto_sub.exe" + Delete "$INSTDIR\mosquitto.dll" + Delete "$INSTDIR\mosquittopp.dll" + Delete "$INSTDIR\aclfile.example" + Delete "$INSTDIR\ChangeLog.txt" + Delete "$INSTDIR\mosquitto.conf" + Delete "$INSTDIR\pwfile.example" + Delete "$INSTDIR\readme.txt" + Delete "$INSTDIR\readme-windows.txt" + ;Delete "$INSTDIR\pthreadVC2.dll" + ;Delete "$INSTDIR\libeay32.dll" + ;Delete "$INSTDIR\ssleay32.dll" + Delete "$INSTDIR\edl-v10" + Delete "$INSTDIR\epl-v10" + + Delete "$INSTDIR\devel\mosquitto.h" + Delete "$INSTDIR\devel\mosquitto.lib" + Delete "$INSTDIR\devel\mosquittopp.h" + Delete "$INSTDIR\devel\mosquittopp.lib" + Delete "$INSTDIR\devel\mosquitto_plugin.h" + + Delete "$INSTDIR\Uninstall.exe" + RMDir "$INSTDIR" + DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MosquittoCygwin" + + DeleteRegValue ${env_hklm} MOSQUITTO_DIR + SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000 +SectionEnd + +LangString DESC_SecInstall ${LANG_ENGLISH} "The main installation." +LangString DESC_SecService ${LANG_ENGLISH} "Install mosquitto as a Windows service (needs all dependencies installed)?" +!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN + !insertmacro MUI_DESCRIPTION_TEXT ${SecInstall} $(DESC_SecInstall) + !insertmacro MUI_DESCRIPTION_TEXT ${SecService} $(DESC_SecService) +!insertmacro MUI_FUNCTION_DESCRIPTION_END diff --git a/src/libs/mosquitto/installer/mosquitto.nsi b/src/libs/mosquitto/installer/mosquitto.nsi new file mode 100644 index 0000000..7bf3162 --- /dev/null +++ b/src/libs/mosquitto/installer/mosquitto.nsi @@ -0,0 +1,163 @@ +; NSIS installer script for mosquitto + +!include "MUI2.nsh" +!include "nsDialogs.nsh" +!include "LogicLib.nsh" + +; For environment variable code +!include "WinMessages.nsh" +!define env_hklm 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"' + +Name "mosquitto" +!define VERSION 1.4.14 +OutFile "mosquitto-${VERSION}-install-win32.exe" + +InstallDir "$PROGRAMFILES\mosquitto" + +;-------------------------------- +; Installer pages +!insertmacro MUI_PAGE_WELCOME + +Page custom DependencyPage +!insertmacro MUI_PAGE_COMPONENTS +!insertmacro MUI_PAGE_DIRECTORY +!insertmacro MUI_PAGE_INSTFILES +!insertmacro MUI_PAGE_FINISH + + +;-------------------------------- +; Uninstaller pages +!insertmacro MUI_UNPAGE_WELCOME +!insertmacro MUI_UNPAGE_CONFIRM +!insertmacro MUI_UNPAGE_INSTFILES +!insertmacro MUI_UNPAGE_FINISH + +;-------------------------------- +; Languages +!insertmacro MUI_LANGUAGE "English" + +;-------------------------------- +; Installer sections + +Section "Files" SecInstall + SectionIn RO + SetOutPath "$INSTDIR" + File "..\build\src\Release\mosquitto.exe" + File "..\build\src\Release\mosquitto_passwd.exe" + File "..\build\client\Release\mosquitto_pub.exe" + File "..\build\client\Release\mosquitto_sub.exe" + File "..\build\lib\Release\mosquitto.dll" + File "..\build\lib\cpp\Release\mosquittopp.dll" + File "..\aclfile.example" + File "..\ChangeLog.txt" + File "..\mosquitto.conf" + File "..\pwfile.example" + File "..\readme.md" + File "..\readme-windows.txt" + ;File "C:\pthreads\Pre-built.2\dll\x86\pthreadVC2.dll" + ;File "C:\OpenSSL-Win32\libeay32.dll" + ;File "C:\OpenSSL-Win32\ssleay32.dll" + File "..\edl-v10" + File "..\epl-v10" + + SetOutPath "$INSTDIR\devel" + File "..\lib\mosquitto.h" + File "..\build\lib\Release\mosquitto.lib" + File "..\lib\cpp\mosquittopp.h" + File "..\build\lib\cpp\Release\mosquittopp.lib" + File "..\src\mosquitto_plugin.h" + + WriteUninstaller "$INSTDIR\Uninstall.exe" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto" "DisplayName" "Mosquitto MQTT broker" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto" "UninstallString" "$\"$INSTDIR\Uninstall.exe$\"" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto" "QuietUninstallString" "$\"$INSTDIR\Uninstall.exe$\" /S" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto" "HelpLink" "http://mosquitto.org/" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto" "URLInfoAbout" "http://mosquitto.org/" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto" "DisplayVersion" "${VERSION}" + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto" "NoModify" "1" + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto" "NoRepair" "1" + + WriteRegExpandStr ${env_hklm} MOSQUITTO_DIR $INSTDIR + SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000 +SectionEnd + +Section "Service" SecService + ExecWait '"$INSTDIR\mosquitto.exe" install' +SectionEnd + +Section "Uninstall" + ExecWait '"$INSTDIR\mosquitto.exe" uninstall' + Delete "$INSTDIR\mosquitto.exe" + Delete "$INSTDIR\mosquitto_passwd.exe" + Delete "$INSTDIR\mosquitto_pub.exe" + Delete "$INSTDIR\mosquitto_sub.exe" + Delete "$INSTDIR\mosquitto.dll" + Delete "$INSTDIR\mosquittopp.dll" + Delete "$INSTDIR\aclfile.example" + Delete "$INSTDIR\ChangeLog.txt" + Delete "$INSTDIR\mosquitto.conf" + Delete "$INSTDIR\pwfile.example" + Delete "$INSTDIR\readme.txt" + Delete "$INSTDIR\readme-windows.txt" + ;Delete "$INSTDIR\pthreadVC2.dll" + ;Delete "$INSTDIR\libeay32.dll" + ;Delete "$INSTDIR\ssleay32.dll" + Delete "$INSTDIR\edl-v10" + Delete "$INSTDIR\epl-v10" + + Delete "$INSTDIR\devel\mosquitto.h" + Delete "$INSTDIR\devel\mosquitto.lib" + Delete "$INSTDIR\devel\mosquittopp.h" + Delete "$INSTDIR\devel\mosquittopp.lib" + Delete "$INSTDIR\devel\mosquitto_plugin.h" + + Delete "$INSTDIR\Uninstall.exe" + RMDir "$INSTDIR" + DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto" + + DeleteRegValue ${env_hklm} MOSQUITTO_DIR + SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000 +SectionEnd + +LangString DESC_SecInstall ${LANG_ENGLISH} "The main installation." +LangString DESC_SecService ${LANG_ENGLISH} "Install mosquitto as a Windows service?" +!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN + !insertmacro MUI_DESCRIPTION_TEXT ${SecInstall} $(DESC_SecInstall) + !insertmacro MUI_DESCRIPTION_TEXT ${SecService} $(DESC_SecService) +!insertmacro MUI_FUNCTION_DESCRIPTION_END + +Var Dialog +Var OSSLLink +Var PTHLink + +Function DependencyPage + nsDialogs::Create 1018 + Pop $Dialog + + ${If} $Dialog == error + Abort + ${EndIf} + + ${NSD_CreateLabel} 0 0 100% 12u "OpenSSL - install 'Win32 OpenSSL vXXXXX Light' then copy dlls to the mosquitto directory" + ${NSD_CreateLink} 13u 13u 100% 12u "http://slproweb.com/products/Win32OpenSSL.html" + Pop $OSSLLink + ${NSD_OnClick} $OSSLLink OnClick_OSSL + + ${NSD_CreateLabel} 0 26u 100% 12u "pthreads - copy 'pthreadVC2.dll' to the mosquitto directory" + ${NSD_CreateLink} 13u 39u 100% 12u "ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/dll/x86/" + Pop $PTHLink + ${NSD_OnClick} $PTHLink OnClick_PTH + + !insertmacro MUI_HEADER_TEXT_PAGE "Dependencies" "This page lists packages that must be installed if not already present" + nsDialogs::Show +FunctionEnd + +Function OnClick_OSSL + Pop $0 + ExecShell "open" "http://slproweb.com/products/Win32OpenSSL.html" +FunctionEnd + +Function OnClick_PTH + Pop $0 + ExecShell "open" "ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/dll/x86/" +FunctionEnd diff --git a/src/libs/mosquitto/lib/CMakeFiles/CMakeDirectoryInformation.cmake b/src/libs/mosquitto/lib/CMakeFiles/CMakeDirectoryInformation.cmake new file mode 100644 index 0000000..8cf4b23 --- /dev/null +++ b/src/libs/mosquitto/lib/CMakeFiles/CMakeDirectoryInformation.cmake @@ -0,0 +1,16 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.10 + +# Relative path conversion top directories. +set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/Users/benjamin/orchestra/src/libs/mosquitto") +set(CMAKE_RELATIVE_PATH_TOP_BINARY "/Users/benjamin/orchestra/src/libs/mosquitto") + +# Force unix paths in dependencies. +set(CMAKE_FORCE_UNIX_PATHS 1) + + +# The C and CXX include file regular expressions for this directory. +set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") +set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") +set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) +set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) diff --git a/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/C.includecache b/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/C.includecache new file mode 100644 index 0000000..6e48765 --- /dev/null +++ b/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/C.includecache @@ -0,0 +1,588 @@ +#IncludeRegexLine: ^[ ]*[#%][ ]*(include|import)[ ]*[<"]([^">]+)([">]) + +#IncludeRegexScan: ^.*$ + +#IncludeRegexComplain: ^$ + +#IncludeRegexTransform: + +/Users/benjamin/orchestra/src/libs/mosquitto/lib/logging_mosq.c +assert.h +- +stdarg.h +- +stdio.h +- +string.h +- +mosquitto_internal.h +- +mosquitto.h +- +memory_mosq.h +- + +/Users/benjamin/orchestra/src/libs/mosquitto/lib/logging_mosq.h +mosquitto.h +- + +/Users/benjamin/orchestra/src/libs/mosquitto/lib/memory_mosq.c +config.h +- +stdlib.h +- +string.h +- +memory_mosq.h +- +malloc/malloc.h +- +malloc_np.h +- +malloc.h +- + +/Users/benjamin/orchestra/src/libs/mosquitto/lib/memory_mosq.h +stdio.h +- +sys/types.h +- + +/Users/benjamin/orchestra/src/libs/mosquitto/lib/messages_mosq.c +assert.h +- +stdlib.h +- +string.h +- +mosquitto_internal.h +- +mosquitto.h +- +memory_mosq.h +- +messages_mosq.h +- +send_mosq.h +- +time_mosq.h +- + +/Users/benjamin/orchestra/src/libs/mosquitto/lib/mosquitto.c +assert.h +- +errno.h +- +signal.h +- +stdio.h +- +string.h +- +sys/select.h +- +sys/time.h +- +unistd.h +- +winsock2.h +- +windows.h +- +mosquitto.h +- +mosquitto_internal.h +- +logging_mosq.h +- +messages_mosq.h +- +memory_mosq.h +- +mqtt3_protocol.h +- +net_mosq.h +- +read_handle.h +- +send_mosq.h +- +socks_mosq.h +- +time_mosq.h +- +tls_mosq.h +- +util_mosq.h +- +will_mosq.h +- +config.h +/Users/benjamin/orchestra/src/libs/mosquitto/lib/config.h + +/Users/benjamin/orchestra/src/libs/mosquitto/lib/mosquitto.h +stdbool.h +- + +/Users/benjamin/orchestra/src/libs/mosquitto/lib/mosquitto_internal.h +config.h +- +winsock2.h +- +openssl/ssl.h +- +time.h +- +stdlib.h +- +pthread.h +- +dummypthread.h +- +ares.h +- +stdint.h +- +stdint.h +- +mosquitto.h +/Users/benjamin/orchestra/src/libs/mosquitto/lib/mosquitto.h +time_mosq.h +/Users/benjamin/orchestra/src/libs/mosquitto/lib/time_mosq.h +netdb.h +- +uthash.h +/Users/benjamin/orchestra/src/libs/mosquitto/lib/uthash.h + +/Users/benjamin/orchestra/src/libs/mosquitto/lib/net_mosq.c +assert.h +- +errno.h +- +fcntl.h +- +stdio.h +- +string.h +- +netdb.h +- +sys/socket.h +- +unistd.h +- +winsock2.h +- +ws2tcpip.h +- +linux/in.h +- +linux/in6.h +- +sys/endian.h +- +netinet/in.h +- +netinet/in.h +- +net/netbyte.h +- +netinet/in.h +- +openssl/conf.h +- +openssl/engine.h +- +openssl/err.h +- +tls_mosq.h +- +mosquitto_broker.h +- +libwebsockets.h +- +read_handle.h +- +logging_mosq.h +- +memory_mosq.h +- +mqtt3_protocol.h +- +net_mosq.h +- +time_mosq.h +- +util_mosq.h +- +config.h +/Users/benjamin/orchestra/src/libs/mosquitto/lib/config.h + +/Users/benjamin/orchestra/src/libs/mosquitto/lib/net_mosq.h +unistd.h +- +winsock2.h +- +mosquitto_internal.h +- +mosquitto.h +- + +/Users/benjamin/orchestra/src/libs/mosquitto/lib/read_handle.c +assert.h +- +stdio.h +- +string.h +- +mosquitto.h +- +logging_mosq.h +- +memory_mosq.h +- +messages_mosq.h +- +mqtt3_protocol.h +- +net_mosq.h +- +read_handle.h +- +send_mosq.h +- +time_mosq.h +- +util_mosq.h +- + +/Users/benjamin/orchestra/src/libs/mosquitto/lib/read_handle_client.c +assert.h +- +mosquitto.h +- +logging_mosq.h +- +memory_mosq.h +- +net_mosq.h +- +read_handle.h +- + +/Users/benjamin/orchestra/src/libs/mosquitto/lib/read_handle_shared.c +assert.h +- +stdio.h +- +string.h +- +mosquitto.h +- +logging_mosq.h +- +memory_mosq.h +- +messages_mosq.h +- +mqtt3_protocol.h +- +net_mosq.h +- +read_handle.h +- +send_mosq.h +- +util_mosq.h +- +mosquitto_broker.h +- + +/Users/benjamin/orchestra/src/libs/mosquitto/lib/send_client_mosq.c +assert.h +- +string.h +- +mosquitto.h +- +logging_mosq.h +- +memory_mosq.h +- +mqtt3_protocol.h +- +net_mosq.h +- +send_mosq.h +- +util_mosq.h +- +mosquitto_broker.h +- + +/Users/benjamin/orchestra/src/libs/mosquitto/lib/send_mosq.c +assert.h +- +stdio.h +- +string.h +- +mosquitto_broker.h +- +mosquitto.h +- +mosquitto_internal.h +- +logging_mosq.h +- +mqtt3_protocol.h +- +memory_mosq.h +- +net_mosq.h +- +send_mosq.h +- +time_mosq.h +- +util_mosq.h +- + +/Users/benjamin/orchestra/src/libs/mosquitto/lib/send_mosq.h +mosquitto.h +- + +/Users/benjamin/orchestra/src/libs/mosquitto/lib/socks_mosq.c +errno.h +- +string.h +- +mosquitto_internal.h +/Users/benjamin/orchestra/src/libs/mosquitto/lib/mosquitto_internal.h +memory_mosq.h +/Users/benjamin/orchestra/src/libs/mosquitto/lib/memory_mosq.h +net_mosq.h +/Users/benjamin/orchestra/src/libs/mosquitto/lib/net_mosq.h +send_mosq.h +/Users/benjamin/orchestra/src/libs/mosquitto/lib/send_mosq.h + +/Users/benjamin/orchestra/src/libs/mosquitto/lib/srv_mosq.c +ares.h +- +arpa/nameser.h +- +stdio.h +- +string.h +- +logging_mosq.h +/Users/benjamin/orchestra/src/libs/mosquitto/lib/logging_mosq.h +memory_mosq.h +/Users/benjamin/orchestra/src/libs/mosquitto/lib/memory_mosq.h +mosquitto_internal.h +/Users/benjamin/orchestra/src/libs/mosquitto/lib/mosquitto_internal.h +mosquitto.h +/Users/benjamin/orchestra/src/libs/mosquitto/lib/mosquitto.h + +/Users/benjamin/orchestra/src/libs/mosquitto/lib/thread_mosq.c +config.h +- +unistd.h +- +mosquitto_internal.h +- +net_mosq.h +- + +/Users/benjamin/orchestra/src/libs/mosquitto/lib/time_mosq.c +mach/mach.h +- +mach/mach_time.h +- +windows.h +- +unistd.h +- +time.h +- +mosquitto.h +/Users/benjamin/orchestra/src/libs/mosquitto/lib/mosquitto.h +time_mosq.h +/Users/benjamin/orchestra/src/libs/mosquitto/lib/time_mosq.h + +/Users/benjamin/orchestra/src/libs/mosquitto/lib/time_mosq.h + +/Users/benjamin/orchestra/src/libs/mosquitto/lib/tls_mosq.c +winsock2.h +- +ws2tcpip.h +- +arpa/inet.h +- +sys/socket.h +- +string.h +- +openssl/conf.h +- +openssl/x509v3.h +- +openssl/ssl.h +- +mosquitto_broker.h +/Users/benjamin/orchestra/src/libs/mosquitto/lib/mosquitto_broker.h +mosquitto_internal.h +/Users/benjamin/orchestra/src/libs/mosquitto/lib/mosquitto_internal.h +tls_mosq.h +/Users/benjamin/orchestra/src/libs/mosquitto/lib/tls_mosq.h + +/Users/benjamin/orchestra/src/libs/mosquitto/lib/tls_mosq.h +openssl/ssl.h +- + +/Users/benjamin/orchestra/src/libs/mosquitto/lib/util_mosq.c +assert.h +- +string.h +- +winsock2.h +- +aclapi.h +- +io.h +- +lmcons.h +- +sys/stat.h +- +mosquitto.h +- +memory_mosq.h +- +net_mosq.h +- +send_mosq.h +- +time_mosq.h +- +tls_mosq.h +- +util_mosq.h +- +mosquitto_broker.h +- +libwebsockets.h +- + +/Users/benjamin/orchestra/src/libs/mosquitto/lib/will_mosq.c +stdio.h +- +string.h +- +mosquitto_internal.h +- +memory_mosq.h +- +mqtt3_protocol.h +- + +config.h + +lib/dummypthread.h + +lib/logging_mosq.h +mosquitto.h +- + +lib/memory_mosq.h +stdio.h +- +sys/types.h +- + +lib/messages_mosq.h +mosquitto_internal.h +- +mosquitto.h +- + +lib/mosquitto.h +stdbool.h +- + +lib/mosquitto_internal.h +config.h +- +winsock2.h +- +openssl/ssl.h +- +time.h +- +stdlib.h +- +pthread.h +- +dummypthread.h +- +ares.h +- +stdint.h +- +stdint.h +- +mosquitto.h +lib/mosquitto.h +time_mosq.h +lib/time_mosq.h +netdb.h +- +uthash.h +lib/uthash.h + +lib/mqtt3_protocol.h + +lib/net_mosq.h +unistd.h +- +winsock2.h +- +mosquitto_internal.h +- +mosquitto.h +- + +lib/read_handle.h +mosquitto.h +- + +lib/send_mosq.h +mosquitto.h +- + +lib/socks_mosq.h + +lib/time_mosq.h + +lib/tls_mosq.h +openssl/ssl.h +- + +lib/util_mosq.h +stdio.h +- +tls_mosq.h +lib/tls_mosq.h +mosquitto.h +lib/mosquitto.h +mosquitto_internal.h +lib/mosquitto_internal.h +mosquitto_broker.h +lib/mosquitto_broker.h + +lib/will_mosq.h +mosquitto.h +- +mosquitto_internal.h +- + diff --git a/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/DependInfo.cmake b/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/DependInfo.cmake new file mode 100644 index 0000000..faaca0e --- /dev/null +++ b/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/DependInfo.cmake @@ -0,0 +1,54 @@ +# The set of languages for which implicit dependencies are needed: +set(CMAKE_DEPENDS_LANGUAGES + "C" + ) +# The set of files for implicit dependencies of each language: +set(CMAKE_DEPENDS_CHECK_C + "/Users/benjamin/orchestra/src/libs/mosquitto/lib/logging_mosq.c" "/Users/benjamin/orchestra/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/logging_mosq.c.o" + "/Users/benjamin/orchestra/src/libs/mosquitto/lib/memory_mosq.c" "/Users/benjamin/orchestra/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/memory_mosq.c.o" + "/Users/benjamin/orchestra/src/libs/mosquitto/lib/messages_mosq.c" "/Users/benjamin/orchestra/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/messages_mosq.c.o" + "/Users/benjamin/orchestra/src/libs/mosquitto/lib/mosquitto.c" "/Users/benjamin/orchestra/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/mosquitto.c.o" + "/Users/benjamin/orchestra/src/libs/mosquitto/lib/net_mosq.c" "/Users/benjamin/orchestra/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/net_mosq.c.o" + "/Users/benjamin/orchestra/src/libs/mosquitto/lib/read_handle.c" "/Users/benjamin/orchestra/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/read_handle.c.o" + "/Users/benjamin/orchestra/src/libs/mosquitto/lib/read_handle_client.c" "/Users/benjamin/orchestra/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/read_handle_client.c.o" + "/Users/benjamin/orchestra/src/libs/mosquitto/lib/read_handle_shared.c" "/Users/benjamin/orchestra/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/read_handle_shared.c.o" + "/Users/benjamin/orchestra/src/libs/mosquitto/lib/send_client_mosq.c" "/Users/benjamin/orchestra/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/send_client_mosq.c.o" + "/Users/benjamin/orchestra/src/libs/mosquitto/lib/send_mosq.c" "/Users/benjamin/orchestra/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/send_mosq.c.o" + "/Users/benjamin/orchestra/src/libs/mosquitto/lib/socks_mosq.c" "/Users/benjamin/orchestra/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/socks_mosq.c.o" + "/Users/benjamin/orchestra/src/libs/mosquitto/lib/srv_mosq.c" "/Users/benjamin/orchestra/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/srv_mosq.c.o" + "/Users/benjamin/orchestra/src/libs/mosquitto/lib/thread_mosq.c" "/Users/benjamin/orchestra/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/thread_mosq.c.o" + "/Users/benjamin/orchestra/src/libs/mosquitto/lib/time_mosq.c" "/Users/benjamin/orchestra/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/time_mosq.c.o" + "/Users/benjamin/orchestra/src/libs/mosquitto/lib/tls_mosq.c" "/Users/benjamin/orchestra/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/tls_mosq.c.o" + "/Users/benjamin/orchestra/src/libs/mosquitto/lib/util_mosq.c" "/Users/benjamin/orchestra/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/util_mosq.c.o" + "/Users/benjamin/orchestra/src/libs/mosquitto/lib/will_mosq.c" "/Users/benjamin/orchestra/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/will_mosq.c.o" + ) +set(CMAKE_C_COMPILER_ID "Clang") + +# Preprocessor definitions for this target. +set(CMAKE_TARGET_DEFINITIONS_C + "CMAKE" + "TIMESTAMP=\"2018-01-23 10:58:26+0100\"" + "VERSION=\"1.4.14\"" + "WITH_SOCKS" + "WITH_THREADING" + ) + +# The include file search paths: +set(CMAKE_C_TARGET_INCLUDE_PATH + "." + "lib" + ) + +# Pairs of files generated by the same build rule. +set(CMAKE_MULTIPLE_OUTPUT_PAIRS + "/Users/benjamin/orchestra/src/libs/mosquitto/lib/libmosquitto.1.dylib" "/Users/benjamin/orchestra/src/libs/mosquitto/lib/libmosquitto.1.4.14.dylib" + "/Users/benjamin/orchestra/src/libs/mosquitto/lib/libmosquitto.dylib" "/Users/benjamin/orchestra/src/libs/mosquitto/lib/libmosquitto.1.4.14.dylib" + ) + + +# Targets to which this target links. +set(CMAKE_TARGET_LINKED_INFO_FILES + ) + +# Fortran module output directory. +set(CMAKE_Fortran_TARGET_MODULE_DIR "") diff --git a/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/build.make b/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/build.make new file mode 100644 index 0000000..85064b8 --- /dev/null +++ b/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/build.make @@ -0,0 +1,552 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.10 + +# Delete rule output on recipe failure. +.DELETE_ON_ERROR: + + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + + +# Remove some rules from gmake that .SUFFIXES does not remove. +SUFFIXES = + +.SUFFIXES: .hpux_make_needs_suffix_list + + +# Suppress display of executed commands. +$(VERBOSE).SILENT: + + +# A target that is always out of date. +cmake_force: + +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/local/Cellar/cmake/3.10.1/bin/cmake + +# The command to remove a file. +RM = /usr/local/Cellar/cmake/3.10.1/bin/cmake -E remove -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /Users/benjamin/orchestra/src/libs/mosquitto + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /Users/benjamin/orchestra/src/libs/mosquitto + +# Include any dependencies generated for this target. +include lib/CMakeFiles/libmosquitto.dir/depend.make + +# Include the progress variables for this target. +include lib/CMakeFiles/libmosquitto.dir/progress.make + +# Include the compile flags for this target's objects. +include lib/CMakeFiles/libmosquitto.dir/flags.make + +lib/CMakeFiles/libmosquitto.dir/logging_mosq.c.o: lib/CMakeFiles/libmosquitto.dir/flags.make +lib/CMakeFiles/libmosquitto.dir/logging_mosq.c.o: lib/logging_mosq.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building C object lib/CMakeFiles/libmosquitto.dir/logging_mosq.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/libmosquitto.dir/logging_mosq.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/lib/logging_mosq.c + +lib/CMakeFiles/libmosquitto.dir/logging_mosq.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/libmosquitto.dir/logging_mosq.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/lib/logging_mosq.c > CMakeFiles/libmosquitto.dir/logging_mosq.c.i + +lib/CMakeFiles/libmosquitto.dir/logging_mosq.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/libmosquitto.dir/logging_mosq.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/lib/logging_mosq.c -o CMakeFiles/libmosquitto.dir/logging_mosq.c.s + +lib/CMakeFiles/libmosquitto.dir/logging_mosq.c.o.requires: + +.PHONY : lib/CMakeFiles/libmosquitto.dir/logging_mosq.c.o.requires + +lib/CMakeFiles/libmosquitto.dir/logging_mosq.c.o.provides: lib/CMakeFiles/libmosquitto.dir/logging_mosq.c.o.requires + $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/logging_mosq.c.o.provides.build +.PHONY : lib/CMakeFiles/libmosquitto.dir/logging_mosq.c.o.provides + +lib/CMakeFiles/libmosquitto.dir/logging_mosq.c.o.provides.build: lib/CMakeFiles/libmosquitto.dir/logging_mosq.c.o + + +lib/CMakeFiles/libmosquitto.dir/memory_mosq.c.o: lib/CMakeFiles/libmosquitto.dir/flags.make +lib/CMakeFiles/libmosquitto.dir/memory_mosq.c.o: lib/memory_mosq.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Building C object lib/CMakeFiles/libmosquitto.dir/memory_mosq.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/libmosquitto.dir/memory_mosq.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/lib/memory_mosq.c + +lib/CMakeFiles/libmosquitto.dir/memory_mosq.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/libmosquitto.dir/memory_mosq.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/lib/memory_mosq.c > CMakeFiles/libmosquitto.dir/memory_mosq.c.i + +lib/CMakeFiles/libmosquitto.dir/memory_mosq.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/libmosquitto.dir/memory_mosq.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/lib/memory_mosq.c -o CMakeFiles/libmosquitto.dir/memory_mosq.c.s + +lib/CMakeFiles/libmosquitto.dir/memory_mosq.c.o.requires: + +.PHONY : lib/CMakeFiles/libmosquitto.dir/memory_mosq.c.o.requires + +lib/CMakeFiles/libmosquitto.dir/memory_mosq.c.o.provides: lib/CMakeFiles/libmosquitto.dir/memory_mosq.c.o.requires + $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/memory_mosq.c.o.provides.build +.PHONY : lib/CMakeFiles/libmosquitto.dir/memory_mosq.c.o.provides + +lib/CMakeFiles/libmosquitto.dir/memory_mosq.c.o.provides.build: lib/CMakeFiles/libmosquitto.dir/memory_mosq.c.o + + +lib/CMakeFiles/libmosquitto.dir/messages_mosq.c.o: lib/CMakeFiles/libmosquitto.dir/flags.make +lib/CMakeFiles/libmosquitto.dir/messages_mosq.c.o: lib/messages_mosq.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_3) "Building C object lib/CMakeFiles/libmosquitto.dir/messages_mosq.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/libmosquitto.dir/messages_mosq.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/lib/messages_mosq.c + +lib/CMakeFiles/libmosquitto.dir/messages_mosq.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/libmosquitto.dir/messages_mosq.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/lib/messages_mosq.c > CMakeFiles/libmosquitto.dir/messages_mosq.c.i + +lib/CMakeFiles/libmosquitto.dir/messages_mosq.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/libmosquitto.dir/messages_mosq.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/lib/messages_mosq.c -o CMakeFiles/libmosquitto.dir/messages_mosq.c.s + +lib/CMakeFiles/libmosquitto.dir/messages_mosq.c.o.requires: + +.PHONY : lib/CMakeFiles/libmosquitto.dir/messages_mosq.c.o.requires + +lib/CMakeFiles/libmosquitto.dir/messages_mosq.c.o.provides: lib/CMakeFiles/libmosquitto.dir/messages_mosq.c.o.requires + $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/messages_mosq.c.o.provides.build +.PHONY : lib/CMakeFiles/libmosquitto.dir/messages_mosq.c.o.provides + +lib/CMakeFiles/libmosquitto.dir/messages_mosq.c.o.provides.build: lib/CMakeFiles/libmosquitto.dir/messages_mosq.c.o + + +lib/CMakeFiles/libmosquitto.dir/mosquitto.c.o: lib/CMakeFiles/libmosquitto.dir/flags.make +lib/CMakeFiles/libmosquitto.dir/mosquitto.c.o: lib/mosquitto.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_4) "Building C object lib/CMakeFiles/libmosquitto.dir/mosquitto.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/libmosquitto.dir/mosquitto.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/lib/mosquitto.c + +lib/CMakeFiles/libmosquitto.dir/mosquitto.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/libmosquitto.dir/mosquitto.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/lib/mosquitto.c > CMakeFiles/libmosquitto.dir/mosquitto.c.i + +lib/CMakeFiles/libmosquitto.dir/mosquitto.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/libmosquitto.dir/mosquitto.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/lib/mosquitto.c -o CMakeFiles/libmosquitto.dir/mosquitto.c.s + +lib/CMakeFiles/libmosquitto.dir/mosquitto.c.o.requires: + +.PHONY : lib/CMakeFiles/libmosquitto.dir/mosquitto.c.o.requires + +lib/CMakeFiles/libmosquitto.dir/mosquitto.c.o.provides: lib/CMakeFiles/libmosquitto.dir/mosquitto.c.o.requires + $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/mosquitto.c.o.provides.build +.PHONY : lib/CMakeFiles/libmosquitto.dir/mosquitto.c.o.provides + +lib/CMakeFiles/libmosquitto.dir/mosquitto.c.o.provides.build: lib/CMakeFiles/libmosquitto.dir/mosquitto.c.o + + +lib/CMakeFiles/libmosquitto.dir/net_mosq.c.o: lib/CMakeFiles/libmosquitto.dir/flags.make +lib/CMakeFiles/libmosquitto.dir/net_mosq.c.o: lib/net_mosq.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_5) "Building C object lib/CMakeFiles/libmosquitto.dir/net_mosq.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/libmosquitto.dir/net_mosq.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/lib/net_mosq.c + +lib/CMakeFiles/libmosquitto.dir/net_mosq.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/libmosquitto.dir/net_mosq.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/lib/net_mosq.c > CMakeFiles/libmosquitto.dir/net_mosq.c.i + +lib/CMakeFiles/libmosquitto.dir/net_mosq.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/libmosquitto.dir/net_mosq.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/lib/net_mosq.c -o CMakeFiles/libmosquitto.dir/net_mosq.c.s + +lib/CMakeFiles/libmosquitto.dir/net_mosq.c.o.requires: + +.PHONY : lib/CMakeFiles/libmosquitto.dir/net_mosq.c.o.requires + +lib/CMakeFiles/libmosquitto.dir/net_mosq.c.o.provides: lib/CMakeFiles/libmosquitto.dir/net_mosq.c.o.requires + $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/net_mosq.c.o.provides.build +.PHONY : lib/CMakeFiles/libmosquitto.dir/net_mosq.c.o.provides + +lib/CMakeFiles/libmosquitto.dir/net_mosq.c.o.provides.build: lib/CMakeFiles/libmosquitto.dir/net_mosq.c.o + + +lib/CMakeFiles/libmosquitto.dir/read_handle.c.o: lib/CMakeFiles/libmosquitto.dir/flags.make +lib/CMakeFiles/libmosquitto.dir/read_handle.c.o: lib/read_handle.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_6) "Building C object lib/CMakeFiles/libmosquitto.dir/read_handle.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/libmosquitto.dir/read_handle.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/lib/read_handle.c + +lib/CMakeFiles/libmosquitto.dir/read_handle.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/libmosquitto.dir/read_handle.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/lib/read_handle.c > CMakeFiles/libmosquitto.dir/read_handle.c.i + +lib/CMakeFiles/libmosquitto.dir/read_handle.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/libmosquitto.dir/read_handle.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/lib/read_handle.c -o CMakeFiles/libmosquitto.dir/read_handle.c.s + +lib/CMakeFiles/libmosquitto.dir/read_handle.c.o.requires: + +.PHONY : lib/CMakeFiles/libmosquitto.dir/read_handle.c.o.requires + +lib/CMakeFiles/libmosquitto.dir/read_handle.c.o.provides: lib/CMakeFiles/libmosquitto.dir/read_handle.c.o.requires + $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/read_handle.c.o.provides.build +.PHONY : lib/CMakeFiles/libmosquitto.dir/read_handle.c.o.provides + +lib/CMakeFiles/libmosquitto.dir/read_handle.c.o.provides.build: lib/CMakeFiles/libmosquitto.dir/read_handle.c.o + + +lib/CMakeFiles/libmosquitto.dir/read_handle_client.c.o: lib/CMakeFiles/libmosquitto.dir/flags.make +lib/CMakeFiles/libmosquitto.dir/read_handle_client.c.o: lib/read_handle_client.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_7) "Building C object lib/CMakeFiles/libmosquitto.dir/read_handle_client.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/libmosquitto.dir/read_handle_client.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/lib/read_handle_client.c + +lib/CMakeFiles/libmosquitto.dir/read_handle_client.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/libmosquitto.dir/read_handle_client.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/lib/read_handle_client.c > CMakeFiles/libmosquitto.dir/read_handle_client.c.i + +lib/CMakeFiles/libmosquitto.dir/read_handle_client.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/libmosquitto.dir/read_handle_client.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/lib/read_handle_client.c -o CMakeFiles/libmosquitto.dir/read_handle_client.c.s + +lib/CMakeFiles/libmosquitto.dir/read_handle_client.c.o.requires: + +.PHONY : lib/CMakeFiles/libmosquitto.dir/read_handle_client.c.o.requires + +lib/CMakeFiles/libmosquitto.dir/read_handle_client.c.o.provides: lib/CMakeFiles/libmosquitto.dir/read_handle_client.c.o.requires + $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/read_handle_client.c.o.provides.build +.PHONY : lib/CMakeFiles/libmosquitto.dir/read_handle_client.c.o.provides + +lib/CMakeFiles/libmosquitto.dir/read_handle_client.c.o.provides.build: lib/CMakeFiles/libmosquitto.dir/read_handle_client.c.o + + +lib/CMakeFiles/libmosquitto.dir/read_handle_shared.c.o: lib/CMakeFiles/libmosquitto.dir/flags.make +lib/CMakeFiles/libmosquitto.dir/read_handle_shared.c.o: lib/read_handle_shared.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_8) "Building C object lib/CMakeFiles/libmosquitto.dir/read_handle_shared.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/libmosquitto.dir/read_handle_shared.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/lib/read_handle_shared.c + +lib/CMakeFiles/libmosquitto.dir/read_handle_shared.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/libmosquitto.dir/read_handle_shared.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/lib/read_handle_shared.c > CMakeFiles/libmosquitto.dir/read_handle_shared.c.i + +lib/CMakeFiles/libmosquitto.dir/read_handle_shared.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/libmosquitto.dir/read_handle_shared.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/lib/read_handle_shared.c -o CMakeFiles/libmosquitto.dir/read_handle_shared.c.s + +lib/CMakeFiles/libmosquitto.dir/read_handle_shared.c.o.requires: + +.PHONY : lib/CMakeFiles/libmosquitto.dir/read_handle_shared.c.o.requires + +lib/CMakeFiles/libmosquitto.dir/read_handle_shared.c.o.provides: lib/CMakeFiles/libmosquitto.dir/read_handle_shared.c.o.requires + $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/read_handle_shared.c.o.provides.build +.PHONY : lib/CMakeFiles/libmosquitto.dir/read_handle_shared.c.o.provides + +lib/CMakeFiles/libmosquitto.dir/read_handle_shared.c.o.provides.build: lib/CMakeFiles/libmosquitto.dir/read_handle_shared.c.o + + +lib/CMakeFiles/libmosquitto.dir/send_client_mosq.c.o: lib/CMakeFiles/libmosquitto.dir/flags.make +lib/CMakeFiles/libmosquitto.dir/send_client_mosq.c.o: lib/send_client_mosq.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_9) "Building C object lib/CMakeFiles/libmosquitto.dir/send_client_mosq.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/libmosquitto.dir/send_client_mosq.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/lib/send_client_mosq.c + +lib/CMakeFiles/libmosquitto.dir/send_client_mosq.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/libmosquitto.dir/send_client_mosq.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/lib/send_client_mosq.c > CMakeFiles/libmosquitto.dir/send_client_mosq.c.i + +lib/CMakeFiles/libmosquitto.dir/send_client_mosq.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/libmosquitto.dir/send_client_mosq.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/lib/send_client_mosq.c -o CMakeFiles/libmosquitto.dir/send_client_mosq.c.s + +lib/CMakeFiles/libmosquitto.dir/send_client_mosq.c.o.requires: + +.PHONY : lib/CMakeFiles/libmosquitto.dir/send_client_mosq.c.o.requires + +lib/CMakeFiles/libmosquitto.dir/send_client_mosq.c.o.provides: lib/CMakeFiles/libmosquitto.dir/send_client_mosq.c.o.requires + $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/send_client_mosq.c.o.provides.build +.PHONY : lib/CMakeFiles/libmosquitto.dir/send_client_mosq.c.o.provides + +lib/CMakeFiles/libmosquitto.dir/send_client_mosq.c.o.provides.build: lib/CMakeFiles/libmosquitto.dir/send_client_mosq.c.o + + +lib/CMakeFiles/libmosquitto.dir/send_mosq.c.o: lib/CMakeFiles/libmosquitto.dir/flags.make +lib/CMakeFiles/libmosquitto.dir/send_mosq.c.o: lib/send_mosq.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_10) "Building C object lib/CMakeFiles/libmosquitto.dir/send_mosq.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/libmosquitto.dir/send_mosq.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/lib/send_mosq.c + +lib/CMakeFiles/libmosquitto.dir/send_mosq.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/libmosquitto.dir/send_mosq.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/lib/send_mosq.c > CMakeFiles/libmosquitto.dir/send_mosq.c.i + +lib/CMakeFiles/libmosquitto.dir/send_mosq.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/libmosquitto.dir/send_mosq.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/lib/send_mosq.c -o CMakeFiles/libmosquitto.dir/send_mosq.c.s + +lib/CMakeFiles/libmosquitto.dir/send_mosq.c.o.requires: + +.PHONY : lib/CMakeFiles/libmosquitto.dir/send_mosq.c.o.requires + +lib/CMakeFiles/libmosquitto.dir/send_mosq.c.o.provides: lib/CMakeFiles/libmosquitto.dir/send_mosq.c.o.requires + $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/send_mosq.c.o.provides.build +.PHONY : lib/CMakeFiles/libmosquitto.dir/send_mosq.c.o.provides + +lib/CMakeFiles/libmosquitto.dir/send_mosq.c.o.provides.build: lib/CMakeFiles/libmosquitto.dir/send_mosq.c.o + + +lib/CMakeFiles/libmosquitto.dir/socks_mosq.c.o: lib/CMakeFiles/libmosquitto.dir/flags.make +lib/CMakeFiles/libmosquitto.dir/socks_mosq.c.o: lib/socks_mosq.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_11) "Building C object lib/CMakeFiles/libmosquitto.dir/socks_mosq.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/libmosquitto.dir/socks_mosq.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/lib/socks_mosq.c + +lib/CMakeFiles/libmosquitto.dir/socks_mosq.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/libmosquitto.dir/socks_mosq.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/lib/socks_mosq.c > CMakeFiles/libmosquitto.dir/socks_mosq.c.i + +lib/CMakeFiles/libmosquitto.dir/socks_mosq.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/libmosquitto.dir/socks_mosq.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/lib/socks_mosq.c -o CMakeFiles/libmosquitto.dir/socks_mosq.c.s + +lib/CMakeFiles/libmosquitto.dir/socks_mosq.c.o.requires: + +.PHONY : lib/CMakeFiles/libmosquitto.dir/socks_mosq.c.o.requires + +lib/CMakeFiles/libmosquitto.dir/socks_mosq.c.o.provides: lib/CMakeFiles/libmosquitto.dir/socks_mosq.c.o.requires + $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/socks_mosq.c.o.provides.build +.PHONY : lib/CMakeFiles/libmosquitto.dir/socks_mosq.c.o.provides + +lib/CMakeFiles/libmosquitto.dir/socks_mosq.c.o.provides.build: lib/CMakeFiles/libmosquitto.dir/socks_mosq.c.o + + +lib/CMakeFiles/libmosquitto.dir/srv_mosq.c.o: lib/CMakeFiles/libmosquitto.dir/flags.make +lib/CMakeFiles/libmosquitto.dir/srv_mosq.c.o: lib/srv_mosq.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_12) "Building C object lib/CMakeFiles/libmosquitto.dir/srv_mosq.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/libmosquitto.dir/srv_mosq.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/lib/srv_mosq.c + +lib/CMakeFiles/libmosquitto.dir/srv_mosq.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/libmosquitto.dir/srv_mosq.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/lib/srv_mosq.c > CMakeFiles/libmosquitto.dir/srv_mosq.c.i + +lib/CMakeFiles/libmosquitto.dir/srv_mosq.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/libmosquitto.dir/srv_mosq.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/lib/srv_mosq.c -o CMakeFiles/libmosquitto.dir/srv_mosq.c.s + +lib/CMakeFiles/libmosquitto.dir/srv_mosq.c.o.requires: + +.PHONY : lib/CMakeFiles/libmosquitto.dir/srv_mosq.c.o.requires + +lib/CMakeFiles/libmosquitto.dir/srv_mosq.c.o.provides: lib/CMakeFiles/libmosquitto.dir/srv_mosq.c.o.requires + $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/srv_mosq.c.o.provides.build +.PHONY : lib/CMakeFiles/libmosquitto.dir/srv_mosq.c.o.provides + +lib/CMakeFiles/libmosquitto.dir/srv_mosq.c.o.provides.build: lib/CMakeFiles/libmosquitto.dir/srv_mosq.c.o + + +lib/CMakeFiles/libmosquitto.dir/thread_mosq.c.o: lib/CMakeFiles/libmosquitto.dir/flags.make +lib/CMakeFiles/libmosquitto.dir/thread_mosq.c.o: lib/thread_mosq.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_13) "Building C object lib/CMakeFiles/libmosquitto.dir/thread_mosq.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/libmosquitto.dir/thread_mosq.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/lib/thread_mosq.c + +lib/CMakeFiles/libmosquitto.dir/thread_mosq.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/libmosquitto.dir/thread_mosq.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/lib/thread_mosq.c > CMakeFiles/libmosquitto.dir/thread_mosq.c.i + +lib/CMakeFiles/libmosquitto.dir/thread_mosq.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/libmosquitto.dir/thread_mosq.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/lib/thread_mosq.c -o CMakeFiles/libmosquitto.dir/thread_mosq.c.s + +lib/CMakeFiles/libmosquitto.dir/thread_mosq.c.o.requires: + +.PHONY : lib/CMakeFiles/libmosquitto.dir/thread_mosq.c.o.requires + +lib/CMakeFiles/libmosquitto.dir/thread_mosq.c.o.provides: lib/CMakeFiles/libmosquitto.dir/thread_mosq.c.o.requires + $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/thread_mosq.c.o.provides.build +.PHONY : lib/CMakeFiles/libmosquitto.dir/thread_mosq.c.o.provides + +lib/CMakeFiles/libmosquitto.dir/thread_mosq.c.o.provides.build: lib/CMakeFiles/libmosquitto.dir/thread_mosq.c.o + + +lib/CMakeFiles/libmosquitto.dir/time_mosq.c.o: lib/CMakeFiles/libmosquitto.dir/flags.make +lib/CMakeFiles/libmosquitto.dir/time_mosq.c.o: lib/time_mosq.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_14) "Building C object lib/CMakeFiles/libmosquitto.dir/time_mosq.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/libmosquitto.dir/time_mosq.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/lib/time_mosq.c + +lib/CMakeFiles/libmosquitto.dir/time_mosq.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/libmosquitto.dir/time_mosq.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/lib/time_mosq.c > CMakeFiles/libmosquitto.dir/time_mosq.c.i + +lib/CMakeFiles/libmosquitto.dir/time_mosq.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/libmosquitto.dir/time_mosq.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/lib/time_mosq.c -o CMakeFiles/libmosquitto.dir/time_mosq.c.s + +lib/CMakeFiles/libmosquitto.dir/time_mosq.c.o.requires: + +.PHONY : lib/CMakeFiles/libmosquitto.dir/time_mosq.c.o.requires + +lib/CMakeFiles/libmosquitto.dir/time_mosq.c.o.provides: lib/CMakeFiles/libmosquitto.dir/time_mosq.c.o.requires + $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/time_mosq.c.o.provides.build +.PHONY : lib/CMakeFiles/libmosquitto.dir/time_mosq.c.o.provides + +lib/CMakeFiles/libmosquitto.dir/time_mosq.c.o.provides.build: lib/CMakeFiles/libmosquitto.dir/time_mosq.c.o + + +lib/CMakeFiles/libmosquitto.dir/tls_mosq.c.o: lib/CMakeFiles/libmosquitto.dir/flags.make +lib/CMakeFiles/libmosquitto.dir/tls_mosq.c.o: lib/tls_mosq.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_15) "Building C object lib/CMakeFiles/libmosquitto.dir/tls_mosq.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/libmosquitto.dir/tls_mosq.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/lib/tls_mosq.c + +lib/CMakeFiles/libmosquitto.dir/tls_mosq.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/libmosquitto.dir/tls_mosq.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/lib/tls_mosq.c > CMakeFiles/libmosquitto.dir/tls_mosq.c.i + +lib/CMakeFiles/libmosquitto.dir/tls_mosq.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/libmosquitto.dir/tls_mosq.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/lib/tls_mosq.c -o CMakeFiles/libmosquitto.dir/tls_mosq.c.s + +lib/CMakeFiles/libmosquitto.dir/tls_mosq.c.o.requires: + +.PHONY : lib/CMakeFiles/libmosquitto.dir/tls_mosq.c.o.requires + +lib/CMakeFiles/libmosquitto.dir/tls_mosq.c.o.provides: lib/CMakeFiles/libmosquitto.dir/tls_mosq.c.o.requires + $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/tls_mosq.c.o.provides.build +.PHONY : lib/CMakeFiles/libmosquitto.dir/tls_mosq.c.o.provides + +lib/CMakeFiles/libmosquitto.dir/tls_mosq.c.o.provides.build: lib/CMakeFiles/libmosquitto.dir/tls_mosq.c.o + + +lib/CMakeFiles/libmosquitto.dir/util_mosq.c.o: lib/CMakeFiles/libmosquitto.dir/flags.make +lib/CMakeFiles/libmosquitto.dir/util_mosq.c.o: lib/util_mosq.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_16) "Building C object lib/CMakeFiles/libmosquitto.dir/util_mosq.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/libmosquitto.dir/util_mosq.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/lib/util_mosq.c + +lib/CMakeFiles/libmosquitto.dir/util_mosq.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/libmosquitto.dir/util_mosq.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/lib/util_mosq.c > CMakeFiles/libmosquitto.dir/util_mosq.c.i + +lib/CMakeFiles/libmosquitto.dir/util_mosq.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/libmosquitto.dir/util_mosq.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/lib/util_mosq.c -o CMakeFiles/libmosquitto.dir/util_mosq.c.s + +lib/CMakeFiles/libmosquitto.dir/util_mosq.c.o.requires: + +.PHONY : lib/CMakeFiles/libmosquitto.dir/util_mosq.c.o.requires + +lib/CMakeFiles/libmosquitto.dir/util_mosq.c.o.provides: lib/CMakeFiles/libmosquitto.dir/util_mosq.c.o.requires + $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/util_mosq.c.o.provides.build +.PHONY : lib/CMakeFiles/libmosquitto.dir/util_mosq.c.o.provides + +lib/CMakeFiles/libmosquitto.dir/util_mosq.c.o.provides.build: lib/CMakeFiles/libmosquitto.dir/util_mosq.c.o + + +lib/CMakeFiles/libmosquitto.dir/will_mosq.c.o: lib/CMakeFiles/libmosquitto.dir/flags.make +lib/CMakeFiles/libmosquitto.dir/will_mosq.c.o: lib/will_mosq.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_17) "Building C object lib/CMakeFiles/libmosquitto.dir/will_mosq.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/libmosquitto.dir/will_mosq.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/lib/will_mosq.c + +lib/CMakeFiles/libmosquitto.dir/will_mosq.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/libmosquitto.dir/will_mosq.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/lib/will_mosq.c > CMakeFiles/libmosquitto.dir/will_mosq.c.i + +lib/CMakeFiles/libmosquitto.dir/will_mosq.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/libmosquitto.dir/will_mosq.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/lib/will_mosq.c -o CMakeFiles/libmosquitto.dir/will_mosq.c.s + +lib/CMakeFiles/libmosquitto.dir/will_mosq.c.o.requires: + +.PHONY : lib/CMakeFiles/libmosquitto.dir/will_mosq.c.o.requires + +lib/CMakeFiles/libmosquitto.dir/will_mosq.c.o.provides: lib/CMakeFiles/libmosquitto.dir/will_mosq.c.o.requires + $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/will_mosq.c.o.provides.build +.PHONY : lib/CMakeFiles/libmosquitto.dir/will_mosq.c.o.provides + +lib/CMakeFiles/libmosquitto.dir/will_mosq.c.o.provides.build: lib/CMakeFiles/libmosquitto.dir/will_mosq.c.o + + +# Object files for target libmosquitto +libmosquitto_OBJECTS = \ +"CMakeFiles/libmosquitto.dir/logging_mosq.c.o" \ +"CMakeFiles/libmosquitto.dir/memory_mosq.c.o" \ +"CMakeFiles/libmosquitto.dir/messages_mosq.c.o" \ +"CMakeFiles/libmosquitto.dir/mosquitto.c.o" \ +"CMakeFiles/libmosquitto.dir/net_mosq.c.o" \ +"CMakeFiles/libmosquitto.dir/read_handle.c.o" \ +"CMakeFiles/libmosquitto.dir/read_handle_client.c.o" \ +"CMakeFiles/libmosquitto.dir/read_handle_shared.c.o" \ +"CMakeFiles/libmosquitto.dir/send_client_mosq.c.o" \ +"CMakeFiles/libmosquitto.dir/send_mosq.c.o" \ +"CMakeFiles/libmosquitto.dir/socks_mosq.c.o" \ +"CMakeFiles/libmosquitto.dir/srv_mosq.c.o" \ +"CMakeFiles/libmosquitto.dir/thread_mosq.c.o" \ +"CMakeFiles/libmosquitto.dir/time_mosq.c.o" \ +"CMakeFiles/libmosquitto.dir/tls_mosq.c.o" \ +"CMakeFiles/libmosquitto.dir/util_mosq.c.o" \ +"CMakeFiles/libmosquitto.dir/will_mosq.c.o" + +# External object files for target libmosquitto +libmosquitto_EXTERNAL_OBJECTS = + +lib/libmosquitto.1.4.14.dylib: lib/CMakeFiles/libmosquitto.dir/logging_mosq.c.o +lib/libmosquitto.1.4.14.dylib: lib/CMakeFiles/libmosquitto.dir/memory_mosq.c.o +lib/libmosquitto.1.4.14.dylib: lib/CMakeFiles/libmosquitto.dir/messages_mosq.c.o +lib/libmosquitto.1.4.14.dylib: lib/CMakeFiles/libmosquitto.dir/mosquitto.c.o +lib/libmosquitto.1.4.14.dylib: lib/CMakeFiles/libmosquitto.dir/net_mosq.c.o +lib/libmosquitto.1.4.14.dylib: lib/CMakeFiles/libmosquitto.dir/read_handle.c.o +lib/libmosquitto.1.4.14.dylib: lib/CMakeFiles/libmosquitto.dir/read_handle_client.c.o +lib/libmosquitto.1.4.14.dylib: lib/CMakeFiles/libmosquitto.dir/read_handle_shared.c.o +lib/libmosquitto.1.4.14.dylib: lib/CMakeFiles/libmosquitto.dir/send_client_mosq.c.o +lib/libmosquitto.1.4.14.dylib: lib/CMakeFiles/libmosquitto.dir/send_mosq.c.o +lib/libmosquitto.1.4.14.dylib: lib/CMakeFiles/libmosquitto.dir/socks_mosq.c.o +lib/libmosquitto.1.4.14.dylib: lib/CMakeFiles/libmosquitto.dir/srv_mosq.c.o +lib/libmosquitto.1.4.14.dylib: lib/CMakeFiles/libmosquitto.dir/thread_mosq.c.o +lib/libmosquitto.1.4.14.dylib: lib/CMakeFiles/libmosquitto.dir/time_mosq.c.o +lib/libmosquitto.1.4.14.dylib: lib/CMakeFiles/libmosquitto.dir/tls_mosq.c.o +lib/libmosquitto.1.4.14.dylib: lib/CMakeFiles/libmosquitto.dir/util_mosq.c.o +lib/libmosquitto.1.4.14.dylib: lib/CMakeFiles/libmosquitto.dir/will_mosq.c.o +lib/libmosquitto.1.4.14.dylib: lib/CMakeFiles/libmosquitto.dir/build.make +lib/libmosquitto.1.4.14.dylib: lib/CMakeFiles/libmosquitto.dir/link.txt + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_18) "Linking C shared library libmosquitto.dylib" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/libmosquitto.dir/link.txt --verbose=$(VERBOSE) + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && $(CMAKE_COMMAND) -E cmake_symlink_library libmosquitto.1.4.14.dylib libmosquitto.1.dylib libmosquitto.dylib + +lib/libmosquitto.1.dylib: lib/libmosquitto.1.4.14.dylib + @$(CMAKE_COMMAND) -E touch_nocreate lib/libmosquitto.1.dylib + +lib/libmosquitto.dylib: lib/libmosquitto.1.4.14.dylib + @$(CMAKE_COMMAND) -E touch_nocreate lib/libmosquitto.dylib + +# Rule to build all files generated by this target. +lib/CMakeFiles/libmosquitto.dir/build: lib/libmosquitto.dylib + +.PHONY : lib/CMakeFiles/libmosquitto.dir/build + +lib/CMakeFiles/libmosquitto.dir/requires: lib/CMakeFiles/libmosquitto.dir/logging_mosq.c.o.requires +lib/CMakeFiles/libmosquitto.dir/requires: lib/CMakeFiles/libmosquitto.dir/memory_mosq.c.o.requires +lib/CMakeFiles/libmosquitto.dir/requires: lib/CMakeFiles/libmosquitto.dir/messages_mosq.c.o.requires +lib/CMakeFiles/libmosquitto.dir/requires: lib/CMakeFiles/libmosquitto.dir/mosquitto.c.o.requires +lib/CMakeFiles/libmosquitto.dir/requires: lib/CMakeFiles/libmosquitto.dir/net_mosq.c.o.requires +lib/CMakeFiles/libmosquitto.dir/requires: lib/CMakeFiles/libmosquitto.dir/read_handle.c.o.requires +lib/CMakeFiles/libmosquitto.dir/requires: lib/CMakeFiles/libmosquitto.dir/read_handle_client.c.o.requires +lib/CMakeFiles/libmosquitto.dir/requires: lib/CMakeFiles/libmosquitto.dir/read_handle_shared.c.o.requires +lib/CMakeFiles/libmosquitto.dir/requires: lib/CMakeFiles/libmosquitto.dir/send_client_mosq.c.o.requires +lib/CMakeFiles/libmosquitto.dir/requires: lib/CMakeFiles/libmosquitto.dir/send_mosq.c.o.requires +lib/CMakeFiles/libmosquitto.dir/requires: lib/CMakeFiles/libmosquitto.dir/socks_mosq.c.o.requires +lib/CMakeFiles/libmosquitto.dir/requires: lib/CMakeFiles/libmosquitto.dir/srv_mosq.c.o.requires +lib/CMakeFiles/libmosquitto.dir/requires: lib/CMakeFiles/libmosquitto.dir/thread_mosq.c.o.requires +lib/CMakeFiles/libmosquitto.dir/requires: lib/CMakeFiles/libmosquitto.dir/time_mosq.c.o.requires +lib/CMakeFiles/libmosquitto.dir/requires: lib/CMakeFiles/libmosquitto.dir/tls_mosq.c.o.requires +lib/CMakeFiles/libmosquitto.dir/requires: lib/CMakeFiles/libmosquitto.dir/util_mosq.c.o.requires +lib/CMakeFiles/libmosquitto.dir/requires: lib/CMakeFiles/libmosquitto.dir/will_mosq.c.o.requires + +.PHONY : lib/CMakeFiles/libmosquitto.dir/requires + +lib/CMakeFiles/libmosquitto.dir/clean: + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib && $(CMAKE_COMMAND) -P CMakeFiles/libmosquitto.dir/cmake_clean.cmake +.PHONY : lib/CMakeFiles/libmosquitto.dir/clean + +lib/CMakeFiles/libmosquitto.dir/depend: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /Users/benjamin/orchestra/src/libs/mosquitto /Users/benjamin/orchestra/src/libs/mosquitto/lib /Users/benjamin/orchestra/src/libs/mosquitto /Users/benjamin/orchestra/src/libs/mosquitto/lib /Users/benjamin/orchestra/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/DependInfo.cmake --color=$(COLOR) +.PHONY : lib/CMakeFiles/libmosquitto.dir/depend + diff --git a/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/cmake_clean.cmake b/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/cmake_clean.cmake new file mode 100644 index 0000000..24c62a8 --- /dev/null +++ b/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/cmake_clean.cmake @@ -0,0 +1,28 @@ +file(REMOVE_RECURSE + "CMakeFiles/libmosquitto.dir/logging_mosq.c.o" + "CMakeFiles/libmosquitto.dir/memory_mosq.c.o" + "CMakeFiles/libmosquitto.dir/messages_mosq.c.o" + "CMakeFiles/libmosquitto.dir/mosquitto.c.o" + "CMakeFiles/libmosquitto.dir/net_mosq.c.o" + "CMakeFiles/libmosquitto.dir/read_handle.c.o" + "CMakeFiles/libmosquitto.dir/read_handle_client.c.o" + "CMakeFiles/libmosquitto.dir/read_handle_shared.c.o" + "CMakeFiles/libmosquitto.dir/send_client_mosq.c.o" + "CMakeFiles/libmosquitto.dir/send_mosq.c.o" + "CMakeFiles/libmosquitto.dir/socks_mosq.c.o" + "CMakeFiles/libmosquitto.dir/srv_mosq.c.o" + "CMakeFiles/libmosquitto.dir/thread_mosq.c.o" + "CMakeFiles/libmosquitto.dir/time_mosq.c.o" + "CMakeFiles/libmosquitto.dir/tls_mosq.c.o" + "CMakeFiles/libmosquitto.dir/util_mosq.c.o" + "CMakeFiles/libmosquitto.dir/will_mosq.c.o" + "libmosquitto.pdb" + "libmosquitto.1.4.14.dylib" + "libmosquitto.dylib" + "libmosquitto.1.dylib" +) + +# Per-language clean rules from dependency scanning. +foreach(lang C) + include(CMakeFiles/libmosquitto.dir/cmake_clean_${lang}.cmake OPTIONAL) +endforeach() diff --git a/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/depend.internal b/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/depend.internal new file mode 100644 index 0000000..6b1e24e --- /dev/null +++ b/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/depend.internal @@ -0,0 +1,188 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.10 + +lib/CMakeFiles/libmosquitto.dir/logging_mosq.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/lib/logging_mosq.c + config.h + lib/dummypthread.h + lib/memory_mosq.h + lib/mosquitto.h + lib/mosquitto_internal.h + lib/time_mosq.h +lib/CMakeFiles/libmosquitto.dir/memory_mosq.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/lib/memory_mosq.c + config.h + lib/memory_mosq.h +lib/CMakeFiles/libmosquitto.dir/messages_mosq.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/lib/messages_mosq.c + config.h + lib/dummypthread.h + lib/memory_mosq.h + lib/messages_mosq.h + lib/mosquitto.h + lib/mosquitto_internal.h + lib/send_mosq.h + lib/time_mosq.h +lib/CMakeFiles/libmosquitto.dir/mosquitto.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/lib/mosquitto.c + config.h + lib/dummypthread.h + lib/logging_mosq.h + lib/memory_mosq.h + lib/messages_mosq.h + lib/mosquitto.h + lib/mosquitto_internal.h + lib/mqtt3_protocol.h + lib/net_mosq.h + lib/read_handle.h + lib/send_mosq.h + lib/socks_mosq.h + lib/time_mosq.h + lib/tls_mosq.h + lib/util_mosq.h + lib/will_mosq.h +lib/CMakeFiles/libmosquitto.dir/net_mosq.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/lib/net_mosq.c + config.h + lib/dummypthread.h + lib/logging_mosq.h + lib/memory_mosq.h + lib/mosquitto.h + lib/mosquitto_internal.h + lib/mqtt3_protocol.h + lib/net_mosq.h + lib/read_handle.h + lib/time_mosq.h + lib/tls_mosq.h + lib/util_mosq.h +lib/CMakeFiles/libmosquitto.dir/read_handle.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/lib/read_handle.c + config.h + lib/dummypthread.h + lib/logging_mosq.h + lib/memory_mosq.h + lib/messages_mosq.h + lib/mosquitto.h + lib/mosquitto_internal.h + lib/mqtt3_protocol.h + lib/net_mosq.h + lib/read_handle.h + lib/send_mosq.h + lib/time_mosq.h + lib/tls_mosq.h + lib/util_mosq.h +lib/CMakeFiles/libmosquitto.dir/read_handle_client.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/lib/read_handle_client.c + config.h + lib/dummypthread.h + lib/logging_mosq.h + lib/memory_mosq.h + lib/mosquitto.h + lib/mosquitto_internal.h + lib/net_mosq.h + lib/read_handle.h + lib/time_mosq.h +lib/CMakeFiles/libmosquitto.dir/read_handle_shared.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/lib/read_handle_shared.c + config.h + lib/dummypthread.h + lib/logging_mosq.h + lib/memory_mosq.h + lib/messages_mosq.h + lib/mosquitto.h + lib/mosquitto_internal.h + lib/mqtt3_protocol.h + lib/net_mosq.h + lib/read_handle.h + lib/send_mosq.h + lib/time_mosq.h + lib/tls_mosq.h + lib/util_mosq.h +lib/CMakeFiles/libmosquitto.dir/send_client_mosq.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/lib/send_client_mosq.c + config.h + lib/dummypthread.h + lib/logging_mosq.h + lib/memory_mosq.h + lib/mosquitto.h + lib/mosquitto_internal.h + lib/mqtt3_protocol.h + lib/net_mosq.h + lib/send_mosq.h + lib/time_mosq.h + lib/tls_mosq.h + lib/util_mosq.h +lib/CMakeFiles/libmosquitto.dir/send_mosq.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/lib/send_mosq.c + config.h + lib/dummypthread.h + lib/logging_mosq.h + lib/memory_mosq.h + lib/mosquitto.h + lib/mosquitto_internal.h + lib/mqtt3_protocol.h + lib/net_mosq.h + lib/send_mosq.h + lib/time_mosq.h + lib/tls_mosq.h + lib/util_mosq.h +lib/CMakeFiles/libmosquitto.dir/socks_mosq.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/lib/memory_mosq.h + /Users/benjamin/orchestra/src/libs/mosquitto/lib/mosquitto.h + /Users/benjamin/orchestra/src/libs/mosquitto/lib/mosquitto_internal.h + /Users/benjamin/orchestra/src/libs/mosquitto/lib/net_mosq.h + /Users/benjamin/orchestra/src/libs/mosquitto/lib/send_mosq.h + /Users/benjamin/orchestra/src/libs/mosquitto/lib/socks_mosq.c + /Users/benjamin/orchestra/src/libs/mosquitto/lib/time_mosq.h + config.h + lib/dummypthread.h +lib/CMakeFiles/libmosquitto.dir/srv_mosq.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/lib/logging_mosq.h + /Users/benjamin/orchestra/src/libs/mosquitto/lib/memory_mosq.h + /Users/benjamin/orchestra/src/libs/mosquitto/lib/mosquitto.h + /Users/benjamin/orchestra/src/libs/mosquitto/lib/mosquitto_internal.h + /Users/benjamin/orchestra/src/libs/mosquitto/lib/srv_mosq.c + /Users/benjamin/orchestra/src/libs/mosquitto/lib/time_mosq.h + config.h + lib/dummypthread.h +lib/CMakeFiles/libmosquitto.dir/thread_mosq.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/lib/thread_mosq.c + config.h + lib/dummypthread.h + lib/mosquitto.h + lib/mosquitto_internal.h + lib/net_mosq.h + lib/time_mosq.h +lib/CMakeFiles/libmosquitto.dir/time_mosq.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/lib/mosquitto.h + /Users/benjamin/orchestra/src/libs/mosquitto/lib/time_mosq.c + /Users/benjamin/orchestra/src/libs/mosquitto/lib/time_mosq.h +lib/CMakeFiles/libmosquitto.dir/tls_mosq.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/lib/mosquitto.h + /Users/benjamin/orchestra/src/libs/mosquitto/lib/mosquitto_internal.h + /Users/benjamin/orchestra/src/libs/mosquitto/lib/time_mosq.h + /Users/benjamin/orchestra/src/libs/mosquitto/lib/tls_mosq.c + /Users/benjamin/orchestra/src/libs/mosquitto/lib/tls_mosq.h + config.h + lib/dummypthread.h +lib/CMakeFiles/libmosquitto.dir/util_mosq.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/lib/util_mosq.c + config.h + lib/dummypthread.h + lib/memory_mosq.h + lib/mosquitto.h + lib/mosquitto_internal.h + lib/net_mosq.h + lib/send_mosq.h + lib/time_mosq.h + lib/tls_mosq.h + lib/util_mosq.h +lib/CMakeFiles/libmosquitto.dir/will_mosq.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/lib/will_mosq.c + config.h + lib/dummypthread.h + lib/memory_mosq.h + lib/mosquitto.h + lib/mosquitto_internal.h + lib/mqtt3_protocol.h + lib/time_mosq.h diff --git a/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/depend.make b/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/depend.make new file mode 100644 index 0000000..78c53c6 --- /dev/null +++ b/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/depend.make @@ -0,0 +1,188 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.10 + +lib/CMakeFiles/libmosquitto.dir/logging_mosq.c.o: lib/logging_mosq.c +lib/CMakeFiles/libmosquitto.dir/logging_mosq.c.o: config.h +lib/CMakeFiles/libmosquitto.dir/logging_mosq.c.o: lib/dummypthread.h +lib/CMakeFiles/libmosquitto.dir/logging_mosq.c.o: lib/memory_mosq.h +lib/CMakeFiles/libmosquitto.dir/logging_mosq.c.o: lib/mosquitto.h +lib/CMakeFiles/libmosquitto.dir/logging_mosq.c.o: lib/mosquitto_internal.h +lib/CMakeFiles/libmosquitto.dir/logging_mosq.c.o: lib/time_mosq.h + +lib/CMakeFiles/libmosquitto.dir/memory_mosq.c.o: lib/memory_mosq.c +lib/CMakeFiles/libmosquitto.dir/memory_mosq.c.o: config.h +lib/CMakeFiles/libmosquitto.dir/memory_mosq.c.o: lib/memory_mosq.h + +lib/CMakeFiles/libmosquitto.dir/messages_mosq.c.o: lib/messages_mosq.c +lib/CMakeFiles/libmosquitto.dir/messages_mosq.c.o: config.h +lib/CMakeFiles/libmosquitto.dir/messages_mosq.c.o: lib/dummypthread.h +lib/CMakeFiles/libmosquitto.dir/messages_mosq.c.o: lib/memory_mosq.h +lib/CMakeFiles/libmosquitto.dir/messages_mosq.c.o: lib/messages_mosq.h +lib/CMakeFiles/libmosquitto.dir/messages_mosq.c.o: lib/mosquitto.h +lib/CMakeFiles/libmosquitto.dir/messages_mosq.c.o: lib/mosquitto_internal.h +lib/CMakeFiles/libmosquitto.dir/messages_mosq.c.o: lib/send_mosq.h +lib/CMakeFiles/libmosquitto.dir/messages_mosq.c.o: lib/time_mosq.h + +lib/CMakeFiles/libmosquitto.dir/mosquitto.c.o: lib/mosquitto.c +lib/CMakeFiles/libmosquitto.dir/mosquitto.c.o: config.h +lib/CMakeFiles/libmosquitto.dir/mosquitto.c.o: lib/dummypthread.h +lib/CMakeFiles/libmosquitto.dir/mosquitto.c.o: lib/logging_mosq.h +lib/CMakeFiles/libmosquitto.dir/mosquitto.c.o: lib/memory_mosq.h +lib/CMakeFiles/libmosquitto.dir/mosquitto.c.o: lib/messages_mosq.h +lib/CMakeFiles/libmosquitto.dir/mosquitto.c.o: lib/mosquitto.h +lib/CMakeFiles/libmosquitto.dir/mosquitto.c.o: lib/mosquitto_internal.h +lib/CMakeFiles/libmosquitto.dir/mosquitto.c.o: lib/mqtt3_protocol.h +lib/CMakeFiles/libmosquitto.dir/mosquitto.c.o: lib/net_mosq.h +lib/CMakeFiles/libmosquitto.dir/mosquitto.c.o: lib/read_handle.h +lib/CMakeFiles/libmosquitto.dir/mosquitto.c.o: lib/send_mosq.h +lib/CMakeFiles/libmosquitto.dir/mosquitto.c.o: lib/socks_mosq.h +lib/CMakeFiles/libmosquitto.dir/mosquitto.c.o: lib/time_mosq.h +lib/CMakeFiles/libmosquitto.dir/mosquitto.c.o: lib/tls_mosq.h +lib/CMakeFiles/libmosquitto.dir/mosquitto.c.o: lib/util_mosq.h +lib/CMakeFiles/libmosquitto.dir/mosquitto.c.o: lib/will_mosq.h + +lib/CMakeFiles/libmosquitto.dir/net_mosq.c.o: lib/net_mosq.c +lib/CMakeFiles/libmosquitto.dir/net_mosq.c.o: config.h +lib/CMakeFiles/libmosquitto.dir/net_mosq.c.o: lib/dummypthread.h +lib/CMakeFiles/libmosquitto.dir/net_mosq.c.o: lib/logging_mosq.h +lib/CMakeFiles/libmosquitto.dir/net_mosq.c.o: lib/memory_mosq.h +lib/CMakeFiles/libmosquitto.dir/net_mosq.c.o: lib/mosquitto.h +lib/CMakeFiles/libmosquitto.dir/net_mosq.c.o: lib/mosquitto_internal.h +lib/CMakeFiles/libmosquitto.dir/net_mosq.c.o: lib/mqtt3_protocol.h +lib/CMakeFiles/libmosquitto.dir/net_mosq.c.o: lib/net_mosq.h +lib/CMakeFiles/libmosquitto.dir/net_mosq.c.o: lib/read_handle.h +lib/CMakeFiles/libmosquitto.dir/net_mosq.c.o: lib/time_mosq.h +lib/CMakeFiles/libmosquitto.dir/net_mosq.c.o: lib/tls_mosq.h +lib/CMakeFiles/libmosquitto.dir/net_mosq.c.o: lib/util_mosq.h + +lib/CMakeFiles/libmosquitto.dir/read_handle.c.o: lib/read_handle.c +lib/CMakeFiles/libmosquitto.dir/read_handle.c.o: config.h +lib/CMakeFiles/libmosquitto.dir/read_handle.c.o: lib/dummypthread.h +lib/CMakeFiles/libmosquitto.dir/read_handle.c.o: lib/logging_mosq.h +lib/CMakeFiles/libmosquitto.dir/read_handle.c.o: lib/memory_mosq.h +lib/CMakeFiles/libmosquitto.dir/read_handle.c.o: lib/messages_mosq.h +lib/CMakeFiles/libmosquitto.dir/read_handle.c.o: lib/mosquitto.h +lib/CMakeFiles/libmosquitto.dir/read_handle.c.o: lib/mosquitto_internal.h +lib/CMakeFiles/libmosquitto.dir/read_handle.c.o: lib/mqtt3_protocol.h +lib/CMakeFiles/libmosquitto.dir/read_handle.c.o: lib/net_mosq.h +lib/CMakeFiles/libmosquitto.dir/read_handle.c.o: lib/read_handle.h +lib/CMakeFiles/libmosquitto.dir/read_handle.c.o: lib/send_mosq.h +lib/CMakeFiles/libmosquitto.dir/read_handle.c.o: lib/time_mosq.h +lib/CMakeFiles/libmosquitto.dir/read_handle.c.o: lib/tls_mosq.h +lib/CMakeFiles/libmosquitto.dir/read_handle.c.o: lib/util_mosq.h + +lib/CMakeFiles/libmosquitto.dir/read_handle_client.c.o: lib/read_handle_client.c +lib/CMakeFiles/libmosquitto.dir/read_handle_client.c.o: config.h +lib/CMakeFiles/libmosquitto.dir/read_handle_client.c.o: lib/dummypthread.h +lib/CMakeFiles/libmosquitto.dir/read_handle_client.c.o: lib/logging_mosq.h +lib/CMakeFiles/libmosquitto.dir/read_handle_client.c.o: lib/memory_mosq.h +lib/CMakeFiles/libmosquitto.dir/read_handle_client.c.o: lib/mosquitto.h +lib/CMakeFiles/libmosquitto.dir/read_handle_client.c.o: lib/mosquitto_internal.h +lib/CMakeFiles/libmosquitto.dir/read_handle_client.c.o: lib/net_mosq.h +lib/CMakeFiles/libmosquitto.dir/read_handle_client.c.o: lib/read_handle.h +lib/CMakeFiles/libmosquitto.dir/read_handle_client.c.o: lib/time_mosq.h + +lib/CMakeFiles/libmosquitto.dir/read_handle_shared.c.o: lib/read_handle_shared.c +lib/CMakeFiles/libmosquitto.dir/read_handle_shared.c.o: config.h +lib/CMakeFiles/libmosquitto.dir/read_handle_shared.c.o: lib/dummypthread.h +lib/CMakeFiles/libmosquitto.dir/read_handle_shared.c.o: lib/logging_mosq.h +lib/CMakeFiles/libmosquitto.dir/read_handle_shared.c.o: lib/memory_mosq.h +lib/CMakeFiles/libmosquitto.dir/read_handle_shared.c.o: lib/messages_mosq.h +lib/CMakeFiles/libmosquitto.dir/read_handle_shared.c.o: lib/mosquitto.h +lib/CMakeFiles/libmosquitto.dir/read_handle_shared.c.o: lib/mosquitto_internal.h +lib/CMakeFiles/libmosquitto.dir/read_handle_shared.c.o: lib/mqtt3_protocol.h +lib/CMakeFiles/libmosquitto.dir/read_handle_shared.c.o: lib/net_mosq.h +lib/CMakeFiles/libmosquitto.dir/read_handle_shared.c.o: lib/read_handle.h +lib/CMakeFiles/libmosquitto.dir/read_handle_shared.c.o: lib/send_mosq.h +lib/CMakeFiles/libmosquitto.dir/read_handle_shared.c.o: lib/time_mosq.h +lib/CMakeFiles/libmosquitto.dir/read_handle_shared.c.o: lib/tls_mosq.h +lib/CMakeFiles/libmosquitto.dir/read_handle_shared.c.o: lib/util_mosq.h + +lib/CMakeFiles/libmosquitto.dir/send_client_mosq.c.o: lib/send_client_mosq.c +lib/CMakeFiles/libmosquitto.dir/send_client_mosq.c.o: config.h +lib/CMakeFiles/libmosquitto.dir/send_client_mosq.c.o: lib/dummypthread.h +lib/CMakeFiles/libmosquitto.dir/send_client_mosq.c.o: lib/logging_mosq.h +lib/CMakeFiles/libmosquitto.dir/send_client_mosq.c.o: lib/memory_mosq.h +lib/CMakeFiles/libmosquitto.dir/send_client_mosq.c.o: lib/mosquitto.h +lib/CMakeFiles/libmosquitto.dir/send_client_mosq.c.o: lib/mosquitto_internal.h +lib/CMakeFiles/libmosquitto.dir/send_client_mosq.c.o: lib/mqtt3_protocol.h +lib/CMakeFiles/libmosquitto.dir/send_client_mosq.c.o: lib/net_mosq.h +lib/CMakeFiles/libmosquitto.dir/send_client_mosq.c.o: lib/send_mosq.h +lib/CMakeFiles/libmosquitto.dir/send_client_mosq.c.o: lib/time_mosq.h +lib/CMakeFiles/libmosquitto.dir/send_client_mosq.c.o: lib/tls_mosq.h +lib/CMakeFiles/libmosquitto.dir/send_client_mosq.c.o: lib/util_mosq.h + +lib/CMakeFiles/libmosquitto.dir/send_mosq.c.o: lib/send_mosq.c +lib/CMakeFiles/libmosquitto.dir/send_mosq.c.o: config.h +lib/CMakeFiles/libmosquitto.dir/send_mosq.c.o: lib/dummypthread.h +lib/CMakeFiles/libmosquitto.dir/send_mosq.c.o: lib/logging_mosq.h +lib/CMakeFiles/libmosquitto.dir/send_mosq.c.o: lib/memory_mosq.h +lib/CMakeFiles/libmosquitto.dir/send_mosq.c.o: lib/mosquitto.h +lib/CMakeFiles/libmosquitto.dir/send_mosq.c.o: lib/mosquitto_internal.h +lib/CMakeFiles/libmosquitto.dir/send_mosq.c.o: lib/mqtt3_protocol.h +lib/CMakeFiles/libmosquitto.dir/send_mosq.c.o: lib/net_mosq.h +lib/CMakeFiles/libmosquitto.dir/send_mosq.c.o: lib/send_mosq.h +lib/CMakeFiles/libmosquitto.dir/send_mosq.c.o: lib/time_mosq.h +lib/CMakeFiles/libmosquitto.dir/send_mosq.c.o: lib/tls_mosq.h +lib/CMakeFiles/libmosquitto.dir/send_mosq.c.o: lib/util_mosq.h + +lib/CMakeFiles/libmosquitto.dir/socks_mosq.c.o: lib/memory_mosq.h +lib/CMakeFiles/libmosquitto.dir/socks_mosq.c.o: lib/mosquitto.h +lib/CMakeFiles/libmosquitto.dir/socks_mosq.c.o: lib/mosquitto_internal.h +lib/CMakeFiles/libmosquitto.dir/socks_mosq.c.o: lib/net_mosq.h +lib/CMakeFiles/libmosquitto.dir/socks_mosq.c.o: lib/send_mosq.h +lib/CMakeFiles/libmosquitto.dir/socks_mosq.c.o: lib/socks_mosq.c +lib/CMakeFiles/libmosquitto.dir/socks_mosq.c.o: lib/time_mosq.h +lib/CMakeFiles/libmosquitto.dir/socks_mosq.c.o: config.h +lib/CMakeFiles/libmosquitto.dir/socks_mosq.c.o: lib/dummypthread.h + +lib/CMakeFiles/libmosquitto.dir/srv_mosq.c.o: lib/logging_mosq.h +lib/CMakeFiles/libmosquitto.dir/srv_mosq.c.o: lib/memory_mosq.h +lib/CMakeFiles/libmosquitto.dir/srv_mosq.c.o: lib/mosquitto.h +lib/CMakeFiles/libmosquitto.dir/srv_mosq.c.o: lib/mosquitto_internal.h +lib/CMakeFiles/libmosquitto.dir/srv_mosq.c.o: lib/srv_mosq.c +lib/CMakeFiles/libmosquitto.dir/srv_mosq.c.o: lib/time_mosq.h +lib/CMakeFiles/libmosquitto.dir/srv_mosq.c.o: config.h +lib/CMakeFiles/libmosquitto.dir/srv_mosq.c.o: lib/dummypthread.h + +lib/CMakeFiles/libmosquitto.dir/thread_mosq.c.o: lib/thread_mosq.c +lib/CMakeFiles/libmosquitto.dir/thread_mosq.c.o: config.h +lib/CMakeFiles/libmosquitto.dir/thread_mosq.c.o: lib/dummypthread.h +lib/CMakeFiles/libmosquitto.dir/thread_mosq.c.o: lib/mosquitto.h +lib/CMakeFiles/libmosquitto.dir/thread_mosq.c.o: lib/mosquitto_internal.h +lib/CMakeFiles/libmosquitto.dir/thread_mosq.c.o: lib/net_mosq.h +lib/CMakeFiles/libmosquitto.dir/thread_mosq.c.o: lib/time_mosq.h + +lib/CMakeFiles/libmosquitto.dir/time_mosq.c.o: lib/mosquitto.h +lib/CMakeFiles/libmosquitto.dir/time_mosq.c.o: lib/time_mosq.c +lib/CMakeFiles/libmosquitto.dir/time_mosq.c.o: lib/time_mosq.h + +lib/CMakeFiles/libmosquitto.dir/tls_mosq.c.o: lib/mosquitto.h +lib/CMakeFiles/libmosquitto.dir/tls_mosq.c.o: lib/mosquitto_internal.h +lib/CMakeFiles/libmosquitto.dir/tls_mosq.c.o: lib/time_mosq.h +lib/CMakeFiles/libmosquitto.dir/tls_mosq.c.o: lib/tls_mosq.c +lib/CMakeFiles/libmosquitto.dir/tls_mosq.c.o: lib/tls_mosq.h +lib/CMakeFiles/libmosquitto.dir/tls_mosq.c.o: config.h +lib/CMakeFiles/libmosquitto.dir/tls_mosq.c.o: lib/dummypthread.h + +lib/CMakeFiles/libmosquitto.dir/util_mosq.c.o: lib/util_mosq.c +lib/CMakeFiles/libmosquitto.dir/util_mosq.c.o: config.h +lib/CMakeFiles/libmosquitto.dir/util_mosq.c.o: lib/dummypthread.h +lib/CMakeFiles/libmosquitto.dir/util_mosq.c.o: lib/memory_mosq.h +lib/CMakeFiles/libmosquitto.dir/util_mosq.c.o: lib/mosquitto.h +lib/CMakeFiles/libmosquitto.dir/util_mosq.c.o: lib/mosquitto_internal.h +lib/CMakeFiles/libmosquitto.dir/util_mosq.c.o: lib/net_mosq.h +lib/CMakeFiles/libmosquitto.dir/util_mosq.c.o: lib/send_mosq.h +lib/CMakeFiles/libmosquitto.dir/util_mosq.c.o: lib/time_mosq.h +lib/CMakeFiles/libmosquitto.dir/util_mosq.c.o: lib/tls_mosq.h +lib/CMakeFiles/libmosquitto.dir/util_mosq.c.o: lib/util_mosq.h + +lib/CMakeFiles/libmosquitto.dir/will_mosq.c.o: lib/will_mosq.c +lib/CMakeFiles/libmosquitto.dir/will_mosq.c.o: config.h +lib/CMakeFiles/libmosquitto.dir/will_mosq.c.o: lib/dummypthread.h +lib/CMakeFiles/libmosquitto.dir/will_mosq.c.o: lib/memory_mosq.h +lib/CMakeFiles/libmosquitto.dir/will_mosq.c.o: lib/mosquitto.h +lib/CMakeFiles/libmosquitto.dir/will_mosq.c.o: lib/mosquitto_internal.h +lib/CMakeFiles/libmosquitto.dir/will_mosq.c.o: lib/mqtt3_protocol.h +lib/CMakeFiles/libmosquitto.dir/will_mosq.c.o: lib/time_mosq.h + diff --git a/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/flags.make b/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/flags.make new file mode 100644 index 0000000..d402923 --- /dev/null +++ b/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/flags.make @@ -0,0 +1,10 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.10 + +# compile C with /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc +C_FLAGS = -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -fPIC + +C_DEFINES = -DCMAKE -DTIMESTAMP="\"2018-01-23 10:58:26+0100\"" -DVERSION=\"1.4.14\" -DWITH_SOCKS -DWITH_THREADING -Dlibmosquitto_EXPORTS + +C_INCLUDES = -I/Users/benjamin/orchestra/src/libs/mosquitto -I/Users/benjamin/orchestra/src/libs/mosquitto/lib + diff --git a/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/link.txt b/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/link.txt new file mode 100644 index 0000000..aeb3ede --- /dev/null +++ b/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/link.txt @@ -0,0 +1 @@ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -dynamiclib -Wl,-headerpad_max_install_names -compatibility_version 1.0.0 -current_version 1.4.14 -o libmosquitto.1.4.14.dylib -install_name /Users/benjamin/orchestra/src/libs/mosquitto/lib/libmosquitto.1.dylib CMakeFiles/libmosquitto.dir/logging_mosq.c.o CMakeFiles/libmosquitto.dir/memory_mosq.c.o CMakeFiles/libmosquitto.dir/messages_mosq.c.o CMakeFiles/libmosquitto.dir/mosquitto.c.o CMakeFiles/libmosquitto.dir/net_mosq.c.o CMakeFiles/libmosquitto.dir/read_handle.c.o CMakeFiles/libmosquitto.dir/read_handle_client.c.o CMakeFiles/libmosquitto.dir/read_handle_shared.c.o CMakeFiles/libmosquitto.dir/send_client_mosq.c.o CMakeFiles/libmosquitto.dir/send_mosq.c.o CMakeFiles/libmosquitto.dir/socks_mosq.c.o CMakeFiles/libmosquitto.dir/srv_mosq.c.o CMakeFiles/libmosquitto.dir/thread_mosq.c.o CMakeFiles/libmosquitto.dir/time_mosq.c.o CMakeFiles/libmosquitto.dir/tls_mosq.c.o CMakeFiles/libmosquitto.dir/util_mosq.c.o CMakeFiles/libmosquitto.dir/will_mosq.c.o -L/Users/benjamin/orchestra/src/libs/mosquitto/lib -Wl,-rpath,/Users/benjamin/orchestra/src/libs/mosquitto/lib -lpthread diff --git a/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/progress.make b/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/progress.make new file mode 100644 index 0000000..4f47425 --- /dev/null +++ b/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/progress.make @@ -0,0 +1,19 @@ +CMAKE_PROGRESS_1 = 1 +CMAKE_PROGRESS_2 = 2 +CMAKE_PROGRESS_3 = 3 +CMAKE_PROGRESS_4 = 4 +CMAKE_PROGRESS_5 = 5 +CMAKE_PROGRESS_6 = 6 +CMAKE_PROGRESS_7 = 7 +CMAKE_PROGRESS_8 = 8 +CMAKE_PROGRESS_9 = 9 +CMAKE_PROGRESS_10 = 10 +CMAKE_PROGRESS_11 = 11 +CMAKE_PROGRESS_12 = 12 +CMAKE_PROGRESS_13 = 13 +CMAKE_PROGRESS_14 = 14 +CMAKE_PROGRESS_15 = 15 +CMAKE_PROGRESS_16 = 16 +CMAKE_PROGRESS_17 = 17 +CMAKE_PROGRESS_18 = 18 + diff --git a/src/libs/mosquitto/lib/CMakeFiles/progress.marks b/src/libs/mosquitto/lib/CMakeFiles/progress.marks new file mode 100644 index 0000000..209e3ef --- /dev/null +++ b/src/libs/mosquitto/lib/CMakeFiles/progress.marks @@ -0,0 +1 @@ +20 diff --git a/src/libs/mosquitto/lib/CMakeLists.txt b/src/libs/mosquitto/lib/CMakeLists.txt new file mode 100644 index 0000000..07be5d9 --- /dev/null +++ b/src/libs/mosquitto/lib/CMakeLists.txt @@ -0,0 +1,86 @@ +add_subdirectory(cpp) + +option(WITH_THREADING "Include client library threading support?" ON) +if (${WITH_THREADING} STREQUAL ON) + add_definitions("-DWITH_THREADING") + if (WIN32) + set (PTHREAD_LIBRARIES C:\\pthreads\\Pre-built.2\\lib\\x86\\pthreadVC2.lib) + set (PTHREAD_INCLUDE_DIR C:\\pthreads\\Pre-built.2\\include) + else (WIN32) + find_library(LIBPTHREAD pthread) + if (LIBPTHREAD) + set (PTHREAD_LIBRARIES pthread) + else (LIBPTHREAD) + set (PTHREAD_LIBRARIES "") + endif() + set (PTHREAD_INCLUDE_DIR "") + endif (WIN32) +else (${WITH_THREADING} STREQUAL ON) + set (PTHREAD_LIBRARIES "") + set (PTHREAD_INCLUDE_DIR "") +endif (${WITH_THREADING} STREQUAL ON) + +include_directories(${mosquitto_SOURCE_DIR} ${mosquitto_SOURCE_DIR}/lib + ${STDBOOL_H_PATH} ${STDINT_H_PATH} + ${OPENSSL_INCLUDE_DIR} ${PTHREAD_INCLUDE_DIR}) +link_directories(${mosquitto_SOURCE_DIR}/lib) + +add_library(libmosquitto SHARED + logging_mosq.c logging_mosq.h + memory_mosq.c memory_mosq.h + messages_mosq.c messages_mosq.h + mosquitto.c mosquitto.h + mosquitto_internal.h + mqtt3_protocol.h + net_mosq.c net_mosq.h + read_handle.c read_handle.h + read_handle_client.c + read_handle_shared.c + send_client_mosq.c + send_mosq.c send_mosq.h + socks_mosq.c + srv_mosq.c + thread_mosq.c + time_mosq.c + tls_mosq.c + util_mosq.c util_mosq.h + will_mosq.c will_mosq.h) + +set (LIBRARIES ${OPENSSL_LIBRARIES} ${PTHREAD_LIBRARIES}) + +if (UNIX AND NOT APPLE) + find_library(LIBRT rt) + if (LIBRT) + set (LIBRARIES ${LIBRARIES} rt) + endif (LIBRT) +endif (UNIX AND NOT APPLE) + +if (WIN32) + set (LIBRARIES ${LIBRARIES} ws2_32) +endif (WIN32) + +if (${WITH_SRV} STREQUAL ON) + # Simple detect c-ares + find_path(ARES_HEADER ares.h) + if (ARES_HEADER) + add_definitions("-DWITH_SRV") + set (LIBRARIES ${LIBRARIES} cares) + else (ARES_HEADER) + message(WARNING "c-ares library not found.") + endif (ARES_HEADER) +endif (${WITH_SRV} STREQUAL ON) + +target_link_libraries(libmosquitto ${LIBRARIES}) + +set_target_properties(libmosquitto PROPERTIES + OUTPUT_NAME mosquitto + VERSION ${VERSION} + SOVERSION 1 +) + +install(TARGETS libmosquitto RUNTIME DESTINATION "${BINDIR}" LIBRARY DESTINATION "${LIBDIR}") +install(FILES mosquitto.h DESTINATION "${INCLUDEDIR}") + +if (UNIX) + install(CODE "EXEC_PROGRAM(/sbin/ldconfig)") +endif (UNIX) diff --git a/src/libs/mosquitto/lib/Makefile b/src/libs/mosquitto/lib/Makefile new file mode 100644 index 0000000..bad4a60 --- /dev/null +++ b/src/libs/mosquitto/lib/Makefile @@ -0,0 +1,710 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.10 + +# Default target executed when no arguments are given to make. +default_target: all + +.PHONY : default_target + +# Allow only one "make -f Makefile2" at a time, but pass parallelism. +.NOTPARALLEL: + + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + + +# Remove some rules from gmake that .SUFFIXES does not remove. +SUFFIXES = + +.SUFFIXES: .hpux_make_needs_suffix_list + + +# Suppress display of executed commands. +$(VERBOSE).SILENT: + + +# A target that is always out of date. +cmake_force: + +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/local/Cellar/cmake/3.10.1/bin/cmake + +# The command to remove a file. +RM = /usr/local/Cellar/cmake/3.10.1/bin/cmake -E remove -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /Users/benjamin/orchestra/src/libs/mosquitto + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /Users/benjamin/orchestra/src/libs/mosquitto + +#============================================================================= +# Targets provided globally by CMake. + +# Special rule for the target install/local +install/local: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake +.PHONY : install/local + +# Special rule for the target install/local +install/local/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake +.PHONY : install/local/fast + +# Special rule for the target rebuild_cache +rebuild_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : rebuild_cache + +# Special rule for the target rebuild_cache +rebuild_cache/fast: rebuild_cache + +.PHONY : rebuild_cache/fast + +# Special rule for the target edit_cache +edit_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." + /usr/local/Cellar/cmake/3.10.1/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : edit_cache + +# Special rule for the target edit_cache +edit_cache/fast: edit_cache + +.PHONY : edit_cache/fast + +# Special rule for the target install/strip +install/strip: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake +.PHONY : install/strip + +# Special rule for the target install/strip +install/strip/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake +.PHONY : install/strip/fast + +# Special rule for the target install +install: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -P cmake_install.cmake +.PHONY : install + +# Special rule for the target install +install/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -P cmake_install.cmake +.PHONY : install/fast + +# Special rule for the target list_install_components +list_install_components: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\"" +.PHONY : list_install_components + +# Special rule for the target list_install_components +list_install_components/fast: list_install_components + +.PHONY : list_install_components/fast + +# The main all target +all: cmake_check_build_system + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(CMAKE_COMMAND) -E cmake_progress_start /Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles /Users/benjamin/orchestra/src/libs/mosquitto/lib/CMakeFiles/progress.marks + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f CMakeFiles/Makefile2 lib/all + $(CMAKE_COMMAND) -E cmake_progress_start /Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles 0 +.PHONY : all + +# The main clean target +clean: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f CMakeFiles/Makefile2 lib/clean +.PHONY : clean + +# The main clean target +clean/fast: clean + +.PHONY : clean/fast + +# Prepare targets for installation. +preinstall: all + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f CMakeFiles/Makefile2 lib/preinstall +.PHONY : preinstall + +# Prepare targets for installation. +preinstall/fast: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f CMakeFiles/Makefile2 lib/preinstall +.PHONY : preinstall/fast + +# clear depends +depend: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 +.PHONY : depend + +# Convenience name for target. +lib/CMakeFiles/libmosquitto.dir/rule: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f CMakeFiles/Makefile2 lib/CMakeFiles/libmosquitto.dir/rule +.PHONY : lib/CMakeFiles/libmosquitto.dir/rule + +# Convenience name for target. +libmosquitto: lib/CMakeFiles/libmosquitto.dir/rule + +.PHONY : libmosquitto + +# fast build rule for target. +libmosquitto/fast: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/build +.PHONY : libmosquitto/fast + +logging_mosq.o: logging_mosq.c.o + +.PHONY : logging_mosq.o + +# target to build an object file +logging_mosq.c.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/logging_mosq.c.o +.PHONY : logging_mosq.c.o + +logging_mosq.i: logging_mosq.c.i + +.PHONY : logging_mosq.i + +# target to preprocess a source file +logging_mosq.c.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/logging_mosq.c.i +.PHONY : logging_mosq.c.i + +logging_mosq.s: logging_mosq.c.s + +.PHONY : logging_mosq.s + +# target to generate assembly for a file +logging_mosq.c.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/logging_mosq.c.s +.PHONY : logging_mosq.c.s + +memory_mosq.o: memory_mosq.c.o + +.PHONY : memory_mosq.o + +# target to build an object file +memory_mosq.c.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/memory_mosq.c.o +.PHONY : memory_mosq.c.o + +memory_mosq.i: memory_mosq.c.i + +.PHONY : memory_mosq.i + +# target to preprocess a source file +memory_mosq.c.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/memory_mosq.c.i +.PHONY : memory_mosq.c.i + +memory_mosq.s: memory_mosq.c.s + +.PHONY : memory_mosq.s + +# target to generate assembly for a file +memory_mosq.c.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/memory_mosq.c.s +.PHONY : memory_mosq.c.s + +messages_mosq.o: messages_mosq.c.o + +.PHONY : messages_mosq.o + +# target to build an object file +messages_mosq.c.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/messages_mosq.c.o +.PHONY : messages_mosq.c.o + +messages_mosq.i: messages_mosq.c.i + +.PHONY : messages_mosq.i + +# target to preprocess a source file +messages_mosq.c.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/messages_mosq.c.i +.PHONY : messages_mosq.c.i + +messages_mosq.s: messages_mosq.c.s + +.PHONY : messages_mosq.s + +# target to generate assembly for a file +messages_mosq.c.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/messages_mosq.c.s +.PHONY : messages_mosq.c.s + +mosquitto.o: mosquitto.c.o + +.PHONY : mosquitto.o + +# target to build an object file +mosquitto.c.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/mosquitto.c.o +.PHONY : mosquitto.c.o + +mosquitto.i: mosquitto.c.i + +.PHONY : mosquitto.i + +# target to preprocess a source file +mosquitto.c.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/mosquitto.c.i +.PHONY : mosquitto.c.i + +mosquitto.s: mosquitto.c.s + +.PHONY : mosquitto.s + +# target to generate assembly for a file +mosquitto.c.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/mosquitto.c.s +.PHONY : mosquitto.c.s + +net_mosq.o: net_mosq.c.o + +.PHONY : net_mosq.o + +# target to build an object file +net_mosq.c.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/net_mosq.c.o +.PHONY : net_mosq.c.o + +net_mosq.i: net_mosq.c.i + +.PHONY : net_mosq.i + +# target to preprocess a source file +net_mosq.c.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/net_mosq.c.i +.PHONY : net_mosq.c.i + +net_mosq.s: net_mosq.c.s + +.PHONY : net_mosq.s + +# target to generate assembly for a file +net_mosq.c.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/net_mosq.c.s +.PHONY : net_mosq.c.s + +read_handle.o: read_handle.c.o + +.PHONY : read_handle.o + +# target to build an object file +read_handle.c.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/read_handle.c.o +.PHONY : read_handle.c.o + +read_handle.i: read_handle.c.i + +.PHONY : read_handle.i + +# target to preprocess a source file +read_handle.c.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/read_handle.c.i +.PHONY : read_handle.c.i + +read_handle.s: read_handle.c.s + +.PHONY : read_handle.s + +# target to generate assembly for a file +read_handle.c.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/read_handle.c.s +.PHONY : read_handle.c.s + +read_handle_client.o: read_handle_client.c.o + +.PHONY : read_handle_client.o + +# target to build an object file +read_handle_client.c.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/read_handle_client.c.o +.PHONY : read_handle_client.c.o + +read_handle_client.i: read_handle_client.c.i + +.PHONY : read_handle_client.i + +# target to preprocess a source file +read_handle_client.c.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/read_handle_client.c.i +.PHONY : read_handle_client.c.i + +read_handle_client.s: read_handle_client.c.s + +.PHONY : read_handle_client.s + +# target to generate assembly for a file +read_handle_client.c.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/read_handle_client.c.s +.PHONY : read_handle_client.c.s + +read_handle_shared.o: read_handle_shared.c.o + +.PHONY : read_handle_shared.o + +# target to build an object file +read_handle_shared.c.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/read_handle_shared.c.o +.PHONY : read_handle_shared.c.o + +read_handle_shared.i: read_handle_shared.c.i + +.PHONY : read_handle_shared.i + +# target to preprocess a source file +read_handle_shared.c.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/read_handle_shared.c.i +.PHONY : read_handle_shared.c.i + +read_handle_shared.s: read_handle_shared.c.s + +.PHONY : read_handle_shared.s + +# target to generate assembly for a file +read_handle_shared.c.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/read_handle_shared.c.s +.PHONY : read_handle_shared.c.s + +send_client_mosq.o: send_client_mosq.c.o + +.PHONY : send_client_mosq.o + +# target to build an object file +send_client_mosq.c.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/send_client_mosq.c.o +.PHONY : send_client_mosq.c.o + +send_client_mosq.i: send_client_mosq.c.i + +.PHONY : send_client_mosq.i + +# target to preprocess a source file +send_client_mosq.c.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/send_client_mosq.c.i +.PHONY : send_client_mosq.c.i + +send_client_mosq.s: send_client_mosq.c.s + +.PHONY : send_client_mosq.s + +# target to generate assembly for a file +send_client_mosq.c.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/send_client_mosq.c.s +.PHONY : send_client_mosq.c.s + +send_mosq.o: send_mosq.c.o + +.PHONY : send_mosq.o + +# target to build an object file +send_mosq.c.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/send_mosq.c.o +.PHONY : send_mosq.c.o + +send_mosq.i: send_mosq.c.i + +.PHONY : send_mosq.i + +# target to preprocess a source file +send_mosq.c.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/send_mosq.c.i +.PHONY : send_mosq.c.i + +send_mosq.s: send_mosq.c.s + +.PHONY : send_mosq.s + +# target to generate assembly for a file +send_mosq.c.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/send_mosq.c.s +.PHONY : send_mosq.c.s + +socks_mosq.o: socks_mosq.c.o + +.PHONY : socks_mosq.o + +# target to build an object file +socks_mosq.c.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/socks_mosq.c.o +.PHONY : socks_mosq.c.o + +socks_mosq.i: socks_mosq.c.i + +.PHONY : socks_mosq.i + +# target to preprocess a source file +socks_mosq.c.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/socks_mosq.c.i +.PHONY : socks_mosq.c.i + +socks_mosq.s: socks_mosq.c.s + +.PHONY : socks_mosq.s + +# target to generate assembly for a file +socks_mosq.c.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/socks_mosq.c.s +.PHONY : socks_mosq.c.s + +srv_mosq.o: srv_mosq.c.o + +.PHONY : srv_mosq.o + +# target to build an object file +srv_mosq.c.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/srv_mosq.c.o +.PHONY : srv_mosq.c.o + +srv_mosq.i: srv_mosq.c.i + +.PHONY : srv_mosq.i + +# target to preprocess a source file +srv_mosq.c.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/srv_mosq.c.i +.PHONY : srv_mosq.c.i + +srv_mosq.s: srv_mosq.c.s + +.PHONY : srv_mosq.s + +# target to generate assembly for a file +srv_mosq.c.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/srv_mosq.c.s +.PHONY : srv_mosq.c.s + +thread_mosq.o: thread_mosq.c.o + +.PHONY : thread_mosq.o + +# target to build an object file +thread_mosq.c.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/thread_mosq.c.o +.PHONY : thread_mosq.c.o + +thread_mosq.i: thread_mosq.c.i + +.PHONY : thread_mosq.i + +# target to preprocess a source file +thread_mosq.c.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/thread_mosq.c.i +.PHONY : thread_mosq.c.i + +thread_mosq.s: thread_mosq.c.s + +.PHONY : thread_mosq.s + +# target to generate assembly for a file +thread_mosq.c.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/thread_mosq.c.s +.PHONY : thread_mosq.c.s + +time_mosq.o: time_mosq.c.o + +.PHONY : time_mosq.o + +# target to build an object file +time_mosq.c.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/time_mosq.c.o +.PHONY : time_mosq.c.o + +time_mosq.i: time_mosq.c.i + +.PHONY : time_mosq.i + +# target to preprocess a source file +time_mosq.c.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/time_mosq.c.i +.PHONY : time_mosq.c.i + +time_mosq.s: time_mosq.c.s + +.PHONY : time_mosq.s + +# target to generate assembly for a file +time_mosq.c.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/time_mosq.c.s +.PHONY : time_mosq.c.s + +tls_mosq.o: tls_mosq.c.o + +.PHONY : tls_mosq.o + +# target to build an object file +tls_mosq.c.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/tls_mosq.c.o +.PHONY : tls_mosq.c.o + +tls_mosq.i: tls_mosq.c.i + +.PHONY : tls_mosq.i + +# target to preprocess a source file +tls_mosq.c.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/tls_mosq.c.i +.PHONY : tls_mosq.c.i + +tls_mosq.s: tls_mosq.c.s + +.PHONY : tls_mosq.s + +# target to generate assembly for a file +tls_mosq.c.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/tls_mosq.c.s +.PHONY : tls_mosq.c.s + +util_mosq.o: util_mosq.c.o + +.PHONY : util_mosq.o + +# target to build an object file +util_mosq.c.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/util_mosq.c.o +.PHONY : util_mosq.c.o + +util_mosq.i: util_mosq.c.i + +.PHONY : util_mosq.i + +# target to preprocess a source file +util_mosq.c.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/util_mosq.c.i +.PHONY : util_mosq.c.i + +util_mosq.s: util_mosq.c.s + +.PHONY : util_mosq.s + +# target to generate assembly for a file +util_mosq.c.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/util_mosq.c.s +.PHONY : util_mosq.c.s + +will_mosq.o: will_mosq.c.o + +.PHONY : will_mosq.o + +# target to build an object file +will_mosq.c.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/will_mosq.c.o +.PHONY : will_mosq.c.o + +will_mosq.i: will_mosq.c.i + +.PHONY : will_mosq.i + +# target to preprocess a source file +will_mosq.c.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/will_mosq.c.i +.PHONY : will_mosq.c.i + +will_mosq.s: will_mosq.c.s + +.PHONY : will_mosq.s + +# target to generate assembly for a file +will_mosq.c.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/CMakeFiles/libmosquitto.dir/build.make lib/CMakeFiles/libmosquitto.dir/will_mosq.c.s +.PHONY : will_mosq.c.s + +# Help Target +help: + @echo "The following are some of the valid targets for this Makefile:" + @echo "... all (the default if no target is provided)" + @echo "... clean" + @echo "... depend" + @echo "... install/local" + @echo "... libmosquitto" + @echo "... rebuild_cache" + @echo "... edit_cache" + @echo "... install/strip" + @echo "... install" + @echo "... list_install_components" + @echo "... logging_mosq.o" + @echo "... logging_mosq.i" + @echo "... logging_mosq.s" + @echo "... memory_mosq.o" + @echo "... memory_mosq.i" + @echo "... memory_mosq.s" + @echo "... messages_mosq.o" + @echo "... messages_mosq.i" + @echo "... messages_mosq.s" + @echo "... mosquitto.o" + @echo "... mosquitto.i" + @echo "... mosquitto.s" + @echo "... net_mosq.o" + @echo "... net_mosq.i" + @echo "... net_mosq.s" + @echo "... read_handle.o" + @echo "... read_handle.i" + @echo "... read_handle.s" + @echo "... read_handle_client.o" + @echo "... read_handle_client.i" + @echo "... read_handle_client.s" + @echo "... read_handle_shared.o" + @echo "... read_handle_shared.i" + @echo "... read_handle_shared.s" + @echo "... send_client_mosq.o" + @echo "... send_client_mosq.i" + @echo "... send_client_mosq.s" + @echo "... send_mosq.o" + @echo "... send_mosq.i" + @echo "... send_mosq.s" + @echo "... socks_mosq.o" + @echo "... socks_mosq.i" + @echo "... socks_mosq.s" + @echo "... srv_mosq.o" + @echo "... srv_mosq.i" + @echo "... srv_mosq.s" + @echo "... thread_mosq.o" + @echo "... thread_mosq.i" + @echo "... thread_mosq.s" + @echo "... time_mosq.o" + @echo "... time_mosq.i" + @echo "... time_mosq.s" + @echo "... tls_mosq.o" + @echo "... tls_mosq.i" + @echo "... tls_mosq.s" + @echo "... util_mosq.o" + @echo "... util_mosq.i" + @echo "... util_mosq.s" + @echo "... will_mosq.o" + @echo "... will_mosq.i" + @echo "... will_mosq.s" +.PHONY : help + + + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system + diff --git a/src/libs/mosquitto/lib/cmake_install.cmake b/src/libs/mosquitto/lib/cmake_install.cmake new file mode 100644 index 0000000..19683c2 --- /dev/null +++ b/src/libs/mosquitto/lib/cmake_install.cmake @@ -0,0 +1,77 @@ +# Install script for directory: /Users/benjamin/orchestra/src/libs/mosquitto/lib + +# Set the install prefix +if(NOT DEFINED CMAKE_INSTALL_PREFIX) + set(CMAKE_INSTALL_PREFIX "/usr/local") +endif() +string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") + +# Set the install configuration name. +if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) + if(BUILD_TYPE) + string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" + CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") + else() + set(CMAKE_INSTALL_CONFIG_NAME "") + endif() + message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") +endif() + +# Set the component getting installed. +if(NOT CMAKE_INSTALL_COMPONENT) + if(COMPONENT) + message(STATUS "Install component: \"${COMPONENT}\"") + set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") + else() + set(CMAKE_INSTALL_COMPONENT) + endif() +endif() + +# Is this installation the result of a crosscompile? +if(NOT DEFINED CMAKE_CROSSCOMPILING) + set(CMAKE_CROSSCOMPILING "FALSE") +endif() + +if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" OR NOT CMAKE_INSTALL_COMPONENT) + file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" TYPE SHARED_LIBRARY FILES + "/Users/benjamin/orchestra/src/libs/mosquitto/lib/libmosquitto.1.4.14.dylib" + "/Users/benjamin/orchestra/src/libs/mosquitto/lib/libmosquitto.1.dylib" + "/Users/benjamin/orchestra/src/libs/mosquitto/lib/libmosquitto.dylib" + ) + foreach(file + "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libmosquitto.1.4.14.dylib" + "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libmosquitto.1.dylib" + "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libmosquitto.dylib" + ) + if(EXISTS "${file}" AND + NOT IS_SYMLINK "${file}") + execute_process(COMMAND "/usr/bin/install_name_tool" + -id "libmosquitto.1.dylib" + "${file}") + execute_process(COMMAND /usr/bin/install_name_tool + -delete_rpath "/Users/benjamin/orchestra/src/libs/mosquitto/lib" + "${file}") + execute_process(COMMAND /usr/bin/install_name_tool + -add_rpath "/usr/local/lib" + "${file}") + if(CMAKE_INSTALL_DO_STRIP) + execute_process(COMMAND "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip" "${file}") + endif() + endif() + endforeach() +endif() + +if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" OR NOT CMAKE_INSTALL_COMPONENT) + file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/include" TYPE FILE FILES "/Users/benjamin/orchestra/src/libs/mosquitto/lib/mosquitto.h") +endif() + +if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" OR NOT CMAKE_INSTALL_COMPONENT) + EXEC_PROGRAM(/sbin/ldconfig) +endif() + +if(NOT CMAKE_INSTALL_LOCAL_ONLY) + # Include the install script for each subdirectory. + include("/Users/benjamin/orchestra/src/libs/mosquitto/lib/cpp/cmake_install.cmake") + +endif() + diff --git a/src/libs/mosquitto/lib/cpp/CMakeFiles/CMakeDirectoryInformation.cmake b/src/libs/mosquitto/lib/cpp/CMakeFiles/CMakeDirectoryInformation.cmake new file mode 100644 index 0000000..8cf4b23 --- /dev/null +++ b/src/libs/mosquitto/lib/cpp/CMakeFiles/CMakeDirectoryInformation.cmake @@ -0,0 +1,16 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.10 + +# Relative path conversion top directories. +set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/Users/benjamin/orchestra/src/libs/mosquitto") +set(CMAKE_RELATIVE_PATH_TOP_BINARY "/Users/benjamin/orchestra/src/libs/mosquitto") + +# Force unix paths in dependencies. +set(CMAKE_FORCE_UNIX_PATHS 1) + + +# The C and CXX include file regular expressions for this directory. +set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") +set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") +set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) +set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) diff --git a/src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/CXX.includecache b/src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/CXX.includecache new file mode 100644 index 0000000..4f117da --- /dev/null +++ b/src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/CXX.includecache @@ -0,0 +1,28 @@ +#IncludeRegexLine: ^[ ]*[#%][ ]*(include|import)[ ]*[<"]([^">]+)([">]) + +#IncludeRegexScan: ^.*$ + +#IncludeRegexComplain: ^$ + +#IncludeRegexTransform: + +/Users/benjamin/orchestra/src/libs/mosquitto/lib/cpp/mosquittopp.cpp +cstdlib +- +mosquitto.h +- +mosquittopp.h +- + +lib/cpp/mosquittopp.h +cstdlib +- +mosquitto.h +- +time.h +- + +lib/mosquitto.h +stdbool.h +- + diff --git a/src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/DependInfo.cmake b/src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/DependInfo.cmake new file mode 100644 index 0000000..c553d48 --- /dev/null +++ b/src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/DependInfo.cmake @@ -0,0 +1,38 @@ +# The set of languages for which implicit dependencies are needed: +set(CMAKE_DEPENDS_LANGUAGES + "CXX" + ) +# The set of files for implicit dependencies of each language: +set(CMAKE_DEPENDS_CHECK_CXX + "/Users/benjamin/orchestra/src/libs/mosquitto/lib/cpp/mosquittopp.cpp" "/Users/benjamin/orchestra/src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/mosquittopp.cpp.o" + ) +set(CMAKE_CXX_COMPILER_ID "Clang") + +# Preprocessor definitions for this target. +set(CMAKE_TARGET_DEFINITIONS_CXX + "CMAKE" + "TIMESTAMP=\"2018-01-23 10:58:26+0100\"" + "VERSION=\"1.4.14\"" + "WITH_SOCKS" + ) + +# The include file search paths: +set(CMAKE_CXX_TARGET_INCLUDE_PATH + "lib" + "lib/cpp" + ) + +# Pairs of files generated by the same build rule. +set(CMAKE_MULTIPLE_OUTPUT_PAIRS + "/Users/benjamin/orchestra/src/libs/mosquitto/lib/cpp/libmosquittopp.1.dylib" "/Users/benjamin/orchestra/src/libs/mosquitto/lib/cpp/libmosquittopp.1.4.14.dylib" + "/Users/benjamin/orchestra/src/libs/mosquitto/lib/cpp/libmosquittopp.dylib" "/Users/benjamin/orchestra/src/libs/mosquitto/lib/cpp/libmosquittopp.1.4.14.dylib" + ) + + +# Targets to which this target links. +set(CMAKE_TARGET_LINKED_INFO_FILES + "/Users/benjamin/orchestra/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/DependInfo.cmake" + ) + +# Fortran module output directory. +set(CMAKE_Fortran_TARGET_MODULE_DIR "") diff --git a/src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/build.make b/src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/build.make new file mode 100644 index 0000000..bdc32a5 --- /dev/null +++ b/src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/build.make @@ -0,0 +1,121 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.10 + +# Delete rule output on recipe failure. +.DELETE_ON_ERROR: + + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + + +# Remove some rules from gmake that .SUFFIXES does not remove. +SUFFIXES = + +.SUFFIXES: .hpux_make_needs_suffix_list + + +# Suppress display of executed commands. +$(VERBOSE).SILENT: + + +# A target that is always out of date. +cmake_force: + +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/local/Cellar/cmake/3.10.1/bin/cmake + +# The command to remove a file. +RM = /usr/local/Cellar/cmake/3.10.1/bin/cmake -E remove -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /Users/benjamin/orchestra/src/libs/mosquitto + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /Users/benjamin/orchestra/src/libs/mosquitto + +# Include any dependencies generated for this target. +include lib/cpp/CMakeFiles/mosquittopp.dir/depend.make + +# Include the progress variables for this target. +include lib/cpp/CMakeFiles/mosquittopp.dir/progress.make + +# Include the compile flags for this target's objects. +include lib/cpp/CMakeFiles/mosquittopp.dir/flags.make + +lib/cpp/CMakeFiles/mosquittopp.dir/mosquittopp.cpp.o: lib/cpp/CMakeFiles/mosquittopp.dir/flags.make +lib/cpp/CMakeFiles/mosquittopp.dir/mosquittopp.cpp.o: lib/cpp/mosquittopp.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building CXX object lib/cpp/CMakeFiles/mosquittopp.dir/mosquittopp.cpp.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib/cpp && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/mosquittopp.dir/mosquittopp.cpp.o -c /Users/benjamin/orchestra/src/libs/mosquitto/lib/cpp/mosquittopp.cpp + +lib/cpp/CMakeFiles/mosquittopp.dir/mosquittopp.cpp.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/mosquittopp.dir/mosquittopp.cpp.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib/cpp && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/lib/cpp/mosquittopp.cpp > CMakeFiles/mosquittopp.dir/mosquittopp.cpp.i + +lib/cpp/CMakeFiles/mosquittopp.dir/mosquittopp.cpp.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/mosquittopp.dir/mosquittopp.cpp.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib/cpp && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/lib/cpp/mosquittopp.cpp -o CMakeFiles/mosquittopp.dir/mosquittopp.cpp.s + +lib/cpp/CMakeFiles/mosquittopp.dir/mosquittopp.cpp.o.requires: + +.PHONY : lib/cpp/CMakeFiles/mosquittopp.dir/mosquittopp.cpp.o.requires + +lib/cpp/CMakeFiles/mosquittopp.dir/mosquittopp.cpp.o.provides: lib/cpp/CMakeFiles/mosquittopp.dir/mosquittopp.cpp.o.requires + $(MAKE) -f lib/cpp/CMakeFiles/mosquittopp.dir/build.make lib/cpp/CMakeFiles/mosquittopp.dir/mosquittopp.cpp.o.provides.build +.PHONY : lib/cpp/CMakeFiles/mosquittopp.dir/mosquittopp.cpp.o.provides + +lib/cpp/CMakeFiles/mosquittopp.dir/mosquittopp.cpp.o.provides.build: lib/cpp/CMakeFiles/mosquittopp.dir/mosquittopp.cpp.o + + +# Object files for target mosquittopp +mosquittopp_OBJECTS = \ +"CMakeFiles/mosquittopp.dir/mosquittopp.cpp.o" + +# External object files for target mosquittopp +mosquittopp_EXTERNAL_OBJECTS = + +lib/cpp/libmosquittopp.1.4.14.dylib: lib/cpp/CMakeFiles/mosquittopp.dir/mosquittopp.cpp.o +lib/cpp/libmosquittopp.1.4.14.dylib: lib/cpp/CMakeFiles/mosquittopp.dir/build.make +lib/cpp/libmosquittopp.1.4.14.dylib: lib/libmosquitto.1.4.14.dylib +lib/cpp/libmosquittopp.1.4.14.dylib: lib/cpp/CMakeFiles/mosquittopp.dir/link.txt + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Linking CXX shared library libmosquittopp.dylib" + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib/cpp && $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/mosquittopp.dir/link.txt --verbose=$(VERBOSE) + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib/cpp && $(CMAKE_COMMAND) -E cmake_symlink_library libmosquittopp.1.4.14.dylib libmosquittopp.1.dylib libmosquittopp.dylib + +lib/cpp/libmosquittopp.1.dylib: lib/cpp/libmosquittopp.1.4.14.dylib + @$(CMAKE_COMMAND) -E touch_nocreate lib/cpp/libmosquittopp.1.dylib + +lib/cpp/libmosquittopp.dylib: lib/cpp/libmosquittopp.1.4.14.dylib + @$(CMAKE_COMMAND) -E touch_nocreate lib/cpp/libmosquittopp.dylib + +# Rule to build all files generated by this target. +lib/cpp/CMakeFiles/mosquittopp.dir/build: lib/cpp/libmosquittopp.dylib + +.PHONY : lib/cpp/CMakeFiles/mosquittopp.dir/build + +lib/cpp/CMakeFiles/mosquittopp.dir/requires: lib/cpp/CMakeFiles/mosquittopp.dir/mosquittopp.cpp.o.requires + +.PHONY : lib/cpp/CMakeFiles/mosquittopp.dir/requires + +lib/cpp/CMakeFiles/mosquittopp.dir/clean: + cd /Users/benjamin/orchestra/src/libs/mosquitto/lib/cpp && $(CMAKE_COMMAND) -P CMakeFiles/mosquittopp.dir/cmake_clean.cmake +.PHONY : lib/cpp/CMakeFiles/mosquittopp.dir/clean + +lib/cpp/CMakeFiles/mosquittopp.dir/depend: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /Users/benjamin/orchestra/src/libs/mosquitto /Users/benjamin/orchestra/src/libs/mosquitto/lib/cpp /Users/benjamin/orchestra/src/libs/mosquitto /Users/benjamin/orchestra/src/libs/mosquitto/lib/cpp /Users/benjamin/orchestra/src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/DependInfo.cmake --color=$(COLOR) +.PHONY : lib/cpp/CMakeFiles/mosquittopp.dir/depend + diff --git a/src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/cmake_clean.cmake b/src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/cmake_clean.cmake new file mode 100644 index 0000000..47b3ada --- /dev/null +++ b/src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/cmake_clean.cmake @@ -0,0 +1,12 @@ +file(REMOVE_RECURSE + "CMakeFiles/mosquittopp.dir/mosquittopp.cpp.o" + "libmosquittopp.pdb" + "libmosquittopp.1.4.14.dylib" + "libmosquittopp.dylib" + "libmosquittopp.1.dylib" +) + +# Per-language clean rules from dependency scanning. +foreach(lang CXX) + include(CMakeFiles/mosquittopp.dir/cmake_clean_${lang}.cmake OPTIONAL) +endforeach() diff --git a/src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/depend.internal b/src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/depend.internal new file mode 100644 index 0000000..53c68dd --- /dev/null +++ b/src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/depend.internal @@ -0,0 +1,7 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.10 + +lib/cpp/CMakeFiles/mosquittopp.dir/mosquittopp.cpp.o + /Users/benjamin/orchestra/src/libs/mosquitto/lib/cpp/mosquittopp.cpp + lib/cpp/mosquittopp.h + lib/mosquitto.h diff --git a/src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/depend.make b/src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/depend.make new file mode 100644 index 0000000..0a9fbd9 --- /dev/null +++ b/src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/depend.make @@ -0,0 +1,7 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.10 + +lib/cpp/CMakeFiles/mosquittopp.dir/mosquittopp.cpp.o: lib/cpp/mosquittopp.cpp +lib/cpp/CMakeFiles/mosquittopp.dir/mosquittopp.cpp.o: lib/cpp/mosquittopp.h +lib/cpp/CMakeFiles/mosquittopp.dir/mosquittopp.cpp.o: lib/mosquitto.h + diff --git a/src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/flags.make b/src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/flags.make new file mode 100644 index 0000000..486eda3 --- /dev/null +++ b/src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/flags.make @@ -0,0 +1,10 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.10 + +# compile CXX with /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ +CXX_FLAGS = -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -fPIC + +CXX_DEFINES = -DCMAKE -DTIMESTAMP="\"2018-01-23 10:58:26+0100\"" -DVERSION=\"1.4.14\" -DWITH_SOCKS -Dmosquittopp_EXPORTS + +CXX_INCLUDES = -I/Users/benjamin/orchestra/src/libs/mosquitto/lib -I/Users/benjamin/orchestra/src/libs/mosquitto/lib/cpp + diff --git a/src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/link.txt b/src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/link.txt new file mode 100644 index 0000000..e2f25ba --- /dev/null +++ b/src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/link.txt @@ -0,0 +1 @@ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -dynamiclib -Wl,-headerpad_max_install_names -compatibility_version 1.0.0 -current_version 1.4.14 -o libmosquittopp.1.4.14.dylib -install_name /Users/benjamin/orchestra/src/libs/mosquitto/lib/cpp/libmosquittopp.1.dylib CMakeFiles/mosquittopp.dir/mosquittopp.cpp.o -L/Users/benjamin/orchestra/src/libs/mosquitto/lib -Wl,-rpath,/Users/benjamin/orchestra/src/libs/mosquitto/lib ../libmosquitto.1.4.14.dylib -lpthread diff --git a/src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/progress.make b/src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/progress.make new file mode 100644 index 0000000..f524363 --- /dev/null +++ b/src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/progress.make @@ -0,0 +1,3 @@ +CMAKE_PROGRESS_1 = 53 +CMAKE_PROGRESS_2 = 54 + diff --git a/src/libs/mosquitto/lib/cpp/CMakeFiles/progress.marks b/src/libs/mosquitto/lib/cpp/CMakeFiles/progress.marks new file mode 100644 index 0000000..209e3ef --- /dev/null +++ b/src/libs/mosquitto/lib/cpp/CMakeFiles/progress.marks @@ -0,0 +1 @@ +20 diff --git a/src/libs/mosquitto/lib/cpp/CMakeLists.txt b/src/libs/mosquitto/lib/cpp/CMakeLists.txt new file mode 100644 index 0000000..b80dc18 --- /dev/null +++ b/src/libs/mosquitto/lib/cpp/CMakeLists.txt @@ -0,0 +1,18 @@ +include_directories(${mosquitto_SOURCE_DIR}/lib ${mosquitto_SOURCE_DIR}/lib/cpp + ${STDBOOL_H_PATH} ${STDINT_H_PATH}) +link_directories(${mosquitto_BINARY_DIR}/lib) + +add_library(mosquittopp SHARED + mosquittopp.cpp mosquittopp.h) + +target_link_libraries(mosquittopp libmosquitto) +set_target_properties(mosquittopp PROPERTIES + VERSION ${VERSION} + SOVERSION 1 +) +install(TARGETS mosquittopp RUNTIME DESTINATION "${BINDIR}" LIBRARY DESTINATION "${LIBDIR}") +install(FILES mosquittopp.h DESTINATION "${INCLUDEDIR}") + +if (UNIX) + install(CODE "EXEC_PROGRAM(/sbin/ldconfig)") +endif (UNIX) diff --git a/src/libs/mosquitto/lib/cpp/Makefile b/src/libs/mosquitto/lib/cpp/Makefile new file mode 100644 index 0000000..b2390f8 --- /dev/null +++ b/src/libs/mosquitto/lib/cpp/Makefile @@ -0,0 +1,230 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.10 + +# Default target executed when no arguments are given to make. +default_target: all + +.PHONY : default_target + +# Allow only one "make -f Makefile2" at a time, but pass parallelism. +.NOTPARALLEL: + + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + + +# Remove some rules from gmake that .SUFFIXES does not remove. +SUFFIXES = + +.SUFFIXES: .hpux_make_needs_suffix_list + + +# Suppress display of executed commands. +$(VERBOSE).SILENT: + + +# A target that is always out of date. +cmake_force: + +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/local/Cellar/cmake/3.10.1/bin/cmake + +# The command to remove a file. +RM = /usr/local/Cellar/cmake/3.10.1/bin/cmake -E remove -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /Users/benjamin/orchestra/src/libs/mosquitto + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /Users/benjamin/orchestra/src/libs/mosquitto + +#============================================================================= +# Targets provided globally by CMake. + +# Special rule for the target install/local +install/local: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake +.PHONY : install/local + +# Special rule for the target install/local +install/local/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake +.PHONY : install/local/fast + +# Special rule for the target install/strip +install/strip: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake +.PHONY : install/strip + +# Special rule for the target install/strip +install/strip/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake +.PHONY : install/strip/fast + +# Special rule for the target install +install: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -P cmake_install.cmake +.PHONY : install + +# Special rule for the target install +install/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -P cmake_install.cmake +.PHONY : install/fast + +# Special rule for the target list_install_components +list_install_components: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\"" +.PHONY : list_install_components + +# Special rule for the target list_install_components +list_install_components/fast: list_install_components + +.PHONY : list_install_components/fast + +# Special rule for the target rebuild_cache +rebuild_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : rebuild_cache + +# Special rule for the target rebuild_cache +rebuild_cache/fast: rebuild_cache + +.PHONY : rebuild_cache/fast + +# Special rule for the target edit_cache +edit_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." + /usr/local/Cellar/cmake/3.10.1/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : edit_cache + +# Special rule for the target edit_cache +edit_cache/fast: edit_cache + +.PHONY : edit_cache/fast + +# The main all target +all: cmake_check_build_system + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(CMAKE_COMMAND) -E cmake_progress_start /Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles /Users/benjamin/orchestra/src/libs/mosquitto/lib/cpp/CMakeFiles/progress.marks + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f CMakeFiles/Makefile2 lib/cpp/all + $(CMAKE_COMMAND) -E cmake_progress_start /Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles 0 +.PHONY : all + +# The main clean target +clean: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f CMakeFiles/Makefile2 lib/cpp/clean +.PHONY : clean + +# The main clean target +clean/fast: clean + +.PHONY : clean/fast + +# Prepare targets for installation. +preinstall: all + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f CMakeFiles/Makefile2 lib/cpp/preinstall +.PHONY : preinstall + +# Prepare targets for installation. +preinstall/fast: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f CMakeFiles/Makefile2 lib/cpp/preinstall +.PHONY : preinstall/fast + +# clear depends +depend: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 +.PHONY : depend + +# Convenience name for target. +lib/cpp/CMakeFiles/mosquittopp.dir/rule: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f CMakeFiles/Makefile2 lib/cpp/CMakeFiles/mosquittopp.dir/rule +.PHONY : lib/cpp/CMakeFiles/mosquittopp.dir/rule + +# Convenience name for target. +mosquittopp: lib/cpp/CMakeFiles/mosquittopp.dir/rule + +.PHONY : mosquittopp + +# fast build rule for target. +mosquittopp/fast: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/cpp/CMakeFiles/mosquittopp.dir/build.make lib/cpp/CMakeFiles/mosquittopp.dir/build +.PHONY : mosquittopp/fast + +mosquittopp.o: mosquittopp.cpp.o + +.PHONY : mosquittopp.o + +# target to build an object file +mosquittopp.cpp.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/cpp/CMakeFiles/mosquittopp.dir/build.make lib/cpp/CMakeFiles/mosquittopp.dir/mosquittopp.cpp.o +.PHONY : mosquittopp.cpp.o + +mosquittopp.i: mosquittopp.cpp.i + +.PHONY : mosquittopp.i + +# target to preprocess a source file +mosquittopp.cpp.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/cpp/CMakeFiles/mosquittopp.dir/build.make lib/cpp/CMakeFiles/mosquittopp.dir/mosquittopp.cpp.i +.PHONY : mosquittopp.cpp.i + +mosquittopp.s: mosquittopp.cpp.s + +.PHONY : mosquittopp.s + +# target to generate assembly for a file +mosquittopp.cpp.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f lib/cpp/CMakeFiles/mosquittopp.dir/build.make lib/cpp/CMakeFiles/mosquittopp.dir/mosquittopp.cpp.s +.PHONY : mosquittopp.cpp.s + +# Help Target +help: + @echo "The following are some of the valid targets for this Makefile:" + @echo "... all (the default if no target is provided)" + @echo "... clean" + @echo "... depend" + @echo "... install/local" + @echo "... install/strip" + @echo "... install" + @echo "... mosquittopp" + @echo "... list_install_components" + @echo "... rebuild_cache" + @echo "... edit_cache" + @echo "... mosquittopp.o" + @echo "... mosquittopp.i" + @echo "... mosquittopp.s" +.PHONY : help + + + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system + diff --git a/src/libs/mosquitto/lib/cpp/cmake_install.cmake b/src/libs/mosquitto/lib/cpp/cmake_install.cmake new file mode 100644 index 0000000..16e0052 --- /dev/null +++ b/src/libs/mosquitto/lib/cpp/cmake_install.cmake @@ -0,0 +1,72 @@ +# Install script for directory: /Users/benjamin/orchestra/src/libs/mosquitto/lib/cpp + +# Set the install prefix +if(NOT DEFINED CMAKE_INSTALL_PREFIX) + set(CMAKE_INSTALL_PREFIX "/usr/local") +endif() +string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") + +# Set the install configuration name. +if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) + if(BUILD_TYPE) + string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" + CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") + else() + set(CMAKE_INSTALL_CONFIG_NAME "") + endif() + message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") +endif() + +# Set the component getting installed. +if(NOT CMAKE_INSTALL_COMPONENT) + if(COMPONENT) + message(STATUS "Install component: \"${COMPONENT}\"") + set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") + else() + set(CMAKE_INSTALL_COMPONENT) + endif() +endif() + +# Is this installation the result of a crosscompile? +if(NOT DEFINED CMAKE_CROSSCOMPILING) + set(CMAKE_CROSSCOMPILING "FALSE") +endif() + +if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" OR NOT CMAKE_INSTALL_COMPONENT) + file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" TYPE SHARED_LIBRARY FILES + "/Users/benjamin/orchestra/src/libs/mosquitto/lib/cpp/libmosquittopp.1.4.14.dylib" + "/Users/benjamin/orchestra/src/libs/mosquitto/lib/cpp/libmosquittopp.1.dylib" + "/Users/benjamin/orchestra/src/libs/mosquitto/lib/cpp/libmosquittopp.dylib" + ) + foreach(file + "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libmosquittopp.1.4.14.dylib" + "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libmosquittopp.1.dylib" + "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libmosquittopp.dylib" + ) + if(EXISTS "${file}" AND + NOT IS_SYMLINK "${file}") + execute_process(COMMAND "/usr/bin/install_name_tool" + -id "libmosquittopp.1.dylib" + -change "/Users/benjamin/orchestra/src/libs/mosquitto/lib/libmosquitto.1.dylib" "libmosquitto.1.dylib" + "${file}") + execute_process(COMMAND /usr/bin/install_name_tool + -delete_rpath "/Users/benjamin/orchestra/src/libs/mosquitto/lib" + "${file}") + execute_process(COMMAND /usr/bin/install_name_tool + -add_rpath "/usr/local/lib" + "${file}") + if(CMAKE_INSTALL_DO_STRIP) + execute_process(COMMAND "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip" "${file}") + endif() + endif() + endforeach() +endif() + +if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" OR NOT CMAKE_INSTALL_COMPONENT) + file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/include" TYPE FILE FILES "/Users/benjamin/orchestra/src/libs/mosquitto/lib/cpp/mosquittopp.h") +endif() + +if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" OR NOT CMAKE_INSTALL_COMPONENT) + EXEC_PROGRAM(/sbin/ldconfig) +endif() + diff --git a/src/libs/mosquitto/lib/cpp/mosquittopp.cpp b/src/libs/mosquitto/lib/cpp/mosquittopp.cpp new file mode 100644 index 0000000..0a22b80 --- /dev/null +++ b/src/libs/mosquitto/lib/cpp/mosquittopp.cpp @@ -0,0 +1,308 @@ +/* +Copyright (c) 2010-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include +#include +#include + +namespace mosqpp { + +static void on_connect_wrapper(struct mosquitto *mosq, void *userdata, int rc) +{ + class mosquittopp *m = (class mosquittopp *)userdata; + m->on_connect(rc); +} + +static void on_disconnect_wrapper(struct mosquitto *mosq, void *userdata, int rc) +{ + class mosquittopp *m = (class mosquittopp *)userdata; + m->on_disconnect(rc); +} + +static void on_publish_wrapper(struct mosquitto *mosq, void *userdata, int mid) +{ + class mosquittopp *m = (class mosquittopp *)userdata; + m->on_publish(mid); +} + +static void on_message_wrapper(struct mosquitto *mosq, void *userdata, const struct mosquitto_message *message) +{ + class mosquittopp *m = (class mosquittopp *)userdata; + m->on_message(message); +} + +static void on_subscribe_wrapper(struct mosquitto *mosq, void *userdata, int mid, int qos_count, const int *granted_qos) +{ + class mosquittopp *m = (class mosquittopp *)userdata; + m->on_subscribe(mid, qos_count, granted_qos); +} + +static void on_unsubscribe_wrapper(struct mosquitto *mosq, void *userdata, int mid) +{ + class mosquittopp *m = (class mosquittopp *)userdata; + m->on_unsubscribe(mid); +} + + +static void on_log_wrapper(struct mosquitto *mosq, void *userdata, int level, const char *str) +{ + class mosquittopp *m = (class mosquittopp *)userdata; + m->on_log(level, str); +} + +int lib_version(int *major, int *minor, int *revision) +{ + if(major) *major = LIBMOSQUITTO_MAJOR; + if(minor) *minor = LIBMOSQUITTO_MINOR; + if(revision) *revision = LIBMOSQUITTO_REVISION; + return LIBMOSQUITTO_VERSION_NUMBER; +} + +int lib_init() +{ + return mosquitto_lib_init(); +} + +int lib_cleanup() +{ + return mosquitto_lib_cleanup(); +} + +const char* strerror(int mosq_errno) +{ + return mosquitto_strerror(mosq_errno); +} + +const char* connack_string(int connack_code) +{ + return mosquitto_connack_string(connack_code); +} + +int sub_topic_tokenise(const char *subtopic, char ***topics, int *count) +{ + return mosquitto_sub_topic_tokenise(subtopic, topics, count); +} + +int sub_topic_tokens_free(char ***topics, int count) +{ + return mosquitto_sub_topic_tokens_free(topics, count); +} + +int topic_matches_sub(const char *sub, const char *topic, bool *result) +{ + return mosquitto_topic_matches_sub(sub, topic, result); +} + +mosquittopp::mosquittopp(const char *id, bool clean_session) +{ + m_mosq = mosquitto_new(id, clean_session, this); + mosquitto_connect_callback_set(m_mosq, on_connect_wrapper); + mosquitto_disconnect_callback_set(m_mosq, on_disconnect_wrapper); + mosquitto_publish_callback_set(m_mosq, on_publish_wrapper); + mosquitto_message_callback_set(m_mosq, on_message_wrapper); + mosquitto_subscribe_callback_set(m_mosq, on_subscribe_wrapper); + mosquitto_unsubscribe_callback_set(m_mosq, on_unsubscribe_wrapper); + mosquitto_log_callback_set(m_mosq, on_log_wrapper); +} + +mosquittopp::~mosquittopp() +{ + mosquitto_destroy(m_mosq); +} + +int mosquittopp::reinitialise(const char *id, bool clean_session) +{ + int rc; + rc = mosquitto_reinitialise(m_mosq, id, clean_session, this); + if(rc == MOSQ_ERR_SUCCESS){ + mosquitto_connect_callback_set(m_mosq, on_connect_wrapper); + mosquitto_disconnect_callback_set(m_mosq, on_disconnect_wrapper); + mosquitto_publish_callback_set(m_mosq, on_publish_wrapper); + mosquitto_message_callback_set(m_mosq, on_message_wrapper); + mosquitto_subscribe_callback_set(m_mosq, on_subscribe_wrapper); + mosquitto_unsubscribe_callback_set(m_mosq, on_unsubscribe_wrapper); + mosquitto_log_callback_set(m_mosq, on_log_wrapper); + } + return rc; +} + +int mosquittopp::connect(const char *host, int port, int keepalive) +{ + return mosquitto_connect(m_mosq, host, port, keepalive); +} + +int mosquittopp::connect(const char *host, int port, int keepalive, const char *bind_address) +{ + return mosquitto_connect_bind(m_mosq, host, port, keepalive, bind_address); +} + +int mosquittopp::connect_async(const char *host, int port, int keepalive) +{ + return mosquitto_connect_async(m_mosq, host, port, keepalive); +} + +int mosquittopp::connect_async(const char *host, int port, int keepalive, const char *bind_address) +{ + return mosquitto_connect_bind_async(m_mosq, host, port, keepalive, bind_address); +} + +int mosquittopp::reconnect() +{ + return mosquitto_reconnect(m_mosq); +} + +int mosquittopp::reconnect_async() +{ + return mosquitto_reconnect_async(m_mosq); +} + +int mosquittopp::disconnect() +{ + return mosquitto_disconnect(m_mosq); +} + +int mosquittopp::socket() +{ + return mosquitto_socket(m_mosq); +} + +int mosquittopp::will_set(const char *topic, int payloadlen, const void *payload, int qos, bool retain) +{ + return mosquitto_will_set(m_mosq, topic, payloadlen, payload, qos, retain); +} + +int mosquittopp::will_clear() +{ + return mosquitto_will_clear(m_mosq); +} + +int mosquittopp::username_pw_set(const char *username, const char *password) +{ + return mosquitto_username_pw_set(m_mosq, username, password); +} + +int mosquittopp::publish(int *mid, const char *topic, int payloadlen, const void *payload, int qos, bool retain) +{ + return mosquitto_publish(m_mosq, mid, topic, payloadlen, payload, qos, retain); +} + +void mosquittopp::reconnect_delay_set(unsigned int reconnect_delay, unsigned int reconnect_delay_max, bool reconnect_exponential_backoff) +{ + mosquitto_reconnect_delay_set(m_mosq, reconnect_delay, reconnect_delay_max, reconnect_exponential_backoff); +} + +int mosquittopp::max_inflight_messages_set(unsigned int max_inflight_messages) +{ + return mosquitto_max_inflight_messages_set(m_mosq, max_inflight_messages); +} + +void mosquittopp::message_retry_set(unsigned int message_retry) +{ + mosquitto_message_retry_set(m_mosq, message_retry); +} + +int mosquittopp::subscribe(int *mid, const char *sub, int qos) +{ + return mosquitto_subscribe(m_mosq, mid, sub, qos); +} + +int mosquittopp::unsubscribe(int *mid, const char *sub) +{ + return mosquitto_unsubscribe(m_mosq, mid, sub); +} + +int mosquittopp::loop(int timeout, int max_packets) +{ + return mosquitto_loop(m_mosq, timeout, max_packets); +} + +int mosquittopp::loop_misc() +{ + return mosquitto_loop_misc(m_mosq); +} + +int mosquittopp::loop_read(int max_packets) +{ + return mosquitto_loop_read(m_mosq, max_packets); +} + +int mosquittopp::loop_write(int max_packets) +{ + return mosquitto_loop_write(m_mosq, max_packets); +} + +int mosquittopp::loop_forever(int timeout, int max_packets) +{ + return mosquitto_loop_forever(m_mosq, timeout, max_packets); +} + +int mosquittopp::loop_start() +{ + return mosquitto_loop_start(m_mosq); +} + +int mosquittopp::loop_stop(bool force) +{ + return mosquitto_loop_stop(m_mosq, force); +} + +bool mosquittopp::want_write() +{ + return mosquitto_want_write(m_mosq); +} + +int mosquittopp::opts_set(enum mosq_opt_t option, void *value) +{ + return mosquitto_opts_set(m_mosq, option, value); +} + +int mosquittopp::threaded_set(bool threaded) +{ + return mosquitto_threaded_set(m_mosq, threaded); +} + +void mosquittopp::user_data_set(void *userdata) +{ + mosquitto_user_data_set(m_mosq, userdata); +} + +int mosquittopp::socks5_set(const char *host, int port, const char *username, const char *password) +{ + return mosquitto_socks5_set(m_mosq, host, port, username, password); +} + + +int mosquittopp::tls_set(const char *cafile, const char *capath, const char *certfile, const char *keyfile, int (*pw_callback)(char *buf, int size, int rwflag, void *userdata)) +{ + return mosquitto_tls_set(m_mosq, cafile, capath, certfile, keyfile, pw_callback); +} + +int mosquittopp::tls_opts_set(int cert_reqs, const char *tls_version, const char *ciphers) +{ + return mosquitto_tls_opts_set(m_mosq, cert_reqs, tls_version, ciphers); +} + +int mosquittopp::tls_insecure_set(bool value) +{ + return mosquitto_tls_insecure_set(m_mosq, value); +} + +int mosquittopp::tls_psk_set(const char *psk, const char *identity, const char *ciphers) +{ + return mosquitto_tls_psk_set(m_mosq, psk, identity, ciphers); +} + +} diff --git a/src/libs/mosquitto/lib/cpp/mosquittopp.h b/src/libs/mosquitto/lib/cpp/mosquittopp.h new file mode 100644 index 0000000..9b0cb69 --- /dev/null +++ b/src/libs/mosquitto/lib/cpp/mosquittopp.h @@ -0,0 +1,106 @@ +/* +Copyright (c) 2010-2013 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#ifndef MOSQUITTOPP_H +#define MOSQUITTOPP_H + +#ifdef _WIN32 +# ifdef mosquittopp_EXPORTS +# define mosqpp_EXPORT __declspec(dllexport) +# else +# define mosqpp_EXPORT __declspec(dllimport) +# endif +#else +# define mosqpp_EXPORT +#endif + +#include +#include +#include + +namespace mosqpp { + +mosqpp_EXPORT const char *strerror(int mosq_errno); +mosqpp_EXPORT const char *connack_string(int connack_code); +mosqpp_EXPORT int sub_topic_tokenise(const char *subtopic, char ***topics, int *count); +mosqpp_EXPORT int sub_topic_tokens_free(char ***topics, int count); +mosqpp_EXPORT int lib_version(int *major, int *minor, int *revision); +mosqpp_EXPORT int lib_init(); +mosqpp_EXPORT int lib_cleanup(); +mosqpp_EXPORT int topic_matches_sub(const char *sub, const char *topic, bool *result); + +/* + * Class: mosquittopp + * + * A mosquitto client class. This is a C++ wrapper class for the mosquitto C + * library. Please see mosquitto.h for details of the functions. + */ +class mosqpp_EXPORT mosquittopp { + private: + struct mosquitto *m_mosq; + public: + mosquittopp(const char *id=NULL, bool clean_session=true); + virtual ~mosquittopp(); + + int reinitialise(const char *id, bool clean_session); + int socket(); + int will_set(const char *topic, int payloadlen=0, const void *payload=NULL, int qos=0, bool retain=false); + int will_clear(); + int username_pw_set(const char *username, const char *password=NULL); + int connect(const char *host, int port=1883, int keepalive=60); + int connect_async(const char *host, int port=1883, int keepalive=60); + int connect(const char *host, int port, int keepalive, const char *bind_address); + int connect_async(const char *host, int port, int keepalive, const char *bind_address); + int reconnect(); + int reconnect_async(); + int disconnect(); + int publish(int *mid, const char *topic, int payloadlen=0, const void *payload=NULL, int qos=0, bool retain=false); + int subscribe(int *mid, const char *sub, int qos=0); + int unsubscribe(int *mid, const char *sub); + void reconnect_delay_set(unsigned int reconnect_delay, unsigned int reconnect_delay_max, bool reconnect_exponential_backoff); + int max_inflight_messages_set(unsigned int max_inflight_messages); + void message_retry_set(unsigned int message_retry); + void user_data_set(void *userdata); + int tls_set(const char *cafile, const char *capath=NULL, const char *certfile=NULL, const char *keyfile=NULL, int (*pw_callback)(char *buf, int size, int rwflag, void *userdata)=NULL); + int tls_opts_set(int cert_reqs, const char *tls_version=NULL, const char *ciphers=NULL); + int tls_insecure_set(bool value); + int tls_psk_set(const char *psk, const char *identity, const char *ciphers=NULL); + int opts_set(enum mosq_opt_t option, void *value); + + int loop(int timeout=-1, int max_packets=1); + int loop_misc(); + int loop_read(int max_packets=1); + int loop_write(int max_packets=1); + int loop_forever(int timeout=-1, int max_packets=1); + int loop_start(); + int loop_stop(bool force=false); + bool want_write(); + int threaded_set(bool threaded=true); + int socks5_set(const char *host, int port=1080, const char *username=NULL, const char *password=NULL); + + // names in the functions commented to prevent unused parameter warning + virtual void on_connect(int /*rc*/) {return;} + virtual void on_disconnect(int /*rc*/) {return;} + virtual void on_publish(int /*mid*/) {return;} + virtual void on_message(const struct mosquitto_message * /*message*/) {return;} + virtual void on_subscribe(int /*mid*/, int /*qos_count*/, const int * /*granted_qos*/) {return;} + virtual void on_unsubscribe(int /*mid*/) {return;} + virtual void on_log(int /*level*/, const char * /*str*/) {return;} + virtual void on_error() {return;} +}; + +} +#endif diff --git a/src/libs/mosquitto/lib/dummypthread.h b/src/libs/mosquitto/lib/dummypthread.h new file mode 100644 index 0000000..31f3251 --- /dev/null +++ b/src/libs/mosquitto/lib/dummypthread.h @@ -0,0 +1,13 @@ +#ifndef _DUMMYPTHREAD_H_ +#define _DUMMYPTHREAD_H_ + +#define pthread_create(A, B, C, D) +#define pthread_join(A, B) +#define pthread_cancel(A) + +#define pthread_mutex_init(A, B) +#define pthread_mutex_destroy(A) +#define pthread_mutex_lock(A) +#define pthread_mutex_unlock(A) + +#endif diff --git a/src/libs/mosquitto/lib/linker.version b/src/libs/mosquitto/lib/linker.version new file mode 100644 index 0000000..59eed79 --- /dev/null +++ b/src/libs/mosquitto/lib/linker.version @@ -0,0 +1,80 @@ +/* Linker version script - currently used here primarily to control which + * symbols are exported. + */ + +MOSQ_1.0 { + global: + mosquitto_lib_version; + mosquitto_lib_init; + mosquitto_lib_cleanup; + mosquitto_new; + mosquitto_destroy; + mosquitto_reinitialise; + mosquitto_will_set; + mosquitto_will_clear; + mosquitto_username_pw_set; + mosquitto_connect; + mosquitto_connect_async; + mosquitto_reconnect; + mosquitto_disconnect; + mosquitto_publish; + mosquitto_subscribe; + mosquitto_unsubscribe; + mosquitto_message_copy; + mosquitto_message_free; + mosquitto_loop; + mosquitto_socket; + mosquitto_loop_start; + mosquitto_loop_stop; + mosquitto_loop_read; + mosquitto_loop_write; + mosquitto_loop_misc; + mosquitto_connect_callback_set; + mosquitto_disconnect_callback_set; + mosquitto_publish_callback_set; + mosquitto_message_callback_set; + mosquitto_subscribe_callback_set; + mosquitto_unsubscribe_callback_set; + mosquitto_log_callback_set; + mosquitto_message_retry_set; + mosquitto_want_write; + mosquitto_user_data_set; + mosquitto_strerror; + mosquitto_connack_string; + mosquitto_tls_set; + mosquitto_tls_opts_set; + mosquitto_tls_psk_set; + mosquitto_sub_topic_tokenise; + mosquitto_sub_topic_tokens_free; + mosquitto_topic_matches_sub; + local: *; +}; + +MOSQ_1.1 { + global: + mosquitto_loop_forever; +} MOSQ_1.0; + +MOSQ_1.2 { + global: + mosquitto_connect_bind; + mosquitto_connect_bind_async; + mosquitto_max_inflight_messages_set; + mosquitto_reconnect_delay_set; + mosquitto_reconnect_async; + mosquitto_tls_insecure_set; +} MOSQ_1.1; + +MOSQ_1.3 { + global: + mosquitto_connect_srv; +} MOSQ_1.2; + +MOSQ_1.4 { + global: + mosquitto_threaded_set; + mosquitto_opts_set; + mosquitto_pub_topic_check; + mosquitto_sub_topic_check; + mosquitto_socks5_set; +} MOSQ_1.3; diff --git a/src/libs/mosquitto/lib/logging_mosq.c b/src/libs/mosquitto/lib/logging_mosq.c new file mode 100644 index 0000000..3d94974 --- /dev/null +++ b/src/libs/mosquitto/lib/logging_mosq.c @@ -0,0 +1,56 @@ +/* +Copyright (c) 2009-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ +#include +#include +#include +#include + +#include +#include +#include + +int _mosquitto_log_printf(struct mosquitto *mosq, int priority, const char *fmt, ...) +{ + va_list va; + char *s; + int len; + + assert(mosq); + assert(fmt); + + pthread_mutex_lock(&mosq->log_callback_mutex); + if(mosq->on_log){ + len = strlen(fmt) + 500; + s = _mosquitto_malloc(len*sizeof(char)); + if(!s){ + pthread_mutex_unlock(&mosq->log_callback_mutex); + return MOSQ_ERR_NOMEM; + } + + va_start(va, fmt); + vsnprintf(s, len, fmt, va); + va_end(va); + s[len-1] = '\0'; /* Ensure string is null terminated. */ + + mosq->on_log(mosq, mosq->userdata, priority, s); + + _mosquitto_free(s); + } + pthread_mutex_unlock(&mosq->log_callback_mutex); + + return MOSQ_ERR_SUCCESS; +} + diff --git a/src/libs/mosquitto/lib/logging_mosq.h b/src/libs/mosquitto/lib/logging_mosq.h new file mode 100644 index 0000000..3430fc2 --- /dev/null +++ b/src/libs/mosquitto/lib/logging_mosq.h @@ -0,0 +1,23 @@ +/* +Copyright (c) 2009-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ +#ifndef _LOGGING_MOSQ_H_ +#define _LOGGING_MOSQ_H_ + +#include + +int _mosquitto_log_printf(struct mosquitto *mosq, int priority, const char *fmt, ...); + +#endif diff --git a/src/libs/mosquitto/lib/memory_mosq.c b/src/libs/mosquitto/lib/memory_mosq.c new file mode 100644 index 0000000..dd3c50d --- /dev/null +++ b/src/libs/mosquitto/lib/memory_mosq.c @@ -0,0 +1,124 @@ +/* +Copyright (c) 2009-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include + +#include +#include + +#include + +#ifdef REAL_WITH_MEMORY_TRACKING +# if defined(__APPLE__) +# include +# define malloc_usable_size malloc_size +# elif defined(__FreeBSD__) +# include +# else +# include +# endif +#endif + +#ifdef REAL_WITH_MEMORY_TRACKING +static unsigned long memcount = 0; +static unsigned long max_memcount = 0; +#endif + +void *_mosquitto_calloc(size_t nmemb, size_t size) +{ + void *mem = calloc(nmemb, size); + +#ifdef REAL_WITH_MEMORY_TRACKING + memcount += malloc_usable_size(mem); + if(memcount > max_memcount){ + max_memcount = memcount; + } +#endif + + return mem; +} + +void _mosquitto_free(void *mem) +{ +#ifdef REAL_WITH_MEMORY_TRACKING + if(!mem){ + return; + } + memcount -= malloc_usable_size(mem); +#endif + free(mem); +} + +void *_mosquitto_malloc(size_t size) +{ + void *mem = malloc(size); + +#ifdef REAL_WITH_MEMORY_TRACKING + memcount += malloc_usable_size(mem); + if(memcount > max_memcount){ + max_memcount = memcount; + } +#endif + + return mem; +} + +#ifdef REAL_WITH_MEMORY_TRACKING +unsigned long _mosquitto_memory_used(void) +{ + return memcount; +} + +unsigned long _mosquitto_max_memory_used(void) +{ + return max_memcount; +} +#endif + +void *_mosquitto_realloc(void *ptr, size_t size) +{ + void *mem; +#ifdef REAL_WITH_MEMORY_TRACKING + if(ptr){ + memcount -= malloc_usable_size(ptr); + } +#endif + mem = realloc(ptr, size); + +#ifdef REAL_WITH_MEMORY_TRACKING + memcount += malloc_usable_size(mem); + if(memcount > max_memcount){ + max_memcount = memcount; + } +#endif + + return mem; +} + +char *_mosquitto_strdup(const char *s) +{ + char *str = strdup(s); + +#ifdef REAL_WITH_MEMORY_TRACKING + memcount += malloc_usable_size(str); + if(memcount > max_memcount){ + max_memcount = memcount; + } +#endif + + return str; +} + diff --git a/src/libs/mosquitto/lib/memory_mosq.h b/src/libs/mosquitto/lib/memory_mosq.h new file mode 100644 index 0000000..6e14d7f --- /dev/null +++ b/src/libs/mosquitto/lib/memory_mosq.h @@ -0,0 +1,37 @@ +/* +Copyright (c) 2010-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#ifndef _MEMORY_MOSQ_H_ +#define _MEMORY_MOSQ_H_ + +#include +#include + +#if defined(WITH_MEMORY_TRACKING) && defined(WITH_BROKER) && !defined(WIN32) && !defined(__SYMBIAN32__) && !defined(__ANDROID__) && !defined(__UCLIBC__) && !defined(__OpenBSD__) +#define REAL_WITH_MEMORY_TRACKING +#endif + +void *_mosquitto_calloc(size_t nmemb, size_t size); +void _mosquitto_free(void *mem); +void *_mosquitto_malloc(size_t size); +#ifdef REAL_WITH_MEMORY_TRACKING +unsigned long _mosquitto_memory_used(void); +unsigned long _mosquitto_max_memory_used(void); +#endif +void *_mosquitto_realloc(void *ptr, size_t size); +char *_mosquitto_strdup(const char *s); + +#endif diff --git a/src/libs/mosquitto/lib/messages_mosq.c b/src/libs/mosquitto/lib/messages_mosq.c new file mode 100644 index 0000000..2adaa86 --- /dev/null +++ b/src/libs/mosquitto/lib/messages_mosq.c @@ -0,0 +1,399 @@ +/* +Copyright (c) 2010-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +void _mosquitto_message_cleanup(struct mosquitto_message_all **message) +{ + struct mosquitto_message_all *msg; + + if(!message || !*message) return; + + msg = *message; + + if(msg->msg.topic) _mosquitto_free(msg->msg.topic); + if(msg->msg.payload) _mosquitto_free(msg->msg.payload); + _mosquitto_free(msg); +} + +void _mosquitto_message_cleanup_all(struct mosquitto *mosq) +{ + struct mosquitto_message_all *tmp; + + assert(mosq); + + while(mosq->in_messages){ + tmp = mosq->in_messages->next; + _mosquitto_message_cleanup(&mosq->in_messages); + mosq->in_messages = tmp; + } + while(mosq->out_messages){ + tmp = mosq->out_messages->next; + _mosquitto_message_cleanup(&mosq->out_messages); + mosq->out_messages = tmp; + } +} + +int mosquitto_message_copy(struct mosquitto_message *dst, const struct mosquitto_message *src) +{ + if(!dst || !src) return MOSQ_ERR_INVAL; + + dst->mid = src->mid; + dst->topic = _mosquitto_strdup(src->topic); + if(!dst->topic) return MOSQ_ERR_NOMEM; + dst->qos = src->qos; + dst->retain = src->retain; + if(src->payloadlen){ + dst->payload = _mosquitto_malloc(src->payloadlen); + if(!dst->payload){ + _mosquitto_free(dst->topic); + return MOSQ_ERR_NOMEM; + } + memcpy(dst->payload, src->payload, src->payloadlen); + dst->payloadlen = src->payloadlen; + }else{ + dst->payloadlen = 0; + dst->payload = NULL; + } + return MOSQ_ERR_SUCCESS; +} + +int _mosquitto_message_delete(struct mosquitto *mosq, uint16_t mid, enum mosquitto_msg_direction dir) +{ + struct mosquitto_message_all *message; + int rc; + assert(mosq); + + rc = _mosquitto_message_remove(mosq, mid, dir, &message); + if(rc == MOSQ_ERR_SUCCESS){ + _mosquitto_message_cleanup(&message); + } + return rc; +} + +void mosquitto_message_free(struct mosquitto_message **message) +{ + struct mosquitto_message *msg; + + if(!message || !*message) return; + + msg = *message; + + if(msg->topic) _mosquitto_free(msg->topic); + if(msg->payload) _mosquitto_free(msg->payload); + _mosquitto_free(msg); +} + + +/* + * Function: _mosquitto_message_queue + * + * Returns: + * 0 - to indicate an outgoing message can be started + * 1 - to indicate that the outgoing message queue is full (inflight limit has been reached) + */ +int _mosquitto_message_queue(struct mosquitto *mosq, struct mosquitto_message_all *message, enum mosquitto_msg_direction dir) +{ + int rc = 0; + + /* mosq->*_message_mutex should be locked before entering this function */ + assert(mosq); + assert(message); + + if(dir == mosq_md_out){ + mosq->out_queue_len++; + message->next = NULL; + if(mosq->out_messages_last){ + mosq->out_messages_last->next = message; + }else{ + mosq->out_messages = message; + } + mosq->out_messages_last = message; + if(message->msg.qos > 0){ + if(mosq->max_inflight_messages == 0 || mosq->inflight_messages < mosq->max_inflight_messages){ + mosq->inflight_messages++; + }else{ + rc = 1; + } + } + }else{ + mosq->in_queue_len++; + message->next = NULL; + if(mosq->in_messages_last){ + mosq->in_messages_last->next = message; + }else{ + mosq->in_messages = message; + } + mosq->in_messages_last = message; + } + return rc; +} + +void _mosquitto_messages_reconnect_reset(struct mosquitto *mosq) +{ + struct mosquitto_message_all *message; + struct mosquitto_message_all *prev = NULL; + assert(mosq); + + pthread_mutex_lock(&mosq->in_message_mutex); + message = mosq->in_messages; + mosq->in_queue_len = 0; + while(message){ + mosq->in_queue_len++; + message->timestamp = 0; + if(message->msg.qos != 2){ + if(prev){ + prev->next = message->next; + _mosquitto_message_cleanup(&message); + message = prev; + }else{ + mosq->in_messages = message->next; + _mosquitto_message_cleanup(&message); + message = mosq->in_messages; + } + }else{ + /* Message state can be preserved here because it should match + * whatever the client has got. */ + } + prev = message; + message = message->next; + } + mosq->in_messages_last = prev; + pthread_mutex_unlock(&mosq->in_message_mutex); + + + pthread_mutex_lock(&mosq->out_message_mutex); + mosq->inflight_messages = 0; + message = mosq->out_messages; + mosq->out_queue_len = 0; + while(message){ + mosq->out_queue_len++; + message->timestamp = 0; + + if(mosq->max_inflight_messages == 0 || mosq->inflight_messages < mosq->max_inflight_messages){ + if(message->msg.qos > 0){ + mosq->inflight_messages++; + } + if(message->msg.qos == 1){ + message->state = mosq_ms_wait_for_puback; + }else if(message->msg.qos == 2){ + /* Should be able to preserve state. */ + } + }else{ + message->state = mosq_ms_invalid; + } + prev = message; + message = message->next; + } + mosq->out_messages_last = prev; + pthread_mutex_unlock(&mosq->out_message_mutex); +} + +int _mosquitto_message_remove(struct mosquitto *mosq, uint16_t mid, enum mosquitto_msg_direction dir, struct mosquitto_message_all **message) +{ + struct mosquitto_message_all *cur, *prev = NULL; + bool found = false; + int rc; + assert(mosq); + assert(message); + + if(dir == mosq_md_out){ + pthread_mutex_lock(&mosq->out_message_mutex); + cur = mosq->out_messages; + while(cur){ + if(cur->msg.mid == mid){ + if(prev){ + prev->next = cur->next; + }else{ + mosq->out_messages = cur->next; + } + *message = cur; + mosq->out_queue_len--; + if(cur->next == NULL){ + mosq->out_messages_last = prev; + }else if(!mosq->out_messages){ + mosq->out_messages_last = NULL; + } + if(cur->msg.qos > 0){ + mosq->inflight_messages--; + } + found = true; + break; + } + prev = cur; + cur = cur->next; + } + + if(found){ + cur = mosq->out_messages; + while(cur){ + if(mosq->max_inflight_messages == 0 || mosq->inflight_messages < mosq->max_inflight_messages){ + if(cur->msg.qos > 0 && cur->state == mosq_ms_invalid){ + mosq->inflight_messages++; + if(cur->msg.qos == 1){ + cur->state = mosq_ms_wait_for_puback; + }else if(cur->msg.qos == 2){ + cur->state = mosq_ms_wait_for_pubrec; + } + rc = _mosquitto_send_publish(mosq, cur->msg.mid, cur->msg.topic, cur->msg.payloadlen, cur->msg.payload, cur->msg.qos, cur->msg.retain, cur->dup); + if(rc){ + pthread_mutex_unlock(&mosq->out_message_mutex); + return rc; + } + } + }else{ + pthread_mutex_unlock(&mosq->out_message_mutex); + return MOSQ_ERR_SUCCESS; + } + cur = cur->next; + } + pthread_mutex_unlock(&mosq->out_message_mutex); + return MOSQ_ERR_SUCCESS; + }else{ + pthread_mutex_unlock(&mosq->out_message_mutex); + return MOSQ_ERR_NOT_FOUND; + } + }else{ + pthread_mutex_lock(&mosq->in_message_mutex); + cur = mosq->in_messages; + while(cur){ + if(cur->msg.mid == mid){ + if(prev){ + prev->next = cur->next; + }else{ + mosq->in_messages = cur->next; + } + *message = cur; + mosq->in_queue_len--; + if(cur->next == NULL){ + mosq->in_messages_last = prev; + }else if(!mosq->in_messages){ + mosq->in_messages_last = NULL; + } + found = true; + break; + } + prev = cur; + cur = cur->next; + } + + pthread_mutex_unlock(&mosq->in_message_mutex); + if(found){ + return MOSQ_ERR_SUCCESS; + }else{ + return MOSQ_ERR_NOT_FOUND; + } + } +} + +#ifdef WITH_THREADING +void _mosquitto_message_retry_check_actual(struct mosquitto *mosq, struct mosquitto_message_all *messages, pthread_mutex_t *mutex) +#else +void _mosquitto_message_retry_check_actual(struct mosquitto *mosq, struct mosquitto_message_all *messages) +#endif +{ + time_t now = mosquitto_time(); + assert(mosq); + +#ifdef WITH_THREADING + pthread_mutex_lock(mutex); +#endif + + while(messages){ + if(messages->timestamp + mosq->message_retry < now){ + switch(messages->state){ + case mosq_ms_wait_for_puback: + case mosq_ms_wait_for_pubrec: + messages->timestamp = now; + messages->dup = true; + _mosquitto_send_publish(mosq, messages->msg.mid, messages->msg.topic, messages->msg.payloadlen, messages->msg.payload, messages->msg.qos, messages->msg.retain, messages->dup); + break; + case mosq_ms_wait_for_pubrel: + messages->timestamp = now; + messages->dup = true; + _mosquitto_send_pubrec(mosq, messages->msg.mid); + break; + case mosq_ms_wait_for_pubcomp: + messages->timestamp = now; + messages->dup = true; + _mosquitto_send_pubrel(mosq, messages->msg.mid); + break; + default: + break; + } + } + messages = messages->next; + } +#ifdef WITH_THREADING + pthread_mutex_unlock(mutex); +#endif +} + +void _mosquitto_message_retry_check(struct mosquitto *mosq) +{ +#ifdef WITH_THREADING + _mosquitto_message_retry_check_actual(mosq, mosq->out_messages, &mosq->out_message_mutex); + _mosquitto_message_retry_check_actual(mosq, mosq->in_messages, &mosq->in_message_mutex); +#else + _mosquitto_message_retry_check_actual(mosq, mosq->out_messages); + _mosquitto_message_retry_check_actual(mosq, mosq->in_messages); +#endif +} + +void mosquitto_message_retry_set(struct mosquitto *mosq, unsigned int message_retry) +{ + assert(mosq); + if(mosq) mosq->message_retry = message_retry; +} + +int _mosquitto_message_out_update(struct mosquitto *mosq, uint16_t mid, enum mosquitto_msg_state state) +{ + struct mosquitto_message_all *message; + assert(mosq); + + pthread_mutex_lock(&mosq->out_message_mutex); + message = mosq->out_messages; + while(message){ + if(message->msg.mid == mid){ + message->state = state; + message->timestamp = mosquitto_time(); + pthread_mutex_unlock(&mosq->out_message_mutex); + return MOSQ_ERR_SUCCESS; + } + message = message->next; + } + pthread_mutex_unlock(&mosq->out_message_mutex); + return MOSQ_ERR_NOT_FOUND; +} + +int mosquitto_max_inflight_messages_set(struct mosquitto *mosq, unsigned int max_inflight_messages) +{ + if(!mosq) return MOSQ_ERR_INVAL; + + mosq->max_inflight_messages = max_inflight_messages; + + return MOSQ_ERR_SUCCESS; +} + diff --git a/src/libs/mosquitto/lib/messages_mosq.h b/src/libs/mosquitto/lib/messages_mosq.h new file mode 100644 index 0000000..acae1b4 --- /dev/null +++ b/src/libs/mosquitto/lib/messages_mosq.h @@ -0,0 +1,31 @@ +/* +Copyright (c) 2010-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ +#ifndef _MESSAGES_MOSQ_H_ +#define _MESSAGES_MOSQ_H_ + +#include +#include + +void _mosquitto_message_cleanup_all(struct mosquitto *mosq); +void _mosquitto_message_cleanup(struct mosquitto_message_all **message); +int _mosquitto_message_delete(struct mosquitto *mosq, uint16_t mid, enum mosquitto_msg_direction dir); +int _mosquitto_message_queue(struct mosquitto *mosq, struct mosquitto_message_all *message, enum mosquitto_msg_direction dir); +void _mosquitto_messages_reconnect_reset(struct mosquitto *mosq); +int _mosquitto_message_remove(struct mosquitto *mosq, uint16_t mid, enum mosquitto_msg_direction dir, struct mosquitto_message_all **message); +void _mosquitto_message_retry_check(struct mosquitto *mosq); +int _mosquitto_message_out_update(struct mosquitto *mosq, uint16_t mid, enum mosquitto_msg_state state); + +#endif diff --git a/src/libs/mosquitto/lib/mosquitto.c b/src/libs/mosquitto/lib/mosquitto.c new file mode 100644 index 0000000..be8e62e --- /dev/null +++ b/src/libs/mosquitto/lib/mosquitto.c @@ -0,0 +1,1431 @@ +/* +Copyright (c) 2010-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include +#include +#include +#include +#include +#ifndef WIN32 +#include +#include +#include +#else +#include +#include +typedef int ssize_t; +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "config.h" + +#if !defined(WIN32) && !defined(__SYMBIAN32__) +#define HAVE_PSELECT +#endif + +void _mosquitto_destroy(struct mosquitto *mosq); +static int _mosquitto_reconnect(struct mosquitto *mosq, bool blocking); +static int _mosquitto_connect_init(struct mosquitto *mosq, const char *host, int port, int keepalive, const char *bind_address); + +int mosquitto_lib_version(int *major, int *minor, int *revision) +{ + if(major) *major = LIBMOSQUITTO_MAJOR; + if(minor) *minor = LIBMOSQUITTO_MINOR; + if(revision) *revision = LIBMOSQUITTO_REVISION; + return LIBMOSQUITTO_VERSION_NUMBER; +} + +int mosquitto_lib_init(void) +{ +#ifdef WIN32 + srand(GetTickCount()); +#else + struct timeval tv; + + gettimeofday(&tv, NULL); + srand(tv.tv_sec*1000 + tv.tv_usec/1000); +#endif + + _mosquitto_net_init(); + + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_lib_cleanup(void) +{ + _mosquitto_net_cleanup(); + + return MOSQ_ERR_SUCCESS; +} + +struct mosquitto *mosquitto_new(const char *id, bool clean_session, void *userdata) +{ + struct mosquitto *mosq = NULL; + int rc; + + if(clean_session == false && id == NULL){ + errno = EINVAL; + return NULL; + } + +#ifndef WIN32 + signal(SIGPIPE, SIG_IGN); +#endif + + mosq = (struct mosquitto *)_mosquitto_calloc(1, sizeof(struct mosquitto)); + if(mosq){ + mosq->sock = INVALID_SOCKET; + mosq->sockpairR = INVALID_SOCKET; + mosq->sockpairW = INVALID_SOCKET; +#ifdef WITH_THREADING + mosq->thread_id = pthread_self(); +#endif + rc = mosquitto_reinitialise(mosq, id, clean_session, userdata); + if(rc){ + mosquitto_destroy(mosq); + if(rc == MOSQ_ERR_INVAL){ + errno = EINVAL; + }else if(rc == MOSQ_ERR_NOMEM){ + errno = ENOMEM; + } + return NULL; + } + }else{ + errno = ENOMEM; + } + return mosq; +} + +int mosquitto_reinitialise(struct mosquitto *mosq, const char *id, bool clean_session, void *userdata) +{ + int i; + + if(!mosq) return MOSQ_ERR_INVAL; + + if(clean_session == false && id == NULL){ + return MOSQ_ERR_INVAL; + } + + _mosquitto_destroy(mosq); + memset(mosq, 0, sizeof(struct mosquitto)); + + if(userdata){ + mosq->userdata = userdata; + }else{ + mosq->userdata = mosq; + } + mosq->protocol = mosq_p_mqtt31; + mosq->sock = INVALID_SOCKET; + mosq->sockpairR = INVALID_SOCKET; + mosq->sockpairW = INVALID_SOCKET; + mosq->keepalive = 60; + mosq->message_retry = 20; + mosq->last_retry_check = 0; + mosq->clean_session = clean_session; + if(id){ + if(STREMPTY(id)){ + return MOSQ_ERR_INVAL; + } + mosq->id = _mosquitto_strdup(id); + }else{ + mosq->id = (char *)_mosquitto_calloc(24, sizeof(char)); + if(!mosq->id){ + return MOSQ_ERR_NOMEM; + } + mosq->id[0] = 'm'; + mosq->id[1] = 'o'; + mosq->id[2] = 's'; + mosq->id[3] = 'q'; + mosq->id[4] = '/'; + + for(i=5; i<23; i++){ + mosq->id[i] = (rand()%73)+48; + } + } + mosq->in_packet.payload = NULL; + _mosquitto_packet_cleanup(&mosq->in_packet); + mosq->out_packet = NULL; + mosq->current_out_packet = NULL; + mosq->last_msg_in = mosquitto_time(); + mosq->next_msg_out = mosquitto_time() + mosq->keepalive; + mosq->ping_t = 0; + mosq->last_mid = 0; + mosq->state = mosq_cs_new; + mosq->in_messages = NULL; + mosq->in_messages_last = NULL; + mosq->out_messages = NULL; + mosq->out_messages_last = NULL; + mosq->max_inflight_messages = 20; + mosq->will = NULL; + mosq->on_connect = NULL; + mosq->on_publish = NULL; + mosq->on_message = NULL; + mosq->on_subscribe = NULL; + mosq->on_unsubscribe = NULL; + mosq->host = NULL; + mosq->port = 1883; + mosq->in_callback = false; + mosq->in_queue_len = 0; + mosq->out_queue_len = 0; + mosq->reconnect_delay = 1; + mosq->reconnect_delay_max = 1; + mosq->reconnect_exponential_backoff = false; + mosq->threaded = mosq_ts_none; +#ifdef WITH_TLS + mosq->ssl = NULL; + mosq->tls_cert_reqs = SSL_VERIFY_PEER; + mosq->tls_insecure = false; + mosq->want_write = false; +#endif +#ifdef WITH_THREADING + pthread_mutex_init(&mosq->callback_mutex, NULL); + pthread_mutex_init(&mosq->log_callback_mutex, NULL); + pthread_mutex_init(&mosq->state_mutex, NULL); + pthread_mutex_init(&mosq->out_packet_mutex, NULL); + pthread_mutex_init(&mosq->current_out_packet_mutex, NULL); + pthread_mutex_init(&mosq->msgtime_mutex, NULL); + pthread_mutex_init(&mosq->in_message_mutex, NULL); + pthread_mutex_init(&mosq->out_message_mutex, NULL); + pthread_mutex_init(&mosq->mid_mutex, NULL); + mosq->thread_id = pthread_self(); +#endif + + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_will_set(struct mosquitto *mosq, const char *topic, int payloadlen, const void *payload, int qos, bool retain) +{ + if(!mosq) return MOSQ_ERR_INVAL; + return _mosquitto_will_set(mosq, topic, payloadlen, payload, qos, retain); +} + +int mosquitto_will_clear(struct mosquitto *mosq) +{ + if(!mosq) return MOSQ_ERR_INVAL; + return _mosquitto_will_clear(mosq); +} + +int mosquitto_username_pw_set(struct mosquitto *mosq, const char *username, const char *password) +{ + if(!mosq) return MOSQ_ERR_INVAL; + + if(mosq->username){ + _mosquitto_free(mosq->username); + mosq->username = NULL; + } + if(mosq->password){ + _mosquitto_free(mosq->password); + mosq->password = NULL; + } + + if(username){ + mosq->username = _mosquitto_strdup(username); + if(!mosq->username) return MOSQ_ERR_NOMEM; + if(password){ + mosq->password = _mosquitto_strdup(password); + if(!mosq->password){ + _mosquitto_free(mosq->username); + mosq->username = NULL; + return MOSQ_ERR_NOMEM; + } + } + } + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_reconnect_delay_set(struct mosquitto *mosq, unsigned int reconnect_delay, unsigned int reconnect_delay_max, bool reconnect_exponential_backoff) +{ + if(!mosq) return MOSQ_ERR_INVAL; + + mosq->reconnect_delay = reconnect_delay; + mosq->reconnect_delay_max = reconnect_delay_max; + mosq->reconnect_exponential_backoff = reconnect_exponential_backoff; + + return MOSQ_ERR_SUCCESS; + +} + +void _mosquitto_destroy(struct mosquitto *mosq) +{ + struct _mosquitto_packet *packet; + if(!mosq) return; + +#ifdef WITH_THREADING + if(mosq->threaded == mosq_ts_self && !pthread_equal(mosq->thread_id, pthread_self())){ + pthread_cancel(mosq->thread_id); + pthread_join(mosq->thread_id, NULL); + mosq->threaded = mosq_ts_none; + } + + if(mosq->id){ + /* If mosq->id is not NULL then the client has already been initialised + * and so the mutexes need destroying. If mosq->id is NULL, the mutexes + * haven't been initialised. */ + pthread_mutex_destroy(&mosq->callback_mutex); + pthread_mutex_destroy(&mosq->log_callback_mutex); + pthread_mutex_destroy(&mosq->state_mutex); + pthread_mutex_destroy(&mosq->out_packet_mutex); + pthread_mutex_destroy(&mosq->current_out_packet_mutex); + pthread_mutex_destroy(&mosq->msgtime_mutex); + pthread_mutex_destroy(&mosq->in_message_mutex); + pthread_mutex_destroy(&mosq->out_message_mutex); + pthread_mutex_destroy(&mosq->mid_mutex); + } +#endif + if(mosq->sock != INVALID_SOCKET){ + _mosquitto_socket_close(mosq); + } + _mosquitto_message_cleanup_all(mosq); + _mosquitto_will_clear(mosq); +#ifdef WITH_TLS + if(mosq->ssl){ + SSL_free(mosq->ssl); + } + if(mosq->ssl_ctx){ + SSL_CTX_free(mosq->ssl_ctx); + } + if(mosq->tls_cafile) _mosquitto_free(mosq->tls_cafile); + if(mosq->tls_capath) _mosquitto_free(mosq->tls_capath); + if(mosq->tls_certfile) _mosquitto_free(mosq->tls_certfile); + if(mosq->tls_keyfile) _mosquitto_free(mosq->tls_keyfile); + if(mosq->tls_pw_callback) mosq->tls_pw_callback = NULL; + if(mosq->tls_version) _mosquitto_free(mosq->tls_version); + if(mosq->tls_ciphers) _mosquitto_free(mosq->tls_ciphers); + if(mosq->tls_psk) _mosquitto_free(mosq->tls_psk); + if(mosq->tls_psk_identity) _mosquitto_free(mosq->tls_psk_identity); +#endif + + if(mosq->address){ + _mosquitto_free(mosq->address); + mosq->address = NULL; + } + if(mosq->id){ + _mosquitto_free(mosq->id); + mosq->id = NULL; + } + if(mosq->username){ + _mosquitto_free(mosq->username); + mosq->username = NULL; + } + if(mosq->password){ + _mosquitto_free(mosq->password); + mosq->password = NULL; + } + if(mosq->host){ + _mosquitto_free(mosq->host); + mosq->host = NULL; + } + if(mosq->bind_address){ + _mosquitto_free(mosq->bind_address); + mosq->bind_address = NULL; + } + + /* Out packet cleanup */ + if(mosq->out_packet && !mosq->current_out_packet){ + mosq->current_out_packet = mosq->out_packet; + mosq->out_packet = mosq->out_packet->next; + } + while(mosq->current_out_packet){ + packet = mosq->current_out_packet; + /* Free data and reset values */ + mosq->current_out_packet = mosq->out_packet; + if(mosq->out_packet){ + mosq->out_packet = mosq->out_packet->next; + } + + _mosquitto_packet_cleanup(packet); + _mosquitto_free(packet); + } + + _mosquitto_packet_cleanup(&mosq->in_packet); + if(mosq->sockpairR != INVALID_SOCKET){ + COMPAT_CLOSE(mosq->sockpairR); + mosq->sockpairR = INVALID_SOCKET; + } + if(mosq->sockpairW != INVALID_SOCKET){ + COMPAT_CLOSE(mosq->sockpairW); + mosq->sockpairW = INVALID_SOCKET; + } +} + +void mosquitto_destroy(struct mosquitto *mosq) +{ + if(!mosq) return; + + _mosquitto_destroy(mosq); + _mosquitto_free(mosq); +} + +int mosquitto_socket(struct mosquitto *mosq) +{ + if(!mosq) return INVALID_SOCKET; + return mosq->sock; +} + +static int _mosquitto_connect_init(struct mosquitto *mosq, const char *host, int port, int keepalive, const char *bind_address) +{ + if(!mosq) return MOSQ_ERR_INVAL; + if(!host || port <= 0) return MOSQ_ERR_INVAL; + + if(mosq->host) _mosquitto_free(mosq->host); + mosq->host = _mosquitto_strdup(host); + if(!mosq->host) return MOSQ_ERR_NOMEM; + mosq->port = port; + + if(mosq->bind_address) _mosquitto_free(mosq->bind_address); + if(bind_address){ + mosq->bind_address = _mosquitto_strdup(bind_address); + if(!mosq->bind_address) return MOSQ_ERR_NOMEM; + } + + mosq->keepalive = keepalive; + + if(mosq->sockpairR != INVALID_SOCKET){ + COMPAT_CLOSE(mosq->sockpairR); + mosq->sockpairR = INVALID_SOCKET; + } + if(mosq->sockpairW != INVALID_SOCKET){ + COMPAT_CLOSE(mosq->sockpairW); + mosq->sockpairW = INVALID_SOCKET; + } + + if(_mosquitto_socketpair(&mosq->sockpairR, &mosq->sockpairW)){ + _mosquitto_log_printf(mosq, MOSQ_LOG_WARNING, + "Warning: Unable to open socket pair, outgoing publish commands may be delayed."); + } + + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_connect(struct mosquitto *mosq, const char *host, int port, int keepalive) +{ + return mosquitto_connect_bind(mosq, host, port, keepalive, NULL); +} + +int mosquitto_connect_bind(struct mosquitto *mosq, const char *host, int port, int keepalive, const char *bind_address) +{ + int rc; + rc = _mosquitto_connect_init(mosq, host, port, keepalive, bind_address); + if(rc) return rc; + + pthread_mutex_lock(&mosq->state_mutex); + mosq->state = mosq_cs_new; + pthread_mutex_unlock(&mosq->state_mutex); + + return _mosquitto_reconnect(mosq, true); +} + +int mosquitto_connect_async(struct mosquitto *mosq, const char *host, int port, int keepalive) +{ + return mosquitto_connect_bind_async(mosq, host, port, keepalive, NULL); +} + +int mosquitto_connect_bind_async(struct mosquitto *mosq, const char *host, int port, int keepalive, const char *bind_address) +{ + int rc = _mosquitto_connect_init(mosq, host, port, keepalive, bind_address); + if(rc) return rc; + + pthread_mutex_lock(&mosq->state_mutex); + mosq->state = mosq_cs_connect_async; + pthread_mutex_unlock(&mosq->state_mutex); + + return _mosquitto_reconnect(mosq, false); +} + +int mosquitto_reconnect_async(struct mosquitto *mosq) +{ + return _mosquitto_reconnect(mosq, false); +} + +int mosquitto_reconnect(struct mosquitto *mosq) +{ + return _mosquitto_reconnect(mosq, true); +} + +static int _mosquitto_reconnect(struct mosquitto *mosq, bool blocking) +{ + int rc; + struct _mosquitto_packet *packet; + if(!mosq) return MOSQ_ERR_INVAL; + if(!mosq->host || mosq->port <= 0) return MOSQ_ERR_INVAL; + + pthread_mutex_lock(&mosq->state_mutex); +#ifdef WITH_SOCKS + if(mosq->socks5_host){ + mosq->state = mosq_cs_socks5_new; + }else +#endif + { + mosq->state = mosq_cs_new; + } + pthread_mutex_unlock(&mosq->state_mutex); + + pthread_mutex_lock(&mosq->msgtime_mutex); + mosq->last_msg_in = mosquitto_time(); + mosq->next_msg_out = mosq->last_msg_in + mosq->keepalive; + pthread_mutex_unlock(&mosq->msgtime_mutex); + + mosq->ping_t = 0; + + _mosquitto_packet_cleanup(&mosq->in_packet); + + pthread_mutex_lock(&mosq->current_out_packet_mutex); + pthread_mutex_lock(&mosq->out_packet_mutex); + + if(mosq->out_packet && !mosq->current_out_packet){ + mosq->current_out_packet = mosq->out_packet; + mosq->out_packet = mosq->out_packet->next; + } + + while(mosq->current_out_packet){ + packet = mosq->current_out_packet; + /* Free data and reset values */ + mosq->current_out_packet = mosq->out_packet; + if(mosq->out_packet){ + mosq->out_packet = mosq->out_packet->next; + } + + _mosquitto_packet_cleanup(packet); + _mosquitto_free(packet); + } + pthread_mutex_unlock(&mosq->out_packet_mutex); + pthread_mutex_unlock(&mosq->current_out_packet_mutex); + + _mosquitto_messages_reconnect_reset(mosq); + + if(mosq->sock != INVALID_SOCKET){ + _mosquitto_socket_close(mosq); //close socket + } + +#ifdef WITH_SOCKS + if(mosq->socks5_host){ + rc = _mosquitto_socket_connect(mosq, mosq->socks5_host, mosq->socks5_port, mosq->bind_address, blocking); + }else +#endif + { + rc = _mosquitto_socket_connect(mosq, mosq->host, mosq->port, mosq->bind_address, blocking); + } + if(rc>0){ + return rc; + } + +#ifdef WITH_SOCKS + if(mosq->socks5_host){ + return mosquitto__socks5_send(mosq); + }else +#endif + { + return _mosquitto_send_connect(mosq, mosq->keepalive, mosq->clean_session); + } +} + +int mosquitto_disconnect(struct mosquitto *mosq) +{ + if(!mosq) return MOSQ_ERR_INVAL; + + pthread_mutex_lock(&mosq->state_mutex); + mosq->state = mosq_cs_disconnecting; + pthread_mutex_unlock(&mosq->state_mutex); + + if(mosq->sock == INVALID_SOCKET) return MOSQ_ERR_NO_CONN; + return _mosquitto_send_disconnect(mosq); +} + +int mosquitto_publish(struct mosquitto *mosq, int *mid, const char *topic, int payloadlen, const void *payload, int qos, bool retain) +{ + struct mosquitto_message_all *message; + uint16_t local_mid; + int queue_status; + + if(!mosq || !topic || qos<0 || qos>2) return MOSQ_ERR_INVAL; + if(STREMPTY(topic)) return MOSQ_ERR_INVAL; + if(payloadlen < 0 || payloadlen > MQTT_MAX_PAYLOAD) return MOSQ_ERR_PAYLOAD_SIZE; + + if(mosquitto_pub_topic_check(topic) != MOSQ_ERR_SUCCESS){ + return MOSQ_ERR_INVAL; + } + + local_mid = _mosquitto_mid_generate(mosq); + if(mid){ + *mid = local_mid; + } + + if(qos == 0){ + return _mosquitto_send_publish(mosq, local_mid, topic, payloadlen, payload, qos, retain, false); + }else{ + message = _mosquitto_calloc(1, sizeof(struct mosquitto_message_all)); + if(!message) return MOSQ_ERR_NOMEM; + + message->next = NULL; + message->timestamp = mosquitto_time(); + message->msg.mid = local_mid; + message->msg.topic = _mosquitto_strdup(topic); + if(!message->msg.topic){ + _mosquitto_message_cleanup(&message); + return MOSQ_ERR_NOMEM; + } + if(payloadlen){ + message->msg.payloadlen = payloadlen; + message->msg.payload = _mosquitto_malloc(payloadlen*sizeof(uint8_t)); + if(!message->msg.payload){ + _mosquitto_message_cleanup(&message); + return MOSQ_ERR_NOMEM; + } + memcpy(message->msg.payload, payload, payloadlen*sizeof(uint8_t)); + }else{ + message->msg.payloadlen = 0; + message->msg.payload = NULL; + } + message->msg.qos = qos; + message->msg.retain = retain; + message->dup = false; + + pthread_mutex_lock(&mosq->out_message_mutex); + queue_status = _mosquitto_message_queue(mosq, message, mosq_md_out); + if(queue_status == 0){ + if(qos == 1){ + message->state = mosq_ms_wait_for_puback; + }else if(qos == 2){ + message->state = mosq_ms_wait_for_pubrec; + } + pthread_mutex_unlock(&mosq->out_message_mutex); + return _mosquitto_send_publish(mosq, message->msg.mid, message->msg.topic, message->msg.payloadlen, message->msg.payload, message->msg.qos, message->msg.retain, message->dup); + }else{ + message->state = mosq_ms_invalid; + pthread_mutex_unlock(&mosq->out_message_mutex); + return MOSQ_ERR_SUCCESS; + } + } +} + +int mosquitto_subscribe(struct mosquitto *mosq, int *mid, const char *sub, int qos) +{ + if(!mosq) return MOSQ_ERR_INVAL; + if(mosq->sock == INVALID_SOCKET) return MOSQ_ERR_NO_CONN; + + if(mosquitto_sub_topic_check(sub)) return MOSQ_ERR_INVAL; + + return _mosquitto_send_subscribe(mosq, mid, sub, qos); +} + +int mosquitto_unsubscribe(struct mosquitto *mosq, int *mid, const char *sub) +{ + if(!mosq) return MOSQ_ERR_INVAL; + if(mosq->sock == INVALID_SOCKET) return MOSQ_ERR_NO_CONN; + + if(mosquitto_sub_topic_check(sub)) return MOSQ_ERR_INVAL; + + return _mosquitto_send_unsubscribe(mosq, mid, sub); +} + +int mosquitto_tls_set(struct mosquitto *mosq, const char *cafile, const char *capath, const char *certfile, const char *keyfile, int (*pw_callback)(char *buf, int size, int rwflag, void *userdata)) +{ +#ifdef WITH_TLS + FILE *fptr; + + if(!mosq || (!cafile && !capath) || (certfile && !keyfile) || (!certfile && keyfile)) return MOSQ_ERR_INVAL; + + if(cafile){ + fptr = _mosquitto_fopen(cafile, "rt", false); + if(fptr){ + fclose(fptr); + }else{ + return MOSQ_ERR_INVAL; + } + mosq->tls_cafile = _mosquitto_strdup(cafile); + + if(!mosq->tls_cafile){ + return MOSQ_ERR_NOMEM; + } + }else if(mosq->tls_cafile){ + _mosquitto_free(mosq->tls_cafile); + mosq->tls_cafile = NULL; + } + + if(capath){ + mosq->tls_capath = _mosquitto_strdup(capath); + if(!mosq->tls_capath){ + return MOSQ_ERR_NOMEM; + } + }else if(mosq->tls_capath){ + _mosquitto_free(mosq->tls_capath); + mosq->tls_capath = NULL; + } + + if(certfile){ + fptr = _mosquitto_fopen(certfile, "rt", false); + if(fptr){ + fclose(fptr); + }else{ + if(mosq->tls_cafile){ + _mosquitto_free(mosq->tls_cafile); + mosq->tls_cafile = NULL; + } + if(mosq->tls_capath){ + _mosquitto_free(mosq->tls_capath); + mosq->tls_capath = NULL; + } + return MOSQ_ERR_INVAL; + } + mosq->tls_certfile = _mosquitto_strdup(certfile); + if(!mosq->tls_certfile){ + return MOSQ_ERR_NOMEM; + } + }else{ + if(mosq->tls_certfile) _mosquitto_free(mosq->tls_certfile); + mosq->tls_certfile = NULL; + } + + if(keyfile){ + fptr = _mosquitto_fopen(keyfile, "rt", false); + if(fptr){ + fclose(fptr); + }else{ + if(mosq->tls_cafile){ + _mosquitto_free(mosq->tls_cafile); + mosq->tls_cafile = NULL; + } + if(mosq->tls_capath){ + _mosquitto_free(mosq->tls_capath); + mosq->tls_capath = NULL; + } + if(mosq->tls_certfile){ + _mosquitto_free(mosq->tls_certfile); + mosq->tls_certfile = NULL; + } + return MOSQ_ERR_INVAL; + } + mosq->tls_keyfile = _mosquitto_strdup(keyfile); + if(!mosq->tls_keyfile){ + return MOSQ_ERR_NOMEM; + } + }else{ + if(mosq->tls_keyfile) _mosquitto_free(mosq->tls_keyfile); + mosq->tls_keyfile = NULL; + } + + mosq->tls_pw_callback = pw_callback; + + + return MOSQ_ERR_SUCCESS; +#else + return MOSQ_ERR_NOT_SUPPORTED; + +#endif +} + +int mosquitto_tls_opts_set(struct mosquitto *mosq, int cert_reqs, const char *tls_version, const char *ciphers) +{ +#ifdef WITH_TLS + if(!mosq) return MOSQ_ERR_INVAL; + + mosq->tls_cert_reqs = cert_reqs; + if(tls_version){ +#if OPENSSL_VERSION_NUMBER >= 0x10001000L + if(!strcasecmp(tls_version, "tlsv1.2") + || !strcasecmp(tls_version, "tlsv1.1") + || !strcasecmp(tls_version, "tlsv1")){ + + mosq->tls_version = _mosquitto_strdup(tls_version); + if(!mosq->tls_version) return MOSQ_ERR_NOMEM; + }else{ + return MOSQ_ERR_INVAL; + } +#else + if(!strcasecmp(tls_version, "tlsv1")){ + mosq->tls_version = _mosquitto_strdup(tls_version); + if(!mosq->tls_version) return MOSQ_ERR_NOMEM; + }else{ + return MOSQ_ERR_INVAL; + } +#endif + }else{ +#if OPENSSL_VERSION_NUMBER >= 0x10001000L + mosq->tls_version = _mosquitto_strdup("tlsv1.2"); +#else + mosq->tls_version = _mosquitto_strdup("tlsv1"); +#endif + if(!mosq->tls_version) return MOSQ_ERR_NOMEM; + } + if(ciphers){ + mosq->tls_ciphers = _mosquitto_strdup(ciphers); + if(!mosq->tls_ciphers) return MOSQ_ERR_NOMEM; + }else{ + mosq->tls_ciphers = NULL; + } + + + return MOSQ_ERR_SUCCESS; +#else + return MOSQ_ERR_NOT_SUPPORTED; + +#endif +} + + +int mosquitto_tls_insecure_set(struct mosquitto *mosq, bool value) +{ +#ifdef WITH_TLS + if(!mosq) return MOSQ_ERR_INVAL; + mosq->tls_insecure = value; + return MOSQ_ERR_SUCCESS; +#else + return MOSQ_ERR_NOT_SUPPORTED; +#endif +} + + +int mosquitto_tls_psk_set(struct mosquitto *mosq, const char *psk, const char *identity, const char *ciphers) +{ +#ifdef REAL_WITH_TLS_PSK + if(!mosq || !psk || !identity) return MOSQ_ERR_INVAL; + + /* Check for hex only digits */ + if(strspn(psk, "0123456789abcdefABCDEF") < strlen(psk)){ + return MOSQ_ERR_INVAL; + } + mosq->tls_psk = _mosquitto_strdup(psk); + if(!mosq->tls_psk) return MOSQ_ERR_NOMEM; + + mosq->tls_psk_identity = _mosquitto_strdup(identity); + if(!mosq->tls_psk_identity){ + _mosquitto_free(mosq->tls_psk); + return MOSQ_ERR_NOMEM; + } + if(ciphers){ + mosq->tls_ciphers = _mosquitto_strdup(ciphers); + if(!mosq->tls_ciphers) return MOSQ_ERR_NOMEM; + }else{ + mosq->tls_ciphers = NULL; + } + + return MOSQ_ERR_SUCCESS; +#else + return MOSQ_ERR_NOT_SUPPORTED; +#endif +} + + +int mosquitto_loop(struct mosquitto *mosq, int timeout, int max_packets) +{ +#ifdef HAVE_PSELECT + struct timespec local_timeout; +#else + struct timeval local_timeout; +#endif + fd_set readfds, writefds; + int fdcount; + int rc; + char pairbuf; + int maxfd = 0; + time_t now; + + if(!mosq || max_packets < 1) return MOSQ_ERR_INVAL; +#ifndef WIN32 + if(mosq->sock >= FD_SETSIZE || mosq->sockpairR >= FD_SETSIZE){ + return MOSQ_ERR_INVAL; + } +#endif + + FD_ZERO(&readfds); + FD_ZERO(&writefds); + if(mosq->sock != INVALID_SOCKET){ + maxfd = mosq->sock; + FD_SET(mosq->sock, &readfds); + pthread_mutex_lock(&mosq->current_out_packet_mutex); + pthread_mutex_lock(&mosq->out_packet_mutex); + if(mosq->out_packet || mosq->current_out_packet){ + FD_SET(mosq->sock, &writefds); + } +#ifdef WITH_TLS + if(mosq->ssl){ + if(mosq->want_write){ + FD_SET(mosq->sock, &writefds); + }else if(mosq->want_connect){ + /* Remove possible FD_SET from above, we don't want to check + * for writing if we are still connecting, unless want_write is + * definitely set. The presence of outgoing packets does not + * matter yet. */ + FD_CLR(mosq->sock, &writefds); + } + } +#endif + pthread_mutex_unlock(&mosq->out_packet_mutex); + pthread_mutex_unlock(&mosq->current_out_packet_mutex); + }else{ +#ifdef WITH_SRV + if(mosq->achan){ + pthread_mutex_lock(&mosq->state_mutex); + if(mosq->state == mosq_cs_connect_srv){ + rc = ares_fds(mosq->achan, &readfds, &writefds); + if(rc > maxfd){ + maxfd = rc; + } + }else{ + pthread_mutex_unlock(&mosq->state_mutex); + return MOSQ_ERR_NO_CONN; + } + pthread_mutex_unlock(&mosq->state_mutex); + } +#else + return MOSQ_ERR_NO_CONN; +#endif + } + if(mosq->sockpairR != INVALID_SOCKET){ + /* sockpairR is used to break out of select() before the timeout, on a + * call to publish() etc. */ + FD_SET(mosq->sockpairR, &readfds); + if(mosq->sockpairR > maxfd){ + maxfd = mosq->sockpairR; + } + } + + if(timeout < 0){ + timeout = 1000; + } + + now = mosquitto_time(); + if(mosq->next_msg_out && now + timeout/1000 > mosq->next_msg_out){ + timeout = (mosq->next_msg_out - now)*1000; + } + + if(timeout < 0){ + /* There has been a delay somewhere which means we should have already + * sent a message. */ + timeout = 0; + } + + local_timeout.tv_sec = timeout/1000; +#ifdef HAVE_PSELECT + local_timeout.tv_nsec = (timeout-local_timeout.tv_sec*1000)*1e6; +#else + local_timeout.tv_usec = (timeout-local_timeout.tv_sec*1000)*1000; +#endif + +#ifdef HAVE_PSELECT + fdcount = pselect(maxfd+1, &readfds, &writefds, NULL, &local_timeout, NULL); +#else + fdcount = select(maxfd+1, &readfds, &writefds, NULL, &local_timeout); +#endif + if(fdcount == -1){ +#ifdef WIN32 + errno = WSAGetLastError(); +#endif + if(errno == EINTR){ + return MOSQ_ERR_SUCCESS; + }else{ + return MOSQ_ERR_ERRNO; + } + }else{ + if(mosq->sock != INVALID_SOCKET){ + if(FD_ISSET(mosq->sock, &readfds)){ +#ifdef WITH_TLS + if(mosq->want_connect){ + rc = mosquitto__socket_connect_tls(mosq); + if(rc) return rc; + }else +#endif + { + do{ + rc = mosquitto_loop_read(mosq, max_packets); + if(rc || mosq->sock == INVALID_SOCKET){ + return rc; + } + }while(SSL_DATA_PENDING(mosq)); + } + } + if(mosq->sockpairR != INVALID_SOCKET && FD_ISSET(mosq->sockpairR, &readfds)){ +#ifndef WIN32 + if(read(mosq->sockpairR, &pairbuf, 1) == 0){ + } +#else + recv(mosq->sockpairR, &pairbuf, 1, 0); +#endif + /* Fake write possible, to stimulate output write even though + * we didn't ask for it, because at that point the publish or + * other command wasn't present. */ + FD_SET(mosq->sock, &writefds); + } + if(FD_ISSET(mosq->sock, &writefds)){ +#ifdef WITH_TLS + if(mosq->want_connect){ + rc = mosquitto__socket_connect_tls(mosq); + if(rc) return rc; + }else +#endif + { + rc = mosquitto_loop_write(mosq, max_packets); + if(rc || mosq->sock == INVALID_SOCKET){ + return rc; + } + } + } + } +#ifdef WITH_SRV + if(mosq->achan){ + ares_process(mosq->achan, &readfds, &writefds); + } +#endif + } + return mosquitto_loop_misc(mosq); +} + +int mosquitto_loop_forever(struct mosquitto *mosq, int timeout, int max_packets) +{ + int run = 1; + int rc; + unsigned int reconnects = 0; + unsigned long reconnect_delay; + + if(!mosq) return MOSQ_ERR_INVAL; + + if(mosq->state == mosq_cs_connect_async){ + mosquitto_reconnect(mosq); + } + + while(run){ + do{ + rc = mosquitto_loop(mosq, timeout, max_packets); + if (reconnects !=0 && rc == MOSQ_ERR_SUCCESS){ + reconnects = 0; + } + }while(run && rc == MOSQ_ERR_SUCCESS); + /* Quit after fatal errors. */ + switch(rc){ + case MOSQ_ERR_NOMEM: + case MOSQ_ERR_PROTOCOL: + case MOSQ_ERR_INVAL: + case MOSQ_ERR_NOT_FOUND: + case MOSQ_ERR_TLS: + case MOSQ_ERR_PAYLOAD_SIZE: + case MOSQ_ERR_NOT_SUPPORTED: + case MOSQ_ERR_AUTH: + case MOSQ_ERR_ACL_DENIED: + case MOSQ_ERR_UNKNOWN: + case MOSQ_ERR_EAI: + case MOSQ_ERR_PROXY: + return rc; + case MOSQ_ERR_ERRNO: + break; + } + if(errno == EPROTO){ + return rc; + } + do{ + rc = MOSQ_ERR_SUCCESS; + pthread_mutex_lock(&mosq->state_mutex); + if(mosq->state == mosq_cs_disconnecting){ + run = 0; + pthread_mutex_unlock(&mosq->state_mutex); + }else{ + pthread_mutex_unlock(&mosq->state_mutex); + + if(mosq->reconnect_delay > 0 && mosq->reconnect_exponential_backoff){ + reconnect_delay = mosq->reconnect_delay*reconnects*reconnects; + }else{ + reconnect_delay = mosq->reconnect_delay; + } + + if(reconnect_delay > mosq->reconnect_delay_max){ + reconnect_delay = mosq->reconnect_delay_max; + }else{ + reconnects++; + } + +#ifdef WIN32 + Sleep(reconnect_delay*1000); +#else + sleep(reconnect_delay); +#endif + + pthread_mutex_lock(&mosq->state_mutex); + if(mosq->state == mosq_cs_disconnecting){ + run = 0; + pthread_mutex_unlock(&mosq->state_mutex); + }else{ + pthread_mutex_unlock(&mosq->state_mutex); + rc = mosquitto_reconnect(mosq); + } + } + }while(run && rc != MOSQ_ERR_SUCCESS); + } + return rc; +} + +int mosquitto_loop_misc(struct mosquitto *mosq) +{ + time_t now; + int rc; + + if(!mosq) return MOSQ_ERR_INVAL; + if(mosq->sock == INVALID_SOCKET) return MOSQ_ERR_NO_CONN; + + _mosquitto_check_keepalive(mosq); + now = mosquitto_time(); + if(mosq->last_retry_check+1 < now){ + _mosquitto_message_retry_check(mosq); + mosq->last_retry_check = now; + } + if(mosq->ping_t && now - mosq->ping_t >= mosq->keepalive){ + /* mosq->ping_t != 0 means we are waiting for a pingresp. + * This hasn't happened in the keepalive time so we should disconnect. + */ + _mosquitto_socket_close(mosq); + pthread_mutex_lock(&mosq->state_mutex); + if(mosq->state == mosq_cs_disconnecting){ + rc = MOSQ_ERR_SUCCESS; + }else{ + rc = 1; + } + pthread_mutex_unlock(&mosq->state_mutex); + pthread_mutex_lock(&mosq->callback_mutex); + if(mosq->on_disconnect){ + mosq->in_callback = true; + mosq->on_disconnect(mosq, mosq->userdata, rc); + mosq->in_callback = false; + } + pthread_mutex_unlock(&mosq->callback_mutex); + return MOSQ_ERR_CONN_LOST; + } + return MOSQ_ERR_SUCCESS; +} + +static int _mosquitto_loop_rc_handle(struct mosquitto *mosq, int rc) +{ + if(rc){ + _mosquitto_socket_close(mosq); + pthread_mutex_lock(&mosq->state_mutex); + if(mosq->state == mosq_cs_disconnecting){ + rc = MOSQ_ERR_SUCCESS; + } + pthread_mutex_unlock(&mosq->state_mutex); + pthread_mutex_lock(&mosq->callback_mutex); + if(mosq->on_disconnect){ + mosq->in_callback = true; + mosq->on_disconnect(mosq, mosq->userdata, rc); + mosq->in_callback = false; + } + pthread_mutex_unlock(&mosq->callback_mutex); + return rc; + } + return rc; +} + +int mosquitto_loop_read(struct mosquitto *mosq, int max_packets) +{ + int rc; + int i; + if(max_packets < 1) return MOSQ_ERR_INVAL; + + pthread_mutex_lock(&mosq->out_message_mutex); + max_packets = mosq->out_queue_len; + pthread_mutex_unlock(&mosq->out_message_mutex); + + pthread_mutex_lock(&mosq->in_message_mutex); + max_packets += mosq->in_queue_len; + pthread_mutex_unlock(&mosq->in_message_mutex); + + if(max_packets < 1) max_packets = 1; + /* Queue len here tells us how many messages are awaiting processing and + * have QoS > 0. We should try to deal with that many in this loop in order + * to keep up. */ + for(i=0; isocks5_host){ + rc = mosquitto__socks5_read(mosq); + }else +#endif + { + rc = _mosquitto_packet_read(mosq); + } + if(rc || errno == EAGAIN || errno == COMPAT_EWOULDBLOCK){ + return _mosquitto_loop_rc_handle(mosq, rc); + } + } + return rc; +} + +int mosquitto_loop_write(struct mosquitto *mosq, int max_packets) +{ + int rc; + int i; + if(max_packets < 1) return MOSQ_ERR_INVAL; + + pthread_mutex_lock(&mosq->out_message_mutex); + max_packets = mosq->out_queue_len; + pthread_mutex_unlock(&mosq->out_message_mutex); + + pthread_mutex_lock(&mosq->in_message_mutex); + max_packets += mosq->in_queue_len; + pthread_mutex_unlock(&mosq->in_message_mutex); + + if(max_packets < 1) max_packets = 1; + /* Queue len here tells us how many messages are awaiting processing and + * have QoS > 0. We should try to deal with that many in this loop in order + * to keep up. */ + for(i=0; iout_packet || mosq->current_out_packet){ + return true; +#ifdef WITH_TLS + }else if(mosq->ssl && mosq->want_write){ + return true; +#endif + }else{ + return false; + } +} + +int mosquitto_opts_set(struct mosquitto *mosq, enum mosq_opt_t option, void *value) +{ + int ival; + + if(!mosq || !value) return MOSQ_ERR_INVAL; + + switch(option){ + case MOSQ_OPT_PROTOCOL_VERSION: + ival = *((int *)value); + if(ival == MQTT_PROTOCOL_V31){ + mosq->protocol = mosq_p_mqtt31; + }else if(ival == MQTT_PROTOCOL_V311){ + mosq->protocol = mosq_p_mqtt311; + }else{ + return MOSQ_ERR_INVAL; + } + break; + default: + return MOSQ_ERR_INVAL; + } + return MOSQ_ERR_SUCCESS; +} + + +void mosquitto_connect_callback_set(struct mosquitto *mosq, void (*on_connect)(struct mosquitto *, void *, int)) +{ + pthread_mutex_lock(&mosq->callback_mutex); + mosq->on_connect = on_connect; + pthread_mutex_unlock(&mosq->callback_mutex); +} + +void mosquitto_disconnect_callback_set(struct mosquitto *mosq, void (*on_disconnect)(struct mosquitto *, void *, int)) +{ + pthread_mutex_lock(&mosq->callback_mutex); + mosq->on_disconnect = on_disconnect; + pthread_mutex_unlock(&mosq->callback_mutex); +} + +void mosquitto_publish_callback_set(struct mosquitto *mosq, void (*on_publish)(struct mosquitto *, void *, int)) +{ + pthread_mutex_lock(&mosq->callback_mutex); + mosq->on_publish = on_publish; + pthread_mutex_unlock(&mosq->callback_mutex); +} + +void mosquitto_message_callback_set(struct mosquitto *mosq, void (*on_message)(struct mosquitto *, void *, const struct mosquitto_message *)) +{ + pthread_mutex_lock(&mosq->callback_mutex); + mosq->on_message = on_message; + pthread_mutex_unlock(&mosq->callback_mutex); +} + +void mosquitto_subscribe_callback_set(struct mosquitto *mosq, void (*on_subscribe)(struct mosquitto *, void *, int, int, const int *)) +{ + pthread_mutex_lock(&mosq->callback_mutex); + mosq->on_subscribe = on_subscribe; + pthread_mutex_unlock(&mosq->callback_mutex); +} + +void mosquitto_unsubscribe_callback_set(struct mosquitto *mosq, void (*on_unsubscribe)(struct mosquitto *, void *, int)) +{ + pthread_mutex_lock(&mosq->callback_mutex); + mosq->on_unsubscribe = on_unsubscribe; + pthread_mutex_unlock(&mosq->callback_mutex); +} + +void mosquitto_log_callback_set(struct mosquitto *mosq, void (*on_log)(struct mosquitto *, void *, int, const char *)) +{ + pthread_mutex_lock(&mosq->log_callback_mutex); + mosq->on_log = on_log; + pthread_mutex_unlock(&mosq->log_callback_mutex); +} + +void mosquitto_user_data_set(struct mosquitto *mosq, void *userdata) +{ + if(mosq){ + mosq->userdata = userdata; + } +} + +const char *mosquitto_strerror(int mosq_errno) +{ + switch(mosq_errno){ + case MOSQ_ERR_CONN_PENDING: + return "Connection pending."; + case MOSQ_ERR_SUCCESS: + return "No error."; + case MOSQ_ERR_NOMEM: + return "Out of memory."; + case MOSQ_ERR_PROTOCOL: + return "A network protocol error occurred when communicating with the broker."; + case MOSQ_ERR_INVAL: + return "Invalid function arguments provided."; + case MOSQ_ERR_NO_CONN: + return "The client is not currently connected."; + case MOSQ_ERR_CONN_REFUSED: + return "The connection was refused."; + case MOSQ_ERR_NOT_FOUND: + return "Message not found (internal error)."; + case MOSQ_ERR_CONN_LOST: + return "The connection was lost."; + case MOSQ_ERR_TLS: + return "A TLS error occurred."; + case MOSQ_ERR_PAYLOAD_SIZE: + return "Payload too large."; + case MOSQ_ERR_NOT_SUPPORTED: + return "This feature is not supported."; + case MOSQ_ERR_AUTH: + return "Authorisation failed."; + case MOSQ_ERR_ACL_DENIED: + return "Access denied by ACL."; + case MOSQ_ERR_UNKNOWN: + return "Unknown error."; + case MOSQ_ERR_ERRNO: + return strerror(errno); + case MOSQ_ERR_EAI: + return "Lookup error."; + case MOSQ_ERR_PROXY: + return "Proxy error."; + default: + return "Unknown error."; + } +} + +const char *mosquitto_connack_string(int connack_code) +{ + switch(connack_code){ + case 0: + return "Connection Accepted."; + case 1: + return "Connection Refused: unacceptable protocol version."; + case 2: + return "Connection Refused: identifier rejected."; + case 3: + return "Connection Refused: broker unavailable."; + case 4: + return "Connection Refused: bad user name or password."; + case 5: + return "Connection Refused: not authorised."; + default: + return "Connection Refused: unknown reason."; + } +} + +int mosquitto_sub_topic_tokenise(const char *subtopic, char ***topics, int *count) +{ + int len; + int hier_count = 1; + int start, stop; + int hier; + int tlen; + int i, j; + + if(!subtopic || !topics || !count) return MOSQ_ERR_INVAL; + + len = strlen(subtopic); + + for(i=0; i len-1){ + /* Separator at end of line */ + }else{ + hier_count++; + } + } + } + + (*topics) = _mosquitto_calloc(hier_count, sizeof(char *)); + if(!(*topics)) return MOSQ_ERR_NOMEM; + + start = 0; + stop = 0; + hier = 0; + + for(i=0; i + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#ifndef MOSQUITTO_H +#define MOSQUITTO_H + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(WIN32) && !defined(WITH_BROKER) +# ifdef libmosquitto_EXPORTS +# define libmosq_EXPORT __declspec(dllexport) +# else +# define libmosq_EXPORT __declspec(dllimport) +# endif +#else +# define libmosq_EXPORT +#endif + +#ifdef WIN32 +# ifndef __cplusplus +# define bool char +# define true 1 +# define false 0 +# endif +#else +# ifndef __cplusplus +# include +# endif +#endif + +#define LIBMOSQUITTO_MAJOR 1 +#define LIBMOSQUITTO_MINOR 4 +#define LIBMOSQUITTO_REVISION 14 +/* LIBMOSQUITTO_VERSION_NUMBER looks like 1002001 for e.g. version 1.2.1. */ +#define LIBMOSQUITTO_VERSION_NUMBER (LIBMOSQUITTO_MAJOR*1000000+LIBMOSQUITTO_MINOR*1000+LIBMOSQUITTO_REVISION) + +/* Log types */ +#define MOSQ_LOG_NONE 0x00 +#define MOSQ_LOG_INFO 0x01 +#define MOSQ_LOG_NOTICE 0x02 +#define MOSQ_LOG_WARNING 0x04 +#define MOSQ_LOG_ERR 0x08 +#define MOSQ_LOG_DEBUG 0x10 +#define MOSQ_LOG_SUBSCRIBE 0x20 +#define MOSQ_LOG_UNSUBSCRIBE 0x40 +#define MOSQ_LOG_WEBSOCKETS 0x80 +#define MOSQ_LOG_ALL 0xFFFF + +/* Error values */ +enum mosq_err_t { + MOSQ_ERR_CONN_PENDING = -1, + MOSQ_ERR_SUCCESS = 0, + MOSQ_ERR_NOMEM = 1, + MOSQ_ERR_PROTOCOL = 2, + MOSQ_ERR_INVAL = 3, + MOSQ_ERR_NO_CONN = 4, + MOSQ_ERR_CONN_REFUSED = 5, + MOSQ_ERR_NOT_FOUND = 6, + MOSQ_ERR_CONN_LOST = 7, + MOSQ_ERR_TLS = 8, + MOSQ_ERR_PAYLOAD_SIZE = 9, + MOSQ_ERR_NOT_SUPPORTED = 10, + MOSQ_ERR_AUTH = 11, + MOSQ_ERR_ACL_DENIED = 12, + MOSQ_ERR_UNKNOWN = 13, + MOSQ_ERR_ERRNO = 14, + MOSQ_ERR_EAI = 15, + MOSQ_ERR_PROXY = 16 +}; + +/* Error values */ +enum mosq_opt_t { + MOSQ_OPT_PROTOCOL_VERSION = 1, +}; + +/* MQTT specification restricts client ids to a maximum of 23 characters */ +#define MOSQ_MQTT_ID_MAX_LENGTH 23 + +#define MQTT_PROTOCOL_V31 3 +#define MQTT_PROTOCOL_V311 4 + +struct mosquitto_message{ + int mid; + char *topic; + void *payload; + int payloadlen; + int qos; + bool retain; +}; + +struct mosquitto; + +/* + * Topic: Threads + * libmosquitto provides thread safe operation, with the exception of + * which is not thread safe. + * + * If your application uses threads you must use to + * tell the library this is the case, otherwise it makes some optimisations + * for the single threaded case that may result in unexpected behaviour for + * the multi threaded case. + */ +/*************************************************** + * Important note + * + * The following functions that deal with network operations will return + * MOSQ_ERR_SUCCESS on success, but this does not mean that the operation has + * taken place. An attempt will be made to write the network data, but if the + * socket is not available for writing at that time then the packet will not be + * sent. To ensure the packet is sent, call mosquitto_loop() (which must also + * be called to process incoming network data). + * This is especially important when disconnecting a client that has a will. If + * the broker does not receive the DISCONNECT command, it will assume that the + * client has disconnected unexpectedly and send the will. + * + * mosquitto_connect() + * mosquitto_disconnect() + * mosquitto_subscribe() + * mosquitto_unsubscribe() + * mosquitto_publish() + ***************************************************/ + +/* + * Function: mosquitto_lib_version + * + * Can be used to obtain version information for the mosquitto library. + * This allows the application to compare the library version against the + * version it was compiled against by using the LIBMOSQUITTO_MAJOR, + * LIBMOSQUITTO_MINOR and LIBMOSQUITTO_REVISION defines. + * + * Parameters: + * major - an integer pointer. If not NULL, the major version of the + * library will be returned in this variable. + * minor - an integer pointer. If not NULL, the minor version of the + * library will be returned in this variable. + * revision - an integer pointer. If not NULL, the revision of the library will + * be returned in this variable. + * + * Returns: + * LIBMOSQUITTO_VERSION_NUMBER, which is a unique number based on the major, + * minor and revision values. + * See Also: + * , + */ +libmosq_EXPORT int mosquitto_lib_version(int *major, int *minor, int *revision); + +/* + * Function: mosquitto_lib_init + * + * Must be called before any other mosquitto functions. + * + * This function is *not* thread safe. + * + * Returns: + * MOSQ_ERR_SUCCESS - always + * + * See Also: + * , + */ +libmosq_EXPORT int mosquitto_lib_init(void); + +/* + * Function: mosquitto_lib_cleanup + * + * Call to free resources associated with the library. + * + * Returns: + * MOSQ_ERR_SUCCESS - always + * + * See Also: + * , + */ +libmosq_EXPORT int mosquitto_lib_cleanup(void); + +/* + * Function: mosquitto_new + * + * Create a new mosquitto client instance. + * + * Parameters: + * id - String to use as the client id. If NULL, a random client id + * will be generated. If id is NULL, clean_session must be true. + * clean_session - set to true to instruct the broker to clean all messages + * and subscriptions on disconnect, false to instruct it to + * keep them. See the man page mqtt(7) for more details. + * Note that a client will never discard its own outgoing + * messages on disconnect. Calling or + * will cause the messages to be resent. + * Use to reset a client to its + * original state. + * Must be set to true if the id parameter is NULL. + * obj - A user pointer that will be passed as an argument to any + * callbacks that are specified. + * + * Returns: + * Pointer to a struct mosquitto on success. + * NULL on failure. Interrogate errno to determine the cause for the failure: + * - ENOMEM on out of memory. + * - EINVAL on invalid input parameters. + * + * See Also: + * , , + */ +libmosq_EXPORT struct mosquitto *mosquitto_new(const char *id, bool clean_session, void *obj); + +/* + * Function: mosquitto_destroy + * + * Use to free memory associated with a mosquitto client instance. + * + * Parameters: + * mosq - a struct mosquitto pointer to free. + * + * See Also: + * , + */ +libmosq_EXPORT void mosquitto_destroy(struct mosquitto *mosq); + +/* + * Function: mosquitto_reinitialise + * + * This function allows an existing mosquitto client to be reused. Call on a + * mosquitto instance to close any open network connections, free memory + * and reinitialise the client with the new parameters. The end result is the + * same as the output of . + * + * Parameters: + * mosq - a valid mosquitto instance. + * id - string to use as the client id. If NULL, a random client id + * will be generated. If id is NULL, clean_session must be true. + * clean_session - set to true to instruct the broker to clean all messages + * and subscriptions on disconnect, false to instruct it to + * keep them. See the man page mqtt(7) for more details. + * Must be set to true if the id parameter is NULL. + * obj - A user pointer that will be passed as an argument to any + * callbacks that are specified. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NOMEM - if an out of memory condition occurred. + * + * See Also: + * , + */ +libmosq_EXPORT int mosquitto_reinitialise(struct mosquitto *mosq, const char *id, bool clean_session, void *obj); + +/* + * Function: mosquitto_will_set + * + * Configure will information for a mosquitto instance. By default, clients do + * not have a will. This must be called before calling . + * + * Parameters: + * mosq - a valid mosquitto instance. + * topic - the topic on which to publish the will. + * payloadlen - the size of the payload (bytes). Valid values are between 0 and + * 268,435,455. + * payload - pointer to the data to send. If payloadlen > 0 this must be a + * valid memory location. + * qos - integer value 0, 1 or 2 indicating the Quality of Service to be + * used for the will. + * retain - set to true to make the will a retained message. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NOMEM - if an out of memory condition occurred. + * MOSQ_ERR_PAYLOAD_SIZE - if payloadlen is too large. + */ +libmosq_EXPORT int mosquitto_will_set(struct mosquitto *mosq, const char *topic, int payloadlen, const void *payload, int qos, bool retain); + +/* + * Function: mosquitto_will_clear + * + * Remove a previously configured will. This must be called before calling + * . + * + * Parameters: + * mosq - a valid mosquitto instance. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + */ +libmosq_EXPORT int mosquitto_will_clear(struct mosquitto *mosq); + +/* + * Function: mosquitto_username_pw_set + * + * Configure username and password for a mosquitton instance. This is only + * supported by brokers that implement the MQTT spec v3.1. By default, no + * username or password will be sent. + * If username is NULL, the password argument is ignored. + * This must be called before calling mosquitto_connect(). + * + * This is must be called before calling . + * + * Parameters: + * mosq - a valid mosquitto instance. + * username - the username to send as a string, or NULL to disable + * authentication. + * password - the password to send as a string. Set to NULL when username is + * valid in order to send just a username. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NOMEM - if an out of memory condition occurred. + */ +libmosq_EXPORT int mosquitto_username_pw_set(struct mosquitto *mosq, const char *username, const char *password); + +/* + * Function: mosquitto_connect + * + * Connect to an MQTT broker. + * + * Parameters: + * mosq - a valid mosquitto instance. + * host - the hostname or ip address of the broker to connect to. + * port - the network port to connect to. Usually 1883. + * keepalive - the number of seconds after which the broker should send a PING + * message to the client if no other messages have been exchanged + * in that time. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_ERRNO - if a system call returned an error. The variable errno + * contains the error code, even on Windows. + * Use strerror_r() where available or FormatMessage() on + * Windows. + * + * See Also: + * , , , , + */ +libmosq_EXPORT int mosquitto_connect(struct mosquitto *mosq, const char *host, int port, int keepalive); + +/* + * Function: mosquitto_connect_bind + * + * Connect to an MQTT broker. This extends the functionality of + * by adding the bind_address parameter. Use this function + * if you need to restrict network communication over a particular interface. + * + * Parameters: + * mosq - a valid mosquitto instance. + * host - the hostname or ip address of the broker to connect to. + * port - the network port to connect to. Usually 1883. + * keepalive - the number of seconds after which the broker should send a PING + * message to the client if no other messages have been exchanged + * in that time. + * bind_address - the hostname or ip address of the local network interface to + * bind to. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_ERRNO - if a system call returned an error. The variable errno + * contains the error code, even on Windows. + * Use strerror_r() where available or FormatMessage() on + * Windows. + * + * See Also: + * , , + */ +libmosq_EXPORT int mosquitto_connect_bind(struct mosquitto *mosq, const char *host, int port, int keepalive, const char *bind_address); + +/* + * Function: mosquitto_connect_async + * + * Connect to an MQTT broker. This is a non-blocking call. If you use + * your client must use the threaded interface + * . If you need to use , you must use + * to connect the client. + * + * May be called before or after . + * + * Parameters: + * mosq - a valid mosquitto instance. + * host - the hostname or ip address of the broker to connect to. + * port - the network port to connect to. Usually 1883. + * keepalive - the number of seconds after which the broker should send a PING + * message to the client if no other messages have been exchanged + * in that time. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_ERRNO - if a system call returned an error. The variable errno + * contains the error code, even on Windows. + * Use strerror_r() where available or FormatMessage() on + * Windows. + * + * See Also: + * , , , , + */ +libmosq_EXPORT int mosquitto_connect_async(struct mosquitto *mosq, const char *host, int port, int keepalive); + +/* + * Function: mosquitto_connect_bind_async + * + * Connect to an MQTT broker. This is a non-blocking call. If you use + * your client must use the threaded interface + * . If you need to use , you must use + * to connect the client. + * + * This extends the functionality of by adding the + * bind_address parameter. Use this function if you need to restrict network + * communication over a particular interface. + * + * May be called before or after . + * + * Parameters: + * mosq - a valid mosquitto instance. + * host - the hostname or ip address of the broker to connect to. + * port - the network port to connect to. Usually 1883. + * keepalive - the number of seconds after which the broker should send a PING + * message to the client if no other messages have been exchanged + * in that time. + * bind_address - the hostname or ip address of the local network interface to + * bind to. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_ERRNO - if a system call returned an error. The variable errno + * contains the error code, even on Windows. + * Use strerror_r() where available or FormatMessage() on + * Windows. + * + * See Also: + * , , + */ +libmosq_EXPORT int mosquitto_connect_bind_async(struct mosquitto *mosq, const char *host, int port, int keepalive, const char *bind_address); + +/* + * Function: mosquitto_connect_srv + * + * Connect to an MQTT broker. This is a non-blocking call. If you use + * your client must use the threaded interface + * . If you need to use , you must use + * to connect the client. + * + * This extends the functionality of by adding the + * bind_address parameter. Use this function if you need to restrict network + * communication over a particular interface. + * + * May be called before or after . + * + * Parameters: + * mosq - a valid mosquitto instance. + * host - the hostname or ip address of the broker to connect to. + * keepalive - the number of seconds after which the broker should send a PING + * message to the client if no other messages have been exchanged + * in that time. + * bind_address - the hostname or ip address of the local network interface to + * bind to. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_ERRNO - if a system call returned an error. The variable errno + * contains the error code, even on Windows. + * Use strerror_r() where available or FormatMessage() on + * Windows. + * + * See Also: + * , , + */ +libmosq_EXPORT int mosquitto_connect_srv(struct mosquitto *mosq, const char *host, int keepalive, const char *bind_address); + +/* + * Function: mosquitto_reconnect + * + * Reconnect to a broker. + * + * This function provides an easy way of reconnecting to a broker after a + * connection has been lost. It uses the values that were provided in the + * call. It must not be called before + * . + * + * Parameters: + * mosq - a valid mosquitto instance. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NOMEM - if an out of memory condition occurred. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_ERRNO - if a system call returned an error. The variable errno + * contains the error code, even on Windows. + * Use strerror_r() where available or FormatMessage() on + * Windows. + * + * See Also: + * , , + */ +libmosq_EXPORT int mosquitto_reconnect(struct mosquitto *mosq); + +/* + * Function: mosquitto_reconnect_async + * + * Reconnect to a broker. Non blocking version of . + * + * This function provides an easy way of reconnecting to a broker after a + * connection has been lost. It uses the values that were provided in the + * or calls. It must not be + * called before . + * + * Parameters: + * mosq - a valid mosquitto instance. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NOMEM - if an out of memory condition occurred. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_ERRNO - if a system call returned an error. The variable errno + * contains the error code, even on Windows. + * Use strerror_r() where available or FormatMessage() on + * Windows. + * + * See Also: + * , + */ +libmosq_EXPORT int mosquitto_reconnect_async(struct mosquitto *mosq); + +/* + * Function: mosquitto_disconnect + * + * Disconnect from the broker. + * + * Parameters: + * mosq - a valid mosquitto instance. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NO_CONN - if the client isn't connected to a broker. + */ +libmosq_EXPORT int mosquitto_disconnect(struct mosquitto *mosq); + +/* + * Function: mosquitto_publish + * + * Publish a message on a given topic. + * + * Parameters: + * mosq - a valid mosquitto instance. + * mid - pointer to an int. If not NULL, the function will set this + * to the message id of this particular message. This can be then + * used with the publish callback to determine when the message + * has been sent. + * Note that although the MQTT protocol doesn't use message ids + * for messages with QoS=0, libmosquitto assigns them message ids + * so they can be tracked with this parameter. + * topic - null terminated string of the topic to publish to. + * payloadlen - the size of the payload (bytes). Valid values are between 0 and + * 268,435,455. + * payload - pointer to the data to send. If payloadlen > 0 this must be a + * valid memory location. + * qos - integer value 0, 1 or 2 indicating the Quality of Service to be + * used for the message. + * retain - set to true to make the message retained. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NOMEM - if an out of memory condition occurred. + * MOSQ_ERR_NO_CONN - if the client isn't connected to a broker. + * MOSQ_ERR_PROTOCOL - if there is a protocol error communicating with the + * broker. + * MOSQ_ERR_PAYLOAD_SIZE - if payloadlen is too large. + * + * See Also: + * + */ +libmosq_EXPORT int mosquitto_publish(struct mosquitto *mosq, int *mid, const char *topic, int payloadlen, const void *payload, int qos, bool retain); + +/* + * Function: mosquitto_subscribe + * + * Subscribe to a topic. + * + * Parameters: + * mosq - a valid mosquitto instance. + * mid - a pointer to an int. If not NULL, the function will set this to + * the message id of this particular message. This can be then used + * with the subscribe callback to determine when the message has been + * sent. + * sub - the subscription pattern. + * qos - the requested Quality of Service for this subscription. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NOMEM - if an out of memory condition occurred. + * MOSQ_ERR_NO_CONN - if the client isn't connected to a broker. + */ +libmosq_EXPORT int mosquitto_subscribe(struct mosquitto *mosq, int *mid, const char *sub, int qos); + +/* + * Function: mosquitto_unsubscribe + * + * Unsubscribe from a topic. + * + * Parameters: + * mosq - a valid mosquitto instance. + * mid - a pointer to an int. If not NULL, the function will set this to + * the message id of this particular message. This can be then used + * with the unsubscribe callback to determine when the message has been + * sent. + * sub - the unsubscription pattern. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NOMEM - if an out of memory condition occurred. + * MOSQ_ERR_NO_CONN - if the client isn't connected to a broker. + */ +libmosq_EXPORT int mosquitto_unsubscribe(struct mosquitto *mosq, int *mid, const char *sub); + +/* + * Function: mosquitto_message_copy + * + * Copy the contents of a mosquitto message to another message. + * Useful for preserving a message received in the on_message() callback. + * + * Parameters: + * dst - a pointer to a valid mosquitto_message struct to copy to. + * src - a pointer to a valid mosquitto_message struct to copy from. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NOMEM - if an out of memory condition occurred. + * + * See Also: + * + */ +libmosq_EXPORT int mosquitto_message_copy(struct mosquitto_message *dst, const struct mosquitto_message *src); + +/* + * Function: mosquitto_message_free + * + * Completely free a mosquitto_message struct. + * + * Parameters: + * message - pointer to a mosquitto_message pointer to free. + * + * See Also: + * + */ +libmosq_EXPORT void mosquitto_message_free(struct mosquitto_message **message); + +/* + * Function: mosquitto_loop + * + * The main network loop for the client. You must call this frequently in order + * to keep communications between the client and broker working. If incoming + * data is present it will then be processed. Outgoing commands, from e.g. + * , are normally sent immediately that their function is + * called, but this is not always possible. will also attempt + * to send any remaining outgoing messages, which also includes commands that + * are part of the flow for messages with QoS>0. + * + * An alternative approach is to use to run the client + * loop in its own thread. + * + * This calls select() to monitor the client network socket. If you want to + * integrate mosquitto client operation with your own select() call, use + * , , and + * . + * + * Threads: + * + * Parameters: + * mosq - a valid mosquitto instance. + * timeout - Maximum number of milliseconds to wait for network activity + * in the select() call before timing out. Set to 0 for instant + * return. Set negative to use the default of 1000ms. + * max_packets - this parameter is currently unused and should be set to 1 for + * future compatibility. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NOMEM - if an out of memory condition occurred. + * MOSQ_ERR_NO_CONN - if the client isn't connected to a broker. + * MOSQ_ERR_CONN_LOST - if the connection to the broker was lost. + * MOSQ_ERR_PROTOCOL - if there is a protocol error communicating with the + * broker. + * MOSQ_ERR_ERRNO - if a system call returned an error. The variable errno + * contains the error code, even on Windows. + * Use strerror_r() where available or FormatMessage() on + * Windows. + * See Also: + * , , + */ +libmosq_EXPORT int mosquitto_loop(struct mosquitto *mosq, int timeout, int max_packets); + +/* + * Function: mosquitto_loop_forever + * + * This function call loop() for you in an infinite blocking loop. It is useful + * for the case where you only want to run the MQTT client loop in your + * program. + * + * It handles reconnecting in case server connection is lost. If you call + * mosquitto_disconnect() in a callback it will return. + * + * Parameters: + * mosq - a valid mosquitto instance. + * timeout - Maximum number of milliseconds to wait for network activity + * in the select() call before timing out. Set to 0 for instant + * return. Set negative to use the default of 1000ms. + * max_packets - this parameter is currently unused and should be set to 1 for + * future compatibility. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NOMEM - if an out of memory condition occurred. + * MOSQ_ERR_NO_CONN - if the client isn't connected to a broker. + * MOSQ_ERR_CONN_LOST - if the connection to the broker was lost. + * MOSQ_ERR_PROTOCOL - if there is a protocol error communicating with the + * broker. + * MOSQ_ERR_ERRNO - if a system call returned an error. The variable errno + * contains the error code, even on Windows. + * Use strerror_r() where available or FormatMessage() on + * Windows. + * + * See Also: + * , + */ +libmosq_EXPORT int mosquitto_loop_forever(struct mosquitto *mosq, int timeout, int max_packets); + +/* + * Function: mosquitto_loop_start + * + * This is part of the threaded client interface. Call this once to start a new + * thread to process network traffic. This provides an alternative to + * repeatedly calling yourself. + * + * Parameters: + * mosq - a valid mosquitto instance. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NOT_SUPPORTED - if thread support is not available. + * + * See Also: + * , , , + */ +libmosq_EXPORT int mosquitto_loop_start(struct mosquitto *mosq); + +/* + * Function: mosquitto_loop_stop + * + * This is part of the threaded client interface. Call this once to stop the + * network thread previously created with . This call + * will block until the network thread finishes. For the network thread to end, + * you must have previously called or have set the force + * parameter to true. + * + * Parameters: + * mosq - a valid mosquitto instance. + * force - set to true to force thread cancellation. If false, + * must have already been called. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NOT_SUPPORTED - if thread support is not available. + * + * See Also: + * , + */ +libmosq_EXPORT int mosquitto_loop_stop(struct mosquitto *mosq, bool force); + +/* + * Function: mosquitto_socket + * + * Return the socket handle for a mosquitto instance. Useful if you want to + * include a mosquitto client in your own select() calls. + * + * Parameters: + * mosq - a valid mosquitto instance. + * + * Returns: + * The socket for the mosquitto client or -1 on failure. + */ +libmosq_EXPORT int mosquitto_socket(struct mosquitto *mosq); + +/* + * Function: mosquitto_loop_read + * + * Carry out network read operations. + * This should only be used if you are not using mosquitto_loop() and are + * monitoring the client network socket for activity yourself. + * + * Parameters: + * mosq - a valid mosquitto instance. + * max_packets - this parameter is currently unused and should be set to 1 for + * future compatibility. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NOMEM - if an out of memory condition occurred. + * MOSQ_ERR_NO_CONN - if the client isn't connected to a broker. + * MOSQ_ERR_CONN_LOST - if the connection to the broker was lost. + * MOSQ_ERR_PROTOCOL - if there is a protocol error communicating with the + * broker. + * MOSQ_ERR_ERRNO - if a system call returned an error. The variable errno + * contains the error code, even on Windows. + * Use strerror_r() where available or FormatMessage() on + * Windows. + * + * See Also: + * , , + */ +libmosq_EXPORT int mosquitto_loop_read(struct mosquitto *mosq, int max_packets); + +/* + * Function: mosquitto_loop_write + * + * Carry out network write operations. + * This should only be used if you are not using mosquitto_loop() and are + * monitoring the client network socket for activity yourself. + * + * Parameters: + * mosq - a valid mosquitto instance. + * max_packets - this parameter is currently unused and should be set to 1 for + * future compatibility. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NOMEM - if an out of memory condition occurred. + * MOSQ_ERR_NO_CONN - if the client isn't connected to a broker. + * MOSQ_ERR_CONN_LOST - if the connection to the broker was lost. + * MOSQ_ERR_PROTOCOL - if there is a protocol error communicating with the + * broker. + * MOSQ_ERR_ERRNO - if a system call returned an error. The variable errno + * contains the error code, even on Windows. + * Use strerror_r() where available or FormatMessage() on + * Windows. + * + * See Also: + * , , , + */ +libmosq_EXPORT int mosquitto_loop_write(struct mosquitto *mosq, int max_packets); + +/* + * Function: mosquitto_loop_misc + * + * Carry out miscellaneous operations required as part of the network loop. + * This should only be used if you are not using mosquitto_loop() and are + * monitoring the client network socket for activity yourself. + * + * This function deals with handling PINGs and checking whether messages need + * to be retried, so should be called fairly frequently. + * + * Parameters: + * mosq - a valid mosquitto instance. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NO_CONN - if the client isn't connected to a broker. + * + * See Also: + * , , + */ +libmosq_EXPORT int mosquitto_loop_misc(struct mosquitto *mosq); + +/* + * Function: mosquitto_want_write + * + * Returns true if there is data ready to be written on the socket. + * + * Parameters: + * mosq - a valid mosquitto instance. + * + * See Also: + * , , + */ +libmosq_EXPORT bool mosquitto_want_write(struct mosquitto *mosq); + +/* + * Function: mosquitto_threaded_set + * + * Used to tell the library that your application is using threads, but not + * using . The library operates slightly differently when + * not in threaded mode in order to simplify its operation. If you are managing + * your own threads and do not use this function you will experience crashes + * due to race conditions. + * + * When using , this is set automatically. + * + * Parameters: + * mosq - a valid mosquitto instance. + * threaded - true if your application is using threads, false otherwise. + */ +libmosq_EXPORT int mosquitto_threaded_set(struct mosquitto *mosq, bool threaded); + +/* + * Function: mosquitto_opts_set + * + * Used to set options for the client. + * + * Parameters: + * mosq - a valid mosquitto instance. + * option - the option to set. + * value - the option specific value. + * + * Options: + * MOSQ_OPT_PROTOCOL_VERSION - value must be an int, set to either + * MQTT_PROTOCOL_V31 or MQTT_PROTOCOL_V311. Must + * be set before the client connects. Defaults to + * MQTT_PROTOCOL_V31. + */ +libmosq_EXPORT int mosquitto_opts_set(struct mosquitto *mosq, enum mosq_opt_t option, void *value); + + +/* + * Function: mosquitto_tls_set + * + * Configure the client for certificate based SSL/TLS support. Must be called + * before . + * + * Cannot be used in conjunction with . + * + * Define the Certificate Authority certificates to be trusted (ie. the server + * certificate must be signed with one of these certificates) using cafile. + * + * If the server you are connecting to requires clients to provide a + * certificate, define certfile and keyfile with your client certificate and + * private key. If your private key is encrypted, provide a password callback + * function or you will have to enter the password at the command line. + * + * Parameters: + * mosq - a valid mosquitto instance. + * cafile - path to a file containing the PEM encoded trusted CA + * certificate files. Either cafile or capath must not be NULL. + * capath - path to a directory containing the PEM encoded trusted CA + * certificate files. See mosquitto.conf for more details on + * configuring this directory. Either cafile or capath must not + * be NULL. + * certfile - path to a file containing the PEM encoded certificate file + * for this client. If NULL, keyfile must also be NULL and no + * client certificate will be used. + * keyfile - path to a file containing the PEM encoded private key for + * this client. If NULL, certfile must also be NULL and no + * client certificate will be used. + * pw_callback - if keyfile is encrypted, set pw_callback to allow your client + * to pass the correct password for decryption. If set to NULL, + * the password must be entered on the command line. + * Your callback must write the password into "buf", which is + * "size" bytes long. The return value must be the length of the + * password. "userdata" will be set to the calling mosquitto + * instance. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NOMEM - if an out of memory condition occurred. + * + * See Also: + * , , + */ +libmosq_EXPORT int mosquitto_tls_set(struct mosquitto *mosq, + const char *cafile, const char *capath, + const char *certfile, const char *keyfile, + int (*pw_callback)(char *buf, int size, int rwflag, void *userdata)); + +/* + * Function: mosquitto_tls_insecure_set + * + * Configure verification of the server hostname in the server certificate. If + * value is set to true, it is impossible to guarantee that the host you are + * connecting to is not impersonating your server. This can be useful in + * initial server testing, but makes it possible for a malicious third party to + * impersonate your server through DNS spoofing, for example. + * Do not use this function in a real system. Setting value to true makes the + * connection encryption pointless. + * Must be called before . + * + * Parameters: + * mosq - a valid mosquitto instance. + * value - if set to false, the default, certificate hostname checking is + * performed. If set to true, no hostname checking is performed and + * the connection is insecure. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * + * See Also: + * + */ +libmosq_EXPORT int mosquitto_tls_insecure_set(struct mosquitto *mosq, bool value); + +/* + * Function: mosquitto_tls_opts_set + * + * Set advanced SSL/TLS options. Must be called before . + * + * Parameters: + * mosq - a valid mosquitto instance. + * cert_reqs - an integer defining the verification requirements the client + * will impose on the server. This can be one of: + * * SSL_VERIFY_NONE (0): the server will not be verified in any way. + * * SSL_VERIFY_PEER (1): the server certificate will be verified + * and the connection aborted if the verification fails. + * The default and recommended value is SSL_VERIFY_PEER. Using + * SSL_VERIFY_NONE provides no security. + * tls_version - the version of the SSL/TLS protocol to use as a string. If NULL, + * the default value is used. The default value and the + * available values depend on the version of openssl that the + * library was compiled against. For openssl >= 1.0.1, the + * available options are tlsv1.2, tlsv1.1 and tlsv1, with tlv1.2 + * as the default. For openssl < 1.0.1, only tlsv1 is available. + * ciphers - a string describing the ciphers available for use. See the + * "openssl ciphers" tool for more information. If NULL, the + * default ciphers will be used. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NOMEM - if an out of memory condition occurred. + * + * See Also: + * + */ +libmosq_EXPORT int mosquitto_tls_opts_set(struct mosquitto *mosq, int cert_reqs, const char *tls_version, const char *ciphers); + +/* + * Function: mosquitto_tls_psk_set + * + * Configure the client for pre-shared-key based TLS support. Must be called + * before . + * + * Cannot be used in conjunction with . + * + * Parameters: + * mosq - a valid mosquitto instance. + * psk - the pre-shared-key in hex format with no leading "0x". + * identity - the identity of this client. May be used as the username + * depending on the server settings. + * ciphers - a string describing the PSK ciphers available for use. See the + * "openssl ciphers" tool for more information. If NULL, the + * default ciphers will be used. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NOMEM - if an out of memory condition occurred. + * + * See Also: + * + */ +libmosq_EXPORT int mosquitto_tls_psk_set(struct mosquitto *mosq, const char *psk, const char *identity, const char *ciphers); + +/* + * Function: mosquitto_connect_callback_set + * + * Set the connect callback. This is called when the broker sends a CONNACK + * message in response to a connection. + * + * Parameters: + * mosq - a valid mosquitto instance. + * on_connect - a callback function in the following form: + * void callback(struct mosquitto *mosq, void *obj, int rc) + * + * Callback Parameters: + * mosq - the mosquitto instance making the callback. + * obj - the user data provided in + * rc - the return code of the connection response, one of: + * + * * 0 - success + * * 1 - connection refused (unacceptable protocol version) + * * 2 - connection refused (identifier rejected) + * * 3 - connection refused (broker unavailable) + * * 4-255 - reserved for future use + */ +libmosq_EXPORT void mosquitto_connect_callback_set(struct mosquitto *mosq, void (*on_connect)(struct mosquitto *, void *, int)); + +/* + * Function: mosquitto_disconnect_callback_set + * + * Set the disconnect callback. This is called when the broker has received the + * DISCONNECT command and has disconnected the client. + * + * Parameters: + * mosq - a valid mosquitto instance. + * on_disconnect - a callback function in the following form: + * void callback(struct mosquitto *mosq, void *obj) + * + * Callback Parameters: + * mosq - the mosquitto instance making the callback. + * obj - the user data provided in + * rc - integer value indicating the reason for the disconnect. A value of 0 + * means the client has called . Any other value + * indicates that the disconnect is unexpected. + */ +libmosq_EXPORT void mosquitto_disconnect_callback_set(struct mosquitto *mosq, void (*on_disconnect)(struct mosquitto *, void *, int)); + +/* + * Function: mosquitto_publish_callback_set + * + * Set the publish callback. This is called when a message initiated with + * has been sent to the broker successfully. + * + * Parameters: + * mosq - a valid mosquitto instance. + * on_publish - a callback function in the following form: + * void callback(struct mosquitto *mosq, void *obj, int mid) + * + * Callback Parameters: + * mosq - the mosquitto instance making the callback. + * obj - the user data provided in + * mid - the message id of the sent message. + */ +libmosq_EXPORT void mosquitto_publish_callback_set(struct mosquitto *mosq, void (*on_publish)(struct mosquitto *, void *, int)); + +/* + * Function: mosquitto_message_callback_set + * + * Set the message callback. This is called when a message is received from the + * broker. + * + * Parameters: + * mosq - a valid mosquitto instance. + * on_message - a callback function in the following form: + * void callback(struct mosquitto *mosq, void *obj, const struct mosquitto_message *message) + * + * Callback Parameters: + * mosq - the mosquitto instance making the callback. + * obj - the user data provided in + * message - the message data. This variable and associated memory will be + * freed by the library after the callback completes. The client + * should make copies of any of the data it requires. + * + * See Also: + * + */ +libmosq_EXPORT void mosquitto_message_callback_set(struct mosquitto *mosq, void (*on_message)(struct mosquitto *, void *, const struct mosquitto_message *)); + +/* + * Function: mosquitto_subscribe_callback_set + * + * Set the subscribe callback. This is called when the broker responds to a + * subscription request. + * + * Parameters: + * mosq - a valid mosquitto instance. + * on_subscribe - a callback function in the following form: + * void callback(struct mosquitto *mosq, void *obj, int mid, int qos_count, const int *granted_qos) + * + * Callback Parameters: + * mosq - the mosquitto instance making the callback. + * obj - the user data provided in + * mid - the message id of the subscribe message. + * qos_count - the number of granted subscriptions (size of granted_qos). + * granted_qos - an array of integers indicating the granted QoS for each of + * the subscriptions. + */ +libmosq_EXPORT void mosquitto_subscribe_callback_set(struct mosquitto *mosq, void (*on_subscribe)(struct mosquitto *, void *, int, int, const int *)); + +/* + * Function: mosquitto_unsubscribe_callback_set + * + * Set the unsubscribe callback. This is called when the broker responds to a + * unsubscription request. + * + * Parameters: + * mosq - a valid mosquitto instance. + * on_unsubscribe - a callback function in the following form: + * void callback(struct mosquitto *mosq, void *obj, int mid) + * + * Callback Parameters: + * mosq - the mosquitto instance making the callback. + * obj - the user data provided in + * mid - the message id of the unsubscribe message. + */ +libmosq_EXPORT void mosquitto_unsubscribe_callback_set(struct mosquitto *mosq, void (*on_unsubscribe)(struct mosquitto *, void *, int)); + +/* + * Function: mosquitto_log_callback_set + * + * Set the logging callback. This should be used if you want event logging + * information from the client library. + * + * mosq - a valid mosquitto instance. + * on_log - a callback function in the following form: + * void callback(struct mosquitto *mosq, void *obj, int level, const char *str) + * + * Callback Parameters: + * mosq - the mosquitto instance making the callback. + * obj - the user data provided in + * level - the log message level from the values: + * MOSQ_LOG_INFO + * MOSQ_LOG_NOTICE + * MOSQ_LOG_WARNING + * MOSQ_LOG_ERR + * MOSQ_LOG_DEBUG + * str - the message string. + */ +libmosq_EXPORT void mosquitto_log_callback_set(struct mosquitto *mosq, void (*on_log)(struct mosquitto *, void *, int, const char *)); + +/* + * Function: mosquitto_reconnect_delay_set + * + * Control the behaviour of the client when it has unexpectedly disconnected in + * or after . The default + * behaviour if this function is not used is to repeatedly attempt to reconnect + * with a delay of 1 second until the connection succeeds. + * + * Use reconnect_delay parameter to change the delay between successive + * reconnection attempts. You may also enable exponential backoff of the time + * between reconnections by setting reconnect_exponential_backoff to true and + * set an upper bound on the delay with reconnect_delay_max. + * + * Example 1: + * delay=2, delay_max=10, exponential_backoff=False + * Delays would be: 2, 4, 6, 8, 10, 10, ... + * + * Example 2: + * delay=3, delay_max=30, exponential_backoff=True + * Delays would be: 3, 6, 12, 24, 30, 30, ... + * + * Parameters: + * mosq - a valid mosquitto instance. + * reconnect_delay - the number of seconds to wait between + * reconnects. + * reconnect_delay_max - the maximum number of seconds to wait + * between reconnects. + * reconnect_exponential_backoff - use exponential backoff between + * reconnect attempts. Set to true to enable + * exponential backoff. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + */ +libmosq_EXPORT int mosquitto_reconnect_delay_set(struct mosquitto *mosq, unsigned int reconnect_delay, unsigned int reconnect_delay_max, bool reconnect_exponential_backoff); + +/* + * Function: mosquitto_max_inflight_messages_set + * + * Set the number of QoS 1 and 2 messages that can be "in flight" at one time. + * An in flight message is part way through its delivery flow. Attempts to send + * further messages with will result in the messages being + * queued until the number of in flight messages reduces. + * + * A higher number here results in greater message throughput, but if set + * higher than the maximum in flight messages on the broker may lead to + * delays in the messages being acknowledged. + * + * Set to 0 for no maximum. + * + * Parameters: + * mosq - a valid mosquitto instance. + * max_inflight_messages - the maximum number of inflight messages. Defaults + * to 20. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success. + * MOSQ_ERR_INVAL - if the input parameters were invalid. + */ +libmosq_EXPORT int mosquitto_max_inflight_messages_set(struct mosquitto *mosq, unsigned int max_inflight_messages); + +/* + * Function: mosquitto_message_retry_set + * + * Set the number of seconds to wait before retrying messages. This applies to + * publish messages with QoS>0. May be called at any time. + * + * Parameters: + * mosq - a valid mosquitto instance. + * message_retry - the number of seconds to wait for a response before + * retrying. Defaults to 20. + */ +libmosq_EXPORT void mosquitto_message_retry_set(struct mosquitto *mosq, unsigned int message_retry); + +/* + * Function: mosquitto_user_data_set + * + * When is called, the pointer given as the "obj" parameter + * will be passed to the callbacks as user data. The + * function allows this obj parameter to be updated at any time. This function + * will not modify the memory pointed to by the current user data pointer. If + * it is dynamically allocated memory you must free it yourself. + * + * Parameters: + * mosq - a valid mosquitto instance. + * obj - A user pointer that will be passed as an argument to any callbacks + * that are specified. + */ +libmosq_EXPORT void mosquitto_user_data_set(struct mosquitto *mosq, void *obj); + +/* ============================================================================= + * + * Section: SOCKS5 proxy functions + * + * ============================================================================= + */ + +/* + * Function: mosquitto_socks5_set + * + * Configure the client to use a SOCKS5 proxy when connecting. Must be called + * before connecting. "None" and "username/password" authentication is + * supported. + * + * Parameters: + * mosq - a valid mosquitto instance. + * host - the SOCKS5 proxy host to connect to. + * port - the SOCKS5 proxy port to use. + * username - if not NULL, use this username when authenticating with the proxy. + * password - if not NULL and username is not NULL, use this password when + * authenticating with the proxy. + */ +libmosq_EXPORT int mosquitto_socks5_set(struct mosquitto *mosq, const char *host, int port, const char *username, const char *password); + +/* ============================================================================= + * + * Section: Utility functions + * + * ============================================================================= + */ + +/* + * Function: mosquitto_strerror + * + * Call to obtain a const string description of a mosquitto error number. + * + * Parameters: + * mosq_errno - a mosquitto error number. + * + * Returns: + * A constant string describing the error. + */ +libmosq_EXPORT const char *mosquitto_strerror(int mosq_errno); + +/* + * Function: mosquitto_connack_string + * + * Call to obtain a const string description of an MQTT connection result. + * + * Parameters: + * connack_code - an MQTT connection result. + * + * Returns: + * A constant string describing the result. + */ +libmosq_EXPORT const char *mosquitto_connack_string(int connack_code); + +/* + * Function: mosquitto_sub_topic_tokenise + * + * Tokenise a topic or subscription string into an array of strings + * representing the topic hierarchy. + * + * For example: + * + * subtopic: "a/deep/topic/hierarchy" + * + * Would result in: + * + * topics[0] = "a" + * topics[1] = "deep" + * topics[2] = "topic" + * topics[3] = "hierarchy" + * + * and: + * + * subtopic: "/a/deep/topic/hierarchy/" + * + * Would result in: + * + * topics[0] = NULL + * topics[1] = "a" + * topics[2] = "deep" + * topics[3] = "topic" + * topics[4] = "hierarchy" + * + * Parameters: + * subtopic - the subscription/topic to tokenise + * topics - a pointer to store the array of strings + * count - an int pointer to store the number of items in the topics array. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success + * MOSQ_ERR_NOMEM - if an out of memory condition occurred. + * + * Example: + * + * > char **topics; + * > int topic_count; + * > int i; + * > + * > mosquitto_sub_topic_tokenise("$SYS/broker/uptime", &topics, &topic_count); + * > + * > for(i=0; i printf("%d: %s\n", i, topics[i]); + * > } + * + * See Also: + * + */ +libmosq_EXPORT int mosquitto_sub_topic_tokenise(const char *subtopic, char ***topics, int *count); + +/* + * Function: mosquitto_sub_topic_tokens_free + * + * Free memory that was allocated in . + * + * Parameters: + * topics - pointer to string array. + * count - count of items in string array. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * + * See Also: + * + */ +libmosq_EXPORT int mosquitto_sub_topic_tokens_free(char ***topics, int count); + +/* + * Function: mosquitto_topic_matches_sub + * + * Check whether a topic matches a subscription. + * + * For example: + * + * foo/bar would match the subscription foo/# or +/bar + * non/matching would not match the subscription non/+/+ + * + * Parameters: + * sub - subscription string to check topic against. + * topic - topic to check. + * result - bool pointer to hold result. Will be set to true if the topic + * matches the subscription. + * + * Returns: + * MOSQ_ERR_SUCCESS - on success + * MOSQ_ERR_INVAL - if the input parameters were invalid. + * MOSQ_ERR_NOMEM - if an out of memory condition occurred. + */ +libmosq_EXPORT int mosquitto_topic_matches_sub(const char *sub, const char *topic, bool *result); + +/* + * Function: mosquitto_pub_topic_check + * + * Check whether a topic to be used for publishing is valid. + * + * This searches for + or # in a topic and checks its length. + * + * This check is already carried out in and + * , there is no need to call it directly before them. It + * may be useful if you wish to check the validity of a topic in advance of + * making a connection for example. + * + * Parameters: + * topic - the topic to check + * + * Returns: + * MOSQ_ERR_SUCCESS - for a valid topic + * MOSQ_ERR_INVAL - if the topic contains a + or a #, or if it is too long. + * + * See Also: + * + */ +libmosq_EXPORT int mosquitto_pub_topic_check(const char *topic); + +/* + * Function: mosquitto_sub_topic_check + * + * Check whether a topic to be used for subscribing is valid. + * + * This searches for + or # in a topic and checks that they aren't in invalid + * positions, such as with foo/#/bar, foo/+bar or foo/bar#, and checks its + * length. + * + * This check is already carried out in and + * , there is no need to call it directly before them. + * It may be useful if you wish to check the validity of a topic in advance of + * making a connection for example. + * + * Parameters: + * topic - the topic to check + * + * Returns: + * MOSQ_ERR_SUCCESS - for a valid topic + * MOSQ_ERR_INVAL - if the topic contains a + or a # that is in an invalid + * position, or if it is too long. + * + * See Also: + * + */ +libmosq_EXPORT int mosquitto_sub_topic_check(const char *topic); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/libs/mosquitto/lib/mosquitto_internal.h b/src/libs/mosquitto/lib/mosquitto_internal.h new file mode 100644 index 0000000..8d3014d --- /dev/null +++ b/src/libs/mosquitto/lib/mosquitto_internal.h @@ -0,0 +1,279 @@ +/* +Copyright (c) 2010-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#ifndef _MOSQUITTO_INTERNAL_H_ +#define _MOSQUITTO_INTERNAL_H_ + +#include + +#ifdef WIN32 +# include +#endif + +#ifdef WITH_TLS +# include +#else +# include +#endif +#include + +#if defined(WITH_THREADING) && !defined(WITH_BROKER) +# include +#else +# include +#endif + +#ifdef WITH_SRV +# include +#endif + +#ifdef WIN32 +# if _MSC_VER < 1600 + typedef unsigned char uint8_t; + typedef unsigned short uint16_t; + typedef unsigned int uint32_t; + typedef unsigned long long uint64_t; +# else +# include +# endif +#else +# include +#endif + +#include "mosquitto.h" +#include "time_mosq.h" +#ifdef WITH_BROKER +# ifdef __linux__ +# include +# endif +# include "uthash.h" +struct mosquitto_client_msg; +#endif + +#ifdef WIN32 +typedef SOCKET mosq_sock_t; +#else +typedef int mosq_sock_t; +#endif + +enum mosquitto_msg_direction { + mosq_md_in = 0, + mosq_md_out = 1 +}; + +enum mosquitto_msg_state { + mosq_ms_invalid = 0, + mosq_ms_publish_qos0 = 1, + mosq_ms_publish_qos1 = 2, + mosq_ms_wait_for_puback = 3, + mosq_ms_publish_qos2 = 4, + mosq_ms_wait_for_pubrec = 5, + mosq_ms_resend_pubrel = 6, + mosq_ms_wait_for_pubrel = 7, + mosq_ms_resend_pubcomp = 8, + mosq_ms_wait_for_pubcomp = 9, + mosq_ms_send_pubrec = 10, + mosq_ms_queued = 11 +}; + +enum mosquitto_client_state { + mosq_cs_new = 0, + mosq_cs_connected = 1, + mosq_cs_disconnecting = 2, + mosq_cs_connect_async = 3, + mosq_cs_connect_pending = 4, + mosq_cs_connect_srv = 5, + mosq_cs_disconnect_ws = 6, + mosq_cs_disconnected = 7, + mosq_cs_socks5_new = 8, + mosq_cs_socks5_start = 9, + mosq_cs_socks5_request = 10, + mosq_cs_socks5_reply = 11, + mosq_cs_socks5_auth_ok = 12, + mosq_cs_socks5_userpass_reply = 13, + mosq_cs_socks5_send_userpass = 14, + mosq_cs_expiring = 15, +}; + +enum _mosquitto_protocol { + mosq_p_invalid = 0, + mosq_p_mqtt31 = 1, + mosq_p_mqtt311 = 2, + mosq_p_mqtts = 3 +}; + +enum mosquitto__threaded_state { + mosq_ts_none, /* No threads in use */ + mosq_ts_self, /* Threads started by libmosquitto */ + mosq_ts_external /* Threads started by external code */ +}; + +enum _mosquitto_transport { + mosq_t_invalid = 0, + mosq_t_tcp = 1, + mosq_t_ws = 2, + mosq_t_sctp = 3 +}; + +struct _mosquitto_packet{ + uint8_t *payload; + struct _mosquitto_packet *next; + uint32_t remaining_mult; + uint32_t remaining_length; + uint32_t packet_length; + uint32_t to_process; + uint32_t pos; + uint16_t mid; + uint8_t command; + int8_t remaining_count; +}; + +struct mosquitto_message_all{ + struct mosquitto_message_all *next; + time_t timestamp; + //enum mosquitto_msg_direction direction; + enum mosquitto_msg_state state; + bool dup; + struct mosquitto_message msg; +}; + +struct mosquitto { + mosq_sock_t sock; +#ifndef WITH_BROKER + mosq_sock_t sockpairR, sockpairW; +#endif +#if defined(__GLIBC__) && defined(WITH_ADNS) + struct gaicb *adns; /* For getaddrinfo_a */ +#endif + enum _mosquitto_protocol protocol; + char *address; + char *id; + char *username; + char *password; + uint16_t keepalive; + uint16_t last_mid; + enum mosquitto_client_state state; + time_t last_msg_in; + time_t next_msg_out; + time_t ping_t; + struct _mosquitto_packet in_packet; + struct _mosquitto_packet *current_out_packet; + struct _mosquitto_packet *out_packet; + struct mosquitto_message *will; +#ifdef WITH_TLS + SSL *ssl; + SSL_CTX *ssl_ctx; + char *tls_cafile; + char *tls_capath; + char *tls_certfile; + char *tls_keyfile; + int (*tls_pw_callback)(char *buf, int size, int rwflag, void *userdata); + char *tls_version; + char *tls_ciphers; + char *tls_psk; + char *tls_psk_identity; + int tls_cert_reqs; + bool tls_insecure; +#endif + bool want_write; + bool want_connect; +#if defined(WITH_THREADING) && !defined(WITH_BROKER) + pthread_mutex_t callback_mutex; + pthread_mutex_t log_callback_mutex; + pthread_mutex_t msgtime_mutex; + pthread_mutex_t out_packet_mutex; + pthread_mutex_t current_out_packet_mutex; + pthread_mutex_t state_mutex; + pthread_mutex_t in_message_mutex; + pthread_mutex_t out_message_mutex; + pthread_mutex_t mid_mutex; + pthread_t thread_id; +#endif + bool clean_session; +#ifdef WITH_BROKER + bool is_dropping; + bool is_bridge; + struct _mqtt3_bridge *bridge; + struct mosquitto_client_msg *msgs; + struct mosquitto_client_msg *last_msg; + int msg_count; + int msg_count12; + struct _mosquitto_acl_user *acl_list; + struct _mqtt3_listener *listener; + time_t disconnect_t; + struct _mosquitto_packet *out_packet_last; + struct _mosquitto_subhier **subs; + int sub_count; + int pollfd_index; +# ifdef WITH_WEBSOCKETS +# if defined(LWS_LIBRARY_VERSION_NUMBER) + struct lws *wsi; +# else + struct libwebsocket_context *ws_context; + struct libwebsocket *wsi; +# endif +# endif + bool ws_want_write; +#else +# ifdef WITH_SOCKS + char *socks5_host; + int socks5_port; + char *socks5_username; + char *socks5_password; +# endif + void *userdata; + bool in_callback; + unsigned int message_retry; + time_t last_retry_check; + struct mosquitto_message_all *in_messages; + struct mosquitto_message_all *in_messages_last; + struct mosquitto_message_all *out_messages; + struct mosquitto_message_all *out_messages_last; + void (*on_connect)(struct mosquitto *, void *userdata, int rc); + void (*on_disconnect)(struct mosquitto *, void *userdata, int rc); + void (*on_publish)(struct mosquitto *, void *userdata, int mid); + void (*on_message)(struct mosquitto *, void *userdata, const struct mosquitto_message *message); + void (*on_subscribe)(struct mosquitto *, void *userdata, int mid, int qos_count, const int *granted_qos); + void (*on_unsubscribe)(struct mosquitto *, void *userdata, int mid); + void (*on_log)(struct mosquitto *, void *userdata, int level, const char *str); + //void (*on_error)(); + char *host; + int port; + int in_queue_len; + int out_queue_len; + char *bind_address; + unsigned int reconnect_delay; + unsigned int reconnect_delay_max; + bool reconnect_exponential_backoff; + char threaded; + struct _mosquitto_packet *out_packet_last; + int inflight_messages; + int max_inflight_messages; +# ifdef WITH_SRV + ares_channel achan; +# endif +#endif + +#ifdef WITH_BROKER + UT_hash_handle hh_id; + UT_hash_handle hh_sock; + struct mosquitto *for_free_next; +#endif +}; + +#define STREMPTY(str) (str[0] == '\0') + +#endif diff --git a/src/libs/mosquitto/lib/mqtt3_protocol.h b/src/libs/mosquitto/lib/mqtt3_protocol.h new file mode 100644 index 0000000..0e8ac8d --- /dev/null +++ b/src/libs/mosquitto/lib/mqtt3_protocol.h @@ -0,0 +1,53 @@ +/* +Copyright (c) 2009-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#ifndef _MQTT3_PROTOCOL_H_ +#define _MQTT3_PROTOCOL_H_ + +/* For version 3 of the MQTT protocol */ + +#define PROTOCOL_NAME_v31 "MQIsdp" +#define PROTOCOL_VERSION_v31 3 + +#define PROTOCOL_NAME_v311 "MQTT" +#define PROTOCOL_VERSION_v311 4 + +/* Message types */ +#define CONNECT 0x10 +#define CONNACK 0x20 +#define PUBLISH 0x30 +#define PUBACK 0x40 +#define PUBREC 0x50 +#define PUBREL 0x60 +#define PUBCOMP 0x70 +#define SUBSCRIBE 0x80 +#define SUBACK 0x90 +#define UNSUBSCRIBE 0xA0 +#define UNSUBACK 0xB0 +#define PINGREQ 0xC0 +#define PINGRESP 0xD0 +#define DISCONNECT 0xE0 + +#define CONNACK_ACCEPTED 0 +#define CONNACK_REFUSED_PROTOCOL_VERSION 1 +#define CONNACK_REFUSED_IDENTIFIER_REJECTED 2 +#define CONNACK_REFUSED_SERVER_UNAVAILABLE 3 +#define CONNACK_REFUSED_BAD_USERNAME_PASSWORD 4 +#define CONNACK_REFUSED_NOT_AUTHORIZED 5 + +#define MQTT_MAX_PAYLOAD 268435455 + +#endif diff --git a/src/libs/mosquitto/lib/net_mosq.c b/src/libs/mosquitto/lib/net_mosq.c new file mode 100644 index 0000000..063c4a2 --- /dev/null +++ b/src/libs/mosquitto/lib/net_mosq.c @@ -0,0 +1,1307 @@ +/* +Copyright (c) 2009-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#define _GNU_SOURCE + +#include +#include +#include +#include +#include +#ifndef WIN32 +#define _GNU_SOURCE +#include +#include +#include +#else +#include +#include +#endif + +#ifdef __ANDROID__ +#include +#include +#include +#endif + +#ifdef __FreeBSD__ +# include +#endif + +#ifdef __SYMBIAN32__ +#include +#endif + +#ifdef __QNX__ +#ifndef AI_ADDRCONFIG +#define AI_ADDRCONFIG 0 +#endif +#include +#include +#endif + +#ifdef WITH_TLS +#include +#include +#include +#include +#endif + +#ifdef WITH_BROKER +# include +# ifdef WITH_SYS_TREE + extern uint64_t g_bytes_received; + extern uint64_t g_bytes_sent; + extern unsigned long g_msgs_received; + extern unsigned long g_msgs_sent; + extern unsigned long g_pub_msgs_received; + extern unsigned long g_pub_msgs_sent; +# endif +# ifdef WITH_WEBSOCKETS +# include +# endif +#else +# include +#endif + +#include +#include +#include +#include +#include +#include + +#include "config.h" + +#ifdef WITH_TLS +int tls_ex_index_mosq = -1; +#endif + +void _mosquitto_net_init(void) +{ +#ifdef WIN32 + WSADATA wsaData; + WSAStartup(MAKEWORD(2,2), &wsaData); +#endif + +#ifdef WITH_SRV + ares_library_init(ARES_LIB_INIT_ALL); +#endif + +#ifdef WITH_TLS + SSL_load_error_strings(); + SSL_library_init(); + OpenSSL_add_all_algorithms(); + if(tls_ex_index_mosq == -1){ + tls_ex_index_mosq = SSL_get_ex_new_index(0, "client context", NULL, NULL, NULL); + } +#endif +} + +void _mosquitto_net_cleanup(void) +{ +#ifdef WITH_TLS + #if OPENSSL_VERSION_NUMBER < 0x10100000L + ERR_remove_state(0); + #endif + ENGINE_cleanup(); + CONF_modules_unload(1); + ERR_free_strings(); + EVP_cleanup(); + CRYPTO_cleanup_all_ex_data(); +#endif + +#ifdef WITH_SRV + ares_library_cleanup(); +#endif + +#ifdef WIN32 + WSACleanup(); +#endif +} + +void _mosquitto_packet_cleanup(struct _mosquitto_packet *packet) +{ + if(!packet) return; + + /* Free data and reset values */ + packet->command = 0; + packet->remaining_count = 0; + packet->remaining_mult = 1; + packet->remaining_length = 0; + if(packet->payload) _mosquitto_free(packet->payload); + packet->payload = NULL; + packet->to_process = 0; + packet->pos = 0; +} + +int _mosquitto_packet_queue(struct mosquitto *mosq, struct _mosquitto_packet *packet) +{ +#ifndef WITH_BROKER + char sockpair_data = 0; +#endif + assert(mosq); + assert(packet); + + packet->pos = 0; + packet->to_process = packet->packet_length; + + packet->next = NULL; + pthread_mutex_lock(&mosq->out_packet_mutex); + if(mosq->out_packet){ + mosq->out_packet_last->next = packet; + }else{ + mosq->out_packet = packet; + } + mosq->out_packet_last = packet; + pthread_mutex_unlock(&mosq->out_packet_mutex); +#ifdef WITH_BROKER +# ifdef WITH_WEBSOCKETS + if(mosq->wsi){ + libwebsocket_callback_on_writable(mosq->ws_context, mosq->wsi); + return 0; + }else{ + return _mosquitto_packet_write(mosq); + } +# else + return _mosquitto_packet_write(mosq); +# endif +#else + + /* Write a single byte to sockpairW (connected to sockpairR) to break out + * of select() if in threaded mode. */ + if(mosq->sockpairW != INVALID_SOCKET){ +#ifndef WIN32 + if(write(mosq->sockpairW, &sockpair_data, 1)){ + } +#else + send(mosq->sockpairW, &sockpair_data, 1, 0); +#endif + } + + if(mosq->in_callback == false && mosq->threaded == mosq_ts_none){ + return _mosquitto_packet_write(mosq); + }else{ + return MOSQ_ERR_SUCCESS; + } +#endif +} + +/* Close a socket associated with a context and set it to -1. + * Returns 1 on failure (context is NULL) + * Returns 0 on success. + */ +#ifdef WITH_BROKER +int _mosquitto_socket_close(struct mosquitto_db *db, struct mosquitto *mosq) +#else +int _mosquitto_socket_close(struct mosquitto *mosq) +#endif +{ + int rc = 0; + + assert(mosq); +#ifdef WITH_TLS + if(mosq->ssl){ + SSL_shutdown(mosq->ssl); + SSL_free(mosq->ssl); + mosq->ssl = NULL; + } + if(mosq->ssl_ctx){ + SSL_CTX_free(mosq->ssl_ctx); + mosq->ssl_ctx = NULL; + } +#endif + + if((int)mosq->sock >= 0){ +#ifdef WITH_BROKER + HASH_DELETE(hh_sock, db->contexts_by_sock, mosq); +#endif + rc = COMPAT_CLOSE(mosq->sock); + mosq->sock = INVALID_SOCKET; +#ifdef WITH_WEBSOCKETS + }else if(mosq->sock == WEBSOCKET_CLIENT){ + if(mosq->state != mosq_cs_disconnecting){ + mosq->state = mosq_cs_disconnect_ws; + } + if(mosq->wsi){ + libwebsocket_callback_on_writable(mosq->ws_context, mosq->wsi); + } + mosq->sock = INVALID_SOCKET; +#endif + } + +#ifdef WITH_BROKER + if(mosq->listener){ + mosq->listener->client_count--; + assert(mosq->listener->client_count >= 0); + mosq->listener = NULL; + } +#endif + + return rc; +} + +#ifdef REAL_WITH_TLS_PSK +static unsigned int psk_client_callback(SSL *ssl, const char *hint, + char *identity, unsigned int max_identity_len, + unsigned char *psk, unsigned int max_psk_len) +{ + struct mosquitto *mosq; + int len; + + mosq = SSL_get_ex_data(ssl, tls_ex_index_mosq); + if(!mosq) return 0; + + snprintf(identity, max_identity_len, "%s", mosq->tls_psk_identity); + + len = _mosquitto_hex2bin(mosq->tls_psk, psk, max_psk_len); + if (len < 0) return 0; + return len; +} +#endif + +#if defined(WITH_BROKER) && defined(__GLIBC__) && defined(WITH_ADNS) +/* Async connect, part 1 (dns lookup) */ +int _mosquitto_try_connect_step1(struct mosquitto *mosq, const char *host) +{ + int s; + void *sevp = NULL; + + if(mosq->adns){ + _mosquitto_free(mosq->adns); + } + mosq->adns = _mosquitto_calloc(1, sizeof(struct gaicb)); + if(!mosq->adns){ + return MOSQ_ERR_NOMEM; + } + mosq->adns->ar_name = host; + + s = getaddrinfo_a(GAI_NOWAIT, &mosq->adns, 1, sevp); + if(s){ + errno = s; + _mosquitto_free(mosq->adns); + mosq->adns = NULL; + return MOSQ_ERR_EAI; + } + + return MOSQ_ERR_SUCCESS; +} + +/* Async connect part 2, the connection. */ +int _mosquitto_try_connect_step2(struct mosquitto *mosq, uint16_t port, mosq_sock_t *sock) +{ + struct addrinfo *ainfo, *rp; + int rc; + + ainfo = mosq->adns->ar_result; + + for(rp = ainfo; rp != NULL; rp = rp->ai_next){ + *sock = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol); + if(*sock == INVALID_SOCKET) continue; + + if(rp->ai_family == PF_INET){ + ((struct sockaddr_in *)rp->ai_addr)->sin_port = htons(port); + }else if(rp->ai_family == PF_INET6){ + ((struct sockaddr_in6 *)rp->ai_addr)->sin6_port = htons(port); + }else{ + COMPAT_CLOSE(*sock); + continue; + } + + /* Set non-blocking */ + if(_mosquitto_socket_nonblock(*sock)){ + COMPAT_CLOSE(*sock); + continue; + } + + rc = connect(*sock, rp->ai_addr, rp->ai_addrlen); +#ifdef WIN32 + errno = WSAGetLastError(); +#endif + if(rc == 0 || errno == EINPROGRESS || errno == COMPAT_EWOULDBLOCK){ + if(rc < 0 && (errno == EINPROGRESS || errno == COMPAT_EWOULDBLOCK)){ + rc = MOSQ_ERR_CONN_PENDING; + } + + /* Set non-blocking */ + if(_mosquitto_socket_nonblock(*sock)){ + COMPAT_CLOSE(*sock); + continue; + } + break; + } + + COMPAT_CLOSE(*sock); + *sock = INVALID_SOCKET; + } + freeaddrinfo(mosq->adns->ar_result); + mosq->adns->ar_result = NULL; + + _mosquitto_free(mosq->adns); + mosq->adns = NULL; + + if(!rp){ + return MOSQ_ERR_ERRNO; + } + + return rc; +} + +#endif + + +int _mosquitto_try_connect(struct mosquitto *mosq, const char *host, uint16_t port, mosq_sock_t *sock, const char *bind_address, bool blocking) +{ + struct addrinfo hints; + struct addrinfo *ainfo, *rp; + struct addrinfo *ainfo_bind, *rp_bind; + int s; + int rc = MOSQ_ERR_SUCCESS; +#ifdef WIN32 + uint32_t val = 1; +#endif + + *sock = INVALID_SOCKET; + memset(&hints, 0, sizeof(struct addrinfo)); + hints.ai_family = PF_UNSPEC; + hints.ai_flags = AI_ADDRCONFIG; + hints.ai_socktype = SOCK_STREAM; + + s = getaddrinfo(host, NULL, &hints, &ainfo); + if(s){ + errno = s; + return MOSQ_ERR_EAI; + } + + if(bind_address){ + s = getaddrinfo(bind_address, NULL, &hints, &ainfo_bind); + if(s){ + freeaddrinfo(ainfo); + errno = s; + return MOSQ_ERR_EAI; + } + } + + for(rp = ainfo; rp != NULL; rp = rp->ai_next){ + *sock = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol); + if(*sock == INVALID_SOCKET) continue; + + if(rp->ai_family == PF_INET){ + ((struct sockaddr_in *)rp->ai_addr)->sin_port = htons(port); + }else if(rp->ai_family == PF_INET6){ + ((struct sockaddr_in6 *)rp->ai_addr)->sin6_port = htons(port); + }else{ + COMPAT_CLOSE(*sock); + continue; + } + + if(bind_address){ + for(rp_bind = ainfo_bind; rp_bind != NULL; rp_bind = rp_bind->ai_next){ + if(bind(*sock, rp_bind->ai_addr, rp_bind->ai_addrlen) == 0){ + break; + } + } + if(!rp_bind){ + COMPAT_CLOSE(*sock); + continue; + } + } + + if(!blocking){ + /* Set non-blocking */ + if(_mosquitto_socket_nonblock(*sock)){ + COMPAT_CLOSE(*sock); + continue; + } + } + + rc = connect(*sock, rp->ai_addr, rp->ai_addrlen); +#ifdef WIN32 + errno = WSAGetLastError(); +#endif + if(rc == 0 || errno == EINPROGRESS || errno == COMPAT_EWOULDBLOCK){ + if(rc < 0 && (errno == EINPROGRESS || errno == COMPAT_EWOULDBLOCK)){ + rc = MOSQ_ERR_CONN_PENDING; + } + + if(blocking){ + /* Set non-blocking */ + if(_mosquitto_socket_nonblock(*sock)){ + COMPAT_CLOSE(*sock); + continue; + } + } + break; + } + + COMPAT_CLOSE(*sock); + *sock = INVALID_SOCKET; + } + freeaddrinfo(ainfo); + if(bind_address){ + freeaddrinfo(ainfo_bind); + } + if(!rp){ + return MOSQ_ERR_ERRNO; + } + return rc; +} + +#ifdef WITH_TLS +int mosquitto__socket_connect_tls(struct mosquitto *mosq) +{ + int ret, err; + ERR_clear_error(); + ret = SSL_connect(mosq->ssl); + if(ret != 1) { + err = SSL_get_error(mosq->ssl, ret); +#ifdef WIN32 + if (err == SSL_ERROR_SYSCALL) { + mosq->want_connect = true; + return MOSQ_ERR_SUCCESS; + } +#endif + if(err == SSL_ERROR_WANT_READ){ + mosq->want_connect = true; + /* We always try to read anyway */ + }else if(err == SSL_ERROR_WANT_WRITE){ + mosq->want_write = true; + mosq->want_connect = true; + }else{ + COMPAT_CLOSE(mosq->sock); + mosq->sock = INVALID_SOCKET; + return MOSQ_ERR_TLS; + } + }else{ + mosq->want_connect = false; + } + return MOSQ_ERR_SUCCESS; +} +#endif + +int _mosquitto_socket_connect_step3(struct mosquitto *mosq, const char *host, uint16_t port, const char *bind_address, bool blocking) +{ +#ifdef WITH_TLS + int ret; + BIO *bio; +#endif + +#ifdef WITH_TLS + if(mosq->tls_cafile || mosq->tls_capath || mosq->tls_psk){ +#if OPENSSL_VERSION_NUMBER >= 0x10001000L + if(!mosq->tls_version || !strcmp(mosq->tls_version, "tlsv1.2")){ + mosq->ssl_ctx = SSL_CTX_new(TLSv1_2_client_method()); + }else if(!strcmp(mosq->tls_version, "tlsv1.1")){ + mosq->ssl_ctx = SSL_CTX_new(TLSv1_1_client_method()); + }else if(!strcmp(mosq->tls_version, "tlsv1")){ + mosq->ssl_ctx = SSL_CTX_new(TLSv1_client_method()); + }else{ + _mosquitto_log_printf(mosq, MOSQ_LOG_ERR, "Error: Protocol %s not supported.", mosq->tls_version); + COMPAT_CLOSE(mosq->sock); + return MOSQ_ERR_INVAL; + } +#else + if(!mosq->tls_version || !strcmp(mosq->tls_version, "tlsv1")){ + mosq->ssl_ctx = SSL_CTX_new(TLSv1_client_method()); + }else{ + _mosquitto_log_printf(mosq, MOSQ_LOG_ERR, "Error: Protocol %s not supported.", mosq->tls_version); + COMPAT_CLOSE(mosq->sock); + return MOSQ_ERR_INVAL; + } +#endif + if(!mosq->ssl_ctx){ + _mosquitto_log_printf(mosq, MOSQ_LOG_ERR, "Error: Unable to create TLS context."); + COMPAT_CLOSE(mosq->sock); + return MOSQ_ERR_TLS; + } + +#if OPENSSL_VERSION_NUMBER >= 0x10000000 + /* Disable compression */ + SSL_CTX_set_options(mosq->ssl_ctx, SSL_OP_NO_COMPRESSION); +#endif +#ifdef SSL_MODE_RELEASE_BUFFERS + /* Use even less memory per SSL connection. */ + SSL_CTX_set_mode(mosq->ssl_ctx, SSL_MODE_RELEASE_BUFFERS); +#endif + + if(mosq->tls_ciphers){ + ret = SSL_CTX_set_cipher_list(mosq->ssl_ctx, mosq->tls_ciphers); + if(ret == 0){ + _mosquitto_log_printf(mosq, MOSQ_LOG_ERR, "Error: Unable to set TLS ciphers. Check cipher list \"%s\".", mosq->tls_ciphers); + COMPAT_CLOSE(mosq->sock); + return MOSQ_ERR_TLS; + } + } + if(mosq->tls_cafile || mosq->tls_capath){ + ret = SSL_CTX_load_verify_locations(mosq->ssl_ctx, mosq->tls_cafile, mosq->tls_capath); + if(ret == 0){ +#ifdef WITH_BROKER + if(mosq->tls_cafile && mosq->tls_capath){ + _mosquitto_log_printf(mosq, MOSQ_LOG_ERR, "Error: Unable to load CA certificates, check bridge_cafile \"%s\" and bridge_capath \"%s\".", mosq->tls_cafile, mosq->tls_capath); + }else if(mosq->tls_cafile){ + _mosquitto_log_printf(mosq, MOSQ_LOG_ERR, "Error: Unable to load CA certificates, check bridge_cafile \"%s\".", mosq->tls_cafile); + }else{ + _mosquitto_log_printf(mosq, MOSQ_LOG_ERR, "Error: Unable to load CA certificates, check bridge_capath \"%s\".", mosq->tls_capath); + } +#else + if(mosq->tls_cafile && mosq->tls_capath){ + _mosquitto_log_printf(mosq, MOSQ_LOG_ERR, "Error: Unable to load CA certificates, check cafile \"%s\" and capath \"%s\".", mosq->tls_cafile, mosq->tls_capath); + }else if(mosq->tls_cafile){ + _mosquitto_log_printf(mosq, MOSQ_LOG_ERR, "Error: Unable to load CA certificates, check cafile \"%s\".", mosq->tls_cafile); + }else{ + _mosquitto_log_printf(mosq, MOSQ_LOG_ERR, "Error: Unable to load CA certificates, check capath \"%s\".", mosq->tls_capath); + } +#endif + COMPAT_CLOSE(mosq->sock); + return MOSQ_ERR_TLS; + } + if(mosq->tls_cert_reqs == 0){ + SSL_CTX_set_verify(mosq->ssl_ctx, SSL_VERIFY_NONE, NULL); + }else{ + SSL_CTX_set_verify(mosq->ssl_ctx, SSL_VERIFY_PEER, _mosquitto_server_certificate_verify); + } + + if(mosq->tls_pw_callback){ + SSL_CTX_set_default_passwd_cb(mosq->ssl_ctx, mosq->tls_pw_callback); + SSL_CTX_set_default_passwd_cb_userdata(mosq->ssl_ctx, mosq); + } + + if(mosq->tls_certfile){ + ret = SSL_CTX_use_certificate_chain_file(mosq->ssl_ctx, mosq->tls_certfile); + if(ret != 1){ +#ifdef WITH_BROKER + _mosquitto_log_printf(mosq, MOSQ_LOG_ERR, "Error: Unable to load client certificate, check bridge_certfile \"%s\".", mosq->tls_certfile); +#else + _mosquitto_log_printf(mosq, MOSQ_LOG_ERR, "Error: Unable to load client certificate \"%s\".", mosq->tls_certfile); +#endif + COMPAT_CLOSE(mosq->sock); + return MOSQ_ERR_TLS; + } + } + if(mosq->tls_keyfile){ + ret = SSL_CTX_use_PrivateKey_file(mosq->ssl_ctx, mosq->tls_keyfile, SSL_FILETYPE_PEM); + if(ret != 1){ +#ifdef WITH_BROKER + _mosquitto_log_printf(mosq, MOSQ_LOG_ERR, "Error: Unable to load client key file, check bridge_keyfile \"%s\".", mosq->tls_keyfile); +#else + _mosquitto_log_printf(mosq, MOSQ_LOG_ERR, "Error: Unable to load client key file \"%s\".", mosq->tls_keyfile); +#endif + COMPAT_CLOSE(mosq->sock); + return MOSQ_ERR_TLS; + } + ret = SSL_CTX_check_private_key(mosq->ssl_ctx); + if(ret != 1){ + _mosquitto_log_printf(mosq, MOSQ_LOG_ERR, "Error: Client certificate/key are inconsistent."); + COMPAT_CLOSE(mosq->sock); + return MOSQ_ERR_TLS; + } + } +#ifdef REAL_WITH_TLS_PSK + }else if(mosq->tls_psk){ + SSL_CTX_set_psk_client_callback(mosq->ssl_ctx, psk_client_callback); +#endif + } + + mosq->ssl = SSL_new(mosq->ssl_ctx); + if(!mosq->ssl){ + COMPAT_CLOSE(mosq->sock); + return MOSQ_ERR_TLS; + } + + SSL_set_ex_data(mosq->ssl, tls_ex_index_mosq, mosq); + bio = BIO_new_socket(mosq->sock, BIO_NOCLOSE); + if(!bio){ + COMPAT_CLOSE(mosq->sock); + return MOSQ_ERR_TLS; + } + SSL_set_bio(mosq->ssl, bio, bio); + + if(mosquitto__socket_connect_tls(mosq)){ + return MOSQ_ERR_TLS; + } + + } +#endif + return MOSQ_ERR_SUCCESS; +} + +/* Create a socket and connect it to 'ip' on port 'port'. + * Returns -1 on failure (ip is NULL, socket creation/connection error) + * Returns sock number on success. + */ +int _mosquitto_socket_connect(struct mosquitto *mosq, const char *host, uint16_t port, const char *bind_address, bool blocking) +{ + mosq_sock_t sock = INVALID_SOCKET; + int rc; + + if(!mosq || !host || !port) return MOSQ_ERR_INVAL; + + rc = _mosquitto_try_connect(mosq, host, port, &sock, bind_address, blocking); + if(rc > 0) return rc; + + mosq->sock = sock; + rc = _mosquitto_socket_connect_step3(mosq, host, port, bind_address, blocking); + + return rc; +} + +int _mosquitto_read_byte(struct _mosquitto_packet *packet, uint8_t *byte) +{ + assert(packet); + if(packet->pos+1 > packet->remaining_length) return MOSQ_ERR_PROTOCOL; + + *byte = packet->payload[packet->pos]; + packet->pos++; + + return MOSQ_ERR_SUCCESS; +} + +void _mosquitto_write_byte(struct _mosquitto_packet *packet, uint8_t byte) +{ + assert(packet); + assert(packet->pos+1 <= packet->packet_length); + + packet->payload[packet->pos] = byte; + packet->pos++; +} + +int _mosquitto_read_bytes(struct _mosquitto_packet *packet, void *bytes, uint32_t count) +{ + assert(packet); + if(packet->pos+count > packet->remaining_length) return MOSQ_ERR_PROTOCOL; + + memcpy(bytes, &(packet->payload[packet->pos]), count); + packet->pos += count; + + return MOSQ_ERR_SUCCESS; +} + +void _mosquitto_write_bytes(struct _mosquitto_packet *packet, const void *bytes, uint32_t count) +{ + assert(packet); + assert(packet->pos+count <= packet->packet_length); + + memcpy(&(packet->payload[packet->pos]), bytes, count); + packet->pos += count; +} + +int _mosquitto_read_string(struct _mosquitto_packet *packet, char **str) +{ + uint16_t len; + int rc; + + assert(packet); + rc = _mosquitto_read_uint16(packet, &len); + if(rc) return rc; + + if(packet->pos+len > packet->remaining_length) return MOSQ_ERR_PROTOCOL; + + *str = _mosquitto_malloc(len+1); + if(*str){ + memcpy(*str, &(packet->payload[packet->pos]), len); + (*str)[len] = '\0'; + packet->pos += len; + }else{ + return MOSQ_ERR_NOMEM; + } + + return MOSQ_ERR_SUCCESS; +} + +void _mosquitto_write_string(struct _mosquitto_packet *packet, const char *str, uint16_t length) +{ + assert(packet); + _mosquitto_write_uint16(packet, length); + _mosquitto_write_bytes(packet, str, length); +} + +int _mosquitto_read_uint16(struct _mosquitto_packet *packet, uint16_t *word) +{ + uint8_t msb, lsb; + + assert(packet); + if(packet->pos+2 > packet->remaining_length) return MOSQ_ERR_PROTOCOL; + + msb = packet->payload[packet->pos]; + packet->pos++; + lsb = packet->payload[packet->pos]; + packet->pos++; + + *word = (msb<<8) + lsb; + + return MOSQ_ERR_SUCCESS; +} + +void _mosquitto_write_uint16(struct _mosquitto_packet *packet, uint16_t word) +{ + _mosquitto_write_byte(packet, MOSQ_MSB(word)); + _mosquitto_write_byte(packet, MOSQ_LSB(word)); +} + +ssize_t _mosquitto_net_read(struct mosquitto *mosq, void *buf, size_t count) +{ +#ifdef WITH_TLS + int ret; + int err; + char ebuf[256]; + unsigned long e; +#endif + assert(mosq); + errno = 0; +#ifdef WITH_TLS + if(mosq->ssl){ + ERR_clear_error(); + ret = SSL_read(mosq->ssl, buf, count); + if(ret <= 0){ + err = SSL_get_error(mosq->ssl, ret); + if(err == SSL_ERROR_WANT_READ){ + ret = -1; + errno = EAGAIN; + }else if(err == SSL_ERROR_WANT_WRITE){ + ret = -1; + mosq->want_write = true; + errno = EAGAIN; + }else{ + e = ERR_get_error(); + while(e){ + _mosquitto_log_printf(mosq, MOSQ_LOG_ERR, "OpenSSL Error: %s", ERR_error_string(e, ebuf)); + e = ERR_get_error(); + } + errno = EPROTO; + } + } + return (ssize_t )ret; + }else{ + /* Call normal read/recv */ + +#endif + +#ifndef WIN32 + return read(mosq->sock, buf, count); +#else + return recv(mosq->sock, buf, count, 0); +#endif + +#ifdef WITH_TLS + } +#endif +} + +ssize_t _mosquitto_net_write(struct mosquitto *mosq, void *buf, size_t count) +{ +#ifdef WITH_TLS + int ret; + int err; + char ebuf[256]; + unsigned long e; +#endif + assert(mosq); + + errno = 0; +#ifdef WITH_TLS + if(mosq->ssl){ + mosq->want_write = false; + ERR_clear_error(); + ret = SSL_write(mosq->ssl, buf, count); + if(ret < 0){ + err = SSL_get_error(mosq->ssl, ret); + if(err == SSL_ERROR_WANT_READ){ + ret = -1; + errno = EAGAIN; + }else if(err == SSL_ERROR_WANT_WRITE){ + ret = -1; + mosq->want_write = true; + errno = EAGAIN; + }else{ + e = ERR_get_error(); + while(e){ + _mosquitto_log_printf(mosq, MOSQ_LOG_ERR, "OpenSSL Error: %s", ERR_error_string(e, ebuf)); + e = ERR_get_error(); + } + errno = EPROTO; + } + } + return (ssize_t )ret; + }else{ + /* Call normal write/send */ +#endif + +#ifndef WIN32 + return write(mosq->sock, buf, count); +#else + return send(mosq->sock, buf, count, 0); +#endif + +#ifdef WITH_TLS + } +#endif +} + +int _mosquitto_packet_write(struct mosquitto *mosq) +{ + ssize_t write_length; + struct _mosquitto_packet *packet; + + if(!mosq) return MOSQ_ERR_INVAL; + if(mosq->sock == INVALID_SOCKET) return MOSQ_ERR_NO_CONN; + + pthread_mutex_lock(&mosq->current_out_packet_mutex); + pthread_mutex_lock(&mosq->out_packet_mutex); + if(mosq->out_packet && !mosq->current_out_packet){ + mosq->current_out_packet = mosq->out_packet; + mosq->out_packet = mosq->out_packet->next; + if(!mosq->out_packet){ + mosq->out_packet_last = NULL; + } + } + pthread_mutex_unlock(&mosq->out_packet_mutex); + + if(mosq->state == mosq_cs_connect_pending){ + pthread_mutex_unlock(&mosq->current_out_packet_mutex); + return MOSQ_ERR_SUCCESS; + } + + while(mosq->current_out_packet){ + packet = mosq->current_out_packet; + + while(packet->to_process > 0){ + write_length = _mosquitto_net_write(mosq, &(packet->payload[packet->pos]), packet->to_process); + if(write_length > 0){ +#if defined(WITH_BROKER) && defined(WITH_SYS_TREE) + g_bytes_sent += write_length; +#endif + packet->to_process -= write_length; + packet->pos += write_length; + }else{ +#ifdef WIN32 + errno = WSAGetLastError(); +#endif + if(errno == EAGAIN || errno == COMPAT_EWOULDBLOCK){ + pthread_mutex_unlock(&mosq->current_out_packet_mutex); + return MOSQ_ERR_SUCCESS; + }else{ + pthread_mutex_unlock(&mosq->current_out_packet_mutex); + switch(errno){ + case COMPAT_ECONNRESET: + return MOSQ_ERR_CONN_LOST; + default: + return MOSQ_ERR_ERRNO; + } + } + } + } + +#ifdef WITH_BROKER +# ifdef WITH_SYS_TREE + g_msgs_sent++; + if(((packet->command)&0xF6) == PUBLISH){ + g_pub_msgs_sent++; + } +# endif +#else + if(((packet->command)&0xF6) == PUBLISH){ + pthread_mutex_lock(&mosq->callback_mutex); + if(mosq->on_publish){ + /* This is a QoS=0 message */ + mosq->in_callback = true; + mosq->on_publish(mosq, mosq->userdata, packet->mid); + mosq->in_callback = false; + } + pthread_mutex_unlock(&mosq->callback_mutex); + }else if(((packet->command)&0xF0) == DISCONNECT){ + /* FIXME what cleanup needs doing here? + * incoming/outgoing messages? */ + _mosquitto_socket_close(mosq); + + /* Start of duplicate, possibly unnecessary code. + * This does leave things in a consistent state at least. */ + /* Free data and reset values */ + pthread_mutex_lock(&mosq->out_packet_mutex); + mosq->current_out_packet = mosq->out_packet; + if(mosq->out_packet){ + mosq->out_packet = mosq->out_packet->next; + if(!mosq->out_packet){ + mosq->out_packet_last = NULL; + } + } + pthread_mutex_unlock(&mosq->out_packet_mutex); + + _mosquitto_packet_cleanup(packet); + _mosquitto_free(packet); + + pthread_mutex_lock(&mosq->msgtime_mutex); + mosq->next_msg_out = mosquitto_time() + mosq->keepalive; + pthread_mutex_unlock(&mosq->msgtime_mutex); + /* End of duplicate, possibly unnecessary code */ + + pthread_mutex_lock(&mosq->callback_mutex); + if(mosq->on_disconnect){ + mosq->in_callback = true; + mosq->on_disconnect(mosq, mosq->userdata, 0); + mosq->in_callback = false; + } + pthread_mutex_unlock(&mosq->callback_mutex); + pthread_mutex_unlock(&mosq->current_out_packet_mutex); + return MOSQ_ERR_SUCCESS; + } +#endif + + /* Free data and reset values */ + pthread_mutex_lock(&mosq->out_packet_mutex); + mosq->current_out_packet = mosq->out_packet; + if(mosq->out_packet){ + mosq->out_packet = mosq->out_packet->next; + if(!mosq->out_packet){ + mosq->out_packet_last = NULL; + } + } + pthread_mutex_unlock(&mosq->out_packet_mutex); + + _mosquitto_packet_cleanup(packet); + _mosquitto_free(packet); + + pthread_mutex_lock(&mosq->msgtime_mutex); + mosq->next_msg_out = mosquitto_time() + mosq->keepalive; + pthread_mutex_unlock(&mosq->msgtime_mutex); + } + pthread_mutex_unlock(&mosq->current_out_packet_mutex); + return MOSQ_ERR_SUCCESS; +} + +#ifdef WITH_BROKER +int _mosquitto_packet_read(struct mosquitto_db *db, struct mosquitto *mosq) +#else +int _mosquitto_packet_read(struct mosquitto *mosq) +#endif +{ + uint8_t byte; + ssize_t read_length; + int rc = 0; + + if(!mosq) return MOSQ_ERR_INVAL; + if(mosq->sock == INVALID_SOCKET) return MOSQ_ERR_NO_CONN; + if(mosq->state == mosq_cs_connect_pending){ + return MOSQ_ERR_SUCCESS; + } + + /* This gets called if pselect() indicates that there is network data + * available - ie. at least one byte. What we do depends on what data we + * already have. + * If we've not got a command, attempt to read one and save it. This should + * always work because it's only a single byte. + * Then try to read the remaining length. This may fail because it is may + * be more than one byte - will need to save data pending next read if it + * does fail. + * Then try to read the remaining payload, where 'payload' here means the + * combined variable header and actual payload. This is the most likely to + * fail due to longer length, so save current data and current position. + * After all data is read, send to _mosquitto_handle_packet() to deal with. + * Finally, free the memory and reset everything to starting conditions. + */ + if(!mosq->in_packet.command){ + read_length = _mosquitto_net_read(mosq, &byte, 1); + if(read_length == 1){ + mosq->in_packet.command = byte; +#ifdef WITH_BROKER +# ifdef WITH_SYS_TREE + g_bytes_received++; +# endif + /* Clients must send CONNECT as their first command. */ + if(!(mosq->bridge) && mosq->state == mosq_cs_new && (byte&0xF0) != CONNECT) return MOSQ_ERR_PROTOCOL; +#endif + }else{ + if(read_length == 0) return MOSQ_ERR_CONN_LOST; /* EOF */ +#ifdef WIN32 + errno = WSAGetLastError(); +#endif + if(errno == EAGAIN || errno == COMPAT_EWOULDBLOCK){ + return MOSQ_ERR_SUCCESS; + }else{ + switch(errno){ + case COMPAT_ECONNRESET: + return MOSQ_ERR_CONN_LOST; + default: + return MOSQ_ERR_ERRNO; + } + } + } + } + /* remaining_count is the number of bytes that the remaining_length + * parameter occupied in this incoming packet. We don't use it here as such + * (it is used when allocating an outgoing packet), but we must be able to + * determine whether all of the remaining_length parameter has been read. + * remaining_count has three states here: + * 0 means that we haven't read any remaining_length bytes + * <0 means we have read some remaining_length bytes but haven't finished + * >0 means we have finished reading the remaining_length bytes. + */ + if(mosq->in_packet.remaining_count <= 0){ + do{ + read_length = _mosquitto_net_read(mosq, &byte, 1); + if(read_length == 1){ + mosq->in_packet.remaining_count--; + /* Max 4 bytes length for remaining length as defined by protocol. + * Anything more likely means a broken/malicious client. + */ + if(mosq->in_packet.remaining_count < -4) return MOSQ_ERR_PROTOCOL; + +#if defined(WITH_BROKER) && defined(WITH_SYS_TREE) + g_bytes_received++; +#endif + mosq->in_packet.remaining_length += (byte & 127) * mosq->in_packet.remaining_mult; + mosq->in_packet.remaining_mult *= 128; + }else{ + if(read_length == 0) return MOSQ_ERR_CONN_LOST; /* EOF */ +#ifdef WIN32 + errno = WSAGetLastError(); +#endif + if(errno == EAGAIN || errno == COMPAT_EWOULDBLOCK){ + return MOSQ_ERR_SUCCESS; + }else{ + switch(errno){ + case COMPAT_ECONNRESET: + return MOSQ_ERR_CONN_LOST; + default: + return MOSQ_ERR_ERRNO; + } + } + } + }while((byte & 128) != 0); + /* We have finished reading remaining_length, so make remaining_count + * positive. */ + mosq->in_packet.remaining_count *= -1; + + if(mosq->in_packet.remaining_length > 0){ + mosq->in_packet.payload = _mosquitto_malloc(mosq->in_packet.remaining_length*sizeof(uint8_t)); + if(!mosq->in_packet.payload) return MOSQ_ERR_NOMEM; + mosq->in_packet.to_process = mosq->in_packet.remaining_length; + } + } + while(mosq->in_packet.to_process>0){ + read_length = _mosquitto_net_read(mosq, &(mosq->in_packet.payload[mosq->in_packet.pos]), mosq->in_packet.to_process); + if(read_length > 0){ +#if defined(WITH_BROKER) && defined(WITH_SYS_TREE) + g_bytes_received += read_length; +#endif + mosq->in_packet.to_process -= read_length; + mosq->in_packet.pos += read_length; + }else{ +#ifdef WIN32 + errno = WSAGetLastError(); +#endif + if(errno == EAGAIN || errno == COMPAT_EWOULDBLOCK){ + if(mosq->in_packet.to_process > 1000){ + /* Update last_msg_in time if more than 1000 bytes left to + * receive. Helps when receiving large messages. + * This is an arbitrary limit, but with some consideration. + * If a client can't send 1000 bytes in a second it + * probably shouldn't be using a 1 second keep alive. */ + pthread_mutex_lock(&mosq->msgtime_mutex); + mosq->last_msg_in = mosquitto_time(); + pthread_mutex_unlock(&mosq->msgtime_mutex); + } + return MOSQ_ERR_SUCCESS; + }else{ + switch(errno){ + case COMPAT_ECONNRESET: + return MOSQ_ERR_CONN_LOST; + default: + return MOSQ_ERR_ERRNO; + } + } + } + } + + /* All data for this packet is read. */ + mosq->in_packet.pos = 0; +#ifdef WITH_BROKER +# ifdef WITH_SYS_TREE + g_msgs_received++; + if(((mosq->in_packet.command)&0xF5) == PUBLISH){ + g_pub_msgs_received++; + } +# endif + rc = mqtt3_packet_handle(db, mosq); +#else + rc = _mosquitto_packet_handle(mosq); +#endif + + /* Free data and reset values */ + _mosquitto_packet_cleanup(&mosq->in_packet); + + pthread_mutex_lock(&mosq->msgtime_mutex); + mosq->last_msg_in = mosquitto_time(); + pthread_mutex_unlock(&mosq->msgtime_mutex); + return rc; +} + +int _mosquitto_socket_nonblock(mosq_sock_t sock) +{ +#ifndef WIN32 + int opt; + /* Set non-blocking */ + opt = fcntl(sock, F_GETFL, 0); + if(opt == -1){ + COMPAT_CLOSE(sock); + return 1; + } + if(fcntl(sock, F_SETFL, opt | O_NONBLOCK) == -1){ + /* If either fcntl fails, don't want to allow this client to connect. */ + COMPAT_CLOSE(sock); + return 1; + } +#else + unsigned long opt = 1; + if(ioctlsocket(sock, FIONBIO, &opt)){ + COMPAT_CLOSE(sock); + return 1; + } +#endif + return 0; +} + + +#ifndef WITH_BROKER +int _mosquitto_socketpair(mosq_sock_t *pairR, mosq_sock_t *pairW) +{ +#ifdef WIN32 + int family[2] = {AF_INET, AF_INET6}; + int i; + struct sockaddr_storage ss; + struct sockaddr_in *sa = (struct sockaddr_in *)&ss; + struct sockaddr_in6 *sa6 = (struct sockaddr_in6 *)&ss; + socklen_t ss_len; + mosq_sock_t spR, spW; + + mosq_sock_t listensock; + + *pairR = INVALID_SOCKET; + *pairW = INVALID_SOCKET; + + for(i=0; i<2; i++){ + memset(&ss, 0, sizeof(ss)); + if(family[i] == AF_INET){ + sa->sin_family = family[i]; + sa->sin_addr.s_addr = htonl(INADDR_LOOPBACK); + sa->sin_port = 0; + ss_len = sizeof(struct sockaddr_in); + }else if(family[i] == AF_INET6){ + sa6->sin6_family = family[i]; + sa6->sin6_addr = in6addr_loopback; + sa6->sin6_port = 0; + ss_len = sizeof(struct sockaddr_in6); + }else{ + return MOSQ_ERR_INVAL; + } + + listensock = socket(family[i], SOCK_STREAM, IPPROTO_TCP); + if(listensock == -1){ + continue; + } + + if(bind(listensock, (struct sockaddr *)&ss, ss_len) == -1){ + COMPAT_CLOSE(listensock); + continue; + } + + if(listen(listensock, 1) == -1){ + COMPAT_CLOSE(listensock); + continue; + } + memset(&ss, 0, sizeof(ss)); + ss_len = sizeof(ss); + if(getsockname(listensock, (struct sockaddr *)&ss, &ss_len) < 0){ + COMPAT_CLOSE(listensock); + continue; + } + + if(family[i] == AF_INET){ + sa->sin_family = family[i]; + sa->sin_addr.s_addr = htonl(INADDR_LOOPBACK); + ss_len = sizeof(struct sockaddr_in); + }else if(family[i] == AF_INET6){ + sa6->sin6_family = family[i]; + sa6->sin6_addr = in6addr_loopback; + ss_len = sizeof(struct sockaddr_in6); + } + + spR = socket(family[i], SOCK_STREAM, IPPROTO_TCP); + if(spR == -1){ + COMPAT_CLOSE(listensock); + continue; + } + if(_mosquitto_socket_nonblock(spR)){ + COMPAT_CLOSE(spR); + COMPAT_CLOSE(listensock); + continue; + } + if(connect(spR, (struct sockaddr *)&ss, ss_len) < 0){ +#ifdef WIN32 + errno = WSAGetLastError(); +#endif + if(errno != EINPROGRESS && errno != COMPAT_EWOULDBLOCK){ + COMPAT_CLOSE(spR); + COMPAT_CLOSE(listensock); + continue; + } + } + spW = accept(listensock, NULL, 0); + if(spW == -1){ +#ifdef WIN32 + errno = WSAGetLastError(); +#endif + if(errno != EINPROGRESS && errno != COMPAT_EWOULDBLOCK){ + COMPAT_CLOSE(spR); + COMPAT_CLOSE(listensock); + continue; + } + } + + if(_mosquitto_socket_nonblock(spW)){ + COMPAT_CLOSE(spR); + COMPAT_CLOSE(spW); + COMPAT_CLOSE(listensock); + continue; + } + COMPAT_CLOSE(listensock); + + *pairR = spR; + *pairW = spW; + return MOSQ_ERR_SUCCESS; + } + return MOSQ_ERR_UNKNOWN; +#else + int sv[2]; + + if(socketpair(AF_UNIX, SOCK_STREAM, 0, sv) == -1){ + return MOSQ_ERR_ERRNO; + } + if(_mosquitto_socket_nonblock(sv[0])){ + COMPAT_CLOSE(sv[0]); + COMPAT_CLOSE(sv[1]); + return MOSQ_ERR_ERRNO; + } + if(_mosquitto_socket_nonblock(sv[1])){ + COMPAT_CLOSE(sv[0]); + COMPAT_CLOSE(sv[1]); + return MOSQ_ERR_ERRNO; + } + *pairR = sv[0]; + *pairW = sv[1]; + return MOSQ_ERR_SUCCESS; +#endif +} +#endif diff --git a/src/libs/mosquitto/lib/net_mosq.h b/src/libs/mosquitto/lib/net_mosq.h new file mode 100644 index 0000000..b504ebc --- /dev/null +++ b/src/libs/mosquitto/lib/net_mosq.h @@ -0,0 +1,95 @@ +/* +Copyright (c) 2010-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ +#ifndef _NET_MOSQ_H_ +#define _NET_MOSQ_H_ + +#ifndef WIN32 +#include +#else +#include +typedef int ssize_t; +#endif + +#include +#include + +#ifdef WITH_BROKER +struct mosquitto_db; +#endif + +#ifdef WIN32 +# define COMPAT_CLOSE(a) closesocket(a) +# define COMPAT_ECONNRESET WSAECONNRESET +# define COMPAT_EWOULDBLOCK WSAEWOULDBLOCK +#else +# define COMPAT_CLOSE(a) close(a) +# define COMPAT_ECONNRESET ECONNRESET +# define COMPAT_EWOULDBLOCK EWOULDBLOCK +#endif + +/* For when not using winsock libraries. */ +#ifndef INVALID_SOCKET +#define INVALID_SOCKET -1 +#endif + +/* Macros for accessing the MSB and LSB of a uint16_t */ +#define MOSQ_MSB(A) (uint8_t)((A & 0xFF00) >> 8) +#define MOSQ_LSB(A) (uint8_t)(A & 0x00FF) + +void _mosquitto_net_init(void); +void _mosquitto_net_cleanup(void); + +void _mosquitto_packet_cleanup(struct _mosquitto_packet *packet); +int _mosquitto_packet_queue(struct mosquitto *mosq, struct _mosquitto_packet *packet); +int _mosquitto_socket_connect(struct mosquitto *mosq, const char *host, uint16_t port, const char *bind_address, bool blocking); +#ifdef WITH_BROKER +int _mosquitto_socket_close(struct mosquitto_db *db, struct mosquitto *mosq); +#else +int _mosquitto_socket_close(struct mosquitto *mosq); +#endif +int _mosquitto_try_connect(struct mosquitto *mosq, const char *host, uint16_t port, mosq_sock_t *sock, const char *bind_address, bool blocking); +int _mosquitto_try_connect_step1(struct mosquitto *mosq, const char *host); +int _mosquitto_try_connect_step2(struct mosquitto *mosq, uint16_t port, mosq_sock_t *sock); +int _mosquitto_socket_connect_step3(struct mosquitto *mosq, const char *host, uint16_t port, const char *bind_address, bool blocking); +int _mosquitto_socket_nonblock(mosq_sock_t sock); +int _mosquitto_socketpair(mosq_sock_t *sp1, mosq_sock_t *sp2); + +int _mosquitto_read_byte(struct _mosquitto_packet *packet, uint8_t *byte); +int _mosquitto_read_bytes(struct _mosquitto_packet *packet, void *bytes, uint32_t count); +int _mosquitto_read_string(struct _mosquitto_packet *packet, char **str); +int _mosquitto_read_uint16(struct _mosquitto_packet *packet, uint16_t *word); + +void _mosquitto_write_byte(struct _mosquitto_packet *packet, uint8_t byte); +void _mosquitto_write_bytes(struct _mosquitto_packet *packet, const void *bytes, uint32_t count); +void _mosquitto_write_string(struct _mosquitto_packet *packet, const char *str, uint16_t length); +void _mosquitto_write_uint16(struct _mosquitto_packet *packet, uint16_t word); + +ssize_t _mosquitto_net_read(struct mosquitto *mosq, void *buf, size_t count); +ssize_t _mosquitto_net_write(struct mosquitto *mosq, void *buf, size_t count); + +int _mosquitto_packet_write(struct mosquitto *mosq); +#ifdef WITH_BROKER +int _mosquitto_packet_read(struct mosquitto_db *db, struct mosquitto *mosq); +#else +int _mosquitto_packet_read(struct mosquitto *mosq); +#endif + +#ifdef WITH_TLS +int _mosquitto_socket_apply_tls(struct mosquitto *mosq); +int mosquitto__socket_connect_tls(struct mosquitto *mosq); +#endif + +#endif diff --git a/src/libs/mosquitto/lib/read_handle.c b/src/libs/mosquitto/lib/read_handle.c new file mode 100644 index 0000000..d83294a --- /dev/null +++ b/src/libs/mosquitto/lib/read_handle.c @@ -0,0 +1,155 @@ +/* +Copyright (c) 2009-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int _mosquitto_packet_handle(struct mosquitto *mosq) +{ + assert(mosq); + + switch((mosq->in_packet.command)&0xF0){ + case PINGREQ: + return _mosquitto_handle_pingreq(mosq); + case PINGRESP: + return _mosquitto_handle_pingresp(mosq); + case PUBACK: + return _mosquitto_handle_pubackcomp(mosq, "PUBACK"); + case PUBCOMP: + return _mosquitto_handle_pubackcomp(mosq, "PUBCOMP"); + case PUBLISH: + return _mosquitto_handle_publish(mosq); + case PUBREC: + return _mosquitto_handle_pubrec(mosq); + case PUBREL: + return _mosquitto_handle_pubrel(NULL, mosq); + case CONNACK: + return _mosquitto_handle_connack(mosq); + case SUBACK: + return _mosquitto_handle_suback(mosq); + case UNSUBACK: + return _mosquitto_handle_unsuback(mosq); + default: + /* If we don't recognise the command, return an error straight away. */ + _mosquitto_log_printf(mosq, MOSQ_LOG_ERR, "Error: Unrecognised command %d\n", (mosq->in_packet.command)&0xF0); + return MOSQ_ERR_PROTOCOL; + } +} + +int _mosquitto_handle_publish(struct mosquitto *mosq) +{ + uint8_t header; + struct mosquitto_message_all *message; + int rc = 0; + uint16_t mid; + + assert(mosq); + + message = _mosquitto_calloc(1, sizeof(struct mosquitto_message_all)); + if(!message) return MOSQ_ERR_NOMEM; + + header = mosq->in_packet.command; + + message->dup = (header & 0x08)>>3; + message->msg.qos = (header & 0x06)>>1; + message->msg.retain = (header & 0x01); + + rc = _mosquitto_read_string(&mosq->in_packet, &message->msg.topic); + if(rc){ + _mosquitto_message_cleanup(&message); + return rc; + } + if(!strlen(message->msg.topic)){ + _mosquitto_message_cleanup(&message); + return MOSQ_ERR_PROTOCOL; + } + + if(message->msg.qos > 0){ + rc = _mosquitto_read_uint16(&mosq->in_packet, &mid); + if(rc){ + _mosquitto_message_cleanup(&message); + return rc; + } + message->msg.mid = (int)mid; + } + + message->msg.payloadlen = mosq->in_packet.remaining_length - mosq->in_packet.pos; + if(message->msg.payloadlen){ + message->msg.payload = _mosquitto_calloc(message->msg.payloadlen+1, sizeof(uint8_t)); + if(!message->msg.payload){ + _mosquitto_message_cleanup(&message); + return MOSQ_ERR_NOMEM; + } + rc = _mosquitto_read_bytes(&mosq->in_packet, message->msg.payload, message->msg.payloadlen); + if(rc){ + _mosquitto_message_cleanup(&message); + return rc; + } + } + _mosquitto_log_printf(mosq, MOSQ_LOG_DEBUG, + "Client %s received PUBLISH (d%d, q%d, r%d, m%d, '%s', ... (%ld bytes))", + mosq->id, message->dup, message->msg.qos, message->msg.retain, + message->msg.mid, message->msg.topic, + (long)message->msg.payloadlen); + + message->timestamp = mosquitto_time(); + switch(message->msg.qos){ + case 0: + pthread_mutex_lock(&mosq->callback_mutex); + if(mosq->on_message){ + mosq->in_callback = true; + mosq->on_message(mosq, mosq->userdata, &message->msg); + mosq->in_callback = false; + } + pthread_mutex_unlock(&mosq->callback_mutex); + _mosquitto_message_cleanup(&message); + return MOSQ_ERR_SUCCESS; + case 1: + rc = _mosquitto_send_puback(mosq, message->msg.mid); + pthread_mutex_lock(&mosq->callback_mutex); + if(mosq->on_message){ + mosq->in_callback = true; + mosq->on_message(mosq, mosq->userdata, &message->msg); + mosq->in_callback = false; + } + pthread_mutex_unlock(&mosq->callback_mutex); + _mosquitto_message_cleanup(&message); + return rc; + case 2: + rc = _mosquitto_send_pubrec(mosq, message->msg.mid); + pthread_mutex_lock(&mosq->in_message_mutex); + message->state = mosq_ms_wait_for_pubrel; + _mosquitto_message_queue(mosq, message, mosq_md_in); + pthread_mutex_unlock(&mosq->in_message_mutex); + return rc; + default: + _mosquitto_message_cleanup(&message); + return MOSQ_ERR_PROTOCOL; + } +} + diff --git a/src/libs/mosquitto/lib/read_handle.h b/src/libs/mosquitto/lib/read_handle.h new file mode 100644 index 0000000..96e0467 --- /dev/null +++ b/src/libs/mosquitto/lib/read_handle.h @@ -0,0 +1,38 @@ +/* +Copyright (c) 2010-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ +#ifndef _READ_HANDLE_H_ +#define _READ_HANDLE_H_ + +#include +struct mosquitto_db; + +int _mosquitto_packet_handle(struct mosquitto *mosq); +int _mosquitto_handle_connack(struct mosquitto *mosq); +int _mosquitto_handle_pingreq(struct mosquitto *mosq); +int _mosquitto_handle_pingresp(struct mosquitto *mosq); +#ifdef WITH_BROKER +int _mosquitto_handle_pubackcomp(struct mosquitto_db *db, struct mosquitto *mosq, const char *type); +#else +int _mosquitto_handle_pubackcomp(struct mosquitto *mosq, const char *type); +#endif +int _mosquitto_handle_publish(struct mosquitto *mosq); +int _mosquitto_handle_pubrec(struct mosquitto *mosq); +int _mosquitto_handle_pubrel(struct mosquitto_db *db, struct mosquitto *mosq); +int _mosquitto_handle_suback(struct mosquitto *mosq); +int _mosquitto_handle_unsuback(struct mosquitto *mosq); + + +#endif diff --git a/src/libs/mosquitto/lib/read_handle_client.c b/src/libs/mosquitto/lib/read_handle_client.c new file mode 100644 index 0000000..71c3231 --- /dev/null +++ b/src/libs/mosquitto/lib/read_handle_client.c @@ -0,0 +1,60 @@ +/* +Copyright (c) 2009-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include + +#include +#include +#include +#include +#include + +int _mosquitto_handle_connack(struct mosquitto *mosq) +{ + uint8_t byte; + uint8_t result; + int rc; + + assert(mosq); + _mosquitto_log_printf(mosq, MOSQ_LOG_DEBUG, "Client %s received CONNACK", mosq->id); + rc = _mosquitto_read_byte(&mosq->in_packet, &byte); // Reserved byte, not used + if(rc) return rc; + rc = _mosquitto_read_byte(&mosq->in_packet, &result); + if(rc) return rc; + pthread_mutex_lock(&mosq->callback_mutex); + if(mosq->on_connect){ + mosq->in_callback = true; + mosq->on_connect(mosq, mosq->userdata, result); + mosq->in_callback = false; + } + pthread_mutex_unlock(&mosq->callback_mutex); + switch(result){ + case 0: + if(mosq->state != mosq_cs_disconnecting){ + mosq->state = mosq_cs_connected; + } + return MOSQ_ERR_SUCCESS; + case 1: + case 2: + case 3: + case 4: + case 5: + return MOSQ_ERR_CONN_REFUSED; + default: + return MOSQ_ERR_PROTOCOL; + } +} + diff --git a/src/libs/mosquitto/lib/read_handle_shared.c b/src/libs/mosquitto/lib/read_handle_shared.c new file mode 100644 index 0000000..6a135df --- /dev/null +++ b/src/libs/mosquitto/lib/read_handle_shared.c @@ -0,0 +1,242 @@ +/* +Copyright (c) 2009-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef WITH_BROKER +#include +#endif + +int _mosquitto_handle_pingreq(struct mosquitto *mosq) +{ + assert(mosq); +#ifdef WITH_BROKER + _mosquitto_log_printf(NULL, MOSQ_LOG_DEBUG, "Received PINGREQ from %s", mosq->id); +#else + _mosquitto_log_printf(mosq, MOSQ_LOG_DEBUG, "Client %s received PINGREQ", mosq->id); +#endif + return _mosquitto_send_pingresp(mosq); +} + +int _mosquitto_handle_pingresp(struct mosquitto *mosq) +{ + assert(mosq); + mosq->ping_t = 0; /* No longer waiting for a PINGRESP. */ +#ifdef WITH_BROKER + _mosquitto_log_printf(NULL, MOSQ_LOG_DEBUG, "Received PINGRESP from %s", mosq->id); +#else + _mosquitto_log_printf(mosq, MOSQ_LOG_DEBUG, "Client %s received PINGRESP", mosq->id); +#endif + return MOSQ_ERR_SUCCESS; +} + +#ifdef WITH_BROKER +int _mosquitto_handle_pubackcomp(struct mosquitto_db *db, struct mosquitto *mosq, const char *type) +#else +int _mosquitto_handle_pubackcomp(struct mosquitto *mosq, const char *type) +#endif +{ + uint16_t mid; + int rc; + + assert(mosq); + rc = _mosquitto_read_uint16(&mosq->in_packet, &mid); + if(rc) return rc; +#ifdef WITH_BROKER + _mosquitto_log_printf(NULL, MOSQ_LOG_DEBUG, "Received %s from %s (Mid: %d)", type, mosq->id, mid); + + if(mid){ + rc = mqtt3_db_message_delete(db, mosq, mid, mosq_md_out); + if(rc == MOSQ_ERR_NOT_FOUND){ + _mosquitto_log_printf(mosq, MOSQ_LOG_WARNING, "Warning: Received %s from %s for an unknown packet identifier %d.", type, mosq->id, mid); + return MOSQ_ERR_SUCCESS; + }else{ + return rc; + } + } +#else + _mosquitto_log_printf(mosq, MOSQ_LOG_DEBUG, "Client %s received %s (Mid: %d)", mosq->id, type, mid); + + if(!_mosquitto_message_delete(mosq, mid, mosq_md_out)){ + /* Only inform the client the message has been sent once. */ + pthread_mutex_lock(&mosq->callback_mutex); + if(mosq->on_publish){ + mosq->in_callback = true; + mosq->on_publish(mosq, mosq->userdata, mid); + mosq->in_callback = false; + } + pthread_mutex_unlock(&mosq->callback_mutex); + } +#endif + + return MOSQ_ERR_SUCCESS; +} + +int _mosquitto_handle_pubrec(struct mosquitto *mosq) +{ + uint16_t mid; + int rc; + + assert(mosq); + rc = _mosquitto_read_uint16(&mosq->in_packet, &mid); + if(rc) return rc; +#ifdef WITH_BROKER + _mosquitto_log_printf(NULL, MOSQ_LOG_DEBUG, "Received PUBREC from %s (Mid: %d)", mosq->id, mid); + + rc = mqtt3_db_message_update(mosq, mid, mosq_md_out, mosq_ms_wait_for_pubcomp); +#else + _mosquitto_log_printf(mosq, MOSQ_LOG_DEBUG, "Client %s received PUBREC (Mid: %d)", mosq->id, mid); + + rc = _mosquitto_message_out_update(mosq, mid, mosq_ms_wait_for_pubcomp); +#endif + if(rc == MOSQ_ERR_NOT_FOUND){ + _mosquitto_log_printf(mosq, MOSQ_LOG_WARNING, "Warning: Received PUBREC from %s for an unknown packet identifier %d.", mosq->id, mid); + }else if(rc != MOSQ_ERR_SUCCESS){ + return rc; + } + rc = _mosquitto_send_pubrel(mosq, mid); + if(rc) return rc; + + return MOSQ_ERR_SUCCESS; +} + +int _mosquitto_handle_pubrel(struct mosquitto_db *db, struct mosquitto *mosq) +{ + uint16_t mid; +#ifndef WITH_BROKER + struct mosquitto_message_all *message = NULL; +#endif + int rc; + + assert(mosq); + if(mosq->protocol == mosq_p_mqtt311){ + if((mosq->in_packet.command&0x0F) != 0x02){ + return MOSQ_ERR_PROTOCOL; + } + } + rc = _mosquitto_read_uint16(&mosq->in_packet, &mid); + if(rc) return rc; +#ifdef WITH_BROKER + _mosquitto_log_printf(NULL, MOSQ_LOG_DEBUG, "Received PUBREL from %s (Mid: %d)", mosq->id, mid); + + if(mqtt3_db_message_release(db, mosq, mid, mosq_md_in)){ + /* Message not found. Still send a PUBCOMP anyway because this could be + * due to a repeated PUBREL after a client has reconnected. */ + _mosquitto_log_printf(mosq, MOSQ_LOG_WARNING, "Warning: Received PUBREL from %s for an unknown packet identifier %d.", mosq->id, mid); + } +#else + _mosquitto_log_printf(mosq, MOSQ_LOG_DEBUG, "Client %s received PUBREL (Mid: %d)", mosq->id, mid); + + if(!_mosquitto_message_remove(mosq, mid, mosq_md_in, &message)){ + /* Only pass the message on if we have removed it from the queue - this + * prevents multiple callbacks for the same message. */ + pthread_mutex_lock(&mosq->callback_mutex); + if(mosq->on_message){ + mosq->in_callback = true; + mosq->on_message(mosq, mosq->userdata, &message->msg); + mosq->in_callback = false; + } + pthread_mutex_unlock(&mosq->callback_mutex); + _mosquitto_message_cleanup(&message); + } +#endif + rc = _mosquitto_send_pubcomp(mosq, mid); + if(rc) return rc; + + return MOSQ_ERR_SUCCESS; +} + +int _mosquitto_handle_suback(struct mosquitto *mosq) +{ + uint16_t mid; + uint8_t qos; + int *granted_qos; + int qos_count; + int i = 0; + int rc; + + assert(mosq); +#ifdef WITH_BROKER + _mosquitto_log_printf(NULL, MOSQ_LOG_DEBUG, "Received SUBACK from %s", mosq->id); +#else + _mosquitto_log_printf(mosq, MOSQ_LOG_DEBUG, "Client %s received SUBACK", mosq->id); +#endif + rc = _mosquitto_read_uint16(&mosq->in_packet, &mid); + if(rc) return rc; + + qos_count = mosq->in_packet.remaining_length - mosq->in_packet.pos; + granted_qos = _mosquitto_malloc(qos_count*sizeof(int)); + if(!granted_qos) return MOSQ_ERR_NOMEM; + while(mosq->in_packet.pos < mosq->in_packet.remaining_length){ + rc = _mosquitto_read_byte(&mosq->in_packet, &qos); + if(rc){ + _mosquitto_free(granted_qos); + return rc; + } + granted_qos[i] = (int)qos; + i++; + } +#ifndef WITH_BROKER + pthread_mutex_lock(&mosq->callback_mutex); + if(mosq->on_subscribe){ + mosq->in_callback = true; + mosq->on_subscribe(mosq, mosq->userdata, mid, qos_count, granted_qos); + mosq->in_callback = false; + } + pthread_mutex_unlock(&mosq->callback_mutex); +#endif + _mosquitto_free(granted_qos); + + return MOSQ_ERR_SUCCESS; +} + +int _mosquitto_handle_unsuback(struct mosquitto *mosq) +{ + uint16_t mid; + int rc; + + assert(mosq); +#ifdef WITH_BROKER + _mosquitto_log_printf(NULL, MOSQ_LOG_DEBUG, "Received UNSUBACK from %s", mosq->id); +#else + _mosquitto_log_printf(mosq, MOSQ_LOG_DEBUG, "Client %s received UNSUBACK", mosq->id); +#endif + rc = _mosquitto_read_uint16(&mosq->in_packet, &mid); + if(rc) return rc; +#ifndef WITH_BROKER + pthread_mutex_lock(&mosq->callback_mutex); + if(mosq->on_unsubscribe){ + mosq->in_callback = true; + mosq->on_unsubscribe(mosq, mosq->userdata, mid); + mosq->in_callback = false; + } + pthread_mutex_unlock(&mosq->callback_mutex); +#endif + + return MOSQ_ERR_SUCCESS; +} + diff --git a/src/libs/mosquitto/lib/send_client_mosq.c b/src/libs/mosquitto/lib/send_client_mosq.c new file mode 100644 index 0000000..a930bc9 --- /dev/null +++ b/src/libs/mosquitto/lib/send_client_mosq.c @@ -0,0 +1,246 @@ +/* +Copyright (c) 2009-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#ifdef WITH_BROKER +#include +#endif + +int _mosquitto_send_connect(struct mosquitto *mosq, uint16_t keepalive, bool clean_session) +{ + struct _mosquitto_packet *packet = NULL; + int payloadlen; + uint8_t will = 0; + uint8_t byte; + int rc; + uint8_t version; + char *clientid, *username, *password; + int headerlen; + + assert(mosq); + assert(mosq->id); + +#if defined(WITH_BROKER) && defined(WITH_BRIDGE) + if(mosq->bridge){ + clientid = mosq->bridge->remote_clientid; + username = mosq->bridge->remote_username; + password = mosq->bridge->remote_password; + }else{ + clientid = mosq->id; + username = mosq->username; + password = mosq->password; + } +#else + clientid = mosq->id; + username = mosq->username; + password = mosq->password; +#endif + + if(mosq->protocol == mosq_p_mqtt31){ + version = MQTT_PROTOCOL_V31; + headerlen = 12; + }else if(mosq->protocol == mosq_p_mqtt311){ + version = MQTT_PROTOCOL_V311; + headerlen = 10; + }else{ + return MOSQ_ERR_INVAL; + } + + packet = _mosquitto_calloc(1, sizeof(struct _mosquitto_packet)); + if(!packet) return MOSQ_ERR_NOMEM; + + payloadlen = 2+strlen(clientid); + if(mosq->will){ + will = 1; + assert(mosq->will->topic); + + payloadlen += 2+strlen(mosq->will->topic) + 2+mosq->will->payloadlen; + } + if(username){ + payloadlen += 2+strlen(username); + if(password){ + payloadlen += 2+strlen(password); + } + } + + packet->command = CONNECT; + packet->remaining_length = headerlen+payloadlen; + rc = _mosquitto_packet_alloc(packet); + if(rc){ + _mosquitto_free(packet); + return rc; + } + + /* Variable header */ + if(version == MQTT_PROTOCOL_V31){ + _mosquitto_write_string(packet, PROTOCOL_NAME_v31, strlen(PROTOCOL_NAME_v31)); + }else if(version == MQTT_PROTOCOL_V311){ + _mosquitto_write_string(packet, PROTOCOL_NAME_v311, strlen(PROTOCOL_NAME_v311)); + } +#if defined(WITH_BROKER) && defined(WITH_BRIDGE) + if(mosq->bridge && mosq->bridge->try_private && mosq->bridge->try_private_accepted){ + version |= 0x80; + }else{ + } +#endif + _mosquitto_write_byte(packet, version); + byte = (clean_session&0x1)<<1; + if(will){ + byte = byte | ((mosq->will->retain&0x1)<<5) | ((mosq->will->qos&0x3)<<3) | ((will&0x1)<<2); + } + if(username){ + byte = byte | 0x1<<7; + if(mosq->password){ + byte = byte | 0x1<<6; + } + } + _mosquitto_write_byte(packet, byte); + _mosquitto_write_uint16(packet, keepalive); + + /* Payload */ + _mosquitto_write_string(packet, clientid, strlen(clientid)); + if(will){ + _mosquitto_write_string(packet, mosq->will->topic, strlen(mosq->will->topic)); + _mosquitto_write_string(packet, (const char *)mosq->will->payload, mosq->will->payloadlen); + } + if(username){ + _mosquitto_write_string(packet, username, strlen(username)); + if(password){ + _mosquitto_write_string(packet, password, strlen(password)); + } + } + + mosq->keepalive = keepalive; +#ifdef WITH_BROKER +# ifdef WITH_BRIDGE + _mosquitto_log_printf(mosq, MOSQ_LOG_DEBUG, "Bridge %s sending CONNECT", clientid); +# endif +#else + _mosquitto_log_printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending CONNECT", clientid); +#endif + return _mosquitto_packet_queue(mosq, packet); +} + +int _mosquitto_send_disconnect(struct mosquitto *mosq) +{ + assert(mosq); +#ifdef WITH_BROKER +# ifdef WITH_BRIDGE + _mosquitto_log_printf(mosq, MOSQ_LOG_DEBUG, "Bridge %s sending DISCONNECT", mosq->id); +# endif +#else + _mosquitto_log_printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending DISCONNECT", mosq->id); +#endif + return _mosquitto_send_simple_command(mosq, DISCONNECT); +} + +int _mosquitto_send_subscribe(struct mosquitto *mosq, int *mid, const char *topic, uint8_t topic_qos) +{ + /* FIXME - only deals with a single topic */ + struct _mosquitto_packet *packet = NULL; + uint32_t packetlen; + uint16_t local_mid; + int rc; + + assert(mosq); + assert(topic); + + packet = _mosquitto_calloc(1, sizeof(struct _mosquitto_packet)); + if(!packet) return MOSQ_ERR_NOMEM; + + packetlen = 2 + 2+strlen(topic) + 1; + + packet->command = SUBSCRIBE | (1<<1); + packet->remaining_length = packetlen; + rc = _mosquitto_packet_alloc(packet); + if(rc){ + _mosquitto_free(packet); + return rc; + } + + /* Variable header */ + local_mid = _mosquitto_mid_generate(mosq); + if(mid) *mid = (int)local_mid; + _mosquitto_write_uint16(packet, local_mid); + + /* Payload */ + _mosquitto_write_string(packet, topic, strlen(topic)); + _mosquitto_write_byte(packet, topic_qos); + +#ifdef WITH_BROKER +# ifdef WITH_BRIDGE + _mosquitto_log_printf(mosq, MOSQ_LOG_DEBUG, "Bridge %s sending SUBSCRIBE (Mid: %d, Topic: %s, QoS: %d)", mosq->id, local_mid, topic, topic_qos); +# endif +#else + _mosquitto_log_printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending SUBSCRIBE (Mid: %d, Topic: %s, QoS: %d)", mosq->id, local_mid, topic, topic_qos); +#endif + + return _mosquitto_packet_queue(mosq, packet); +} + + +int _mosquitto_send_unsubscribe(struct mosquitto *mosq, int *mid, const char *topic) +{ + /* FIXME - only deals with a single topic */ + struct _mosquitto_packet *packet = NULL; + uint32_t packetlen; + uint16_t local_mid; + int rc; + + assert(mosq); + assert(topic); + + packet = _mosquitto_calloc(1, sizeof(struct _mosquitto_packet)); + if(!packet) return MOSQ_ERR_NOMEM; + + packetlen = 2 + 2+strlen(topic); + + packet->command = UNSUBSCRIBE | (1<<1); + packet->remaining_length = packetlen; + rc = _mosquitto_packet_alloc(packet); + if(rc){ + _mosquitto_free(packet); + return rc; + } + + /* Variable header */ + local_mid = _mosquitto_mid_generate(mosq); + if(mid) *mid = (int)local_mid; + _mosquitto_write_uint16(packet, local_mid); + + /* Payload */ + _mosquitto_write_string(packet, topic, strlen(topic)); + +#ifdef WITH_BROKER +# ifdef WITH_BRIDGE + _mosquitto_log_printf(mosq, MOSQ_LOG_DEBUG, "Bridge %s sending UNSUBSCRIBE (Mid: %d, Topic: %s)", mosq->id, local_mid, topic); +# endif +#else + _mosquitto_log_printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending UNSUBSCRIBE (Mid: %d, Topic: %s)", mosq->id, local_mid, topic); +#endif + return _mosquitto_packet_queue(mosq, packet); +} + diff --git a/src/libs/mosquitto/lib/send_mosq.c b/src/libs/mosquitto/lib/send_mosq.c new file mode 100644 index 0000000..a4aae72 --- /dev/null +++ b/src/libs/mosquitto/lib/send_mosq.c @@ -0,0 +1,282 @@ +/* +Copyright (c) 2009-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include +#include +#include + +#ifdef WITH_BROKER +#include +# ifdef WITH_SYS_TREE +extern uint64_t g_pub_bytes_sent; +# endif +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int _mosquitto_send_pingreq(struct mosquitto *mosq) +{ + int rc; + assert(mosq); +#ifdef WITH_BROKER + _mosquitto_log_printf(NULL, MOSQ_LOG_DEBUG, "Sending PINGREQ to %s", mosq->id); +#else + _mosquitto_log_printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending PINGREQ", mosq->id); +#endif + rc = _mosquitto_send_simple_command(mosq, PINGREQ); + if(rc == MOSQ_ERR_SUCCESS){ + mosq->ping_t = mosquitto_time(); + } + return rc; +} + +int _mosquitto_send_pingresp(struct mosquitto *mosq) +{ +#ifdef WITH_BROKER + if(mosq) _mosquitto_log_printf(NULL, MOSQ_LOG_DEBUG, "Sending PINGRESP to %s", mosq->id); +#else + if(mosq) _mosquitto_log_printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending PINGRESP", mosq->id); +#endif + return _mosquitto_send_simple_command(mosq, PINGRESP); +} + +int _mosquitto_send_puback(struct mosquitto *mosq, uint16_t mid) +{ +#ifdef WITH_BROKER + if(mosq) _mosquitto_log_printf(NULL, MOSQ_LOG_DEBUG, "Sending PUBACK to %s (Mid: %d)", mosq->id, mid); +#else + if(mosq) _mosquitto_log_printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending PUBACK (Mid: %d)", mosq->id, mid); +#endif + return _mosquitto_send_command_with_mid(mosq, PUBACK, mid, false); +} + +int _mosquitto_send_pubcomp(struct mosquitto *mosq, uint16_t mid) +{ +#ifdef WITH_BROKER + if(mosq) _mosquitto_log_printf(NULL, MOSQ_LOG_DEBUG, "Sending PUBCOMP to %s (Mid: %d)", mosq->id, mid); +#else + if(mosq) _mosquitto_log_printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending PUBCOMP (Mid: %d)", mosq->id, mid); +#endif + return _mosquitto_send_command_with_mid(mosq, PUBCOMP, mid, false); +} + +int _mosquitto_send_publish(struct mosquitto *mosq, uint16_t mid, const char *topic, uint32_t payloadlen, const void *payload, int qos, bool retain, bool dup) +{ +#ifdef WITH_BROKER + size_t len; +#ifdef WITH_BRIDGE + int i; + struct _mqtt3_bridge_topic *cur_topic; + bool match; + int rc; + char *mapped_topic = NULL; + char *topic_temp = NULL; +#endif +#endif + assert(mosq); + assert(topic); + +#if defined(WITH_BROKER) && defined(WITH_WEBSOCKETS) + if(mosq->sock == INVALID_SOCKET && !mosq->wsi) return MOSQ_ERR_NO_CONN; +#else + if(mosq->sock == INVALID_SOCKET) return MOSQ_ERR_NO_CONN; +#endif + +#ifdef WITH_BROKER + if(mosq->listener && mosq->listener->mount_point){ + len = strlen(mosq->listener->mount_point); + if(len < strlen(topic)){ + topic += len; + }else{ + /* Invalid topic string. Should never happen, but silently swallow the message anyway. */ + return MOSQ_ERR_SUCCESS; + } + } +#ifdef WITH_BRIDGE + if(mosq->bridge && mosq->bridge->topics && mosq->bridge->topic_remapping){ + for(i=0; ibridge->topic_count; i++){ + cur_topic = &mosq->bridge->topics[i]; + if((cur_topic->direction == bd_both || cur_topic->direction == bd_out) + && (cur_topic->remote_prefix || cur_topic->local_prefix)){ + /* Topic mapping required on this topic if the message matches */ + + rc = mosquitto_topic_matches_sub(cur_topic->local_topic, topic, &match); + if(rc){ + return rc; + } + if(match){ + mapped_topic = _mosquitto_strdup(topic); + if(!mapped_topic) return MOSQ_ERR_NOMEM; + if(cur_topic->local_prefix){ + /* This prefix needs removing. */ + if(!strncmp(cur_topic->local_prefix, mapped_topic, strlen(cur_topic->local_prefix))){ + topic_temp = _mosquitto_strdup(mapped_topic+strlen(cur_topic->local_prefix)); + _mosquitto_free(mapped_topic); + if(!topic_temp){ + return MOSQ_ERR_NOMEM; + } + mapped_topic = topic_temp; + } + } + + if(cur_topic->remote_prefix){ + /* This prefix needs adding. */ + len = strlen(mapped_topic) + strlen(cur_topic->remote_prefix)+1; + topic_temp = _mosquitto_malloc(len+1); + if(!topic_temp){ + _mosquitto_free(mapped_topic); + return MOSQ_ERR_NOMEM; + } + snprintf(topic_temp, len, "%s%s", cur_topic->remote_prefix, mapped_topic); + topic_temp[len] = '\0'; + _mosquitto_free(mapped_topic); + mapped_topic = topic_temp; + } + _mosquitto_log_printf(NULL, MOSQ_LOG_DEBUG, "Sending PUBLISH to %s (d%d, q%d, r%d, m%d, '%s', ... (%ld bytes))", mosq->id, dup, qos, retain, mid, mapped_topic, (long)payloadlen); +#ifdef WITH_SYS_TREE + g_pub_bytes_sent += payloadlen; +#endif + rc = _mosquitto_send_real_publish(mosq, mid, mapped_topic, payloadlen, payload, qos, retain, dup); + _mosquitto_free(mapped_topic); + return rc; + } + } + } + } +#endif + _mosquitto_log_printf(NULL, MOSQ_LOG_DEBUG, "Sending PUBLISH to %s (d%d, q%d, r%d, m%d, '%s', ... (%ld bytes))", mosq->id, dup, qos, retain, mid, topic, (long)payloadlen); +# ifdef WITH_SYS_TREE + g_pub_bytes_sent += payloadlen; +# endif +#else + _mosquitto_log_printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending PUBLISH (d%d, q%d, r%d, m%d, '%s', ... (%ld bytes))", mosq->id, dup, qos, retain, mid, topic, (long)payloadlen); +#endif + + return _mosquitto_send_real_publish(mosq, mid, topic, payloadlen, payload, qos, retain, dup); +} + +int _mosquitto_send_pubrec(struct mosquitto *mosq, uint16_t mid) +{ +#ifdef WITH_BROKER + if(mosq) _mosquitto_log_printf(NULL, MOSQ_LOG_DEBUG, "Sending PUBREC to %s (Mid: %d)", mosq->id, mid); +#else + if(mosq) _mosquitto_log_printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending PUBREC (Mid: %d)", mosq->id, mid); +#endif + return _mosquitto_send_command_with_mid(mosq, PUBREC, mid, false); +} + +int _mosquitto_send_pubrel(struct mosquitto *mosq, uint16_t mid) +{ +#ifdef WITH_BROKER + if(mosq) _mosquitto_log_printf(NULL, MOSQ_LOG_DEBUG, "Sending PUBREL to %s (Mid: %d)", mosq->id, mid); +#else + if(mosq) _mosquitto_log_printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending PUBREL (Mid: %d)", mosq->id, mid); +#endif + return _mosquitto_send_command_with_mid(mosq, PUBREL|2, mid, false); +} + +/* For PUBACK, PUBCOMP, PUBREC, and PUBREL */ +int _mosquitto_send_command_with_mid(struct mosquitto *mosq, uint8_t command, uint16_t mid, bool dup) +{ + struct _mosquitto_packet *packet = NULL; + int rc; + + assert(mosq); + packet = _mosquitto_calloc(1, sizeof(struct _mosquitto_packet)); + if(!packet) return MOSQ_ERR_NOMEM; + + packet->command = command; + if(dup){ + packet->command |= 8; + } + packet->remaining_length = 2; + rc = _mosquitto_packet_alloc(packet); + if(rc){ + _mosquitto_free(packet); + return rc; + } + + packet->payload[packet->pos+0] = MOSQ_MSB(mid); + packet->payload[packet->pos+1] = MOSQ_LSB(mid); + + return _mosquitto_packet_queue(mosq, packet); +} + +/* For DISCONNECT, PINGREQ and PINGRESP */ +int _mosquitto_send_simple_command(struct mosquitto *mosq, uint8_t command) +{ + struct _mosquitto_packet *packet = NULL; + int rc; + + assert(mosq); + packet = _mosquitto_calloc(1, sizeof(struct _mosquitto_packet)); + if(!packet) return MOSQ_ERR_NOMEM; + + packet->command = command; + packet->remaining_length = 0; + + rc = _mosquitto_packet_alloc(packet); + if(rc){ + _mosquitto_free(packet); + return rc; + } + + return _mosquitto_packet_queue(mosq, packet); +} + +int _mosquitto_send_real_publish(struct mosquitto *mosq, uint16_t mid, const char *topic, uint32_t payloadlen, const void *payload, int qos, bool retain, bool dup) +{ + struct _mosquitto_packet *packet = NULL; + int packetlen; + int rc; + + assert(mosq); + assert(topic); + + packetlen = 2+strlen(topic) + payloadlen; + if(qos > 0) packetlen += 2; /* For message id */ + packet = _mosquitto_calloc(1, sizeof(struct _mosquitto_packet)); + if(!packet) return MOSQ_ERR_NOMEM; + + packet->mid = mid; + packet->command = PUBLISH | ((dup&0x1)<<3) | (qos<<1) | retain; + packet->remaining_length = packetlen; + rc = _mosquitto_packet_alloc(packet); + if(rc){ + _mosquitto_free(packet); + return rc; + } + /* Variable header (topic string) */ + _mosquitto_write_string(packet, topic, strlen(topic)); + if(qos > 0){ + _mosquitto_write_uint16(packet, mid); + } + + /* Payload */ + if(payloadlen){ + _mosquitto_write_bytes(packet, payload, payloadlen); + } + + return _mosquitto_packet_queue(mosq, packet); +} diff --git a/src/libs/mosquitto/lib/send_mosq.h b/src/libs/mosquitto/lib/send_mosq.h new file mode 100644 index 0000000..ff2c6b9 --- /dev/null +++ b/src/libs/mosquitto/lib/send_mosq.h @@ -0,0 +1,37 @@ +/* +Copyright (c) 2010-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ +#ifndef _SEND_MOSQ_H_ +#define _SEND_MOSQ_H_ + +#include + +int _mosquitto_send_simple_command(struct mosquitto *mosq, uint8_t command); +int _mosquitto_send_command_with_mid(struct mosquitto *mosq, uint8_t command, uint16_t mid, bool dup); +int _mosquitto_send_real_publish(struct mosquitto *mosq, uint16_t mid, const char *topic, uint32_t payloadlen, const void *payload, int qos, bool retain, bool dup); + +int _mosquitto_send_connect(struct mosquitto *mosq, uint16_t keepalive, bool clean_session); +int _mosquitto_send_disconnect(struct mosquitto *mosq); +int _mosquitto_send_pingreq(struct mosquitto *mosq); +int _mosquitto_send_pingresp(struct mosquitto *mosq); +int _mosquitto_send_puback(struct mosquitto *mosq, uint16_t mid); +int _mosquitto_send_pubcomp(struct mosquitto *mosq, uint16_t mid); +int _mosquitto_send_publish(struct mosquitto *mosq, uint16_t mid, const char *topic, uint32_t payloadlen, const void *payload, int qos, bool retain, bool dup); +int _mosquitto_send_pubrec(struct mosquitto *mosq, uint16_t mid); +int _mosquitto_send_pubrel(struct mosquitto *mosq, uint16_t mid); +int _mosquitto_send_subscribe(struct mosquitto *mosq, int *mid, const char *topic, uint8_t topic_qos); +int _mosquitto_send_unsubscribe(struct mosquitto *mosq, int *mid, const char *topic); + +#endif diff --git a/src/libs/mosquitto/lib/socks_mosq.c b/src/libs/mosquitto/lib/socks_mosq.c new file mode 100644 index 0000000..36f5ed6 --- /dev/null +++ b/src/libs/mosquitto/lib/socks_mosq.c @@ -0,0 +1,396 @@ +/* +Copyright (c) 2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include +#include + +#include "mosquitto_internal.h" +#include "memory_mosq.h" +#include "net_mosq.h" +#include "send_mosq.h" + +#define SOCKS_AUTH_NONE 0x00 +#define SOCKS_AUTH_GSS 0x01 +#define SOCKS_AUTH_USERPASS 0x02 +#define SOCKS_AUTH_NO_ACCEPTABLE 0xFF + +#define SOCKS_ATYPE_IP_V4 1 /* four bytes */ +#define SOCKS_ATYPE_DOMAINNAME 3 /* one byte length, followed by fqdn no null, 256 max chars */ +#define SOCKS_ATYPE_IP_V6 4 /* 16 bytes */ + +#define SOCKS_REPLY_SUCCEEDED 0x00 +#define SOCKS_REPLY_GENERAL_FAILURE 0x01 +#define SOCKS_REPLY_CONNECTION_NOT_ALLOWED 0x02 +#define SOCKS_REPLY_NETWORK_UNREACHABLE 0x03 +#define SOCKS_REPLY_HOST_UNREACHABLE 0x04 +#define SOCKS_REPLY_CONNECTION_REFUSED 0x05 +#define SOCKS_REPLY_TTL_EXPIRED 0x06 +#define SOCKS_REPLY_COMMAND_NOT_SUPPORTED 0x07 +#define SOCKS_REPLY_ADDRESS_TYPE_NOT_SUPPORTED 0x08 + +int mosquitto_socks5_set(struct mosquitto *mosq, const char *host, int port, const char *username, const char *password) +{ +#ifdef WITH_SOCKS + if(!mosq) return MOSQ_ERR_INVAL; + if(!host || strlen(host) > 256) return MOSQ_ERR_INVAL; + if(port < 1 || port > 65535) return MOSQ_ERR_INVAL; + + if(mosq->socks5_host){ + _mosquitto_free(mosq->socks5_host); + } + + mosq->socks5_host = _mosquitto_strdup(host); + if(!mosq->socks5_host){ + return MOSQ_ERR_NOMEM; + } + + mosq->socks5_port = port; + + if(mosq->socks5_username){ + _mosquitto_free(mosq->socks5_username); + } + if(mosq->socks5_password){ + _mosquitto_free(mosq->socks5_password); + } + + if(username){ + mosq->socks5_username = _mosquitto_strdup(username); + if(!mosq->socks5_username){ + return MOSQ_ERR_NOMEM; + } + + if(password){ + mosq->socks5_password = _mosquitto_strdup(password); + if(!mosq->socks5_password){ + _mosquitto_free(mosq->socks5_username); + return MOSQ_ERR_NOMEM; + } + } + } + + return MOSQ_ERR_SUCCESS; +#else + return MOSQ_ERR_NOT_SUPPORTED; +#endif +} + +#ifdef WITH_SOCKS +int mosquitto__socks5_send(struct mosquitto *mosq) +{ + struct _mosquitto_packet *packet; + int slen; + int ulen, plen; + + if(mosq->state == mosq_cs_socks5_new){ + packet = _mosquitto_calloc(1, sizeof(struct _mosquitto_packet)); + if(!packet) return MOSQ_ERR_NOMEM; + + if(mosq->socks5_username){ + packet->packet_length = 4; + }else{ + packet->packet_length = 3; + } + packet->payload = _mosquitto_malloc(sizeof(uint8_t)*packet->packet_length); + + packet->payload[0] = 0x05; + if(mosq->socks5_username){ + packet->payload[1] = 2; + packet->payload[2] = SOCKS_AUTH_NONE; + packet->payload[3] = SOCKS_AUTH_USERPASS; + }else{ + packet->payload[1] = 1; + packet->payload[2] = SOCKS_AUTH_NONE; + } + + pthread_mutex_lock(&mosq->state_mutex); + mosq->state = mosq_cs_socks5_start; + pthread_mutex_unlock(&mosq->state_mutex); + + mosq->in_packet.pos = 0; + mosq->in_packet.packet_length = 2; + mosq->in_packet.to_process = 2; + mosq->in_packet.payload = _mosquitto_malloc(sizeof(uint8_t)*2); + if(!mosq->in_packet.payload){ + _mosquitto_free(packet->payload); + _mosquitto_free(packet); + return MOSQ_ERR_NOMEM; + } + + return _mosquitto_packet_queue(mosq, packet); + }else if(mosq->state == mosq_cs_socks5_auth_ok){ + packet = _mosquitto_calloc(1, sizeof(struct _mosquitto_packet)); + if(!packet) return MOSQ_ERR_NOMEM; + + packet->packet_length = 7+strlen(mosq->host); + packet->payload = _mosquitto_malloc(sizeof(uint8_t)*packet->packet_length); + + slen = strlen(mosq->host); + + packet->payload[0] = 0x05; + packet->payload[1] = 1; + packet->payload[2] = 0; + packet->payload[3] = SOCKS_ATYPE_DOMAINNAME; + packet->payload[4] = slen; + memcpy(&(packet->payload[5]), mosq->host, slen); + packet->payload[5+slen] = MOSQ_MSB(mosq->port); + packet->payload[6+slen] = MOSQ_LSB(mosq->port); + + pthread_mutex_lock(&mosq->state_mutex); + mosq->state = mosq_cs_socks5_request; + pthread_mutex_unlock(&mosq->state_mutex); + + mosq->in_packet.pos = 0; + mosq->in_packet.packet_length = 5; + mosq->in_packet.to_process = 5; + mosq->in_packet.payload = _mosquitto_malloc(sizeof(uint8_t)*5); + if(!mosq->in_packet.payload){ + _mosquitto_free(packet->payload); + _mosquitto_free(packet); + return MOSQ_ERR_NOMEM; + } + + return _mosquitto_packet_queue(mosq, packet); + }else if(mosq->state == mosq_cs_socks5_send_userpass){ + packet = _mosquitto_calloc(1, sizeof(struct _mosquitto_packet)); + if(!packet) return MOSQ_ERR_NOMEM; + + ulen = strlen(mosq->socks5_username); + plen = strlen(mosq->socks5_password); + packet->packet_length = 3 + ulen + plen; + packet->payload = _mosquitto_malloc(sizeof(uint8_t)*packet->packet_length); + + + packet->payload[0] = 0x01; + packet->payload[1] = ulen; + memcpy(&(packet->payload[2]), mosq->socks5_username, ulen); + packet->payload[2+ulen] = plen; + memcpy(&(packet->payload[3+ulen]), mosq->socks5_password, plen); + + pthread_mutex_lock(&mosq->state_mutex); + mosq->state = mosq_cs_socks5_userpass_reply; + pthread_mutex_unlock(&mosq->state_mutex); + + mosq->in_packet.pos = 0; + mosq->in_packet.packet_length = 2; + mosq->in_packet.to_process = 2; + mosq->in_packet.payload = _mosquitto_malloc(sizeof(uint8_t)*2); + if(!mosq->in_packet.payload){ + _mosquitto_free(packet->payload); + _mosquitto_free(packet); + return MOSQ_ERR_NOMEM; + } + + return _mosquitto_packet_queue(mosq, packet); + } + return MOSQ_ERR_SUCCESS; +} + +int mosquitto__socks5_read(struct mosquitto *mosq) +{ + ssize_t len; + uint8_t *payload; + uint8_t i; + + if(mosq->state == mosq_cs_socks5_start){ + while(mosq->in_packet.to_process > 0){ + len = _mosquitto_net_read(mosq, &(mosq->in_packet.payload[mosq->in_packet.pos]), mosq->in_packet.to_process); + if(len > 0){ + mosq->in_packet.pos += len; + mosq->in_packet.to_process -= len; + }else{ +#ifdef WIN32 + errno = WSAGetLastError(); +#endif + if(errno == EAGAIN || errno == COMPAT_EWOULDBLOCK){ + return MOSQ_ERR_SUCCESS; + }else{ + _mosquitto_packet_cleanup(&mosq->in_packet); + switch(errno){ + case 0: + return MOSQ_ERR_PROXY; + case COMPAT_ECONNRESET: + return MOSQ_ERR_CONN_LOST; + default: + return MOSQ_ERR_ERRNO; + } + } + } + } + if(mosq->in_packet.payload[0] != 5){ + _mosquitto_packet_cleanup(&mosq->in_packet); + return MOSQ_ERR_PROXY; + } + switch(mosq->in_packet.payload[1]){ + case SOCKS_AUTH_NONE: + _mosquitto_packet_cleanup(&mosq->in_packet); + mosq->state = mosq_cs_socks5_auth_ok; + return mosquitto__socks5_send(mosq); + case SOCKS_AUTH_USERPASS: + _mosquitto_packet_cleanup(&mosq->in_packet); + mosq->state = mosq_cs_socks5_send_userpass; + return mosquitto__socks5_send(mosq); + default: + _mosquitto_packet_cleanup(&mosq->in_packet); + return MOSQ_ERR_AUTH; + } + }else if(mosq->state == mosq_cs_socks5_userpass_reply){ + while(mosq->in_packet.to_process > 0){ + len = _mosquitto_net_read(mosq, &(mosq->in_packet.payload[mosq->in_packet.pos]), mosq->in_packet.to_process); + if(len > 0){ + mosq->in_packet.pos += len; + mosq->in_packet.to_process -= len; + }else{ +#ifdef WIN32 + errno = WSAGetLastError(); +#endif + if(errno == EAGAIN || errno == COMPAT_EWOULDBLOCK){ + return MOSQ_ERR_SUCCESS; + }else{ + _mosquitto_packet_cleanup(&mosq->in_packet); + switch(errno){ + case 0: + return MOSQ_ERR_PROXY; + case COMPAT_ECONNRESET: + return MOSQ_ERR_CONN_LOST; + default: + return MOSQ_ERR_ERRNO; + } + } + } + } + if(mosq->in_packet.payload[0] != 1){ + _mosquitto_packet_cleanup(&mosq->in_packet); + return MOSQ_ERR_PROXY; + } + if(mosq->in_packet.payload[1] == 0){ + _mosquitto_packet_cleanup(&mosq->in_packet); + mosq->state = mosq_cs_socks5_auth_ok; + return mosquitto__socks5_send(mosq); + }else{ + i = mosq->in_packet.payload[1]; + _mosquitto_packet_cleanup(&mosq->in_packet); + switch(i){ + case SOCKS_REPLY_CONNECTION_NOT_ALLOWED: + return MOSQ_ERR_AUTH; + + case SOCKS_REPLY_NETWORK_UNREACHABLE: + case SOCKS_REPLY_HOST_UNREACHABLE: + case SOCKS_REPLY_CONNECTION_REFUSED: + return MOSQ_ERR_NO_CONN; + + case SOCKS_REPLY_GENERAL_FAILURE: + case SOCKS_REPLY_TTL_EXPIRED: + case SOCKS_REPLY_COMMAND_NOT_SUPPORTED: + case SOCKS_REPLY_ADDRESS_TYPE_NOT_SUPPORTED: + return MOSQ_ERR_PROXY; + + default: + return MOSQ_ERR_INVAL; + } + return MOSQ_ERR_PROXY; + } + }else if(mosq->state == mosq_cs_socks5_request){ + while(mosq->in_packet.to_process > 0){ + len = _mosquitto_net_read(mosq, &(mosq->in_packet.payload[mosq->in_packet.pos]), mosq->in_packet.to_process); + if(len > 0){ + mosq->in_packet.pos += len; + mosq->in_packet.to_process -= len; + }else{ +#ifdef WIN32 + errno = WSAGetLastError(); +#endif + if(errno == EAGAIN || errno == COMPAT_EWOULDBLOCK){ + return MOSQ_ERR_SUCCESS; + }else{ + _mosquitto_packet_cleanup(&mosq->in_packet); + switch(errno){ + case 0: + return MOSQ_ERR_PROXY; + case COMPAT_ECONNRESET: + return MOSQ_ERR_CONN_LOST; + default: + return MOSQ_ERR_ERRNO; + } + } + } + } + + if(mosq->in_packet.packet_length == 5){ + /* First part of the packet has been received, we now know what else to expect. */ + if(mosq->in_packet.payload[3] == SOCKS_ATYPE_IP_V4){ + mosq->in_packet.to_process += 4+2-1; /* 4 bytes IPv4, 2 bytes port, -1 byte because we've already read the first byte */ + mosq->in_packet.packet_length += 4+2-1; + }else if(mosq->in_packet.payload[3] == SOCKS_ATYPE_IP_V6){ + mosq->in_packet.to_process += 16+2-1; /* 16 bytes IPv6, 2 bytes port, -1 byte because we've already read the first byte */ + mosq->in_packet.packet_length += 16+2-1; + }else if(mosq->in_packet.payload[3] == SOCKS_ATYPE_DOMAINNAME){ + if(mosq->in_packet.payload[4] > 0 && mosq->in_packet.payload[4] <= 255){ + mosq->in_packet.to_process += mosq->in_packet.payload[4]; + mosq->in_packet.packet_length += mosq->in_packet.payload[4]; + } + }else{ + _mosquitto_packet_cleanup(&mosq->in_packet); + return MOSQ_ERR_PROTOCOL; + } + payload = _mosquitto_realloc(mosq->in_packet.payload, mosq->in_packet.packet_length); + if(payload){ + mosq->in_packet.payload = payload; + }else{ + _mosquitto_packet_cleanup(&mosq->in_packet); + return MOSQ_ERR_NOMEM; + } + return MOSQ_ERR_SUCCESS; + } + + /* Entire packet is now read. */ + if(mosq->in_packet.payload[0] != 5){ + _mosquitto_packet_cleanup(&mosq->in_packet); + return MOSQ_ERR_PROXY; + } + if(mosq->in_packet.payload[1] == 0){ + /* Auth passed */ + _mosquitto_packet_cleanup(&mosq->in_packet); + mosq->state = mosq_cs_new; + return _mosquitto_send_connect(mosq, mosq->keepalive, mosq->clean_session); + }else{ + i = mosq->in_packet.payload[1]; + _mosquitto_packet_cleanup(&mosq->in_packet); + mosq->state = mosq_cs_socks5_new; + switch(i){ + case SOCKS_REPLY_CONNECTION_NOT_ALLOWED: + return MOSQ_ERR_AUTH; + + case SOCKS_REPLY_NETWORK_UNREACHABLE: + case SOCKS_REPLY_HOST_UNREACHABLE: + case SOCKS_REPLY_CONNECTION_REFUSED: + return MOSQ_ERR_NO_CONN; + + case SOCKS_REPLY_GENERAL_FAILURE: + case SOCKS_REPLY_TTL_EXPIRED: + case SOCKS_REPLY_COMMAND_NOT_SUPPORTED: + case SOCKS_REPLY_ADDRESS_TYPE_NOT_SUPPORTED: + return MOSQ_ERR_PROXY; + + default: + return MOSQ_ERR_INVAL; + } + } + }else{ + return _mosquitto_packet_read(mosq); + } + return MOSQ_ERR_SUCCESS; +} +#endif diff --git a/src/libs/mosquitto/lib/socks_mosq.h b/src/libs/mosquitto/lib/socks_mosq.h new file mode 100644 index 0000000..f3f0683 --- /dev/null +++ b/src/libs/mosquitto/lib/socks_mosq.h @@ -0,0 +1,23 @@ +/* +Copyright (c) 2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#ifndef SOCKS_MOSQ_H +#define SOCKS_MOSQ_H + +int mosquitto__socks5_send(struct mosquitto *mosq); +int mosquitto__socks5_read(struct mosquitto *mosq); + +#endif diff --git a/src/libs/mosquitto/lib/srv_mosq.c b/src/libs/mosquitto/lib/srv_mosq.c new file mode 100644 index 0000000..b6f2e46 --- /dev/null +++ b/src/libs/mosquitto/lib/srv_mosq.c @@ -0,0 +1,100 @@ +/* +Copyright (c) 2013,2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#ifdef WITH_SRV +# include + +# include +# include +# include +#endif + +#include "logging_mosq.h" +#include "memory_mosq.h" +#include "mosquitto_internal.h" +#include "mosquitto.h" + +#ifdef WITH_SRV +static void srv_callback(void *arg, int status, int timeouts, unsigned char *abuf, int alen) +{ + struct mosquitto *mosq = arg; + struct ares_srv_reply *reply = NULL; + if(status == ARES_SUCCESS){ + status = ares_parse_srv_reply(abuf, alen, &reply); + if(status == ARES_SUCCESS){ + // FIXME - choose which answer to use based on rfc2782 page 3. */ + mosquitto_connect(mosq, reply->host, reply->port, mosq->keepalive); + } + }else{ + _mosquitto_log_printf(mosq, MOSQ_LOG_ERR, "Error: SRV lookup failed (%d).", status); + /* FIXME - calling on_disconnect here isn't correct. */ + pthread_mutex_lock(&mosq->callback_mutex); + if(mosq->on_disconnect){ + mosq->in_callback = true; + mosq->on_disconnect(mosq, mosq->userdata, 2); + mosq->in_callback = false; + } + pthread_mutex_unlock(&mosq->callback_mutex); + } +} +#endif + +int mosquitto_connect_srv(struct mosquitto *mosq, const char *host, int keepalive, const char *bind_address) +{ +#ifdef WITH_SRV + char *h; + int rc; + if(!mosq) return MOSQ_ERR_INVAL; + + rc = ares_init(&mosq->achan); + if(rc != ARES_SUCCESS){ + return MOSQ_ERR_UNKNOWN; + } + + if(!host){ + // get local domain + }else{ +#ifdef WITH_TLS + if(mosq->tls_cafile || mosq->tls_capath || mosq->tls_psk){ + h = _mosquitto_malloc(strlen(host) + strlen("_secure-mqtt._tcp.") + 1); + if(!h) return MOSQ_ERR_NOMEM; + sprintf(h, "_secure-mqtt._tcp.%s", host); + }else{ +#endif + h = _mosquitto_malloc(strlen(host) + strlen("_mqtt._tcp.") + 1); + if(!h) return MOSQ_ERR_NOMEM; + sprintf(h, "_mqtt._tcp.%s", host); +#ifdef WITH_TLS + } +#endif + ares_search(mosq->achan, h, ns_c_in, ns_t_srv, srv_callback, mosq); + _mosquitto_free(h); + } + + pthread_mutex_lock(&mosq->state_mutex); + mosq->state = mosq_cs_connect_srv; + pthread_mutex_unlock(&mosq->state_mutex); + + mosq->keepalive = keepalive; + + return MOSQ_ERR_SUCCESS; + +#else + return MOSQ_ERR_NOT_SUPPORTED; +#endif +} + + diff --git a/src/libs/mosquitto/lib/thread_mosq.c b/src/libs/mosquitto/lib/thread_mosq.c new file mode 100644 index 0000000..93c5b63 --- /dev/null +++ b/src/libs/mosquitto/lib/thread_mosq.c @@ -0,0 +1,116 @@ +/* +Copyright (c) 2011-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include + +#ifndef WIN32 +#include +#endif + +#include +#include + +void *_mosquitto_thread_main(void *obj); + +int mosquitto_loop_start(struct mosquitto *mosq) +{ +#ifdef WITH_THREADING + if(!mosq || mosq->threaded != mosq_ts_none) return MOSQ_ERR_INVAL; + + mosq->threaded = mosq_ts_self; + if(!pthread_create(&mosq->thread_id, NULL, _mosquitto_thread_main, mosq)){ + return MOSQ_ERR_SUCCESS; + }else{ + return MOSQ_ERR_ERRNO; + } +#else + return MOSQ_ERR_NOT_SUPPORTED; +#endif +} + +int mosquitto_loop_stop(struct mosquitto *mosq, bool force) +{ +#ifdef WITH_THREADING +# ifndef WITH_BROKER + char sockpair_data = 0; +# endif + + if(!mosq || mosq->threaded != mosq_ts_self) return MOSQ_ERR_INVAL; + + + /* Write a single byte to sockpairW (connected to sockpairR) to break out + * of select() if in threaded mode. */ + if(mosq->sockpairW != INVALID_SOCKET){ +#ifndef WIN32 + if(write(mosq->sockpairW, &sockpair_data, 1)){ + } +#else + send(mosq->sockpairW, &sockpair_data, 1, 0); +#endif + } + + if(force){ + pthread_cancel(mosq->thread_id); + } + pthread_join(mosq->thread_id, NULL); + mosq->thread_id = pthread_self(); + mosq->threaded = mosq_ts_none; + + return MOSQ_ERR_SUCCESS; +#else + return MOSQ_ERR_NOT_SUPPORTED; +#endif +} + +#ifdef WITH_THREADING +void *_mosquitto_thread_main(void *obj) +{ + struct mosquitto *mosq = obj; + + if(!mosq) return NULL; + + pthread_mutex_lock(&mosq->state_mutex); + if(mosq->state == mosq_cs_connect_async){ + pthread_mutex_unlock(&mosq->state_mutex); + mosquitto_reconnect(mosq); + }else{ + pthread_mutex_unlock(&mosq->state_mutex); + } + + if(!mosq->keepalive){ + /* Sleep for a day if keepalive disabled. */ + mosquitto_loop_forever(mosq, 1000*86400, 1); + }else{ + /* Sleep for our keepalive value. publish() etc. will wake us up. */ + mosquitto_loop_forever(mosq, mosq->keepalive*1000, 1); + } + + return obj; +} +#endif + +int mosquitto_threaded_set(struct mosquitto *mosq, bool threaded) +{ + if(!mosq) return MOSQ_ERR_INVAL; + + if(threaded){ + mosq->threaded = mosq_ts_external; + }else{ + mosq->threaded = mosq_ts_none; + } + + return MOSQ_ERR_SUCCESS; +} diff --git a/src/libs/mosquitto/lib/time_mosq.c b/src/libs/mosquitto/lib/time_mosq.c new file mode 100644 index 0000000..0f85bbc --- /dev/null +++ b/src/libs/mosquitto/lib/time_mosq.c @@ -0,0 +1,82 @@ +/* +Copyright (c) 2013,2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#ifdef __APPLE__ +#include +#include +#endif + +#ifdef WIN32 +# define _WIN32_WINNT _WIN32_WINNT_VISTA +# include +#else +# include +#endif +#include + +#include "mosquitto.h" +#include "time_mosq.h" + +#ifdef WIN32 +static bool tick64 = false; + +void _windows_time_version_check(void) +{ + OSVERSIONINFO vi; + + tick64 = false; + + memset(&vi, 0, sizeof(OSVERSIONINFO)); + vi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + if(GetVersionEx(&vi)){ + if(vi.dwMajorVersion > 5){ + tick64 = true; + } + } +} +#endif + +time_t mosquitto_time(void) +{ +#ifdef WIN32 + if(tick64){ + return GetTickCount64()/1000; + }else{ + return GetTickCount()/1000; /* FIXME - need to deal with overflow. */ + } +#elif _POSIX_TIMERS>0 && defined(_POSIX_MONOTONIC_CLOCK) + struct timespec tp; + + clock_gettime(CLOCK_MONOTONIC, &tp); + return tp.tv_sec; +#elif defined(__APPLE__) + static mach_timebase_info_data_t tb; + uint64_t ticks; + uint64_t sec; + + ticks = mach_absolute_time(); + + if(tb.denom == 0){ + mach_timebase_info(&tb); + } + sec = ticks*tb.numer/tb.denom/1000000000; + + return (time_t)sec; +#else + return time(NULL); +#endif +} + diff --git a/src/libs/mosquitto/lib/time_mosq.h b/src/libs/mosquitto/lib/time_mosq.h new file mode 100644 index 0000000..106279c --- /dev/null +++ b/src/libs/mosquitto/lib/time_mosq.h @@ -0,0 +1,22 @@ +/* +Copyright (c) 2013,2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#ifndef _TIME_MOSQ_H_ +#define _TIME_MOSQ_H_ + +time_t mosquitto_time(void); + +#endif diff --git a/src/libs/mosquitto/lib/tls_mosq.c b/src/libs/mosquitto/lib/tls_mosq.c new file mode 100644 index 0000000..20f0d3a --- /dev/null +++ b/src/libs/mosquitto/lib/tls_mosq.c @@ -0,0 +1,167 @@ +/* +Copyright (c) 2013,2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#ifdef WITH_TLS + +#ifdef WIN32 +# include +# include +#else +# include +# include +#endif + +#include +#include +#include +#include + +#ifdef WITH_BROKER +# include "mosquitto_broker.h" +#endif +#include "mosquitto_internal.h" +#include "tls_mosq.h" + +extern int tls_ex_index_mosq; + +int _mosquitto_server_certificate_verify(int preverify_ok, X509_STORE_CTX *ctx) +{ + /* Preverify should have already checked expiry, revocation. + * We need to verify the hostname. */ + struct mosquitto *mosq; + SSL *ssl; + X509 *cert; + + /* Always reject if preverify_ok has failed. */ + if(!preverify_ok) return 0; + + ssl = X509_STORE_CTX_get_ex_data(ctx, SSL_get_ex_data_X509_STORE_CTX_idx()); + mosq = SSL_get_ex_data(ssl, tls_ex_index_mosq); + if(!mosq) return 0; + + if(mosq->tls_insecure == false){ + if(X509_STORE_CTX_get_error_depth(ctx) == 0){ + /* FIXME - use X509_check_host() etc. for sufficiently new openssl (>=1.1.x) */ + cert = X509_STORE_CTX_get_current_cert(ctx); + /* This is the peer certificate, all others are upwards in the chain. */ +#if defined(WITH_BROKER) + return _mosquitto_verify_certificate_hostname(cert, mosq->bridge->addresses[mosq->bridge->cur_address].address); +#else + return _mosquitto_verify_certificate_hostname(cert, mosq->host); +#endif + }else{ + return preverify_ok; + } + }else{ + return preverify_ok; + } +} + +int mosquitto__cmp_hostname_wildcard(char *certname, const char *hostname) +{ + int i; + int len; + + if(!certname || !hostname){ + return 1; + } + + if(certname[0] == '*'){ + if(certname[1] != '.'){ + return 1; + } + certname += 2; + len = strlen(hostname); + for(i=0; itype == GEN_DNS){ + data = ASN1_STRING_data(nval->d.dNSName); + if(data && !mosquitto__cmp_hostname_wildcard((char *)data, hostname)){ + sk_GENERAL_NAME_pop_free(san, GENERAL_NAME_free); + return 1; + } + have_san_dns = true; + }else if(nval->type == GEN_IPADD){ + data = ASN1_STRING_data(nval->d.iPAddress); + if(nval->d.iPAddress->length == 4 && ipv4_ok){ + if(!memcmp(ipv4_addr, data, 4)){ + sk_GENERAL_NAME_pop_free(san, GENERAL_NAME_free); + return 1; + } + }else if(nval->d.iPAddress->length == 16 && ipv6_ok){ + if(!memcmp(ipv6_addr, data, 16)){ + sk_GENERAL_NAME_pop_free(san, GENERAL_NAME_free); + return 1; + } + } + } + } + sk_GENERAL_NAME_pop_free(san, GENERAL_NAME_free); + if(have_san_dns){ + /* Only check CN if subjectAltName DNS entry does not exist. */ + return 0; + } + } + + subj = X509_get_subject_name(cert); + if(X509_NAME_get_text_by_NID(subj, NID_commonName, name, sizeof(name)) > 0){ + name[sizeof(name) - 1] = '\0'; + if (!mosquitto__cmp_hostname_wildcard(name, hostname)) return 1; + } + return 0; +} + +#endif + diff --git a/src/libs/mosquitto/lib/tls_mosq.h b/src/libs/mosquitto/lib/tls_mosq.h new file mode 100644 index 0000000..c1d3803 --- /dev/null +++ b/src/libs/mosquitto/lib/tls_mosq.h @@ -0,0 +1,42 @@ +/* +Copyright (c) 2013,2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#ifndef _TLS_MOSQ_H_ +#define _TLS_MOSQ_H_ + +#ifdef WITH_TLS +# define SSL_DATA_PENDING(A) ((A)->ssl && SSL_pending((A)->ssl)) +#else +# define SSL_DATA_PENDING(A) 0 +#endif + +#ifdef WITH_TLS + +#include +#ifdef WITH_TLS_PSK +# if OPENSSL_VERSION_NUMBER >= 0x10000000 +# define REAL_WITH_TLS_PSK +# else +# warning "TLS-PSK not supported, openssl too old." +# endif +#endif + +int _mosquitto_server_certificate_verify(int preverify_ok, X509_STORE_CTX *ctx); +int _mosquitto_verify_certificate_hostname(X509 *cert, const char *hostname); + +#endif /* WITH_TLS */ + +#endif diff --git a/src/libs/mosquitto/lib/util_mosq.c b/src/libs/mosquitto/lib/util_mosq.c new file mode 100644 index 0000000..6f6bb49 --- /dev/null +++ b/src/libs/mosquitto/lib/util_mosq.c @@ -0,0 +1,420 @@ +/* +Copyright (c) 2009-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include +#include + +#ifdef WIN32 +# include +# include +# include +# include +#else +# include +#endif + + +#include +#include +#include +#include +#include +#include +#include + +#ifdef WITH_BROKER +#include +#endif + +#ifdef WITH_WEBSOCKETS +#include +#endif + +int _mosquitto_packet_alloc(struct _mosquitto_packet *packet) +{ + uint8_t remaining_bytes[5], byte; + uint32_t remaining_length; + int i; + + assert(packet); + + remaining_length = packet->remaining_length; + packet->payload = NULL; + packet->remaining_count = 0; + do{ + byte = remaining_length % 128; + remaining_length = remaining_length / 128; + /* If there are more digits to encode, set the top bit of this digit */ + if(remaining_length > 0){ + byte = byte | 0x80; + } + remaining_bytes[packet->remaining_count] = byte; + packet->remaining_count++; + }while(remaining_length > 0 && packet->remaining_count < 5); + if(packet->remaining_count == 5) return MOSQ_ERR_PAYLOAD_SIZE; + packet->packet_length = packet->remaining_length + 1 + packet->remaining_count; +#ifdef WITH_WEBSOCKETS + packet->payload = _mosquitto_malloc(sizeof(uint8_t)*packet->packet_length + LWS_SEND_BUFFER_PRE_PADDING + LWS_SEND_BUFFER_POST_PADDING); +#else + packet->payload = _mosquitto_malloc(sizeof(uint8_t)*packet->packet_length); +#endif + if(!packet->payload) return MOSQ_ERR_NOMEM; + + packet->payload[0] = packet->command; + for(i=0; iremaining_count; i++){ + packet->payload[i+1] = remaining_bytes[i]; + } + packet->pos = 1 + packet->remaining_count; + + return MOSQ_ERR_SUCCESS; +} + +#ifdef WITH_BROKER +void _mosquitto_check_keepalive(struct mosquitto_db *db, struct mosquitto *mosq) +#else +void _mosquitto_check_keepalive(struct mosquitto *mosq) +#endif +{ + time_t next_msg_out; + time_t last_msg_in; + time_t now = mosquitto_time(); +#ifndef WITH_BROKER + int rc; +#endif + + assert(mosq); +#if defined(WITH_BROKER) && defined(WITH_BRIDGE) + /* Check if a lazy bridge should be timed out due to idle. */ + if(mosq->bridge && mosq->bridge->start_type == bst_lazy + && mosq->sock != INVALID_SOCKET + && now - mosq->next_msg_out - mosq->keepalive >= mosq->bridge->idle_timeout){ + + _mosquitto_log_printf(NULL, MOSQ_LOG_NOTICE, "Bridge connection %s has exceeded idle timeout, disconnecting.", mosq->id); + _mosquitto_socket_close(db, mosq); + return; + } +#endif + pthread_mutex_lock(&mosq->msgtime_mutex); + next_msg_out = mosq->next_msg_out; + last_msg_in = mosq->last_msg_in; + pthread_mutex_unlock(&mosq->msgtime_mutex); + if(mosq->keepalive && mosq->sock != INVALID_SOCKET && + (now >= next_msg_out || now - last_msg_in >= mosq->keepalive)){ + + if(mosq->state == mosq_cs_connected && mosq->ping_t == 0){ + _mosquitto_send_pingreq(mosq); + /* Reset last msg times to give the server time to send a pingresp */ + pthread_mutex_lock(&mosq->msgtime_mutex); + mosq->last_msg_in = now; + mosq->next_msg_out = now + mosq->keepalive; + pthread_mutex_unlock(&mosq->msgtime_mutex); + }else{ +#ifdef WITH_BROKER + if(mosq->listener){ + mosq->listener->client_count--; + assert(mosq->listener->client_count >= 0); + } + mosq->listener = NULL; + _mosquitto_socket_close(db, mosq); +#else + _mosquitto_socket_close(mosq); + pthread_mutex_lock(&mosq->state_mutex); + if(mosq->state == mosq_cs_disconnecting){ + rc = MOSQ_ERR_SUCCESS; + }else{ + rc = 1; + } + pthread_mutex_unlock(&mosq->state_mutex); + pthread_mutex_lock(&mosq->callback_mutex); + if(mosq->on_disconnect){ + mosq->in_callback = true; + mosq->on_disconnect(mosq, mosq->userdata, rc); + mosq->in_callback = false; + } + pthread_mutex_unlock(&mosq->callback_mutex); +#endif + } + } +} + +uint16_t _mosquitto_mid_generate(struct mosquitto *mosq) +{ + /* FIXME - this would be better with atomic increment, but this is safer + * for now for a bug fix release. + * + * If this is changed to use atomic increment, callers of this function + * will have to be aware that they may receive a 0 result, which may not be + * used as a mid. + */ + uint16_t mid; + assert(mosq); + + pthread_mutex_lock(&mosq->mid_mutex); + mosq->last_mid++; + if(mosq->last_mid == 0) mosq->last_mid++; + mid = mosq->last_mid; + pthread_mutex_unlock(&mosq->mid_mutex); + + return mid; +} + +/* Check that a topic used for publishing is valid. + * Search for + or # in a topic. Return MOSQ_ERR_INVAL if found. + * Also returns MOSQ_ERR_INVAL if the topic string is too long. + * Returns MOSQ_ERR_SUCCESS if everything is fine. + */ +int mosquitto_pub_topic_check(const char *str) +{ + int len = 0; + while(str && str[0]){ + if(str[0] == '+' || str[0] == '#'){ + return MOSQ_ERR_INVAL; + } + len++; + str = &str[1]; + } + if(len > 65535) return MOSQ_ERR_INVAL; + + return MOSQ_ERR_SUCCESS; +} + +/* Check that a topic used for subscriptions is valid. + * Search for + or # in a topic, check they aren't in invalid positions such as + * foo/#/bar, foo/+bar or foo/bar#. + * Return MOSQ_ERR_INVAL if invalid position found. + * Also returns MOSQ_ERR_INVAL if the topic string is too long. + * Returns MOSQ_ERR_SUCCESS if everything is fine. + */ +int mosquitto_sub_topic_check(const char *str) +{ + char c = '\0'; + int len = 0; + while(str && str[0]){ + if(str[0] == '+'){ + if((c != '\0' && c != '/') || (str[1] != '\0' && str[1] != '/')){ + return MOSQ_ERR_INVAL; + } + }else if(str[0] == '#'){ + if((c != '\0' && c != '/') || str[1] != '\0'){ + return MOSQ_ERR_INVAL; + } + } + len++; + c = str[0]; + str = &str[1]; + } + if(len > 65535) return MOSQ_ERR_INVAL; + + return MOSQ_ERR_SUCCESS; +} + +/* Does a topic match a subscription? */ +int mosquitto_topic_matches_sub(const char *sub, const char *topic, bool *result) +{ + int slen, tlen; + int spos, tpos; + bool multilevel_wildcard = false; + + if(!sub || !topic || !result) return MOSQ_ERR_INVAL; + + slen = strlen(sub); + tlen = strlen(topic); + + if(!slen || !tlen){ + *result = false; + return MOSQ_ERR_INVAL; + } + + if(slen && tlen){ + if((sub[0] == '$' && topic[0] != '$') + || (topic[0] == '$' && sub[0] != '$')){ + + *result = false; + return MOSQ_ERR_SUCCESS; + } + } + + spos = 0; + tpos = 0; + + while(spos < slen && tpos <= tlen){ + if(sub[spos] == topic[tpos]){ + if(tpos == tlen-1){ + /* Check for e.g. foo matching foo/# */ + if(spos == slen-3 + && sub[spos+1] == '/' + && sub[spos+2] == '#'){ + *result = true; + multilevel_wildcard = true; + return MOSQ_ERR_SUCCESS; + } + } + spos++; + tpos++; + if(spos == slen && tpos == tlen){ + *result = true; + return MOSQ_ERR_SUCCESS; + }else if(tpos == tlen && spos == slen-1 && sub[spos] == '+'){ + if(spos > 0 && sub[spos-1] != '/'){ + *result = false; + return MOSQ_ERR_INVAL; + } + spos++; + *result = true; + return MOSQ_ERR_SUCCESS; + } + }else{ + if(sub[spos] == '+'){ + /* Check for bad "+foo" or "a/+foo" subscription */ + if(spos > 0 && sub[spos-1] != '/'){ + *result = false; + return MOSQ_ERR_INVAL; + } + /* Check for bad "foo+" or "foo+/a" subscription */ + if(spos < slen-1 && sub[spos+1] != '/'){ + *result = false; + return MOSQ_ERR_INVAL; + } + spos++; + while(tpos < tlen && topic[tpos] != '/'){ + tpos++; + } + if(tpos == tlen && spos == slen){ + *result = true; + return MOSQ_ERR_SUCCESS; + } + }else if(sub[spos] == '#'){ + if(spos > 0 && sub[spos-1] != '/'){ + *result = false; + return MOSQ_ERR_INVAL; + } + multilevel_wildcard = true; + if(spos+1 != slen){ + *result = false; + return MOSQ_ERR_INVAL; + }else{ + *result = true; + return MOSQ_ERR_SUCCESS; + } + }else{ + *result = false; + return MOSQ_ERR_SUCCESS; + } + } + } + if(multilevel_wildcard == false && (tpos < tlen || spos < slen)){ + *result = false; + } + + return MOSQ_ERR_SUCCESS; +} + +#ifdef REAL_WITH_TLS_PSK +int _mosquitto_hex2bin(const char *hex, unsigned char *bin, int bin_max_len) +{ + BIGNUM *bn = NULL; + int len; + + if(BN_hex2bn(&bn, hex) == 0){ + if(bn) BN_free(bn); + return 0; + } + if(BN_num_bytes(bn) > bin_max_len){ + BN_free(bn); + return 0; + } + + len = BN_bn2bin(bn, bin); + BN_free(bn); + return len; +} +#endif + +FILE *_mosquitto_fopen(const char *path, const char *mode, bool restrict_read) +{ +#ifdef WIN32 + char buf[4096]; + int rc; + rc = ExpandEnvironmentStrings(path, buf, 4096); + if(rc == 0 || rc > 4096){ + return NULL; + }else{ + if (restrict_read) { + HANDLE hfile; + SECURITY_ATTRIBUTES sec; + EXPLICIT_ACCESS ea; + PACL pacl = NULL; + char username[UNLEN + 1]; + int ulen = UNLEN; + SECURITY_DESCRIPTOR sd; + + GetUserName(username, &ulen); + if (!InitializeSecurityDescriptor(&sd, SECURITY_DESCRIPTOR_REVISION)) { + return NULL; + } + BuildExplicitAccessWithName(&ea, username, GENERIC_ALL, SET_ACCESS, NO_INHERITANCE); + if (SetEntriesInAcl(1, &ea, NULL, &pacl) != ERROR_SUCCESS) { + return NULL; + } + if (!SetSecurityDescriptorDacl(&sd, TRUE, pacl, FALSE)) { + LocalFree(pacl); + return NULL; + } + + sec.nLength = sizeof(SECURITY_ATTRIBUTES); + sec.bInheritHandle = FALSE; + sec.lpSecurityDescriptor = &sd; + + hfile = CreateFile(buf, GENERIC_READ | GENERIC_WRITE, 0, + &sec, + CREATE_NEW, + FILE_ATTRIBUTE_NORMAL, + NULL); + + LocalFree(pacl); + + int fd = _open_osfhandle((intptr_t)hfile, 0); + if (fd < 0) { + return NULL; + } + + FILE *fptr = _fdopen(fd, mode); + if (!fptr) { + _close(fd); + return NULL; + } + return fptr; + + }else { + return fopen(buf, mode); + } + } +#else + if (restrict_read) { + FILE *fptr; + mode_t old_mask; + + old_mask = umask(0077); + fptr = fopen(path, mode); + umask(old_mask); + + return fptr; + }else{ + return fopen(path, mode); + } +#endif +} + diff --git a/src/libs/mosquitto/lib/util_mosq.h b/src/libs/mosquitto/lib/util_mosq.h new file mode 100644 index 0000000..8a8b7b5 --- /dev/null +++ b/src/libs/mosquitto/lib/util_mosq.h @@ -0,0 +1,41 @@ +/* +Copyright (c) 2009-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ +#ifndef _UTIL_MOSQ_H_ +#define _UTIL_MOSQ_H_ + +#include + +#include "tls_mosq.h" +#include "mosquitto.h" +#include "mosquitto_internal.h" +#ifdef WITH_BROKER +# include "mosquitto_broker.h" +#endif + +int _mosquitto_packet_alloc(struct _mosquitto_packet *packet); +#ifdef WITH_BROKER +void _mosquitto_check_keepalive(struct mosquitto_db *db, struct mosquitto *mosq); +#else +void _mosquitto_check_keepalive(struct mosquitto *mosq); +#endif +uint16_t _mosquitto_mid_generate(struct mosquitto *mosq); +FILE *_mosquitto_fopen(const char *path, const char *mode, bool restrict_read); + +#ifdef REAL_WITH_TLS_PSK +int _mosquitto_hex2bin(const char *hex, unsigned char *bin, int bin_max_len); +#endif + +#endif diff --git a/src/libs/mosquitto/lib/will_mosq.c b/src/libs/mosquitto/lib/will_mosq.c new file mode 100644 index 0000000..2155a27 --- /dev/null +++ b/src/libs/mosquitto/lib/will_mosq.c @@ -0,0 +1,101 @@ +/* +Copyright (c) 2010-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include +#include + +#include +#include +#include + +int _mosquitto_will_set(struct mosquitto *mosq, const char *topic, int payloadlen, const void *payload, int qos, bool retain) +{ + int rc = MOSQ_ERR_SUCCESS; + + if(!mosq || !topic) return MOSQ_ERR_INVAL; + if(payloadlen < 0 || payloadlen > MQTT_MAX_PAYLOAD) return MOSQ_ERR_PAYLOAD_SIZE; + if(payloadlen > 0 && !payload) return MOSQ_ERR_INVAL; + + if(mosquitto_pub_topic_check(topic)) return MOSQ_ERR_INVAL; + + if(mosq->will){ + if(mosq->will->topic){ + _mosquitto_free(mosq->will->topic); + mosq->will->topic = NULL; + } + if(mosq->will->payload){ + _mosquitto_free(mosq->will->payload); + mosq->will->payload = NULL; + } + _mosquitto_free(mosq->will); + mosq->will = NULL; + } + + mosq->will = _mosquitto_calloc(1, sizeof(struct mosquitto_message)); + if(!mosq->will) return MOSQ_ERR_NOMEM; + mosq->will->topic = _mosquitto_strdup(topic); + if(!mosq->will->topic){ + rc = MOSQ_ERR_NOMEM; + goto cleanup; + } + mosq->will->payloadlen = payloadlen; + if(mosq->will->payloadlen > 0){ + if(!payload){ + rc = MOSQ_ERR_INVAL; + goto cleanup; + } + mosq->will->payload = _mosquitto_malloc(sizeof(char)*mosq->will->payloadlen); + if(!mosq->will->payload){ + rc = MOSQ_ERR_NOMEM; + goto cleanup; + } + + memcpy(mosq->will->payload, payload, payloadlen); + } + mosq->will->qos = qos; + mosq->will->retain = retain; + + return MOSQ_ERR_SUCCESS; + +cleanup: + if(mosq->will){ + if(mosq->will->topic) _mosquitto_free(mosq->will->topic); + if(mosq->will->payload) _mosquitto_free(mosq->will->payload); + } + _mosquitto_free(mosq->will); + mosq->will = NULL; + + return rc; +} + +int _mosquitto_will_clear(struct mosquitto *mosq) +{ + if(!mosq->will) return MOSQ_ERR_SUCCESS; + + if(mosq->will->topic){ + _mosquitto_free(mosq->will->topic); + mosq->will->topic = NULL; + } + if(mosq->will->payload){ + _mosquitto_free(mosq->will->payload); + mosq->will->payload = NULL; + } + _mosquitto_free(mosq->will); + mosq->will = NULL; + + return MOSQ_ERR_SUCCESS; +} + diff --git a/src/libs/mosquitto/lib/will_mosq.h b/src/libs/mosquitto/lib/will_mosq.h new file mode 100644 index 0000000..66ac9af --- /dev/null +++ b/src/libs/mosquitto/lib/will_mosq.h @@ -0,0 +1,26 @@ +/* +Copyright (c) 2010-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#ifndef _WILL_MOSQ_H_ +#define _WILL_MOSQ_H_ + +#include +#include + +int _mosquitto_will_set(struct mosquitto *mosq, const char *topic, int payloadlen, const void *payload, int qos, bool retain); +int _mosquitto_will_clear(struct mosquitto *mosq); + +#endif diff --git a/src/libs/mosquitto/logo/legacy/mosquitto-14x14.png b/src/libs/mosquitto/logo/legacy/mosquitto-14x14.png new file mode 100644 index 0000000000000000000000000000000000000000..4fcda77a547b3ca994974ce8a20693c87e49e50d GIT binary patch literal 513 zcmV+c0{;DpP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L006iE006iFFyNyM00007bV*G`2iXe= z3I!T|zY#S600DtXL_t(2&$W`R%lc3p#qZrS5b*_!CRuR`zEow^V35J0AQppvh0QM7 zv}h9qSrY~p%Y}uBh(U0I3b!d-HhkN-`~HIPd&(1@@|<)yeBhjLFaV(6NkG4r_+$Eb zJf_pBZQFt%c%IkkbmH;&H)>hd<#LHcBD2}-bUNkp`A{h2`~K_oB7{_{Rq;R9?RF7D z7~^a;! zSS;3Vw-rVCG=B|;!_{h~s;Vf8ilQ*aQmIs_RI+W`aU9b$!{M+j%Lt*bN~I!6lB%lv z{XUb)P)f_?@_M~)Hk-HGjZ(VVYycpa%c0R|1ONb_>pB4VzOUPx#24YJ`L;z3#PykTIhYRok000SaNLh0L007be007bf2AvEY00007bV*G`2iXe= z2|6_R@ra)Q00Fj1L_t(2&$W_2tKv`)#pm9AiJ&CWN(&8WA=p?1t;9+YECj7AY{Wkx zSjJab*jZ>{VQ&@0!Y^Q_`2d0-f<#0FC5>oMRE*xch0EK=vMgBauR1fsDQ3(cWipxVc1tNm-*-r*QV5|) zByv0+{eHjQZWjcB<2Z~l&+|T?4*-4}DwWD^w|nXP{m!y10C>G#x7*G0JOC`0%VaY7 z0RZduda+oX&u5G=Ap`(emgRXq7K@ptsq6afcEcD4gTY3lfljAWKA$&DGn>uM=kwKS zWf;ce@xT}(gd|DI<#M7Z0>EaovDs`tK0iNIRlQs;k|c2)XBbAcS|x-q40AXfbX^~h z$4;kH6h%Q0tX3;_I2;Va)M~XvA~Bgvn$2dn+l@w}01%JI5klANwcTzH27_P0O{Y@; z2#3QKiv<8M#sClq1OOlu3f1d%kH)x^~e;2YW@ArGtG!;cD z7K`b0dN>@yY&QGK>kq^8`TXioN;OT>G!6at=X=}m6Njz-NlRn8LI3~&07*qoM6N<$ Eg3?>(K>z>% literal 0 HcmV?d00001 diff --git a/src/libs/mosquitto/logo/legacy/mosquitto.svg b/src/libs/mosquitto/logo/legacy/mosquitto.svg new file mode 100644 index 0000000..7839c1a --- /dev/null +++ b/src/libs/mosquitto/logo/legacy/mosquitto.svg @@ -0,0 +1,182 @@ + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + diff --git a/src/libs/mosquitto/logo/mosquitto-logo-min.svg b/src/libs/mosquitto/logo/mosquitto-logo-min.svg new file mode 100644 index 0000000..5438312 --- /dev/null +++ b/src/libs/mosquitto/logo/mosquitto-logo-min.svg @@ -0,0 +1,65 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/src/libs/mosquitto/logo/mosquitto-logo-only.svg b/src/libs/mosquitto/logo/mosquitto-logo-only.svg new file mode 100644 index 0000000..e43167d --- /dev/null +++ b/src/libs/mosquitto/logo/mosquitto-logo-only.svg @@ -0,0 +1,60 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/src/libs/mosquitto/logo/mosquitto-text-below.svg b/src/libs/mosquitto/logo/mosquitto-text-below.svg new file mode 100644 index 0000000..ef8c3fc --- /dev/null +++ b/src/libs/mosquitto/logo/mosquitto-text-below.svg @@ -0,0 +1,66 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/src/libs/mosquitto/logo/mosquitto-text-side.svg b/src/libs/mosquitto/logo/mosquitto-text-side.svg new file mode 100644 index 0000000..7f50724 --- /dev/null +++ b/src/libs/mosquitto/logo/mosquitto-text-side.svg @@ -0,0 +1,66 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/src/libs/mosquitto/logo/mosquitto.ico b/src/libs/mosquitto/logo/mosquitto.ico new file mode 100644 index 0000000000000000000000000000000000000000..88c91589f7a95445372e342b4b4b6f72b02338c7 GIT binary patch literal 34572 zcmeFZ2|QKp`v1S#=CLH1LguJYGK(ft86ufO!XqjYGH*$P2oViLA%zSLQpk=>sT2t% zR3aH8^Yp*2p1q&%bIy65GyTr*|N6fE|KoMu&wa1!zOK)8t$VF?ueI0S9Rh)dKu=h* zgaEAw;TJjrVGn^o;N|^w`!q9w@EB|&BEN3m1V0@P0zqD$vMoU%3<*I1{9(NB76Ku0 z8-XAV+u#b8U+vHk2%vLK{8xT%|6lx%px+n)prP=mnMkG@1b|54H$O@|JG97e_P_S0 zY}-L=PU-*jrNoOsi~O`v$0@!TgSpoL#efmu3@in(c0`c^`XM-mKIn@v7#j(M0scS> zkOVACG~nh^IY{2Gas=am;rf!HD%i%e3w$Hp6m5ABz%{0D%cGu zW9Wmv7=y8OfGKbTZ~!2`Iw@ect{>E%f?ywQzmEO%L0^o)*jiu@kOp`FXTnU?;`ZAf zw&6cE(TrdpZ8%2pL0^o)Sk%}B3fM;*j-e0wVhqNv0B!@Z z0M6%H;J5RQ+CdwD#~Xdn7h^CM?V3O#pibGQhW*x3?G&E^XfcLbAMPU?K!dhF`=j`y z5Bg%vpSk|i_Qgd4VIh=2xa$8a3=V%DN<$(L7`q6BnD4)WvAE8_QbmB}=;!(a4S@h_ z*8f}U%+GxPi~a-G8?GDwaNYZNOQz^^K#Tm-GL&-%&o==;gu4CL0u+5wXpz4jrk=0Z zq6TXH-o_5wc#UQN3^?}Je-!gRHg_>yR1D*p{03P5W&<&UXzg?FUeOqXepZYM4@#urT7=y8>fm-zd zYC8hGfC{Dm71}4j7hoTN*E8d3<8>R?dNrRwu#Yy%82X?u#$YV!p%!XlKOZ0i%YjlL z6OaNrfh+*+vB!6*Hf=mql?&uxA8nK|^g&;Y!PpW2V^9;dKLJqyj^jRB0l1#_0h@s% zKs(&G41|1#FCy4S8)XcA&=+Gc7Bx@{HBoyCz;%8LfcvKaga8eI7*Kb7m&#Ed|9KUd z_bvqcXu~mz5Bg%vdH^+03pG)D0l<4c-n(%gG52}kF(3`JMVKh+@Ew~D2JJ-z`)I>4 ziVyl?4Em!6YM~}-PXoUITLH{150HQt0M`E;YCX8Ze@+v$n-T1z4aX=x=!-G9@2G)V zsEOJ*UuS^T0OrQ~?@pi(z5gU7!rW z^A?Z!HGmhWrflPRTnwxN2oyvpHXOqk^u-vAEeB8wHBs9I=m8V~SD+VA1+boe;3mKi zP_?No+Heeg&=+Gc7Bx@{HBnm-cm-Sl@V<=sF}E|MgEcdKOCoA z+ceN3|InY3UkqC0ANv12eaaZFEqefG;O83q_e3fAm7qobp6kywi=v6znB%u~jM|4* z5x{jCpN}MfzpF{fZvZXwcYRTdqKVp=V*|xTt&J77bAfpPpWAS~l?S+h-)jAR5=wqM zXp!F!{p?fYC>nCmq9$r%4$Or)srgNzkIyuC4`Bz^1Mh(A06stbMGZoJ<9O~Po)idz zK0kh|f$9$}-m_5ywNMka9{`vObD}N_fS=VT0Rw;$$OaYxe2%*VhyuUWK*^2y!zlc$ z2MeJ3QDQI_HBbvRQ5$n$F3iaSXaGY1K1(tK`oIM66vzW`zAAxr0P5rQAqCHgW@0|Q zDG2t_Mj1mN^u-vAMGe$KP1MGmm}>~Y+#~?&I|^WI8ZZZ-CO^;wppFxO<9h)-hn|Ta z{ZfcvpJKx?^g&;Y!C2HlE!0c}a2#`CP7+WG;4_dKfXBKWcmr?)X!{P71Nhv6I>SIy zkl9xAm44svA=pP7Wek1L7h^CMHBbvRQ5$ohZ5+Vd_}tq8@B`PEpo%LuSc+tHW))4^g&;Y!C2HlEj$lV8*^Z;P5^Vy0`&l150(JN1Oph8 z1B?Nvtp&h&qaH>Rw#Wc^F9GuuE};#_e)ak3i!m6R4WJfkqBiEhT$mGcqpbqKH4oP( z+&%=*0XRSSOezA{0JHG!(TpQ#Q3UdK13y0(VIOTchCUQujKNscKrPfnZOnnWFeh#! z)c_OVK-oSDEiG^#7z88%V_+8EJ37;m7MDQIn&0KGK^u;t55*U+2aH7x)Iv?nWe;F3 z%!%70z*~R|!0Q9g+gJeSES|Ex16nZvk5|ztV|jLX52^;+zr40AOm2{{XjXu2v`6Mz(oM(EDgY#kHcqmx}|}OLs`eF>m zq6TWACTe32%!N5I_Z0x^v;xqt3>XF!0UiK-z5xM1D}WmN0Gw0YF9iE&!!h(hUyQ+6 z)IcrNL~YE0xiBZ@wghlJP6beldY;6POx1AP0hj=AU%G%@0Iq?5z22h@$Iu6TF~%YE zS546RId6w3+n5V;Vs5+^u}(a;s{sL^3BY~X1mIj^{A*w{fHnP=o7$n;DL${D#Tbl5 z4b(zS)W#f`3v*&_)WiA0<9dd&?Fj7@PzB(*gy)tp@Q1nopa%5C7>q>?)Iv>+#~hdo zbNW8fpfXAd7 zz~=+(-v9)GpML)+FLj*iPl?Th7PU|lwXu)6e$%A%nW4P|;6Bd)c-<}qe)FU1|1&K$ zj-r8DsEOK`19Sa_3~mE_z%Af7zzY0@&%d*Q8WgQCXi*z;{EZaaC~!cF*XZB){JRE< zE^4Cozcru#Ztnla{rwq$cM$*cw-CCx2=p$5_I_Rnt*KlHtt2gk(vU(zXb78v;0t6X z_+FZc2^DGK)dE6Q|E&*S3N0m)PZKyt2&aXomXbmjXvm=pMDpSy@#Es+sjO zp+){332Mz)1J;5y{pm9rbqrekOxF$!18%_2&x8MJ0hIdfp+)}HaBA(C8*9K?uqLeS z5BGs$Uj}UvfY0Md6!32y14{izphf=O`Y|`wK&=OB!*>LKp@-WPjzT*Jp#MXF2f#7> z%)o~INWJxc5&K6QE1_OW{o&9ezrDx&BmdvqDETng&(A5)t^ghZSQFNUHU7mhplq*( z7LO77^#JMs`Y`|zz%}6KXB23EpYm_|)Ow-4K;a+OkD3%P2j;?@m>ca_3)Y0SVU1Yp z&%D?IG{6}E$B}RVZ8)|E7zNON4-f}_=K7n$DF#aY_}idN3fTWM_n%r6O)+Ti0+R?zZ2AWiWa^H!u*&6b74;04hE=oVr^(cux7O5wekQ!8@?A+ z0MIT1v;t_y{oMuN^-qoOfW8Uv`{PIt+v;Ja>SqsH+3yiJHc^jYA8j}Wpbxbkj71I9 zqUvG}%!N78hI5X!U<}rVHKHAB#@caB?FGU zV=I7jz#!B*d%$}CVg6&2Z-Hj)qYcL>KIn@v7>gQIJ=De=IEFdVjx}H{Xv5m5*9TtD zSi3ub+UQGNoA8}P0mar2trCFo0>EnkeQ_Q%0krc1dBD%}3*I+(+BlGGVeY#S=;QBV zJ7FB-&%h-)0ahe8|9Ro+Px1$nWfJ@Rnw_aoRx8;((Y&=+Gc7Bx@{ZK&-4 zU@pvwxzUcbU`=Sp8nITirvc9>ee_ucppPCf37}5|fHped27orazBB-|Z>4ObJsaRw zJXDM8y*e;PK^<*4M)9F)U@Y2E3pLS>IWQO6F*n+<7OV+vSYsD}_Bx=4(#QQ+0-z5b z7aYg=vsXB6|7wtxCJawz`ih!p$~w*sFQ@hQ-T(?P!nyK zg9ku6=EfS(egL5QQs*3Nr_OUR^r`1qIP@_FkCQflak4-kfc9$u+PHw{0NSp@@7HO0 z{bv}V)@uOuJ0NO%jn{vc@q)o}BKlHdFcvjv0MtYs%z?R3A9LgPacIYy(8dH{t!TsA ze_nIY<^$B@77KkG$78ApV4Ny23ZVTgfHqO!BY-wPOUDSDdnw@e-(gYfN1GJ-pf4o` zV^;xai=x;t2j)T>=BA!kSQFZ?MywTcV(rxW@!F!+A4eJgef?@+qt+h@ebf>IsOQ2_ zOUIK~|7xHIpw>-o(I$;P5OWm3{1}TGXhTi3VGhiNw%^x}HK7e_#9FEKPf_|0prxKa z)a&L4*fs$ew-)#YU|b4-w&ehIJ-xKZNg%*?W-L%=&L7mD1NQ>vMed*9rC)+L)WKNP zK&`6)+As&^LL27B8qiK%N3ce$6>V5M^_<4*hZDfKLjaEBdS(Hj4WA3&0%)%U*a2FA zdfvW+zPOpwIXni^Kt3=)0sE_Q41ECfMIDSq4b(zSv|$d+g}#^@Yd|~Jgf^^^daYya zF996?00;x=(F0{2jM=j0df@B(1v3G`k)5J zU@Y2E3pLS>IWQO6NdVfgmYo3FgnJAm zZA*a)0Bth>9_OF=sn2S#jecmuG4w%SjKNqOLoKwSHs(MZ=EU4+$6Bx^v}29b>kw-{ z0#J|9LFiLsspr^Nu*p&EqR>*0eHZjq0WV+}z&u|7YXHv)YWb*#pbf{+2Yp8Xj71I9 zLK|vh4)n*Im>ca_3v~{$MzmqgSi2fPy)JX0&j4UNYNH<#0-y~E0&t!XJmZUIIWQOI#N5=m$C|J<+jrm?@N+Hu zP2m5q1A3UBiK2};Fc+R9m>X-z0nmoEVU0hJ*YDGU4K;9HD*^PK0v-T;lx=MH19ZUe zL;oXv)TC%TLHqlhSOeCAHDPUkcvqzf(#No#J&DyWMsbU_~K3a49K6nO%56BifBP&XM{BJ2<2;$j!<&j{z@ z;t1^Lh}Pob9JEs~I}5P?b1;jGT7PdI(cyo_&zKnLva|5B5C{ZzeZ6g__-ieMi2)kh zBR5?Lge{u-+cxh$_HHo6Kge!-TTQw5`J-~qvhK{MnNDn{iOW=7P2;@c7bDBvOLm2= z@S8ZUJ={*ag=YIw?xo+I{heRv(`?=x@hW+@HcwopN9Gci+P60hC%ZfR7cX8ppW$}J z|D~bn<>`=3A)A;~`&0a1KEFFBG;&NsD5mD~_y0GVvW)#{hts68Md!baMt&1`CY#-P z=xW7^H?pNVTM6%nNEOQmySb=(c;X(u4HYm z$scMd!e0Y_9DBRXGKa{fOSGWzkSb*EYL}!ks?~q*c_d0xI!D4V6j`PP2=vza$<0PK_V|nzEORj z)M7`@RQysh9k)wP%0%eQ;3f8h#NY-YW54VJKbW{(X{{V8&F9*B$SYviuUvLj3Q~ME zsnNwC5_ME{L?A7IJyeaGH{YS`IK7?PtI477N0;cdjqln|@+QT(PmSFs4c5zMXDK&$ zT-1u4)J%i0J5FKtG`bU`v8G)+$UI-v&9yo-?mB+d?kKMzF3}0t(8bcV+d)r`b9Rk< zUg`Bm*I-&dg*}?2*+6j2(4|eHmHN~Z#YU2ISo^gcs(CJO({b~yx&EZ0`^0^Oipw5+k$1zI!qz`o&0PQ!1&8A<9F7j*)4d~Xhbr_!g^Gn#=&ZIG z(xfuJD|+X)82VWA?zPTz+xbHf%*rh@CF!Z)-XVMY%X6`bAcP|XtrAVGqA5oHJa$U<#YHSzFeZ6&85NEMqYevkvyQ-0E>;1A90>_@8l$if+ zI}ej3txi`=nBsVQw$p-*F`IM;PWUXC<2A!Ey<@rWPuy>NO&0GG^>8_0e@D~dne4>j zftVP}Q~^?OOzO^8dFLu!blHdd`yJC+W(fj3TqhaURDYZPVP^SoFYVlk1-|l?jzet% z!#4ACfelJOrmJQW&PzNQB2^E0&756Db|dFk>K$&5X&KMmdLmBfl#gYq&hWCJ$R`2X zF5Bu2d=$248Cwu8#C7OdovM2rJTIb|MzSNNu)GhWX(*Wp3Sbf|BPwk#I~g)%GC|g9 z-TCCyY@_fiR|bbI32SLy(mk#xmy$V(h!bn_Z!Q?aKKn6_Y|=>Os?Zxg6a9ViLgk|e z9;|CR0&2e9=t&aTX>Xg>An77B=G>**y6se$i*Q#AeHcTG>jk*r){p2ixHP{@G40aT z`TphcBkfeC<0s-exQbbMQ%83nrU@mUV|Xi9al4E@d1XTOu^BtQRM{@8CsTTiVRl3I z+r9S9jfItj<#T@w+CXxOw=6ds=v_C%lXgeR=0;Z*xiDjc{B80>ULX3%$wF(IbkmNG z8SVRZ8$xZjkB2gdPQJT4vGnc!9Tz^mCpUz7ZCCkniaedRj<|`IgX}V^-^NvYxU6Y` z{l#{nyW2ZyrJXn`WUgnZ`l)-az4<Z9^3IbweFu=NSE$Miv+><$anD`lrW}3foSUaDVhoqHU3RBN6T8qP?9@gSgc^VWpG2R@F>)fjX|Mj{v%MY?H(RozaAF9#!ctMU<>zBxJgXUmdHj`k< zI7Ow5Gl$96b4`fvAX)VQm%D{S8(nhA!5Q%7|&>0jyR+S@h@ix-CQPbrNgiMD&Y zeY7oK%cOpcfyOaIEBw=g)+P71#avhCr0F!;H=l1lzu9r8`v7l}>G6%0fy?{txT^@e zbpjMUdG?H$7;qE|We(Xj2}>4+(94$p$g1#iGqD^V7M2k!bARUT|Mm!+XU8vGjnONo ze@Wx#konkt?`L~~p{m5CS$ub|5M58k8TBt=jNDI1NYOrZL*qp{xmn-thDD>Eer_*8 zt2%MTiuA8p)@`<7&-RrrYj~&2+xMNkxUX!~&FY*X&x|8i|ARnpZPWbsq?|%0P4-hx zy|xET)oEC#8z*T4GgMv#lD+hEQ@)tUq(7IAP-E;5l|E@6#ICaSNqBVOQ2c{*5BB!Zdz zH?F#FMiU*0)#W%_e*&DW;Y{K-mxU7 zUQ)tAl3C7yd&M0(9t5_Y9j!<0SNnHyirCEfnMl7c6_n+;oM_c*Ig~0e^q6eC;B!L! zt>l?;V(SuX1vSIN47PiD1CK-@$l$a>G#de0=keCJUuIpuEF z$-Ba`%3OnM(@Bl69+&HhKh2OO1(U>1)X=VB$oqD1Dnm;0&0awVZyL!P#W5TmG$D76 zJ)Cx5`tpm_S+~9S=JH!dycA^mC26yUloe$6>aXY_o42a2`oeT#o;mq&>H24ERXnpE zUjsa(gcN=4B_$6ZSw`BRms&Tz)Ke)_Vp4Og*W;O)|6AY7!ZUo`#lk8AdcA>noQ9)p z9V9cwfEM(ULBA+?Vl1nvXET?O3Av#UG}&2pYc6G$K}f7c%M;grykX_tQl5E*QAJ)NC` zb-KylgJ$$U)zy<^3!PTIV38*nDZRZURhqO@KFL0gl@XhSz%1XUq z{Toxi%rbN*B@_=~G;QR5t z#6u}U?z^6E$i2knaF@eO&GsUFa{P}p<*p#(`)#K3Qp8EVi-J0jv;u|M3@Y^UUD@Kp zX62{ja}In+EY;k_%i0^eN!LM3zVkNMjb5cTwkI})-rJwW@fP(D3QvC1$vM}|VzbF= zUFj_i&kd4Qtb3*#h@E07&pc&g_4m#1kMt%)*fKeV(AtK*s8w4w~923yxsB}KLt7y zc3yc$m-AfqgI_sq`_(t~rtY$0nrs3k7x+aAgJtzaH1yNpLq$rY*8G3)cSpV89A@xSouMJq}V)KQ>u@jLvSJYg^(W*?xR<%Q|_5UMZQ>96q4->}&rtNL5$+{V`&wmAs~rpe*Y_*bSq|K2L$dYGa5s%6Br ztrMCbvlWws5~8#g;4~7B8f+ZP+$*@A<(0H|(3jUMvShs*a_D5gq)2LIu&DcP@9r`e zG4c*}e$H<(m=nC~!hJsapymFpgTW>bls}05n9~hd=E3KBdHzE>d6>Vy(TCPFa%-Xa zsdYU5j9n+sSFx7&a9!pbfXCeJdk-M~K zw&I#8V}Z3LE05V9n~x65=jj=dvARuTq7yA)_o<=tNvVjcXG#7X*T7?Y+i#~|jFoGg zaeg1e0Z;WyOOz851P{~C@mIPz4kj#kD9qp5zhy9CeeUaWo=ZPwVGWGv+zAJjvyef{ zu#B8UesgHDj5Xp^POrWc|B>SLPY$rZx}0b*E7}<-$1t>W-`XRO4ypw#^t484xh1y{ z9>}~o`tdsf9{X7O!*A+&U5*Z`SD5y$)Qj2ab=Bvxe52T?Wav8i3rFkrF1Hkm&Gy^o zIM5#1&S$|8Z&r^GDU{Q2M4Z98Gw!_>vv z_&IFFa@!VO*Qbx%FWe6he@k;&X_{$3Xnaf8`QuJaO=l|9AJWa9(^>H`VU{Mo(%S!| zOS)l08OO2JRlx%%4b0T?xdv>{%L}S#Kg-<2ylN&on70>$lJ0`EcI&Syrl`DKGR2Az(oV}7l z`q-WQ%bnKMD!CrD{gz@Px9wNc8?lM4l}WSFIP}?Hd*x{Ri33qq&XrBgWf#BKjxY2O zIOhj%)jR9Ta!7vY2xah`jM8$S<}*0HL?!7Hd+l;phR4iv>!Ob4n<=%J!@=XRp&K)d z?7SVoD_^(d^o5*-kY3{_l1%d(V7HhB*QkzMat|RCjm0V^&+!fHd8`|tNVv9~PlIWC zVOGK9dj4TvXI;ngN2U#n`??+}Zb^5{P_8^VJM&HU!&1A4tD}Al1s{#Re^tJ*#IZ6+ z*Q8tLeo8Ctt0J%4QOB1}TXzS3cO)z447B=IOS`NxHj*K7AX!Jepc*_%Zs>s;$T?+j?ti;_11pNPG(=n&zDO}dKW#k>>r!t=PRGTs=a!gsqY&d z$9BHg-i$XV9Z@}U8qm6Sa^18PNz0$aR;eflc&V>!=S${L+;zOd!G&~j4<}K zgjVe0&+V#PsOZmf_U=01EL#^jcudeU`}*pw>^(J>%z0svq}{~MR=?{z=k6D-Yl^gc zsAu!)AiE%ch|`_1u%^M}8JkG=n3{s~-)-s$yjQlZ8aFD>PFUljnrj$ctyZ0}V_3>C z@{OTcMK5XCEIH)6>08Ei3K!49eK^W;%6hY9j;_GyihZBwh?j`F7=p^h+ey9;tFa>#WgA%2Z~VYpc&BegtRL?o#zTj>l=zs% z?Dl!gxLr1q^Vd$8d=^Y%E0?#%9#Gid)DxGtHi>?@usZ_2Kc4;M_N@ThokI+4byUq$!&GG+e2db!#i{5|+sz zF;BrhF&X~>bxqYXpWG<0Nhd+omYUA)$%S{L^5 zsfVuhq00rGN4xy=vubtWR-m0ioTGi%QnVq^DViMCIrD7ob``r$&yJ3IsAIW@Z|Y48 zJLN<|IoY!)I4kk#0rfeK=@8!B6BEp)_Jo_gv002Uv=f|Ck9va@->JSm?Gd3W*y`Px zzqja_s)t2>=R@(G^m(LavEVvKUl*B&0L@%uv zOVg88ti!mRJnVXVvbxax{`$7Q$NRS^O6V1p4)6{<%i;|=|#Qqkajz@bpp@Ik?th)$G#K%Q~(;eW}VENVhdHf21atSMS+SWoG?|a+tC>qs(sl zQJM{mA1xd@#Wt|)q>G9dwD010p1myQJe&yWdDYJ>v)bplk zXpQj#_rM+7%bVX_;w0VO_3c}RQNF2JgJo8i-Risz9H%AUL~f85CUz_rD%o%(`iydc zw^0R$LGY*0sqP)ur`QTIM=}-_M(1C3v?}T|Z(uX{A!=ao#-%kl?MKbw>X9oMA>+rT z^n-8MT{~1Up{Un1aVxx#e1XCH5U(?1slYB+*wda{wJtDKG1)w34zj;>UQ663Ctu3# z&b|#TG>wvSEH~=};u@DpZxj%ik1N>J)&BghXNxegfi=HG;$*|oxzv|C>QZ6{E7?c# zZ?u*@arr1K$*x{RAvx_lTnc?i4c@-Ajx0g;* zK&OqyjQ7qr9m%uf&$0$1_p=Q5l<4R7^Y;h5zui`A^ zw>~jgcdJQtKuLS_d3xWyPaK5mmi^`*?F}XpZ!=YfGTh}GJs!I#`a^y9+ppJJm0TO0 zf2`?ByrK3W`IPwE7{UrO!I~~nhcn;GuV-FmVre*ERHYO#W@~#)w@mWPUH>kg6E-Fu zAr(&x_Ox4edkt776bM{2jHuakD);Oz!hoXVCyDIOi%X<8uqlr>znoh!9kO3)e?^Q# z^tqdDr%eY=mv*-j{CH_y%fc&KX7n1*Mrkkx*<8D!_)g|N&8jm#ImcI%^;`4(_)pU4 z?qN|}W`4CrzeP{%Y3-bS^||>_nA7E>=3hO!PrB9w#R@Q_25BmtFrJ`4_q-x|*r0W# zRqJa)jD+cM`Jkfs^3xZI?XS6weP?Ebk0vlYSIBTLbRm@!YNQGu%SCrM7XA|D6Ufy+ zTgVr{DVlnM#`E6s^vQgm{`6NWhP{Oh+Luq=S?#-1rD=annxdd8t>Ze{n=!HZ0h@>} z#Hsxvhr(U}O;(=I{&-K+cEQ3bu9g_5z9{rmx>xa4l|&GO3h~mD@GWOI zb|u_fd2Z%-g=Wg}7x76hn>iR?dML9#@Y-a0OR=wu#?wLi@b?9k(HqxGEOgA0BMf-h z1s-!hwCuBFVGdo%kS2I(nG|Q~2zl+hdA+KWwGURlFlgP<##^L&=ok;dPh$L#eMf<$ z*>NAjkWA?zq4)BmQu?`>_768nof$77_eBI=;19E7Pqwv+_p+9d@VVscp=YADbdr!^ zemq|^X4}BcT6GJ(O|x0vG<&rtuC}C`_;!9j|6uD4a>){ZZ!;7i)0ump52hM8P zj^8_;l^kPwz}2Jr+RFxfqcWo|j-MJ1R$HqidQDR=4cEew?e)v%Af6STsMZQ|J=g53Yem-3pi5 zrW7qYq3KtOYClL< zqq^SEbAyGw*^DL}Zw7)dUY&j#{;0)%4>4cHX06og#5FbNcAR+~K)fgRr~c!CB4(KiWG6$f zx2p$u6YfPSO_JK*Yx>KhK%G#zSaM%bRb1>r~o>7v_mz|tTj(8FFKYs(h!qY zT<+6YoMSB&tzJ4_>UFCrKw$WiN0e#kHp%nXNtf?99$L73!&0ug=j)D+_e@VY_Kk0< zDCO?j5Vrp1ddKMT`1f&HNr&k?mN+=2HJaM?Erf3UDzmeT?4FkVdGW&Q$b$6!>(^-~ zj@g}A^ZK(`SFe7u+tSBk1V|_FUd^q2vfzHdpX1r{*@ZGs1)L^R`NSYSE;{%gwuc^VD(&w3800yL^_W+1T+cQ26AUemNzBGXgn9SJl`30+Zq} zkWtRye%dzV^U~IU1$)Qh5}1&!P~nbM7I|DEJc250DnVNYxm(=JkI&T?i&dAYx_#DE zi_s8OV({Pp&2ImFCb2L>+FYld*ISC1Zr!c&6*|8&N~v4UpSAn(x!wy-_njOpRIYVd z3lo$#HrJ`i-Z$b`rmecvN_*)*H~XF^YHm^v-h&MuDT+o3(q><|e9S(!*)oqw4&Sp@ zG|0S__@4Hm%-c2lWlSo~Y{$0lzt6ih?1fqp;k@(rEg1~t0*NE(Vur=7{B7&&3C7Bg zEYye2J#YBF#6VNlpL{(0@cN>zn-?Q1oC;MJFI8+5*I?CHqjJbykhS{qxAm&scdP_N zCymP@Jk}?!ig~KfPP$$|AIneL&h*BTW9|{d!~5==^VAF0-uYH8LEf1}lySf75N}{> zp?Wr~gw^?m(Y>q6hon7~ls**8@trjM=9hQv7}4rnB<-fVov+Q>V-)W(|~so7kMR74q;P*+yqoNk0jZGG-pF zNatK)IX-bGb8GAa!N3(Q=BL(Q5v?BzP-IH*w(;KZsEoFFNqdR~tqyTTPd%-ls_e3$ z6S;v+z49-8#)RWV^>1jV`q{6|<_=M4wOsxA5P_{e&Xt%aEF!EpcENCuSE>C*I{(0% zoJ&=#MlW8gwNUeBGO%4c@U}SrNFq&i({POrELtme7Wbx}^ZJA9960;6pBUG38f_r#P50uH?=1!OMJSjt_X5n-YeGTtCswXyep zuR-!w_!dkoGv}P&`M`BY41M46OrA)eO!MP%vNQQMW_hr3;RcV@*_;)u4c{u51WTBW zQKZ0+NffjFL z{&$mZ4%)0xJTbS>#wW+M# ze0571_az$X%?mb>z5DoyuR0^|NmgyFkIf;d>ZnESAL)+eQ+7Msw@>sTW1aZws`;`a z<~*WruAW8pVC{vt%=2Ei*hoLFy9t>Fyilysj~UE&*ALltYs3AEdPA#D%}(u-?rk|h z*HYNRe^EhZy9_y-cBa!hb5(Ri0ta2og{?x9!s6OWaT%N9_K8|OWCQsgd7aU{5>Apa zb2(~Dgje^yT_v1x%%tz_=JlJkmH3+WniX*GK3J@N)gbnZQ!cyAlk+C;nc8cN1%|BB zoR9aD<}LMlBi?-Njt#A=@>YQ99f}iQMmKQwLV!z>*qCs_M-_z&3iY0x^?Lnc9oh@C z%fkiN2UkaXbvDSYH+XpN%16)$iaNeB{XFM|r(_?I2@ASf&Hl!^)^$Oz2$!x3w=%Du z-n_#rVaEm<)%G2U%L}Sb@DB!rZisWex;)&UT)&QSU{}uOJsg`X_&y(as=MlnV0~O~ za+J0UArUU8PqAOLc}a?I%`X>~ZktM$P>DR5+NsTUNEt+|O3+;QcIa zwW-1+(rIsK*raDZv5jeZ|4t`@INL><*iAQg^SP+PN-QI~evgRhOtO(x@P?sR43`eP z?)7}5@6m8&I>Wv85(9BA^WN1m-Qu}>ll3s5AzWpqc1cB(78!GCS35LBFCZYr^%mZ)rD;)l`;H388^t-NS zst(ITGmpG+JH~oZY3_ilaM#;n_YG@m6oQYXR=zZ=buQu|c?rpxZ?uZgP-J8&H zaPKim?FEIsydtSl>BI}(z6HFq5{X9D(Zo@%m|oLd?Gq=~vJd9%$hA7|+D>S#pPzUx zOFsBxScXh^;5f>~H&Eu;5^hOK=k=&7__#IhEIA~~i?fh_=jtQGR|leO6nII`F0Jp* zITt}QTBpL0Y_?(7TV`n=+k+m-lXVWi%7mdY2QQ`Lh%|{#ZV&HdrU?erGFb-m^2QJle^ss3L0fAwtJi=Av7^9tJ*AJ*%y@ zxiXCg#M0A@%6*>Ei(El_Ve4CQS_d)b_9S&fpGPYnULJAjYL#1ec$1Fk5Y6XZLmYQr zoAoLZ`MSU4uL~mV*D+4{e4xwZna8Qz*EMImquuvAZ|GKIegWTeR#vk#zxFk(&<)!) ze~_?=BUUOtissAE_qnG1;dAb#OGi0m4vX4I#yolLc423IPk~*qUH$_J&k>={H!qd> zE_OL;i>)|4z|Kmzy}N78uwC##1A(JjlkOtpRq0Z*6-8S+f@cid`V|C3l?lT}sXda6 z77lcylIp_rt&KbDB6N>?y`9)`Qo5jCRsU_%Ol^{7zSxeGmB)9^eDi7_qoM6;U3#`X z)vJ5?3ss^r?TXjR4{62*9=?c9Uw7Dd!SsG_VhsJcs^DoYPOB^58^mPu?T)XMeaWk? z)UrbGvTokqdo*{XNi-dtEGrUsR>#%e{t#Gugr@P{`olVp$6L!}o)vT4u!y~{&`Gp% zwRw9*E$c;E2r-D$KlRboW9(C5&w4{Qz`?p>dH1_?yXsV9P5$ z9Q6FNQRn5>x0X$>TgRvoT+Z;`*Jd<1FkCex-)Y0A$a*+AG){fu?s6v|eX^QAEI<9t zYADCwC_s2t(C-YbH|-sv3E}I_Ti?_f-OCF3HJA1?#t>fG`e^Fm=@tK;omV%6Zz^?1diE zjo3P zogq}tX$ zV(=rzie=I;NqsYw*IK6$enKitm#$`zqxiwvyU$If&+J!iRaiZKrtIC(;i{qeb!_Qz z>Q$Ze_obzGr6-C_1{^x4v1XFx$VR@`jh1a0Qhoac*#)i5(^DpF^pmG~i#J#$j*A*b&nIoxFEI|K zv1;|=J15bc(#ku1U~27#Bk5l@Z~b6JxEmp5B|I(Ey}aA%bVdG*pEvHN_ZQl01{;C|sl2Jcab*c^Rsr%0A#aa@Hzx~=uvR`F?c^z$@;kOOv zV=9xvR-R}{319P(iTet%ge6~H;8F-(>qDv6wU#YQIW5;| z6N&nvKpu`|4mm1sxO#j=OSp`fCfAi&k%M{P#YbzVX<|)RZiYe zSIGZtrOwb88s~F^rd2_tS1@tbHCch&RNEMPiZ~mkHNn+Oj1Ty5GP+?$AlpvDgwNwc z$yRK(5kbwwx1VR<6TEeJo$WfN_q88oNm+QDy(fmwn_)ztd#_u8ePs@R|N56c-=8f= znhuAmkFE938T9+4d#Gp-raYPJ!;(%&#h?0;`#P?N7}UX(?@rqswdU!YCm*FhujznEv`aeKp8DGnC<+)ioWXVbRKX<-!$-uKbUNHjS9dZ* z|9G2#%9^VC!puw=^@}TGhZkK}Esh+DY43XJk=;~(&4IAjUoZT&ebSnnOq%($WJ1bw zBL?kDS8KL7M++_0nbBr@z@4}DR>Hu`cx|OK_s52JxrK(C#jd!qmhM|tO?>9)H}lnb z^SP^jSt?W_u%6LDJ;n5sg-U!Bd%eC>ntgWEJ@3*7g&{|Te%W&4#C1~s?(Npu+;hf_ zh81Gu0XbE9c&S5vSes&$!p9*PF@L;+M@Nk%eL&JY<=(QS#MLcIy<_jy`AFHnM6!r! zDn%X5;C`??&xiZSg`Ss+#Q5`;XSwci_Yk^HbGL+YWo}#bF56m@c8X5kTkR@Q7=bMH+b^}8Ko<@g-mT5$DGw}!3pVK_$-k|fx^ z*K~r{bJLOZ_f7L}2#bt8o41BkWwcJ6SMBO?zf`_(A(h*R=jAv_Q+Z>pQ^SW#tjQMF zPoA0RbUf%A+*MP%-0NLf$@xc7dfTdaWk_<&`SU`fzr49oo3pay`Iym1@r}a%_uKch z?zVDeJD@arkZjr2Wq9hLE|H~S&b6`c+i<>oC$GJC;aFHqXK>gqoe#`ACGF}C`JJS( z-|rlA>};j#qs76H*06QWsl#XXbctpb_ZL1IOP-wn_;d}gw}yyy#PVaz?ybqHUox(c zWd!vnKQ>4w?0(@d)$Lf*Yo68I#X^KH6alpc%09pW676QK{-ure%KVJ^xcoqCS+U@$Q$J z$IE6z29J<}W8DbdVOj8Fy$=7$6X#vyIG-A9Jeqe;_SsR>4Epr;&!dExMXT@+40@V{ z4tEP*%86fBiGO-Y$?47g*6fG-4E%4q>U68GSbG1J`qq}rCDOdt4OZvTTx6VsZz~Sw zHk>xSQ~7Q{uS=tQeA2=E+|YsSmd4MM+jk2xST?WHzoa5jpL9-JGMB~okRP+UuQDNj zRZPrqWbVMSf%Uf585>wsbgUJ!*bWnv#q8+`g15U)FfaRXC6S=m?D}qW&$Irc-EPl5 zSaCLQFDi@ZP_-#ZpcSZG66s3lpfR#I*(q63rxkL253e_ES1woMAm3pQS}XRQ=C{`o z&u#9A{k*!{rs1G|oUg~D;DJYcgfaLAWa>ukZhO6bWlU47qx#20DspdD2ONa|8=2mS z7KRe#Opg)gZDM~IgtDa zyNHg^HG(B)lXGb4>5k=eYp;2))Sg+ct?tP=GA{m>v*BjE_>5(Rbcux0XA|qNcTZ^L zug~&^cGI(*)@wRSC$wBMG+UR78enJsleMv=Fd*{j*T?v`}tA(-o3@WpQX(##0!lE+jmc-gs@LP?caII zv(_*|;g#$}PP4K^jNe3Rh^~PVg;nOlxrB5&dDZZ!-DR9_Bl= ztQsfVrxFNK_vGCB&9|8H_7O>onJV@R96ZDphX=cEx#gCKq&|JLbV_nWY+%!)2RmA> z9oloGg4W28Kyut4X? zNyD&Zv1^~u?0s4rc@EwUI+It`awih_S8tTfw9em8xV(?uSJa>~>{{4CamJo!Qv{n0 zaw`=}h_Bbxd^KO#{AHKfZr(no_uF-?jXx|~OWv;I<;B&XD0(#srs%w7C#ktbUD#c` zrCWaR03pDBsfuuO=8~Jr3?eax+0&~%_jC0N%yg~1$6Hm^x^}xlLmBJHDf!0xvpOqo zAMq(nU1_%T$QNN^yZg?);^dsDX|^RS`DKJ-YaZ^%{~;W(cS2?%+&0TYmM&YBuvls) zkP9y*0_#cfEe+$j%=UcF^}F>K)LS3aL7RQ^>l@`pO33$axS3@LKbVhmT`YSpbKO>xpV0i$_UZWR z1cL7F?N+-?W7mhNXx=5SAbp-t-}L|Va@}7|ZcX(UCd$s=CSS}Cs!$RCc^LR|_pKNndLVgc(Fh1%}blK;^BDch`ER^0(k1QqM zbZ(fvL!f9a{Jl)=CJE0}(@V6Kyy}-d4m(x;7nbb#9cYD7cZ{1~r&_>uaVl z4lQcN8bge>|c+M_D|5XJjbU@~2VVo9^7v?s`Sc4wD%EZ0M0 z>lI_xMOM3pTy|O9&cxY|Upc(;L(S%u$phKgy3MC|S*@lviXIMsn!Al7lYa!C!*nsO zupDTmHJg2@DpI5QY{lBnISA2~87g@xuCsl}j$LuEPvE~qU7F|JcUjnuWSlKBwH~b1 z_rrH?JWGn77LX>FOPDgHNq4N};k2^ZNrl1tSfY~sW>V6zkzzM&lQ)$wzx;uXW0E$< zq;=$)kWt;mw%~j=L!|nI@NeadP+-%6KSVtFeyKUB@LqP8h+CkH`5Sx6uQvB}yqBa# zV3RQRQsYo5JW-V+{Lo+Aye#PH!eRV1C7z8fP4m)hi{72#*S*YdSYkKl0n4sD^#p%` zx04W#An-{05;aPQMN^a3A#~(CP>{Niv-KwD)hmbkYA0ETJ?J?U4(tiYB2(whOfSTMCt_Q&zd z-f_I6IX^U)sC{<^V{nx-J*Oc^xG2G%auP8{9=`#7Cq}yTV`QjtL3^q!?W2oj<)od>%4NElH zFX~w?#5{}@kem~sBl4Z@N;B5`>->=^?*ZU?x9{!ps%4&l1JB}d`8fr8yL3UEn*5r( z_Nlh%-B@}#QSo(eT}<%XAIFj&NuO;#&gEJ=lD1_>YyPxuA~x5gX$gU)j!oVLkiH7G z3 zuf8IDeK9aspm2BhGBI~BU3vAKzE&DTmm;uTmMfn*E~TZN);t;AF!(~czKY-q?a29XU?Z&**J_IeLijm9og|J(J_N)bnp{NKukNFhI^1F3XhIKV(UzpT= z0JWcKj0e3TJbyGdGK_75qhPxxk|Rt^(#3N$jO?7c^{+5prm=Q5&WHf^ z13A){(Mj3Mrd%Z_+^s@O9eyM2Psoz3P#oj4qxW%TAO1-JVL1o!&iBULJbB zuB|($&2!#ijSECuJpmFkv~-0&2~%HAemd^~BLMMyrmpT@**(!GLPRz<5K1fiMfA)J zGRbt`ZlJa+@;(|bo|q>+)U+_0IcfY%^WO74&5$VDC#QnXgHpUl4%#^pv{z?tR(gi( zk9-Ad=q0`TZbmeRDvBq?eD;b${V1v_w>&wfc=NY2I-!$CX18_3c=(Vl8YTS7N=52F zVTBsKqxEXrJj4a>e<$&TjRs(4JmVuw`qi#pGpv>A`-N3aHd4S%5LIRzOfjXKQ3!lB-e(~ zO-Pr+0X+CNA0?f^&Hd;oM0azRmh|X2B-!}&9khKEPXN%+gy_}d8#TT%2D-IZ`EH!WCwP%J!Lx6AA@($g1i$w^3S-E;+aXLk?a=`04VOi+CS)o@YC%*H@Yhf}x zDJ`0EVV*6V2sFY#O zJ9To1K>+dMLjl)wEI-{Bq=bX?^b)vm9JSP8?%)lfD_}@RDxpQ=lxZ|PAf}y+L<`_- zhZ__T;{f9H+3T>;h{3NOB8qjSaZ$wYBR!Pg(p>j%B2j)+)a(55Iugy$2{Ez7xZ|1L z4S*bXB&0PbtPKM2=g*e*%jv4kMd_hbpVZgXr_}Q`8n9QcT0pJ|T{g6`AEJ;`^IK*6(6>kbF4;jx?4P*Y zBwgP8f_NS!rUjCb_~W7)QV23(bqBvw4Naue7`e`&*=k>-xheUnw8%KqC#QkLYUgga zd*XGo?Q^8Rt|l~xpT2NmE|)`d)!?PkIl?~}u)^oq<=J$4Hyg}iV7WTIWXGHafD4{F zt0xS{ViF7`ULM3){L}7_M!(4CPP7njVT4JgF;J61SKf^62Zo?3rlzhjeW+7PZ1l(Q zVJLOYc`Z?WPFV?F505YEiLP+fZTRui=_1g3q>Iir_YQO$aKjd>D=bVUtq^Aa^lfy! zz^pf5xB!yh?>K>%6B}-Xwd1>7iXEn=_RbjuwYy&k3zx z9zHKrqgi^g&AYBTZ;&v1Y$1-=pluW=#0KVv#K-RqW*@a~ZXV;3N8NIr8^$t_6N07~ z4S2hTJznI_9Nq7P#t8VY(U(Qn2oR#XOlm9R2c~0#_fH}6pUJVbZP|YKYCnE+L%o*^ zGGpnjA9r>gmo@e(J>k!`$|vz$?#%_|(cei5*0o1T_mR-sN?jjsW{rYWCv%Er>hb;> z*j}2}8`=4}l)!caMt4Ci%CTSERihg{)C5urhZw*Nz-8MB5$?P|&rLTB2H23G!Lt*x z83|SXYsvl8A_@ZkKU2XkbNxhg*J&c?@U!_$afVjJA~(ILqKQW7=eq5m3jUKYv?oA0 z`=7zWaR2sY7nEVeR@Zs@f0lO^%F^hWCLjyN$WKhkgCNp!#H6nZbX_ao4G`geBWJ>h8(N$aov u&naRcY?UONJBKWk|DVwc;0%Yr~jMD?bnJU2K`0x&nRx>9fKmHa>6W{{Tv literal 0 HcmV?d00001 diff --git a/src/libs/mosquitto/man/CMakeFiles/CMakeDirectoryInformation.cmake b/src/libs/mosquitto/man/CMakeFiles/CMakeDirectoryInformation.cmake new file mode 100644 index 0000000..8cf4b23 --- /dev/null +++ b/src/libs/mosquitto/man/CMakeFiles/CMakeDirectoryInformation.cmake @@ -0,0 +1,16 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.10 + +# Relative path conversion top directories. +set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/Users/benjamin/orchestra/src/libs/mosquitto") +set(CMAKE_RELATIVE_PATH_TOP_BINARY "/Users/benjamin/orchestra/src/libs/mosquitto") + +# Force unix paths in dependencies. +set(CMAKE_FORCE_UNIX_PATHS 1) + + +# The C and CXX include file regular expressions for this directory. +set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") +set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") +set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) +set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) diff --git a/src/libs/mosquitto/man/CMakeFiles/progress.marks b/src/libs/mosquitto/man/CMakeFiles/progress.marks new file mode 100644 index 0000000..573541a --- /dev/null +++ b/src/libs/mosquitto/man/CMakeFiles/progress.marks @@ -0,0 +1 @@ +0 diff --git a/src/libs/mosquitto/man/CMakeLists.txt b/src/libs/mosquitto/man/CMakeLists.txt new file mode 100644 index 0000000..f0a9cf7 --- /dev/null +++ b/src/libs/mosquitto/man/CMakeLists.txt @@ -0,0 +1,5 @@ +install(FILES mosquitto_passwd.1 mosquitto_pub.1 mosquitto_sub.1 DESTINATION ${MANDIR}/man1) +install(FILES libmosquitto.3 DESTINATION ${MANDIR}/man3) +install(FILES mosquitto.conf.5 DESTINATION ${MANDIR}/man5) +install(FILES mosquitto-tls.7 mqtt.7 DESTINATION ${MANDIR}/man7) +install(FILES mosquitto.8 DESTINATION ${MANDIR}/man8) diff --git a/src/libs/mosquitto/man/Makefile b/src/libs/mosquitto/man/Makefile new file mode 100644 index 0000000..0a3fa6c --- /dev/null +++ b/src/libs/mosquitto/man/Makefile @@ -0,0 +1,184 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.10 + +# Default target executed when no arguments are given to make. +default_target: all + +.PHONY : default_target + +# Allow only one "make -f Makefile2" at a time, but pass parallelism. +.NOTPARALLEL: + + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + + +# Remove some rules from gmake that .SUFFIXES does not remove. +SUFFIXES = + +.SUFFIXES: .hpux_make_needs_suffix_list + + +# Suppress display of executed commands. +$(VERBOSE).SILENT: + + +# A target that is always out of date. +cmake_force: + +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/local/Cellar/cmake/3.10.1/bin/cmake + +# The command to remove a file. +RM = /usr/local/Cellar/cmake/3.10.1/bin/cmake -E remove -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /Users/benjamin/orchestra/src/libs/mosquitto + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /Users/benjamin/orchestra/src/libs/mosquitto + +#============================================================================= +# Targets provided globally by CMake. + +# Special rule for the target install/local +install/local: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake +.PHONY : install/local + +# Special rule for the target install/local +install/local/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake +.PHONY : install/local/fast + +# Special rule for the target install/strip +install/strip: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake +.PHONY : install/strip + +# Special rule for the target install/strip +install/strip/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake +.PHONY : install/strip/fast + +# Special rule for the target install +install: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -P cmake_install.cmake +.PHONY : install + +# Special rule for the target install +install/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -P cmake_install.cmake +.PHONY : install/fast + +# Special rule for the target list_install_components +list_install_components: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\"" +.PHONY : list_install_components + +# Special rule for the target list_install_components +list_install_components/fast: list_install_components + +.PHONY : list_install_components/fast + +# Special rule for the target rebuild_cache +rebuild_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : rebuild_cache + +# Special rule for the target rebuild_cache +rebuild_cache/fast: rebuild_cache + +.PHONY : rebuild_cache/fast + +# Special rule for the target edit_cache +edit_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." + /usr/local/Cellar/cmake/3.10.1/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : edit_cache + +# Special rule for the target edit_cache +edit_cache/fast: edit_cache + +.PHONY : edit_cache/fast + +# The main all target +all: cmake_check_build_system + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(CMAKE_COMMAND) -E cmake_progress_start /Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles /Users/benjamin/orchestra/src/libs/mosquitto/man/CMakeFiles/progress.marks + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f CMakeFiles/Makefile2 man/all + $(CMAKE_COMMAND) -E cmake_progress_start /Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles 0 +.PHONY : all + +# The main clean target +clean: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f CMakeFiles/Makefile2 man/clean +.PHONY : clean + +# The main clean target +clean/fast: clean + +.PHONY : clean/fast + +# Prepare targets for installation. +preinstall: all + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f CMakeFiles/Makefile2 man/preinstall +.PHONY : preinstall + +# Prepare targets for installation. +preinstall/fast: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f CMakeFiles/Makefile2 man/preinstall +.PHONY : preinstall/fast + +# clear depends +depend: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 +.PHONY : depend + +# Help Target +help: + @echo "The following are some of the valid targets for this Makefile:" + @echo "... all (the default if no target is provided)" + @echo "... clean" + @echo "... depend" + @echo "... install/local" + @echo "... install/strip" + @echo "... install" + @echo "... list_install_components" + @echo "... rebuild_cache" + @echo "... edit_cache" +.PHONY : help + + + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system + diff --git a/src/libs/mosquitto/man/cmake_install.cmake b/src/libs/mosquitto/man/cmake_install.cmake new file mode 100644 index 0000000..ddc4956 --- /dev/null +++ b/src/libs/mosquitto/man/cmake_install.cmake @@ -0,0 +1,61 @@ +# Install script for directory: /Users/benjamin/orchestra/src/libs/mosquitto/man + +# Set the install prefix +if(NOT DEFINED CMAKE_INSTALL_PREFIX) + set(CMAKE_INSTALL_PREFIX "/usr/local") +endif() +string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") + +# Set the install configuration name. +if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) + if(BUILD_TYPE) + string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" + CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") + else() + set(CMAKE_INSTALL_CONFIG_NAME "") + endif() + message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") +endif() + +# Set the component getting installed. +if(NOT CMAKE_INSTALL_COMPONENT) + if(COMPONENT) + message(STATUS "Install component: \"${COMPONENT}\"") + set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") + else() + set(CMAKE_INSTALL_COMPONENT) + endif() +endif() + +# Is this installation the result of a crosscompile? +if(NOT DEFINED CMAKE_CROSSCOMPILING) + set(CMAKE_CROSSCOMPILING "FALSE") +endif() + +if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" OR NOT CMAKE_INSTALL_COMPONENT) + file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/share/man/man1" TYPE FILE FILES + "/Users/benjamin/orchestra/src/libs/mosquitto/man/mosquitto_passwd.1" + "/Users/benjamin/orchestra/src/libs/mosquitto/man/mosquitto_pub.1" + "/Users/benjamin/orchestra/src/libs/mosquitto/man/mosquitto_sub.1" + ) +endif() + +if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" OR NOT CMAKE_INSTALL_COMPONENT) + file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/share/man/man3" TYPE FILE FILES "/Users/benjamin/orchestra/src/libs/mosquitto/man/libmosquitto.3") +endif() + +if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" OR NOT CMAKE_INSTALL_COMPONENT) + file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/share/man/man5" TYPE FILE FILES "/Users/benjamin/orchestra/src/libs/mosquitto/man/mosquitto.conf.5") +endif() + +if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" OR NOT CMAKE_INSTALL_COMPONENT) + file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/share/man/man7" TYPE FILE FILES + "/Users/benjamin/orchestra/src/libs/mosquitto/man/mosquitto-tls.7" + "/Users/benjamin/orchestra/src/libs/mosquitto/man/mqtt.7" + ) +endif() + +if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" OR NOT CMAKE_INSTALL_COMPONENT) + file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/share/man/man8" TYPE FILE FILES "/Users/benjamin/orchestra/src/libs/mosquitto/man/mosquitto.8") +endif() + diff --git a/src/libs/mosquitto/man/html.xsl b/src/libs/mosquitto/man/html.xsl new file mode 100644 index 0000000..44f0018 --- /dev/null +++ b/src/libs/mosquitto/man/html.xsl @@ -0,0 +1,12 @@ + + + + + man.css + + ansi + + + + + diff --git a/src/libs/mosquitto/man/libmosquitto.3 b/src/libs/mosquitto/man/libmosquitto.3 new file mode 100644 index 0000000..3323593 --- /dev/null +++ b/src/libs/mosquitto/man/libmosquitto.3 @@ -0,0 +1,250 @@ +'\" t +.\" Title: libmosquitto +.\" Author: [see the "Author" section] +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 07/10/2017 +.\" Manual: Library calls +.\" Source: Mosquitto Project +.\" Language: English +.\" +.TH "LIBMOSQUITTO" "3" "07/10/2017" "Mosquitto Project" "Library calls" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +libmosquitto \- MQTT version 3\&.1 client library +.SH "DESCRIPTION" +.PP +This is an overview of how to use libmosquitto to create MQTT aware client programs\&. There may be separate man pages on each of the functions described here in the future\&. There is also a binding for libmosquitto for C++ and a Python implementation\&. They are not documented here but operate in a similar way\&. +.PP +This is fairly incomplete, please see mosquitto\&.h for a better description of the functions\&. +.SH "LIBMOSQUITTO SYMBOL NAMES" +.PP +All public functions in libmosquitto have the prefix "mosquitto_"\&. Any other functions defined in the source code are to be treated as private functions and may change between any release\&. Do not use these functions! +.SH "FUNCTIONS" +.SS "Library version" +.HP \w'int\ mosquitto_lib_version('u +.BI "int mosquitto_lib_version(int\ *" "major" ", int\ *" "minor" ", int\ *" "revision" ");" +.PP +Obtain version information about the library\&. If any of major, minor or revision are not NULL they will return the corresponding version numbers\&. The return value is an integer representation of the complete version number (e\&.g\&. 1009001 for 1\&.9\&.1) that can be used for comparisons\&. +.SS "Library initialisation and cleanup" +.HP \w'int\ mosquitto_lib_init('u +.BI "int mosquitto_lib_init(void);" +.HP \w'int\ mosquitto_lib_cleanup('u +.BI "int mosquitto_lib_cleanup(void);" +.PP +Call mosquitto_lib_init() before using any of the other library functions and mosquitto_lib_cleanup() after finishing with the library\&. +.SS "Client constructor/destructor" +.HP \w'struct\ mosquitto\ *mosquitto_new('u +.BI "struct mosquitto *mosquitto_new(const\ char\ *" "id" ", bool\ " "clean_session" ", void\ *" "userdata" ");" +.PP +Create a new mosquitto client instance\&. +.HP \w'void\ mosquitto_destroy('u +.BI "void mosquitto_destroy(struct\ mosquitto\ *" "mosq" ");" +.PP +Use to free memory associated with a mosquitto client instance\&. +.HP \w'int\ mosquitto_reinitialise('u +.BI "int mosquitto_reinitialise(struct\ mosquitto\ *" "mosq" ", const\ char\ *" "id" ", bool\ " "clean_session" ", void\ *" "userdata" ");" +.SS "Authentication and encryption" +.HP \w'int\ mosquitto_username_pw_set('u +.BI "int mosquitto_username_pw_set(struct\ mosquitto\ *" "mosq" ", const\ char\ *" "username" ", const\ char\ *" "password" ");" +.HP \w'int\ mosquitto_tls_set('u +.BI "int mosquitto_tls_set(struct\ mosquitto\ *" "mosq" ", const\ char\ *" "cafile" ", const\ char\ *" "capath" ", const\ char\ *" "certfile" ", const\ char\ *" "keyfile" ", int\ " "(*pw_callback)(char\ *buf,\ int\ size,\ int\ rwflag,\ void\ *userdata)" ");" +.HP \w'int\ mosquitto_tls_opts_set('u +.BI "int mosquitto_tls_opts_set(struct\ mosquitto\ *" "mosq" ", int\ " "cert_reqs" ", const\ char\ *" "tls_version" ", const\ char\ *" "ciphers" ");" +.HP \w'int\ mosquitto_tls_insecure_set('u +.BI "int mosquitto_tls_insecure_set(struct\ mosquitto\ *" "mosq" ", bool\ " "value" ");" +.HP \w'int\ mosquitto_tls_psk_set('u +.BI "int mosquitto_tls_psk_set(struct\ mosquitto\ *" "mosq" ", const\ char\ *" "psk" ", const\ char\ *" "identity" ", const\ char\ *" "ciphers" ");" +.SS "Wills" +.HP \w'int\ mosquitto_will_set('u +.BI "int mosquitto_will_set(struct\ mosquitto\ *" "mosq" ", const\ char\ *" "topic" ", int\ " "payloadlen" ", const\ void\ *" "payload" ", int\ " "qos" ", bool\ " "retain" ");" +.HP \w'int\ mosquitto_will_clear('u +.BI "int mosquitto_will_clear(" "struct\ mosquitto\ *mosq" ");" +.SS "Connect/disconnect" +.HP \w'int\ mosquitto_connect('u +.BI "int mosquitto_connect(struct\ mosquitto\ *" "mosq" ", const\ char\ *" "host" ", int\ " "port" ", int\ " "keepalive" ");" +.HP \w'int\ mosquitto_connect_bind('u +.BI "int mosquitto_connect_bind(struct\ mosquitto\ *" "mosq" ", const\ char\ *" "host" ", int\ " "port" ", int\ " "keepalive" ", const\ char\ *" "bind_address" ");" +.HP \w'int\ mosquitto_connect_async('u +.BI "int mosquitto_connect_async(struct\ mosquitto\ *" "mosq" ", const\ char\ *" "host" ", int\ " "port" ", int\ " "keepalive" ");" +.HP \w'int\ mosquitto_connect_bind_async('u +.BI "int mosquitto_connect_bind_async(struct\ mosquitto\ *" "mosq" ", const\ char\ *" "host" ", int\ " "port" ", int\ " "keepalive" ", const\ char\ *" "bind_address" ");" +.HP \w'int\ mosquitto_reconnect('u +.BI "int mosquitto_reconnect(struct\ mosquitto\ *" "mosq" ");" +.HP \w'int\ mosquitto_reconnect_async('u +.BI "int mosquitto_reconnect_async(struct\ mosquitto\ *" "mosq" ");" +.HP \w'int\ mosquitto_disconnect('u +.BI "int mosquitto_disconnect(struct\ mosquitto\ *" "mosq" ");" +.SS "Publish" +.HP \w'int\ mosquitto_publish('u +.BI "int mosquitto_publish(struct\ mosquitto\ *" "mosq" ", int\ *" "mid" ", const\ char\ *" "topic" ", int\ " "payloadlen" ", const\ void\ *" "payload" ", int\ " "qos" ", bool\ " "retain" ");" +.SS "Subscribe/unsubscribe" +.HP \w'int\ mosquitto_subscribe('u +.BI "int mosquitto_subscribe(struct\ mosquitto\ *" "mosq" ", int\ *" "mid" ", const\ char\ *" "sub" ", int\ " "qos" ");" +.HP \w'int\ mosquitto_unsubscribe('u +.BI "int mosquitto_unsubscribe(struct\ mosquitto\ *" "mosq" ", int\ *" "mid" ", const\ char\ *" "sub" ");" +.SS "Network loop" +.HP \w'int\ mosquitto_loop('u +.BI "int mosquitto_loop(struct\ mosquitto\ *" "mosq" ", int\ " "timeout" ", int\ " "max_packets" ");" +.HP \w'int\ mosquitto_loop_read('u +.BI "int mosquitto_loop_read(struct\ mosquitto\ *" "mosq" ", int\ " "max_packets" ");" +.HP \w'int\ mosquitto_loop_write('u +.BI "int mosquitto_loop_write(struct\ mosquitto\ *" "mosq" ", int\ " "max_packets" ");" +.HP \w'int\ mosquitto_loop_misc('u +.BI "int mosquitto_loop_misc(struct\ mosquitto\ *" "mosq" ");" +.HP \w'int\ mosquitto_loop_forever('u +.BI "int mosquitto_loop_forever(struct\ mosquitto\ *" "mosq" ", int\ " "timeout" ", int\ " "max_packets" ");" +.HP \w'int\ mosquitto_socket('u +.BI "int mosquitto_socket(struct\ mosquitto\ *" "mosq" ");" +.HP \w'bool\ mosquitto_want_write('u +.BI "bool mosquitto_want_write(struct\ mosquitto\ *" "mosq" ");" +.SS "Threaded network loop" +.HP \w'int\ mosquitto_loop_start('u +.BI "int mosquitto_loop_start(struct\ mosquitto\ *" "mosq" ");" +.HP \w'int\ mosquitto_loop_stop('u +.BI "int mosquitto_loop_stop(struct\ mosquitto\ *" "mosq" ", bool\ " "force" ");" +.SS "Misc client functions" +.HP \w'int\ mosquitto_max_inflight_messages_set('u +.BI "int mosquitto_max_inflight_messages_set(struct\ mosquitto\ *" "mosq" ", unsigned\ int\ " "max_inflight_messages" ");" +.HP \w'int\ mosquitto_message_retry_set('u +.BI "int mosquitto_message_retry_set(struct\ mosquitto\ *" "mosq" ", unsigned\ int\ " "message_retry" ");" +.HP \w'int\ mosquitto_reconnect_delay_set('u +.BI "int mosquitto_reconnect_delay_set(struct\ mosquitto\ *" "mosq" ", unsigned\ int\ " "reconnect_delay" ", unsigned\ int\ " "reconnect_delay_max" ", bool\ " "reconnect_exponential_backoff" ");" +.HP \w'int\ mosquitto_user_data_set('u +.BI "int mosquitto_user_data_set(struct\ mosquitto\ *" "mosq" ", void\ *" "userdata" ");" +.SS "Callbacks" +.HP \w'int\ mosquitto_connect_callback_set('u +.BI "int mosquitto_connect_callback_set(struct\ mosquitto\ *" "mosq" ", void\ " "(*on_connect)(struct\ mosquitto\ *,\ void\ *,\ int)" ");" +.HP \w'int\ mosquitto_disconnect_callback_set('u +.BI "int mosquitto_disconnect_callback_set(struct\ mosquitto\ *" "mosq" ", void\ " "(*on_disconnect)(struct\ mosquitto\ *,\ void\ *,\ int)" ");" +.HP \w'int\ mosquitto_publish_callback_set('u +.BI "int mosquitto_publish_callback_set(struct\ mosquitto\ *" "mosq" ", void\ " "(*on_publish)(struct\ mosquitto\ *,\ void\ *,\ int)" ");" +.HP \w'int\ mosquitto_message_callback_set('u +.BI "int mosquitto_message_callback_set(struct\ mosquitto\ *" "mosq" ", void\ " "(*on_message)(struct\ mosquitto\ *,\ void\ *,\ const\ struct\ mosquitto_message\ *)" ");" +.HP \w'int\ mosquitto_subscribe_callback_set('u +.BI "int mosquitto_subscribe_callback_set(struct\ mosquitto\ *" "mosq" ", void\ " "(*on_subscribe)(struct\ mosquitto\ *,\ void\ *,\ int,\ int,\ const\ int\ *)" ");" +.HP \w'int\ mosquitto_unsubscribe_callback_set('u +.BI "int mosquitto_unsubscribe_callback_set(struct\ mosquitto\ *" "mosq" ", void\ " "(*on_unsubscribe)(struct\ mosquitto\ *,\ void\ *,\ int)" ");" +.HP \w'int\ mosquitto_log_callback_set('u +.BI "int mosquitto_log_callback_set(struct\ mosquitto\ *" "mosq" ", void\ " "(*on_unsubscribe)(struct\ mosquitto\ *,\ void\ *,\ int,\ const\ char\ *)" ");" +.SS "Utility functions" +.HP \w'const\ char\ *mosquitto_connack_string('u +.BI "const char *mosquitto_connack_string(int\ " "connack_code" ");" +.HP \w'int\ mosquitto_message_copy('u +.BI "int mosquitto_message_copy(struct\ mosquitto_message\ *" "dst" ", const\ struct\ mosquitto_message\ *" "src" ");" +.HP \w'int\ mosquitto_message_free('u +.BI "int mosquitto_message_free(struct\ mosquitto_message\ **" "message" ");" +.HP \w'const\ char\ *mosquitto_strerror('u +.BI "const char *mosquitto_strerror(int\ " "mosq_errno" ");" +.HP \w'int\ mosquitto_sub_topic_tokenise('u +.BI "int mosquitto_sub_topic_tokenise(const\ char\ *" "subtopic" ", char\ ***" "topics" ", int\ *" "count" ");" +.HP \w'int\ mosquitto_sub_topic_tokens_free('u +.BI "int mosquitto_sub_topic_tokens_free(char\ ***" "topics" ", int\ " "count" ");" +.HP \w'int\ mosquitto_topic_matches_sub('u +.BI "int mosquitto_topic_matches_sub(const\ char\ *" "sub" ", const\ char\ *" "topic" ", bool\ *" "result" ");" +.SH "EXAMPLES" +.PP +.if n \{\ +.RS 4 +.\} +.nf +#include +#include + +void my_message_callback(struct mosquitto *mosq, void *userdata, const struct mosquitto_message *message) +{ + if(message\->payloadlen){ + printf("%s %s\en", message\->topic, message\->payload); + }else{ + printf("%s (null)\en", message\->topic); + } + fflush(stdout); +} + +void my_connect_callback(struct mosquitto *mosq, void *userdata, int result) +{ + int i; + if(!result){ + /* Subscribe to broker information topics on successful connect\&. */ + mosquitto_subscribe(mosq, NULL, "$SYS/#", 2); + }else{ + fprintf(stderr, "Connect failed\en"); + } +} + +void my_subscribe_callback(struct mosquitto *mosq, void *userdata, int mid, int qos_count, const int *granted_qos) +{ + int i; + + printf("Subscribed (mid: %d): %d", mid, granted_qos[0]); + for(i=1; i diff --git a/src/libs/mosquitto/man/libmosquitto.3.xml b/src/libs/mosquitto/man/libmosquitto.3.xml new file mode 100644 index 0000000..0ceaf05 --- /dev/null +++ b/src/libs/mosquitto/man/libmosquitto.3.xml @@ -0,0 +1,475 @@ + + + + + + libmosquitto + 3 + Mosquitto Project + Library calls + + + + libmosquitto + MQTT version 3.1 client library + + + + Description + This is an overview of how to use libmosquitto to create MQTT + aware client programs. There may be separate man pages on each of the + functions described here in the future. There is also a binding for + libmosquitto for C++ and a Python implementation. They are not + documented here but operate in a similar way. + This is fairly incomplete, please see mosquitto.h for a better + description of the functions. + + + + libmosquitto symbol names + All public functions in libmosquitto have the prefix + "mosquitto_". Any other functions defined in the source code are to be + treated as private functions and may change between any release. Do not + use these functions! + + + + Functions + + + Library version + + int mosquitto_lib_version + int *major + int *minor + int *revision + + Obtain version information about the library. If any of + major, minor or revision are not NULL they will return the + corresponding version numbers. The return value is an integer + representation of the complete version number (e.g. 1009001 for 1.9.1) + that can be used for comparisons. + + + + Library initialisation and cleanup + + int mosquitto_lib_init + + + int mosquitto_lib_cleanup + + Call mosquitto_lib_init() before using any of the other + library functions and mosquitto_lib_cleanup() after finishing + with the library. + + + + Client constructor/destructor + + struct mosquitto *mosquitto_new + const char *id + bool clean_session + void *userdata + + Create a new mosquitto client instance. + + void mosquitto_destroy + struct mosquitto *mosq + + Use to free memory associated with a mosquitto client instance. + + int mosquitto_reinitialise + struct mosquitto *mosq + const char *id + bool clean_session + void *userdata + + + + + Authentication and encryption + + int mosquitto_username_pw_set + struct mosquitto *mosq + const char *username + const char *password + + + int mosquitto_tls_set + struct mosquitto *mosq + const char *cafile + const char *capath + const char *certfile + const char *keyfile + int (*pw_callback)(char *buf, int size, int rwflag, void *userdata) + + + + int mosquitto_tls_opts_set + struct mosquitto *mosq + int cert_reqs + const char *tls_version + const char *ciphers + + + int mosquitto_tls_insecure_set + struct mosquitto *mosq + bool value + + + int mosquitto_tls_psk_set + struct mosquitto *mosq + const char *psk + const char *identity + const char *ciphers + + + + + Wills + + int mosquitto_will_set + struct mosquitto *mosq + const char *topic + int payloadlen + const void *payload + int qos + bool retain + + + int mosquitto_will_clear + struct mosquitto *mosq + + + + + Connect/disconnect + + int mosquitto_connect + struct mosquitto *mosq + const char *host + int port + int keepalive + + + int mosquitto_connect_bind + struct mosquitto *mosq + const char *host + int port + int keepalive + const char *bind_address + + + int mosquitto_connect_async + struct mosquitto *mosq + const char *host + int port + int keepalive + + + int mosquitto_connect_bind_async + struct mosquitto *mosq + const char *host + int port + int keepalive + const char *bind_address + + + int mosquitto_reconnect + struct mosquitto *mosq + + + int mosquitto_reconnect_async + struct mosquitto *mosq + + + int mosquitto_disconnect + struct mosquitto *mosq + + + + + Publish + + int mosquitto_publish + struct mosquitto *mosq + int *mid + const char *topic + int payloadlen + const void *payload + int qos + bool retain + + + + + Subscribe/unsubscribe + + int mosquitto_subscribe + struct mosquitto *mosq + int *mid + const char *sub + int qos + + + int mosquitto_unsubscribe + struct mosquitto *mosq + int *mid + const char *sub + + + + + Network loop + + int mosquitto_loop + struct mosquitto *mosq + int timeout + int max_packets + + + int mosquitto_loop_read + struct mosquitto *mosq + int max_packets + + + int mosquitto_loop_write + struct mosquitto *mosq + int max_packets + + + int mosquitto_loop_misc + struct mosquitto *mosq + + + int mosquitto_loop_forever + struct mosquitto *mosq + int timeout + int max_packets + + + int mosquitto_socket + struct mosquitto *mosq + + + bool mosquitto_want_write + struct mosquitto *mosq + + + + + Threaded network loop + + int mosquitto_loop_start + struct mosquitto *mosq + + + int mosquitto_loop_stop + struct mosquitto *mosq + bool force + + + + + Misc client functions + + int mosquitto_max_inflight_messages_set + struct mosquitto *mosq + unsigned int max_inflight_messages + + + int mosquitto_message_retry_set + struct mosquitto *mosq + unsigned int message_retry + + + int mosquitto_reconnect_delay_set + struct mosquitto *mosq + unsigned int reconnect_delay + unsigned int reconnect_delay_max + bool reconnect_exponential_backoff + + + int mosquitto_user_data_set + struct mosquitto *mosq + void *userdata + + + + + Callbacks + + int mosquitto_connect_callback_set + struct mosquitto *mosq + void (*on_connect)(struct mosquitto *, void *, int) + + + int mosquitto_disconnect_callback_set + struct mosquitto *mosq + void (*on_disconnect)(struct mosquitto *, void *, int) + + + int mosquitto_publish_callback_set + struct mosquitto *mosq + void (*on_publish)(struct mosquitto *, void *, int) + + + int mosquitto_message_callback_set + struct mosquitto *mosq + void (*on_message)(struct mosquitto *, void *, const struct mosquitto_message *) + + + int mosquitto_subscribe_callback_set + struct mosquitto *mosq + void (*on_subscribe)(struct mosquitto *, void *, int, int, const int *) + + + int mosquitto_unsubscribe_callback_set + struct mosquitto *mosq + void (*on_unsubscribe)(struct mosquitto *, void *, int) + + + int mosquitto_log_callback_set + struct mosquitto *mosq + void (*on_unsubscribe)(struct mosquitto *, void *, int, const char *) + + + + + Utility functions + + const char *mosquitto_connack_string + int connack_code + + + int mosquitto_message_copy + struct mosquitto_message *dst + const struct mosquitto_message *src + + + int mosquitto_message_free + struct mosquitto_message **message + + + const char *mosquitto_strerror + int mosq_errno + + + int mosquitto_sub_topic_tokenise + const char *subtopic + char ***topics + int *count + + + int mosquitto_sub_topic_tokens_free + char ***topics + int count + + + int mosquitto_topic_matches_sub + const char *sub + const char *topic + bool *result + + + + + + Examples + +#include <stdio.h> +#include <mosquitto.h> + +void my_message_callback(struct mosquitto *mosq, void *userdata, const struct mosquitto_message *message) +{ + if(message->payloadlen){ + printf("%s %s\n", message->topic, message->payload); + }else{ + printf("%s (null)\n", message->topic); + } + fflush(stdout); +} + +void my_connect_callback(struct mosquitto *mosq, void *userdata, int result) +{ + int i; + if(!result){ + /* Subscribe to broker information topics on successful connect. */ + mosquitto_subscribe(mosq, NULL, "$SYS/#", 2); + }else{ + fprintf(stderr, "Connect failed\n"); + } +} + +void my_subscribe_callback(struct mosquitto *mosq, void *userdata, int mid, int qos_count, const int *granted_qos) +{ + int i; + + printf("Subscribed (mid: %d): %d", mid, granted_qos[0]); + for(i=1; i<qos_count; i++){ + printf(", %d", granted_qos[i]); + } + printf("\n"); +} + +void my_log_callback(struct mosquitto *mosq, void *userdata, int level, const char *str) +{ + /* Pring all log messages regardless of level. */ + printf("%s\n", str); +} + +int main(int argc, char *argv[]) +{ + int i; + char *host = "localhost"; + int port = 1883; + int keepalive = 60; + bool clean_session = true; + struct mosquitto *mosq = NULL; + + mosquitto_lib_init(); + mosq = mosquitto_new(NULL, clean_session, NULL); + if(!mosq){ + fprintf(stderr, "Error: Out of memory.\n"); + return 1; + } + mosquitto_log_callback_set(mosq, my_log_callback); + mosquitto_connect_callback_set(mosq, my_connect_callback); + mosquitto_message_callback_set(mosq, my_message_callback); + mosquitto_subscribe_callback_set(mosq, my_subscribe_callback); + + if(mosquitto_connect(mosq, host, port, keepalive)){ + fprintf(stderr, "Unable to connect.\n"); + return 1; + } + + mosquitto_loop_forever(mosq, -1, 1); + + mosquitto_destroy(mosq); + mosquitto_lib_cleanup(); + return 0; +} + + + + See Also + + + + mosquitto + 8 + + + mqtt + 7 + + + + + + + Author + Roger Light roger@atchoo.org + + diff --git a/src/libs/mosquitto/man/manpage.xsl b/src/libs/mosquitto/man/manpage.xsl new file mode 100644 index 0000000..0ebd8d4 --- /dev/null +++ b/src/libs/mosquitto/man/manpage.xsl @@ -0,0 +1,14 @@ + + + + + + 0 + 0 + + http://mosquitto.org/man/ + + + + ansi + diff --git a/src/libs/mosquitto/man/mosquitto-tls.7 b/src/libs/mosquitto/man/mosquitto-tls.7 new file mode 100644 index 0000000..6cea1c7 --- /dev/null +++ b/src/libs/mosquitto/man/mosquitto-tls.7 @@ -0,0 +1,164 @@ +'\" t +.\" Title: mosquitto-tls +.\" Author: [see the "Author" section] +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 07/10/2017 +.\" Manual: Conventions and miscellaneous +.\" Source: Mosquitto Project +.\" Language: English +.\" +.TH "MOSQUITTO\-TLS" "7" "07/10/2017" "Mosquitto Project" "Conventions and miscellaneous" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +mosquitto-tls \- Configure SSL/TLS support for Mosquitto +.SH "DESCRIPTION" +.PP +\fBmosquitto\fR +provides SSL support for encrypted network connections and authentication\&. This manual describes how to create the files needed\&. +.if n \{\ +.sp +.\} +.RS 4 +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 +\fBNote\fR +.ps -1 +.br +.PP +It is important to use different certificate subject parameters for your CA, server and clients\&. If the certificates appear identical, even though generated separately, the broker/client will not be able to distinguish between them and you will experience difficult to diagnose errors\&. +.sp .5v +.RE +.SH "CERTIFICATE AUTHORITY" +.PP +Generate a certificate authority certificate and key\&. +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +openssl req \-new \-x509 \-days \-extensions v3_ca \-keyout ca\&.key \-out ca\&.crt +.RE +.SH "SERVER" +.PP +Generate a server key\&. +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +openssl genrsa \-des3 \-out server\&.key 2048 +.RE +.PP +Generate a server key without encryption\&. +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +openssl genrsa \-out server\&.key 2048 +.RE +.PP +Generate a certificate signing request to send to the CA\&. +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +openssl req \-out server\&.csr \-key server\&.key \-new +.RE +.PP +Send the CSR to the CA, or sign it with your CA key: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +openssl x509 \-req \-in server\&.csr \-CA ca\&.crt \-CAkey ca\&.key \-CAcreateserial \-out server\&.crt \-days +.RE +.SH "CLIENT" +.PP +Generate a client key\&. +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +openssl genrsa \-des3 \-out client\&.key 2048 +.RE +.PP +Generate a certificate signing request to send to the CA\&. +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +openssl req \-out client\&.csr \-key client\&.key \-new +.RE +.PP +Send the CSR to the CA, or sign it with your CA key: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +openssl x509 \-req \-in client\&.csr \-CA ca\&.crt \-CAkey ca\&.key \-CAcreateserial \-out client\&.crt \-days +.RE +.SH "SEE ALSO" +\fBmosquitto\fR(8), \fBmosquitto-conf\fR(5) +.SH "AUTHOR" +.PP +Roger Light + diff --git a/src/libs/mosquitto/man/mosquitto-tls.7.xml b/src/libs/mosquitto/man/mosquitto-tls.7.xml new file mode 100644 index 0000000..1fa40f7 --- /dev/null +++ b/src/libs/mosquitto/man/mosquitto-tls.7.xml @@ -0,0 +1,100 @@ + + + + + + mosquitto-tls + 7 + Mosquitto Project + Conventions and miscellaneous + + + + mosquitto-tls + Configure SSL/TLS support for Mosquitto + + + + Description + mosquitto provides SSL support for encrypted + network connections and authentication. This manual describes how + to create the files needed. + It is important to use different certificate subject + parameters for your CA, server and clients. If the certificates + appear identical, even though generated separately, the + broker/client will not be able to distinguish between them and + you will experience difficult to diagnose errors. + + + + Certificate Authority + Generate a certificate authority certificate and key. + + openssl req -new -x509 -days <duration> -extensions v3_ca -keyout ca.key -out ca.crt + + + + + Server + Generate a server key. + + openssl genrsa -des3 -out server.key 2048 + + + Generate a server key without encryption. + + openssl genrsa -out server.key 2048 + + + Generate a certificate signing request to send to the CA. + + openssl req -out server.csr -key server.key -new + + + Send the CSR to the CA, or sign it with your CA key: + + openssl x509 -req -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out server.crt -days <duration> + + + + + Client + Generate a client key. + + openssl genrsa -des3 -out client.key 2048 + + + Generate a certificate signing request to send to the CA. + + openssl req -out client.csr -key client.key -new + + + Send the CSR to the CA, or sign it with your CA key: + + openssl x509 -req -in client.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out client.crt -days <duration> + + + + + See Also + + + + mosquitto + 8 + + + + + mosquitto-conf + 5 + + + + + + + Author + Roger Light roger@atchoo.org + + diff --git a/src/libs/mosquitto/man/mosquitto.8 b/src/libs/mosquitto/man/mosquitto.8 new file mode 100644 index 0000000..eddf034 --- /dev/null +++ b/src/libs/mosquitto/man/mosquitto.8 @@ -0,0 +1,470 @@ +'\" t +.\" Title: mosquitto +.\" Author: [see the "Author" section] +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 07/10/2017 +.\" Manual: System management commands +.\" Source: Mosquitto Project +.\" Language: English +.\" +.TH "MOSQUITTO" "8" "07/10/2017" "Mosquitto Project" "System management commands" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +mosquitto \- an MQTT broker +.SH "SYNOPSIS" +.HP \w'\fBmosquitto\fR\ 'u +\fBmosquitto\fR [\-c\ \fIconfig\ file\fR] [\-d | \-\-daemon] [\-p\ \fIport\ number\fR] [\-v] +.SH "DESCRIPTION" +.PP +\fBmosquitto\fR +is a broker for the MQTT protocol version 3\&.1\&. +.SH "OPTIONS" +.PP +\fB\-c\fR, \fB\-\-config\-file\fR +.RS 4 +Load configuration from a file\&. If not given, the default values as described in +\fBmosquitto.conf\fR(5) +are used\&. +.RE +.PP +\fB\-d\fR, \fB\-\-daemon\fR +.RS 4 +Run +\fBmosquitto\fR +in the background as a daemon\&. All other behaviour remains the same\&. +.RE +.PP +\fB\-p\fR, \fB\-\-port\fR +.RS 4 +Listen on the port specified instead of the default 1883\&. This acts in addition to the port setting in the config file\&. May be specified multiple times to open multiple sockets listening on different ports\&. This socket will be bound to all network interfaces\&. +.RE +.PP +\fB\-v\fR, \fB\-\-verbose\fR +.RS 4 +Use verbose logging\&. This is equivalent to setting +\fBlog_type\fR +to +\fBall\fR +in the configuration file\&. This overrides and logging options given in the configuration file\&. +.RE +.SH "CONFIGURATION" +.PP +The broker can be configured using a configuration file as described in +\fBmosquitto.conf\fR(5) +and this is the main point of information for mosquitto\&. The files required for SSL/TLS support are described in +\fBmosquitto-tls\fR(7)\&. +.SH "BROKER STATUS" +.PP +Clients can find information about the broker by subscribing to topics in the $SYS hierarchy as follows\&. Topics marked as static are only sent once per client on subscription\&. All other topics are updated every +\fBsys_interval\fR +seconds\&. If +\fBsys_interval\fR +is 0, then updates are not sent\&. +.PP +Note that if you are using a command line client to interact with the $SYS topics and your shell interprets $ as an environment variable, you need to place the topic in single quotes \*(Aq$SYS/\&.\&.\&.\*(Aq or to escape the dollar symbol: \e$SYS/\&.\&.\&. otherwise the $SYS will be treated as an environment variable\&. +.PP +\fB$SYS/broker/bytes/received\fR +.RS 4 +The total number of bytes received since the broker started\&. +.RE +.PP +\fB$SYS/broker/bytes/sent\fR +.RS 4 +The total number of bytes sent since the broker started\&. +.RE +.PP +\fB$SYS/broker/clients/connected\fR, \fB$SYS/broker/clients/active\fR (deprecated) +.RS 4 +The number of currently connected clients\&. +.RE +.PP +\fB$SYS/broker/clients/expired\fR +.RS 4 +The number of disconnected persistent clients that have been expired and removed through the persistent_client_expiration option\&. +.RE +.PP +\fB$SYS/broker/clients/disconnected\fR, \fB$SYS/broker/clients/inactive\fR (deprecated) +.RS 4 +The total number of persistent clients (with clean session disabled) that are registered at the broker but are currently disconnected\&. +.RE +.PP +\fB$SYS/broker/clients/maximum\fR +.RS 4 +The maximum number of clients that have been connected to the broker at the same time\&. +.RE +.PP +\fB$SYS/broker/clients/total\fR +.RS 4 +The total number of active and inactive clients currently connected and registered on the broker\&. +.RE +.PP +\fB$SYS/broker/connection/#\fR +.RS 4 +When bridges are configured to/from the broker, common practice is to provide a status topic that indicates the state of the connection\&. This is provided within $SYS/broker/connection/ by default\&. If the value of the topic is 1 the connection is active, if 0 then it is not active\&. See the Bridges section below for more information on bridges\&. +.RE +.PP +\fB$SYS/broker/heap/current size\fR +.RS 4 +The current size of the heap memory in use by mosquitto\&. Note that this topic may be unavailable depending on compile time options\&. +.RE +.PP +\fB$SYS/broker/heap/maximum size\fR +.RS 4 +The largest amount of heap memory used by mosquitto\&. Note that this topic may be unavailable depending on compile time options\&. +.RE +.PP +\fB$SYS/broker/load/connections/+\fR +.RS 4 +The moving average of the number of CONNECT packets received by the broker over different time intervals\&. The final "+" of the hierarchy can be 1min, 5min or 15min\&. The value returned represents the number of connections received in 1 minute, averaged over 1, 5 or 15 minutes\&. +.RE +.PP +\fB$SYS/broker/load/bytes/received/+\fR +.RS 4 +The moving average of the number of bytes received by the broker over different time intervals\&. The final "+" of the hierarchy can be 1min, 5min or 15min\&. The value returned represents the number of bytes received in 1 minute, averaged over 1, 5 or 15 minutes\&. +.RE +.PP +\fB$SYS/broker/load/bytes/sent/+\fR +.RS 4 +The moving average of the number of bytes sent by the broker over different time intervals\&. The final "+" of the hierarchy can be 1min, 5min or 15min\&. The value returned represents the number of bytes sent in 1 minute, averaged over 1, 5 or 15 minutes\&. +.RE +.PP +\fB$SYS/broker/load/messages/received/+\fR +.RS 4 +The moving average of the number of all types of MQTT messages received by the broker over different time intervals\&. The final "+" of the hierarchy can be 1min, 5min or 15min\&. The value returned represents the number of messages received in 1 minute, averaged over 1, 5 or 15 minutes\&. +.RE +.PP +\fB$SYS/broker/load/messages/sent/+\fR +.RS 4 +The moving average of the number of all types of MQTT messages sent by the broker over different time intervals\&. The final "+" of the hierarchy can be 1min, 5min or 15min\&. The value returned represents the number of messages send in 1 minute, averaged over 1, 5 or 15 minutes\&. +.RE +.PP +\fB$SYS/broker/load/publish/dropped/+\fR +.RS 4 +The moving average of the number of publish messages dropped by the broker over different time intervals\&. This shows the rate at which durable clients that are disconnected are losing messages\&. The final "+" of the hierarchy can be 1min, 5min or 15min\&. The value returned represents the number of messages dropped in 1 minute, averaged over 1, 5 or 15 minutes\&. +.RE +.PP +\fB$SYS/broker/load/publish/received/+\fR +.RS 4 +The moving average of the number of publish messages received by the broker over different time intervals\&. The final "+" of the hierarchy can be 1min, 5min or 15min\&. The value returned represents the number of publish messages received in 1 minute, averaged over 1, 5 or 15 minutes\&. +.RE +.PP +\fB$SYS/broker/load/publish/sent/+\fR +.RS 4 +The moving average of the number of publish messages sent by the broker over different time intervals\&. The final "+" of the hierarchy can be 1min, 5min or 15min\&. The value returned represents the number of publish messages sent in 1 minute, averaged over 1, 5 or 15 minutes\&. +.RE +.PP +\fB$SYS/broker/load/sockets/+\fR +.RS 4 +The moving average of the number of socket connections opened to the broker over different time intervals\&. The final "+" of the hierarchy can be 1min, 5min or 15min\&. The value returned represents the number of socket connections in 1 minute, averaged over 1, 5 or 15 minutes\&. +.RE +.PP +\fB$SYS/broker/messages/inflight\fR +.RS 4 +The number of messages with QoS>0 that are awaiting acknowledgments\&. +.RE +.PP +\fB$SYS/broker/messages/received\fR +.RS 4 +The total number of messages of any type received since the broker started\&. +.RE +.PP +\fB$SYS/broker/messages/sent\fR +.RS 4 +The total number of messages of any type sent since the broker started\&. +.RE +.PP +\fB$SYS/broker/messages/stored\fR +.RS 4 +The number of messages currently held in the message store\&. This includes retained messages and messages queued for durable clients\&. +.RE +.PP +\fB$SYS/broker/publish/messages/dropped\fR +.RS 4 +The total number of publish messages that have been dropped due to inflight/queuing limits\&. See the max_inflight_messages and max_queued_messages options in +\fBmosquitto.conf\fR(5) +for more information\&. +.RE +.PP +\fB$SYS/broker/publish/messages/received\fR +.RS 4 +The total number of PUBLISH messages received since the broker started\&. +.RE +.PP +\fB$SYS/broker/publish/messages/sent\fR +.RS 4 +The total number of PUBLISH messages sent since the broker started\&. +.RE +.PP +\fB$SYS/broker/retained messages/count\fR +.RS 4 +The total number of retained messages active on the broker\&. +.RE +.PP +\fB$SYS/broker/subscriptions/count\fR +.RS 4 +The total number of subscriptions active on the broker\&. +.RE +.PP +\fB$SYS/broker/timestamp\fR +.RS 4 +The timestamp at which this particular build of the broker was made\&. Static\&. +.RE +.PP +\fB$SYS/broker/uptime\fR +.RS 4 +The amount of time in seconds the broker has been online\&. +.RE +.PP +\fB$SYS/broker/version\fR +.RS 4 +The version of the broker\&. Static\&. +.RE +.SH "WILDCARD TOPIC SUBSCRIPTIONS" +.PP +In addition to allowing clients to subscribe to specific topics, mosquitto also allows the use of two wildcards in subscriptions\&. +\fB+\fR +is the wildcard used to match a single level of hierarchy\&. For example, for a topic of "a/b/c/d", the following example subscriptions will match: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +a/b/c/d +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} ++/b/c/d +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +a/+/c/d +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +a/+/+/d +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} ++/+/+/+ +.RE +.PP +The following subscriptions will not match: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +a/b/c +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +b/+/c/d +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} ++/+/+ +.RE +.PP +The second wildcard is +\fB#\fR +and is used to match all subsequent levels of hierarchy\&. With a topic of "a/b/c/d", the following example subscriptions will match: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +a/b/c/d +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +# +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +a/# +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +a/b/# +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +a/b/c/# +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} ++/b/c/# +.RE +.PP +The $SYS hierarchy does not match a subscription of "#"\&. If you want to observe the entire $SYS hierarchy, subscribe to $SYS/#\&. +.PP +Note that the wildcards must be only ever used on their own, so a subscription of "a/b+/c" is not valid use of a wildcard\&. The +\fB#\fR +wildcard must only ever be used as the final character of a subscription\&. +.SH "BRIDGES" +.PP +Multiple brokers can be connected together with the bridging functionality\&. This is useful where it is desirable to share information between locations, but where not all of the information needs to be shared\&. An example could be where a number of users are running a broker to help record power usage and for a number of other reasons\&. The power usage could be shared through bridging all of the user brokers to a common broker, allowing the power usage of all users to be collected and compared\&. The other information would remain local to each broker\&. +.PP +For information on configuring bridges, see +\fBmosquitto.conf\fR(5)\&. +.SH "SIGNALS" +.PP +SIGHUP +.RS 4 +Upon receiving the SIGHUP signal, mosquitto will attempt to reload configuration file data, assuming that the +\fB\-c\fR +argument was provided when mosquitto was started\&. Not all configuration parameters can be reloaded without restarting\&. See +\fBmosquitto.conf\fR(5) +for details\&. +.RE +.PP +SIGUSR1 +.RS 4 +Upon receiving the SIGUSR1 signal, mosquitto will write the persistence database to disk\&. This signal is only acted upon if persistence is enabled\&. +.RE +.PP +SIGUSR2 +.RS 4 +The SIGUSR2 signal causes mosquitto to print out the current subscription tree, along with information about where retained messages exist\&. This is intended as a testing feature only and may be removed at any time\&. +.RE +.SH "FILES" +.PP +/etc/mosquitto/mosquitto\&.conf +.RS 4 +Configuration file\&. See +\fBmosquitto.conf\fR(5)\&. +.RE +.PP +/var/lib/mosquitto/mosquitto\&.db +.RS 4 +Persistent message data storage location if persist enabled\&. +.RE +.PP +/etc/hosts\&.allow, /etc/hosts\&.deny +.RS 4 +Host access control via tcp\-wrappers as described in +\fBhosts_access\fR(5)\&. +.RE +.SH "BUGS" +.PP +\fBmosquitto\fR +bug information can be found at +\m[blue]\fB\%https://github.com/eclipse/mosquitto/issues\fR\m[] +.SH "SEE ALSO" +\fBmqtt\fR(7), \fBmosquitto-tls\fR(7), \fBmosquitto.conf\fR(5), \fBhosts_access\fR(5), \fBmosquitto_passwd\fR(1), \fBmosquitto_pub\fR(1), \fBmosquitto_sub\fR(1), \fBlibmosquitto\fR(3) +.SH "THANKS" +.PP +Thanks to Andy Stanford\-Clark for being one of the people who came up with MQTT in the first place\&. Thanks to Andy and Nicholas O\*(AqLeary for providing clarifications of the protocol\&. +.PP +Thanks also to everybody at the Ubuntu UK Podcast and Linux Outlaws for organising OggCamp, where Andy gave a talk that inspired mosquitto\&. +.SH "AUTHOR" +.PP +Roger Light + diff --git a/src/libs/mosquitto/man/mosquitto.8.xml b/src/libs/mosquitto/man/mosquitto.8.xml new file mode 100644 index 0000000..ecec6bf --- /dev/null +++ b/src/libs/mosquitto/man/mosquitto.8.xml @@ -0,0 +1,548 @@ + + + + + + mosquitto + 8 + Mosquitto Project + System management commands + + + + mosquitto + an MQTT broker + + + + + mosquitto + -c config file + + -d + --daemon + + -p port number + -v + + + + + Description + mosquitto is a broker for the MQTT protocol version 3.1. + + + + Options + + + + + + Load configuration from a file. If not given, the default values as described in mosquitto.conf5 are used. + + + + + + + Run mosquitto in the background as a daemon. All other behaviour remains the same. + + + + + + + Listen on the port specified instead of the default 1883. This acts in addition to the port setting in the config file. May be specified multiple times to open multiple sockets listening on different ports. This socket will be bound to all network interfaces. + + + + + + + Use verbose logging. This is equivalent to setting + to in + the configuration file. This overrides and logging + options given in the configuration file. + + + + + + + Configuration + The broker can be configured using a configuration file as + described in + mosquitto.conf5 + and this is the main point of information for mosquitto. + The files required for SSL/TLS support are described in + mosquitto-tls7. + + + + + Broker Status + Clients can find information about the broker by subscribing to + topics in the $SYS hierarchy as follows. Topics marked as static are + only sent once per client on subscription. All other topics are updated + every seconds. If + is 0, then updates are not sent. + Note that if you are using a command line client to interact with the + $SYS topics and your shell interprets $ as an environment variable, + you need to place the topic in single quotes '$SYS/...' or to + escape the dollar symbol: \$SYS/... otherwise the $SYS will be + treated as an environment variable. + + + + + The total number of bytes received since the broker + started. + + + + + + The total number of bytes sent since the broker + started. + + + + + (deprecated) + + The number of currently connected clients. + + + + + + The number of disconnected persistent clients that + have been expired and removed through the + persistent_client_expiration option. + + + + + (deprecated) + + The total number of persistent clients (with clean + session disabled) that are registered at the broker but are + currently disconnected. + + + + + + The maximum number of clients that have been + connected to the broker at the same time. + + + + + + The total number of active and inactive clients + currently connected and registered on the + broker. + + + + + + When bridges are configured to/from the broker, + common practice is to provide a status topic that + indicates the state of the connection. This is provided + within $SYS/broker/connection/ by default. If the value + of the topic is 1 the connection is active, if 0 then + it is not active. See the Bridges section below for + more information on bridges. + + + + + + The current size of the heap memory in use by + mosquitto. Note that this topic may be unavailable + depending on compile time options. + + + + + + The largest amount of heap memory used by + mosquitto. Note that this topic may be unavailable + depending on compile time options. + + + + + + The moving average of the number of CONNECT packets + received by the broker over different time intervals. + The final "+" of the hierarchy can be 1min, 5min or + 15min. The value returned represents the number of + connections received in 1 minute, averaged over 1, 5 or + 15 minutes. + + + + + + The moving average of the number of bytes received by + the broker over different time intervals. The final "+" + of the hierarchy can be 1min, 5min or 15min. The value + returned represents the number of bytes received in 1 + minute, averaged over 1, 5 or 15 minutes. + + + + + + The moving average of the number of bytes sent by the + broker over different time intervals. The final "+" of + the hierarchy can be 1min, 5min or 15min. The value + returned represents the number of bytes sent in 1 + minute, averaged over 1, 5 or 15 minutes. + + + + + + The moving average of the number of all types of MQTT + messages received by the broker over different time + intervals. The final "+" of the hierarchy can be 1min, + 5min or 15min. The value returned represents the number + of messages received in 1 minute, averaged over 1, 5 or + 15 minutes. + + + + + + The moving average of the number of all types of MQTT + messages sent by the broker over different time + intervals. The final "+" of the hierarchy can be 1min, + 5min or 15min. The value returned represents the number + of messages send in 1 minute, averaged over 1, 5 or 15 + minutes. + + + + + + The moving average of the number of publish messages + dropped by the broker over different time intervals. + This shows the rate at which durable clients that are + disconnected are losing messages. The final "+" of the + hierarchy can be 1min, 5min or 15min. The value + returned represents the number of messages dropped in 1 + minute, averaged over 1, 5 or 15 minutes. + + + + + + The moving average of the number of publish messages + received by the broker over different time intervals. + The final "+" of the hierarchy can be 1min, 5min or + 15min. The value returned represents the number of + publish messages received in 1 minute, averaged over 1, + 5 or 15 minutes. + + + + + + The moving average of the number of publish messages + sent by the broker over different time intervals. The + final "+" of the hierarchy can be 1min, 5min or 15min. + The value returned represents the number of publish + messages sent in 1 minute, averaged over 1, 5 or 15 + minutes. + + + + + + The moving average of the number of socket + connections opened to the broker over different time + intervals. The final "+" of the hierarchy can be 1min, + 5min or 15min. The value returned represents the number + of socket connections in 1 minute, averaged over 1, 5 + or 15 minutes. + + + + + + The number of messages with QoS>0 that are awaiting + acknowledgments. + + + + + + The total number of messages of any type received since the broker started. + + + + + + The total number of messages of any type sent since the broker started. + + + + + + The number of messages currently held in the message + store. This includes retained messages and messages + queued for durable clients. + + + + + + The total number of publish messages that have been + dropped due to inflight/queuing limits. See the + max_inflight_messages and max_queued_messages options + in + mosquitto.conf5 + for more information. + + + + + + The total number of PUBLISH messages received since the broker started. + + + + + + The total number of PUBLISH messages sent since the broker started. + + + + + + The total number of retained messages active on the broker. + + + + + + The total number of subscriptions active on the broker. + + + + + + The timestamp at which this particular build of the broker was made. Static. + + + + + + The amount of time in seconds the broker has been online. + + + + + + The version of the broker. Static. + + + + + + + Wildcard Topic Subscriptions + In addition to allowing clients to subscribe to specific topics, + mosquitto also allows the use of two wildcards in subscriptions. + is the wildcard used to match a single level of + hierarchy. For example, for a topic of "a/b/c/d", the following example + subscriptions will match: + + a/b/c/d + +/b/c/d + a/+/c/d + a/+/+/d + +/+/+/+ + + The following subscriptions will not match: + + a/b/c + b/+/c/d + +/+/+ + + The second wildcard is and is used to match + all subsequent levels of hierarchy. With a topic of "a/b/c/d", the + following example subscriptions will match: + + a/b/c/d + # + a/# + a/b/# + a/b/c/# + +/b/c/# + + The $SYS hierarchy does not match a subscription of + "#". If you want to observe the entire $SYS hierarchy, subscribe to + $SYS/#. + Note that the wildcards must be only ever used on their own, so a + subscription of "a/b+/c" is not valid use of a wildcard. The + wildcard must only ever be used as the final + character of a subscription. + + + + Bridges + Multiple brokers can be connected together with the bridging + functionality. This is useful where it is desirable to share + information between locations, but where not all of the information + needs to be shared. An example could be where a number of users are + running a broker to help record power usage and for a number of other + reasons. The power usage could be shared through bridging all of the + user brokers to a common broker, allowing the power usage of all + users to be collected and compared. The other information would remain + local to each + broker. + For information on configuring bridges, see + mosquitto.conf5. + + + + Signals + + + SIGHUP + + Upon receiving the SIGHUP signal, mosquitto will + attempt to reload configuration file data, assuming that + the argument was provided when + mosquitto was started. Not all configuration parameters can + be reloaded without restarting. See + mosquitto.conf5 + for details. + + + + SIGUSR1 + + Upon receiving the SIGUSR1 signal, mosquitto will + write the persistence database to disk. This signal is only + acted upon if persistence is enabled. + + + + SIGUSR2 + + The SIGUSR2 signal causes mosquitto to print out the + current subscription tree, along with information about + where retained messages exist. This is intended as a + testing feature only and may be removed at any time. + + + + + + + Files + + + /etc/mosquitto/mosquitto.conf + + Configuration file. See mosquitto.conf5. + + + + /var/lib/mosquitto/mosquitto.db + + Persistent message data storage location if persist enabled. + + + + /etc/hosts.allow + /etc/hosts.deny + + Host access control via tcp-wrappers as described in hosts_access5. + + + + + + + Bugs + mosquitto bug information can be found at + + + + + See Also + + + + mqtt + 7 + + + + + mosquitto-tls + 7 + + + + + mosquitto.conf + 5 + + + + + hosts_access + 5 + + + + + mosquitto_passwd + 1 + + + + + mosquitto_pub + 1 + + + + + mosquitto_sub + 1 + + + + + libmosquitto + 3 + + + + + + + Thanks + Thanks to Andy Stanford-Clark for being one of the people who + came up with MQTT in the first place. Thanks to Andy and Nicholas + O'Leary for providing clarifications of the protocol. + Thanks also to everybody at the Ubuntu UK Podcast and Linux + Outlaws for organising OggCamp, where Andy gave a talk that + inspired mosquitto. + + + + Author + Roger Light roger@atchoo.org + + diff --git a/src/libs/mosquitto/man/mosquitto.conf.5 b/src/libs/mosquitto/man/mosquitto.conf.5 new file mode 100644 index 0000000..f7bf32a --- /dev/null +++ b/src/libs/mosquitto/man/mosquitto.conf.5 @@ -0,0 +1,1162 @@ +'\" t +.\" Title: mosquitto.conf +.\" Author: [see the "Author" section] +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 07/10/2017 +.\" Manual: File formats and conventions +.\" Source: Mosquitto Project +.\" Language: English +.\" +.TH "MOSQUITTO\&.CONF" "5" "07/10/2017" "Mosquitto Project" "File formats and conventions" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +mosquitto.conf \- the configuration file for mosquitto +.SH "SYNOPSIS" +.HP \w'\fBmosquitto\&.conf\fR\ 'u +\fBmosquitto\&.conf\fR +.SH "DESCRIPTION" +.PP +\fBmosquitto\&.conf\fR +is the configuration file for mosquitto\&. This file can reside anywhere as long as mosquitto can read it\&. By default, mosquitto does not need a configuration file and will use the default values listed below\&. See +\fBmosquitto\fR(8) +for information on how to load a configuration file\&. +.SH "FILE FORMAT" +.PP +All lines with a # as the very first character are treated as a comment\&. +.PP +Configuration lines start with a variable name\&. The variable value is separated from the name by a single space\&. +.SH "AUTHENTICATION" +.PP +The authentication options described below allow a wide range of possibilities in conjunction with the listener options\&. This section aims to clarify the possibilities\&. +.PP +The simplest option is to have no authentication at all\&. This is the default if no other options are given\&. Unauthenticated encrypted support is provided by using the certificate based SSL/TLS based options cafile/capath, certfile and keyfile\&. +.PP +MQTT provides username/password authentication as part of the protocol\&. Use the password_file option to define the valid usernames and passwords\&. Be sure to use network encryption if you are using this option otherwise the username and password will be vulnerable to interception\&. +.PP +When using certificate based encryption there are two options that affect authentication\&. The first is require_certificate, which may be set to true or false\&. If false, the SSL/TLS component of the client will verify the server but there is no requirement for the client to provide anything for the server: authentication is limited to the MQTT built in username/password\&. If require_certificate is true, the client must provide a valid certificate in order to connect successfully\&. In this case, the second option, use_identity_as_username, becomes relevant\&. If set to true, the Common Name (CN) from the client certificate is used instead of the MQTT username for access control purposes\&. The password is not replaced because it is assumed that only authenticated clients have valid certificates\&. If use_identity_as_username is false, the client must authenticate as normal (if required by password_file) through the MQTT options\&. +.PP +When using pre\-shared\-key based encryption through the psk_hint and psk_file options, the client must provide a valid identity and key in order to connect to the broker before any MQTT communication takes place\&. If use_identity_as_username is true, the PSK identity is used instead of the MQTT username for access control purposes\&. If use_identity_as_username is false, the client may still authenticate using the MQTT username/password if using the password_file option\&. +.PP +Both certificate and PSK based encryption are configured on a per\-listener basis\&. +.PP +Authentication plugins can be created to replace the password_file and psk_file options (as well as the ACL options) with e\&.g\&. SQL based lookups\&. +.PP +It is possible to support multiple authentication schemes at once\&. A config could be created that had a listener for all of the different encryption options described above and hence a large number of ways of authenticating\&. +.SH "GENERAL OPTIONS" +.PP +\fBacl_file\fR \fIfile path\fR +.RS 4 +Set the path to an access control list file\&. If defined, the contents of the file are used to control client access to topics on the broker\&. +.sp +If this parameter is defined then only the topics listed will have access\&. Topic access is added with lines of the format: +.sp +topic [read|write|readwrite] +.sp +The access type is controlled using "read", "write" or "readwrite"\&. This parameter is optional (unless includes a space character) \- if not given then the access is read/write\&. can contain the + or # wildcards as in subscriptions\&. +.sp +The first set of topics are applied to anonymous clients, assuming +\fBallow_anonymous\fR +is true\&. User specific topic ACLs are added after a user line as follows: +.sp +user +.sp +The username referred to here is the same as in +\fBpassword_fil\fRe\&. It is not the clientid\&. +.sp +It is also possible to define ACLs based on pattern substitution within the topic\&. The form is the same as for the topic keyword, but using pattern as the keyword\&. +.sp +pattern [read|write|readwrite] +.sp +The patterns available for substition are: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +%c to match the client id of the client +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +%u to match the username of the client +.RE +.sp +The substitution pattern must be the only text for that level of hierarchy\&. Pattern ACLs apply to all users even if the "user" keyword has previously been given\&. +.sp +Example: +.sp +pattern write sensor/%u/data +.sp +Allow access for bridge connection messages: +.sp +pattern write $SYS/broker/connection/%c/state +.sp +If the first character of a line of the ACL file is a # it is treated as a comment\&. +.sp +Reloaded on reload signal\&. The currently loaded ACLs will be freed and reloaded\&. Existing subscriptions will be affected after the reload\&. +.RE +.PP +\fBallow_anonymous\fR [ true | false ] +.RS 4 +Boolean value that determines whether clients that connect without providing a username are allowed to connect\&. If set to +\fIfalse\fR +then another means of connection should be created to control authenticated client access\&. Defaults to +\fItrue\fR\&. +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBallow_duplicate_messages\fR [ true | false ] +.RS 4 +If a client is subscribed to multiple subscriptions that overlap, e\&.g\&. foo/# and foo/+/baz , then MQTT expects that when the broker receives a message on a topic that matches both subscriptions, such as foo/bar/baz, then the client should only receive the message once\&. +.sp +Mosquitto keeps track of which clients a message has been sent to in order to meet this requirement\&. This option allows this behaviour to be disabled, which may be useful if you have a large number of clients subscribed to the same set of topics and want to minimise memory usage\&. +.sp +It can be safely set to +\fItrue\fR +if you know in advance that your clients will never have overlapping subscriptions, otherwise your clients must be able to correctly deal with duplicate messages even when then have QoS=2\&. +.sp +Defaults to +\fItrue\fR\&. +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBauth_opt_*\fR \fIvalue\fR +.RS 4 +Options to be passed to the auth plugin\&. See the specific plugin instructions\&. +.RE +.PP +\fBauth_plugin\fR \fIfile path\fR +.RS 4 +Specify an external module to use for authentication and access control\&. This allows custom username/password and access control functions to be created\&. +.sp +Not currently reloaded on reload signal\&. +.RE +.PP +\fBauth_plugin_deny_special_chars\fR [ true | false ] +.RS 4 +If +\fItrue\fR +then before an ACL check is made, the username/client id of the client needing the check is searched for the presence of either a \*(Aq+\*(Aq or \*(Aq#\*(Aq character\&. If either of these characters is found in either the username or client id, then the ACL check is denied before it is sent to the plugin\&. +.sp +This check prevents the case where a malicious user could circumvent an ACL check by using one of these characters as their username or client id\&. This is the same issue as was reported with mosquitto itself as CVE\-2017\-7650\&. +.sp +If you are entirely sure that the plugin you are using is not vulnerable to this attack (i\&.e\&. if you never use usernames or client ids in topics) then you can disable this extra check and hence have all ACL checks delivered to your plugin by setting this option to +\fIfalse\fR\&. +.sp +Defaults to +\fItrue\fR\&. +.sp +Not currently reloaded on reload signal\&. +.RE +.PP +\fBautosave_interval\fR \fIseconds\fR +.RS 4 +The number of seconds that mosquitto will wait between each time it saves the in\-memory database to disk\&. If set to 0, the in\-memory database will only be saved when mosquitto exits or when receiving the SIGUSR1 signal\&. Note that this setting only has an effect if persistence is enabled\&. Defaults to 1800 seconds (30 minutes)\&. +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBautosave_on_changes\fR [ true | false ] +.RS 4 +If +\fItrue\fR, mosquitto will count the number of subscription changes, retained messages received and queued messages and if the total exceeds +\fBautosave_interval\fR +then the in\-memory database will be saved to disk\&. If +\fIfalse\fR, mosquitto will save the in\-memory database to disk by treating +\fBautosave_interval\fR +as a time in seconds\&. +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBclientid_prefixes\fR \fIprefix\fR +.RS 4 +If defined, only clients that have a clientid with a prefix that matches clientid_prefixes will be allowed to connect to the broker\&. For example, setting "secure\-" here would mean a client "secure\-client" could connect but another with clientid "mqtt" couldn\*(Aqt\&. By default, all client ids are valid\&. +.sp +Reloaded on reload signal\&. Note that currently connected clients will be unaffected by any changes\&. +.RE +.PP +\fBconnection_messages\fR [ true | false ] +.RS 4 +If set to +\fItrue\fR, the log will include entries when clients connect and disconnect\&. If set to +\fIfalse\fR, these entries will not appear\&. +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBinclude_dir\fR \fIdir\fR +.RS 4 +External configuration files may be included by using the include_dir option\&. This defines a directory that will be searched for config files\&. All files that end in \*(Aq\&.conf\*(Aq will be loaded as a configuration file\&. It is best to have this as the last option in the main file\&. This option will only be processed from the main configuration file\&. The directory specified must not contain the main configuration file\&. +.RE +.PP +\fBlog_dest\fR \fIdestinations\fR +.RS 4 +Send log messages to a particular destination\&. Possible destinations are: +\fBstdout\fR +\fBstderr\fR +\fBsyslog\fR +\fBtopic\fR\&. +.sp +\fBstdout\fR +and +\fBstderr\fR +log to the console on the named output\&. +.sp +\fBsyslog\fR +uses the userspace syslog facility which usually ends up in /var/log/messages or similar and topic logs to the broker topic \*(Aq$SYS/broker/log/\*(Aq, where severity is one of D, E, W, N, I, M which are debug, error, warning, notice, information and message\&. Message type severity is used by the subscribe and unsubscribe log_type options and publishes log messages at $SYS/broker/log/M/subscribe and $SYS/broker/log/M/unsubscribe\&. +.sp +The +\fBfile\fR +destination requires an additional parameter which is the file to be logged to, e\&.g\&. "log_dest file /var/log/mosquitto\&.log"\&. The file will be closed and reopened when the broker receives a HUP signal\&. Only a single file destination may be configured\&. +.sp +Use "log_dest none" if you wish to disable logging\&. Defaults to stderr\&. This option may be specified multiple times\&. +.sp +Note that if the broker is running as a Windows service it will default to "log_dest none" and neither stdout nor stderr logging is available\&. +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBlog_facility\fR \fIlocal facility\fR +.RS 4 +If using syslog logging (not on Windows), messages will be logged to the "daemon" facility by default\&. Use the +\fBlog_facility\fR +option to choose which of local0 to local7 to log to instead\&. The option value should be an integer value, e\&.g\&. "log_facility 5" to use local5\&. +.RE +.PP +\fBlog_timestamp\fR [ true | false ] +.RS 4 +Boolean value, if set to +\fItrue\fR +a timestamp value will be added to each log entry\&. The default is +\fItrue\fR\&. +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBlog_type\fR \fItypes\fR +.RS 4 +Choose types of messages to log\&. Possible types are: +\fIdebug\fR, +\fIerror\fR, +\fIwarning\fR, +\fInotice\fR, +\fIinformation\fR, +\fIsubscribe\fR, +\fIunsubscribe\fR, +\fIwebsockets\fR, +\fInone\fR, +\fIall\fR\&. +.sp +Defaults to +\fIerror\fR, +\fIwarning\fR, +\fInotice \fRand +\fIinformation\fR\&. This option may be specified multiple times\&. Note that the +\fIdebug \fRtype (used for decoding incoming/outgoing network packets) is never logged in topics\&. +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBmax_inflight_messages\fR \fIcount\fR +.RS 4 +The maximum number of QoS 1 or 2 messages that can be in the process of being transmitted simultaneously\&. This includes messages currently going through handshakes and messages that are being retried\&. Defaults to 20\&. Set to 0 for no maximum\&. If set to 1, this will guarantee in\-order delivery of messages\&. +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBmax_queued_messages\fR \fIcount\fR +.RS 4 +The maximum number of QoS 1 or 2 messages to hold in the queue above those messages that are currently in flight\&. Defaults to 100\&. Set to 0 for no maximum (not recommended)\&. See also the +\fBqueue_qos0_messages\fR +option\&. +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBmessage_size_limit\fR \fIlimit\fR +.RS 4 +This option sets the maximum publish payload size that the broker will allow\&. Received messages that exceed this size will not be accepted by the broker\&. The default value is 0, which means that all valid MQTT messages are accepted\&. MQTT imposes a maximum payload size of 268435455 bytes\&. +.RE +.PP +\fBpassword_file\fR \fIfile path\fR +.RS 4 +Set the path to a password file\&. If defined, the contents of the file are used to control client access to the broker\&. The file can be created using the +\fBmosquitto_passwd\fR(1) +utility\&. If mosquitto is compiled without TLS support (it is recommended that TLS support is included), then the password file should be a text file with each line in the format "username:password", where the colon and password are optional but recommended\&. If +\fBallow_anonymous\fR +is set to +\fIfalse\fR, only users defined in this file will be able to connect\&. Setting +\fBallow_anonymous\fR +to +\fItrue\fR +when +\fIpassword_file\fRis defined is valid and could be used with acl_file to have e\&.g\&. read only guest/anonymous accounts and defined users that can publish\&. +.sp +Reloaded on reload signal\&. The currently loaded username and password data will be freed and reloaded\&. Clients that are already connected will not be affected\&. +.sp +See also +\fBmosquitto_passwd\fR(1)\&. +.RE +.PP +\fBpersistence\fR [ true | false ] +.RS 4 +If +\fItrue\fR, connection, subscription and message data will be written to the disk in mosquitto\&.db at the location dictated by persistence_location\&. When mosquitto is restarted, it will reload the information stored in mosquitto\&.db\&. The data will be written to disk when mosquitto closes and also at periodic intervals as defined by autosave_interval\&. Writing of the persistence database may also be forced by sending mosquitto the SIGUSR1 signal\&. If +\fIfalse\fR, the data will be stored in memory only\&. Defaults to +\fIfalse\fR\&. +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBpersistence_file\fR \fIfile name\fR +.RS 4 +The filename to use for the persistent database\&. Defaults to mosquitto\&.db\&. +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBpersistence_location\fR \fIpath\fR +.RS 4 +The path where the persistence database should be stored\&. Must end in a trailing slash\&. If not given, then the current directory is used\&. +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBpersistent_client_expiration\fR \fIduration\fR +.RS 4 +This option allows persistent clients (those with clean session set to false) to be removed if they do not reconnect within a certain time frame\&. This is a non\-standard option\&. As far as the MQTT spec is concerned, persistent clients persist forever\&. +.sp +Badly designed clients may set clean session to false whilst using a randomly generated client id\&. This leads to persistent clients that will never reconnect\&. This option allows these clients to be removed\&. +.sp +The expiration period should be an integer followed by one of h d w m y for hour, day, week, month and year respectively\&. For example: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +persistent_client_expiration 2m +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +persistent_client_expiration 14d +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +persistent_client_expiration 1y +.RE +.sp +As this is a non\-standard option, the default if not set is to never expire persistent clients\&. +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBpid_file\fR \fIfile path\fR +.RS 4 +Write a pid file to the file specified\&. If not given (the default), no pid file will be written\&. If the pid file cannot be written, mosquitto will exit\&. This option only has an effect is mosquitto is run in daemon mode\&. +.sp +If mosquitto is being automatically started by an init script it will usually be required to write a pid file\&. This should then be configured as e\&.g\&. /var/run/mosquitto\&.pid +.sp +Not reloaded on reload signal\&. +.RE +.PP +\fBpsk_file\fR \fIfile path\fR +.RS 4 +Set the path to a pre\-shared\-key file\&. This option requires a listener to be have PSK support enabled\&. If defined, the contents of the file are used to control client access to the broker\&. Each line should be in the format "identity:key", where the key is a hexadecimal string with no leading "0x"\&. A client connecting to a listener that has PSK support enabled must provide a matching identity and PSK to allow the encrypted connection to proceed\&. +.sp +Reloaded on reload signal\&. The currently loaded identity and key data will be freed and reloaded\&. Clients that are already connected will not be affected\&. +.RE +.PP +\fBqueue_qos0_messages\fR [ true | false ] +.RS 4 +Set to +\fItrue\fR +to queue messages with QoS 0 when a persistent client is disconnected\&. These messages are included in the limit imposed by max_queued_messages\&. Defaults to +\fIfalse\fR\&. +.sp +Note that the MQTT v3\&.1 spec states that only QoS 1 and 2 messages should be saved in this situation so this is a non\-standard option\&. +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBretained_persistence\fR [ true | false ] +.RS 4 +This is a synonym of the +\fBpersistence\fR +option\&. +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBretry_interval\fR \fIseconds\fR +.RS 4 +The integer number of seconds after a QoS=1 or QoS=2 message has been sent that mosquitto will wait before retrying when no response is received\&. If unset, defaults to 20 seconds\&. +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBstore_clean_interval\fR \fIseconds\fR +.RS 4 +The integer number of seconds between the internal message store being cleaned of messages that are no longer referenced\&. Lower values will result in lower memory usage but more processor time, higher values will have the opposite effect\&. Setting a value of 0 means the unreferenced messages will be disposed of as quickly as possible\&. Defaults to 10 seconds\&. +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBsys_interval\fR \fIseconds\fR +.RS 4 +The integer number of seconds between updates of the $SYS subscription hierarchy, which provides status information about the broker\&. If unset, defaults to 10 seconds\&. +.sp +Set to 0 to disable publishing the $SYS hierarchy completely\&. +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBupgrade_outgoing_qos\fR [ true | false ] +.RS 4 +The MQTT specification requires that the QoS of a message delivered to a subscriber is never upgraded to match the QoS of the subscription\&. Enabling this option changes this behaviour\&. If +\fBupgrade_outgoing_qos\fR +is set +\fItrue\fR, messages sent to a subscriber will always match the QoS of its subscription\&. This is a non\-standard option not provided for by the spec\&. Defaults to +\fIfalse\fR\&. +.sp +Reloaded on reload signal\&. +.RE +.PP +\fBuser\fR \fIusername\fR +.RS 4 +When run as root, change to this user and its primary group on startup\&. If mosquitto is unable to change to this user and group, it will exit with an error\&. The user specified must have read/write access to the persistence database if it is to be written\&. If run as a non\-root user, this setting has no effect\&. Defaults to mosquitto\&. +.sp +This setting has no effect on Windows and so you should run mosquitto as the user you wish it to run as\&. +.sp +Not reloaded on reload signal\&. +.RE +.SH "LISTENERS" +.PP +The network ports that mosquitto listens on can be controlled using listeners\&. The default listener options can be overridden and further listeners can be created\&. +.SS "General Options" +.PP +\fBbind_address\fR \fIaddress\fR +.RS 4 +Listen for incoming network connections on the specified IP address/hostname only\&. This is useful to restrict access to certain network interfaces\&. To restrict access to mosquitto to the local host only, use "bind_address localhost"\&. This only applies to the default listener\&. Use the listener variable to control other listeners\&. +.sp +Not reloaded on reload signal\&. +.RE +.PP +\fBhttp_dir\fR \fIdirectory\fR +.RS 4 +When a listener is using the websockets protocol, it is possible to serve http data as well\&. Set +\fBhttp_dir\fR +to a directory which contains the files you wish to serve\&. If this option is not specified, then no normal http connections will be possible\&. +.sp +Not reloaded on reload signal\&. +.RE +.PP +\fBlistener\fR \fIport\fR \fI[bind address/host]\fR +.RS 4 +Listen for incoming network connection on the specified port\&. A second optional argument allows the listener to be bound to a specific ip address/hostname\&. If this variable is used and neither the global +\fBbind_address\fR +nor +\fBport\fR +options are used then the default listener will not be started\&. +.sp +The +\fBbind address/host\fR +option allows this listener to be bound to a specific IP address by passing an IP address or hostname\&. For websockets listeners, it is only possible to pass an IP address here\&. +.sp +This option may be specified multiple times\&. See also the +\fBmount_point\fR +option\&. +.sp +Not reloaded on reload signal\&. +.RE +.PP +\fBmax_connections\fR \fIcount\fR +.RS 4 +Limit the total number of clients connected for the current listener\&. Set to +\-1 +to have "unlimited" connections\&. Note that other limits may be imposed that are outside the control of mosquitto\&. See e\&.g\&. +\fBlimits.conf\fR(5)\&. +.sp +Not reloaded on reload signal\&. +.RE +.PP +\fBmount_point\fR \fItopic prefix\fR +.RS 4 +This option is used with the listener option to isolate groups of clients\&. When a client connects to a listener which uses this option, the string argument is attached to the start of all topics for this client\&. This prefix is removed when any messages are sent to the client\&. This means a client connected to a listener with mount point +\fIexample\fR +can only see messages that are published in the topic hierarchy +\fIexample\fR +and above\&. +.sp +Not reloaded on reload signal\&. +.RE +.PP +\fBport\fR \fIport number\fR +.RS 4 +Set the network port for the default listener to listen on\&. Defaults to 1883\&. +.sp +Not reloaded on reload signal\&. +.RE +.PP +\fBprotocol\fR \fIvalue\fR +.RS 4 +Set the protocol to accept for this listener\&. Can be +\fBmqtt\fR, the default, or +\fBwebsockets\fR +if available\&. +.sp +Websockets support is currently disabled by default at compile time\&. Certificate based TLS may be used with websockets, except that only the +\fBcafile\fR, +\fBcertfile\fR, +\fBkeyfile\fR +and +\fBciphers\fR +options are supported\&. +.sp +Not reloaded on reload signal\&. +.RE +.PP +\fBuse_username_as_clientid\fR [ true | false ] +.RS 4 +Set +\fBuse_username_as_clientid\fR +to true to replace the clientid that a client connected with with its username\&. This allows authentication to be tied to the clientid, which means that it is possible to prevent one client disconnecting another by using the same clientid\&. Defaults to false\&. +.sp +If a client connects with no username it will be disconnected as not authorised when this option is set to true\&. Do not use in conjunction with +\fBclientid_prefixes\fR\&. +.sp +See also +\fBuse_identity_as_username\fR\&. +.sp +Not reloaded on reload signal\&. +.RE +.PP +\fBwebsockets_log_level\fR \fIlevel\fR +.RS 4 +Change the websockets logging level\&. This is a global option, it is not possible to set per listener\&. This is an integer that is interpreted by libwebsockets as a bit mask for its lws_log_levels enum\&. See the libwebsockets documentation for more details\&. +.sp +To use this option, +\fBlog_type websockets\fR +must also be enabled\&. Defaults to 0\&. +.RE +.SS "Certificate based SSL/TLS Support" +.PP +The following options are available for all listeners to configure certificate based SSL support\&. See also "Pre\-shared\-key based SSL/TLS support"\&. +.PP +\fBcafile\fR \fIfile path\fR +.RS 4 +At least one of +\fBcafile\fR +or +\fBcapath\fR +must be provided to allow SSL support\&. +.sp +\fBcafile\fR +is used to define the path to a file containing the PEM encoded CA certificates that are trusted\&. +.RE +.PP +\fBcapath\fR \fIdirectory path\fR +.RS 4 +At least one of +\fBcafile\fR +or +\fBcapath\fR +must be provided to allow SSL support\&. +.sp +\fBcapath\fR +is used to define a directory that contains PEM encoded CA certificates that are trusted\&. For +\fBcapath\fR +to work correctly, the certificates files must have "\&.pem" as the file ending and you must run "c_rehash " each time you add/remove a certificate\&. +.RE +.PP +\fBcertfile\fR \fIfile path\fR +.RS 4 +Path to the PEM encoded server certificate\&. +.RE +.PP +\fBciphers\fR \fIcipher:list\fR +.RS 4 +The list of allowed ciphers, each separated with a colon\&. Available ciphers can be obtained using the "openssl ciphers" command\&. +.RE +.PP +\fBcrlfile\fR \fIfile path\fR +.RS 4 +If you have +\fBrequire_certificate\fR +set to +\fItrue\fR, you can create a certificate revocation list file to revoke access to particular client certificates\&. If you have done this, use crlfile to point to the PEM encoded revocation file\&. +.RE +.PP +\fBkeyfile\fR \fIfile path\fR +.RS 4 +Path to the PEM encoded keyfile\&. +.RE +.PP +\fBrequire_certificate\fR [ true | false ] +.RS 4 +By default an SSL/TLS enabled listener will operate in a similar fashion to a https enabled web server, in that the server has a certificate signed by a CA and the client will verify that it is a trusted certificate\&. The overall aim is encryption of the network traffic\&. By setting +\fBrequire_certificate\fR +to +\fItrue\fR, the client must provide a valid certificate in order for the network connection to proceed\&. This allows access to the broker to be controlled outside of the mechanisms provided by MQTT\&. +.RE +.PP +\fBtls_version\fR \fIversion\fR +.RS 4 +Configure the version of the TLS protocol to be used for this listener\&. Possible values are +\fItlsv1\&.2\fR, +\fItlsv1\&.1\fR +and +\fItlsv1\fR\&. If left unset, the default of allowing all of TLS v1\&.2, v1\&.1 and v1\&.0 is used\&. +.RE +.PP +\fBuse_identity_as_username\fR [ true | false ] +.RS 4 +If +\fBrequire_certificate\fR +is +\fItrue\fR, you may set +\fBuse_identity_as_username\fR +to +\fItrue\fR +to use the CN value from the client certificate as a username\&. If this is +\fItrue\fR, the +\fBpassword_file\fR +option will not be used for this listener\&. +.RE +.SS "Pre\-shared\-key based SSL/TLS Support" +.PP +The following options are available for all listeners to configure pre\-shared\-key based SSL support\&. See also "Certificate based SSL/TLS support"\&. +.PP +\fBciphers\fR \fIcipher:list\fR +.RS 4 +When using PSK, the encryption ciphers used will be chosen from the list of available PSK ciphers\&. If you want to control which ciphers are available, use this option\&. The list of available ciphers can be optained using the "openssl ciphers" command and should be provided in the same format as the output of that command\&. +.RE +.PP +\fBpsk_hint\fR \fIhint\fR +.RS 4 +The +\fBpsk_hint\fR +option enables pre\-shared\-key support for this listener and also acts as an identifier for this listener\&. The hint is sent to clients and may be used locally to aid authentication\&. The hint is a free form string that doesn\*(Aqt have much meaning in itself, so feel free to be creative\&. +.sp +If this option is provided, see +\fBpsk_file\fR +to define the pre\-shared keys to be used or create a security plugin to handle them\&. +.RE +.PP +\fBtls_version\fR \fIversion\fR +.RS 4 +Configure the version of the TLS protocol to be used for this listener\&. Possible values are +\fItlsv1\&.2\fR, +\fItlsv1\&.1\fR +and +\fItlsv1\fR\&. If left unset, the default of allowing all of TLS v1\&.2, v1\&.1 and v1\&.0 is used\&. +.RE +.PP +\fBuse_identity_as_username\fR [ true | false ] +.RS 4 +Set +\fBuse_identity_as_username\fR +to have the psk identity sent by the client used as its username\&. The username will be checked as normal, so +\fBpassword_file\fR +or another means of authentication checking must be used\&. No password will be used\&. +.RE +.SH "CONFIGURING BRIDGES" +.PP +Multiple bridges (connections to other brokers) can be configured using the following variables\&. +.PP +Bridges cannot currently be reloaded on reload signal\&. +.PP +\fBaddress\fR \fIaddress[:port]\fR \fI[address[:port]]\fR, \fBaddresses\fR \fIaddress[:port]\fR \fI[address[:port]]\fR +.RS 4 +Specify the address and optionally the port of the bridge to connect to\&. This must be given for each bridge connection\&. If the port is not specified, the default of 1883 is used\&. +.sp +Multiple host addresses can be specified on the address config\&. See the +\fBround_robin\fR +option for more details on the behaviour of bridges with multiple addresses\&. +.RE +.PP +\fBbridge_attempt_unsubscribe\fR [ true | false ] +.RS 4 +If a bridge has topics that have "out" direction, the default behaviour is to send an unsubscribe request to the remote broker on that topic\&. This means that changing a topic direction from "in" to "out" will not keep receiving incoming messages\&. Sending these unsubscribe requests is not always desirable, setting +\fBbridge_attempt_unsubscribe\fR +to +\fIfalse\fR +will disable sending the unsubscribe request\&. Defaults to +\fItrue\fR\&. +.RE +.PP +\fBbridge_protocol_version\fR \fIversion\fR +.RS 4 +Set the version of the MQTT protocol to use with for this bridge\&. Can be one of +\fImqttv31\fR +or +\fImqttv311\fR\&. Defaults to +\fImqttv31\fR\&. +.RE +.PP +\fBcleansession\fR [ true | false ] +.RS 4 +Set the clean session option for this bridge\&. Setting to +\fIfalse\fR +(the default), means that all subscriptions on the remote broker are kept in case of the network connection dropping\&. If set to +\fItrue\fR, all subscriptions and messages on the remote broker will be cleaned up if the connection drops\&. Note that setting to +\fItrue\fR +may cause a large amount of retained messages to be sent each time the bridge reconnects\&. +.sp +If you are using bridges with +\fBcleansession\fR +set to +\fIfalse\fR +(the default), then you may get unexpected behaviour from incoming topics if you change what topics you are subscribing to\&. This is because the remote broker keeps the subscription for the old topic\&. If you have this problem, connect your bridge with +\fBcleansession\fR +set to +\fItrue\fR, then reconnect with cleansession set to +\fIfalse\fR +as normal\&. +.RE +.PP +\fBconnection\fR \fIname\fR +.RS 4 +This variable marks the start of a new bridge connection\&. It is also used to give the bridge a name which is used as the client id on the remote broker\&. +.RE +.PP +\fBkeepalive_interval\fR \fIseconds\fR +.RS 4 +Set the number of seconds after which the bridge should send a ping if no other traffic has occurred\&. Defaults to 60\&. A minimum value of 5 seconds is allowed\&. +.RE +.PP +\fBidle_timeout\fR \fIseconds\fR +.RS 4 +Set the amount of time a bridge using the lazy start type must be idle before it will be stopped\&. Defaults to 60 seconds\&. +.RE +.PP +\fBlocal_clientid\fR \fIid\fR +.RS 4 +Set the clientid to use on the local broker\&. If not defined, this defaults to +\fBlocal\&.\fR\&. If you are bridging a broker to itself, it is important that local_clientid and clientid do not match\&. +.RE +.PP +\fBlocal_password\fR \fIpassword\fR +.RS 4 +Configure the password to be used when connecting this bridge to the local broker\&. This may be important when authentication and ACLs are being used\&. +.RE +.PP +\fBlocal_username\fR \fIusername\fR +.RS 4 +Configure the username to be used when connecting this bridge to the local broker\&. This may be important when authentication and ACLs are being used\&. +.RE +.PP +\fBnotifications\fR [ true | false ] +.RS 4 +If set to +\fItrue\fR, publish notification messages to the local and remote brokers giving information about the state of the bridge connection\&. Retained messages are published to the topic $SYS/broker/connection//state unless otherwise set with +\fBnotification_topic\fRs\&. If the message is 1 then the connection is active, or 0 if the connection has failed\&. Defaults to +\fItrue\fR\&. +.RE +.PP +\fBnotification_topic\fR \fItopic\fR +.RS 4 +Choose the topic on which notifications will be published for this bridge\&. If not set the messages will be sent on the topic $SYS/broker/connection//state\&. +.RE +.PP +\fBremote_clientid\fR \fIid\fR +.RS 4 +Set the client id for this bridge connection\&. If not defined, this defaults to \*(Aqname\&.hostname\*(Aq, where name is the connection name and hostname is the hostname of this computer\&. +.sp +This replaces the old "clientid" option to avoid confusion with local/remote sides of the bridge\&. "clientid" remains valid for the time being\&. +.RE +.PP +\fBremote_password\fR \fIvalue\fR +.RS 4 +Configure a password for the bridge\&. This is used for authentication purposes when connecting to a broker that supports MQTT v3\&.1 and up and requires a username and/or password to connect\&. This option is only valid if a remote_username is also supplied\&. +.sp +This replaces the old "password" option to avoid confusion with local/remote sides of the bridge\&. "password" remains valid for the time being\&. +.RE +.PP +\fBremote_username\fR \fIname\fR +.RS 4 +Configure a username for the bridge\&. This is used for authentication purposes when connecting to a broker that supports MQTT v3\&.1 and up and requires a username and/or password to connect\&. See also the +\fBremote_password\fR +option\&. +.sp +This replaces the old "username" option to avoid confusion with local/remote sides of the bridge\&. "username" remains valid for the time being\&. +.RE +.PP +\fBrestart_timeout\fR \fIvalue\fR +.RS 4 +Set the amount of time a bridge using the automatic start type will wait until attempting to reconnect\&. Defaults to 30 seconds\&. +.RE +.PP +\fBround_robin\fR [ true | false ] +.RS 4 +If the bridge has more than one address given in the address/addresses configuration, the round_robin option defines the behaviour of the bridge on a failure of the bridge connection\&. If round_robin is +\fIfalse\fR, the default value, then the first address is treated as the main bridge connection\&. If the connection fails, the other secondary addresses will be attempted in turn\&. Whilst connected to a secondary bridge, the bridge will periodically attempt to reconnect to the main bridge until successful\&. +.sp +If round_robin is +\fItrue\fR, then all addresses are treated as equals\&. If a connection fails, the next address will be tried and if successful will remain connected until it fails\&. +.RE +.PP +\fBstart_type\fR [ automatic | lazy | once ] +.RS 4 +Set the start type of the bridge\&. This controls how the bridge starts and can be one of three types: +\fIautomatic\fR, +\fIlazy \fRand +\fIonce\fR\&. Note that RSMB provides a fourth start type "manual" which isn\*(Aqt currently supported by mosquitto\&. +.sp +\fIautomatic\fR +is the default start type and means that the bridge connection will be started automatically when the broker starts and also restarted after a short delay (30 seconds) if the connection fails\&. +.sp +Bridges using the +\fIlazy\fR +start type will be started automatically when the number of queued messages exceeds the number set with the +\fBthreshold\fR +option\&. It will be stopped automatically after the time set by the +\fBidle_timeout\fR +parameter\&. Use this start type if you wish the connection to only be active when it is needed\&. +.sp +A bridge using the +\fIonce\fR +start type will be started automatically when the broker starts but will not be restarted if the connection fails\&. +.RE +.PP +\fBthreshold\fR \fIcount\fR +.RS 4 +Set the number of messages that need to be queued for a bridge with lazy start type to be restarted\&. Defaults to 10 messages\&. +.RE +.PP +\fBtopic\fR \fIpattern\fR [[[ out | in | both ] qos\-level] local\-prefix remote\-prefix] +.RS 4 +Define a topic pattern to be shared between the two brokers\&. Any topics matching the pattern (which may include wildcards) are shared\&. The second parameter defines the direction that the messages will be shared in, so it is possible to import messages from a remote broker using +\fIin\fR, export messages to a remote broker using +\fIout\fR +or share messages in both directions\&. If this parameter is not defined, the default of +\fIout\fR +is used\&. The QoS level defines the publish/subscribe QoS level used for this topic and defaults to 0\&. +.sp +The +\fIlocal\-prefix\fR +and +\fIremote\-prefix\fR +options allow topics to be remapped when publishing to and receiving from remote brokers\&. This allows a topic tree from the local broker to be inserted into the topic tree of the remote broker at an appropriate place\&. +.sp +For incoming topics, the bridge will prepend the pattern with the remote prefix and subscribe to the resulting topic on the remote broker\&. When a matching incoming message is received, the remote prefix will be removed from the topic and then the local prefix added\&. +.sp +For outgoing topics, the bridge will prepend the pattern with the local prefix and subscribe to the resulting topic on the local broker\&. When an outgoing message is processed, the local prefix will be removed from the topic then the remote prefix added\&. +.sp +When using topic mapping, an empty prefix can be defined using the place marker +\fI""\fR\&. Using the empty marker for the topic itself is also valid\&. The table below defines what combination of empty or value is valid\&. +.TS +allbox tab(:); +lB lB lB lB lB. +T{ +\ \& +T}:T{ +\fITopic\fR +T}:T{ +\fILocal Prefix\fR +T}:T{ +\fIRemote Prefix\fR +T}:T{ +\fIValidity\fR +T} +.T& +l l l l l +l l l l l +l l l l l +l l l l l +l l l l l +l l l l l +l l l l l +l l l l l. +T{ +1 +T}:T{ +value +T}:T{ +value +T}:T{ +value +T}:T{ +valid +T} +T{ +2 +T}:T{ +value +T}:T{ +value +T}:T{ +"" +T}:T{ +valid +T} +T{ +3 +T}:T{ +value +T}:T{ +"" +T}:T{ +value +T}:T{ +valid +T} +T{ +4 +T}:T{ +value +T}:T{ +"" +T}:T{ +"" +T}:T{ +valid (no remapping) +T} +T{ +5 +T}:T{ +"" +T}:T{ +value +T}:T{ +value +T}:T{ +valid (remap single local topic to remote) +T} +T{ +6 +T}:T{ +"" +T}:T{ +value +T}:T{ +"" +T}:T{ +invalid +T} +T{ +7 +T}:T{ +"" +T}:T{ +"" +T}:T{ +value +T}:T{ +invalid +T} +T{ +8 +T}:T{ +"" +T}:T{ +"" +T}:T{ +"" +T}:T{ +invalid +T} +.TE +.sp 1 +To remap an entire topic tree, use e\&.g\&.: +.sp +.if n \{\ +.RS 4 +.\} +.nf +topic # both 2 local/topic/ remote/topic/ +.fi +.if n \{\ +.RE +.\} +.sp +This option can be specified multiple times per bridge\&. +.sp +Care must be taken to ensure that loops are not created with this option\&. If you are experiencing high CPU load from a broker, it is possible that you have a loop where each broker is forever forwarding each other the same messages\&. +.sp +See also the +\fBcleansession\fR +option if you have messages arriving on unexpected topics when using incoming topics\&. +.PP +\fBExample\ \&Bridge Topic Remapping.\ \&\fR +The configuration below connects a bridge to the broker at +\fBtest\&.mosquitto\&.org\fR\&. It subscribes to the remote topic +\fB$SYS/broker/clients/total\fR +and republishes the messages received to the local topic +\fBtest/mosquitto/org/clients/total\fR +.sp +.if n \{\ +.RS 4 +.\} +.nf +connection test\-mosquitto\-org +address test\&.mosquitto\&.org +cleansession true +topic clients/total in 0 test/mosquitto/org $SYS/broker/ +.fi +.if n \{\ +.RE +.\} +.RE +.PP +\fBtry_private\fR [ true | false ] +.RS 4 +If try_private is set to +\fItrue\fR, the bridge will attempt to indicate to the remote broker that it is a bridge not an ordinary client\&. If successful, this means that loop detection will be more effective and that retained messages will be propagated correctly\&. Not all brokers support this feature so it may be necessary to set +\fBtry_private\fR +to +\fIfalse\fR +if your bridge does not connect properly\&. +.sp +Defaults to +\fItrue\fR\&. +.RE +.SS "SSL/TLS Support" +.PP +The following options are available for all bridges to configure SSL/TLS support\&. +.PP +\fBbridge_attempt_unsubscribe\fR [ true | false ] +.RS 4 +If a bridge has topics that have "out" direction, the default behaviour is to send an unsubscribe request to the remote broker on that topic\&. This means that changing a topic direction from "in" to "out" will not keep receiving incoming messages\&. Sending these unsubscribe requests is not always desirable, setting +\fBbridge_attempt_unsubscribe\fR +to +\fIfalse\fR +will disable sending the unsubscribe request\&. +.RE +.PP +\fBbridge_cafile\fR \fIfile path\fR +.RS 4 +One of +\fBbridge_cafile\fR +or +\fBbridge_capath\fR +must be provided to allow SSL/TLS support\&. +.sp +bridge_cafile is used to define the path to a file containing the PEM encoded CA certificates that have signed the certificate for the remote broker\&. +.RE +.PP +\fBbridge_capath\fR \fIfile path\fR +.RS 4 +One of +\fBbridge_capath\fR +or +\fBbridge_capath\fR +must be provided to allow SSL/TLS support\&. +.sp +bridge_capath is used to define the path to a directory containing the PEM encoded CA certificates that have signed the certificate for the remote broker\&. For bridge_capath to work correctly, the certificate files must have "\&.crt" as the file ending and you must run "c_rehash " each time you add/remove a certificate\&. +.RE +.PP +\fBbridge_certfile\fR \fIfile path\fR +.RS 4 +Path to the PEM encoded client certificate for this bridge, if required by the remote broker\&. +.RE +.PP +\fBbridge_identity\fR \fIidentity\fR +.RS 4 +Pre\-shared\-key encryption provides an alternative to certificate based encryption\&. A bridge can be configured to use PSK with the +\fBbridge_identity\fR +and +\fBbridge_psk\fR +options\&. This is the client identity used with PSK encryption\&. Only one of certificate and PSK based encryption can be used on one bridge at once\&. +.RE +.PP +\fBbridge_insecure\fR [ true | false ] +.RS 4 +When using certificate based TLS, the bridge will attempt to verify the hostname provided in the remote certificate matches the host/address being connected to\&. This may cause problems in testing scenarios, so +\fBbridge_insecure\fR +may be set to +\fIfalse\fR +to disable the hostname verification\&. +.sp +Setting this option to +\fItrue\fR +means that a malicious third party could potentially inpersonate your server, so it should always be set to +\fIfalse\fR +in production environments\&. +.RE +.PP +\fBbridge_keyfile\fR \fIfile path\fR +.RS 4 +Path to the PEM encoded private key for this bridge, if required by the remote broker\&. +.RE +.PP +\fBbridge_psk\fR \fIkey\fR +.RS 4 +Pre\-shared\-key encryption provides an alternative to certificate based encryption\&. A bridge can be configured to use PSK with the +\fBbridge_identity\fR +and +\fBbridge_psk\fR +options\&. This is the pre\-shared\-key in hexadecimal format with no "0x"\&. Only one of certificate and PSK based encryption can be used on one bridge at once\&. +.RE +.PP +\fBbridge_tls_version\fR \fIversion\fR +.RS 4 +Configure the version of the TLS protocol to be used for this bridge\&. Possible values are +\fItlsv1\&.2\fR, +\fItlsv1\&.1\fR +and +\fItlsv1\fR\&. Defaults to +\fItlsv1\&.2\fR\&. The remote broker must support the same version of TLS for the connection to succeed\&. +.RE +.SH "FILES" +.PP +mosquitto\&.conf +.SH "BUGS" +.PP +\fBmosquitto\fR +bug information can be found at +\m[blue]\fB\%https://github.com/eclipse/mosquitto/issues\fR\m[] +.SH "SEE ALSO" +\fBmosquitto\fR(8), \fBmosquitto_passwd\fR(1), \fBmosquitto-tls\fR(7), \fBmqtt\fR(7), \fBlimits.conf\fR(5) +.SH "AUTHOR" +.PP +Roger Light + diff --git a/src/libs/mosquitto/man/mosquitto.conf.5.xml b/src/libs/mosquitto/man/mosquitto.conf.5.xml new file mode 100644 index 0000000..37614dd --- /dev/null +++ b/src/libs/mosquitto/man/mosquitto.conf.5.xml @@ -0,0 +1,1468 @@ + + + + + + mosquitto.conf + 5 + Mosquitto Project + File formats and conventions + + + + mosquitto.conf + the configuration file for mosquitto + + + + + mosquitto.conf + + + + + Description + mosquitto.conf is the configuration file for + mosquitto. This file can reside anywhere as long as mosquitto can read + it. By default, mosquitto does not need a configuration file and will + use the default values listed below. See + mosquitto8 + for information on how to load a configuration file. + + + + File Format + All lines with a # as the very first character are treated as a + comment. + Configuration lines start with a variable name. The variable + value is separated from the name by a single space. + + + + Authentication + The authentication options described below allow a wide range of + possibilities in conjunction with the listener options. This + section aims to clarify the possibilities. + The simplest option is to have no authentication at all. This is + the default if no other options are given. Unauthenticated + encrypted support is provided by using the certificate based + SSL/TLS based options cafile/capath, certfile and keyfile. + MQTT provides username/password authentication as part of the + protocol. Use the password_file option to define the valid + usernames and passwords. Be sure to use network encryption if you + are using this option otherwise the username and password will be + vulnerable to interception. + When using certificate based encryption there are two options + that affect authentication. The first is require_certificate, which + may be set to true or false. If false, the SSL/TLS component of the + client will verify the server but there is no requirement for the + client to provide anything for the server: authentication is + limited to the MQTT built in username/password. If + require_certificate is true, the client must provide a valid + certificate in order to connect successfully. In this case, the + second option, use_identity_as_username, becomes relevant. If set + to true, the Common Name (CN) from the client certificate is used + instead of the MQTT username for access control purposes. The + password is not replaced because it is assumed that only + authenticated clients have valid certificates. If + use_identity_as_username is false, the client must authenticate as + normal (if required by password_file) through the MQTT + options. + When using pre-shared-key based encryption through the psk_hint + and psk_file options, the client must provide a valid identity and + key in order to connect to the broker before any MQTT communication + takes place. If use_identity_as_username is true, the PSK identity + is used instead of the MQTT username for access control purposes. + If use_identity_as_username is false, the client may still + authenticate using the MQTT username/password if using the + password_file option. + Both certificate and PSK based encryption are configured on a per-listener basis. + Authentication plugins can be created to replace the + password_file and psk_file options (as well as the ACL options) + with e.g. SQL based lookups. + It is possible to support multiple authentication schemes at + once. A config could be created that had a listener for all of the + different encryption options described above and hence a large + number of ways of authenticating. + + + + General Options + + + file path + + Set the path to an access control list file. If + defined, the contents of the file are used to control + client access to topics on the broker. + If this parameter is defined then only the topics + listed will have access. Topic access is added with + lines of the format: + + topic [read|write|readwrite] <topic> + + The access type is controlled using "read", "write" or + "readwrite". This parameter is optional (unless + <topic> includes a space character) - if not + given then the access is read/write. <topic> can + contain the + or # wildcards as in + subscriptions. + + The first set of topics are applied to anonymous + clients, assuming is + true. User specific topic ACLs are added after a user + line as follows: + + user <username> + + The username referred to here is the same as in + e. It is not the + clientid. + + It is also possible to define ACLs based on pattern + substitution within the topic. The form is the same as + for the topic keyword, but using pattern as the + keyword. + pattern [read|write|readwrite] <topic> + + The patterns available for substition are: + + %c to match the client id of the client + %u to match the username of the client + + The substitution pattern must be the only text for + that level of hierarchy. Pattern ACLs apply to all + users even if the "user" keyword has previously been + given. + + Example: + pattern write sensor/%u/data + Allow access for bridge connection messages: + pattern write $SYS/broker/connection/%c/state + + If the first character of a line of the ACL file is a + # it is treated as a comment. + + Reloaded on reload signal. The currently loaded ACLs + will be freed and reloaded. Existing subscriptions will + be affected after the reload. + + + + [ true | false ] + + Boolean value that determines whether clients that + connect without providing a username are allowed to + connect. If set to false + then another means of connection should be created to + control authenticated client access. Defaults to + true. + Reloaded on reload signal. + + + + [ true | false ] + + If a client is subscribed to multiple subscriptions + that overlap, e.g. foo/# and foo/+/baz , then MQTT + expects that when the broker receives a message on a + topic that matches both subscriptions, such as + foo/bar/baz, then the client should only receive the + message once. + Mosquitto keeps track of which clients a message has + been sent to in order to meet this requirement. This + option allows this behaviour to be disabled, which may + be useful if you have a large number of clients + subscribed to the same set of topics and want to + minimise memory usage. + It can be safely set to + true if you know in advance + that your clients will never have overlapping + subscriptions, otherwise your clients must be able to + correctly deal with duplicate messages even when then + have QoS=2. + Defaults to true. + Reloaded on reload signal. + + + + value + + Options to be passed to the auth plugin. See the + specific plugin instructions. + + + + file path + + Specify an external module to use for authentication + and access control. This allows custom + username/password and access control functions to be + created. + Not currently reloaded on reload signal. + + + + [ true | false ] + + If true then before an ACL + check is made, the username/client id of the client + needing the check is searched for the presence of + either a '+' or '#' character. If either of these + characters is found in either the username or client + id, then the ACL check is denied before it is sent to + the plugin. + This check prevents the case where a malicious user + could circumvent an ACL check by using one of these + characters as their username or client id. This is the + same issue as was reported with mosquitto itself as + CVE-2017-7650. + If you are entirely sure that the plugin you are + using is not vulnerable to this attack (i.e. if you + never use usernames or client ids in topics) then you + can disable this extra check and hence have all ACL + checks delivered to your plugin by setting this option + to false. + Defaults to true. + Not currently reloaded on reload signal. + + + + seconds + + The number of seconds that mosquitto will wait + between each time it saves the in-memory database to + disk. If set to 0, the in-memory database will only be + saved when mosquitto exits or when receiving the + SIGUSR1 signal. Note that this setting only has an + effect if persistence is enabled. Defaults to 1800 + seconds (30 minutes). + Reloaded on reload signal. + + + + [ true | false ] + + If true, mosquitto will + count the number of subscription changes, retained + messages received and queued messages and if the total + exceeds then the + in-memory database will be saved to disk. If + false, mosquitto will save + the in-memory database to disk by treating + as a time in + seconds. + Reloaded on reload signal. + + + + prefix + + If defined, only clients that have a clientid with a + prefix that matches clientid_prefixes will be allowed + to connect to the broker. For example, setting + "secure-" here would mean a client "secure-client" + could connect but another with clientid "mqtt" + couldn't. By default, all client ids are valid. + Reloaded on reload signal. Note that currently + connected clients will be unaffected by any + changes. + + + + [ true | false ] + + If set to true, the log + will include entries when clients connect and + disconnect. If set to false, + these entries will not appear. + Reloaded on reload signal. + + + + dir + + External configuration files may be included by using + the include_dir option. This defines a directory that + will be searched for config files. All files that end + in '.conf' will be loaded as a configuration file. It + is best to have this as the last option in the main + file. This option will only be processed from the main + configuration file. The directory specified must not + contain the main configuration file. + + + + destinations + + Send log messages to a particular destination. + Possible destinations are: + + . + and + log to the console on the + named output. + uses the userspace syslog + facility which usually ends up in /var/log/messages or + similar and topic logs to the broker topic + '$SYS/broker/log/<severity>', where severity is + one of D, E, W, N, I, M which are debug, error, + warning, notice, information and message. Message type + severity is used by the subscribe and unsubscribe + log_type options and publishes log messages at + $SYS/broker/log/M/subscribe and + $SYS/broker/log/M/unsubscribe. + The destination requires an + additional parameter which is the file to be logged to, + e.g. "log_dest file /var/log/mosquitto.log". The file + will be closed and reopened when the broker receives a + HUP signal. Only a single file destination may be + configured. + Use "log_dest none" if you wish to disable logging. + Defaults to stderr. This option may be specified + multiple times. + Note that if the broker is running as a Windows + service it will default to "log_dest none" and neither + stdout nor stderr logging is available. + Reloaded on reload signal. + + + + local facility + + If using syslog logging (not on Windows), messages + will be logged to the "daemon" facility by default. Use + the option to choose + which of local0 to local7 to log to instead. The option + value should be an integer value, e.g. "log_facility 5" + to use local5. + + + + [ true | false ] + + Boolean value, if set to + true a timestamp value will + be added to each log entry. The default is + true. + Reloaded on reload signal. + + + + types + + Choose types of messages to log. Possible types are: + debug, + error, + warning, + notice, + information, + subscribe, + unsubscribe, + websockets, + none, + all. + Defaults to error, + warning, notice + and + information. This option + may be specified multiple times. Note that the + debug type (used for + decoding incoming/outgoing network packets) is never + logged in topics. + Reloaded on reload signal. + + + + count + + The maximum number of QoS 1 or 2 messages that can be + in the process of being transmitted simultaneously. + This includes messages currently going through + handshakes and messages that are being retried. + Defaults to 20. Set to 0 for no maximum. If set to 1, + this will guarantee in-order delivery of + messages. + Reloaded on reload signal. + + + + count + + The maximum number of QoS 1 or 2 messages to hold in + the queue above those messages that are currently in + flight. Defaults to 100. Set to 0 for no maximum (not + recommended). See also the + option. + Reloaded on reload signal. + + + + limit + + This option sets the maximum publish payload size + that the broker will allow. Received messages that + exceed this size will not be accepted by the broker. + The default value is 0, which means that all valid MQTT + messages are accepted. MQTT imposes a maximum payload + size of 268435455 bytes. + + + + file path + + Set the path to a password file. If defined, the + contents of the file are used to control client access + to the broker. The file can be created using the + mosquitto_passwd1 + utility. If mosquitto is compiled without TLS support + (it is recommended that TLS support is included), then + the password file should be a text file with each line + in the format "username:password", where the colon and + password are optional but recommended. If + is set to + false, only users defined in + this file will be able to connect. Setting + to + true when + password_fileis defined is + valid and could be used with acl_file to have e.g. read + only guest/anonymous accounts and defined users that + can publish. + Reloaded on reload signal. The currently loaded + username and password data will be freed and reloaded. + Clients that are already connected will not be + affected. + See also + mosquitto_passwd1. + + + [ true | false ] + + If true, connection, + subscription and message data will be written to the + disk in mosquitto.db at the location dictated by + persistence_location. When mosquitto is restarted, it + will reload the information stored in mosquitto.db. The + data will be written to disk when mosquitto closes and + also at periodic intervals as defined by + autosave_interval. Writing of the persistence database + may also be forced by sending mosquitto the SIGUSR1 + signal. If false, the data + will be stored in memory only. Defaults to + false. + Reloaded on reload signal. + + + + file name + + The filename to use for the persistent database. + Defaults to mosquitto.db. + Reloaded on reload signal. + + + + path + + The path where the persistence database should be + stored. Must end in a trailing slash. If not given, + then the current directory is used. + Reloaded on reload signal. + + + + duration + + This option allows persistent clients (those with + clean session set to false) to be removed if they do + not reconnect within a certain time frame. This is a + non-standard option. As far as the MQTT spec is + concerned, persistent clients persist forever. + Badly designed clients may set clean session to false + whilst using a randomly generated client id. This leads + to persistent clients that will never reconnect. This + option allows these clients to be removed. + The expiration period should be an integer followed + by one of h d w m y for hour, day, week, month and year + respectively. For example: + + persistent_client_expiration 2m + persistent_client_expiration 14d + persistent_client_expiration 1y + + As this is a non-standard option, the default if not + set is to never expire persistent clients. + Reloaded on reload signal. + + + + file path + + Write a pid file to the file specified. If not given + (the default), no pid file will be written. If the pid + file cannot be written, mosquitto will exit. This + option only has an effect is mosquitto is run in daemon + mode. + If mosquitto is being automatically started by an + init script it will usually be required to write a pid + file. This should then be configured as e.g. + /var/run/mosquitto.pid + Not reloaded on reload signal. + + + + file path + + Set the path to a pre-shared-key file. This option + requires a listener to be have PSK support enabled. If + defined, the contents of the file are used to control + client access to the broker. Each line should be in the + format "identity:key", where the key is a hexadecimal + string with no leading "0x". A client connecting to a + listener that has PSK support enabled must provide a + matching identity and PSK to allow the encrypted + connection to proceed. + Reloaded on reload signal. The currently loaded + identity and key data will be freed and reloaded. + Clients that are already connected will not be + affected. + + + [ true | false ] + + Set to true to queue + messages with QoS 0 when a persistent client is + disconnected. These messages are included in the limit + imposed by max_queued_messages. Defaults to + false. + Note that the MQTT v3.1 spec states that only QoS 1 + and 2 messages should be saved in this situation so + this is a non-standard option. + Reloaded on reload signal. + + + + [ true | false ] + + This is a synonym of the + option. + Reloaded on reload signal. + + + + seconds + + The integer number of seconds after a QoS=1 or QoS=2 + message has been sent that mosquitto will wait before + retrying when no response is received. If unset, + defaults to 20 seconds. + Reloaded on reload signal. + + + + seconds + + The integer number of seconds between the internal + message store being cleaned of messages that are no + longer referenced. Lower values will result in lower + memory usage but more processor time, higher values + will have the opposite effect. Setting a value of 0 + means the unreferenced messages will be disposed of as + quickly as possible. Defaults to 10 seconds. + Reloaded on reload signal. + + + + seconds + + The integer number of seconds between updates of the + $SYS subscription hierarchy, which provides status + information about the broker. If unset, defaults to 10 + seconds. + Set to 0 to disable publishing the $SYS hierarchy + completely. + Reloaded on reload signal. + + + + [ true | false ] + + The MQTT specification requires that the QoS of a + message delivered to a subscriber is never upgraded to + match the QoS of the subscription. Enabling this option + changes this behaviour. If + is set + true, messages sent to a + subscriber will always match the QoS of its + subscription. This is a non-standard option not + provided for by the spec. Defaults to + false. + Reloaded on reload signal. + + + + username + + When run as root, change to this user and its primary + group on startup. If mosquitto is unable to change to + this user and group, it will exit with an error. The + user specified must have read/write access to the + persistence database if it is to be written. If run as + a non-root user, this setting has no effect. Defaults + to mosquitto. + This setting has no effect on Windows and so you + should run mosquitto as the user you wish it to run + as. + Not reloaded on reload signal. + + + + + + + Listeners + The network ports that mosquitto listens on can be controlled + using listeners. The default listener options can be overridden and + further listeners can be created. + + General Options + + + address + + Listen for incoming network connections on the + specified IP address/hostname only. This is useful + to restrict access to certain network interfaces. + To restrict access to mosquitto to the local host + only, use "bind_address localhost". This only + applies to the default listener. Use the listener + variable to control other listeners. + Not reloaded on reload signal. + + + + directory + + When a listener is using the websockets protocol, + it is possible to serve http data as well. Set + to a directory which + contains the files you wish to serve. If this + option is not specified, then no normal http + connections will be possible. + Not reloaded on reload signal. + + + + port bind address/host + + Listen for incoming network connection on the + specified port. A second optional argument allows + the listener to be bound to a specific ip + address/hostname. If this variable is used and + neither the global + nor options are used then the + default listener will not be started. + The option + allows this listener to be bound to a specific IP + address by passing an IP address or hostname. For + websockets listeners, it is only possible to pass + an IP address here. + This option may be specified multiple times. See + also the + option. + Not reloaded on reload signal. + + + + count + + Limit the total number of clients connected for + the current listener. Set to -1 + to have "unlimited" connections. Note that other + limits may be imposed that are outside the control + of mosquitto. See e.g. + limits.conf5. + Not reloaded on reload signal. + + + + topic prefix + + This option is used with the listener option to + isolate groups of clients. When a client connects + to a listener which uses this option, the string + argument is attached to the start of all topics for + this client. This prefix is removed when any + messages are sent to the client. This means a + client connected to a listener with mount point + example can only see + messages that are published in the topic hierarchy + example and above. + Not reloaded on reload signal. + + + + port number + + Set the network port for the default listener to + listen on. Defaults to 1883. + Not reloaded on reload signal. + + + + value + + Set the protocol to accept for this listener. Can + be , the default, or + if available. + Websockets support is currently disabled by + default at compile time. Certificate based TLS may be used + with websockets, except that only the + , , + and + options are + supported. + Not reloaded on reload signal. + + + + [ true | false ] + + Set to + true to replace the clientid that a client + connected with with its username. This allows + authentication to be tied to the clientid, which + means that it is possible to prevent one client + disconnecting another by using the same + clientid. Defaults to false. + If a client connects with no username it will be + disconnected as not authorised when this option is + set to true. Do not use in conjunction with + . + See also + . + Not reloaded on reload signal. + + + + level + + Change the websockets logging level. This is a + global option, it is not possible to set per + listener. This is an integer that is interpreted by + libwebsockets as a bit mask for its lws_log_levels + enum. See the libwebsockets documentation for more + details. + To use this option, must also be enabled. + Defaults to 0. + + + + + + Certificate based SSL/TLS Support + The following options are available for all listeners to + configure certificate based SSL support. See also + "Pre-shared-key based SSL/TLS support". + + + file path + + At least one of or + must be provided to allow + SSL support. + is used to define the + path to a file containing the PEM encoded CA + certificates that are trusted. + + + + directory path + + At least one of or + must be provided to allow + SSL support. + is used to define a + directory that contains PEM encoded CA certificates + that are trusted. For to + work correctly, the certificates files must have + ".pem" as the file ending and you must run + "c_rehash <path to capath>" each time you + add/remove a certificate. + + + + file path + + Path to the PEM encoded server certificate. + + + + cipher:list + + The list of allowed ciphers, each separated with + a colon. Available ciphers can be obtained using + the "openssl ciphers" command. + + + + file path + + If you have + set to true, you can + create a certificate revocation list file to revoke + access to particular client certificates. If you + have done this, use crlfile to point to the PEM + encoded revocation file. + + + + file path + + Path to the PEM encoded keyfile. + + + + [ true | false ] + + By default an SSL/TLS enabled listener will + operate in a similar fashion to a https enabled web + server, in that the server has a certificate signed + by a CA and the client will verify that it is a + trusted certificate. The overall aim is encryption + of the network traffic. By setting + to + true, the client must + provide a valid certificate in order for the + network connection to proceed. This allows access + to the broker to be controlled outside of the + mechanisms provided by MQTT. + + + + version + + Configure the version of the TLS protocol to be + used for this listener. Possible values are + tlsv1.2, + tlsv1.1 and + tlsv1. If left unset, + the default of allowing all of TLS v1.2, v1.1 and + v1.0 is used. + + + + [ true | false ] + + If is + true, you may set + to + true to use the CN value + from the client certificate as a username. If this + is true, the + option will not be + used for this listener. + + + + + + Pre-shared-key based SSL/TLS Support + The following options are available for all listeners to + configure pre-shared-key based SSL support. See also + "Certificate based SSL/TLS support". + + + cipher:list + + When using PSK, the encryption ciphers used will + be chosen from the list of available PSK ciphers. + If you want to control which ciphers are available, + use this option. The list of available ciphers can + be optained using the "openssl ciphers" command and + should be provided in the same format as the output + of that command. + + + + hint + + The option enables + pre-shared-key support for this listener and also + acts as an identifier for this listener. The hint + is sent to clients and may be used locally to aid + authentication. The hint is a free form string that + doesn't have much meaning in itself, so feel free + to be creative. + If this option is provided, see + to define the pre-shared + keys to be used or create a security plugin to + handle them. + + + + version + + Configure the version of the TLS protocol to be + used for this listener. Possible values are + tlsv1.2, + tlsv1.1 and + tlsv1. If left unset, + the default of allowing all of TLS v1.2, v1.1 and + v1.0 is used. + + + + [ true | false ] + + Set to + have the psk identity sent by the client used as + its username. The username will be checked as + normal, so or + another means of authentication checking must be + used. No password will be used. + + + + + + + + Configuring Bridges + Multiple bridges (connections to other brokers) can be configured + using the following variables. + Bridges cannot currently be reloaded on reload signal. + + + address[:port] [address[:port]] + address[:port] [address[:port]] + + Specify the address and optionally the port of the + bridge to connect to. This must be given for each + bridge connection. If the port is not specified, the + default of 1883 is used. + Multiple host addresses can be specified on the + address config. See the + option for more details on the behaviour of bridges + with multiple addresses. + + + + [ true | false ] + + If a bridge has topics that have "out" direction, the + default behaviour is to send an unsubscribe request to + the remote broker on that topic. This means that + changing a topic direction from "in" to "out" will not + keep receiving incoming messages. Sending these + unsubscribe requests is not always desirable, setting + to + false will disable sending + the unsubscribe request. Defaults to + true. + + + + version + + Set the version of the MQTT protocol to use with for + this bridge. Can be one of + mqttv31 or + mqttv311. Defaults to + mqttv31. + + + + [ true | false ] + + Set the clean session option for this bridge. Setting + to false (the default), + means that all subscriptions on the remote broker are + kept in case of the network connection dropping. If set + to true, all subscriptions + and messages on the remote broker will be cleaned up if + the connection drops. Note that setting to + true may cause a large + amount of retained messages to be sent each time the + bridge reconnects. + If you are using bridges with + set to + false (the default), then + you may get unexpected behaviour from incoming topics + if you change what topics you are subscribing to. This + is because the remote broker keeps the subscription for + the old topic. If you have this problem, connect your + bridge with set to + true, then reconnect with + cleansession set to false as + normal. + + + + name + + This variable marks the start of a new bridge + connection. It is also used to give the bridge a name + which is used as the client id on the remote + broker. + + + + seconds + + Set the number of seconds after which the bridge + should send a ping if no other traffic has occurred. + Defaults to 60. A minimum value of 5 seconds + is allowed. + + + + seconds + + Set the amount of time a bridge using the lazy start + type must be idle before it will be stopped. Defaults + to 60 seconds. + + + + id + + Set the clientid to use on the local broker. If not + defined, this defaults to + . If you are + bridging a broker to itself, it is important that + local_clientid and clientid do not match. + + + + password + + Configure the password to be used when connecting + this bridge to the local broker. This may be important + when authentication and ACLs are being used. + + + + username + + Configure the username to be used when connecting + this bridge to the local broker. This may be important + when authentication and ACLs are being used. + + + + [ true | false ] + + If set to true, publish + notification messages to the local and remote brokers + giving information about the state of the bridge + connection. Retained messages are published to the + topic $SYS/broker/connection/<clientid>/state + unless otherwise set with + s. If the message + is 1 then the connection is active, or 0 if the + connection has failed. Defaults to + true. + + + + topic + + Choose the topic on which notifications will be + published for this bridge. If not set the messages will + be sent on the topic + $SYS/broker/connection/<clientid>/state. + + + + id + + Set the client id for this bridge connection. If not + defined, this defaults to 'name.hostname', where name + is the connection name and hostname is the hostname of + this computer. + This replaces the old "clientid" option to avoid + confusion with local/remote sides of the bridge. + "clientid" remains valid for the time being. + + + + value + + Configure a password for the bridge. This is used for + authentication purposes when connecting to a broker + that supports MQTT v3.1 and up and requires a username + and/or password to connect. This option is only valid + if a remote_username is also supplied. + This replaces the old "password" option to avoid + confusion with local/remote sides of the bridge. + "password" remains valid for the time being. + + + + name + + Configure a username for the bridge. This is used for + authentication purposes when connecting to a broker + that supports MQTT v3.1 and up and requires a username + and/or password to connect. See also the + option. + This replaces the old "username" option to avoid + confusion with local/remote sides of the bridge. + "username" remains valid for the time being. + + + + value + + Set the amount of time a bridge using the automatic + start type will wait until attempting to reconnect. + Defaults to 30 seconds. + + + + [ true | false ] + + If the bridge has more than one address given in the + address/addresses configuration, the round_robin option + defines the behaviour of the bridge on a failure of the + bridge connection. If round_robin is + false, the default value, + then the first address is treated as the main bridge + connection. If the connection fails, the other + secondary addresses will be attempted in turn. Whilst + connected to a secondary bridge, the bridge will + periodically attempt to reconnect to the main bridge + until successful. + If round_robin is true, + then all addresses are treated as equals. If a + connection fails, the next address will be tried and if + successful will remain connected until it fails. + + + + [ automatic | lazy | once ] + + Set the start type of the bridge. This controls how + the bridge starts and can be one of three types: + automatic, lazy + and once. Note + that RSMB provides a fourth start type "manual" which + isn't currently supported by mosquitto. + + automatic is the default + start type and means that the bridge connection will be + started automatically when the broker starts and also + restarted after a short delay (30 seconds) if the + connection fails. + + Bridges using the lazy + start type will be started automatically when the + number of queued messages exceeds the number set with + the option. It will be + stopped automatically after the time set by the + parameter. Use this start + type if you wish the connection to only be active when + it is needed. + + A bridge using the once + start type will be started automatically when the + broker starts but will not be restarted if the + connection fails. + + + + count + + Set the number of messages that need to be queued for + a bridge with lazy start type to be restarted. + Defaults to 10 messages. + + + + pattern [[[ out | in | both ] qos-level] local-prefix remote-prefix] + + Define a topic pattern to be shared between the two + brokers. Any topics matching the pattern (which may + include wildcards) are shared. The second parameter + defines the direction that the messages will be shared + in, so it is possible to import messages from a remote + broker using in, export + messages to a remote broker using + out or share messages in + both directions. If this parameter is not defined, the + default of out is used. The + QoS level defines the publish/subscribe QoS level used + for this topic and defaults to 0. + The local-prefix and + remote-prefix options allow + topics to be remapped when publishing to and receiving + from remote brokers. This allows a topic tree from the + local broker to be inserted into the topic tree of the + remote broker at an appropriate place. + For incoming topics, the bridge will prepend the + pattern with the remote prefix and subscribe to the + resulting topic on the remote broker. When a matching + incoming message is received, the remote prefix will be + removed from the topic and then the local prefix + added. + For outgoing topics, the bridge will prepend the + pattern with the local prefix and subscribe to the + resulting topic on the local broker. When an outgoing + message is processed, the local prefix will be removed + from the topic then the remote prefix added. + When using topic mapping, an empty prefix can be + defined using the place marker + "". Using the empty marker + for the topic itself is also valid. The table below + defines what combination of empty or value is + valid. + + + + + + Topic + Local Prefix + Remote Prefix + Validity + + + + 1valuevaluevaluevalid + 2valuevalue""valid + 3value""valuevalid + 4value""""valid (no remapping) + 5""valuevaluevalid (remap single local topic to remote) + 6""value""invalid + 7""""valueinvalid + 8""""""invalid + + + + To remap an entire topic tree, use e.g.: + +topic # both 2 local/topic/ remote/topic/ + + This option can be specified multiple times per + bridge. + Care must be taken to ensure that loops are not + created with this option. If you are experiencing high + CPU load from a broker, it is possible that you have a + loop where each broker is forever forwarding each other + the same messages. + See also the option if + you have messages arriving on unexpected topics when + using incoming topics. + + + The configuration below connects a bridge to the + broker at . It + subscribes to the remote topic + and + republishes the messages received to the local topic + + +connection test-mosquitto-org +address test.mosquitto.org +cleansession true +topic clients/total in 0 test/mosquitto/org $SYS/broker/ + + + + + + [ true | false ] + + If try_private is set to + true, the bridge will + attempt to indicate to the remote broker that it is a + bridge not an ordinary client. If successful, this + means that loop detection will be more effective and + that retained messages will be propagated correctly. + Not all brokers support this feature so it may be + necessary to set to + false if your bridge does + not connect properly. + Defaults to true. + + + + + SSL/TLS Support + The following options are available for all bridges to + configure SSL/TLS support. + + + [ true | false ] + + If a bridge has topics that have "out" direction, + the default behaviour is to send an unsubscribe + request to the remote broker on that topic. This + means that changing a topic direction from "in" to + "out" will not keep receiving incoming messages. + Sending these unsubscribe requests is not always + desirable, setting + to + false will disable + sending the unsubscribe request. + + + + file path + + One of or + must be provided to + allow SSL/TLS support. + bridge_cafile is used to define the path to a file + containing the PEM encoded CA certificates that + have signed the certificate for the remote broker. + + + + + file path + + One of or + must be provided to + allow SSL/TLS support. + bridge_capath is used to define the path to a + directory containing the PEM encoded CA + certificates that have signed the certificate for + the remote broker. For bridge_capath to work + correctly, the certificate files must have ".crt" + as the file ending and you must run "c_rehash + <path to bridge_capath>" each time you + add/remove a certificate. + + + + file path + + Path to the PEM encoded client certificate for + this bridge, if required by the remote + broker. + + + + identity + + Pre-shared-key encryption provides an alternative + to certificate based encryption. A bridge can be + configured to use PSK with the + and + options. This is the + client identity used with PSK encryption. Only one + of certificate and PSK based encryption can be used + on one bridge at once. + + + + [ true | false ] + + When using certificate based TLS, the bridge will + attempt to verify the hostname provided in the + remote certificate matches the host/address being + connected to. This may cause problems in testing + scenarios, so may + be set to false to + disable the hostname verification. + Setting this option to + true means that a + malicious third party could potentially inpersonate + your server, so it should always be set to + false in production + environments. + + + + file path + + Path to the PEM encoded private key for this + bridge, if required by the remote broker. + + + + key + + Pre-shared-key encryption provides an alternative + to certificate based encryption. A bridge can be + configured to use PSK with the + and + options. This is the + pre-shared-key in hexadecimal format with no "0x". + Only one of certificate and PSK based encryption + can be used on one bridge at once. + + + + version + + Configure the version of the TLS protocol to be + used for this bridge. Possible values are + tlsv1.2, + tlsv1.1 and + tlsv1. Defaults to + tlsv1.2. The remote + broker must support the same version of TLS for the + connection to succeed. + + + + + + + + Files + mosquitto.conf + + + + Bugs + mosquitto bug information can be found at + + + + + See Also + + + + mosquitto + 8 + + + + + mosquitto_passwd + 1 + + + + + mosquitto-tls + 7 + + + + + mqtt + 7 + + + + + limits.conf + 5 + + + + + + + Author + Roger Light roger@atchoo.org + + diff --git a/src/libs/mosquitto/man/mosquitto_passwd.1 b/src/libs/mosquitto/man/mosquitto_passwd.1 new file mode 100644 index 0000000..e24115f --- /dev/null +++ b/src/libs/mosquitto/man/mosquitto_passwd.1 @@ -0,0 +1,125 @@ +'\" t +.\" Title: mosquitto_passwd +.\" Author: [see the "Author" section] +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 07/10/2017 +.\" Manual: Commands +.\" Source: Mosquitto Project +.\" Language: English +.\" +.TH "MOSQUITTO_PASSWD" "1" "07/10/2017" "Mosquitto Project" "Commands" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +mosquitto_passwd \- manage password files for mosquitto +.SH "SYNOPSIS" +.HP \w'\fBmosquitto_passwd\fR\ 'u +\fBmosquitto_passwd\fR [\fB\-c\fR | \fB\-D\fR] \fIpasswordfile\fR \fIusername\fR +.HP \w'\fBmosquitto_passwd\fR\ 'u +\fBmosquitto_passwd\fR \fB\-b\fR \fIpasswordfile\fR \fIusername\fR \fIpassword\fR +.HP \w'\fBmosquitto_passwd\fR\ 'u +\fBmosquitto_passwd\fR \fB\-U\fR \fIpasswordfile\fR +.SH "DESCRIPTION" +.PP +\fBmosquitto_passwd\fR +is a tool for managing password files the mosquitto MQTT broker\&. +.PP +Usernames must not contain ":"\&. Passwords are stored in a similar format to +\fBcrypt\fR(3)\&. +.SH "OPTIONS" +.PP +\fB\-b\fR +.RS 4 +Run in batch mode\&. This allows the password to be provided at the command line which can be convenient but should be used with care because the password will be visible on the command line and in command history\&. +.RE +.PP +\fB\-c\fR +.RS 4 +Create a new password file\&. If the file already exists, it will be overwritten\&. +.RE +.PP +\fB\-D\fR +.RS 4 +Delete the specified user from the password file\&. +.RE +.PP +\fB\-U\fR +.RS 4 +This option can be used to upgrade/convert a password file with plain text passwords into one using hashed passwords\&. It will modify the specified file\&. It does not detect whether passwords are already hashed, so using it on a password file that already contains hashed passwords will generate new hashes based on the old hashes and render the password file unusable\&. +.RE +.PP +\fBpasswordfile\fR +.RS 4 +The password file to modify\&. +.RE +.PP +\fBusername\fR +.RS 4 +The username to add/update/delete\&. +.RE +.PP +\fBpassword\fR +.RS 4 +The password to use when in batch mode\&. +.RE +.SH "EXAMPLES" +.PP +Add a user to a new password file: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +mosquitto_passwd +\-c +/etc/mosquitto/passwd +ral +.RE +.PP +Delete a user from a password file +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +mosquitto_passwd +\-D +/etc/mosquitto/passwd +ral +.RE +.SH "BUGS" +.PP +\fBmosquitto\fR +bug information can be found at +\m[blue]\fB\%https://github.com/eclipse/mosquitto/issues\fR\m[] +.SH "SEE ALSO" +\fBmosquitto\fR(8), \fBmosquitto.conf\fR(5), \fBmqtt\fR(7) +.SH "AUTHOR" +.PP +Roger Light + diff --git a/src/libs/mosquitto/man/mosquitto_passwd.1.xml b/src/libs/mosquitto/man/mosquitto_passwd.1.xml new file mode 100644 index 0000000..95b3c13 --- /dev/null +++ b/src/libs/mosquitto/man/mosquitto_passwd.1.xml @@ -0,0 +1,158 @@ + + + + + + mosquitto_passwd + 1 + Mosquitto Project + Commands + + + + mosquitto_passwd + manage password files for mosquitto + + + + + mosquitto_passwd + + + + + passwordfile + username + + + mosquitto_passwd + + passwordfile + username + password + + + mosquitto_passwd + + passwordfile + + + + + Description + mosquitto_passwd is a tool for managing + password files the mosquitto MQTT broker. + Usernames must not contain ":". Passwords are stored in a similar + format to + crypt3. + + + + Options + + + + + Run in batch mode. This allows the password to be + provided at the command line which can be convenient + but should be used with care because the password will + be visible on the command line and in command + history. + + + + + + Create a new password file. If the file already + exists, it will be overwritten. + + + + + + Delete the specified user from the password + file. + + + + + + This option can be used to upgrade/convert a password + file with plain text passwords into one using hashed + passwords. It will modify the specified file. It does + not detect whether passwords are already hashed, so + using it on a password file that already contains + hashed passwords will generate new hashes based on the + old hashes and render the password file + unusable. + + + + + + The password file to modify. + + + + + + The username to add/update/delete. + + + + + + The password to use when in batch mode. + + + + + + + + Examples + Add a user to a new password file: + + mosquitto_passwd -c /etc/mosquitto/passwd ral + + Delete a user from a password file + + mosquitto_passwd -D /etc/mosquitto/passwd ral + + + + + Bugs + mosquitto bug information can be found at + + + + + See Also + + + + mosquitto + 8 + + + + + mosquitto.conf + 5 + + + + + mqtt + 7 + + + + + + + Author + Roger Light roger@atchoo.org + + diff --git a/src/libs/mosquitto/man/mosquitto_pub.1 b/src/libs/mosquitto/man/mosquitto_pub.1 new file mode 100644 index 0000000..101c4ed --- /dev/null +++ b/src/libs/mosquitto/man/mosquitto_pub.1 @@ -0,0 +1,430 @@ +'\" t +.\" Title: mosquitto_pub +.\" Author: [see the "Author" section] +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 07/10/2017 +.\" Manual: Commands +.\" Source: Mosquitto Project +.\" Language: English +.\" +.TH "MOSQUITTO_PUB" "1" "07/10/2017" "Mosquitto Project" "Commands" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +mosquitto_pub \- an MQTT version 3\&.1/3\&.1\&.1 client for publishing simple messages +.SH "SYNOPSIS" +.HP \w'\fBmosquitto_pub\fR\ 'u +\fBmosquitto_pub\fR [\fB\-A\fR\ \fIbind_address\fR] [\fB\-d\fR] [\fB\-h\fR\ \fIhostname\fR] [\fB\-i\fR\ \fIclient_id\fR] [\fB\-I\fR\ \fIclient\ id\ prefix\fR] [\fB\-k\fR\ \fIkeepalive\ time\fR] [\fB\-p\fR\ \fIport\ number\fR] [\fB\-q\fR\ \fImessage\ QoS\fR] [\fB\-\-quiet\fR] [\fB\-r\fR] [\fB\-S\fR] {\fB\-f\fR\ \fIfile\fR | \fB\-l\fR | \fB\-m\fR\ \fImessage\fR | \fB\-n\fR | \fB\-s\fR} [[\fB\-u\fR\ \fIusername\fR]\ [\fB\-P\fR\ \fIpassword\fR]] [\fB\-\-will\-topic\fR\ \fItopic\fR\ [\fB\-\-will\-payload\fR\ \fIpayload\fR]\ [\fB\-\-will\-qos\fR\ \fIqos\fR]\ [\fB\-\-will\-retain\fR]] [[{\fB\-\-cafile\fR\ \fIfile\fR\ |\ \fB\-\-capath\fR\ \fIdir\fR}\ [\fB\-\-cert\fR\ \fIfile\fR]\ [\fB\-\-key\fR\ \fIfile\fR]\ [\fB\-\-ciphers\fR\ \fIciphers\fR]\ [\fB\-\-tls\-version\fR\ \fIversion\fR]\ [\fB\-\-insecure\fR]] | [\fB\-\-psk\fR\ \fIhex\-key\fR\ \fB\-\-psk\-identity\fR\ \fIidentity\fR\ [\fB\-\-ciphers\fR\ \fIciphers\fR]\ [\fB\-\-tls\-version\fR\ \fIversion\fR]]] [\fB\-\-proxy\fR\ \fIsocks\-url\fR] [\fB\-V\fR\ \fIprotocol\-version\fR] \fB\-t\fR\ \fImessage\-topic\fR +.HP \w'\fBmosquitto_pub\fR\ 'u +\fBmosquitto_pub\fR [\fB\-\-help\fR] +.SH "DESCRIPTION" +.PP +\fBmosquitto_pub\fR +is a simple MQTT version 3\&.1 client that will publish a single message on a topic and exit\&. +.SH "OPTIONS" +.PP +The options below may be given on the command line, but may also be placed in a config file located at +\fB$XDG_CONFIG_HOME/mosquitto_pub\fR +or +\fB$HOME/\&.config/mosquitto_sub\fR +with one pair of +\fB\-option \fR\fB\fIvalue\fR\fR +per line\&. The values in the config file will be used as defaults and can be overridden by using the command line\&. The exceptions to this are the message type options, of which only one can be specified\&. Note also that currently some options cannot be negated, e\&.g\&. +\fB\-S\fR\&. Config file lines that have a +\fB#\fR +as the first character are treated as comments and not processed any further\&. +.PP +\fB\-A\fR +.RS 4 +Bind the outgoing connection to a local ip address/hostname\&. Use this argument if you need to restrict network communication to a particular interface\&. +.RE +.PP +\fB\-\-cafile\fR +.RS 4 +Define the path to a file containing PEM encoded CA certificates that are trusted\&. Used to enable SSL communication\&. +.sp +See also +\fB\-\-capath\fR +.RE +.PP +\fB\-\-capath\fR +.RS 4 +Define the path to a directory containing PEM encoded CA certificates that are trusted\&. Used to enable SSL communication\&. +.sp +For +\fB\-\-capath\fR +to work correctly, the certificate files must have "\&.crt" as the file ending and you must run "c_rehash " each time you add/remove a certificate\&. +.sp +See also +\fB\-\-cafile\fR +.RE +.PP +\fB\-\-cert\fR +.RS 4 +Define the path to a file containing a PEM encoded certificate for this client, if required by the server\&. +.sp +See also +\fB\-\-key\fR\&. +.RE +.PP +\fB\-\-ciphers\fR +.RS 4 +An openssl compatible list of TLS ciphers to support in the client\&. See +\fBciphers\fR(1) +for more information\&. +.RE +.PP +\fB\-d\fR, \fB\-\-debug\fR +.RS 4 +Enable debug messages\&. +.RE +.PP +\fB\-f\fR, \fB\-\-file\fR +.RS 4 +Send the contents of a file as the message\&. +.RE +.PP +\fB\-\-help\fR +.RS 4 +Display usage information\&. +.RE +.PP +\fB\-h\fR, \fB\-\-host\fR +.RS 4 +Specify the host to connect to\&. Defaults to localhost\&. +.RE +.PP +\fB\-i\fR, \fB\-\-id\fR +.RS 4 +The id to use for this client\&. If not given, defaults to mosquitto_pub_ appended with the process id of the client\&. Cannot be used at the same time as the +\fB\-\-id\-prefix\fR +argument\&. +.RE +.PP +\fB\-I\fR, \fB\-\-id\-prefix\fR +.RS 4 +Provide a prefix that the client id will be built from by appending the process id of the client\&. This is useful where the broker is using the clientid_prefixes option\&. Cannot be used at the same time as the +\fB\-\-id\fR +argument\&. +.RE +.PP +\fB\-\-insecure\fR +.RS 4 +When using certificate based encryption, this option disables verification of the server hostname in the server certificate\&. This can be useful when testing initial server configurations but makes it possible for a malicious third party to impersonate your server through DNS spoofing, for example\&. Use this option in testing +\fIonly\fR\&. If you need to resort to using this option in a production environment, your setup is at fault and there is no point using encryption\&. +.RE +.PP +\fB\-k\fR, \fB\-\-keepalive\fR +.RS 4 +The number of seconds between sending PING commands to the broker for the purposes of informing it we are still connected and functioning\&. Defaults to 60 seconds\&. +.RE +.PP +\fB\-\-key\fR +.RS 4 +Define the path to a file containing a PEM encoded private key for this client, if required by the server\&. +.sp +See also +\fB\-\-cert\fR\&. +.RE +.PP +\fB\-l\fR, \fB\-\-stdin\-line\fR +.RS 4 +Send messages read from stdin, splitting separate lines into separate messages\&. Note that blank lines won\*(Aqt be sent\&. +.RE +.PP +\fB\-m\fR, \fB\-\-message\fR +.RS 4 +Send a single message from the command line\&. +.RE +.PP +\fB\-n\fR, \fB\-\-null\-message\fR +.RS 4 +Send a null (zero length) message\&. +.RE +.PP +\fB\-p\fR, \fB\-\-port\fR +.RS 4 +Connect to the port specified instead of the default 1883\&. +.RE +.PP +\fB\-P\fR, \fB\-\-pw\fR +.RS 4 +Provide a password to be used for authenticating with the broker\&. Using this argument without also specifying a username is invalid\&. This requires a broker that supports MQTT v3\&.1\&. See also the +\fB\-\-username\fR +option\&. +.RE +.PP +\fB\-\-proxy\fR +.RS 4 +Specify a SOCKS5 proxy to connect through\&. "None" and "username" authentication types are supported\&. The +\fBsocks\-url\fR +must be of the form +\fBsocks5h://[username[:password]@]host[:port]\fR\&. The protocol prefix +\fBsocks5h\fR +means that hostnames are resolved by the proxy\&. The symbols %25, %3A and %40 are URL decoded into %, : and @ respectively, if present in the username or password\&. +.sp +If username is not given, then no authentication is attempted\&. If the port is not given, then the default of 1080 is used\&. +.sp +More SOCKS versions may be available in the future, depending on demand, and will use different protocol prefixes as described in +\fBcurl\fR(1)\&. +.RE +.PP +\fB\-\-psk\fR +.RS 4 +Provide the hexadecimal (no leading 0x) pre\-shared\-key matching the one used on the broker to use TLS\-PSK encryption support\&. +\fB\-\-psk\-identity\fR +must also be provided to enable TLS\-PSK\&. +.RE +.PP +\fB\-\-psk\-identity\fR +.RS 4 +The client identity to use with TLS\-PSK support\&. This may be used instead of a username if the broker is configured to do so\&. +.RE +.PP +\fB\-q\fR, \fB\-\-qos\fR +.RS 4 +Specify the quality of service to use for the message, from 0, 1 and 2\&. Defaults to 0\&. +.RE +.PP +\fB\-\-quiet\fR +.RS 4 +If this argument is given, no runtime errors will be printed\&. This excludes any error messages given in case of invalid user input (e\&.g\&. using +\fB\-\-port\fR +without a port)\&. +.RE +.PP +\fB\-r\fR, \fB\-\-retain\fR +.RS 4 +If retain is given, the message will be retained as a "last known good" value on the broker\&. See +\fBmqtt\fR(7) +for more information\&. +.RE +.PP +\fB\-s\fR, \fB\-\-stdin\-file\fR +.RS 4 +Send a message read from stdin, sending the entire content as a single message\&. +.RE +.PP +\fB\-S\fR +.RS 4 +Use SRV lookups to determine which host to connect to\&. Performs lookups to +\fB_mqtt\&._tcp\&.\fR +when used in conjunction with +\fB\-h\fR, otherwise uses +\fB_mqtt\&._tcp\&.\fR\&. +.RE +.PP +\fB\-t\fR, \fB\-\-topic\fR +.RS 4 +The MQTT topic on which to publish the message\&. See +\fBmqtt\fR(7) +for more information on MQTT topics\&. +.RE +.PP +\fB\-\-tls\-version\fR +.RS 4 +Choose which TLS protocol version to use when communicating with the broker\&. Valid options are +\fBtlsv1\&.2\fR, +\fBtlsv1\&.1\fR +and +\fBtlsv1\fR\&. The default value is +\fBtlsv1\&.2\fR\&. If the installed version of openssl is too old, only +\fBtlsv1\fR +will be available\&. Must match the protocol version used by the broker\&. +.RE +.PP +\fB\-u\fR, \fB\-\-username\fR +.RS 4 +Provide a username to be used for authenticating with the broker\&. This requires a broker that supports MQTT v3\&.1\&. See also the +\fB\-\-pw\fR +argument\&. +.RE +.PP +\fB\-V\fR, \fB\-\-protocol\-version\fR +.RS 4 +Specify which version of the MQTT protocol should be used when connecting to the rmeote broker\&. Can be +\fBmqttv31\fR +or +\fBmqttv311\fR\&. Defaults to +\fBmqttv31\fR\&. +.RE +.PP +\fB\-\-will\-payload\fR +.RS 4 +Specify a message that will be stored by the broker and sent out if this client disconnects unexpectedly\&. This must be used in conjunction with +\fB\-\-will\-topic\fR\&. +.RE +.PP +\fB\-\-will\-qos\fR +.RS 4 +The QoS to use for the Will\&. Defaults to 0\&. This must be used in conjunction with +\fB\-\-will\-topic\fR\&. +.RE +.PP +\fB\-\-will\-retain\fR +.RS 4 +If given, if the client disconnects unexpectedly the message sent out will be treated as a retained message\&. This must be used in conjunction with +\fB\-\-will\-topic\fR\&. +.RE +.PP +\fB\-\-will\-topic\fR +.RS 4 +The topic on which to send a Will, in the event that the client disconnects unexpectedly\&. +.RE +.SH "WILLS" +.PP +mosquitto_sub can register a message with the broker that will be sent out if it disconnects unexpectedly\&. See +\fBmqtt\fR(7) +for more information\&. +.PP +The minimum requirement for this is to use +\fB\-\-will\-topic\fR +to specify which topic the will should be sent out on\&. This will result in a non\-retained, zero length message with QoS 0\&. +.PP +Use the +\fB\-\-will\-retain\fR, +\fB\-\-will\-payload\fR +and +\fB\-\-will\-qos\fR +arguments to modify the other will parameters\&. +.SH "EXAMPLES" +.PP +Publish temperature information to localhost with QoS 1: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +mosquitto_pub +\-t +sensors/temperature +\-m +32 +\-q +1 +.RE +.PP +Publish timestamp and temperature information to a remote host on a non\-standard port and QoS 0: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +mosquitto_pub +\-h +192\&.168\&.1\&.1 +\-p +1885 +\-t +sensors/temperature +\-m +"1266193804 32" +.RE +.PP +Publish light switch status\&. Message is set to retained because there may be a long period of time between light switch events: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +mosquitto_pub +\-r +\-t +switches/kitchen_lights/status +\-m +"on" +.RE +.PP +Send the contents of a file in two ways: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +mosquitto_pub +\-t +my/topic +\-f +\&./data +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +mosquitto_pub +\-t +my/topic +\-s +< \&./data +.RE +.PP +Send parsed electricity usage data from a Current Cost meter, reading from stdin with one line/reading as one message: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +read_cc128\&.pl | mosquitto_pub +\-t +sensors/cc128 +\-l +.RE +.SH "FILES" +.PP +$XDG_CONFIG_HOME/mosquitto_pub, $HOME/\&.config/mosquitto_pub +.RS 4 +Configuration file for default options\&. +.RE +.SH "BUGS" +.PP +\fBmosquitto\fR +bug information can be found at +\m[blue]\fB\%https://github.com/eclipse/mosquitto/issues\fR\m[] +.SH "SEE ALSO" +\fBmqtt\fR(7), \fBmosquitto_sub\fR(1), \fBmosquitto\fR(8), \fBlibmosquitto\fR(3), \fBmosquitto-tls\fR(7) +.SH "AUTHOR" +.PP +Roger Light + diff --git a/src/libs/mosquitto/man/mosquitto_pub.1.xml b/src/libs/mosquitto/man/mosquitto_pub.1.xml new file mode 100644 index 0000000..7d21486 --- /dev/null +++ b/src/libs/mosquitto/man/mosquitto_pub.1.xml @@ -0,0 +1,522 @@ + + + + + + mosquitto_pub + 1 + Mosquitto Project + Commands + + + + mosquitto_pub + an MQTT version 3.1/3.1.1 client for publishing simple messages + + + + + mosquitto_pub + bind_address + + hostname + client_id + client id prefix + keepalive time + port number + message QoS + + + + + file + + message + + + + + username + password + + + topic + payload + qos + + + + + + file + dir + + file + file + ciphers + version + + + + hex-key + identity + ciphers + version + + + socks-url + protocol-version + + message-topic + + + mosquitto_pub + + + + + + + + Description + mosquitto_pub is a simple MQTT version 3.1 client that will publish a single message on a topic and exit. + + + + Options + The options below may be given on the command line, but may also + be placed in a config file located at + or + with one pair of + + per line. The values in the config file will be used as defaults + and can be overridden by using the command line. The exceptions to + this are the message type options, of which only one can be + specified. Note also that currently some options cannot be negated, + e.g. . Config file lines that have a + as the first character are treated as comments + and not processed any further. + + + + + Bind the outgoing connection to a local ip + address/hostname. Use this argument if you need to + restrict network communication to a particular + interface. + + + + + + Define the path to a file containing PEM encoded CA + certificates that are trusted. Used to enable SSL + communication. + See also + + + + + + Define the path to a directory containing PEM encoded CA + certificates that are trusted. Used to enable SSL + communication. + For to work correctly, the + certificate files must have ".crt" as the file ending + and you must run "c_rehash <path to capath>" each + time you add/remove a certificate. + See also + + + + + + Define the path to a file containing a PEM encoded + certificate for this client, if required by the + server. + See also . + + + + + + An openssl compatible list of TLS ciphers to support + in the client. See + ciphers1 + for more information. + + + + + + + Enable debug messages. + + + + + + + Send the contents of a file as the message. + + + + + + Display usage information. + + + + + + + Specify the host to connect to. Defaults to localhost. + + + + + + + The id to use for this client. If not given, defaults + to mosquitto_pub_ appended with the process id of the + client. Cannot be used at the same time as the + argument. + + + + + + + Provide a prefix that the client id will be built + from by appending the process id of the client. This is + useful where the broker is using the clientid_prefixes + option. Cannot be used at the same time as the + argument. + + + + + + When using certificate based encryption, this option + disables verification of the server hostname in the + server certificate. This can be useful when testing + initial server configurations but makes it possible for + a malicious third party to impersonate your server + through DNS spoofing, for example. Use this option in + testing only. If you need to + resort to using this option in a production + environment, your setup is at fault and there is no + point using encryption. + + + + + + + The number of seconds between sending PING commands + to the broker for the purposes of informing it we are still + connected and functioning. Defaults to 60 seconds. + + + + + + Define the path to a file containing a PEM encoded + private key for this client, if required by the + server. + See also . + + + + + + + Send messages read from stdin, splitting separate lines into separate messages. Note that blank lines won't be sent. + + + + + + + Send a single message from the command line. + + + + + + + Send a null (zero length) message. + + + + + + + Connect to the port specified instead of the default 1883. + + + + + + + Provide a password to be used for authenticating with + the broker. Using this argument without also specifying a + username is invalid. This requires a broker that supports + MQTT v3.1. See also the option. + + + + + + Specify a SOCKS5 proxy to connect through. "None" and + "username" authentication types are supported. The + must be of the form + . + The protocol prefix means that + hostnames are resolved by the proxy. The symbols %25, + %3A and %40 are URL decoded into %, : and @ + respectively, if present in the username or + password. + If username is not given, then no authentication is + attempted. If the port is not given, then the default + of 1080 is used. + More SOCKS versions may be available in the future, + depending on demand, and will use different protocol + prefixes as described in + curl + 1 . + + + + + + Provide the hexadecimal (no leading 0x) + pre-shared-key matching the one used on the broker to + use TLS-PSK encryption support. + must also be provided + to enable TLS-PSK. + + + + + + The client identity to use with TLS-PSK support. This + may be used instead of a username if the broker is + configured to do so. + + + + + + + Specify the quality of service to use for the message, from 0, 1 and 2. Defaults to 0. + + + + + + If this argument is given, no runtime errors will be + printed. This excludes any error messages given in case of + invalid user input (e.g. using without a + port). + + + + + + + If retain is given, the message will be retained as a "last known good" value on the broker. See mqtt7 for more information. + + + + + + + Send a message read from stdin, sending the entire content as a single message. + + + + + + Use SRV lookups to determine which host to connect + to. Performs lookups to + when used in + conjunction with , otherwise uses + . + + + + + + + The MQTT topic on which to publish the message. See mqtt7 for more information on MQTT topics. + + + + + + Choose which TLS protocol version to use when + communicating with the broker. Valid options are + , and + . The default value is + . If the installed version of + openssl is too old, only will be + available. Must match the protocol version used by the + broker. + + + + + + + Provide a username to be used for authenticating with + the broker. This requires a broker that supports MQTT v3.1. + See also the argument. + + + + + + + Specify which version of the MQTT protocol should be + used when connecting to the rmeote broker. Can be + or . + Defaults to . + + + + + + Specify a message that will be stored by the broker + and sent out if this client disconnects unexpectedly. This + must be used in conjunction with . + + + + + + The QoS to use for the Will. Defaults to 0. This must + be used in conjunction with . + + + + + + If given, if the client disconnects unexpectedly the + message sent out will be treated as a retained message. + This must be used in conjunction with . + + + + + + The topic on which to send a Will, in the event that + the client disconnects unexpectedly. + + + + + + + Wills + mosquitto_sub can register a message with the broker that will be + sent out if it disconnects unexpectedly. See + mqtt7 + for more information. + The minimum requirement for this is to use to + specify which topic the will should be sent out on. This will result in + a non-retained, zero length message with QoS 0. + Use the , + and + arguments to modify the other will parameters. + + + + Examples + Publish temperature information to localhost with QoS 1: + + mosquitto_pub -t sensors/temperature -m 32 -q 1 + + Publish timestamp and temperature information to a remote host on a non-standard port and QoS 0: + + mosquitto_pub -h 192.168.1.1 + -p 1885 -t + sensors/temperature -m "1266193804 + 32" + + Publish light switch status. Message is set to retained because there may be a long period of time between light switch events: + + mosquitto_pub -r -t switches/kitchen_lights/status -m "on" + + Send the contents of a file in two ways: + + mosquitto_pub -t my/topic -f ./data + mosquitto_pub -t my/topic -s < ./data + + Send parsed electricity usage data from a Current Cost meter, reading from stdin with one line/reading as one message: + + read_cc128.pl | mosquitto_pub -t sensors/cc128 -l + + + + + Files + + + $XDG_CONFIG_HOME/mosquitto_pub + $HOME/.config/mosquitto_pub + + Configuration file for default options. + + + + + + + Bugs + mosquitto bug information can be found at + + + + + See Also + + + + mqtt + 7 + + + + + mosquitto_sub + 1 + + + + + mosquitto + 8 + + + + + libmosquitto + 3 + + + + + mosquitto-tls + 7 + + + + + + + Author + Roger Light roger@atchoo.org + + diff --git a/src/libs/mosquitto/man/mosquitto_sub.1 b/src/libs/mosquitto/man/mosquitto_sub.1 new file mode 100644 index 0000000..cd9234d --- /dev/null +++ b/src/libs/mosquitto/man/mosquitto_sub.1 @@ -0,0 +1,410 @@ +'\" t +.\" Title: mosquitto_sub +.\" Author: [see the "Author" section] +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 07/10/2017 +.\" Manual: Commands +.\" Source: Mosquitto Project +.\" Language: English +.\" +.TH "MOSQUITTO_SUB" "1" "07/10/2017" "Mosquitto Project" "Commands" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +mosquitto_sub \- an MQTT version 3\&.1 client for subscribing to topics +.SH "SYNOPSIS" +.HP \w'\fBmosquitto_sub\fR\ 'u +\fBmosquitto_sub\fR [\fB\-A\fR\ \fIbind_address\fR] [\fB\-c\fR] [\fB\-C\fR\ \fImsg\ count\fR] [\fB\-d\fR] [\fB\-h\fR\ \fIhostname\fR] [\fB\-i\fR\ \fIclient_id\fR] [\fB\-I\fR\ \fIclient\ id\ prefix\fR] [\fB\-k\fR\ \fIkeepalive\ time\fR] [\fB\-p\fR\ \fIport\ number\fR] [\fB\-q\fR\ \fImessage\ QoS\fR] [\fB\-R\fR] [\fB\-S\fR] [\fB\-N\fR] [\fB\-\-quiet\fR] [\fB\-v\fR] [[\fB\-u\fR\ \fIusername\fR]\ [\fB\-P\fR\ \fIpassword\fR]] [\fB\-\-will\-topic\fR\ \fItopic\fR\ [\fB\-\-will\-payload\fR\ \fIpayload\fR]\ [\fB\-\-will\-qos\fR\ \fIqos\fR]\ [\fB\-\-will\-retain\fR]] [[{\fB\-\-cafile\fR\ \fIfile\fR\ |\ \fB\-\-capath\fR\ \fIdir\fR}\ [\fB\-\-cert\fR\ \fIfile\fR]\ [\fB\-\-key\fR\ \fIfile\fR]\ [\fB\-\-tls\-version\fR\ \fIversion\fR]\ [\fB\-\-insecure\fR]] | [\fB\-\-psk\fR\ \fIhex\-key\fR\ \fB\-\-psk\-identity\fR\ \fIidentity\fR\ [\fB\-\-tls\-version\fR\ \fIversion\fR]]] [\fB\-\-proxy\fR\ \fIsocks\-url\fR] [\fB\-V\fR\ \fIprotocol\-version\fR] [\fB\-T\fR\ \fIfilter\-out\fR...] \fB\-t\fR\ \fImessage\-topic\fR... +.HP \w'\fBmosquitto_sub\fR\ 'u +\fBmosquitto_sub\fR [\fB\-\-help\fR] +.SH "DESCRIPTION" +.PP +\fBmosquitto_sub\fR +is a simple MQTT version 3\&.1 client that will subscribe to a topic and print the messages that it receives\&. +.SH "OPTIONS" +.PP +The options below may be given on the command line, but may also be placed in a config file located at +\fB$XDG_CONFIG_HOME/mosquitto_sub\fR +or +\fB$HOME/\&.config/mosquitto_sub\fR +with one pair of +\fB\-option \fR\fB\fIvalue\fR\fR +per line\&. The values in the config file will be used as defaults and can be overridden by using the command line\&. The exceptions to this are +\fB\-t\fR +and +\fB\-T\fR, which if given in the config file will not be overridden\&. Note also that currently some options cannot be negated, e\&.g\&. +\fB\-S\fR\&. Config file lines that have a +\fB#\fR +as the first character are treated as comments and not processed any further\&. +.PP +\fB\-A\fR +.RS 4 +Bind the outgoing connection to a local ip address/hostname\&. Use this argument if you need to restrict network communication to a particular interface\&. +.RE +.PP +\fB\-c\fR, \fB\-\-disable\-clean\-session\fR +.RS 4 +Disable the \*(Aqclean session\*(Aq flag\&. This means that all of the subscriptions for the client will be maintained after it disconnects, along with subsequent QoS 1 and QoS 2 messages that arrive\&. When the client reconnects, it will receive all of the queued messages\&. +.sp +If using this option, it is recommended that the client id is set manually with +\fB\-\-id\fR +.RE +.PP +\fB\-\-cafile\fR +.RS 4 +Define the path to a file containing PEM encoded CA certificates that are trusted\&. Used to enable SSL communication\&. +.sp +See also +\fB\-\-capath\fR +.RE +.PP +\fB\-\-capath\fR +.RS 4 +Define the path to a directory containing PEM encoded CA certificates that are trusted\&. Used to enable SSL communication\&. +.sp +For +\fB\-\-capath\fR +to work correctly, the certificate files must have "\&.crt" as the file ending and you must run "c_rehash " each time you add/remove a certificate\&. +.sp +See also +\fB\-\-cafile\fR +.RE +.PP +\fB\-\-cert\fR +.RS 4 +Define the path to a file containing a PEM encoded certificate for this client, if required by the server\&. +.sp +See also +\fB\-\-key\fR\&. +.RE +.PP +\fB\-\-ciphers\fR +.RS 4 +An openssl compatible list of TLS ciphers to support in the client\&. See +\fBciphers\fR(1) +for more information\&. +.RE +.PP +\fB\-C\fR +.RS 4 +Disconnect and exit the program immediately after the given count of messages have been received\&. This may be useful in shell scripts where on a single status value is required, for example\&. +.sp +Combine with +\fB\-R\fR +to print only the first set of fresh messages (i\&.e\&. that does not have the retained flag set), or with +\fB\-T\fR +to filter which topics are processed\&. +.RE +.PP +\fB\-d\fR, \fB\-\-debug\fR +.RS 4 +Enable debug messages\&. +.RE +.PP +\fB\-\-help\fR +.RS 4 +Display usage information\&. +.RE +.PP +\fB\-h\fR, \fB\-\-host\fR +.RS 4 +Specify the host to connect to\&. Defaults to localhost\&. +.RE +.PP +\fB\-i\fR, \fB\-\-id\fR +.RS 4 +The id to use for this client\&. If not given, defaults to mosquitto_sub_ appended with the process id of the client\&. Cannot be used at the same time as the +\fB\-\-id\-prefix\fR +argument\&. +.RE +.PP +\fB\-I\fR, \fB\-\-id\-prefix\fR +.RS 4 +Provide a prefix that the client id will be built from by appending the process id of the client\&. This is useful where the broker is using the clientid_prefixes option\&. Cannot be used at the same time as the +\fB\-\-id\fR +argument\&. +.RE +.PP +\fB\-\-insecure\fR +.RS 4 +When using certificate based encryption, this option disables verification of the server hostname in the server certificate\&. This can be useful when testing initial server configurations but makes it possible for a malicious third party to impersonate your server through DNS spoofing, for example\&. Use this option in testing +\fIonly\fR\&. If you need to resort to using this option in a production environment, your setup is at fault and there is no point using encryption\&. +.RE +.PP +\fB\-k\fR, \fB\-\-keepalive\fR +.RS 4 +The number of seconds between sending PING commands to the broker for the purposes of informing it we are still connected and functioning\&. Defaults to 60 seconds\&. +.RE +.PP +\fB\-\-key\fR +.RS 4 +Define the path to a file containing a PEM encoded private key for this client, if required by the server\&. +.sp +See also +\fB\-\-cert\fR\&. +.RE +.PP +\fB\-N\fR +.RS 4 +Do not append an end of line character to the payload when printing\&. This allows streaming of payload data from multiple messages directly to another application unmodified\&. Only really makes sense when not using +\fB\-v\fR\&. +.RE +.PP +\fB\-p\fR, \fB\-\-port\fR +.RS 4 +Connect to the port specified instead of the default 1883\&. +.RE +.PP +\fB\-P\fR, \fB\-\-pw\fR +.RS 4 +Provide a password to be used for authenticating with the broker\&. Using this argument without also specifying a username is invalid\&. This requires a broker that supports MQTT v3\&.1\&. See also the +\fB\-\-username\fR +option\&. +.RE +.PP +\fB\-\-proxy\fR +.RS 4 +Specify a SOCKS5 proxy to connect through\&. "None" and "username" authentication types are supported\&. The +\fBsocks\-url\fR +must be of the form +\fBsocks5h://[username[:password]@]host[:port]\fR\&. The protocol prefix +\fBsocks5h\fR +means that hostnames are resolved by the proxy\&. The symbols %25, %3A and %40 are URL decoded into %, : and @ respectively, if present in the username or password\&. +.sp +If username is not given, then no authentication is attempted\&. If the port is not given, then the default of 1080 is used\&. +.sp +More SOCKS versions may be available in the future, depending on demand, and will use different protocol prefixes as described in +\fBcurl\fR(1)\&. +.RE +.PP +\fB\-\-psk\fR +.RS 4 +Provide the hexadecimal (no leading 0x) pre\-shared\-key matching the one used on the broker to use TLS\-PSK encryption support\&. +\fB\-\-psk\-identity\fR +must also be provided to enable TLS\-PSK\&. +.RE +.PP +\fB\-\-psk\-identity\fR +.RS 4 +The client identity to use with TLS\-PSK support\&. This may be used instead of a username if the broker is configured to do so\&. +.RE +.PP +\fB\-q\fR, \fB\-\-qos\fR +.RS 4 +Specify the quality of service desired for the incoming messages, from 0, 1 and 2\&. Defaults to 0\&. See +\fBmqtt\fR(7) +for more information on QoS\&. +.sp +The QoS is identical for all topics subscribed to in a single instance of mosquitto_sub\&. +.RE +.PP +\fB\-\-quiet\fR +.RS 4 +If this argument is given, no runtime errors will be printed\&. This excludes any error messages given in case of invalid user input (e\&.g\&. using +\fB\-\-port\fR +without a port)\&. +.RE +.PP +\fB\-R\fR +.RS 4 +If this argument is given, messages that are received that have the retain bit set will not be printed\&. Messages with retain set are "stale", in that it is not known when they were originally published\&. When subscribing to a wildcard topic there may be a large number of retained messages\&. This argument suppresses their display\&. +.RE +.PP +\fB\-S\fR +.RS 4 +Use SRV lookups to determine which host to connect to\&. Performs lookups to +\fB_mqtt\&._tcp\&.\fR +when used in conjunction with +\fB\-h\fR, otherwise uses +\fB_mqtt\&._tcp\&.\fR\&. +.RE +.PP +\fB\-t\fR, \fB\-\-topic\fR +.RS 4 +The MQTT topic to subscribe to\&. See +\fBmqtt\fR(7) +for more information on MQTT topics\&. +.sp +This option may be repeated to subscribe to multiple topics\&. +.RE +.PP +\fB\-T\fR, \fB\-\-filter\-out\fR +.RS 4 +Suppress printing of topics that match the filter\&. This allows subscribing to a wildcard topic and only printing a partial set of the wildcard hierarchy\&. +.sp +For example, subscribe to the BBC tree, but suppress output from Radio 3: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +mosquitto_sub +\-t +bbc/# +\-T +bbc/radio3 +.RE +.sp +This option may be repeated to filter out multiple topics or topic trees\&. +.RE +.PP +\fB\-\-tls\-version\fR +.RS 4 +Choose which TLS protocol version to use when communicating with the broker\&. Valid options are +\fBtlsv1\&.2\fR, +\fBtlsv1\&.1\fR +and +\fBtlsv1\fR\&. The default value is +\fBtlsv1\&.2\fR\&. If the installed version of openssl is too old, only +\fBtlsv1\fR +will be available\&. Must match the protocol version used by the broker\&. +.RE +.PP +\fB\-u\fR, \fB\-\-username\fR +.RS 4 +Provide a username to be used for authenticating with the broker\&. This requires a broker that supports MQTT v3\&.1\&. See also the +\fB\-\-pw\fR +argument\&. +.RE +.PP +\fB\-v\fR, \fB\-\-verbose\fR +.RS 4 +Print received messages verbosely\&. With this argument, messages will be printed as "topic payload"\&. When this argument is not given, the messages are printed as "payload"\&. +.RE +.PP +\fB\-V\fR, \fB\-\-protocol\-version\fR +.RS 4 +Specify which version of the MQTT protocol should be used when connecting to the rmeote broker\&. Can be +\fBmqttv31\fR +or +\fBmqttv311\fR\&. Defaults to +\fBmqttv31\fR\&. +.RE +.PP +\fB\-\-will\-payload\fR +.RS 4 +Specify a message that will be stored by the broker and sent out if this client disconnects unexpectedly\&. This must be used in conjunction with +\fB\-\-will\-topic\fR\&. +.RE +.PP +\fB\-\-will\-qos\fR +.RS 4 +The QoS to use for the Will\&. Defaults to 0\&. This must be used in conjunction with +\fB\-\-will\-topic\fR\&. +.RE +.PP +\fB\-\-will\-retain\fR +.RS 4 +If given, if the client disconnects unexpectedly the message sent out will be treated as a retained message\&. This must be used in conjunction with +\fB\-\-will\-topic\fR\&. +.RE +.PP +\fB\-\-will\-topic\fR +.RS 4 +The topic on which to send a Will, in the event that the client disconnects unexpectedly\&. +.RE +.SH "WILLS" +.PP +mosquitto_sub can register a message with the broker that will be sent out if it disconnects unexpectedly\&. See +\fBmqtt\fR(7) +for more information\&. +.PP +The minimum requirement for this is to use +\fB\-\-will\-topic\fR +to specify which topic the will should be sent out on\&. This will result in a non\-retained, zero length message with QoS 0\&. +.PP +Use the +\fB\-\-will\-retain\fR, +\fB\-\-will\-payload\fR +and +\fB\-\-will\-qos\fR +arguments to modify the other will parameters\&. +.SH "EXAMPLES" +.PP +Note that these really are examples \- the subscriptions will work if you run them as shown, but there must be something publishing messages on those topics for you to receive anything\&. +.PP +Subscribe to temperature information on localhost with QoS 1: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +mosquitto_sub +\-t +sensors/temperature +\-q +1 +.RE +.PP +Subscribe to hard drive temperature updates on multiple machines/hard drives\&. This expects each machine to be publishing its hard drive temperature to sensors/machines/HOSTNAME/temperature/HD_NAME\&. +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +mosquitto_sub +\-t +sensors/machines/+/temperature/+ +.RE +.PP +Subscribe to all broker status messages: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +mosquitto_sub +\-v +\-t +\e$SYS/# +.RE +.SH "FILES" +.PP +$XDG_CONFIG_HOME/mosquitto_sub, $HOME/\&.config/mosquitto_sub +.RS 4 +Configuration file for default options\&. +.RE +.SH "BUGS" +.PP +\fBmosquitto\fR +bug information can be found at +\m[blue]\fB\%https://github.com/eclipse/mosquitto/issues\fR\m[] +.SH "SEE ALSO" +\fBmqtt\fR(7), \fBmosquitto_pub\fR(1), \fBmosquitto\fR(8), \fBlibmosquitto\fR(3), \fBmosquitto-tls\fR(7) +.SH "AUTHOR" +.PP +Roger Light + diff --git a/src/libs/mosquitto/man/mosquitto_sub.1.xml b/src/libs/mosquitto/man/mosquitto_sub.1.xml new file mode 100644 index 0000000..876f7dc --- /dev/null +++ b/src/libs/mosquitto/man/mosquitto_sub.1.xml @@ -0,0 +1,555 @@ + + + + + + mosquitto_sub + 1 + Mosquitto Project + Commands + + + + mosquitto_sub + an MQTT version 3.1 client for subscribing to topics + + + + + mosquitto_sub + bind_address + + msg count + + hostname + client_id + client id prefix + keepalive time + port number + message QoS + + + + + + + username + password + + + topic + payload + qos + + + + + + file + dir + + file + file + version + + + + hex-key + identity + version + + + socks-url + protocol-version + filter-out + message-topic + + + mosquitto_sub + + + + + + + + Description + mosquitto_sub is a simple MQTT version 3.1 + client that will subscribe to a topic and print the messages that it + receives. + + + + Options + The options below may be given on the command line, but may also + be placed in a config file located at + or + with one pair of + + per line. The values in the config file will be used as defaults + and can be overridden by using the command line. The exceptions to + this are and , which if + given in the config file will not be overridden. Note also that + currently some options cannot be negated, e.g. + . Config file lines that have a + as the first character are treated as comments + and not processed any further. + + + + + Bind the outgoing connection to a local ip + address/hostname. Use this argument if you need to + restrict network communication to a particular + interface. + + + + + + + Disable the 'clean session' flag. This means that all + of the subscriptions for the client will be maintained + after it disconnects, along with subsequent QoS 1 and QoS 2 + messages that arrive. When the client reconnects, it will + receive all of the queued messages. + If using this option, it is recommended that the + client id is set manually with + + + + + + Define the path to a file containing PEM encoded CA + certificates that are trusted. Used to enable SSL + communication. + See also + + + + + + Define the path to a directory containing PEM encoded CA + certificates that are trusted. Used to enable SSL + communication. + For to work correctly, the + certificate files must have ".crt" as the file ending + and you must run "c_rehash <path to capath>" each + time you add/remove a certificate. + See also + + + + + + Define the path to a file containing a PEM encoded + certificate for this client, if required by the + server. + See also . + + + + + + An openssl compatible list of TLS ciphers to support + in the client. See + ciphers1 + for more information. + + + + + + Disconnect and exit the program immediately after + the given count of messages have been received. This + may be useful in shell scripts where on a single status + value is required, for example. + Combine with to print only the + first set of fresh messages (i.e. that does not have + the retained flag set), or with to + filter which topics are processed. + + + + + + + Enable debug messages. + + + + + + Display usage information. + + + + + + + Specify the host to connect to. Defaults to localhost. + + + + + + + The id to use for this client. If not given, defaults + to mosquitto_sub_ appended with the process id of the + client. Cannot be used at the same time as the + argument. + + + + + + + Provide a prefix that the client id will be built + from by appending the process id of the client. This is + useful where the broker is using the clientid_prefixes + option. Cannot be used at the same time as the + argument. + + + + + + When using certificate based encryption, this option + disables verification of the server hostname in the + server certificate. This can be useful when testing + initial server configurations but makes it possible for + a malicious third party to impersonate your server + through DNS spoofing, for example. Use this option in + testing only. If you need to + resort to using this option in a production + environment, your setup is at fault and there is no + point using encryption. + + + + + + + The number of seconds between sending PING commands + to the broker for the purposes of informing it we are still + connected and functioning. Defaults to 60 seconds. + + + + + + Define the path to a file containing a PEM encoded + private key for this client, if required by the + server. + See also . + + + + + + Do not append an end of line character to the payload + when printing. This allows streaming of payload data + from multiple messages directly to another application + unmodified. Only really makes sense when not using + . + + + + + + + Connect to the port specified instead of the default 1883. + + + + + + + Provide a password to be used for authenticating with + the broker. Using this argument without also specifying a + username is invalid. This requires a broker that supports + MQTT v3.1. See also the option. + + + + + + Specify a SOCKS5 proxy to connect through. "None" and + "username" authentication types are supported. The + must be of the form + . + The protocol prefix means that + hostnames are resolved by the proxy. The symbols %25, + %3A and %40 are URL decoded into %, : and @ + respectively, if present in the username or + password. + If username is not given, then no authentication is + attempted. If the port is not given, then the default + of 1080 is used. + More SOCKS versions may be available in the future, + depending on demand, and will use different protocol + prefixes as described in + curl + 1 . + + + + + + Provide the hexadecimal (no leading 0x) + pre-shared-key matching the one used on the broker to + use TLS-PSK encryption support. + must also be provided + to enable TLS-PSK. + + + + + + The client identity to use with TLS-PSK support. This + may be used instead of a username if the broker is + configured to do so. + + + + + + + Specify the quality of service desired for the + incoming messages, from 0, 1 and 2. Defaults to 0. See + mqtt7 + for more information on QoS. + The QoS is identical for all topics subscribed to in + a single instance of mosquitto_sub. + + + + + + If this argument is given, no runtime errors will be + printed. This excludes any error messages given in case of + invalid user input (e.g. using without a + port). + + + + + + If this argument is given, messages that are received + that have the retain bit set will not be printed. + Messages with retain set are "stale", in that it is not + known when they were originally published. When + subscribing to a wildcard topic there may be a large + number of retained messages. This argument suppresses + their display. + + + + + + Use SRV lookups to determine which host to connect + to. Performs lookups to + when used in + conjunction with , otherwise uses + . + + + + + + + The MQTT topic to subscribe to. See + mqtt7 + for more information on MQTT topics. + This option may be repeated to subscribe to multiple topics. + + + + + + + Suppress printing of topics that match the filter. + This allows subscribing to a wildcard topic and only + printing a partial set of the wildcard + hierarchy. + For example, subscribe to the BBC tree, but suppress output from Radio 3: + + mosquitto_sub -t + bbc/# -T + bbc/radio3 + + This option may be repeated to filter out multiple + topics or topic trees. + + + + + + Choose which TLS protocol version to use when + communicating with the broker. Valid options are + , and + . The default value is + . If the installed version of + openssl is too old, only will be + available. Must match the protocol version used by the + broker. + + + + + + + Provide a username to be used for authenticating with + the broker. This requires a broker that supports MQTT v3.1. + See also the argument. + + + + + + + Print received messages verbosely. With this + argument, messages will be printed as "topic payload". When + this argument is not given, the messages are printed as + "payload". + + + + + + + Specify which version of the MQTT protocol should be + used when connecting to the rmeote broker. Can be + or . + Defaults to . + + + + + + Specify a message that will be stored by the broker + and sent out if this client disconnects unexpectedly. This + must be used in conjunction with . + + + + + + The QoS to use for the Will. Defaults to 0. This must + be used in conjunction with . + + + + + + If given, if the client disconnects unexpectedly the + message sent out will be treated as a retained message. + This must be used in conjunction with . + + + + + + The topic on which to send a Will, in the event that + the client disconnects unexpectedly. + + + + + + + Wills + mosquitto_sub can register a message with the broker that will be + sent out if it disconnects unexpectedly. See + mqtt7 + for more information. + The minimum requirement for this is to use to + specify which topic the will should be sent out on. This will result in + a non-retained, zero length message with QoS 0. + Use the , and arguments to + modify the other will parameters. + + + + Examples + Note that these really are examples - the subscriptions will work + if you run them as shown, but there must be something publishing + messages on those topics for you to receive anything. + Subscribe to temperature information on localhost with QoS 1: + + mosquitto_sub -t sensors/temperature -q 1 + + Subscribe to hard drive temperature updates on multiple + machines/hard drives. This expects each machine to be publishing its + hard drive temperature to + sensors/machines/HOSTNAME/temperature/HD_NAME. + + mosquitto_sub -t sensors/machines/+/temperature/+ + + Subscribe to all broker status messages: + + mosquitto_sub -v -t \$SYS/# + + + + + Files + + + $XDG_CONFIG_HOME/mosquitto_sub + $HOME/.config/mosquitto_sub + + Configuration file for default options. + + + + + + + Bugs + mosquitto bug information can be found at + + + + + See Also + + + + mqtt + 7 + + + + + mosquitto_pub + 1 + + + + + mosquitto + 8 + + + + + libmosquitto + 3 + + + + + mosquitto-tls + 7 + + + + + + + Author + Roger Light roger@atchoo.org + + diff --git a/src/libs/mosquitto/man/mqtt.7 b/src/libs/mosquitto/man/mqtt.7 new file mode 100644 index 0000000..1613d2e --- /dev/null +++ b/src/libs/mosquitto/man/mqtt.7 @@ -0,0 +1,293 @@ +'\" t +.\" Title: mqtt +.\" Author: [see the "Author" section] +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 07/10/2017 +.\" Manual: Conventions and miscellaneous +.\" Source: Mosquitto Project +.\" Language: English +.\" +.TH "MQTT" "7" "07/10/2017" "Mosquitto Project" "Conventions and miscellaneous" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +mqtt \- MQ Telemetry Transport +.SH "SYNOPSIS" +.HP \w'\fBMQTT\fR\ 'u +\fBMQTT\fR +.SH "DESCRIPTION" +.PP +\fBMQTT\fR +is a lightweight publish/subscribe messaging protocol\&. It is useful for use with low power sensors, but is applicable to many scenarios\&. +.PP +This manual describes some of the features of MQTT version 3\&.1, to assist end users in getting the most out of the protocol\&. For more complete information on MQTT, see +http://mqtt\&.org/\&. +.SH "PUBLISH/SUBSCRIBE" +.PP +The MQTT protocol is based on the principle of publishing messages and subscribing to topics, or "pub/sub"\&. Multiple clients connect to a broker and subscribe to topics that they are interested in\&. Clients also connect to the broker and publish messages to topics\&. Many clients may subscribe to the same topics and do with the information as they please\&. The broker and MQTT act as a simple, common interface for everything to connect to\&. This means that you if you have clients that dump subscribed messages to a database, to Twitter, Cosm or even a simple text file, then it becomes very simple to add new sensors or other data input to a database, Twitter or so on\&. +.SH "TOPICS/SUBSCRIPTIONS" +.PP +Messages in MQTT are published on topics\&. There is no need to configure a topic, publishing on it is enough\&. Topics are treated as a hierarchy, using a slash (/) as a separator\&. This allows sensible arrangement of common themes to be created, much in the same way as a filesystem\&. For example, multiple computers may all publish their hard drive temperature information on the following topic, with their own computer and hard drive name being replaced as appropriate: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +sensors/COMPUTER_NAME/temperature/HARDDRIVE_NAME +.RE +.PP +Clients can receive messages by creating subscriptions\&. A subscription may be to an explicit topic, in which case only messages to that topic will be received, or it may include wildcards\&. Two wildcards are available, +\fB+\fR +or +\fB#\fR\&. +.PP +\fB+\fR +can be used as a wildcard for a single level of hierarchy\&. It could be used with the topic above to get information on all computers and hard drives as follows: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +sensors/+/temperature/+ +.RE +.PP +As another example, for a topic of "a/b/c/d", the following example subscriptions will match: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +a/b/c/d +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} ++/b/c/d +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +a/+/c/d +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +a/+/+/d +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} ++/+/+/+ +.RE +.PP +The following subscriptions will not match: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +a/b/c +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +b/+/c/d +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} ++/+/+ +.RE +.PP +\fB#\fR +can be used as a wildcard for all remaining levels of hierarchy\&. This means that it must be the final character in a subscription\&. With a topic of "a/b/c/d", the following example subscriptions will match: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +a/b/c/d +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +# +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +a/# +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +a/b/# +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +a/b/c/# +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} ++/b/c/# +.RE +.PP +Zero length topic levels are valid, which can lead to some slightly non\-obvious behaviour\&. For example, a topic of "a//topic" would correctly match against a subscription of "a/+/topic"\&. Likewise, zero length topic levels can exist at both the beginning and the end of a topic string, so "/a/topic" would match against a subscription of "+/a/topic", "#" or "/#", and a topic "a/topic/" would match against a subscription of "a/topic/+" or "a/topic/#"\&. +.SH "QUALITY OF SERVICE" +.PP +MQTT defines three levels of Quality of Service (QoS)\&. The QoS defines how hard the broker/client will try to ensure that a message is received\&. Messages may be sent at any QoS level, and clients may attempt to subscribe to topics at any QoS level\&. This means that the client chooses the maximum QoS it will receive\&. For example, if a message is published at QoS 2 and a client is subscribed with QoS 0, the message will be delivered to that client with QoS 0\&. If a second client is also subscribed to the same topic, but with QoS 2, then it will receive the same message but with QoS 2\&. For a second example, if a client is subscribed with QoS 2 and a message is published on QoS 0, the client will receive it on QoS 0\&. +.PP +Higher levels of QoS are more reliable, but involve higher latency and have higher bandwidth requirements\&. +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +0: The broker/client will deliver the message once, with no confirmation\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +1: The broker/client will deliver the message at least once, with confirmation required\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +2: The broker/client will deliver the message exactly once by using a four step handshake\&. +.RE +.SH "RETAINED MESSAGES" +.PP +All messages may be set to be retained\&. This means that the broker will keep the message even after sending it to all current subscribers\&. If a new subscription is made that matches the topic of the retained message, then the message will be sent to the client\&. This is useful as a "last known good" mechanism\&. If a topic is only updated infrequently, then without a retained message, a newly subscribed client may have to wait a long time to receive an update\&. With a retained message, the client will receive an instant update\&. +.SH "CLEAN SESSION / DURABLE CONNECTIONS" +.PP +On connection, a client sets the "clean session" flag, which is sometimes also known as the "clean start" flag\&. If clean session is set to false, then the connection is treated as durable\&. This means that when the client disconnects, any subscriptions it has will remain and any subsequent QoS 1 or 2 messages will be stored until it connects again in the future\&. If clean session is true, then all subscriptions will be removed for the client when it disconnects\&. +.SH "WILLS" +.PP +When a client connects to a broker, it may inform the broker that it has a will\&. This is a message that it wishes the broker to send when the client disconnects unexpectedly\&. The will message has a topic, QoS and retain status just the same as any other message\&. +.SH "SEE ALSO" +\fBmosquitto\fR(8), \fBmosquitto_pub\fR(1), \fBmosquitto_sub\fR(1) +.SH "AUTHOR" +.PP +Roger Light + diff --git a/src/libs/mosquitto/man/mqtt.7.xml b/src/libs/mosquitto/man/mqtt.7.xml new file mode 100644 index 0000000..d467fce --- /dev/null +++ b/src/libs/mosquitto/man/mqtt.7.xml @@ -0,0 +1,187 @@ + + + + + + mqtt + 7 + Mosquitto Project + Conventions and miscellaneous + + + + mqtt + MQ Telemetry Transport + + + + + MQTT + + + + + Description + MQTT is a lightweight publish/subscribe + messaging protocol. It is useful for use with low power sensors, but + is applicable to many scenarios. This manual describes + some of the features of MQTT version 3.1, to assist end users in + getting the most out of the protocol. For more complete information on + MQTT, see http://mqtt.org/. + + + + Publish/Subscribe + The MQTT protocol is based on the principle of publishing + messages and subscribing to topics, or "pub/sub". Multiple clients + connect to a broker and subscribe to topics that they are interested + in. Clients also connect to the broker and publish messages to topics. + Many clients may subscribe to the same topics and do with the + information as they please. The broker and MQTT act as a simple, common + interface for everything to connect to. This means that you if you have + clients that dump subscribed messages to a database, to Twitter, + Cosm or even a simple text file, then it becomes very simple to add + new sensors or other data input to a database, Twitter or so on. + + + + Topics/Subscriptions + Messages in MQTT are published on topics. There is no need to + configure a topic, publishing on it is enough. Topics are treated as a + hierarchy, using a slash (/) as a separator. This allows sensible + arrangement of common themes to be created, much in the same way as a + filesystem. For example, multiple computers may all publish their + hard drive temperature information on the following topic, with their + own computer and hard drive name being replaced as appropriate: + + sensors/COMPUTER_NAME/temperature/HARDDRIVE_NAME + + Clients can receive messages by creating subscriptions. A + subscription may be to an explicit topic, in which case only messages + to that topic will be received, or it may include wildcards. Two + wildcards are available, or . + can be used as a wildcard for a single level + of hierarchy. It could be used with the topic above to get information + on all computers and hard drives as follows: + + sensors/+/temperature/+ + + As another example, for a topic of "a/b/c/d", the following + example subscriptions will match: + + a/b/c/d + +/b/c/d + a/+/c/d + a/+/+/d + +/+/+/+ + + The following subscriptions will not match: + + a/b/c + b/+/c/d + +/+/+ + + can be used as a wildcard for all remaining levels of + hierarchy. This means that it must be the final character in a + subscription. With a topic of "a/b/c/d", the following example + subscriptions will match: + + a/b/c/d + # + a/# + a/b/# + a/b/c/# + +/b/c/# + + Zero length topic levels are valid, which can lead to some + slightly non-obvious behaviour. For example, a topic of "a//topic" + would correctly match against a subscription of "a/+/topic". + Likewise, zero length topic levels can exist at both the beginning + and the end of a topic string, so "/a/topic" would match against a + subscription of "+/a/topic", "#" or "/#", and a topic "a/topic/" + would match against a subscription of "a/topic/+" or + "a/topic/#". + + + + Quality of Service + MQTT defines three levels of Quality of Service (QoS). The QoS + defines how hard the broker/client will try to ensure that a message is + received. Messages may be sent at any QoS level, and clients may + attempt to subscribe to topics at any QoS level. This means that the + client chooses the maximum QoS it will receive. For example, if a + message is published at QoS 2 and a client is subscribed with QoS 0, + the message will be delivered to that client with QoS 0. If a second + client is also subscribed to the same topic, but with QoS 2, then it + will receive the same message but with QoS 2. For a second example, if + a client is subscribed with QoS 2 and a message is published on QoS 0, + the client will receive it on QoS 0. + Higher levels of QoS are more reliable, but involve higher + latency and have higher bandwidth requirements. + + 0: The broker/client will deliver the message once, with no confirmation. + 1: The broker/client will deliver the message at least once, with confirmation required. + 2: The broker/client will deliver the message exactly once by using a four step handshake. + + + + + Retained Messages + All messages may be set to be retained. This means that the + broker will keep the message even after sending it to all current + subscribers. If a new subscription is made that matches the topic of + the retained message, then the message will be sent to the client. This + is useful as a "last known good" mechanism. If a topic is only updated + infrequently, then without a retained message, a newly subscribed + client may have to wait a long time to receive an update. With a + retained message, the client will receive an instant update. + + + + Clean session / Durable connections + On connection, a client sets the "clean session" flag, which is + sometimes also known as the "clean start" flag. If clean session is set + to false, then the connection is treated as durable. This means that + when the client disconnects, any subscriptions it has will remain and + any subsequent QoS 1 or 2 messages will be stored until it connects + again in the future. If clean session is true, then all subscriptions + will be removed for the client when it disconnects. + + + + Wills + When a client connects to a broker, it may inform the broker that + it has a will. This is a message that it wishes the broker to send when + the client disconnects unexpectedly. The will message has a topic, + QoS and retain status just the same as any other message. + + + + See Also + + + + mosquitto + 8 + + + + + mosquitto_pub + 1 + + + + + mosquitto_sub + 1 + + + + + + + Author + Roger Light roger@atchoo.org + + diff --git a/src/libs/mosquitto/misc/currentcost/cc128_log_mysql.pl b/src/libs/mosquitto/misc/currentcost/cc128_log_mysql.pl new file mode 100755 index 0000000..1120479 --- /dev/null +++ b/src/libs/mosquitto/misc/currentcost/cc128_log_mysql.pl @@ -0,0 +1,55 @@ +#!/usr/bin/perl + +# Log CurrentCost power meter data to a mysql database. +# Assumes data is coming in on MQTT topic sensors/cc128 +# and in format timestamp,temperature,ch1_data +# e.g. 1276605752,12.7,86 + +# To create database, table and user: +# +# CREATE DATABASE powermeter; +# USE 'powermeter'; +# CREATE TABLE powermeter ( +# `id` INT NOT NULL auto_increment, +# `timestamp` INT NOT NULL, +# `temperature` FLOAT NOT NULL DEFAULT 0.0, +# `ch1` INT NOT NULL DEFAULT 0, +# PRIMARY KEY (`id`), +# UNIQUE KEY `timestamp` (`timestamp`) +# ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +# +# CREATE USER 'powermeter'@'localhost' IDENTIFIED BY ''; +# GRANT ALL ON powermeter.* to 'powermeter'@'localhost'; + +use strict; +use DBI(); +use FileHandle; + +local $| = 1; + +my $dbname = "powermeter"; +my $dbhost = "localhost"; +my $dbusername = "powermeter"; +my $dbpassword = "password"; +my $dbtable = "powermeter"; + +my $subclient = "/usr/bin/mosquitto_sub -t sensors/cc128"; +open(SUB, "$subclient|"); +SUB->autoflush(1); + +my $dbh = DBI->connect("DBI:mysql:database=$dbname;host=$dbhost", + "$dbusername", "$dbpassword", {'RaiseError' => 1}); + +my $query = "INSERT INTO powermeter (timestamp, temperature, ch1) VALUES (?,?,?)"; + +my @vals; +my ($timestamp, $temperature, $ch1); +while (my $line = ) { + @vals = split(/,/, $line); + $timestamp = @vals[0]; + $temperature = @vals[1]; + $ch1 = @vals[2]; + $dbh->do($query, undef, $timestamp, $temperature, $ch1); +} +$dbh->disconnect(); + diff --git a/src/libs/mosquitto/misc/currentcost/cc128_parse.pl b/src/libs/mosquitto/misc/currentcost/cc128_parse.pl new file mode 100755 index 0000000..0236344 --- /dev/null +++ b/src/libs/mosquitto/misc/currentcost/cc128_parse.pl @@ -0,0 +1,45 @@ +#!/usr/bin/perl -w + +# Read raw cc128 data and republish without xml. +# Probably only works if you have a single channel. + +use strict; +use HTTP::Date "str2time"; +use FileHandle; + +local $| = 1; + +my $subclient = "/usr/bin/mosquitto_sub -t sensors/cc128/raw -q 2"; +my $pubclient = "/usr/bin/mosquitto_pub -t sensors/cc128 -q 2 -l"; +my $pubclient_ch1 = "/usr/bin/mosquitto_pub -t sensors/cc128/ch1 -q 2 -l"; + +open(SUB, "$subclient|"); +open(PUB, "|$pubclient"); +open(PUB_CH1, "|$pubclient_ch1"); + +SUB->autoflush(1); +PUB->autoflush(1); +PUB_CH1->autoflush(1); + +while (my $line = ) { + #CC128-v0.120000215.7003112100108 + if ($line =~ m# *([\-\d.]+)0[0-9]*10*(\d+) $now){ + $r_stamp -= 86400; + } + + print PUB "$r_stamp,$temp,$watts\n"; + print PUB_CH1 "$r_stamp $watts\n"; + } +} diff --git a/src/libs/mosquitto/misc/currentcost/cc128_read.pl b/src/libs/mosquitto/misc/currentcost/cc128_read.pl new file mode 100755 index 0000000..e1310e5 --- /dev/null +++ b/src/libs/mosquitto/misc/currentcost/cc128_read.pl @@ -0,0 +1,23 @@ +#!/usr/bin/perl -w + +# Reads data from a Current Cost device via serial port. +# Spawns + +use strict; +use Device::SerialPort qw( :PARAM :STAT 0.07 ); + +my $pubclient = "mosquitto_pub -t sensors/cc128/raw -q 2 -l"; +my $PORT = "/dev/ttyUSB0"; +local $| = 1; + +my $ob = Device::SerialPort->new($PORT); +$ob->baudrate(57600); +$ob->write_settings; + +open(SERIAL, "+<$PORT"); +open(MQTT, "|$pubclient"); +while (my $line = ) { + print(MQTT "$line"); +} + +close(MQTT); diff --git a/src/libs/mosquitto/misc/currentcost/cc128_read.py b/src/libs/mosquitto/misc/currentcost/cc128_read.py new file mode 100755 index 0000000..d2a9c17 --- /dev/null +++ b/src/libs/mosquitto/misc/currentcost/cc128_read.py @@ -0,0 +1,22 @@ +#!/usr/bin/python -u + +import mosquitto +import serial + +usb = serial.Serial(port='/dev/ttyUSB0', baudrate=57600) + +mosq = mosquitto.Mosquitto() +mosq.connect("localhost") +mosq.loop_start() + +running = True +try: + while running: + line = usb.readline() + mosq.publish("cc128/raw", line) +except usb.SerialException, e: + running = False + +mosq.disconnect() +mosq.loop_stop() + diff --git a/src/libs/mosquitto/misc/currentcost/gnome-panel/CurrentCostMQTT.py b/src/libs/mosquitto/misc/currentcost/gnome-panel/CurrentCostMQTT.py new file mode 100755 index 0000000..1091f19 --- /dev/null +++ b/src/libs/mosquitto/misc/currentcost/gnome-panel/CurrentCostMQTT.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python + +import gnomeapplet +import gtk +import mosquitto +import sys + +class CurrentCostMQTT(gnomeapplet.Applet): + def on_message(self, mosq, obj, msg): + # Message format is "power" + self.label.set_text(msg.payload+"W") + + def set_label(self, val): + self.label.set_text(val) + + def on_change_background(self, applet, type, color, pixmap): + applet.set_style(None) + applet.modify_style(gtk.RcStyle()) + + if type == gnomeapplet.COLOR_BACKGROUND: + applet.modify_bg(gtk.STATE_NORMAL, color) + elif type == gnomeapplet.PIXMAP_BACKGROUND: + style = applet.get_style().copy() + style.bg_pixmap[gtk.STATE_NORMAL] = pixmap + applet.set_style(style) + + def show_menu(self, widget, event): + print "menu" + + def __init__(self, applet, iid): + self.applet = applet + self.label = gtk.Label("0W") + self.event_box = gtk.EventBox() + self.event_box.add(self.label) + self.event_box.set_events(gtk.gdk.BUTTON_PRESS_MASK) + self.event_box.connect("button_press_event", self.show_menu) + self.applet.add(self.event_box) + self.applet.set_background_widget(applet) + self.applet.show_all() + self.mosq = mosquitto.Mosquitto() + self.mosq.on_message = self.on_message + self.mosq.connect("localhost") + self.mosq.loop_start() + self.mosq.subscribe("sensors/cc128/ch1", 0) + self.applet.connect('change-background', self.on_change_background) + +def CurrentCostMQTT_factory(applet, iid): + CurrentCostMQTT(applet, iid) + return gtk.TRUE + +if len(sys.argv) == 2: + if sys.argv[1] == "-d": #Debug mode + main_window = gtk.Window(gtk.WINDOW_TOPLEVEL) + main_window.set_title("Python Applet") + main_window.connect("destroy", gtk.main_quit) + app = gnomeapplet.Applet() + CurrentCostMQTT_factory(app,None) + app.reparent(main_window) + main_window.show_all() + gtk.main() + sys.exit() + +if __name__ == '__main__': + gnomeapplet.bonobo_factory("OAFIID:CurrentCostMQTT_Factory", gnomeapplet.Applet.__gtype__, "MQTT", "0", CurrentCostMQTT_factory) + diff --git a/src/libs/mosquitto/misc/currentcost/gnome-panel/CurrentCostMQTT.server b/src/libs/mosquitto/misc/currentcost/gnome-panel/CurrentCostMQTT.server new file mode 100644 index 0000000..9e74bda --- /dev/null +++ b/src/libs/mosquitto/misc/currentcost/gnome-panel/CurrentCostMQTT.server @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/libs/mosquitto/misc/currentcost/gnome-panel/currentcost.png b/src/libs/mosquitto/misc/currentcost/gnome-panel/currentcost.png new file mode 100644 index 0000000000000000000000000000000000000000..df6d01a89b05ad254d497331751e0b862c916c42 GIT binary patch literal 5316 zcmV;#6g%sQP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01ejw01b%&W)SP500007bV*G`2igb+ z2@oD_%JM7#000?uMObu0Z*6U5Zgc=ca%Ew3Wn>_CX>@2HM@dakSAh-}000ypNklDyI-g@-(dwL!_JNqJcmrE{5kQ7BnvVQV@3j9swer2iv%ABIS!qwU!6=Qe|tC_u8l?`g7>Hj!7Hjt2mzUUqN-=FGR9zy0TDzXjuVzD6>7EWQM1|j z4{M#}Kdi*^O@KScT^{RnFh>6G9N6oP5D_+(Ym2S2c`%s#!`?~n6TM!qJs1qm#%c&S z=heFasDx0?ww8-Q2&#GRB!qx5Mw28ViDQY&E5<-2O=-7Vr>pBLzqiqD{%aB01=u?5 zQms~5tuMVd2aZQGymxHh-{Ym{o&aEwg^wK{cRzh}eEeMRq(@N{09YHL8q_(5f<)Gq zvpm0+e;YzTi^7R>o-EIp&1MvNP6$D*wNkHDNs@#(vb5W6*4Ni=ZJb~Kt*Vhf1NifA ze3K76|2)=O>XrB>J8(3}xPALJKl|b{0QAPiCwjf!=eDj_W-{5rLXXjU-$*iwW~kgfy2`Y_wH};SDt^WocY{;a(ip%v)kJ{42PqTRuYL4 zD=4a}Qm%p}iXx0L0B6^C8o!7Q?>&p(dGDFcGDf2@y#&z)t1c0#s*JZ zz51JtO8hy1uYKzlH*Y@0YCU;(2M$gra;{xffKj2pxxM}1GjF|hoAG$;n~kPPDyihI zz&lSIM}!a-#;dBzV&)&6@%dFl2(oZu5!mHb5HUI$jilG>F_}!LR+qHhYKJ(9?OLb9 zlTSYRFFN()vjDqCC$hP=yg&w`(@9Rdns8cp+ObuDlZpGs_wH?d=FXivjK^bbG#VyJ z<9Tp;7U*bt>2xHD zBKrM4MPA^2pw()!y4(U_b!C<6QU&kbj~Mooj8;|jkul{7!UCmq4z&(r4DEKCD2fPG=i`eSR>+BK)DQQ_RL9UmP<-Cmbgt0ifg>UcaR%Q65l#;~@! zLRu+tc%`#U9LMawOV=3kQ#>QDRR+5NL zt4VAuAt++(kDYx)P-6)QLBad-a}k609_KR=d!S|y9`f#g+BF7g6 zs^!cs#+CbD&;TJkOm3>2ZMh^#SgI~D%QCVor`zo^7z|!k)lCE3n9XK4kB^VB)@rp{ zlW8{7FpsF~SS(Q|xP4I${Lf@la5G!Rt9Yaog&)>z4k9It`?V8BU#@*y*w&R!S{`Wk|=w6r84l(_7Q z0`Cf1%?4{LD`&)M|KO1OTif_DanWuysiXPwh?Pc-@vkYTR2?*X3 zg5rF@d53d;9^9d%-maV&V=Rc^U0^oLI5|1NJAd8y;5UcEQhga?$cvoZWhjm$ww&KM zhk$_P=w!g&@d<;`gwbeRa;PNY+-gURDj16kLQnyOJj;m$&abbD1yUnixpJ9GrCc%9 za*TIQf^%h%&$D{aQqg%=;EP;bk(U4vLMe)}3}a<80@_89BM8=53ZD~##}zs2moCt3 zl$8PR99!GFjAuDZRyaO7=KT5^h)}OpY1HfV#u>(dM7G3u=UA#&IlsPomOnPmt#W>2 zgE!y4LzGmwe)Tb~T|AF-e$HxzFrTuZoUvb3$`vXcQ5+FP5v^9E9f?S~Km%ip;0@j> zaTIg)@yAFbL&*+LWp8(nB(kVFcJ}wVdi5%`YK2<8rt2GPviH5WNGlb@m+&VBR#!Sy zt4msHWlv-x9=m*zt*!esn+=}3d4p;a=}##zyz_enB=@Aod!Kt>hLadM+so(I*Eqjc z&Ybhg*6u!|=>%(p5R~IypOe9`)CFQ#Us)xIBh)**bL6ubl_ciM;r=SI@jz#3E`iD$h-*KMNbj>3T+81HfJ5LBfz4s!hK6d32X_5$_ zgVB(;?``1&YC{l3be0$FA0Es3jWxAEt668Y)7FEdBe6tUxSVEVMLNqZ1<0}j5u-^G zi}y~iUweGcp`7N#>}>5bnNHM*Eg5<#S_Dw<1J)YyEZ4#n5=Svn9CPK;g??nL-K|uX zR!>g{vC{# zK%kH$vYcCA$IgxD562uI_vG5O$B3+vasoZZSlRFP^jqKgE~C*<#2A9A7-P!}ADn~` zG_scQcr4TDlqia**Bh*KKC)|)B)+p$UBY`$mSv=A%Ju6vXf+xD%w`kbzVkLg3|NZ> zkM{vFmXm&;(|-SKW47BZ(l{m*j#{N8OXtVirnFS5U)ZAf-w=Ou)MrNtJ(U7 z0e+BHk~_^toh+M5631#y`Qnq4Q+9TDOVMKO8PzQrSIHtz2SaxE56)Jh*=TU}(iK|s z{1Mc%^b3vW>9k&nhL%pJeP+zv``h#fV}dnm1aYANvEX%{xh=!dn7zXzz53W?0od4B zXL+SVY%Ktz@szCxyDCNmgtSs+XYYV+?*y0UGn=^G|dPistC>%h@d6>ol$>`jr8QC&))t% zfEvKLT%#z`Ja^o^x21XEaaw>0>U<8O8Yi*(lH2Gb>P;WHY6yxCLBl*JXb5!LZB|#7 zzY@W>0ZbNx6_IJH)%aqilFn6Ep~K-omOCqmi9|yw1znNLyaXa41aaOYCX(@V#?j#s zfOz#-gMdo^^n`<>BXO#Dbre1qYlWae3YUwNj8wv0p=l^f^Q9grwS^B}R8@>IYQ(U) zxykkGPkd2CreFWocdVIBX9|!Q`LZkg7r=1;!JgdTexU7EgSFKTKDct*h(&{z_uiHI zR!S;y)IDJ^7+^(+Ou7H>ZS63c&Pseo@WnibJW^f>K?w_%AWF~x0=^V8Xeeu^-g)UP zw^?6X|H4vizYOrB1(>W|QDc#q?-p!8?xv2ZzV>=B=lDTiXmqW6~r60$Gqdy#yRw{TG zP#?~S{Ery_NO@5}jTq86QI{8fJQ~SzyUDXp-~65TKmW`t05AXDU+3tks{qwl-n~b* zy?@N5jfWEO)|lV_^JC_+hT0Q4P9=9U z&1OmxEr}~~H6|cp7kz<}?3WD^F(PUOu~CEu4b$n=%(9HNwH1B#*=PRc&%XHFs|#CR zf8%YQee&8*=~AAKm`tZ!KEHPM+3lVEzxUl+-+gs=XYX= z`Z}9tlII15o1g@uCo%Ys??|<>t_uYKr z-z;qSpRc{nlTSTGJ&oR5pZJIOw)xVRzQk|+vwyN!`kP<>=6C+l+jsB({e#1U7=iV3 z=cw1~WtG}{&1N(5JQwFmS*a`nR5TbP#u!9VYYmZ)P#n~@b6-WAlVOU1_8`XBuK z&;7N}w`$cN0DSUOpXKGh^>JQ$_U8Y2r~Ys-=1>3lEByLD_|>z|-n_s2ORvBF`rqmH zx*tC|JzWB&TB}h>mq?PO`OKO!ZybZ{`R-+FaP{sFW%8ot#9vl>wo#$Yn2BNc9Q9I z8s<qh51QT)UDlca~>A^S<|uL}c{n@BZx{{&D=F4}H)-@z~{1VtpWeq+$M(j{gM{ WQPaL!tZ2Ca0000" each time you add/remove a certificate. +#cafile +#capath + +# Path to the PEM encoded server certificate. +#certfile + +# Path to the PEM encoded keyfile. +#keyfile + +# This option defines the version of the TLS protocol to use for this listener. +# The default value allows v1.2, v1.1 and v1.0, if they are all supported by +# the version of openssl that the broker was compiled against. For openssl >= +# 1.0.1 the valid values are tlsv1.2 tlsv1.1 and tlsv1. For openssl < 1.0.1 the +# valid values are tlsv1. +#tls_version + +# By default a TLS enabled listener will operate in a similar fashion to a +# https enabled web server, in that the server has a certificate signed by a CA +# and the client will verify that it is a trusted certificate. The overall aim +# is encryption of the network traffic. By setting require_certificate to true, +# the client must provide a valid certificate in order for the network +# connection to proceed. This allows access to the broker to be controlled +# outside of the mechanisms provided by MQTT. +#require_certificate false + +# If require_certificate is true, you may set use_identity_as_username to true +# to use the CN value from the client certificate as a username. If this is +# true, the password_file option will not be used for this listener. +#use_identity_as_username false + +# If you have require_certificate set to true, you can create a certificate +# revocation list file to revoke access to particular client certificates. If +# you have done this, use crlfile to point to the PEM encoded revocation file. +#crlfile + +# If you wish to control which encryption ciphers are used, use the ciphers +# option. The list of available ciphers can be optained using the "openssl +# ciphers" command and should be provided in the same format as the output of +# that command. +# If unset defaults to DEFAULT:!aNULL:!eNULL:!LOW:!EXPORT:!SSLv2:@STRENGTH +#ciphers DEFAULT:!aNULL:!eNULL:!LOW:!EXPORT:!SSLv2:@STRENGTH + +# ----------------------------------------------------------------- +# Pre-shared-key based SSL/TLS support +# ----------------------------------------------------------------- +# The following options can be used to enable PSK based SSL/TLS support for +# this listener. Note that the recommended port for MQTT over TLS is 8883, but +# this must be set manually. +# +# See also the mosquitto-tls man page and the "Certificate based SSL/TLS +# support" section. Only one of certificate or PSK encryption support can be +# enabled for any listener. + +# The psk_hint option enables pre-shared-key support for this listener and also +# acts as an identifier for this listener. The hint is sent to clients and may +# be used locally to aid authentication. The hint is a free form string that +# doesn't have much meaning in itself, so feel free to be creative. +# If this option is provided, see psk_file to define the pre-shared keys to be +# used or create a security plugin to handle them. +#psk_hint + +# Set use_identity_as_username to have the psk identity sent by the client used +# as its username. Authentication will be carried out using the PSK rather than +# the MQTT username/password and so password_file will not be used for this +# listener. +#use_identity_as_username false + +# When using PSK, the encryption ciphers used will be chosen from the list of +# available PSK ciphers. If you want to control which ciphers are available, +# use the "ciphers" option. The list of available ciphers can be optained +# using the "openssl ciphers" command and should be provided in the same format +# as the output of that command. +#ciphers + +# ================================================================= +# Extra listeners +# ================================================================= + +# Listen on a port/ip address combination. By using this variable +# multiple times, mosquitto can listen on more than one port. If +# this variable is used and neither bind_address nor port given, +# then the default listener will not be started. +# The port number to listen on must be given. Optionally, an ip +# address or host name may be supplied as a second argument. In +# this case, mosquitto will attempt to bind the listener to that +# address and so restrict access to the associated network and +# interface. By default, mosquitto will listen on all interfaces. +# Note that for a websockets listener it is not possible to bind to a host +# name. +# listener port-number [ip address/host name] +#listener + +# The maximum number of client connections to allow. This is +# a per listener setting. +# Default is -1, which means unlimited connections. +# Note that other process limits mean that unlimited connections +# are not really possible. Typically the default maximum number of +# connections possible is around 1024. +#max_connections -1 + +# The listener can be restricted to operating within a topic hierarchy using +# the mount_point option. This is achieved be prefixing the mount_point string +# to all topics for any clients connected to this listener. This prefixing only +# happens internally to the broker; the client will not see the prefix. +#mount_point + +# Choose the protocol to use when listening. +# This can be either mqtt or websockets. +# Certificate based TLS may be used with websockets, except that only the +# cafile, certfile, keyfile and ciphers options are supported. +#protocol mqtt + +# When a listener is using the websockets protocol, it is possible to serve +# http data as well. Set http_dir to a directory which contains the files you +# wish to serve. If this option is not specified, then no normal http +# connections will be possible. +#http_dir + +# Set use_username_as_clientid to true to replace the clientid that a client +# connected with with its username. This allows authentication to be tied to +# the clientid, which means that it is possible to prevent one client +# disconnecting another by using the same clientid. +# If a client connects with no username it will be disconnected as not +# authorised when this option is set to true. +# Do not use in conjunction with clientid_prefixes. +# See also use_identity_as_username. +#use_username_as_clientid + +# ----------------------------------------------------------------- +# Certificate based SSL/TLS support +# ----------------------------------------------------------------- +# The following options can be used to enable certificate based SSL/TLS support +# for this listener. Note that the recommended port for MQTT over TLS is 8883, +# but this must be set manually. +# +# See also the mosquitto-tls man page and the "Pre-shared-key based SSL/TLS +# support" section. Only one of certificate or PSK encryption support can be +# enabled for any listener. + +# At least one of cafile or capath must be defined to enable certificate based +# TLS encryption. They both define methods of accessing the PEM encoded +# Certificate Authority certificates that have signed your server certificate +# and that you wish to trust. +# cafile defines the path to a file containing the CA certificates. +# capath defines a directory that will be searched for files +# containing the CA certificates. For capath to work correctly, the +# certificate files must have ".crt" as the file ending and you must run +# "c_rehash " each time you add/remove a certificate. +#cafile +#capath + +# Path to the PEM encoded server certificate. +#certfile + +# Path to the PEM encoded keyfile. +#keyfile + +# By default an TLS enabled listener will operate in a similar fashion to a +# https enabled web server, in that the server has a certificate signed by a CA +# and the client will verify that it is a trusted certificate. The overall aim +# is encryption of the network traffic. By setting require_certificate to true, +# the client must provide a valid certificate in order for the network +# connection to proceed. This allows access to the broker to be controlled +# outside of the mechanisms provided by MQTT. +#require_certificate false + +# If require_certificate is true, you may set use_identity_as_username to true +# to use the CN value from the client certificate as a username. If this is +# true, the password_file option will not be used for this listener. +#use_identity_as_username false + +# If you have require_certificate set to true, you can create a certificate +# revocation list file to revoke access to particular client certificates. If +# you have done this, use crlfile to point to the PEM encoded revocation file. +#crlfile + +# If you wish to control which encryption ciphers are used, use the ciphers +# option. The list of available ciphers can be optained using the "openssl +# ciphers" command and should be provided in the same format as the output of +# that command. +#ciphers + +# ----------------------------------------------------------------- +# Pre-shared-key based SSL/TLS support +# ----------------------------------------------------------------- +# The following options can be used to enable PSK based SSL/TLS support for +# this listener. Note that the recommended port for MQTT over TLS is 8883, but +# this must be set manually. +# +# See also the mosquitto-tls man page and the "Certificate based SSL/TLS +# support" section. Only one of certificate or PSK encryption support can be +# enabled for any listener. + +# The psk_hint option enables pre-shared-key support for this listener and also +# acts as an identifier for this listener. The hint is sent to clients and may +# be used locally to aid authentication. The hint is a free form string that +# doesn't have much meaning in itself, so feel free to be creative. +# If this option is provided, see psk_file to define the pre-shared keys to be +# used or create a security plugin to handle them. +#psk_hint + +# Set use_identity_as_username to have the psk identity sent by the client used +# as its username. Authentication will be carried out using the PSK rather than +# the MQTT username/password and so password_file will not be used for this +# listener. +#use_identity_as_username false + +# When using PSK, the encryption ciphers used will be chosen from the list of +# available PSK ciphers. If you want to control which ciphers are available, +# use the "ciphers" option. The list of available ciphers can be optained +# using the "openssl ciphers" command and should be provided in the same format +# as the output of that command. +#ciphers + +# ================================================================= +# Persistence +# ================================================================= + +# If persistence is enabled, save the in-memory database to disk +# every autosave_interval seconds. If set to 0, the persistence +# database will only be written when mosquitto exits. See also +# autosave_on_changes. +# Note that writing of the persistence database can be forced by +# sending mosquitto a SIGUSR1 signal. +#autosave_interval 1800 + +# If true, mosquitto will count the number of subscription changes, retained +# messages received and queued messages and if the total exceeds +# autosave_interval then the in-memory database will be saved to disk. +# If false, mosquitto will save the in-memory database to disk by treating +# autosave_interval as a time in seconds. +#autosave_on_changes false + +# Save persistent message data to disk (true/false). +# This saves information about all messages, including +# subscriptions, currently in-flight messages and retained +# messages. +# retained_persistence is a synonym for this option. +#persistence false + +# The filename to use for the persistent database, not including +# the path. +#persistence_file mosquitto.db + +# Location for persistent database. Must include trailing / +# Default is an empty string (current directory). +# Set to e.g. /var/lib/mosquitto/ if running as a proper service on Linux or +# similar. +#persistence_location + +# ================================================================= +# Logging +# ================================================================= + +# Places to log to. Use multiple log_dest lines for multiple +# logging destinations. +# Possible destinations are: stdout stderr syslog topic file +# +# stdout and stderr log to the console on the named output. +# +# syslog uses the userspace syslog facility which usually ends up +# in /var/log/messages or similar. +# +# topic logs to the broker topic '$SYS/broker/log/', +# where severity is one of D, E, W, N, I, M which are debug, error, +# warning, notice, information and message. Message type severity is used by +# the subscribe/unsubscribe log_types and publishes log messages to +# $SYS/broker/log/M/susbcribe or $SYS/broker/log/M/unsubscribe. +# +# The file destination requires an additional parameter which is the file to be +# logged to, e.g. "log_dest file /var/log/mosquitto.log". The file will be +# closed and reopened when the broker receives a HUP signal. Only a single file +# destination may be configured. +# +# Note that if the broker is running as a Windows service it will default to +# "log_dest none" and neither stdout nor stderr logging is available. +# Use "log_dest none" if you wish to disable logging. +#log_dest stderr + +# If using syslog logging (not on Windows), messages will be logged to the +# "daemon" facility by default. Use the log_facility option to choose which of +# local0 to local7 to log to instead. The option value should be an integer +# value, e.g. "log_facility 5" to use local5. +#log_facility + +# Types of messages to log. Use multiple log_type lines for logging +# multiple types of messages. +# Possible types are: debug, error, warning, notice, information, +# none, subscribe, unsubscribe, websockets, all. +# Note that debug type messages are for decoding the incoming/outgoing +# network packets. They are not logged in "topics". +#log_type error +#log_type warning +#log_type notice +#log_type information + +# Change the websockets logging level. This is a global option, it is not +# possible to set per listener. This is an integer that is interpreted by +# libwebsockets as a bit mask for its lws_log_levels enum. See the +# libwebsockets documentation for more details. "log_type websockets" must also +# be enabled. +#websockets_log_level 0 + +# If set to true, client connection and disconnection messages will be included +# in the log. +#connection_messages true + +# If set to true, add a timestamp value to each log message. +#log_timestamp true + +# ================================================================= +# Security +# ================================================================= + +# If set, only clients that have a matching prefix on their +# clientid will be allowed to connect to the broker. By default, +# all clients may connect. +# For example, setting "secure-" here would mean a client "secure- +# client" could connect but another with clientid "mqtt" couldn't. +#clientid_prefixes + +# Boolean value that determines whether clients that connect +# without providing a username are allowed to connect. If set to +# false then a password file should be created (see the +# password_file option) to control authenticated client access. +# Defaults to true. +#allow_anonymous true + +# In addition to the clientid_prefixes, allow_anonymous and TLS +# authentication options, username based authentication is also +# possible. The default support is described in "Default +# authentication and topic access control" below. The auth_plugin +# allows another authentication method to be used. +# Specify the path to the loadable plugin and see the +# "Authentication and topic access plugin options" section below. +#auth_plugin + +# If auth_plugin_deny_special_chars is true, the default, then before an ACL +# check is made, the username/client id of the client needing the check is +# searched for the presence of either a '+' or '#' character. If either of +# these characters is found in either the username or client id, then the ACL +# check is denied before it is sent to the plugin.o +# +# This check prevents the case where a malicious user could circumvent an ACL +# check by using one of these characters as their username or client id. This +# is the same issue as was reported with mosquitto itself as CVE-2017-7650. +# +# If you are entirely sure that the plugin you are using is not vulnerable to +# this attack (i.e. if you never use usernames or client ids in topics) then +# you can disable this extra check and have all ACL checks delivered to your +# plugin by setting auth_plugin_deny_special_chars to false. +#auth_plugin_deny_special_chars true + +# ----------------------------------------------------------------- +# Default authentication and topic access control +# ----------------------------------------------------------------- + +# Control access to the broker using a password file. This file can be +# generated using the mosquitto_passwd utility. If TLS support is not compiled +# into mosquitto (it is recommended that TLS support should be included) then +# plain text passwords are used, in which case the file should be a text file +# with lines in the format: +# username:password +# The password (and colon) may be omitted if desired, although this +# offers very little in the way of security. +# +# See the TLS client require_certificate and use_identity_as_username options +# for alternative authentication options. +#password_file + +# Access may also be controlled using a pre-shared-key file. This requires +# TLS-PSK support and a listener configured to use it. The file should be text +# lines in the format: +# identity:key +# The key should be in hexadecimal format without a leading "0x". +#psk_file + +# Control access to topics on the broker using an access control list +# file. If this parameter is defined then only the topics listed will +# have access. +# If the first character of a line of the ACL file is a # it is treated as a +# comment. +# Topic access is added with lines of the format: +# +# topic [read|write|readwrite] +# +# The access type is controlled using "read", "write" or "readwrite". This +# parameter is optional (unless contains a space character) - if not +# given then the access is read/write. can contain the + or # +# wildcards as in subscriptions. +# +# The first set of topics are applied to anonymous clients, assuming +# allow_anonymous is true. User specific topic ACLs are added after a +# user line as follows: +# +# user +# +# The username referred to here is the same as in password_file. It is +# not the clientid. +# +# +# If is also possible to define ACLs based on pattern substitution within the +# topic. The patterns available for substition are: +# +# %c to match the client id of the client +# %u to match the username of the client +# +# The substitution pattern must be the only text for that level of hierarchy. +# +# The form is the same as for the topic keyword, but using pattern as the +# keyword. +# Pattern ACLs apply to all users even if the "user" keyword has previously +# been given. +# +# If using bridges with usernames and ACLs, connection messages can be allowed +# with the following pattern: +# pattern write $SYS/broker/connection/%c/state +# +# pattern [read|write|readwrite] +# +# Example: +# +# pattern write sensor/%u/data +# +#acl_file + +# ----------------------------------------------------------------- +# Authentication and topic access plugin options +# ----------------------------------------------------------------- + +# If the auth_plugin option above is used, define options to pass to the +# plugin here as described by the plugin instructions. All options named +# using the format auth_opt_* will be passed to the plugin, for example: +# +# auth_opt_db_host +# auth_opt_db_port +# auth_opt_db_username +# auth_opt_db_password + + +# ================================================================= +# Bridges +# ================================================================= + +# A bridge is a way of connecting multiple MQTT brokers together. +# Create a new bridge using the "connection" option as described below. Set +# options for the bridges using the remaining parameters. You must specify the +# address and at least one topic to subscribe to. +# Each connection must have a unique name. +# The address line may have multiple host address and ports specified. See +# below in the round_robin description for more details on bridge behaviour if +# multiple addresses are used. +# The direction that the topic will be shared can be chosen by +# specifying out, in or both, where the default value is out. +# The QoS level of the bridged communication can be specified with the next +# topic option. The default QoS level is 0, to change the QoS the topic +# direction must also be given. +# The local and remote prefix options allow a topic to be remapped when it is +# bridged to/from the remote broker. This provides the ability to place a topic +# tree in an appropriate location. +# For more details see the mosquitto.conf man page. +# Multiple topics can be specified per connection, but be careful +# not to create any loops. +# If you are using bridges with cleansession set to false (the default), then +# you may get unexpected behaviour from incoming topics if you change what +# topics you are subscribing to. This is because the remote broker keeps the +# subscription for the old topic. If you have this problem, connect your bridge +# with cleansession set to true, then reconnect with cleansession set to false +# as normal. +#connection +#address [:] [[:]] +#topic [[[out | in | both] qos-level] local-prefix remote-prefix] + +# Set the version of the MQTT protocol to use with for this bridge. Can be one +# of mqttv31 or mqttv311. Defaults to mqttv31. +#bridge_protocol_version mqttv31 + +# If a bridge has topics that have "out" direction, the default behaviour is to +# send an unsubscribe request to the remote broker on that topic. This means +# that changing a topic direction from "in" to "out" will not keep receiving +# incoming messages. Sending these unsubscribe requests is not always +# desirable, setting bridge_attempt_unsubscribe to false will disable sending +# the unsubscribe request. +#bridge_attempt_unsubscribe true + +# If the bridge has more than one address given in the address/addresses +# configuration, the round_robin option defines the behaviour of the bridge on +# a failure of the bridge connection. If round_robin is false, the default +# value, then the first address is treated as the main bridge connection. If +# the connection fails, the other secondary addresses will be attempted in +# turn. Whilst connected to a secondary bridge, the bridge will periodically +# attempt to reconnect to the main bridge until successful. +# If round_robin is true, then all addresses are treated as equals. If a +# connection fails, the next address will be tried and if successful will +# remain connected until it fails +#round_robin false + +# Set the client id to use on the remote end of this bridge connection. If not +# defined, this defaults to 'name.hostname' where name is the connection name +# and hostname is the hostname of this computer. +# This replaces the old "clientid" option to avoid confusion. "clientid" +# remains valid for the time being. +#remote_clientid + +# Set the clientid to use on the local broker. If not defined, this defaults to +# 'local.'. If you are bridging a broker to itself, it is important +# that local_clientid and clientid do not match. +#local_clientid + +# Set the clean session variable for this bridge. +# When set to true, when the bridge disconnects for any reason, all +# messages and subscriptions will be cleaned up on the remote +# broker. Note that with cleansession set to true, there may be a +# significant amount of retained messages sent when the bridge +# reconnects after losing its connection. +# When set to false, the subscriptions and messages are kept on the +# remote broker, and delivered when the bridge reconnects. +#cleansession false + +# If set to true, publish notification messages to the local and remote brokers +# giving information about the state of the bridge connection. Retained +# messages are published to the topic $SYS/broker/connection//state +# unless the notification_topic option is used. +# If the message is 1 then the connection is active, or 0 if the connection has +# failed. +#notifications true + +# Choose the topic on which notification messages for this bridge are +# published. If not set, messages are published on the topic +# $SYS/broker/connection//state +#notification_topic + +# Set the keepalive interval for this bridge connection, in +# seconds. +#keepalive_interval 60 + +# Set the start type of the bridge. This controls how the bridge starts and +# can be one of three types: automatic, lazy and once. Note that RSMB provides +# a fourth start type "manual" which isn't currently supported by mosquitto. +# +# "automatic" is the default start type and means that the bridge connection +# will be started automatically when the broker starts and also restarted +# after a short delay (30 seconds) if the connection fails. +# +# Bridges using the "lazy" start type will be started automatically when the +# number of queued messages exceeds the number set with the "threshold" +# parameter. It will be stopped automatically after the time set by the +# "idle_timeout" parameter. Use this start type if you wish the connection to +# only be active when it is needed. +# +# A bridge using the "once" start type will be started automatically when the +# broker starts but will not be restarted if the connection fails. +#start_type automatic + +# Set the amount of time a bridge using the automatic start type will wait +# until attempting to reconnect. Defaults to 30 seconds. +#restart_timeout 30 + +# Set the amount of time a bridge using the lazy start type must be idle before +# it will be stopped. Defaults to 60 seconds. +#idle_timeout 60 + +# Set the number of messages that need to be queued for a bridge with lazy +# start type to be restarted. Defaults to 10 messages. +# Must be less than max_queued_messages. +#threshold 10 + +# If try_private is set to true, the bridge will attempt to indicate to the +# remote broker that it is a bridge not an ordinary client. If successful, this +# means that loop detection will be more effective and that retained messages +# will be propagated correctly. Not all brokers support this feature so it may +# be necessary to set try_private to false if your bridge does not connect +# properly. +#try_private true + +# Set the username to use when connecting to a broker that requires +# authentication. +# This replaces the old "username" option to avoid confusion. "username" +# remains valid for the time being. +#remote_username + +# Set the password to use when connecting to a broker that requires +# authentication. This option is only used if remote_username is also set. +# This replaces the old "password" option to avoid confusion. "password" +# remains valid for the time being. +#remote_password + +# ----------------------------------------------------------------- +# Certificate based SSL/TLS support +# ----------------------------------------------------------------- +# Either bridge_cafile or bridge_capath must be defined to enable TLS support +# for this bridge. +# bridge_cafile defines the path to a file containing the +# Certificate Authority certificates that have signed the remote broker +# certificate. +# bridge_capath defines a directory that will be searched for files containing +# the CA certificates. For bridge_capath to work correctly, the certificate +# files must have ".crt" as the file ending and you must run "c_rehash " each time you add/remove a certificate. +#bridge_cafile +#bridge_capath + +# Path to the PEM encoded client certificate, if required by the remote broker. +#bridge_certfile + +# Path to the PEM encoded client private key, if required by the remote broker. +#bridge_keyfile + +# When using certificate based encryption, bridge_insecure disables +# verification of the server hostname in the server certificate. This can be +# useful when testing initial server configurations, but makes it possible for +# a malicious third party to impersonate your server through DNS spoofing, for +# example. Use this option in testing only. If you need to resort to using this +# option in a production environment, your setup is at fault and there is no +# point using encryption. +#bridge_insecure false + +# ----------------------------------------------------------------- +# PSK based SSL/TLS support +# ----------------------------------------------------------------- +# Pre-shared-key encryption provides an alternative to certificate based +# encryption. A bridge can be configured to use PSK with the bridge_identity +# and bridge_psk options. These are the client PSK identity, and pre-shared-key +# in hexadecimal format with no "0x". Only one of certificate and PSK based +# encryption can be used on one +# bridge at once. +#bridge_identity +#bridge_psk + + +# ================================================================= +# External config files +# ================================================================= + +# External configuration files may be included by using the +# include_dir option. This defines a directory that will be searched +# for config files. All files that end in '.conf' will be loaded as +# a configuration file. It is best to have this as the last option +# in the main file. This option will only be processed from the main +# configuration file. The directory specified must not contain the +# main configuration file. +#include_dir + +# ================================================================= +# rsmb options - unlikely to ever be supported +# ================================================================= + +#ffdc_output +#max_log_entries +#trace_level +#trace_output diff --git a/src/libs/mosquitto/notice.html b/src/libs/mosquitto/notice.html new file mode 100644 index 0000000..f19c483 --- /dev/null +++ b/src/libs/mosquitto/notice.html @@ -0,0 +1,108 @@ + + + + + +Eclipse Foundation Software User Agreement + + + +

Eclipse Foundation Software User Agreement

+

February 1, 2011

+ +

Usage Of Content

+ +

THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS + (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND + CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE + OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR + NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND + CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.

+ +

Applicable Licenses

+ +

Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0 + ("EPL"). A copy of the EPL is provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html. + For purposes of the EPL, "Program" will mean the Content.

+ +

Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code + repository ("Repository") in software modules ("Modules") and made available as downloadable archives ("Downloads").

+ +
    +
  • Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"), plug-in fragments ("Fragments"), and features ("Features").
  • +
  • Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java™ ARchive) in a directory named "plugins".
  • +
  • A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named "features". Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of the Plug-ins + and/or Fragments associated with that Feature.
  • +
  • Features may also include other Features ("Included Features"). Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of Included Features.
  • +
+ +

The terms and conditions governing Plug-ins and Fragments should be contained in files named "about.html" ("Abouts"). The terms and conditions governing Features and +Included Features should be contained in files named "license.html" ("Feature Licenses"). Abouts and Feature Licenses may be located in any directory of a Download or Module +including, but not limited to the following locations:

+ +
    +
  • The top-level (root) directory
  • +
  • Plug-in and Fragment directories
  • +
  • Inside Plug-ins and Fragments packaged as JARs
  • +
  • Sub-directories of the directory named "src" of certain Plug-ins
  • +
  • Feature directories
  • +
+ +

Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license ("Feature Update License") during the +installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or +inform you where you can locate them. Feature Update Licenses may be found in the "license" property of files named "feature.properties" found within a Feature. +Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in +that directory.

+ +

THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE +OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):

+ + + +

IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please +contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.

+ + +

Use of Provisioning Technology

+ +

The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse + Update Manager ("Provisioning Technology") for the purpose of allowing users to install software, documentation, information and/or + other materials (collectively "Installable Software"). This capability is provided with the intent of allowing such users to + install, extend and update Eclipse-based products. Information about packaging Installable Software is available at http://eclipse.org/equinox/p2/repository_packaging.html + ("Specification").

+ +

You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the + applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology + in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the + Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:

+ +
    +
  1. A series of actions may occur ("Provisioning Process") in which a user may execute the Provisioning Technology + on a machine ("Target Machine") with the intent of installing, extending or updating the functionality of an Eclipse-based + product.
  2. +
  3. During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be + accessed and copied to the Target Machine.
  4. +
  5. Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable + Software ("Installable Software Agreement") and such Installable Software Agreement shall be accessed from the Target + Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern + the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such + indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.
  6. +
+ +

Cryptography

+ +

Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to + another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import, + possession, or use, and re-export of encryption software, to see if this is permitted.

+ +

Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.

+ + diff --git a/src/libs/mosquitto/pskfile.example b/src/libs/mosquitto/pskfile.example new file mode 100644 index 0000000..95299cb --- /dev/null +++ b/src/libs/mosquitto/pskfile.example @@ -0,0 +1,2 @@ +id:deadbeef +easy:12345 diff --git a/src/libs/mosquitto/pwfile.example b/src/libs/mosquitto/pwfile.example new file mode 100644 index 0000000..58b94c9 --- /dev/null +++ b/src/libs/mosquitto/pwfile.example @@ -0,0 +1,3 @@ +roger:$6$clQ4Ocu312S0qWgl$Cv2wUxgEN73c6C6jlBkswqR4AkHsvDLWvtEXZZ8NpsBLgP1WAo/qA+WXcmEN/mjDNgdUwcxRAveqNMs2xUVQYA== +sub_client:$6$U+qg0/32F0g2Fh+n$fBPSkq/rfNyEQ/TkEjRgwGTTVBpvNhKSyGShovH9KHewsvJ731tD5Zx26IHhR5RYCICt0L9qBW0/KK31UkCliw== +pub_client:$6$vxQ89y+7WrsnL2yn$fSPMmEZn9TSrC8s/jaPmxJ9NijWpkP2e7bMJLz78JXR1vW2x8+T3FZ23byJA6xs5Mt+LeOybAHwcUv0OCl40rA== diff --git a/src/libs/mosquitto/readme-windows.txt b/src/libs/mosquitto/readme-windows.txt new file mode 100644 index 0000000..d8cd569 --- /dev/null +++ b/src/libs/mosquitto/readme-windows.txt @@ -0,0 +1,70 @@ +Mosquitto for Windows +===================== + +Mosquitto for Windows comes in two flavours, win32 or Cygwin. The win32 version is only +supported on Windows Vista or later. + +In all cases, the dependencies are not provided in this installer and must be installed +separately in the case that they are not already available. + + +Capabilities +------------ + +Some versions of Windows have limitations on the number of concurrent +connections. Non-server versions have been reported to be limited to +approximately 1024 connections. + + +Websockets +---------- + +The broker executables provided in the installers do not have Websockets support enabled. +If you wish to have a version of the broker with Websockets support, you will need to compile +libwebsockets version v1.7 onwards because no Windows binaries are provided. + +Please note that on Windows, libwebsockets limits connections to a maximum of 64 clients. + + +Dependencies - win32 +-------------------- + +* OpenSSL + Link: http://slproweb.com/products/Win32OpenSSL.html + Install "Win32 OpenSSL " + Required DLLs: libeay32.dll ssleay32.dll +* pthreads + Link: ftp://sourceware.org/pub/pthreads-win32 + Install "pthreads-w32--release.zip + Required DLLs: pthreadVC2.dll + +Please ensure that the required DLLs are on the system path, or are in the same directory as +the mosquitto executable. + + +Dependencies - Cygwin +--------------------- + +* OpenSSL + Link: http://slproweb.com/products/Win32OpenSSL.html + Install "Win32 OpenSSL " +* pthreads + Link: ftp://sourceware.org/pub/pthreads-win32 + Install "pthreads-w32--release.zip +* Cygwin + Link: https://www.cygwin.com/setup-x86.exe + Required packages: libgcc1, openssl, zlib0 + + +Windows Service +--------------- + +If all dependencies are installed prior to the installer being run, the broker can be +installed as a Windows service. + +You can start/stop it from + the control panel as well as running it as a normal +executable. + +When running as a service, the configuration in mosquitto.conf in the +installation directory is used so modify this to your needs. diff --git a/src/libs/mosquitto/readme.md b/src/libs/mosquitto/readme.md new file mode 100644 index 0000000..0ae7587 --- /dev/null +++ b/src/libs/mosquitto/readme.md @@ -0,0 +1,79 @@ +Eclipse Mosquitto +================= + +Mosquitto is an open source implementation of a server for version 3.1 and +3.1.1 of the MQTT protocol. It also includes a C and C++ client library, and +the `mosquitto_pub` and `mosquitto_sub` utilities for publishing and +subscribing. + +## Links + +See the following links for more information on MQTT: + +- Community page: +- MQTT v3.1.1 standard: + +Mosquitto project information is available at the following locations: + +- Main homepage: +- Find existing bugs or submit a new bug: +- Source code repository: + +There is also a public test server available at + +## Installing + +See for details on installing binaries for +various platforms. + +## Quick start + +If you have installed a binary package the broker should have been started +automatically. If not, it can be started with a basic configuration: + + mosquitto + +Then use `mosquitto_sub` to subscribe to a topic: + + mosquitto_sub -t 'test/topic' -v + +And to publish a message: + + mosquitto_pub -t 'test/topic' -m 'hello world' + +## Documentation + +Documentation for the broker, clients and client library API can be found in +the man pages, which are available online at . There +are also pages with an introduction to the features of MQTT, the +`mosquitto_passwd` utility for dealing with username/passwords, and a +description of the configuration file options available for the broker. + +Detailed client library API documentation can be found at + +## Building from source + +To build from source the recommended route for end users is to download the +archive from . + +On Windows and Mac, use `cmake` to build. On other platforms, just run `make` +to build. For Windows, see also `readme-windows.md`. + +If you are building from the git repository then the documentation will not +already be built. Use `make binary` to skip building the man pages, or install +`docbook-xsl` on Debian/Ubuntu systems. + +### Build Dependencies + +* c-ares (libc-ares-dev on Debian based systems) - disable with `make WITH_SRV=no` +* libuuid (uuid-dev) - disable with `make WITH_UUID=no` +* libwebsockets (libwebsockets-dev) - enable with `make WITH_WEBSOCKETS=yes` +* openssl (libssl-dev on Debian based systems) - disable with `make WITH_TLS=no` + +## Credits + +Mosquitto was written by Roger Light + +Master: [![Travis Build Status (master)](https://travis-ci.org/eclipse/mosquitto.svg?branch=master)](https://travis-ci.org/eclipse/mosquitto) +Develop: [![Travis Build Status (develop)](https://travis-ci.org/eclipse/mosquitto.svg?branch=develop)](https://travis-ci.org/eclipse/mosquitto) +Fixes: [![Travis Build Status (fixes)](https://travis-ci.org/eclipse/mosquitto.svg?branch=fixes)](https://travis-ci.org/eclipse/mosquitto) diff --git a/src/libs/mosquitto/security/mosquitto.apparmor b/src/libs/mosquitto/security/mosquitto.apparmor new file mode 100644 index 0000000..705de6c --- /dev/null +++ b/src/libs/mosquitto/security/mosquitto.apparmor @@ -0,0 +1,27 @@ +/usr/sbin/mosquitto { + #include + #include + + /usr/sbin/mosquitto r, + /etc/mosquitto/mosquitto.conf r, + /etc/mosquitto/ca_certificates/* r, + /etc/mosquitto/certs/* r, + /etc/mosquitto/conf.d/* r, + /var/lib/mosquitto/ r, + /var/lib/mosquitto/mosquitto.db rwk, + /var/run/mosquitto.pid rw, + + network inet stream, + network inet6 stream, + network inet dgram, + network inet6 dgram, + + # For drop privileges + capability setgid, + capability setuid, + + # For tcp-wrappers + /lib{,32,64}/libwrap.so* rm, + /etc/hosts.allow r, + /etc/hosts.deny r, +} diff --git a/src/libs/mosquitto/service/monit/mosquitto.monit b/src/libs/mosquitto/service/monit/mosquitto.monit new file mode 100644 index 0000000..8bcbbea --- /dev/null +++ b/src/libs/mosquitto/service/monit/mosquitto.monit @@ -0,0 +1,4 @@ +check process mosquitto with pidfile /var/run/mosquitto.pid + start = "/etc/init.d/mosquitto start" + stop = "/etc/init.d/mosquitto stop" + diff --git a/src/libs/mosquitto/service/svscan/run b/src/libs/mosquitto/service/svscan/run new file mode 100755 index 0000000..2bd9a70 --- /dev/null +++ b/src/libs/mosquitto/service/svscan/run @@ -0,0 +1,3 @@ +#!/bin/sh + +/usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf diff --git a/src/libs/mosquitto/service/upstart/mosquitto.conf b/src/libs/mosquitto/service/upstart/mosquitto.conf new file mode 100644 index 0000000..993b4c7 --- /dev/null +++ b/src/libs/mosquitto/service/upstart/mosquitto.conf @@ -0,0 +1,8 @@ +description "Mosquitto MQTTv3.1 broker" +author "Roger Light " + +start on net-device-up + +respawn + +exec /usr/local/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf diff --git a/src/libs/mosquitto/src/CMakeFiles/CMakeDirectoryInformation.cmake b/src/libs/mosquitto/src/CMakeFiles/CMakeDirectoryInformation.cmake new file mode 100644 index 0000000..8cf4b23 --- /dev/null +++ b/src/libs/mosquitto/src/CMakeFiles/CMakeDirectoryInformation.cmake @@ -0,0 +1,16 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.10 + +# Relative path conversion top directories. +set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/Users/benjamin/orchestra/src/libs/mosquitto") +set(CMAKE_RELATIVE_PATH_TOP_BINARY "/Users/benjamin/orchestra/src/libs/mosquitto") + +# Force unix paths in dependencies. +set(CMAKE_FORCE_UNIX_PATHS 1) + + +# The C and CXX include file regular expressions for this directory. +set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") +set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") +set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) +set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) diff --git a/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/C.includecache b/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/C.includecache new file mode 100644 index 0000000..80296ce --- /dev/null +++ b/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/C.includecache @@ -0,0 +1,908 @@ +#IncludeRegexLine: ^[ ]*[#%][ ]*(include|import)[ ]*[<"]([^">]+)([">]) + +#IncludeRegexScan: ^.*$ + +#IncludeRegexComplain: ^$ + +#IncludeRegexTransform: + +/Users/benjamin/orchestra/src/libs/mosquitto/lib/memory_mosq.c +config.h +- +stdlib.h +- +string.h +- +memory_mosq.h +- +malloc/malloc.h +- +malloc_np.h +- +malloc.h +- + +/Users/benjamin/orchestra/src/libs/mosquitto/lib/mosquitto.h +stdbool.h +- + +/Users/benjamin/orchestra/src/libs/mosquitto/lib/mosquitto_internal.h +config.h +- +winsock2.h +- +openssl/ssl.h +- +time.h +- +stdlib.h +- +pthread.h +- +dummypthread.h +- +ares.h +- +stdint.h +- +stdint.h +- +mosquitto.h +/Users/benjamin/orchestra/src/libs/mosquitto/lib/mosquitto.h +time_mosq.h +/Users/benjamin/orchestra/src/libs/mosquitto/lib/time_mosq.h +netdb.h +- +uthash.h +/Users/benjamin/orchestra/src/libs/mosquitto/lib/uthash.h + +/Users/benjamin/orchestra/src/libs/mosquitto/lib/net_mosq.c +assert.h +- +errno.h +- +fcntl.h +- +stdio.h +- +string.h +- +netdb.h +- +sys/socket.h +- +unistd.h +- +winsock2.h +- +ws2tcpip.h +- +linux/in.h +- +linux/in6.h +- +sys/endian.h +- +netinet/in.h +- +netinet/in.h +- +net/netbyte.h +- +netinet/in.h +- +openssl/conf.h +- +openssl/engine.h +- +openssl/err.h +- +tls_mosq.h +- +mosquitto_broker.h +- +libwebsockets.h +- +read_handle.h +- +logging_mosq.h +- +memory_mosq.h +- +mqtt3_protocol.h +- +net_mosq.h +- +time_mosq.h +- +util_mosq.h +- +config.h +/Users/benjamin/orchestra/src/libs/mosquitto/lib/config.h + +/Users/benjamin/orchestra/src/libs/mosquitto/lib/read_handle_shared.c +assert.h +- +stdio.h +- +string.h +- +mosquitto.h +- +logging_mosq.h +- +memory_mosq.h +- +messages_mosq.h +- +mqtt3_protocol.h +- +net_mosq.h +- +read_handle.h +- +send_mosq.h +- +util_mosq.h +- +mosquitto_broker.h +- + +/Users/benjamin/orchestra/src/libs/mosquitto/lib/send_client_mosq.c +assert.h +- +string.h +- +mosquitto.h +- +logging_mosq.h +- +memory_mosq.h +- +mqtt3_protocol.h +- +net_mosq.h +- +send_mosq.h +- +util_mosq.h +- +mosquitto_broker.h +- + +/Users/benjamin/orchestra/src/libs/mosquitto/lib/send_mosq.c +assert.h +- +stdio.h +- +string.h +- +mosquitto_broker.h +- +mosquitto.h +- +mosquitto_internal.h +- +logging_mosq.h +- +mqtt3_protocol.h +- +memory_mosq.h +- +net_mosq.h +- +send_mosq.h +- +time_mosq.h +- +util_mosq.h +- + +/Users/benjamin/orchestra/src/libs/mosquitto/lib/time_mosq.c +mach/mach.h +- +mach/mach_time.h +- +windows.h +- +unistd.h +- +time.h +- +mosquitto.h +/Users/benjamin/orchestra/src/libs/mosquitto/lib/mosquitto.h +time_mosq.h +/Users/benjamin/orchestra/src/libs/mosquitto/lib/time_mosq.h + +/Users/benjamin/orchestra/src/libs/mosquitto/lib/time_mosq.h + +/Users/benjamin/orchestra/src/libs/mosquitto/lib/tls_mosq.c +winsock2.h +- +ws2tcpip.h +- +arpa/inet.h +- +sys/socket.h +- +string.h +- +openssl/conf.h +- +openssl/x509v3.h +- +openssl/ssl.h +- +mosquitto_broker.h +/Users/benjamin/orchestra/src/libs/mosquitto/lib/mosquitto_broker.h +mosquitto_internal.h +/Users/benjamin/orchestra/src/libs/mosquitto/lib/mosquitto_internal.h +tls_mosq.h +/Users/benjamin/orchestra/src/libs/mosquitto/lib/tls_mosq.h + +/Users/benjamin/orchestra/src/libs/mosquitto/lib/tls_mosq.h +openssl/ssl.h +- + +/Users/benjamin/orchestra/src/libs/mosquitto/lib/util_mosq.c +assert.h +- +string.h +- +winsock2.h +- +aclapi.h +- +io.h +- +lmcons.h +- +sys/stat.h +- +mosquitto.h +- +memory_mosq.h +- +net_mosq.h +- +send_mosq.h +- +time_mosq.h +- +tls_mosq.h +- +util_mosq.h +- +mosquitto_broker.h +- +libwebsockets.h +- + +/Users/benjamin/orchestra/src/libs/mosquitto/lib/will_mosq.c +stdio.h +- +string.h +- +mosquitto_internal.h +- +memory_mosq.h +- +mqtt3_protocol.h +- + +/Users/benjamin/orchestra/src/libs/mosquitto/src/bridge.c +assert.h +- +errno.h +- +stdio.h +- +string.h +- +netdb.h +- +sys/socket.h +- +winsock2.h +- +ws2tcpip.h +- +config.h +- +mosquitto.h +- +mosquitto_broker.h +- +mosquitto_internal.h +- +net_mosq.h +- +memory_mosq.h +- +send_mosq.h +- +time_mosq.h +- +tls_mosq.h +- +util_mosq.h +- +will_mosq.h +- + +/Users/benjamin/orchestra/src/libs/mosquitto/src/conf.c +config.h +- +limits.h +- +stdio.h +- +stdlib.h +- +string.h +- +errno.h +- +dirent.h +- +netdb.h +- +sys/socket.h +- +winsock2.h +- +ws2tcpip.h +- +syslog.h +- +mosquitto_broker.h +- +memory_mosq.h +- +tls_mosq.h +/Users/benjamin/orchestra/src/libs/mosquitto/src/tls_mosq.h +util_mosq.h +/Users/benjamin/orchestra/src/libs/mosquitto/src/util_mosq.h +mqtt3_protocol.h +/Users/benjamin/orchestra/src/libs/mosquitto/src/mqtt3_protocol.h +windows.h +- + +/Users/benjamin/orchestra/src/libs/mosquitto/src/context.c +assert.h +- +time.h +- +config.h +- +mosquitto_broker.h +- +memory_mosq.h +- +time_mosq.h +- +uthash.h +/Users/benjamin/orchestra/src/libs/mosquitto/src/uthash.h + +/Users/benjamin/orchestra/src/libs/mosquitto/src/database.c +assert.h +- +stdio.h +- +config.h +- +mosquitto_broker.h +- +memory_mosq.h +- +send_mosq.h +- +time_mosq.h +- + +/Users/benjamin/orchestra/src/libs/mosquitto/src/lib_load.h +windows.h +- +dlfcn.h +- + +/Users/benjamin/orchestra/src/libs/mosquitto/src/logging.c +stdarg.h +- +stdio.h +- +string.h +- +syslog.h +- +time.h +- +config.h +- +mosquitto_broker.h +- +memory_mosq.h +- +util_mosq.h +- + +/Users/benjamin/orchestra/src/libs/mosquitto/src/loop.c +config.h +- +assert.h +- +poll.h +- +process.h +- +winsock2.h +- +ws2tcpip.h +- +errno.h +- +signal.h +- +stdio.h +- +string.h +- +sys/socket.h +- +time.h +- +libwebsockets.h +- +mosquitto_broker.h +- +memory_mosq.h +- +send_mosq.h +- +time_mosq.h +- +util_mosq.h +- + +/Users/benjamin/orchestra/src/libs/mosquitto/src/mosquitto.c +config.h +- +unistd.h +- +grp.h +- +assert.h +- +pwd.h +- +process.h +- +winsock2.h +- +ws2tcpip.h +- +sys/time.h +- +errno.h +- +signal.h +- +stdio.h +- +string.h +- +tcpd.h +- +libwebsockets.h +- +mosquitto_broker.h +- +memory_mosq.h +- +util_mosq.h +/Users/benjamin/orchestra/src/libs/mosquitto/src/util_mosq.h +syslog.h +- + +/Users/benjamin/orchestra/src/libs/mosquitto/src/mosquitto_broker.h +config.h +- +stdio.h +- +libwebsockets.h +- +mosquitto_internal.h +- +mosquitto_plugin.h +- +mosquitto.h +- +tls_mosq.h +/Users/benjamin/orchestra/src/libs/mosquitto/src/tls_mosq.h +uthash.h +/Users/benjamin/orchestra/src/libs/mosquitto/src/uthash.h +net_mosq.h +- + +/Users/benjamin/orchestra/src/libs/mosquitto/src/mosquitto_plugin.h + +/Users/benjamin/orchestra/src/libs/mosquitto/src/net.c +config.h +- +netdb.h +- +unistd.h +- +arpa/inet.h +- +sys/socket.h +- +winsock2.h +- +ws2tcpip.h +- +assert.h +- +errno.h +- +fcntl.h +- +stdio.h +- +string.h +- +tcpd.h +- +netinet/in.h +- +sys/socket.h +- +netinet/in.h +- +net/netbyte.h +- +sys/socket.h +- +mosquitto_broker.h +- +mqtt3_protocol.h +- +memory_mosq.h +- +net_mosq.h +- +util_mosq.h +- +tls_mosq.h +/Users/benjamin/orchestra/src/libs/mosquitto/src/tls_mosq.h +openssl/err.h +- + +/Users/benjamin/orchestra/src/libs/mosquitto/src/persist.c +config.h +- +arpa/inet.h +- +assert.h +- +errno.h +- +fcntl.h +- +stdio.h +- +string.h +- +sys/stat.h +- +time.h +- +mosquitto_broker.h +- +memory_mosq.h +- +persist.h +- +time_mosq.h +- +util_mosq.h +/Users/benjamin/orchestra/src/libs/mosquitto/src/util_mosq.h + +/Users/benjamin/orchestra/src/libs/mosquitto/src/read_handle.c +assert.h +- +stdio.h +- +string.h +- +config.h +- +mosquitto_broker.h +- +mqtt3_protocol.h +- +memory_mosq.h +- +read_handle.h +- +send_mosq.h +- +util_mosq.h +- + +/Users/benjamin/orchestra/src/libs/mosquitto/src/read_handle_client.c +config.h +- +stdio.h +- +string.h +- +mosquitto_broker.h +- +memory_mosq.h +- +mqtt3_protocol.h +- +send_mosq.h +- +util_mosq.h +- + +/Users/benjamin/orchestra/src/libs/mosquitto/src/read_handle_server.c +stdio.h +- +string.h +- +config.h +- +mosquitto_broker.h +- +mqtt3_protocol.h +- +memory_mosq.h +- +send_mosq.h +- +time_mosq.h +- +tls_mosq.h +- +util_mosq.h +- +uuid/uuid.h +- +libwebsockets.h +- + +/Users/benjamin/orchestra/src/libs/mosquitto/src/security.c +config.h +- +stdio.h +- +string.h +- +mosquitto_broker.h +- +mosquitto_plugin.h +/Users/benjamin/orchestra/src/libs/mosquitto/src/mosquitto_plugin.h +memory_mosq.h +- +lib_load.h +/Users/benjamin/orchestra/src/libs/mosquitto/src/lib_load.h + +/Users/benjamin/orchestra/src/libs/mosquitto/src/security_default.c +config.h +- +stdio.h +- +string.h +- +mosquitto_broker.h +- +memory_mosq.h +- +util_mosq.h +/Users/benjamin/orchestra/src/libs/mosquitto/src/util_mosq.h + +/Users/benjamin/orchestra/src/libs/mosquitto/src/send_server.c +config.h +- +mosquitto_broker.h +- +mqtt3_protocol.h +- +memory_mosq.h +- +util_mosq.h +- + +/Users/benjamin/orchestra/src/libs/mosquitto/src/subs.c +config.h +- +assert.h +- +stdio.h +- +string.h +- +mosquitto_broker.h +- +memory_mosq.h +- +util_mosq.h +- + +/Users/benjamin/orchestra/src/libs/mosquitto/src/sys_tree.c +math.h +- +stdio.h +- +config.h +- +mosquitto_broker.h +- +memory_mosq.h +- +time_mosq.h +- + +/Users/benjamin/orchestra/src/libs/mosquitto/src/uthash.h +string.h +- +stddef.h +- +stdlib.h +- +inttypes.h +- + +/Users/benjamin/orchestra/src/libs/mosquitto/src/websockets.c +libwebsockets.h +- +mosquitto_internal.h +/Users/benjamin/orchestra/src/libs/mosquitto/src/mosquitto_internal.h +mosquitto_broker.h +/Users/benjamin/orchestra/src/libs/mosquitto/src/mosquitto_broker.h +mqtt3_protocol.h +/Users/benjamin/orchestra/src/libs/mosquitto/src/mqtt3_protocol.h +memory_mosq.h +/Users/benjamin/orchestra/src/libs/mosquitto/src/memory_mosq.h +stdlib.h +- +errno.h +- +sys/stat.h +- + +config.h + +lib/dummypthread.h + +lib/logging_mosq.h +mosquitto.h +- + +lib/memory_mosq.h +stdio.h +- +sys/types.h +- + +lib/messages_mosq.h +mosquitto_internal.h +- +mosquitto.h +- + +lib/mosquitto.h +stdbool.h +- + +lib/mosquitto_internal.h +config.h +- +winsock2.h +- +openssl/ssl.h +- +time.h +- +stdlib.h +- +pthread.h +- +dummypthread.h +- +ares.h +- +stdint.h +- +stdint.h +- +mosquitto.h +lib/mosquitto.h +time_mosq.h +lib/time_mosq.h +netdb.h +- +uthash.h +lib/uthash.h + +lib/mqtt3_protocol.h + +lib/net_mosq.h +unistd.h +- +winsock2.h +- +mosquitto_internal.h +- +mosquitto.h +- + +lib/read_handle.h +mosquitto.h +- + +lib/send_mosq.h +mosquitto.h +- + +lib/time_mosq.h + +lib/tls_mosq.h +openssl/ssl.h +- + +lib/util_mosq.h +stdio.h +- +tls_mosq.h +lib/tls_mosq.h +mosquitto.h +lib/mosquitto.h +mosquitto_internal.h +lib/mosquitto_internal.h +mosquitto_broker.h +lib/mosquitto_broker.h + +lib/will_mosq.h +mosquitto.h +- +mosquitto_internal.h +- + +src/mosquitto_broker.h +config.h +- +stdio.h +- +libwebsockets.h +- +mosquitto_internal.h +- +mosquitto_plugin.h +- +mosquitto.h +- +tls_mosq.h +src/tls_mosq.h +uthash.h +src/uthash.h +net_mosq.h +- + +src/mosquitto_plugin.h + +src/persist.h + +src/uthash.h +string.h +- +stddef.h +- +stdlib.h +- +inttypes.h +- + diff --git a/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/DependInfo.cmake b/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/DependInfo.cmake new file mode 100644 index 0000000..03f6fb4 --- /dev/null +++ b/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/DependInfo.cmake @@ -0,0 +1,62 @@ +# The set of languages for which implicit dependencies are needed: +set(CMAKE_DEPENDS_LANGUAGES + "C" + ) +# The set of files for implicit dependencies of each language: +set(CMAKE_DEPENDS_CHECK_C + "/Users/benjamin/orchestra/src/libs/mosquitto/lib/memory_mosq.c" "/Users/benjamin/orchestra/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/__/lib/memory_mosq.c.o" + "/Users/benjamin/orchestra/src/libs/mosquitto/lib/net_mosq.c" "/Users/benjamin/orchestra/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/__/lib/net_mosq.c.o" + "/Users/benjamin/orchestra/src/libs/mosquitto/lib/read_handle_shared.c" "/Users/benjamin/orchestra/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o" + "/Users/benjamin/orchestra/src/libs/mosquitto/lib/send_client_mosq.c" "/Users/benjamin/orchestra/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/__/lib/send_client_mosq.c.o" + "/Users/benjamin/orchestra/src/libs/mosquitto/lib/send_mosq.c" "/Users/benjamin/orchestra/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/__/lib/send_mosq.c.o" + "/Users/benjamin/orchestra/src/libs/mosquitto/lib/time_mosq.c" "/Users/benjamin/orchestra/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/__/lib/time_mosq.c.o" + "/Users/benjamin/orchestra/src/libs/mosquitto/lib/tls_mosq.c" "/Users/benjamin/orchestra/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/__/lib/tls_mosq.c.o" + "/Users/benjamin/orchestra/src/libs/mosquitto/lib/util_mosq.c" "/Users/benjamin/orchestra/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/__/lib/util_mosq.c.o" + "/Users/benjamin/orchestra/src/libs/mosquitto/lib/will_mosq.c" "/Users/benjamin/orchestra/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/__/lib/will_mosq.c.o" + "/Users/benjamin/orchestra/src/libs/mosquitto/src/bridge.c" "/Users/benjamin/orchestra/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/bridge.c.o" + "/Users/benjamin/orchestra/src/libs/mosquitto/src/conf.c" "/Users/benjamin/orchestra/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/conf.c.o" + "/Users/benjamin/orchestra/src/libs/mosquitto/src/context.c" "/Users/benjamin/orchestra/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/context.c.o" + "/Users/benjamin/orchestra/src/libs/mosquitto/src/database.c" "/Users/benjamin/orchestra/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/database.c.o" + "/Users/benjamin/orchestra/src/libs/mosquitto/src/logging.c" "/Users/benjamin/orchestra/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/logging.c.o" + "/Users/benjamin/orchestra/src/libs/mosquitto/src/loop.c" "/Users/benjamin/orchestra/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/loop.c.o" + "/Users/benjamin/orchestra/src/libs/mosquitto/src/mosquitto.c" "/Users/benjamin/orchestra/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/mosquitto.c.o" + "/Users/benjamin/orchestra/src/libs/mosquitto/src/net.c" "/Users/benjamin/orchestra/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/net.c.o" + "/Users/benjamin/orchestra/src/libs/mosquitto/src/persist.c" "/Users/benjamin/orchestra/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/persist.c.o" + "/Users/benjamin/orchestra/src/libs/mosquitto/src/read_handle.c" "/Users/benjamin/orchestra/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/read_handle.c.o" + "/Users/benjamin/orchestra/src/libs/mosquitto/src/read_handle_client.c" "/Users/benjamin/orchestra/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/read_handle_client.c.o" + "/Users/benjamin/orchestra/src/libs/mosquitto/src/read_handle_server.c" "/Users/benjamin/orchestra/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/read_handle_server.c.o" + "/Users/benjamin/orchestra/src/libs/mosquitto/src/security.c" "/Users/benjamin/orchestra/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/security.c.o" + "/Users/benjamin/orchestra/src/libs/mosquitto/src/security_default.c" "/Users/benjamin/orchestra/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/security_default.c.o" + "/Users/benjamin/orchestra/src/libs/mosquitto/src/send_server.c" "/Users/benjamin/orchestra/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/send_server.c.o" + "/Users/benjamin/orchestra/src/libs/mosquitto/src/subs.c" "/Users/benjamin/orchestra/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/subs.c.o" + "/Users/benjamin/orchestra/src/libs/mosquitto/src/sys_tree.c" "/Users/benjamin/orchestra/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/sys_tree.c.o" + "/Users/benjamin/orchestra/src/libs/mosquitto/src/websockets.c" "/Users/benjamin/orchestra/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/websockets.c.o" + ) +set(CMAKE_C_COMPILER_ID "Clang") + +# Preprocessor definitions for this target. +set(CMAKE_TARGET_DEFINITIONS_C + "CMAKE" + "TIMESTAMP=\"2018-01-23 10:58:26+0100\"" + "VERSION=\"1.4.14\"" + "WITH_BRIDGE" + "WITH_BROKER" + "WITH_MEMORY_TRACKING" + "WITH_PERSISTENCE" + "WITH_SOCKS" + "WITH_SYS_TREE" + ) + +# The include file search paths: +set(CMAKE_C_TARGET_INCLUDE_PATH + "." + "src" + "lib" + ) + +# Targets to which this target links. +set(CMAKE_TARGET_LINKED_INFO_FILES + ) + +# Fortran module output directory. +set(CMAKE_Fortran_TARGET_MODULE_DIR "") diff --git a/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/build.make b/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/build.make new file mode 100644 index 0000000..7fd4d34 --- /dev/null +++ b/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/build.make @@ -0,0 +1,815 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.10 + +# Delete rule output on recipe failure. +.DELETE_ON_ERROR: + + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + + +# Remove some rules from gmake that .SUFFIXES does not remove. +SUFFIXES = + +.SUFFIXES: .hpux_make_needs_suffix_list + + +# Suppress display of executed commands. +$(VERBOSE).SILENT: + + +# A target that is always out of date. +cmake_force: + +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/local/Cellar/cmake/3.10.1/bin/cmake + +# The command to remove a file. +RM = /usr/local/Cellar/cmake/3.10.1/bin/cmake -E remove -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /Users/benjamin/orchestra/src/libs/mosquitto + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /Users/benjamin/orchestra/src/libs/mosquitto + +# Include any dependencies generated for this target. +include src/CMakeFiles/mosquitto.dir/depend.make + +# Include the progress variables for this target. +include src/CMakeFiles/mosquitto.dir/progress.make + +# Include the compile flags for this target's objects. +include src/CMakeFiles/mosquitto.dir/flags.make + +src/CMakeFiles/mosquitto.dir/conf.c.o: src/CMakeFiles/mosquitto.dir/flags.make +src/CMakeFiles/mosquitto.dir/conf.c.o: src/conf.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building C object src/CMakeFiles/mosquitto.dir/conf.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/mosquitto.dir/conf.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/src/conf.c + +src/CMakeFiles/mosquitto.dir/conf.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/mosquitto.dir/conf.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/src/conf.c > CMakeFiles/mosquitto.dir/conf.c.i + +src/CMakeFiles/mosquitto.dir/conf.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/mosquitto.dir/conf.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/src/conf.c -o CMakeFiles/mosquitto.dir/conf.c.s + +src/CMakeFiles/mosquitto.dir/conf.c.o.requires: + +.PHONY : src/CMakeFiles/mosquitto.dir/conf.c.o.requires + +src/CMakeFiles/mosquitto.dir/conf.c.o.provides: src/CMakeFiles/mosquitto.dir/conf.c.o.requires + $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/conf.c.o.provides.build +.PHONY : src/CMakeFiles/mosquitto.dir/conf.c.o.provides + +src/CMakeFiles/mosquitto.dir/conf.c.o.provides.build: src/CMakeFiles/mosquitto.dir/conf.c.o + + +src/CMakeFiles/mosquitto.dir/context.c.o: src/CMakeFiles/mosquitto.dir/flags.make +src/CMakeFiles/mosquitto.dir/context.c.o: src/context.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Building C object src/CMakeFiles/mosquitto.dir/context.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/mosquitto.dir/context.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/src/context.c + +src/CMakeFiles/mosquitto.dir/context.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/mosquitto.dir/context.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/src/context.c > CMakeFiles/mosquitto.dir/context.c.i + +src/CMakeFiles/mosquitto.dir/context.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/mosquitto.dir/context.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/src/context.c -o CMakeFiles/mosquitto.dir/context.c.s + +src/CMakeFiles/mosquitto.dir/context.c.o.requires: + +.PHONY : src/CMakeFiles/mosquitto.dir/context.c.o.requires + +src/CMakeFiles/mosquitto.dir/context.c.o.provides: src/CMakeFiles/mosquitto.dir/context.c.o.requires + $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/context.c.o.provides.build +.PHONY : src/CMakeFiles/mosquitto.dir/context.c.o.provides + +src/CMakeFiles/mosquitto.dir/context.c.o.provides.build: src/CMakeFiles/mosquitto.dir/context.c.o + + +src/CMakeFiles/mosquitto.dir/database.c.o: src/CMakeFiles/mosquitto.dir/flags.make +src/CMakeFiles/mosquitto.dir/database.c.o: src/database.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_3) "Building C object src/CMakeFiles/mosquitto.dir/database.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/mosquitto.dir/database.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/src/database.c + +src/CMakeFiles/mosquitto.dir/database.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/mosquitto.dir/database.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/src/database.c > CMakeFiles/mosquitto.dir/database.c.i + +src/CMakeFiles/mosquitto.dir/database.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/mosquitto.dir/database.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/src/database.c -o CMakeFiles/mosquitto.dir/database.c.s + +src/CMakeFiles/mosquitto.dir/database.c.o.requires: + +.PHONY : src/CMakeFiles/mosquitto.dir/database.c.o.requires + +src/CMakeFiles/mosquitto.dir/database.c.o.provides: src/CMakeFiles/mosquitto.dir/database.c.o.requires + $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/database.c.o.provides.build +.PHONY : src/CMakeFiles/mosquitto.dir/database.c.o.provides + +src/CMakeFiles/mosquitto.dir/database.c.o.provides.build: src/CMakeFiles/mosquitto.dir/database.c.o + + +src/CMakeFiles/mosquitto.dir/logging.c.o: src/CMakeFiles/mosquitto.dir/flags.make +src/CMakeFiles/mosquitto.dir/logging.c.o: src/logging.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_4) "Building C object src/CMakeFiles/mosquitto.dir/logging.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/mosquitto.dir/logging.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/src/logging.c + +src/CMakeFiles/mosquitto.dir/logging.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/mosquitto.dir/logging.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/src/logging.c > CMakeFiles/mosquitto.dir/logging.c.i + +src/CMakeFiles/mosquitto.dir/logging.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/mosquitto.dir/logging.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/src/logging.c -o CMakeFiles/mosquitto.dir/logging.c.s + +src/CMakeFiles/mosquitto.dir/logging.c.o.requires: + +.PHONY : src/CMakeFiles/mosquitto.dir/logging.c.o.requires + +src/CMakeFiles/mosquitto.dir/logging.c.o.provides: src/CMakeFiles/mosquitto.dir/logging.c.o.requires + $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/logging.c.o.provides.build +.PHONY : src/CMakeFiles/mosquitto.dir/logging.c.o.provides + +src/CMakeFiles/mosquitto.dir/logging.c.o.provides.build: src/CMakeFiles/mosquitto.dir/logging.c.o + + +src/CMakeFiles/mosquitto.dir/loop.c.o: src/CMakeFiles/mosquitto.dir/flags.make +src/CMakeFiles/mosquitto.dir/loop.c.o: src/loop.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_5) "Building C object src/CMakeFiles/mosquitto.dir/loop.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/mosquitto.dir/loop.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/src/loop.c + +src/CMakeFiles/mosquitto.dir/loop.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/mosquitto.dir/loop.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/src/loop.c > CMakeFiles/mosquitto.dir/loop.c.i + +src/CMakeFiles/mosquitto.dir/loop.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/mosquitto.dir/loop.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/src/loop.c -o CMakeFiles/mosquitto.dir/loop.c.s + +src/CMakeFiles/mosquitto.dir/loop.c.o.requires: + +.PHONY : src/CMakeFiles/mosquitto.dir/loop.c.o.requires + +src/CMakeFiles/mosquitto.dir/loop.c.o.provides: src/CMakeFiles/mosquitto.dir/loop.c.o.requires + $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/loop.c.o.provides.build +.PHONY : src/CMakeFiles/mosquitto.dir/loop.c.o.provides + +src/CMakeFiles/mosquitto.dir/loop.c.o.provides.build: src/CMakeFiles/mosquitto.dir/loop.c.o + + +src/CMakeFiles/mosquitto.dir/__/lib/memory_mosq.c.o: src/CMakeFiles/mosquitto.dir/flags.make +src/CMakeFiles/mosquitto.dir/__/lib/memory_mosq.c.o: lib/memory_mosq.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_6) "Building C object src/CMakeFiles/mosquitto.dir/__/lib/memory_mosq.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/mosquitto.dir/__/lib/memory_mosq.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/lib/memory_mosq.c + +src/CMakeFiles/mosquitto.dir/__/lib/memory_mosq.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/mosquitto.dir/__/lib/memory_mosq.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/lib/memory_mosq.c > CMakeFiles/mosquitto.dir/__/lib/memory_mosq.c.i + +src/CMakeFiles/mosquitto.dir/__/lib/memory_mosq.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/mosquitto.dir/__/lib/memory_mosq.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/lib/memory_mosq.c -o CMakeFiles/mosquitto.dir/__/lib/memory_mosq.c.s + +src/CMakeFiles/mosquitto.dir/__/lib/memory_mosq.c.o.requires: + +.PHONY : src/CMakeFiles/mosquitto.dir/__/lib/memory_mosq.c.o.requires + +src/CMakeFiles/mosquitto.dir/__/lib/memory_mosq.c.o.provides: src/CMakeFiles/mosquitto.dir/__/lib/memory_mosq.c.o.requires + $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/__/lib/memory_mosq.c.o.provides.build +.PHONY : src/CMakeFiles/mosquitto.dir/__/lib/memory_mosq.c.o.provides + +src/CMakeFiles/mosquitto.dir/__/lib/memory_mosq.c.o.provides.build: src/CMakeFiles/mosquitto.dir/__/lib/memory_mosq.c.o + + +src/CMakeFiles/mosquitto.dir/mosquitto.c.o: src/CMakeFiles/mosquitto.dir/flags.make +src/CMakeFiles/mosquitto.dir/mosquitto.c.o: src/mosquitto.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_7) "Building C object src/CMakeFiles/mosquitto.dir/mosquitto.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/mosquitto.dir/mosquitto.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/src/mosquitto.c + +src/CMakeFiles/mosquitto.dir/mosquitto.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/mosquitto.dir/mosquitto.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/src/mosquitto.c > CMakeFiles/mosquitto.dir/mosquitto.c.i + +src/CMakeFiles/mosquitto.dir/mosquitto.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/mosquitto.dir/mosquitto.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/src/mosquitto.c -o CMakeFiles/mosquitto.dir/mosquitto.c.s + +src/CMakeFiles/mosquitto.dir/mosquitto.c.o.requires: + +.PHONY : src/CMakeFiles/mosquitto.dir/mosquitto.c.o.requires + +src/CMakeFiles/mosquitto.dir/mosquitto.c.o.provides: src/CMakeFiles/mosquitto.dir/mosquitto.c.o.requires + $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/mosquitto.c.o.provides.build +.PHONY : src/CMakeFiles/mosquitto.dir/mosquitto.c.o.provides + +src/CMakeFiles/mosquitto.dir/mosquitto.c.o.provides.build: src/CMakeFiles/mosquitto.dir/mosquitto.c.o + + +src/CMakeFiles/mosquitto.dir/net.c.o: src/CMakeFiles/mosquitto.dir/flags.make +src/CMakeFiles/mosquitto.dir/net.c.o: src/net.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_8) "Building C object src/CMakeFiles/mosquitto.dir/net.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/mosquitto.dir/net.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/src/net.c + +src/CMakeFiles/mosquitto.dir/net.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/mosquitto.dir/net.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/src/net.c > CMakeFiles/mosquitto.dir/net.c.i + +src/CMakeFiles/mosquitto.dir/net.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/mosquitto.dir/net.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/src/net.c -o CMakeFiles/mosquitto.dir/net.c.s + +src/CMakeFiles/mosquitto.dir/net.c.o.requires: + +.PHONY : src/CMakeFiles/mosquitto.dir/net.c.o.requires + +src/CMakeFiles/mosquitto.dir/net.c.o.provides: src/CMakeFiles/mosquitto.dir/net.c.o.requires + $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/net.c.o.provides.build +.PHONY : src/CMakeFiles/mosquitto.dir/net.c.o.provides + +src/CMakeFiles/mosquitto.dir/net.c.o.provides.build: src/CMakeFiles/mosquitto.dir/net.c.o + + +src/CMakeFiles/mosquitto.dir/__/lib/net_mosq.c.o: src/CMakeFiles/mosquitto.dir/flags.make +src/CMakeFiles/mosquitto.dir/__/lib/net_mosq.c.o: lib/net_mosq.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_9) "Building C object src/CMakeFiles/mosquitto.dir/__/lib/net_mosq.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/mosquitto.dir/__/lib/net_mosq.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/lib/net_mosq.c + +src/CMakeFiles/mosquitto.dir/__/lib/net_mosq.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/mosquitto.dir/__/lib/net_mosq.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/lib/net_mosq.c > CMakeFiles/mosquitto.dir/__/lib/net_mosq.c.i + +src/CMakeFiles/mosquitto.dir/__/lib/net_mosq.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/mosquitto.dir/__/lib/net_mosq.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/lib/net_mosq.c -o CMakeFiles/mosquitto.dir/__/lib/net_mosq.c.s + +src/CMakeFiles/mosquitto.dir/__/lib/net_mosq.c.o.requires: + +.PHONY : src/CMakeFiles/mosquitto.dir/__/lib/net_mosq.c.o.requires + +src/CMakeFiles/mosquitto.dir/__/lib/net_mosq.c.o.provides: src/CMakeFiles/mosquitto.dir/__/lib/net_mosq.c.o.requires + $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/__/lib/net_mosq.c.o.provides.build +.PHONY : src/CMakeFiles/mosquitto.dir/__/lib/net_mosq.c.o.provides + +src/CMakeFiles/mosquitto.dir/__/lib/net_mosq.c.o.provides.build: src/CMakeFiles/mosquitto.dir/__/lib/net_mosq.c.o + + +src/CMakeFiles/mosquitto.dir/persist.c.o: src/CMakeFiles/mosquitto.dir/flags.make +src/CMakeFiles/mosquitto.dir/persist.c.o: src/persist.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_10) "Building C object src/CMakeFiles/mosquitto.dir/persist.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/mosquitto.dir/persist.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/src/persist.c + +src/CMakeFiles/mosquitto.dir/persist.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/mosquitto.dir/persist.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/src/persist.c > CMakeFiles/mosquitto.dir/persist.c.i + +src/CMakeFiles/mosquitto.dir/persist.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/mosquitto.dir/persist.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/src/persist.c -o CMakeFiles/mosquitto.dir/persist.c.s + +src/CMakeFiles/mosquitto.dir/persist.c.o.requires: + +.PHONY : src/CMakeFiles/mosquitto.dir/persist.c.o.requires + +src/CMakeFiles/mosquitto.dir/persist.c.o.provides: src/CMakeFiles/mosquitto.dir/persist.c.o.requires + $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/persist.c.o.provides.build +.PHONY : src/CMakeFiles/mosquitto.dir/persist.c.o.provides + +src/CMakeFiles/mosquitto.dir/persist.c.o.provides.build: src/CMakeFiles/mosquitto.dir/persist.c.o + + +src/CMakeFiles/mosquitto.dir/read_handle.c.o: src/CMakeFiles/mosquitto.dir/flags.make +src/CMakeFiles/mosquitto.dir/read_handle.c.o: src/read_handle.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_11) "Building C object src/CMakeFiles/mosquitto.dir/read_handle.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/mosquitto.dir/read_handle.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/src/read_handle.c + +src/CMakeFiles/mosquitto.dir/read_handle.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/mosquitto.dir/read_handle.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/src/read_handle.c > CMakeFiles/mosquitto.dir/read_handle.c.i + +src/CMakeFiles/mosquitto.dir/read_handle.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/mosquitto.dir/read_handle.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/src/read_handle.c -o CMakeFiles/mosquitto.dir/read_handle.c.s + +src/CMakeFiles/mosquitto.dir/read_handle.c.o.requires: + +.PHONY : src/CMakeFiles/mosquitto.dir/read_handle.c.o.requires + +src/CMakeFiles/mosquitto.dir/read_handle.c.o.provides: src/CMakeFiles/mosquitto.dir/read_handle.c.o.requires + $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/read_handle.c.o.provides.build +.PHONY : src/CMakeFiles/mosquitto.dir/read_handle.c.o.provides + +src/CMakeFiles/mosquitto.dir/read_handle.c.o.provides.build: src/CMakeFiles/mosquitto.dir/read_handle.c.o + + +src/CMakeFiles/mosquitto.dir/read_handle_client.c.o: src/CMakeFiles/mosquitto.dir/flags.make +src/CMakeFiles/mosquitto.dir/read_handle_client.c.o: src/read_handle_client.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_12) "Building C object src/CMakeFiles/mosquitto.dir/read_handle_client.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/mosquitto.dir/read_handle_client.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/src/read_handle_client.c + +src/CMakeFiles/mosquitto.dir/read_handle_client.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/mosquitto.dir/read_handle_client.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/src/read_handle_client.c > CMakeFiles/mosquitto.dir/read_handle_client.c.i + +src/CMakeFiles/mosquitto.dir/read_handle_client.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/mosquitto.dir/read_handle_client.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/src/read_handle_client.c -o CMakeFiles/mosquitto.dir/read_handle_client.c.s + +src/CMakeFiles/mosquitto.dir/read_handle_client.c.o.requires: + +.PHONY : src/CMakeFiles/mosquitto.dir/read_handle_client.c.o.requires + +src/CMakeFiles/mosquitto.dir/read_handle_client.c.o.provides: src/CMakeFiles/mosquitto.dir/read_handle_client.c.o.requires + $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/read_handle_client.c.o.provides.build +.PHONY : src/CMakeFiles/mosquitto.dir/read_handle_client.c.o.provides + +src/CMakeFiles/mosquitto.dir/read_handle_client.c.o.provides.build: src/CMakeFiles/mosquitto.dir/read_handle_client.c.o + + +src/CMakeFiles/mosquitto.dir/read_handle_server.c.o: src/CMakeFiles/mosquitto.dir/flags.make +src/CMakeFiles/mosquitto.dir/read_handle_server.c.o: src/read_handle_server.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_13) "Building C object src/CMakeFiles/mosquitto.dir/read_handle_server.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/mosquitto.dir/read_handle_server.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/src/read_handle_server.c + +src/CMakeFiles/mosquitto.dir/read_handle_server.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/mosquitto.dir/read_handle_server.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/src/read_handle_server.c > CMakeFiles/mosquitto.dir/read_handle_server.c.i + +src/CMakeFiles/mosquitto.dir/read_handle_server.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/mosquitto.dir/read_handle_server.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/src/read_handle_server.c -o CMakeFiles/mosquitto.dir/read_handle_server.c.s + +src/CMakeFiles/mosquitto.dir/read_handle_server.c.o.requires: + +.PHONY : src/CMakeFiles/mosquitto.dir/read_handle_server.c.o.requires + +src/CMakeFiles/mosquitto.dir/read_handle_server.c.o.provides: src/CMakeFiles/mosquitto.dir/read_handle_server.c.o.requires + $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/read_handle_server.c.o.provides.build +.PHONY : src/CMakeFiles/mosquitto.dir/read_handle_server.c.o.provides + +src/CMakeFiles/mosquitto.dir/read_handle_server.c.o.provides.build: src/CMakeFiles/mosquitto.dir/read_handle_server.c.o + + +src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o: src/CMakeFiles/mosquitto.dir/flags.make +src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o: lib/read_handle_shared.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_14) "Building C object src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/lib/read_handle_shared.c + +src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/lib/read_handle_shared.c > CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.i + +src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/lib/read_handle_shared.c -o CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.s + +src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o.requires: + +.PHONY : src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o.requires + +src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o.provides: src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o.requires + $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o.provides.build +.PHONY : src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o.provides + +src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o.provides.build: src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o + + +src/CMakeFiles/mosquitto.dir/subs.c.o: src/CMakeFiles/mosquitto.dir/flags.make +src/CMakeFiles/mosquitto.dir/subs.c.o: src/subs.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_15) "Building C object src/CMakeFiles/mosquitto.dir/subs.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/mosquitto.dir/subs.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/src/subs.c + +src/CMakeFiles/mosquitto.dir/subs.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/mosquitto.dir/subs.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/src/subs.c > CMakeFiles/mosquitto.dir/subs.c.i + +src/CMakeFiles/mosquitto.dir/subs.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/mosquitto.dir/subs.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/src/subs.c -o CMakeFiles/mosquitto.dir/subs.c.s + +src/CMakeFiles/mosquitto.dir/subs.c.o.requires: + +.PHONY : src/CMakeFiles/mosquitto.dir/subs.c.o.requires + +src/CMakeFiles/mosquitto.dir/subs.c.o.provides: src/CMakeFiles/mosquitto.dir/subs.c.o.requires + $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/subs.c.o.provides.build +.PHONY : src/CMakeFiles/mosquitto.dir/subs.c.o.provides + +src/CMakeFiles/mosquitto.dir/subs.c.o.provides.build: src/CMakeFiles/mosquitto.dir/subs.c.o + + +src/CMakeFiles/mosquitto.dir/security.c.o: src/CMakeFiles/mosquitto.dir/flags.make +src/CMakeFiles/mosquitto.dir/security.c.o: src/security.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_16) "Building C object src/CMakeFiles/mosquitto.dir/security.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/mosquitto.dir/security.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/src/security.c + +src/CMakeFiles/mosquitto.dir/security.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/mosquitto.dir/security.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/src/security.c > CMakeFiles/mosquitto.dir/security.c.i + +src/CMakeFiles/mosquitto.dir/security.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/mosquitto.dir/security.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/src/security.c -o CMakeFiles/mosquitto.dir/security.c.s + +src/CMakeFiles/mosquitto.dir/security.c.o.requires: + +.PHONY : src/CMakeFiles/mosquitto.dir/security.c.o.requires + +src/CMakeFiles/mosquitto.dir/security.c.o.provides: src/CMakeFiles/mosquitto.dir/security.c.o.requires + $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/security.c.o.provides.build +.PHONY : src/CMakeFiles/mosquitto.dir/security.c.o.provides + +src/CMakeFiles/mosquitto.dir/security.c.o.provides.build: src/CMakeFiles/mosquitto.dir/security.c.o + + +src/CMakeFiles/mosquitto.dir/security_default.c.o: src/CMakeFiles/mosquitto.dir/flags.make +src/CMakeFiles/mosquitto.dir/security_default.c.o: src/security_default.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_17) "Building C object src/CMakeFiles/mosquitto.dir/security_default.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/mosquitto.dir/security_default.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/src/security_default.c + +src/CMakeFiles/mosquitto.dir/security_default.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/mosquitto.dir/security_default.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/src/security_default.c > CMakeFiles/mosquitto.dir/security_default.c.i + +src/CMakeFiles/mosquitto.dir/security_default.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/mosquitto.dir/security_default.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/src/security_default.c -o CMakeFiles/mosquitto.dir/security_default.c.s + +src/CMakeFiles/mosquitto.dir/security_default.c.o.requires: + +.PHONY : src/CMakeFiles/mosquitto.dir/security_default.c.o.requires + +src/CMakeFiles/mosquitto.dir/security_default.c.o.provides: src/CMakeFiles/mosquitto.dir/security_default.c.o.requires + $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/security_default.c.o.provides.build +.PHONY : src/CMakeFiles/mosquitto.dir/security_default.c.o.provides + +src/CMakeFiles/mosquitto.dir/security_default.c.o.provides.build: src/CMakeFiles/mosquitto.dir/security_default.c.o + + +src/CMakeFiles/mosquitto.dir/__/lib/send_client_mosq.c.o: src/CMakeFiles/mosquitto.dir/flags.make +src/CMakeFiles/mosquitto.dir/__/lib/send_client_mosq.c.o: lib/send_client_mosq.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_18) "Building C object src/CMakeFiles/mosquitto.dir/__/lib/send_client_mosq.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/mosquitto.dir/__/lib/send_client_mosq.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/lib/send_client_mosq.c + +src/CMakeFiles/mosquitto.dir/__/lib/send_client_mosq.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/mosquitto.dir/__/lib/send_client_mosq.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/lib/send_client_mosq.c > CMakeFiles/mosquitto.dir/__/lib/send_client_mosq.c.i + +src/CMakeFiles/mosquitto.dir/__/lib/send_client_mosq.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/mosquitto.dir/__/lib/send_client_mosq.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/lib/send_client_mosq.c -o CMakeFiles/mosquitto.dir/__/lib/send_client_mosq.c.s + +src/CMakeFiles/mosquitto.dir/__/lib/send_client_mosq.c.o.requires: + +.PHONY : src/CMakeFiles/mosquitto.dir/__/lib/send_client_mosq.c.o.requires + +src/CMakeFiles/mosquitto.dir/__/lib/send_client_mosq.c.o.provides: src/CMakeFiles/mosquitto.dir/__/lib/send_client_mosq.c.o.requires + $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/__/lib/send_client_mosq.c.o.provides.build +.PHONY : src/CMakeFiles/mosquitto.dir/__/lib/send_client_mosq.c.o.provides + +src/CMakeFiles/mosquitto.dir/__/lib/send_client_mosq.c.o.provides.build: src/CMakeFiles/mosquitto.dir/__/lib/send_client_mosq.c.o + + +src/CMakeFiles/mosquitto.dir/__/lib/send_mosq.c.o: src/CMakeFiles/mosquitto.dir/flags.make +src/CMakeFiles/mosquitto.dir/__/lib/send_mosq.c.o: lib/send_mosq.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_19) "Building C object src/CMakeFiles/mosquitto.dir/__/lib/send_mosq.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/mosquitto.dir/__/lib/send_mosq.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/lib/send_mosq.c + +src/CMakeFiles/mosquitto.dir/__/lib/send_mosq.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/mosquitto.dir/__/lib/send_mosq.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/lib/send_mosq.c > CMakeFiles/mosquitto.dir/__/lib/send_mosq.c.i + +src/CMakeFiles/mosquitto.dir/__/lib/send_mosq.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/mosquitto.dir/__/lib/send_mosq.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/lib/send_mosq.c -o CMakeFiles/mosquitto.dir/__/lib/send_mosq.c.s + +src/CMakeFiles/mosquitto.dir/__/lib/send_mosq.c.o.requires: + +.PHONY : src/CMakeFiles/mosquitto.dir/__/lib/send_mosq.c.o.requires + +src/CMakeFiles/mosquitto.dir/__/lib/send_mosq.c.o.provides: src/CMakeFiles/mosquitto.dir/__/lib/send_mosq.c.o.requires + $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/__/lib/send_mosq.c.o.provides.build +.PHONY : src/CMakeFiles/mosquitto.dir/__/lib/send_mosq.c.o.provides + +src/CMakeFiles/mosquitto.dir/__/lib/send_mosq.c.o.provides.build: src/CMakeFiles/mosquitto.dir/__/lib/send_mosq.c.o + + +src/CMakeFiles/mosquitto.dir/send_server.c.o: src/CMakeFiles/mosquitto.dir/flags.make +src/CMakeFiles/mosquitto.dir/send_server.c.o: src/send_server.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_20) "Building C object src/CMakeFiles/mosquitto.dir/send_server.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/mosquitto.dir/send_server.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/src/send_server.c + +src/CMakeFiles/mosquitto.dir/send_server.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/mosquitto.dir/send_server.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/src/send_server.c > CMakeFiles/mosquitto.dir/send_server.c.i + +src/CMakeFiles/mosquitto.dir/send_server.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/mosquitto.dir/send_server.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/src/send_server.c -o CMakeFiles/mosquitto.dir/send_server.c.s + +src/CMakeFiles/mosquitto.dir/send_server.c.o.requires: + +.PHONY : src/CMakeFiles/mosquitto.dir/send_server.c.o.requires + +src/CMakeFiles/mosquitto.dir/send_server.c.o.provides: src/CMakeFiles/mosquitto.dir/send_server.c.o.requires + $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/send_server.c.o.provides.build +.PHONY : src/CMakeFiles/mosquitto.dir/send_server.c.o.provides + +src/CMakeFiles/mosquitto.dir/send_server.c.o.provides.build: src/CMakeFiles/mosquitto.dir/send_server.c.o + + +src/CMakeFiles/mosquitto.dir/sys_tree.c.o: src/CMakeFiles/mosquitto.dir/flags.make +src/CMakeFiles/mosquitto.dir/sys_tree.c.o: src/sys_tree.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_21) "Building C object src/CMakeFiles/mosquitto.dir/sys_tree.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/mosquitto.dir/sys_tree.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/src/sys_tree.c + +src/CMakeFiles/mosquitto.dir/sys_tree.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/mosquitto.dir/sys_tree.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/src/sys_tree.c > CMakeFiles/mosquitto.dir/sys_tree.c.i + +src/CMakeFiles/mosquitto.dir/sys_tree.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/mosquitto.dir/sys_tree.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/src/sys_tree.c -o CMakeFiles/mosquitto.dir/sys_tree.c.s + +src/CMakeFiles/mosquitto.dir/sys_tree.c.o.requires: + +.PHONY : src/CMakeFiles/mosquitto.dir/sys_tree.c.o.requires + +src/CMakeFiles/mosquitto.dir/sys_tree.c.o.provides: src/CMakeFiles/mosquitto.dir/sys_tree.c.o.requires + $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/sys_tree.c.o.provides.build +.PHONY : src/CMakeFiles/mosquitto.dir/sys_tree.c.o.provides + +src/CMakeFiles/mosquitto.dir/sys_tree.c.o.provides.build: src/CMakeFiles/mosquitto.dir/sys_tree.c.o + + +src/CMakeFiles/mosquitto.dir/__/lib/time_mosq.c.o: src/CMakeFiles/mosquitto.dir/flags.make +src/CMakeFiles/mosquitto.dir/__/lib/time_mosq.c.o: lib/time_mosq.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_22) "Building C object src/CMakeFiles/mosquitto.dir/__/lib/time_mosq.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/mosquitto.dir/__/lib/time_mosq.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/lib/time_mosq.c + +src/CMakeFiles/mosquitto.dir/__/lib/time_mosq.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/mosquitto.dir/__/lib/time_mosq.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/lib/time_mosq.c > CMakeFiles/mosquitto.dir/__/lib/time_mosq.c.i + +src/CMakeFiles/mosquitto.dir/__/lib/time_mosq.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/mosquitto.dir/__/lib/time_mosq.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/lib/time_mosq.c -o CMakeFiles/mosquitto.dir/__/lib/time_mosq.c.s + +src/CMakeFiles/mosquitto.dir/__/lib/time_mosq.c.o.requires: + +.PHONY : src/CMakeFiles/mosquitto.dir/__/lib/time_mosq.c.o.requires + +src/CMakeFiles/mosquitto.dir/__/lib/time_mosq.c.o.provides: src/CMakeFiles/mosquitto.dir/__/lib/time_mosq.c.o.requires + $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/__/lib/time_mosq.c.o.provides.build +.PHONY : src/CMakeFiles/mosquitto.dir/__/lib/time_mosq.c.o.provides + +src/CMakeFiles/mosquitto.dir/__/lib/time_mosq.c.o.provides.build: src/CMakeFiles/mosquitto.dir/__/lib/time_mosq.c.o + + +src/CMakeFiles/mosquitto.dir/__/lib/tls_mosq.c.o: src/CMakeFiles/mosquitto.dir/flags.make +src/CMakeFiles/mosquitto.dir/__/lib/tls_mosq.c.o: lib/tls_mosq.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_23) "Building C object src/CMakeFiles/mosquitto.dir/__/lib/tls_mosq.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/mosquitto.dir/__/lib/tls_mosq.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/lib/tls_mosq.c + +src/CMakeFiles/mosquitto.dir/__/lib/tls_mosq.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/mosquitto.dir/__/lib/tls_mosq.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/lib/tls_mosq.c > CMakeFiles/mosquitto.dir/__/lib/tls_mosq.c.i + +src/CMakeFiles/mosquitto.dir/__/lib/tls_mosq.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/mosquitto.dir/__/lib/tls_mosq.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/lib/tls_mosq.c -o CMakeFiles/mosquitto.dir/__/lib/tls_mosq.c.s + +src/CMakeFiles/mosquitto.dir/__/lib/tls_mosq.c.o.requires: + +.PHONY : src/CMakeFiles/mosquitto.dir/__/lib/tls_mosq.c.o.requires + +src/CMakeFiles/mosquitto.dir/__/lib/tls_mosq.c.o.provides: src/CMakeFiles/mosquitto.dir/__/lib/tls_mosq.c.o.requires + $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/__/lib/tls_mosq.c.o.provides.build +.PHONY : src/CMakeFiles/mosquitto.dir/__/lib/tls_mosq.c.o.provides + +src/CMakeFiles/mosquitto.dir/__/lib/tls_mosq.c.o.provides.build: src/CMakeFiles/mosquitto.dir/__/lib/tls_mosq.c.o + + +src/CMakeFiles/mosquitto.dir/__/lib/util_mosq.c.o: src/CMakeFiles/mosquitto.dir/flags.make +src/CMakeFiles/mosquitto.dir/__/lib/util_mosq.c.o: lib/util_mosq.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_24) "Building C object src/CMakeFiles/mosquitto.dir/__/lib/util_mosq.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/mosquitto.dir/__/lib/util_mosq.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/lib/util_mosq.c + +src/CMakeFiles/mosquitto.dir/__/lib/util_mosq.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/mosquitto.dir/__/lib/util_mosq.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/lib/util_mosq.c > CMakeFiles/mosquitto.dir/__/lib/util_mosq.c.i + +src/CMakeFiles/mosquitto.dir/__/lib/util_mosq.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/mosquitto.dir/__/lib/util_mosq.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/lib/util_mosq.c -o CMakeFiles/mosquitto.dir/__/lib/util_mosq.c.s + +src/CMakeFiles/mosquitto.dir/__/lib/util_mosq.c.o.requires: + +.PHONY : src/CMakeFiles/mosquitto.dir/__/lib/util_mosq.c.o.requires + +src/CMakeFiles/mosquitto.dir/__/lib/util_mosq.c.o.provides: src/CMakeFiles/mosquitto.dir/__/lib/util_mosq.c.o.requires + $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/__/lib/util_mosq.c.o.provides.build +.PHONY : src/CMakeFiles/mosquitto.dir/__/lib/util_mosq.c.o.provides + +src/CMakeFiles/mosquitto.dir/__/lib/util_mosq.c.o.provides.build: src/CMakeFiles/mosquitto.dir/__/lib/util_mosq.c.o + + +src/CMakeFiles/mosquitto.dir/websockets.c.o: src/CMakeFiles/mosquitto.dir/flags.make +src/CMakeFiles/mosquitto.dir/websockets.c.o: src/websockets.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_25) "Building C object src/CMakeFiles/mosquitto.dir/websockets.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/mosquitto.dir/websockets.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/src/websockets.c + +src/CMakeFiles/mosquitto.dir/websockets.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/mosquitto.dir/websockets.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/src/websockets.c > CMakeFiles/mosquitto.dir/websockets.c.i + +src/CMakeFiles/mosquitto.dir/websockets.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/mosquitto.dir/websockets.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/src/websockets.c -o CMakeFiles/mosquitto.dir/websockets.c.s + +src/CMakeFiles/mosquitto.dir/websockets.c.o.requires: + +.PHONY : src/CMakeFiles/mosquitto.dir/websockets.c.o.requires + +src/CMakeFiles/mosquitto.dir/websockets.c.o.provides: src/CMakeFiles/mosquitto.dir/websockets.c.o.requires + $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/websockets.c.o.provides.build +.PHONY : src/CMakeFiles/mosquitto.dir/websockets.c.o.provides + +src/CMakeFiles/mosquitto.dir/websockets.c.o.provides.build: src/CMakeFiles/mosquitto.dir/websockets.c.o + + +src/CMakeFiles/mosquitto.dir/__/lib/will_mosq.c.o: src/CMakeFiles/mosquitto.dir/flags.make +src/CMakeFiles/mosquitto.dir/__/lib/will_mosq.c.o: lib/will_mosq.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_26) "Building C object src/CMakeFiles/mosquitto.dir/__/lib/will_mosq.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/mosquitto.dir/__/lib/will_mosq.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/lib/will_mosq.c + +src/CMakeFiles/mosquitto.dir/__/lib/will_mosq.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/mosquitto.dir/__/lib/will_mosq.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/lib/will_mosq.c > CMakeFiles/mosquitto.dir/__/lib/will_mosq.c.i + +src/CMakeFiles/mosquitto.dir/__/lib/will_mosq.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/mosquitto.dir/__/lib/will_mosq.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/lib/will_mosq.c -o CMakeFiles/mosquitto.dir/__/lib/will_mosq.c.s + +src/CMakeFiles/mosquitto.dir/__/lib/will_mosq.c.o.requires: + +.PHONY : src/CMakeFiles/mosquitto.dir/__/lib/will_mosq.c.o.requires + +src/CMakeFiles/mosquitto.dir/__/lib/will_mosq.c.o.provides: src/CMakeFiles/mosquitto.dir/__/lib/will_mosq.c.o.requires + $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/__/lib/will_mosq.c.o.provides.build +.PHONY : src/CMakeFiles/mosquitto.dir/__/lib/will_mosq.c.o.provides + +src/CMakeFiles/mosquitto.dir/__/lib/will_mosq.c.o.provides.build: src/CMakeFiles/mosquitto.dir/__/lib/will_mosq.c.o + + +src/CMakeFiles/mosquitto.dir/bridge.c.o: src/CMakeFiles/mosquitto.dir/flags.make +src/CMakeFiles/mosquitto.dir/bridge.c.o: src/bridge.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_27) "Building C object src/CMakeFiles/mosquitto.dir/bridge.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/mosquitto.dir/bridge.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/src/bridge.c + +src/CMakeFiles/mosquitto.dir/bridge.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/mosquitto.dir/bridge.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/src/bridge.c > CMakeFiles/mosquitto.dir/bridge.c.i + +src/CMakeFiles/mosquitto.dir/bridge.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/mosquitto.dir/bridge.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/src/bridge.c -o CMakeFiles/mosquitto.dir/bridge.c.s + +src/CMakeFiles/mosquitto.dir/bridge.c.o.requires: + +.PHONY : src/CMakeFiles/mosquitto.dir/bridge.c.o.requires + +src/CMakeFiles/mosquitto.dir/bridge.c.o.provides: src/CMakeFiles/mosquitto.dir/bridge.c.o.requires + $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/bridge.c.o.provides.build +.PHONY : src/CMakeFiles/mosquitto.dir/bridge.c.o.provides + +src/CMakeFiles/mosquitto.dir/bridge.c.o.provides.build: src/CMakeFiles/mosquitto.dir/bridge.c.o + + +# Object files for target mosquitto +mosquitto_OBJECTS = \ +"CMakeFiles/mosquitto.dir/conf.c.o" \ +"CMakeFiles/mosquitto.dir/context.c.o" \ +"CMakeFiles/mosquitto.dir/database.c.o" \ +"CMakeFiles/mosquitto.dir/logging.c.o" \ +"CMakeFiles/mosquitto.dir/loop.c.o" \ +"CMakeFiles/mosquitto.dir/__/lib/memory_mosq.c.o" \ +"CMakeFiles/mosquitto.dir/mosquitto.c.o" \ +"CMakeFiles/mosquitto.dir/net.c.o" \ +"CMakeFiles/mosquitto.dir/__/lib/net_mosq.c.o" \ +"CMakeFiles/mosquitto.dir/persist.c.o" \ +"CMakeFiles/mosquitto.dir/read_handle.c.o" \ +"CMakeFiles/mosquitto.dir/read_handle_client.c.o" \ +"CMakeFiles/mosquitto.dir/read_handle_server.c.o" \ +"CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o" \ +"CMakeFiles/mosquitto.dir/subs.c.o" \ +"CMakeFiles/mosquitto.dir/security.c.o" \ +"CMakeFiles/mosquitto.dir/security_default.c.o" \ +"CMakeFiles/mosquitto.dir/__/lib/send_client_mosq.c.o" \ +"CMakeFiles/mosquitto.dir/__/lib/send_mosq.c.o" \ +"CMakeFiles/mosquitto.dir/send_server.c.o" \ +"CMakeFiles/mosquitto.dir/sys_tree.c.o" \ +"CMakeFiles/mosquitto.dir/__/lib/time_mosq.c.o" \ +"CMakeFiles/mosquitto.dir/__/lib/tls_mosq.c.o" \ +"CMakeFiles/mosquitto.dir/__/lib/util_mosq.c.o" \ +"CMakeFiles/mosquitto.dir/websockets.c.o" \ +"CMakeFiles/mosquitto.dir/__/lib/will_mosq.c.o" \ +"CMakeFiles/mosquitto.dir/bridge.c.o" + +# External object files for target mosquitto +mosquitto_EXTERNAL_OBJECTS = + +src/mosquitto: src/CMakeFiles/mosquitto.dir/conf.c.o +src/mosquitto: src/CMakeFiles/mosquitto.dir/context.c.o +src/mosquitto: src/CMakeFiles/mosquitto.dir/database.c.o +src/mosquitto: src/CMakeFiles/mosquitto.dir/logging.c.o +src/mosquitto: src/CMakeFiles/mosquitto.dir/loop.c.o +src/mosquitto: src/CMakeFiles/mosquitto.dir/__/lib/memory_mosq.c.o +src/mosquitto: src/CMakeFiles/mosquitto.dir/mosquitto.c.o +src/mosquitto: src/CMakeFiles/mosquitto.dir/net.c.o +src/mosquitto: src/CMakeFiles/mosquitto.dir/__/lib/net_mosq.c.o +src/mosquitto: src/CMakeFiles/mosquitto.dir/persist.c.o +src/mosquitto: src/CMakeFiles/mosquitto.dir/read_handle.c.o +src/mosquitto: src/CMakeFiles/mosquitto.dir/read_handle_client.c.o +src/mosquitto: src/CMakeFiles/mosquitto.dir/read_handle_server.c.o +src/mosquitto: src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o +src/mosquitto: src/CMakeFiles/mosquitto.dir/subs.c.o +src/mosquitto: src/CMakeFiles/mosquitto.dir/security.c.o +src/mosquitto: src/CMakeFiles/mosquitto.dir/security_default.c.o +src/mosquitto: src/CMakeFiles/mosquitto.dir/__/lib/send_client_mosq.c.o +src/mosquitto: src/CMakeFiles/mosquitto.dir/__/lib/send_mosq.c.o +src/mosquitto: src/CMakeFiles/mosquitto.dir/send_server.c.o +src/mosquitto: src/CMakeFiles/mosquitto.dir/sys_tree.c.o +src/mosquitto: src/CMakeFiles/mosquitto.dir/__/lib/time_mosq.c.o +src/mosquitto: src/CMakeFiles/mosquitto.dir/__/lib/tls_mosq.c.o +src/mosquitto: src/CMakeFiles/mosquitto.dir/__/lib/util_mosq.c.o +src/mosquitto: src/CMakeFiles/mosquitto.dir/websockets.c.o +src/mosquitto: src/CMakeFiles/mosquitto.dir/__/lib/will_mosq.c.o +src/mosquitto: src/CMakeFiles/mosquitto.dir/bridge.c.o +src/mosquitto: src/CMakeFiles/mosquitto.dir/build.make +src/mosquitto: src/CMakeFiles/mosquitto.dir/link.txt + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_28) "Linking C executable mosquitto" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/mosquitto.dir/link.txt --verbose=$(VERBOSE) + +# Rule to build all files generated by this target. +src/CMakeFiles/mosquitto.dir/build: src/mosquitto + +.PHONY : src/CMakeFiles/mosquitto.dir/build + +src/CMakeFiles/mosquitto.dir/requires: src/CMakeFiles/mosquitto.dir/conf.c.o.requires +src/CMakeFiles/mosquitto.dir/requires: src/CMakeFiles/mosquitto.dir/context.c.o.requires +src/CMakeFiles/mosquitto.dir/requires: src/CMakeFiles/mosquitto.dir/database.c.o.requires +src/CMakeFiles/mosquitto.dir/requires: src/CMakeFiles/mosquitto.dir/logging.c.o.requires +src/CMakeFiles/mosquitto.dir/requires: src/CMakeFiles/mosquitto.dir/loop.c.o.requires +src/CMakeFiles/mosquitto.dir/requires: src/CMakeFiles/mosquitto.dir/__/lib/memory_mosq.c.o.requires +src/CMakeFiles/mosquitto.dir/requires: src/CMakeFiles/mosquitto.dir/mosquitto.c.o.requires +src/CMakeFiles/mosquitto.dir/requires: src/CMakeFiles/mosquitto.dir/net.c.o.requires +src/CMakeFiles/mosquitto.dir/requires: src/CMakeFiles/mosquitto.dir/__/lib/net_mosq.c.o.requires +src/CMakeFiles/mosquitto.dir/requires: src/CMakeFiles/mosquitto.dir/persist.c.o.requires +src/CMakeFiles/mosquitto.dir/requires: src/CMakeFiles/mosquitto.dir/read_handle.c.o.requires +src/CMakeFiles/mosquitto.dir/requires: src/CMakeFiles/mosquitto.dir/read_handle_client.c.o.requires +src/CMakeFiles/mosquitto.dir/requires: src/CMakeFiles/mosquitto.dir/read_handle_server.c.o.requires +src/CMakeFiles/mosquitto.dir/requires: src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o.requires +src/CMakeFiles/mosquitto.dir/requires: src/CMakeFiles/mosquitto.dir/subs.c.o.requires +src/CMakeFiles/mosquitto.dir/requires: src/CMakeFiles/mosquitto.dir/security.c.o.requires +src/CMakeFiles/mosquitto.dir/requires: src/CMakeFiles/mosquitto.dir/security_default.c.o.requires +src/CMakeFiles/mosquitto.dir/requires: src/CMakeFiles/mosquitto.dir/__/lib/send_client_mosq.c.o.requires +src/CMakeFiles/mosquitto.dir/requires: src/CMakeFiles/mosquitto.dir/__/lib/send_mosq.c.o.requires +src/CMakeFiles/mosquitto.dir/requires: src/CMakeFiles/mosquitto.dir/send_server.c.o.requires +src/CMakeFiles/mosquitto.dir/requires: src/CMakeFiles/mosquitto.dir/sys_tree.c.o.requires +src/CMakeFiles/mosquitto.dir/requires: src/CMakeFiles/mosquitto.dir/__/lib/time_mosq.c.o.requires +src/CMakeFiles/mosquitto.dir/requires: src/CMakeFiles/mosquitto.dir/__/lib/tls_mosq.c.o.requires +src/CMakeFiles/mosquitto.dir/requires: src/CMakeFiles/mosquitto.dir/__/lib/util_mosq.c.o.requires +src/CMakeFiles/mosquitto.dir/requires: src/CMakeFiles/mosquitto.dir/websockets.c.o.requires +src/CMakeFiles/mosquitto.dir/requires: src/CMakeFiles/mosquitto.dir/__/lib/will_mosq.c.o.requires +src/CMakeFiles/mosquitto.dir/requires: src/CMakeFiles/mosquitto.dir/bridge.c.o.requires + +.PHONY : src/CMakeFiles/mosquitto.dir/requires + +src/CMakeFiles/mosquitto.dir/clean: + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && $(CMAKE_COMMAND) -P CMakeFiles/mosquitto.dir/cmake_clean.cmake +.PHONY : src/CMakeFiles/mosquitto.dir/clean + +src/CMakeFiles/mosquitto.dir/depend: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /Users/benjamin/orchestra/src/libs/mosquitto /Users/benjamin/orchestra/src/libs/mosquitto/src /Users/benjamin/orchestra/src/libs/mosquitto /Users/benjamin/orchestra/src/libs/mosquitto/src /Users/benjamin/orchestra/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/DependInfo.cmake --color=$(COLOR) +.PHONY : src/CMakeFiles/mosquitto.dir/depend + diff --git a/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/cmake_clean.cmake b/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/cmake_clean.cmake new file mode 100644 index 0000000..6e2ef7a --- /dev/null +++ b/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/cmake_clean.cmake @@ -0,0 +1,36 @@ +file(REMOVE_RECURSE + "CMakeFiles/mosquitto.dir/conf.c.o" + "CMakeFiles/mosquitto.dir/context.c.o" + "CMakeFiles/mosquitto.dir/database.c.o" + "CMakeFiles/mosquitto.dir/logging.c.o" + "CMakeFiles/mosquitto.dir/loop.c.o" + "CMakeFiles/mosquitto.dir/__/lib/memory_mosq.c.o" + "CMakeFiles/mosquitto.dir/mosquitto.c.o" + "CMakeFiles/mosquitto.dir/net.c.o" + "CMakeFiles/mosquitto.dir/__/lib/net_mosq.c.o" + "CMakeFiles/mosquitto.dir/persist.c.o" + "CMakeFiles/mosquitto.dir/read_handle.c.o" + "CMakeFiles/mosquitto.dir/read_handle_client.c.o" + "CMakeFiles/mosquitto.dir/read_handle_server.c.o" + "CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o" + "CMakeFiles/mosquitto.dir/subs.c.o" + "CMakeFiles/mosquitto.dir/security.c.o" + "CMakeFiles/mosquitto.dir/security_default.c.o" + "CMakeFiles/mosquitto.dir/__/lib/send_client_mosq.c.o" + "CMakeFiles/mosquitto.dir/__/lib/send_mosq.c.o" + "CMakeFiles/mosquitto.dir/send_server.c.o" + "CMakeFiles/mosquitto.dir/sys_tree.c.o" + "CMakeFiles/mosquitto.dir/__/lib/time_mosq.c.o" + "CMakeFiles/mosquitto.dir/__/lib/tls_mosq.c.o" + "CMakeFiles/mosquitto.dir/__/lib/util_mosq.c.o" + "CMakeFiles/mosquitto.dir/websockets.c.o" + "CMakeFiles/mosquitto.dir/__/lib/will_mosq.c.o" + "CMakeFiles/mosquitto.dir/bridge.c.o" + "mosquitto.pdb" + "mosquitto" +) + +# Per-language clean rules from dependency scanning. +foreach(lang C) + include(CMakeFiles/mosquitto.dir/cmake_clean_${lang}.cmake OPTIONAL) +endforeach() diff --git a/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/depend.internal b/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/depend.internal new file mode 100644 index 0000000..45c35c4 --- /dev/null +++ b/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/depend.internal @@ -0,0 +1,382 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.10 + +src/CMakeFiles/mosquitto.dir/__/lib/memory_mosq.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/lib/memory_mosq.c + config.h + lib/memory_mosq.h +src/CMakeFiles/mosquitto.dir/__/lib/net_mosq.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/lib/net_mosq.c + config.h + lib/dummypthread.h + lib/logging_mosq.h + lib/memory_mosq.h + lib/mosquitto.h + lib/mosquitto_internal.h + lib/mqtt3_protocol.h + lib/net_mosq.h + lib/read_handle.h + lib/time_mosq.h + lib/tls_mosq.h + lib/util_mosq.h + src/mosquitto_broker.h + src/mosquitto_plugin.h + src/uthash.h +src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/lib/read_handle_shared.c + config.h + lib/dummypthread.h + lib/logging_mosq.h + lib/memory_mosq.h + lib/messages_mosq.h + lib/mosquitto.h + lib/mosquitto_internal.h + lib/mqtt3_protocol.h + lib/net_mosq.h + lib/read_handle.h + lib/send_mosq.h + lib/time_mosq.h + lib/tls_mosq.h + lib/util_mosq.h + src/mosquitto_broker.h + src/mosquitto_plugin.h + src/uthash.h +src/CMakeFiles/mosquitto.dir/__/lib/send_client_mosq.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/lib/send_client_mosq.c + config.h + lib/dummypthread.h + lib/logging_mosq.h + lib/memory_mosq.h + lib/mosquitto.h + lib/mosquitto_internal.h + lib/mqtt3_protocol.h + lib/net_mosq.h + lib/send_mosq.h + lib/time_mosq.h + lib/tls_mosq.h + lib/util_mosq.h + src/mosquitto_broker.h + src/mosquitto_plugin.h + src/uthash.h +src/CMakeFiles/mosquitto.dir/__/lib/send_mosq.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/lib/send_mosq.c + config.h + lib/dummypthread.h + lib/logging_mosq.h + lib/memory_mosq.h + lib/mosquitto.h + lib/mosquitto_internal.h + lib/mqtt3_protocol.h + lib/net_mosq.h + lib/send_mosq.h + lib/time_mosq.h + lib/tls_mosq.h + lib/util_mosq.h + src/mosquitto_broker.h + src/mosquitto_plugin.h + src/uthash.h +src/CMakeFiles/mosquitto.dir/__/lib/time_mosq.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/lib/mosquitto.h + /Users/benjamin/orchestra/src/libs/mosquitto/lib/time_mosq.c + /Users/benjamin/orchestra/src/libs/mosquitto/lib/time_mosq.h +src/CMakeFiles/mosquitto.dir/__/lib/tls_mosq.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/lib/mosquitto_internal.h + /Users/benjamin/orchestra/src/libs/mosquitto/lib/time_mosq.h + /Users/benjamin/orchestra/src/libs/mosquitto/lib/tls_mosq.c + /Users/benjamin/orchestra/src/libs/mosquitto/lib/tls_mosq.h + config.h + lib/dummypthread.h + lib/mosquitto.h + lib/net_mosq.h + src/mosquitto_broker.h + src/mosquitto_plugin.h + src/uthash.h +src/CMakeFiles/mosquitto.dir/__/lib/util_mosq.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/lib/util_mosq.c + config.h + lib/dummypthread.h + lib/memory_mosq.h + lib/mosquitto.h + lib/mosquitto_internal.h + lib/net_mosq.h + lib/send_mosq.h + lib/time_mosq.h + lib/tls_mosq.h + lib/util_mosq.h + src/mosquitto_broker.h + src/mosquitto_plugin.h + src/uthash.h +src/CMakeFiles/mosquitto.dir/__/lib/will_mosq.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/lib/will_mosq.c + config.h + lib/dummypthread.h + lib/memory_mosq.h + lib/mosquitto.h + lib/mosquitto_internal.h + lib/mqtt3_protocol.h + lib/time_mosq.h + src/uthash.h +src/CMakeFiles/mosquitto.dir/bridge.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/src/bridge.c + config.h + lib/dummypthread.h + lib/memory_mosq.h + lib/mosquitto.h + lib/mosquitto_internal.h + lib/net_mosq.h + lib/send_mosq.h + lib/time_mosq.h + lib/tls_mosq.h + lib/util_mosq.h + lib/will_mosq.h + src/mosquitto_broker.h + src/mosquitto_plugin.h + src/uthash.h +src/CMakeFiles/mosquitto.dir/conf.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/src/conf.c + config.h + lib/dummypthread.h + lib/memory_mosq.h + lib/mosquitto.h + lib/mosquitto_internal.h + lib/mqtt3_protocol.h + lib/net_mosq.h + lib/time_mosq.h + lib/tls_mosq.h + lib/util_mosq.h + src/mosquitto_broker.h + src/mosquitto_plugin.h + src/uthash.h +src/CMakeFiles/mosquitto.dir/context.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/src/context.c + /Users/benjamin/orchestra/src/libs/mosquitto/src/uthash.h + config.h + lib/dummypthread.h + lib/memory_mosq.h + lib/mosquitto.h + lib/mosquitto_internal.h + lib/net_mosq.h + lib/time_mosq.h + lib/tls_mosq.h + src/mosquitto_broker.h + src/mosquitto_plugin.h +src/CMakeFiles/mosquitto.dir/database.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/src/database.c + config.h + lib/dummypthread.h + lib/memory_mosq.h + lib/mosquitto.h + lib/mosquitto_internal.h + lib/net_mosq.h + lib/send_mosq.h + lib/time_mosq.h + lib/tls_mosq.h + src/mosquitto_broker.h + src/mosquitto_plugin.h + src/uthash.h +src/CMakeFiles/mosquitto.dir/logging.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/src/logging.c + config.h + lib/dummypthread.h + lib/memory_mosq.h + lib/mosquitto.h + lib/mosquitto_internal.h + lib/net_mosq.h + lib/time_mosq.h + lib/tls_mosq.h + lib/util_mosq.h + src/mosquitto_broker.h + src/mosquitto_plugin.h + src/uthash.h +src/CMakeFiles/mosquitto.dir/loop.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/src/loop.c + config.h + lib/dummypthread.h + lib/memory_mosq.h + lib/mosquitto.h + lib/mosquitto_internal.h + lib/net_mosq.h + lib/send_mosq.h + lib/time_mosq.h + lib/tls_mosq.h + lib/util_mosq.h + src/mosquitto_broker.h + src/mosquitto_plugin.h + src/uthash.h +src/CMakeFiles/mosquitto.dir/mosquitto.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/src/mosquitto.c + config.h + lib/dummypthread.h + lib/memory_mosq.h + lib/mosquitto.h + lib/mosquitto_internal.h + lib/net_mosq.h + lib/time_mosq.h + lib/tls_mosq.h + lib/util_mosq.h + src/mosquitto_broker.h + src/mosquitto_plugin.h + src/uthash.h +src/CMakeFiles/mosquitto.dir/net.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/src/net.c + config.h + lib/dummypthread.h + lib/memory_mosq.h + lib/mosquitto.h + lib/mosquitto_internal.h + lib/mqtt3_protocol.h + lib/net_mosq.h + lib/time_mosq.h + lib/tls_mosq.h + lib/util_mosq.h + src/mosquitto_broker.h + src/mosquitto_plugin.h + src/uthash.h +src/CMakeFiles/mosquitto.dir/persist.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/src/persist.c + config.h + lib/dummypthread.h + lib/memory_mosq.h + lib/mosquitto.h + lib/mosquitto_internal.h + lib/net_mosq.h + lib/time_mosq.h + lib/tls_mosq.h + lib/util_mosq.h + src/mosquitto_broker.h + src/mosquitto_plugin.h + src/persist.h + src/uthash.h +src/CMakeFiles/mosquitto.dir/read_handle.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/src/read_handle.c + config.h + lib/dummypthread.h + lib/memory_mosq.h + lib/mosquitto.h + lib/mosquitto_internal.h + lib/mqtt3_protocol.h + lib/net_mosq.h + lib/read_handle.h + lib/send_mosq.h + lib/time_mosq.h + lib/tls_mosq.h + lib/util_mosq.h + src/mosquitto_broker.h + src/mosquitto_plugin.h + src/uthash.h +src/CMakeFiles/mosquitto.dir/read_handle_client.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/src/read_handle_client.c + config.h + lib/dummypthread.h + lib/memory_mosq.h + lib/mosquitto.h + lib/mosquitto_internal.h + lib/mqtt3_protocol.h + lib/net_mosq.h + lib/send_mosq.h + lib/time_mosq.h + lib/tls_mosq.h + lib/util_mosq.h + src/mosquitto_broker.h + src/mosquitto_plugin.h + src/uthash.h +src/CMakeFiles/mosquitto.dir/read_handle_server.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/src/read_handle_server.c + config.h + lib/dummypthread.h + lib/memory_mosq.h + lib/mosquitto.h + lib/mosquitto_internal.h + lib/mqtt3_protocol.h + lib/net_mosq.h + lib/send_mosq.h + lib/time_mosq.h + lib/tls_mosq.h + lib/util_mosq.h + src/mosquitto_broker.h + src/mosquitto_plugin.h + src/uthash.h +src/CMakeFiles/mosquitto.dir/security.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/src/lib_load.h + /Users/benjamin/orchestra/src/libs/mosquitto/src/mosquitto_plugin.h + /Users/benjamin/orchestra/src/libs/mosquitto/src/security.c + config.h + lib/dummypthread.h + lib/memory_mosq.h + lib/mosquitto.h + lib/mosquitto_internal.h + lib/net_mosq.h + lib/time_mosq.h + lib/tls_mosq.h + src/mosquitto_broker.h + src/uthash.h +src/CMakeFiles/mosquitto.dir/security_default.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/src/security_default.c + config.h + lib/dummypthread.h + lib/memory_mosq.h + lib/mosquitto.h + lib/mosquitto_internal.h + lib/net_mosq.h + lib/time_mosq.h + lib/tls_mosq.h + lib/util_mosq.h + src/mosquitto_broker.h + src/mosquitto_plugin.h + src/uthash.h +src/CMakeFiles/mosquitto.dir/send_server.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/src/send_server.c + config.h + lib/dummypthread.h + lib/memory_mosq.h + lib/mosquitto.h + lib/mosquitto_internal.h + lib/mqtt3_protocol.h + lib/net_mosq.h + lib/time_mosq.h + lib/tls_mosq.h + lib/util_mosq.h + src/mosquitto_broker.h + src/mosquitto_plugin.h + src/uthash.h +src/CMakeFiles/mosquitto.dir/subs.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/src/subs.c + config.h + lib/dummypthread.h + lib/memory_mosq.h + lib/mosquitto.h + lib/mosquitto_internal.h + lib/net_mosq.h + lib/time_mosq.h + lib/tls_mosq.h + lib/util_mosq.h + src/mosquitto_broker.h + src/mosquitto_plugin.h + src/uthash.h +src/CMakeFiles/mosquitto.dir/sys_tree.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/src/sys_tree.c + config.h + lib/dummypthread.h + lib/memory_mosq.h + lib/mosquitto.h + lib/mosquitto_internal.h + lib/net_mosq.h + lib/time_mosq.h + lib/tls_mosq.h + src/mosquitto_broker.h + src/mosquitto_plugin.h + src/uthash.h +src/CMakeFiles/mosquitto.dir/websockets.c.o + /Users/benjamin/orchestra/src/libs/mosquitto/src/mosquitto_broker.h + /Users/benjamin/orchestra/src/libs/mosquitto/src/websockets.c + config.h + lib/dummypthread.h + lib/memory_mosq.h + lib/mosquitto.h + lib/mosquitto_internal.h + lib/mqtt3_protocol.h + lib/net_mosq.h + lib/time_mosq.h + lib/tls_mosq.h + src/mosquitto_plugin.h + src/uthash.h diff --git a/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/depend.make b/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/depend.make new file mode 100644 index 0000000..40a8181 --- /dev/null +++ b/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/depend.make @@ -0,0 +1,382 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.10 + +src/CMakeFiles/mosquitto.dir/__/lib/memory_mosq.c.o: lib/memory_mosq.c +src/CMakeFiles/mosquitto.dir/__/lib/memory_mosq.c.o: config.h +src/CMakeFiles/mosquitto.dir/__/lib/memory_mosq.c.o: lib/memory_mosq.h + +src/CMakeFiles/mosquitto.dir/__/lib/net_mosq.c.o: lib/net_mosq.c +src/CMakeFiles/mosquitto.dir/__/lib/net_mosq.c.o: config.h +src/CMakeFiles/mosquitto.dir/__/lib/net_mosq.c.o: lib/dummypthread.h +src/CMakeFiles/mosquitto.dir/__/lib/net_mosq.c.o: lib/logging_mosq.h +src/CMakeFiles/mosquitto.dir/__/lib/net_mosq.c.o: lib/memory_mosq.h +src/CMakeFiles/mosquitto.dir/__/lib/net_mosq.c.o: lib/mosquitto.h +src/CMakeFiles/mosquitto.dir/__/lib/net_mosq.c.o: lib/mosquitto_internal.h +src/CMakeFiles/mosquitto.dir/__/lib/net_mosq.c.o: lib/mqtt3_protocol.h +src/CMakeFiles/mosquitto.dir/__/lib/net_mosq.c.o: lib/net_mosq.h +src/CMakeFiles/mosquitto.dir/__/lib/net_mosq.c.o: lib/read_handle.h +src/CMakeFiles/mosquitto.dir/__/lib/net_mosq.c.o: lib/time_mosq.h +src/CMakeFiles/mosquitto.dir/__/lib/net_mosq.c.o: lib/tls_mosq.h +src/CMakeFiles/mosquitto.dir/__/lib/net_mosq.c.o: lib/util_mosq.h +src/CMakeFiles/mosquitto.dir/__/lib/net_mosq.c.o: src/mosquitto_broker.h +src/CMakeFiles/mosquitto.dir/__/lib/net_mosq.c.o: src/mosquitto_plugin.h +src/CMakeFiles/mosquitto.dir/__/lib/net_mosq.c.o: src/uthash.h + +src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o: lib/read_handle_shared.c +src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o: config.h +src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o: lib/dummypthread.h +src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o: lib/logging_mosq.h +src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o: lib/memory_mosq.h +src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o: lib/messages_mosq.h +src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o: lib/mosquitto.h +src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o: lib/mosquitto_internal.h +src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o: lib/mqtt3_protocol.h +src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o: lib/net_mosq.h +src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o: lib/read_handle.h +src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o: lib/send_mosq.h +src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o: lib/time_mosq.h +src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o: lib/tls_mosq.h +src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o: lib/util_mosq.h +src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o: src/mosquitto_broker.h +src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o: src/mosquitto_plugin.h +src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o: src/uthash.h + +src/CMakeFiles/mosquitto.dir/__/lib/send_client_mosq.c.o: lib/send_client_mosq.c +src/CMakeFiles/mosquitto.dir/__/lib/send_client_mosq.c.o: config.h +src/CMakeFiles/mosquitto.dir/__/lib/send_client_mosq.c.o: lib/dummypthread.h +src/CMakeFiles/mosquitto.dir/__/lib/send_client_mosq.c.o: lib/logging_mosq.h +src/CMakeFiles/mosquitto.dir/__/lib/send_client_mosq.c.o: lib/memory_mosq.h +src/CMakeFiles/mosquitto.dir/__/lib/send_client_mosq.c.o: lib/mosquitto.h +src/CMakeFiles/mosquitto.dir/__/lib/send_client_mosq.c.o: lib/mosquitto_internal.h +src/CMakeFiles/mosquitto.dir/__/lib/send_client_mosq.c.o: lib/mqtt3_protocol.h +src/CMakeFiles/mosquitto.dir/__/lib/send_client_mosq.c.o: lib/net_mosq.h +src/CMakeFiles/mosquitto.dir/__/lib/send_client_mosq.c.o: lib/send_mosq.h +src/CMakeFiles/mosquitto.dir/__/lib/send_client_mosq.c.o: lib/time_mosq.h +src/CMakeFiles/mosquitto.dir/__/lib/send_client_mosq.c.o: lib/tls_mosq.h +src/CMakeFiles/mosquitto.dir/__/lib/send_client_mosq.c.o: lib/util_mosq.h +src/CMakeFiles/mosquitto.dir/__/lib/send_client_mosq.c.o: src/mosquitto_broker.h +src/CMakeFiles/mosquitto.dir/__/lib/send_client_mosq.c.o: src/mosquitto_plugin.h +src/CMakeFiles/mosquitto.dir/__/lib/send_client_mosq.c.o: src/uthash.h + +src/CMakeFiles/mosquitto.dir/__/lib/send_mosq.c.o: lib/send_mosq.c +src/CMakeFiles/mosquitto.dir/__/lib/send_mosq.c.o: config.h +src/CMakeFiles/mosquitto.dir/__/lib/send_mosq.c.o: lib/dummypthread.h +src/CMakeFiles/mosquitto.dir/__/lib/send_mosq.c.o: lib/logging_mosq.h +src/CMakeFiles/mosquitto.dir/__/lib/send_mosq.c.o: lib/memory_mosq.h +src/CMakeFiles/mosquitto.dir/__/lib/send_mosq.c.o: lib/mosquitto.h +src/CMakeFiles/mosquitto.dir/__/lib/send_mosq.c.o: lib/mosquitto_internal.h +src/CMakeFiles/mosquitto.dir/__/lib/send_mosq.c.o: lib/mqtt3_protocol.h +src/CMakeFiles/mosquitto.dir/__/lib/send_mosq.c.o: lib/net_mosq.h +src/CMakeFiles/mosquitto.dir/__/lib/send_mosq.c.o: lib/send_mosq.h +src/CMakeFiles/mosquitto.dir/__/lib/send_mosq.c.o: lib/time_mosq.h +src/CMakeFiles/mosquitto.dir/__/lib/send_mosq.c.o: lib/tls_mosq.h +src/CMakeFiles/mosquitto.dir/__/lib/send_mosq.c.o: lib/util_mosq.h +src/CMakeFiles/mosquitto.dir/__/lib/send_mosq.c.o: src/mosquitto_broker.h +src/CMakeFiles/mosquitto.dir/__/lib/send_mosq.c.o: src/mosquitto_plugin.h +src/CMakeFiles/mosquitto.dir/__/lib/send_mosq.c.o: src/uthash.h + +src/CMakeFiles/mosquitto.dir/__/lib/time_mosq.c.o: lib/mosquitto.h +src/CMakeFiles/mosquitto.dir/__/lib/time_mosq.c.o: lib/time_mosq.c +src/CMakeFiles/mosquitto.dir/__/lib/time_mosq.c.o: lib/time_mosq.h + +src/CMakeFiles/mosquitto.dir/__/lib/tls_mosq.c.o: lib/mosquitto_internal.h +src/CMakeFiles/mosquitto.dir/__/lib/tls_mosq.c.o: lib/time_mosq.h +src/CMakeFiles/mosquitto.dir/__/lib/tls_mosq.c.o: lib/tls_mosq.c +src/CMakeFiles/mosquitto.dir/__/lib/tls_mosq.c.o: lib/tls_mosq.h +src/CMakeFiles/mosquitto.dir/__/lib/tls_mosq.c.o: config.h +src/CMakeFiles/mosquitto.dir/__/lib/tls_mosq.c.o: lib/dummypthread.h +src/CMakeFiles/mosquitto.dir/__/lib/tls_mosq.c.o: lib/mosquitto.h +src/CMakeFiles/mosquitto.dir/__/lib/tls_mosq.c.o: lib/net_mosq.h +src/CMakeFiles/mosquitto.dir/__/lib/tls_mosq.c.o: src/mosquitto_broker.h +src/CMakeFiles/mosquitto.dir/__/lib/tls_mosq.c.o: src/mosquitto_plugin.h +src/CMakeFiles/mosquitto.dir/__/lib/tls_mosq.c.o: src/uthash.h + +src/CMakeFiles/mosquitto.dir/__/lib/util_mosq.c.o: lib/util_mosq.c +src/CMakeFiles/mosquitto.dir/__/lib/util_mosq.c.o: config.h +src/CMakeFiles/mosquitto.dir/__/lib/util_mosq.c.o: lib/dummypthread.h +src/CMakeFiles/mosquitto.dir/__/lib/util_mosq.c.o: lib/memory_mosq.h +src/CMakeFiles/mosquitto.dir/__/lib/util_mosq.c.o: lib/mosquitto.h +src/CMakeFiles/mosquitto.dir/__/lib/util_mosq.c.o: lib/mosquitto_internal.h +src/CMakeFiles/mosquitto.dir/__/lib/util_mosq.c.o: lib/net_mosq.h +src/CMakeFiles/mosquitto.dir/__/lib/util_mosq.c.o: lib/send_mosq.h +src/CMakeFiles/mosquitto.dir/__/lib/util_mosq.c.o: lib/time_mosq.h +src/CMakeFiles/mosquitto.dir/__/lib/util_mosq.c.o: lib/tls_mosq.h +src/CMakeFiles/mosquitto.dir/__/lib/util_mosq.c.o: lib/util_mosq.h +src/CMakeFiles/mosquitto.dir/__/lib/util_mosq.c.o: src/mosquitto_broker.h +src/CMakeFiles/mosquitto.dir/__/lib/util_mosq.c.o: src/mosquitto_plugin.h +src/CMakeFiles/mosquitto.dir/__/lib/util_mosq.c.o: src/uthash.h + +src/CMakeFiles/mosquitto.dir/__/lib/will_mosq.c.o: lib/will_mosq.c +src/CMakeFiles/mosquitto.dir/__/lib/will_mosq.c.o: config.h +src/CMakeFiles/mosquitto.dir/__/lib/will_mosq.c.o: lib/dummypthread.h +src/CMakeFiles/mosquitto.dir/__/lib/will_mosq.c.o: lib/memory_mosq.h +src/CMakeFiles/mosquitto.dir/__/lib/will_mosq.c.o: lib/mosquitto.h +src/CMakeFiles/mosquitto.dir/__/lib/will_mosq.c.o: lib/mosquitto_internal.h +src/CMakeFiles/mosquitto.dir/__/lib/will_mosq.c.o: lib/mqtt3_protocol.h +src/CMakeFiles/mosquitto.dir/__/lib/will_mosq.c.o: lib/time_mosq.h +src/CMakeFiles/mosquitto.dir/__/lib/will_mosq.c.o: src/uthash.h + +src/CMakeFiles/mosquitto.dir/bridge.c.o: src/bridge.c +src/CMakeFiles/mosquitto.dir/bridge.c.o: config.h +src/CMakeFiles/mosquitto.dir/bridge.c.o: lib/dummypthread.h +src/CMakeFiles/mosquitto.dir/bridge.c.o: lib/memory_mosq.h +src/CMakeFiles/mosquitto.dir/bridge.c.o: lib/mosquitto.h +src/CMakeFiles/mosquitto.dir/bridge.c.o: lib/mosquitto_internal.h +src/CMakeFiles/mosquitto.dir/bridge.c.o: lib/net_mosq.h +src/CMakeFiles/mosquitto.dir/bridge.c.o: lib/send_mosq.h +src/CMakeFiles/mosquitto.dir/bridge.c.o: lib/time_mosq.h +src/CMakeFiles/mosquitto.dir/bridge.c.o: lib/tls_mosq.h +src/CMakeFiles/mosquitto.dir/bridge.c.o: lib/util_mosq.h +src/CMakeFiles/mosquitto.dir/bridge.c.o: lib/will_mosq.h +src/CMakeFiles/mosquitto.dir/bridge.c.o: src/mosquitto_broker.h +src/CMakeFiles/mosquitto.dir/bridge.c.o: src/mosquitto_plugin.h +src/CMakeFiles/mosquitto.dir/bridge.c.o: src/uthash.h + +src/CMakeFiles/mosquitto.dir/conf.c.o: src/conf.c +src/CMakeFiles/mosquitto.dir/conf.c.o: config.h +src/CMakeFiles/mosquitto.dir/conf.c.o: lib/dummypthread.h +src/CMakeFiles/mosquitto.dir/conf.c.o: lib/memory_mosq.h +src/CMakeFiles/mosquitto.dir/conf.c.o: lib/mosquitto.h +src/CMakeFiles/mosquitto.dir/conf.c.o: lib/mosquitto_internal.h +src/CMakeFiles/mosquitto.dir/conf.c.o: lib/mqtt3_protocol.h +src/CMakeFiles/mosquitto.dir/conf.c.o: lib/net_mosq.h +src/CMakeFiles/mosquitto.dir/conf.c.o: lib/time_mosq.h +src/CMakeFiles/mosquitto.dir/conf.c.o: lib/tls_mosq.h +src/CMakeFiles/mosquitto.dir/conf.c.o: lib/util_mosq.h +src/CMakeFiles/mosquitto.dir/conf.c.o: src/mosquitto_broker.h +src/CMakeFiles/mosquitto.dir/conf.c.o: src/mosquitto_plugin.h +src/CMakeFiles/mosquitto.dir/conf.c.o: src/uthash.h + +src/CMakeFiles/mosquitto.dir/context.c.o: src/context.c +src/CMakeFiles/mosquitto.dir/context.c.o: src/uthash.h +src/CMakeFiles/mosquitto.dir/context.c.o: config.h +src/CMakeFiles/mosquitto.dir/context.c.o: lib/dummypthread.h +src/CMakeFiles/mosquitto.dir/context.c.o: lib/memory_mosq.h +src/CMakeFiles/mosquitto.dir/context.c.o: lib/mosquitto.h +src/CMakeFiles/mosquitto.dir/context.c.o: lib/mosquitto_internal.h +src/CMakeFiles/mosquitto.dir/context.c.o: lib/net_mosq.h +src/CMakeFiles/mosquitto.dir/context.c.o: lib/time_mosq.h +src/CMakeFiles/mosquitto.dir/context.c.o: lib/tls_mosq.h +src/CMakeFiles/mosquitto.dir/context.c.o: src/mosquitto_broker.h +src/CMakeFiles/mosquitto.dir/context.c.o: src/mosquitto_plugin.h + +src/CMakeFiles/mosquitto.dir/database.c.o: src/database.c +src/CMakeFiles/mosquitto.dir/database.c.o: config.h +src/CMakeFiles/mosquitto.dir/database.c.o: lib/dummypthread.h +src/CMakeFiles/mosquitto.dir/database.c.o: lib/memory_mosq.h +src/CMakeFiles/mosquitto.dir/database.c.o: lib/mosquitto.h +src/CMakeFiles/mosquitto.dir/database.c.o: lib/mosquitto_internal.h +src/CMakeFiles/mosquitto.dir/database.c.o: lib/net_mosq.h +src/CMakeFiles/mosquitto.dir/database.c.o: lib/send_mosq.h +src/CMakeFiles/mosquitto.dir/database.c.o: lib/time_mosq.h +src/CMakeFiles/mosquitto.dir/database.c.o: lib/tls_mosq.h +src/CMakeFiles/mosquitto.dir/database.c.o: src/mosquitto_broker.h +src/CMakeFiles/mosquitto.dir/database.c.o: src/mosquitto_plugin.h +src/CMakeFiles/mosquitto.dir/database.c.o: src/uthash.h + +src/CMakeFiles/mosquitto.dir/logging.c.o: src/logging.c +src/CMakeFiles/mosquitto.dir/logging.c.o: config.h +src/CMakeFiles/mosquitto.dir/logging.c.o: lib/dummypthread.h +src/CMakeFiles/mosquitto.dir/logging.c.o: lib/memory_mosq.h +src/CMakeFiles/mosquitto.dir/logging.c.o: lib/mosquitto.h +src/CMakeFiles/mosquitto.dir/logging.c.o: lib/mosquitto_internal.h +src/CMakeFiles/mosquitto.dir/logging.c.o: lib/net_mosq.h +src/CMakeFiles/mosquitto.dir/logging.c.o: lib/time_mosq.h +src/CMakeFiles/mosquitto.dir/logging.c.o: lib/tls_mosq.h +src/CMakeFiles/mosquitto.dir/logging.c.o: lib/util_mosq.h +src/CMakeFiles/mosquitto.dir/logging.c.o: src/mosquitto_broker.h +src/CMakeFiles/mosquitto.dir/logging.c.o: src/mosquitto_plugin.h +src/CMakeFiles/mosquitto.dir/logging.c.o: src/uthash.h + +src/CMakeFiles/mosquitto.dir/loop.c.o: src/loop.c +src/CMakeFiles/mosquitto.dir/loop.c.o: config.h +src/CMakeFiles/mosquitto.dir/loop.c.o: lib/dummypthread.h +src/CMakeFiles/mosquitto.dir/loop.c.o: lib/memory_mosq.h +src/CMakeFiles/mosquitto.dir/loop.c.o: lib/mosquitto.h +src/CMakeFiles/mosquitto.dir/loop.c.o: lib/mosquitto_internal.h +src/CMakeFiles/mosquitto.dir/loop.c.o: lib/net_mosq.h +src/CMakeFiles/mosquitto.dir/loop.c.o: lib/send_mosq.h +src/CMakeFiles/mosquitto.dir/loop.c.o: lib/time_mosq.h +src/CMakeFiles/mosquitto.dir/loop.c.o: lib/tls_mosq.h +src/CMakeFiles/mosquitto.dir/loop.c.o: lib/util_mosq.h +src/CMakeFiles/mosquitto.dir/loop.c.o: src/mosquitto_broker.h +src/CMakeFiles/mosquitto.dir/loop.c.o: src/mosquitto_plugin.h +src/CMakeFiles/mosquitto.dir/loop.c.o: src/uthash.h + +src/CMakeFiles/mosquitto.dir/mosquitto.c.o: src/mosquitto.c +src/CMakeFiles/mosquitto.dir/mosquitto.c.o: config.h +src/CMakeFiles/mosquitto.dir/mosquitto.c.o: lib/dummypthread.h +src/CMakeFiles/mosquitto.dir/mosquitto.c.o: lib/memory_mosq.h +src/CMakeFiles/mosquitto.dir/mosquitto.c.o: lib/mosquitto.h +src/CMakeFiles/mosquitto.dir/mosquitto.c.o: lib/mosquitto_internal.h +src/CMakeFiles/mosquitto.dir/mosquitto.c.o: lib/net_mosq.h +src/CMakeFiles/mosquitto.dir/mosquitto.c.o: lib/time_mosq.h +src/CMakeFiles/mosquitto.dir/mosquitto.c.o: lib/tls_mosq.h +src/CMakeFiles/mosquitto.dir/mosquitto.c.o: lib/util_mosq.h +src/CMakeFiles/mosquitto.dir/mosquitto.c.o: src/mosquitto_broker.h +src/CMakeFiles/mosquitto.dir/mosquitto.c.o: src/mosquitto_plugin.h +src/CMakeFiles/mosquitto.dir/mosquitto.c.o: src/uthash.h + +src/CMakeFiles/mosquitto.dir/net.c.o: src/net.c +src/CMakeFiles/mosquitto.dir/net.c.o: config.h +src/CMakeFiles/mosquitto.dir/net.c.o: lib/dummypthread.h +src/CMakeFiles/mosquitto.dir/net.c.o: lib/memory_mosq.h +src/CMakeFiles/mosquitto.dir/net.c.o: lib/mosquitto.h +src/CMakeFiles/mosquitto.dir/net.c.o: lib/mosquitto_internal.h +src/CMakeFiles/mosquitto.dir/net.c.o: lib/mqtt3_protocol.h +src/CMakeFiles/mosquitto.dir/net.c.o: lib/net_mosq.h +src/CMakeFiles/mosquitto.dir/net.c.o: lib/time_mosq.h +src/CMakeFiles/mosquitto.dir/net.c.o: lib/tls_mosq.h +src/CMakeFiles/mosquitto.dir/net.c.o: lib/util_mosq.h +src/CMakeFiles/mosquitto.dir/net.c.o: src/mosquitto_broker.h +src/CMakeFiles/mosquitto.dir/net.c.o: src/mosquitto_plugin.h +src/CMakeFiles/mosquitto.dir/net.c.o: src/uthash.h + +src/CMakeFiles/mosquitto.dir/persist.c.o: src/persist.c +src/CMakeFiles/mosquitto.dir/persist.c.o: config.h +src/CMakeFiles/mosquitto.dir/persist.c.o: lib/dummypthread.h +src/CMakeFiles/mosquitto.dir/persist.c.o: lib/memory_mosq.h +src/CMakeFiles/mosquitto.dir/persist.c.o: lib/mosquitto.h +src/CMakeFiles/mosquitto.dir/persist.c.o: lib/mosquitto_internal.h +src/CMakeFiles/mosquitto.dir/persist.c.o: lib/net_mosq.h +src/CMakeFiles/mosquitto.dir/persist.c.o: lib/time_mosq.h +src/CMakeFiles/mosquitto.dir/persist.c.o: lib/tls_mosq.h +src/CMakeFiles/mosquitto.dir/persist.c.o: lib/util_mosq.h +src/CMakeFiles/mosquitto.dir/persist.c.o: src/mosquitto_broker.h +src/CMakeFiles/mosquitto.dir/persist.c.o: src/mosquitto_plugin.h +src/CMakeFiles/mosquitto.dir/persist.c.o: src/persist.h +src/CMakeFiles/mosquitto.dir/persist.c.o: src/uthash.h + +src/CMakeFiles/mosquitto.dir/read_handle.c.o: src/read_handle.c +src/CMakeFiles/mosquitto.dir/read_handle.c.o: config.h +src/CMakeFiles/mosquitto.dir/read_handle.c.o: lib/dummypthread.h +src/CMakeFiles/mosquitto.dir/read_handle.c.o: lib/memory_mosq.h +src/CMakeFiles/mosquitto.dir/read_handle.c.o: lib/mosquitto.h +src/CMakeFiles/mosquitto.dir/read_handle.c.o: lib/mosquitto_internal.h +src/CMakeFiles/mosquitto.dir/read_handle.c.o: lib/mqtt3_protocol.h +src/CMakeFiles/mosquitto.dir/read_handle.c.o: lib/net_mosq.h +src/CMakeFiles/mosquitto.dir/read_handle.c.o: lib/read_handle.h +src/CMakeFiles/mosquitto.dir/read_handle.c.o: lib/send_mosq.h +src/CMakeFiles/mosquitto.dir/read_handle.c.o: lib/time_mosq.h +src/CMakeFiles/mosquitto.dir/read_handle.c.o: lib/tls_mosq.h +src/CMakeFiles/mosquitto.dir/read_handle.c.o: lib/util_mosq.h +src/CMakeFiles/mosquitto.dir/read_handle.c.o: src/mosquitto_broker.h +src/CMakeFiles/mosquitto.dir/read_handle.c.o: src/mosquitto_plugin.h +src/CMakeFiles/mosquitto.dir/read_handle.c.o: src/uthash.h + +src/CMakeFiles/mosquitto.dir/read_handle_client.c.o: src/read_handle_client.c +src/CMakeFiles/mosquitto.dir/read_handle_client.c.o: config.h +src/CMakeFiles/mosquitto.dir/read_handle_client.c.o: lib/dummypthread.h +src/CMakeFiles/mosquitto.dir/read_handle_client.c.o: lib/memory_mosq.h +src/CMakeFiles/mosquitto.dir/read_handle_client.c.o: lib/mosquitto.h +src/CMakeFiles/mosquitto.dir/read_handle_client.c.o: lib/mosquitto_internal.h +src/CMakeFiles/mosquitto.dir/read_handle_client.c.o: lib/mqtt3_protocol.h +src/CMakeFiles/mosquitto.dir/read_handle_client.c.o: lib/net_mosq.h +src/CMakeFiles/mosquitto.dir/read_handle_client.c.o: lib/send_mosq.h +src/CMakeFiles/mosquitto.dir/read_handle_client.c.o: lib/time_mosq.h +src/CMakeFiles/mosquitto.dir/read_handle_client.c.o: lib/tls_mosq.h +src/CMakeFiles/mosquitto.dir/read_handle_client.c.o: lib/util_mosq.h +src/CMakeFiles/mosquitto.dir/read_handle_client.c.o: src/mosquitto_broker.h +src/CMakeFiles/mosquitto.dir/read_handle_client.c.o: src/mosquitto_plugin.h +src/CMakeFiles/mosquitto.dir/read_handle_client.c.o: src/uthash.h + +src/CMakeFiles/mosquitto.dir/read_handle_server.c.o: src/read_handle_server.c +src/CMakeFiles/mosquitto.dir/read_handle_server.c.o: config.h +src/CMakeFiles/mosquitto.dir/read_handle_server.c.o: lib/dummypthread.h +src/CMakeFiles/mosquitto.dir/read_handle_server.c.o: lib/memory_mosq.h +src/CMakeFiles/mosquitto.dir/read_handle_server.c.o: lib/mosquitto.h +src/CMakeFiles/mosquitto.dir/read_handle_server.c.o: lib/mosquitto_internal.h +src/CMakeFiles/mosquitto.dir/read_handle_server.c.o: lib/mqtt3_protocol.h +src/CMakeFiles/mosquitto.dir/read_handle_server.c.o: lib/net_mosq.h +src/CMakeFiles/mosquitto.dir/read_handle_server.c.o: lib/send_mosq.h +src/CMakeFiles/mosquitto.dir/read_handle_server.c.o: lib/time_mosq.h +src/CMakeFiles/mosquitto.dir/read_handle_server.c.o: lib/tls_mosq.h +src/CMakeFiles/mosquitto.dir/read_handle_server.c.o: lib/util_mosq.h +src/CMakeFiles/mosquitto.dir/read_handle_server.c.o: src/mosquitto_broker.h +src/CMakeFiles/mosquitto.dir/read_handle_server.c.o: src/mosquitto_plugin.h +src/CMakeFiles/mosquitto.dir/read_handle_server.c.o: src/uthash.h + +src/CMakeFiles/mosquitto.dir/security.c.o: src/lib_load.h +src/CMakeFiles/mosquitto.dir/security.c.o: src/mosquitto_plugin.h +src/CMakeFiles/mosquitto.dir/security.c.o: src/security.c +src/CMakeFiles/mosquitto.dir/security.c.o: config.h +src/CMakeFiles/mosquitto.dir/security.c.o: lib/dummypthread.h +src/CMakeFiles/mosquitto.dir/security.c.o: lib/memory_mosq.h +src/CMakeFiles/mosquitto.dir/security.c.o: lib/mosquitto.h +src/CMakeFiles/mosquitto.dir/security.c.o: lib/mosquitto_internal.h +src/CMakeFiles/mosquitto.dir/security.c.o: lib/net_mosq.h +src/CMakeFiles/mosquitto.dir/security.c.o: lib/time_mosq.h +src/CMakeFiles/mosquitto.dir/security.c.o: lib/tls_mosq.h +src/CMakeFiles/mosquitto.dir/security.c.o: src/mosquitto_broker.h +src/CMakeFiles/mosquitto.dir/security.c.o: src/uthash.h + +src/CMakeFiles/mosquitto.dir/security_default.c.o: src/security_default.c +src/CMakeFiles/mosquitto.dir/security_default.c.o: config.h +src/CMakeFiles/mosquitto.dir/security_default.c.o: lib/dummypthread.h +src/CMakeFiles/mosquitto.dir/security_default.c.o: lib/memory_mosq.h +src/CMakeFiles/mosquitto.dir/security_default.c.o: lib/mosquitto.h +src/CMakeFiles/mosquitto.dir/security_default.c.o: lib/mosquitto_internal.h +src/CMakeFiles/mosquitto.dir/security_default.c.o: lib/net_mosq.h +src/CMakeFiles/mosquitto.dir/security_default.c.o: lib/time_mosq.h +src/CMakeFiles/mosquitto.dir/security_default.c.o: lib/tls_mosq.h +src/CMakeFiles/mosquitto.dir/security_default.c.o: lib/util_mosq.h +src/CMakeFiles/mosquitto.dir/security_default.c.o: src/mosquitto_broker.h +src/CMakeFiles/mosquitto.dir/security_default.c.o: src/mosquitto_plugin.h +src/CMakeFiles/mosquitto.dir/security_default.c.o: src/uthash.h + +src/CMakeFiles/mosquitto.dir/send_server.c.o: src/send_server.c +src/CMakeFiles/mosquitto.dir/send_server.c.o: config.h +src/CMakeFiles/mosquitto.dir/send_server.c.o: lib/dummypthread.h +src/CMakeFiles/mosquitto.dir/send_server.c.o: lib/memory_mosq.h +src/CMakeFiles/mosquitto.dir/send_server.c.o: lib/mosquitto.h +src/CMakeFiles/mosquitto.dir/send_server.c.o: lib/mosquitto_internal.h +src/CMakeFiles/mosquitto.dir/send_server.c.o: lib/mqtt3_protocol.h +src/CMakeFiles/mosquitto.dir/send_server.c.o: lib/net_mosq.h +src/CMakeFiles/mosquitto.dir/send_server.c.o: lib/time_mosq.h +src/CMakeFiles/mosquitto.dir/send_server.c.o: lib/tls_mosq.h +src/CMakeFiles/mosquitto.dir/send_server.c.o: lib/util_mosq.h +src/CMakeFiles/mosquitto.dir/send_server.c.o: src/mosquitto_broker.h +src/CMakeFiles/mosquitto.dir/send_server.c.o: src/mosquitto_plugin.h +src/CMakeFiles/mosquitto.dir/send_server.c.o: src/uthash.h + +src/CMakeFiles/mosquitto.dir/subs.c.o: src/subs.c +src/CMakeFiles/mosquitto.dir/subs.c.o: config.h +src/CMakeFiles/mosquitto.dir/subs.c.o: lib/dummypthread.h +src/CMakeFiles/mosquitto.dir/subs.c.o: lib/memory_mosq.h +src/CMakeFiles/mosquitto.dir/subs.c.o: lib/mosquitto.h +src/CMakeFiles/mosquitto.dir/subs.c.o: lib/mosquitto_internal.h +src/CMakeFiles/mosquitto.dir/subs.c.o: lib/net_mosq.h +src/CMakeFiles/mosquitto.dir/subs.c.o: lib/time_mosq.h +src/CMakeFiles/mosquitto.dir/subs.c.o: lib/tls_mosq.h +src/CMakeFiles/mosquitto.dir/subs.c.o: lib/util_mosq.h +src/CMakeFiles/mosquitto.dir/subs.c.o: src/mosquitto_broker.h +src/CMakeFiles/mosquitto.dir/subs.c.o: src/mosquitto_plugin.h +src/CMakeFiles/mosquitto.dir/subs.c.o: src/uthash.h + +src/CMakeFiles/mosquitto.dir/sys_tree.c.o: src/sys_tree.c +src/CMakeFiles/mosquitto.dir/sys_tree.c.o: config.h +src/CMakeFiles/mosquitto.dir/sys_tree.c.o: lib/dummypthread.h +src/CMakeFiles/mosquitto.dir/sys_tree.c.o: lib/memory_mosq.h +src/CMakeFiles/mosquitto.dir/sys_tree.c.o: lib/mosquitto.h +src/CMakeFiles/mosquitto.dir/sys_tree.c.o: lib/mosquitto_internal.h +src/CMakeFiles/mosquitto.dir/sys_tree.c.o: lib/net_mosq.h +src/CMakeFiles/mosquitto.dir/sys_tree.c.o: lib/time_mosq.h +src/CMakeFiles/mosquitto.dir/sys_tree.c.o: lib/tls_mosq.h +src/CMakeFiles/mosquitto.dir/sys_tree.c.o: src/mosquitto_broker.h +src/CMakeFiles/mosquitto.dir/sys_tree.c.o: src/mosquitto_plugin.h +src/CMakeFiles/mosquitto.dir/sys_tree.c.o: src/uthash.h + +src/CMakeFiles/mosquitto.dir/websockets.c.o: src/mosquitto_broker.h +src/CMakeFiles/mosquitto.dir/websockets.c.o: src/websockets.c +src/CMakeFiles/mosquitto.dir/websockets.c.o: config.h +src/CMakeFiles/mosquitto.dir/websockets.c.o: lib/dummypthread.h +src/CMakeFiles/mosquitto.dir/websockets.c.o: lib/memory_mosq.h +src/CMakeFiles/mosquitto.dir/websockets.c.o: lib/mosquitto.h +src/CMakeFiles/mosquitto.dir/websockets.c.o: lib/mosquitto_internal.h +src/CMakeFiles/mosquitto.dir/websockets.c.o: lib/mqtt3_protocol.h +src/CMakeFiles/mosquitto.dir/websockets.c.o: lib/net_mosq.h +src/CMakeFiles/mosquitto.dir/websockets.c.o: lib/time_mosq.h +src/CMakeFiles/mosquitto.dir/websockets.c.o: lib/tls_mosq.h +src/CMakeFiles/mosquitto.dir/websockets.c.o: src/mosquitto_plugin.h +src/CMakeFiles/mosquitto.dir/websockets.c.o: src/uthash.h + diff --git a/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/flags.make b/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/flags.make new file mode 100644 index 0000000..28ca479 --- /dev/null +++ b/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/flags.make @@ -0,0 +1,10 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.10 + +# compile C with /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc +C_FLAGS = -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk + +C_DEFINES = -DCMAKE -DTIMESTAMP="\"2018-01-23 10:58:26+0100\"" -DVERSION=\"1.4.14\" -DWITH_BRIDGE -DWITH_BROKER -DWITH_MEMORY_TRACKING -DWITH_PERSISTENCE -DWITH_SOCKS -DWITH_SYS_TREE + +C_INCLUDES = -I/Users/benjamin/orchestra/src/libs/mosquitto -I/Users/benjamin/orchestra/src/libs/mosquitto/src -I/Users/benjamin/orchestra/src/libs/mosquitto/lib + diff --git a/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/link.txt b/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/link.txt new file mode 100644 index 0000000..2498aee --- /dev/null +++ b/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/link.txt @@ -0,0 +1 @@ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -Wl,-exported_symbols_list -Wl,/Users/benjamin/orchestra/src/libs/mosquitto/src/linker-macosx.syms CMakeFiles/mosquitto.dir/conf.c.o CMakeFiles/mosquitto.dir/context.c.o CMakeFiles/mosquitto.dir/database.c.o CMakeFiles/mosquitto.dir/logging.c.o CMakeFiles/mosquitto.dir/loop.c.o CMakeFiles/mosquitto.dir/__/lib/memory_mosq.c.o CMakeFiles/mosquitto.dir/mosquitto.c.o CMakeFiles/mosquitto.dir/net.c.o CMakeFiles/mosquitto.dir/__/lib/net_mosq.c.o CMakeFiles/mosquitto.dir/persist.c.o CMakeFiles/mosquitto.dir/read_handle.c.o CMakeFiles/mosquitto.dir/read_handle_client.c.o CMakeFiles/mosquitto.dir/read_handle_server.c.o CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o CMakeFiles/mosquitto.dir/subs.c.o CMakeFiles/mosquitto.dir/security.c.o CMakeFiles/mosquitto.dir/security_default.c.o CMakeFiles/mosquitto.dir/__/lib/send_client_mosq.c.o CMakeFiles/mosquitto.dir/__/lib/send_mosq.c.o CMakeFiles/mosquitto.dir/send_server.c.o CMakeFiles/mosquitto.dir/sys_tree.c.o CMakeFiles/mosquitto.dir/__/lib/time_mosq.c.o CMakeFiles/mosquitto.dir/__/lib/tls_mosq.c.o CMakeFiles/mosquitto.dir/__/lib/util_mosq.c.o CMakeFiles/mosquitto.dir/websockets.c.o CMakeFiles/mosquitto.dir/__/lib/will_mosq.c.o CMakeFiles/mosquitto.dir/bridge.c.o -o mosquitto -ldl -lm diff --git a/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/progress.make b/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/progress.make new file mode 100644 index 0000000..3f5a260 --- /dev/null +++ b/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/progress.make @@ -0,0 +1,29 @@ +CMAKE_PROGRESS_1 = 19 +CMAKE_PROGRESS_2 = 20 +CMAKE_PROGRESS_3 = 21 +CMAKE_PROGRESS_4 = 22 +CMAKE_PROGRESS_5 = 23 +CMAKE_PROGRESS_6 = 24 +CMAKE_PROGRESS_7 = 25 +CMAKE_PROGRESS_8 = 26 +CMAKE_PROGRESS_9 = 27 +CMAKE_PROGRESS_10 = 28 +CMAKE_PROGRESS_11 = 29 +CMAKE_PROGRESS_12 = 30 +CMAKE_PROGRESS_13 = 31 +CMAKE_PROGRESS_14 = 32 +CMAKE_PROGRESS_15 = 33 +CMAKE_PROGRESS_16 = 34 +CMAKE_PROGRESS_17 = 35 +CMAKE_PROGRESS_18 = 36 +CMAKE_PROGRESS_19 = 37 +CMAKE_PROGRESS_20 = 38 +CMAKE_PROGRESS_21 = 39 +CMAKE_PROGRESS_22 = 40 +CMAKE_PROGRESS_23 = 41 +CMAKE_PROGRESS_24 = 42 +CMAKE_PROGRESS_25 = 43 +CMAKE_PROGRESS_26 = 44 +CMAKE_PROGRESS_27 = 45 +CMAKE_PROGRESS_28 = 46 + diff --git a/src/libs/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/DependInfo.cmake b/src/libs/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/DependInfo.cmake new file mode 100644 index 0000000..537aabe --- /dev/null +++ b/src/libs/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/DependInfo.cmake @@ -0,0 +1,40 @@ +# The set of languages for which implicit dependencies are needed: +set(CMAKE_DEPENDS_LANGUAGES + "C" + ) +# The set of files for implicit dependencies of each language: +set(CMAKE_DEPENDS_CHECK_C + "/Users/benjamin/orchestra/src/libs/mosquitto/src/mosquitto_passwd.c" "/Users/benjamin/orchestra/src/libs/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/mosquitto_passwd.c.o" + ) +set(CMAKE_C_COMPILER_ID "Clang") + +# Preprocessor definitions for this target. +set(CMAKE_TARGET_DEFINITIONS_C + "CMAKE" + "TIMESTAMP=\"2018-01-23 10:57:51+0100\"" + "VERSION=\"1.4.14\"" + "WITH_BRIDGE" + "WITH_BROKER" + "WITH_EC" + "WITH_MEMORY_TRACKING" + "WITH_PERSISTENCE" + "WITH_SOCKS" + "WITH_SYS_TREE" + "WITH_TLS" + "WITH_TLS_PSK" + ) + +# The include file search paths: +set(CMAKE_C_TARGET_INCLUDE_PATH + "." + "src" + "lib" + "/usr/local/include" + ) + +# Targets to which this target links. +set(CMAKE_TARGET_LINKED_INFO_FILES + ) + +# Fortran module output directory. +set(CMAKE_Fortran_TARGET_MODULE_DIR "") diff --git a/src/libs/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/build.make b/src/libs/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/build.make new file mode 100644 index 0000000..8784909 --- /dev/null +++ b/src/libs/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/build.make @@ -0,0 +1,115 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.10 + +# Delete rule output on recipe failure. +.DELETE_ON_ERROR: + + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + + +# Remove some rules from gmake that .SUFFIXES does not remove. +SUFFIXES = + +.SUFFIXES: .hpux_make_needs_suffix_list + + +# Suppress display of executed commands. +$(VERBOSE).SILENT: + + +# A target that is always out of date. +cmake_force: + +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/local/Cellar/cmake/3.10.1/bin/cmake + +# The command to remove a file. +RM = /usr/local/Cellar/cmake/3.10.1/bin/cmake -E remove -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /Users/benjamin/orchestra/src/libs/mosquitto + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /Users/benjamin/orchestra/src/libs/mosquitto + +# Include any dependencies generated for this target. +include src/CMakeFiles/mosquitto_passwd.dir/depend.make + +# Include the progress variables for this target. +include src/CMakeFiles/mosquitto_passwd.dir/progress.make + +# Include the compile flags for this target's objects. +include src/CMakeFiles/mosquitto_passwd.dir/flags.make + +src/CMakeFiles/mosquitto_passwd.dir/mosquitto_passwd.c.o: src/CMakeFiles/mosquitto_passwd.dir/flags.make +src/CMakeFiles/mosquitto_passwd.dir/mosquitto_passwd.c.o: src/mosquitto_passwd.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building C object src/CMakeFiles/mosquitto_passwd.dir/mosquitto_passwd.c.o" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/mosquitto_passwd.dir/mosquitto_passwd.c.o -c /Users/benjamin/orchestra/src/libs/mosquitto/src/mosquitto_passwd.c + +src/CMakeFiles/mosquitto_passwd.dir/mosquitto_passwd.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/mosquitto_passwd.dir/mosquitto_passwd.c.i" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/benjamin/orchestra/src/libs/mosquitto/src/mosquitto_passwd.c > CMakeFiles/mosquitto_passwd.dir/mosquitto_passwd.c.i + +src/CMakeFiles/mosquitto_passwd.dir/mosquitto_passwd.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/mosquitto_passwd.dir/mosquitto_passwd.c.s" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/benjamin/orchestra/src/libs/mosquitto/src/mosquitto_passwd.c -o CMakeFiles/mosquitto_passwd.dir/mosquitto_passwd.c.s + +src/CMakeFiles/mosquitto_passwd.dir/mosquitto_passwd.c.o.requires: + +.PHONY : src/CMakeFiles/mosquitto_passwd.dir/mosquitto_passwd.c.o.requires + +src/CMakeFiles/mosquitto_passwd.dir/mosquitto_passwd.c.o.provides: src/CMakeFiles/mosquitto_passwd.dir/mosquitto_passwd.c.o.requires + $(MAKE) -f src/CMakeFiles/mosquitto_passwd.dir/build.make src/CMakeFiles/mosquitto_passwd.dir/mosquitto_passwd.c.o.provides.build +.PHONY : src/CMakeFiles/mosquitto_passwd.dir/mosquitto_passwd.c.o.provides + +src/CMakeFiles/mosquitto_passwd.dir/mosquitto_passwd.c.o.provides.build: src/CMakeFiles/mosquitto_passwd.dir/mosquitto_passwd.c.o + + +# Object files for target mosquitto_passwd +mosquitto_passwd_OBJECTS = \ +"CMakeFiles/mosquitto_passwd.dir/mosquitto_passwd.c.o" + +# External object files for target mosquitto_passwd +mosquitto_passwd_EXTERNAL_OBJECTS = + +src/mosquitto_passwd: src/CMakeFiles/mosquitto_passwd.dir/mosquitto_passwd.c.o +src/mosquitto_passwd: src/CMakeFiles/mosquitto_passwd.dir/build.make +src/mosquitto_passwd: /usr/lib/libssl.dylib +src/mosquitto_passwd: /usr/lib/libcrypto.dylib +src/mosquitto_passwd: src/CMakeFiles/mosquitto_passwd.dir/link.txt + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Linking C executable mosquitto_passwd" + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/mosquitto_passwd.dir/link.txt --verbose=$(VERBOSE) + +# Rule to build all files generated by this target. +src/CMakeFiles/mosquitto_passwd.dir/build: src/mosquitto_passwd + +.PHONY : src/CMakeFiles/mosquitto_passwd.dir/build + +src/CMakeFiles/mosquitto_passwd.dir/requires: src/CMakeFiles/mosquitto_passwd.dir/mosquitto_passwd.c.o.requires + +.PHONY : src/CMakeFiles/mosquitto_passwd.dir/requires + +src/CMakeFiles/mosquitto_passwd.dir/clean: + cd /Users/benjamin/orchestra/src/libs/mosquitto/src && $(CMAKE_COMMAND) -P CMakeFiles/mosquitto_passwd.dir/cmake_clean.cmake +.PHONY : src/CMakeFiles/mosquitto_passwd.dir/clean + +src/CMakeFiles/mosquitto_passwd.dir/depend: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /Users/benjamin/orchestra/src/libs/mosquitto /Users/benjamin/orchestra/src/libs/mosquitto/src /Users/benjamin/orchestra/src/libs/mosquitto /Users/benjamin/orchestra/src/libs/mosquitto/src /Users/benjamin/orchestra/src/libs/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/DependInfo.cmake --color=$(COLOR) +.PHONY : src/CMakeFiles/mosquitto_passwd.dir/depend + diff --git a/src/libs/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/cmake_clean.cmake b/src/libs/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/cmake_clean.cmake new file mode 100644 index 0000000..c376fe0 --- /dev/null +++ b/src/libs/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/cmake_clean.cmake @@ -0,0 +1,10 @@ +file(REMOVE_RECURSE + "CMakeFiles/mosquitto_passwd.dir/mosquitto_passwd.c.o" + "mosquitto_passwd.pdb" + "mosquitto_passwd" +) + +# Per-language clean rules from dependency scanning. +foreach(lang C) + include(CMakeFiles/mosquitto_passwd.dir/cmake_clean_${lang}.cmake OPTIONAL) +endforeach() diff --git a/src/libs/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/depend.make b/src/libs/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/depend.make new file mode 100644 index 0000000..8b4ff6b --- /dev/null +++ b/src/libs/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/depend.make @@ -0,0 +1,2 @@ +# Empty dependencies file for mosquitto_passwd. +# This may be replaced when dependencies are built. diff --git a/src/libs/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/flags.make b/src/libs/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/flags.make new file mode 100644 index 0000000..016abee --- /dev/null +++ b/src/libs/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/flags.make @@ -0,0 +1,10 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.10 + +# compile C with /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc +C_FLAGS = -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk + +C_DEFINES = -DCMAKE -DTIMESTAMP="\"2018-01-23 10:57:51+0100\"" -DVERSION=\"1.4.14\" -DWITH_BRIDGE -DWITH_BROKER -DWITH_EC -DWITH_MEMORY_TRACKING -DWITH_PERSISTENCE -DWITH_SOCKS -DWITH_SYS_TREE -DWITH_TLS -DWITH_TLS_PSK + +C_INCLUDES = -I/Users/benjamin/orchestra/src/libs/mosquitto -I/Users/benjamin/orchestra/src/libs/mosquitto/src -I/Users/benjamin/orchestra/src/libs/mosquitto/lib -I/usr/local/include + diff --git a/src/libs/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/link.txt b/src/libs/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/link.txt new file mode 100644 index 0000000..3274d44 --- /dev/null +++ b/src/libs/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/link.txt @@ -0,0 +1 @@ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/mosquitto_passwd.dir/mosquitto_passwd.c.o -o mosquitto_passwd /usr/lib/libssl.dylib /usr/lib/libcrypto.dylib diff --git a/src/libs/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/progress.make b/src/libs/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/progress.make new file mode 100644 index 0000000..ab595e5 --- /dev/null +++ b/src/libs/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/progress.make @@ -0,0 +1,3 @@ +CMAKE_PROGRESS_1 = 47 +CMAKE_PROGRESS_2 = 48 + diff --git a/src/libs/mosquitto/src/CMakeFiles/progress.marks b/src/libs/mosquitto/src/CMakeFiles/progress.marks new file mode 100644 index 0000000..9902f17 --- /dev/null +++ b/src/libs/mosquitto/src/CMakeFiles/progress.marks @@ -0,0 +1 @@ +28 diff --git a/src/libs/mosquitto/src/CMakeLists.txt b/src/libs/mosquitto/src/CMakeLists.txt new file mode 100644 index 0000000..6918ac2 --- /dev/null +++ b/src/libs/mosquitto/src/CMakeLists.txt @@ -0,0 +1,146 @@ +include_directories(${mosquitto_SOURCE_DIR} ${mosquitto_SOURCE_DIR}/src + ${mosquitto_SOURCE_DIR}/lib ${OPENSSL_INCLUDE_DIR} + ${STDBOOL_H_PATH} ${STDINT_H_PATH}) + +set (MOSQ_SRCS + conf.c + context.c + database.c + lib_load.h + logging.c + loop.c + ../lib/memory_mosq.c ../lib/memory_mosq.h + mosquitto.c + mosquitto_broker.h + net.c + ../lib/net_mosq.c ../lib/net_mosq.h + persist.c persist.h + read_handle.c read_handle_client.c read_handle_server.c + ../lib/read_handle_shared.c ../lib/read_handle.h + subs.c + security.c security_default.c + ../lib/send_client_mosq.c ../lib/send_mosq.h + ../lib/send_mosq.c ../lib/send_mosq.h + send_server.c + sys_tree.c + ../lib/time_mosq.c + ../lib/tls_mosq.c + ../lib/util_mosq.c ../lib/util_mosq.h + websockets.c + ../lib/will_mosq.c ../lib/will_mosq.h) + +option(INC_BRIDGE_SUPPORT + "Include bridge support for connecting to other brokers?" ON) +if (${INC_BRIDGE_SUPPORT} STREQUAL ON) + set (MOSQ_SRCS ${MOSQ_SRCS} bridge.c) + add_definitions("-DWITH_BRIDGE") +endif (${INC_BRIDGE_SUPPORT} STREQUAL ON) + + +option(USE_LIBWRAP + "Include tcp-wrappers support?" OFF) + +if (${USE_LIBWRAP} STREQUAL ON) + set (MOSQ_LIBS ${MOSQ_LIBS} wrap) + add_definitions("-DWITH_WRAP") +endif (${USE_LIBWRAP} STREQUAL ON) + +option(INC_DB_UPGRADE + "Include database upgrade support? (recommended)" ON) + +option(INC_MEMTRACK + "Include memory tracking support?" ON) +if (${INC_MEMTRACK} STREQUAL ON) + add_definitions("-DWITH_MEMORY_TRACKING") +endif (${INC_MEMTRACK} STREQUAL ON) + +option(WITH_PERSISTENCE + "Include persistence support?" ON) +if (${WITH_PERSISTENCE} STREQUAL ON) + add_definitions("-DWITH_PERSISTENCE") +endif (${WITH_PERSISTENCE} STREQUAL ON) + +option(WITH_SYS_TREE + "Include $SYS tree support?" ON) +if (${WITH_SYS_TREE} STREQUAL ON) + add_definitions("-DWITH_SYS_TREE") +endif (${WITH_SYS_TREE} STREQUAL ON) + +option(WITH_WEBSOCKETS + "Include websockets support?" OFF) +if (${WITH_WEBSOCKETS} STREQUAL ON) + add_definitions("-DWITH_WEBSOCKETS") +endif (${WITH_WEBSOCKETS} STREQUAL ON) + +if (WIN32 OR CYGWIN) + set (MOSQ_SRCS ${MOSQ_SRCS} service.c) +endif (WIN32 OR CYGWIN) + +add_definitions (-DWITH_BROKER) + +add_executable(mosquitto ${MOSQ_SRCS}) + +set (MOSQ_LIBS ${MOSQ_LIBS} ${OPENSSL_LIBRARIES}) + +# Check for getaddrinfo_a +include(CheckLibraryExists) +check_library_exists(anl getaddrinfo_a "" HAVE_GETADDRINFO_A) +if (HAVE_GETADDRINFO_A) + add_definitions(-DHAVE_GETADDRINFO_A) + set (MOSQ_LIBS ${MOSQ_LIBS} anl) +endif (HAVE_GETADDRINFO_A) + + + +if (UNIX) + if (APPLE) + set (MOSQ_LIBS ${MOSQ_LIBS} dl m) + else (APPLE) + set (MOSQ_LIBS ${MOSQ_LIBS} dl m) + find_library(LIBRT rt) + if (LIBRT) + set (MOSQ_LIBS ${MOSQ_LIBS} rt) + endif (LIBRT) + endif (APPLE) +endif (UNIX) + +if (WIN32) + set (MOSQ_LIBS ${MOSQ_LIBS} ws2_32) +endif (WIN32) + +if (${WITH_WEBSOCKETS} STREQUAL ON) + set (MOSQ_LIBS ${MOSQ_LIBS} websockets) +endif (${WITH_WEBSOCKETS} STREQUAL ON) + +# Simple detect libuuid +if(NOT APPLE) + FIND_PATH(UUID_HEADER uuid/uuid.h) + if (UUID_HEADER) + add_definitions(-DWITH_UUID) + set (MOSQ_LIBS ${MOSQ_LIBS} uuid) + endif (UUID_HEADER) +endif(NOT APPLE) + +target_link_libraries(mosquitto ${MOSQ_LIBS}) + +if (UNIX) + if (APPLE) + set_target_properties(mosquitto PROPERTIES LINK_FLAGS "-Wl,-exported_symbols_list -Wl,${mosquitto_SOURCE_DIR}/src/linker-macosx.syms") + else (APPLE) + set_target_properties(mosquitto PROPERTIES LINK_FLAGS "-Wl,-dynamic-list=${mosquitto_SOURCE_DIR}/src/linker.syms") + endif (APPLE) +endif (UNIX) + +install(TARGETS mosquitto RUNTIME DESTINATION "${SBINDIR}" LIBRARY DESTINATION "${LIBDIR}") +install(FILES mosquitto_plugin.h DESTINATION "${INCLUDEDIR}") + +if (${WITH_TLS} STREQUAL ON) + add_executable(mosquitto_passwd mosquitto_passwd.c) + target_link_libraries(mosquitto_passwd "${OPENSSL_LIBRARIES}") + install(TARGETS mosquitto_passwd RUNTIME DESTINATION "${BINDIR}" LIBRARY DESTINATION "${LIBDIR}") +endif (${WITH_TLS} STREQUAL ON) + +if (UNIX) + install(CODE "EXEC_PROGRAM(/sbin/ldconfig)") +endif (UNIX) + diff --git a/src/libs/mosquitto/src/Makefile b/src/libs/mosquitto/src/Makefile new file mode 100644 index 0000000..a43a731 --- /dev/null +++ b/src/libs/mosquitto/src/Makefile @@ -0,0 +1,1010 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.10 + +# Default target executed when no arguments are given to make. +default_target: all + +.PHONY : default_target + +# Allow only one "make -f Makefile2" at a time, but pass parallelism. +.NOTPARALLEL: + + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + + +# Remove some rules from gmake that .SUFFIXES does not remove. +SUFFIXES = + +.SUFFIXES: .hpux_make_needs_suffix_list + + +# Suppress display of executed commands. +$(VERBOSE).SILENT: + + +# A target that is always out of date. +cmake_force: + +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/local/Cellar/cmake/3.10.1/bin/cmake + +# The command to remove a file. +RM = /usr/local/Cellar/cmake/3.10.1/bin/cmake -E remove -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /Users/benjamin/orchestra/src/libs/mosquitto + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /Users/benjamin/orchestra/src/libs/mosquitto + +#============================================================================= +# Targets provided globally by CMake. + +# Special rule for the target install/local +install/local: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake +.PHONY : install/local + +# Special rule for the target install/local +install/local/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake +.PHONY : install/local/fast + +# Special rule for the target rebuild_cache +rebuild_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : rebuild_cache + +# Special rule for the target rebuild_cache +rebuild_cache/fast: rebuild_cache + +.PHONY : rebuild_cache/fast + +# Special rule for the target edit_cache +edit_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." + /usr/local/Cellar/cmake/3.10.1/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : edit_cache + +# Special rule for the target edit_cache +edit_cache/fast: edit_cache + +.PHONY : edit_cache/fast + +# Special rule for the target install/strip +install/strip: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake +.PHONY : install/strip + +# Special rule for the target install/strip +install/strip/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake +.PHONY : install/strip/fast + +# Special rule for the target install +install: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -P cmake_install.cmake +.PHONY : install + +# Special rule for the target install +install/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." + /usr/local/Cellar/cmake/3.10.1/bin/cmake -P cmake_install.cmake +.PHONY : install/fast + +# Special rule for the target list_install_components +list_install_components: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\"" +.PHONY : list_install_components + +# Special rule for the target list_install_components +list_install_components/fast: list_install_components + +.PHONY : list_install_components/fast + +# The main all target +all: cmake_check_build_system + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(CMAKE_COMMAND) -E cmake_progress_start /Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles /Users/benjamin/orchestra/src/libs/mosquitto/src/CMakeFiles/progress.marks + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f CMakeFiles/Makefile2 src/all + $(CMAKE_COMMAND) -E cmake_progress_start /Users/benjamin/orchestra/src/libs/mosquitto/CMakeFiles 0 +.PHONY : all + +# The main clean target +clean: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f CMakeFiles/Makefile2 src/clean +.PHONY : clean + +# The main clean target +clean/fast: clean + +.PHONY : clean/fast + +# Prepare targets for installation. +preinstall: all + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f CMakeFiles/Makefile2 src/preinstall +.PHONY : preinstall + +# Prepare targets for installation. +preinstall/fast: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f CMakeFiles/Makefile2 src/preinstall +.PHONY : preinstall/fast + +# clear depends +depend: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 +.PHONY : depend + +# Convenience name for target. +src/CMakeFiles/mosquitto.dir/rule: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f CMakeFiles/Makefile2 src/CMakeFiles/mosquitto.dir/rule +.PHONY : src/CMakeFiles/mosquitto.dir/rule + +# Convenience name for target. +mosquitto: src/CMakeFiles/mosquitto.dir/rule + +.PHONY : mosquitto + +# fast build rule for target. +mosquitto/fast: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/build +.PHONY : mosquitto/fast + +__/lib/memory_mosq.o: __/lib/memory_mosq.c.o + +.PHONY : __/lib/memory_mosq.o + +# target to build an object file +__/lib/memory_mosq.c.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/__/lib/memory_mosq.c.o +.PHONY : __/lib/memory_mosq.c.o + +__/lib/memory_mosq.i: __/lib/memory_mosq.c.i + +.PHONY : __/lib/memory_mosq.i + +# target to preprocess a source file +__/lib/memory_mosq.c.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/__/lib/memory_mosq.c.i +.PHONY : __/lib/memory_mosq.c.i + +__/lib/memory_mosq.s: __/lib/memory_mosq.c.s + +.PHONY : __/lib/memory_mosq.s + +# target to generate assembly for a file +__/lib/memory_mosq.c.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/__/lib/memory_mosq.c.s +.PHONY : __/lib/memory_mosq.c.s + +__/lib/net_mosq.o: __/lib/net_mosq.c.o + +.PHONY : __/lib/net_mosq.o + +# target to build an object file +__/lib/net_mosq.c.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/__/lib/net_mosq.c.o +.PHONY : __/lib/net_mosq.c.o + +__/lib/net_mosq.i: __/lib/net_mosq.c.i + +.PHONY : __/lib/net_mosq.i + +# target to preprocess a source file +__/lib/net_mosq.c.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/__/lib/net_mosq.c.i +.PHONY : __/lib/net_mosq.c.i + +__/lib/net_mosq.s: __/lib/net_mosq.c.s + +.PHONY : __/lib/net_mosq.s + +# target to generate assembly for a file +__/lib/net_mosq.c.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/__/lib/net_mosq.c.s +.PHONY : __/lib/net_mosq.c.s + +__/lib/read_handle_shared.o: __/lib/read_handle_shared.c.o + +.PHONY : __/lib/read_handle_shared.o + +# target to build an object file +__/lib/read_handle_shared.c.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o +.PHONY : __/lib/read_handle_shared.c.o + +__/lib/read_handle_shared.i: __/lib/read_handle_shared.c.i + +.PHONY : __/lib/read_handle_shared.i + +# target to preprocess a source file +__/lib/read_handle_shared.c.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.i +.PHONY : __/lib/read_handle_shared.c.i + +__/lib/read_handle_shared.s: __/lib/read_handle_shared.c.s + +.PHONY : __/lib/read_handle_shared.s + +# target to generate assembly for a file +__/lib/read_handle_shared.c.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.s +.PHONY : __/lib/read_handle_shared.c.s + +__/lib/send_client_mosq.o: __/lib/send_client_mosq.c.o + +.PHONY : __/lib/send_client_mosq.o + +# target to build an object file +__/lib/send_client_mosq.c.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/__/lib/send_client_mosq.c.o +.PHONY : __/lib/send_client_mosq.c.o + +__/lib/send_client_mosq.i: __/lib/send_client_mosq.c.i + +.PHONY : __/lib/send_client_mosq.i + +# target to preprocess a source file +__/lib/send_client_mosq.c.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/__/lib/send_client_mosq.c.i +.PHONY : __/lib/send_client_mosq.c.i + +__/lib/send_client_mosq.s: __/lib/send_client_mosq.c.s + +.PHONY : __/lib/send_client_mosq.s + +# target to generate assembly for a file +__/lib/send_client_mosq.c.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/__/lib/send_client_mosq.c.s +.PHONY : __/lib/send_client_mosq.c.s + +__/lib/send_mosq.o: __/lib/send_mosq.c.o + +.PHONY : __/lib/send_mosq.o + +# target to build an object file +__/lib/send_mosq.c.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/__/lib/send_mosq.c.o +.PHONY : __/lib/send_mosq.c.o + +__/lib/send_mosq.i: __/lib/send_mosq.c.i + +.PHONY : __/lib/send_mosq.i + +# target to preprocess a source file +__/lib/send_mosq.c.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/__/lib/send_mosq.c.i +.PHONY : __/lib/send_mosq.c.i + +__/lib/send_mosq.s: __/lib/send_mosq.c.s + +.PHONY : __/lib/send_mosq.s + +# target to generate assembly for a file +__/lib/send_mosq.c.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/__/lib/send_mosq.c.s +.PHONY : __/lib/send_mosq.c.s + +__/lib/time_mosq.o: __/lib/time_mosq.c.o + +.PHONY : __/lib/time_mosq.o + +# target to build an object file +__/lib/time_mosq.c.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/__/lib/time_mosq.c.o +.PHONY : __/lib/time_mosq.c.o + +__/lib/time_mosq.i: __/lib/time_mosq.c.i + +.PHONY : __/lib/time_mosq.i + +# target to preprocess a source file +__/lib/time_mosq.c.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/__/lib/time_mosq.c.i +.PHONY : __/lib/time_mosq.c.i + +__/lib/time_mosq.s: __/lib/time_mosq.c.s + +.PHONY : __/lib/time_mosq.s + +# target to generate assembly for a file +__/lib/time_mosq.c.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/__/lib/time_mosq.c.s +.PHONY : __/lib/time_mosq.c.s + +__/lib/tls_mosq.o: __/lib/tls_mosq.c.o + +.PHONY : __/lib/tls_mosq.o + +# target to build an object file +__/lib/tls_mosq.c.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/__/lib/tls_mosq.c.o +.PHONY : __/lib/tls_mosq.c.o + +__/lib/tls_mosq.i: __/lib/tls_mosq.c.i + +.PHONY : __/lib/tls_mosq.i + +# target to preprocess a source file +__/lib/tls_mosq.c.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/__/lib/tls_mosq.c.i +.PHONY : __/lib/tls_mosq.c.i + +__/lib/tls_mosq.s: __/lib/tls_mosq.c.s + +.PHONY : __/lib/tls_mosq.s + +# target to generate assembly for a file +__/lib/tls_mosq.c.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/__/lib/tls_mosq.c.s +.PHONY : __/lib/tls_mosq.c.s + +__/lib/util_mosq.o: __/lib/util_mosq.c.o + +.PHONY : __/lib/util_mosq.o + +# target to build an object file +__/lib/util_mosq.c.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/__/lib/util_mosq.c.o +.PHONY : __/lib/util_mosq.c.o + +__/lib/util_mosq.i: __/lib/util_mosq.c.i + +.PHONY : __/lib/util_mosq.i + +# target to preprocess a source file +__/lib/util_mosq.c.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/__/lib/util_mosq.c.i +.PHONY : __/lib/util_mosq.c.i + +__/lib/util_mosq.s: __/lib/util_mosq.c.s + +.PHONY : __/lib/util_mosq.s + +# target to generate assembly for a file +__/lib/util_mosq.c.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/__/lib/util_mosq.c.s +.PHONY : __/lib/util_mosq.c.s + +__/lib/will_mosq.o: __/lib/will_mosq.c.o + +.PHONY : __/lib/will_mosq.o + +# target to build an object file +__/lib/will_mosq.c.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/__/lib/will_mosq.c.o +.PHONY : __/lib/will_mosq.c.o + +__/lib/will_mosq.i: __/lib/will_mosq.c.i + +.PHONY : __/lib/will_mosq.i + +# target to preprocess a source file +__/lib/will_mosq.c.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/__/lib/will_mosq.c.i +.PHONY : __/lib/will_mosq.c.i + +__/lib/will_mosq.s: __/lib/will_mosq.c.s + +.PHONY : __/lib/will_mosq.s + +# target to generate assembly for a file +__/lib/will_mosq.c.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/__/lib/will_mosq.c.s +.PHONY : __/lib/will_mosq.c.s + +bridge.o: bridge.c.o + +.PHONY : bridge.o + +# target to build an object file +bridge.c.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/bridge.c.o +.PHONY : bridge.c.o + +bridge.i: bridge.c.i + +.PHONY : bridge.i + +# target to preprocess a source file +bridge.c.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/bridge.c.i +.PHONY : bridge.c.i + +bridge.s: bridge.c.s + +.PHONY : bridge.s + +# target to generate assembly for a file +bridge.c.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/bridge.c.s +.PHONY : bridge.c.s + +conf.o: conf.c.o + +.PHONY : conf.o + +# target to build an object file +conf.c.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/conf.c.o +.PHONY : conf.c.o + +conf.i: conf.c.i + +.PHONY : conf.i + +# target to preprocess a source file +conf.c.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/conf.c.i +.PHONY : conf.c.i + +conf.s: conf.c.s + +.PHONY : conf.s + +# target to generate assembly for a file +conf.c.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/conf.c.s +.PHONY : conf.c.s + +context.o: context.c.o + +.PHONY : context.o + +# target to build an object file +context.c.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/context.c.o +.PHONY : context.c.o + +context.i: context.c.i + +.PHONY : context.i + +# target to preprocess a source file +context.c.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/context.c.i +.PHONY : context.c.i + +context.s: context.c.s + +.PHONY : context.s + +# target to generate assembly for a file +context.c.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/context.c.s +.PHONY : context.c.s + +database.o: database.c.o + +.PHONY : database.o + +# target to build an object file +database.c.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/database.c.o +.PHONY : database.c.o + +database.i: database.c.i + +.PHONY : database.i + +# target to preprocess a source file +database.c.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/database.c.i +.PHONY : database.c.i + +database.s: database.c.s + +.PHONY : database.s + +# target to generate assembly for a file +database.c.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/database.c.s +.PHONY : database.c.s + +logging.o: logging.c.o + +.PHONY : logging.o + +# target to build an object file +logging.c.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/logging.c.o +.PHONY : logging.c.o + +logging.i: logging.c.i + +.PHONY : logging.i + +# target to preprocess a source file +logging.c.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/logging.c.i +.PHONY : logging.c.i + +logging.s: logging.c.s + +.PHONY : logging.s + +# target to generate assembly for a file +logging.c.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/logging.c.s +.PHONY : logging.c.s + +loop.o: loop.c.o + +.PHONY : loop.o + +# target to build an object file +loop.c.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/loop.c.o +.PHONY : loop.c.o + +loop.i: loop.c.i + +.PHONY : loop.i + +# target to preprocess a source file +loop.c.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/loop.c.i +.PHONY : loop.c.i + +loop.s: loop.c.s + +.PHONY : loop.s + +# target to generate assembly for a file +loop.c.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/loop.c.s +.PHONY : loop.c.s + +mosquitto.o: mosquitto.c.o + +.PHONY : mosquitto.o + +# target to build an object file +mosquitto.c.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/mosquitto.c.o +.PHONY : mosquitto.c.o + +mosquitto.i: mosquitto.c.i + +.PHONY : mosquitto.i + +# target to preprocess a source file +mosquitto.c.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/mosquitto.c.i +.PHONY : mosquitto.c.i + +mosquitto.s: mosquitto.c.s + +.PHONY : mosquitto.s + +# target to generate assembly for a file +mosquitto.c.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/mosquitto.c.s +.PHONY : mosquitto.c.s + +net.o: net.c.o + +.PHONY : net.o + +# target to build an object file +net.c.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/net.c.o +.PHONY : net.c.o + +net.i: net.c.i + +.PHONY : net.i + +# target to preprocess a source file +net.c.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/net.c.i +.PHONY : net.c.i + +net.s: net.c.s + +.PHONY : net.s + +# target to generate assembly for a file +net.c.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/net.c.s +.PHONY : net.c.s + +persist.o: persist.c.o + +.PHONY : persist.o + +# target to build an object file +persist.c.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/persist.c.o +.PHONY : persist.c.o + +persist.i: persist.c.i + +.PHONY : persist.i + +# target to preprocess a source file +persist.c.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/persist.c.i +.PHONY : persist.c.i + +persist.s: persist.c.s + +.PHONY : persist.s + +# target to generate assembly for a file +persist.c.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/persist.c.s +.PHONY : persist.c.s + +read_handle.o: read_handle.c.o + +.PHONY : read_handle.o + +# target to build an object file +read_handle.c.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/read_handle.c.o +.PHONY : read_handle.c.o + +read_handle.i: read_handle.c.i + +.PHONY : read_handle.i + +# target to preprocess a source file +read_handle.c.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/read_handle.c.i +.PHONY : read_handle.c.i + +read_handle.s: read_handle.c.s + +.PHONY : read_handle.s + +# target to generate assembly for a file +read_handle.c.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/read_handle.c.s +.PHONY : read_handle.c.s + +read_handle_client.o: read_handle_client.c.o + +.PHONY : read_handle_client.o + +# target to build an object file +read_handle_client.c.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/read_handle_client.c.o +.PHONY : read_handle_client.c.o + +read_handle_client.i: read_handle_client.c.i + +.PHONY : read_handle_client.i + +# target to preprocess a source file +read_handle_client.c.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/read_handle_client.c.i +.PHONY : read_handle_client.c.i + +read_handle_client.s: read_handle_client.c.s + +.PHONY : read_handle_client.s + +# target to generate assembly for a file +read_handle_client.c.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/read_handle_client.c.s +.PHONY : read_handle_client.c.s + +read_handle_server.o: read_handle_server.c.o + +.PHONY : read_handle_server.o + +# target to build an object file +read_handle_server.c.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/read_handle_server.c.o +.PHONY : read_handle_server.c.o + +read_handle_server.i: read_handle_server.c.i + +.PHONY : read_handle_server.i + +# target to preprocess a source file +read_handle_server.c.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/read_handle_server.c.i +.PHONY : read_handle_server.c.i + +read_handle_server.s: read_handle_server.c.s + +.PHONY : read_handle_server.s + +# target to generate assembly for a file +read_handle_server.c.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/read_handle_server.c.s +.PHONY : read_handle_server.c.s + +security.o: security.c.o + +.PHONY : security.o + +# target to build an object file +security.c.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/security.c.o +.PHONY : security.c.o + +security.i: security.c.i + +.PHONY : security.i + +# target to preprocess a source file +security.c.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/security.c.i +.PHONY : security.c.i + +security.s: security.c.s + +.PHONY : security.s + +# target to generate assembly for a file +security.c.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/security.c.s +.PHONY : security.c.s + +security_default.o: security_default.c.o + +.PHONY : security_default.o + +# target to build an object file +security_default.c.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/security_default.c.o +.PHONY : security_default.c.o + +security_default.i: security_default.c.i + +.PHONY : security_default.i + +# target to preprocess a source file +security_default.c.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/security_default.c.i +.PHONY : security_default.c.i + +security_default.s: security_default.c.s + +.PHONY : security_default.s + +# target to generate assembly for a file +security_default.c.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/security_default.c.s +.PHONY : security_default.c.s + +send_server.o: send_server.c.o + +.PHONY : send_server.o + +# target to build an object file +send_server.c.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/send_server.c.o +.PHONY : send_server.c.o + +send_server.i: send_server.c.i + +.PHONY : send_server.i + +# target to preprocess a source file +send_server.c.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/send_server.c.i +.PHONY : send_server.c.i + +send_server.s: send_server.c.s + +.PHONY : send_server.s + +# target to generate assembly for a file +send_server.c.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/send_server.c.s +.PHONY : send_server.c.s + +subs.o: subs.c.o + +.PHONY : subs.o + +# target to build an object file +subs.c.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/subs.c.o +.PHONY : subs.c.o + +subs.i: subs.c.i + +.PHONY : subs.i + +# target to preprocess a source file +subs.c.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/subs.c.i +.PHONY : subs.c.i + +subs.s: subs.c.s + +.PHONY : subs.s + +# target to generate assembly for a file +subs.c.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/subs.c.s +.PHONY : subs.c.s + +sys_tree.o: sys_tree.c.o + +.PHONY : sys_tree.o + +# target to build an object file +sys_tree.c.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/sys_tree.c.o +.PHONY : sys_tree.c.o + +sys_tree.i: sys_tree.c.i + +.PHONY : sys_tree.i + +# target to preprocess a source file +sys_tree.c.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/sys_tree.c.i +.PHONY : sys_tree.c.i + +sys_tree.s: sys_tree.c.s + +.PHONY : sys_tree.s + +# target to generate assembly for a file +sys_tree.c.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/sys_tree.c.s +.PHONY : sys_tree.c.s + +websockets.o: websockets.c.o + +.PHONY : websockets.o + +# target to build an object file +websockets.c.o: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/websockets.c.o +.PHONY : websockets.c.o + +websockets.i: websockets.c.i + +.PHONY : websockets.i + +# target to preprocess a source file +websockets.c.i: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/websockets.c.i +.PHONY : websockets.c.i + +websockets.s: websockets.c.s + +.PHONY : websockets.s + +# target to generate assembly for a file +websockets.c.s: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(MAKE) -f src/CMakeFiles/mosquitto.dir/build.make src/CMakeFiles/mosquitto.dir/websockets.c.s +.PHONY : websockets.c.s + +# Help Target +help: + @echo "The following are some of the valid targets for this Makefile:" + @echo "... all (the default if no target is provided)" + @echo "... clean" + @echo "... depend" + @echo "... install/local" + @echo "... rebuild_cache" + @echo "... edit_cache" + @echo "... install/strip" + @echo "... install" + @echo "... list_install_components" + @echo "... mosquitto" + @echo "... __/lib/memory_mosq.o" + @echo "... __/lib/memory_mosq.i" + @echo "... __/lib/memory_mosq.s" + @echo "... __/lib/net_mosq.o" + @echo "... __/lib/net_mosq.i" + @echo "... __/lib/net_mosq.s" + @echo "... __/lib/read_handle_shared.o" + @echo "... __/lib/read_handle_shared.i" + @echo "... __/lib/read_handle_shared.s" + @echo "... __/lib/send_client_mosq.o" + @echo "... __/lib/send_client_mosq.i" + @echo "... __/lib/send_client_mosq.s" + @echo "... __/lib/send_mosq.o" + @echo "... __/lib/send_mosq.i" + @echo "... __/lib/send_mosq.s" + @echo "... __/lib/time_mosq.o" + @echo "... __/lib/time_mosq.i" + @echo "... __/lib/time_mosq.s" + @echo "... __/lib/tls_mosq.o" + @echo "... __/lib/tls_mosq.i" + @echo "... __/lib/tls_mosq.s" + @echo "... __/lib/util_mosq.o" + @echo "... __/lib/util_mosq.i" + @echo "... __/lib/util_mosq.s" + @echo "... __/lib/will_mosq.o" + @echo "... __/lib/will_mosq.i" + @echo "... __/lib/will_mosq.s" + @echo "... bridge.o" + @echo "... bridge.i" + @echo "... bridge.s" + @echo "... conf.o" + @echo "... conf.i" + @echo "... conf.s" + @echo "... context.o" + @echo "... context.i" + @echo "... context.s" + @echo "... database.o" + @echo "... database.i" + @echo "... database.s" + @echo "... logging.o" + @echo "... logging.i" + @echo "... logging.s" + @echo "... loop.o" + @echo "... loop.i" + @echo "... loop.s" + @echo "... mosquitto.o" + @echo "... mosquitto.i" + @echo "... mosquitto.s" + @echo "... net.o" + @echo "... net.i" + @echo "... net.s" + @echo "... persist.o" + @echo "... persist.i" + @echo "... persist.s" + @echo "... read_handle.o" + @echo "... read_handle.i" + @echo "... read_handle.s" + @echo "... read_handle_client.o" + @echo "... read_handle_client.i" + @echo "... read_handle_client.s" + @echo "... read_handle_server.o" + @echo "... read_handle_server.i" + @echo "... read_handle_server.s" + @echo "... security.o" + @echo "... security.i" + @echo "... security.s" + @echo "... security_default.o" + @echo "... security_default.i" + @echo "... security_default.s" + @echo "... send_server.o" + @echo "... send_server.i" + @echo "... send_server.s" + @echo "... subs.o" + @echo "... subs.i" + @echo "... subs.s" + @echo "... sys_tree.o" + @echo "... sys_tree.i" + @echo "... sys_tree.s" + @echo "... websockets.o" + @echo "... websockets.i" + @echo "... websockets.s" +.PHONY : help + + + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + cd /Users/benjamin/orchestra/src/libs/mosquitto && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system + diff --git a/src/libs/mosquitto/src/bridge.c b/src/libs/mosquitto/src/bridge.c new file mode 100644 index 0000000..dc5f9c4 --- /dev/null +++ b/src/libs/mosquitto/src/bridge.c @@ -0,0 +1,429 @@ +/* +Copyright (c) 2009-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include +#include +#include +#include + +#ifndef WIN32 +#include +#include +#else +#include +#include +#endif + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef WITH_BRIDGE + +int mqtt3_bridge_new(struct mosquitto_db *db, struct _mqtt3_bridge *bridge) +{ + struct mosquitto *new_context = NULL; + struct mosquitto **bridges; + char hostname[256]; + int len; + char *id, *local_id; + + assert(db); + assert(bridge); + + if(!bridge->remote_clientid){ + if(!gethostname(hostname, 256)){ + len = strlen(hostname) + strlen(bridge->name) + 2; + id = _mosquitto_malloc(len); + if(!id){ + return MOSQ_ERR_NOMEM; + } + snprintf(id, len, "%s.%s", hostname, bridge->name); + }else{ + return 1; + } + bridge->remote_clientid = id; + } + if(bridge->local_clientid){ + local_id = _mosquitto_strdup(bridge->local_clientid); + if(!local_id){ + return MOSQ_ERR_NOMEM; + } + }else{ + len = strlen(bridge->remote_clientid) + strlen("local.") + 2; + local_id = _mosquitto_malloc(len); + if(!local_id){ + return MOSQ_ERR_NOMEM; + } + snprintf(local_id, len, "local.%s", bridge->remote_clientid); + bridge->local_clientid = _mosquitto_strdup(local_id); + if(!bridge->local_clientid){ + _mosquitto_free(local_id); + return MOSQ_ERR_NOMEM; + } + } + + HASH_FIND(hh_id, db->contexts_by_id, local_id, strlen(local_id), new_context); + if(new_context){ + /* (possible from persistent db) */ + _mosquitto_free(local_id); + }else{ + /* id wasn't found, so generate a new context */ + new_context = mqtt3_context_init(db, -1); + if(!new_context){ + _mosquitto_free(local_id); + return MOSQ_ERR_NOMEM; + } + new_context->id = local_id; + HASH_ADD_KEYPTR(hh_id, db->contexts_by_id, new_context->id, strlen(new_context->id), new_context); + } + new_context->bridge = bridge; + new_context->is_bridge = true; + + new_context->username = new_context->bridge->remote_username; + new_context->password = new_context->bridge->remote_password; + +#ifdef WITH_TLS + new_context->tls_cafile = new_context->bridge->tls_cafile; + new_context->tls_capath = new_context->bridge->tls_capath; + new_context->tls_certfile = new_context->bridge->tls_certfile; + new_context->tls_keyfile = new_context->bridge->tls_keyfile; + new_context->tls_cert_reqs = SSL_VERIFY_PEER; + new_context->tls_version = new_context->bridge->tls_version; + new_context->tls_insecure = new_context->bridge->tls_insecure; +#ifdef REAL_WITH_TLS_PSK + new_context->tls_psk_identity = new_context->bridge->tls_psk_identity; + new_context->tls_psk = new_context->bridge->tls_psk; +#endif +#endif + + bridge->try_private_accepted = true; + new_context->protocol = bridge->protocol_version; + + bridges = _mosquitto_realloc(db->bridges, (db->bridge_count+1)*sizeof(struct mosquitto *)); + if(bridges){ + db->bridges = bridges; + db->bridge_count++; + db->bridges[db->bridge_count-1] = new_context; + }else{ + return MOSQ_ERR_NOMEM; + } + +#if defined(__GLIBC__) && defined(WITH_ADNS) + new_context->bridge->restart_t = 1; /* force quick restart of bridge */ + return mqtt3_bridge_connect_step1(db, new_context); +#else + return mqtt3_bridge_connect(db, new_context); +#endif +} + +#if defined(__GLIBC__) && defined(WITH_ADNS) +int mqtt3_bridge_connect_step1(struct mosquitto_db *db, struct mosquitto *context) +{ + int rc; + int i; + char *notification_topic; + int notification_topic_len; + uint8_t notification_payload; + + if(!context || !context->bridge) return MOSQ_ERR_INVAL; + + context->state = mosq_cs_new; + context->sock = INVALID_SOCKET; + context->last_msg_in = mosquitto_time(); + context->next_msg_out = mosquitto_time() + context->bridge->keepalive; + context->keepalive = context->bridge->keepalive; + context->clean_session = context->bridge->clean_session; + context->in_packet.payload = NULL; + context->ping_t = 0; + context->bridge->lazy_reconnect = false; + mqtt3_bridge_packet_cleanup(context); + mqtt3_db_message_reconnect_reset(db, context); + + if(context->clean_session){ + mqtt3_db_messages_delete(db, context); + } + + /* Delete all local subscriptions even for clean_session==false. We don't + * remove any messages and the next loop carries out the resubscription + * anyway. This means any unwanted subs will be removed. + */ + mqtt3_subs_clean_session(db, context); + + for(i=0; ibridge->topic_count; i++){ + if(context->bridge->topics[i].direction == bd_out || context->bridge->topics[i].direction == bd_both){ + _mosquitto_log_printf(NULL, MOSQ_LOG_DEBUG, "Bridge %s doing local SUBSCRIBE on topic %s", context->id, context->bridge->topics[i].local_topic); + if(mqtt3_sub_add(db, context, context->bridge->topics[i].local_topic, context->bridge->topics[i].qos, &db->subs)) return 1; + } + } + + if(context->bridge->notifications){ + if(context->bridge->notification_topic){ + if(!context->bridge->initial_notification_done){ + notification_payload = '0'; + mqtt3_db_messages_easy_queue(db, context, context->bridge->notification_topic, 1, 1, ¬ification_payload, 1); + context->bridge->initial_notification_done = true; + } + notification_payload = '0'; + rc = _mosquitto_will_set(context, context->bridge->notification_topic, 1, ¬ification_payload, 1, true); + if(rc != MOSQ_ERR_SUCCESS){ + return rc; + } + }else{ + notification_topic_len = strlen(context->bridge->remote_clientid)+strlen("$SYS/broker/connection//state"); + notification_topic = _mosquitto_malloc(sizeof(char)*(notification_topic_len+1)); + if(!notification_topic) return MOSQ_ERR_NOMEM; + + snprintf(notification_topic, notification_topic_len+1, "$SYS/broker/connection/%s/state", context->bridge->remote_clientid); + + if(!context->bridge->initial_notification_done){ + notification_payload = '0'; + mqtt3_db_messages_easy_queue(db, context, notification_topic, 1, 1, ¬ification_payload, 1); + context->bridge->initial_notification_done = true; + } + + notification_payload = '0'; + rc = _mosquitto_will_set(context, notification_topic, 1, ¬ification_payload, 1, true); + _mosquitto_free(notification_topic); + if(rc != MOSQ_ERR_SUCCESS){ + return rc; + } + } + } + + _mosquitto_log_printf(NULL, MOSQ_LOG_NOTICE, "Connecting bridge %s (%s:%d)", context->bridge->name, context->bridge->addresses[context->bridge->cur_address].address, context->bridge->addresses[context->bridge->cur_address].port); + rc = _mosquitto_try_connect_step1(context, context->bridge->addresses[context->bridge->cur_address].address); + if(rc > 0 ){ + if(rc == MOSQ_ERR_TLS){ + _mosquitto_socket_close(db, context); + return rc; /* Error already printed */ + }else if(rc == MOSQ_ERR_ERRNO){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error creating bridge: %s.", strerror(errno)); + }else if(rc == MOSQ_ERR_EAI){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error creating bridge: %s.", gai_strerror(errno)); + } + + return rc; + } + + return MOSQ_ERR_SUCCESS; +} + + +int mqtt3_bridge_connect_step2(struct mosquitto_db *db, struct mosquitto *context) +{ + int rc; + + if(!context || !context->bridge) return MOSQ_ERR_INVAL; + + _mosquitto_log_printf(NULL, MOSQ_LOG_NOTICE, "Connecting bridge %s (%s:%d)", context->bridge->name, context->bridge->addresses[context->bridge->cur_address].address, context->bridge->addresses[context->bridge->cur_address].port); + rc = _mosquitto_try_connect_step2(context, context->bridge->addresses[context->bridge->cur_address].port, &context->sock); + if(rc > 0 ){ + if(rc == MOSQ_ERR_TLS){ + _mosquitto_socket_close(db, context); + return rc; /* Error already printed */ + }else if(rc == MOSQ_ERR_ERRNO){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error creating bridge: %s.", strerror(errno)); + }else if(rc == MOSQ_ERR_EAI){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error creating bridge: %s.", gai_strerror(errno)); + } + + return rc; + } + + rc = _mosquitto_socket_connect_step3(context, context->bridge->addresses[context->bridge->cur_address].address, context->bridge->addresses[context->bridge->cur_address].port, NULL, false); + if(rc > 0 ){ + if(rc == MOSQ_ERR_TLS){ + _mosquitto_socket_close(db, context); + return rc; /* Error already printed */ + }else if(rc == MOSQ_ERR_ERRNO){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error creating bridge: %s.", strerror(errno)); + }else if(rc == MOSQ_ERR_EAI){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error creating bridge: %s.", gai_strerror(errno)); + } + + return rc; + } + + HASH_ADD(hh_sock, db->contexts_by_sock, sock, sizeof(context->sock), context); + + if(rc == MOSQ_ERR_CONN_PENDING){ + context->state = mosq_cs_connect_pending; + } + rc = _mosquitto_send_connect(context, context->keepalive, context->clean_session); + if(rc == MOSQ_ERR_SUCCESS){ + return MOSQ_ERR_SUCCESS; + }else if(rc == MOSQ_ERR_ERRNO && errno == ENOTCONN){ + return MOSQ_ERR_SUCCESS; + }else{ + if(rc == MOSQ_ERR_TLS){ + return rc; /* Error already printed */ + }else if(rc == MOSQ_ERR_ERRNO){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error creating bridge: %s.", strerror(errno)); + }else if(rc == MOSQ_ERR_EAI){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error creating bridge: %s.", gai_strerror(errno)); + } + _mosquitto_socket_close(db, context); + return rc; + } +} +#else + +int mqtt3_bridge_connect(struct mosquitto_db *db, struct mosquitto *context) +{ + int rc; + int i; + char *notification_topic; + int notification_topic_len; + uint8_t notification_payload; + + if(!context || !context->bridge) return MOSQ_ERR_INVAL; + + context->state = mosq_cs_new; + context->sock = INVALID_SOCKET; + context->last_msg_in = mosquitto_time(); + context->next_msg_out = mosquitto_time() + context->bridge->keepalive; + context->keepalive = context->bridge->keepalive; + context->clean_session = context->bridge->clean_session; + context->in_packet.payload = NULL; + context->ping_t = 0; + context->bridge->lazy_reconnect = false; + mqtt3_bridge_packet_cleanup(context); + mqtt3_db_message_reconnect_reset(db, context); + + if(context->clean_session){ + mqtt3_db_messages_delete(db, context); + } + + /* Delete all local subscriptions even for clean_session==false. We don't + * remove any messages and the next loop carries out the resubscription + * anyway. This means any unwanted subs will be removed. + */ + mqtt3_subs_clean_session(db, context); + + for(i=0; ibridge->topic_count; i++){ + if(context->bridge->topics[i].direction == bd_out || context->bridge->topics[i].direction == bd_both){ + _mosquitto_log_printf(NULL, MOSQ_LOG_DEBUG, "Bridge %s doing local SUBSCRIBE on topic %s", context->id, context->bridge->topics[i].local_topic); + if(mqtt3_sub_add(db, context, context->bridge->topics[i].local_topic, context->bridge->topics[i].qos, &db->subs)) return 1; + } + } + + if(context->bridge->notifications){ + if(context->bridge->notification_topic){ + if(!context->bridge->initial_notification_done){ + notification_payload = '0'; + mqtt3_db_messages_easy_queue(db, context, context->bridge->notification_topic, 1, 1, ¬ification_payload, 1); + context->bridge->initial_notification_done = true; + } + notification_payload = '0'; + rc = _mosquitto_will_set(context, context->bridge->notification_topic, 1, ¬ification_payload, 1, true); + if(rc != MOSQ_ERR_SUCCESS){ + return rc; + } + }else{ + notification_topic_len = strlen(context->bridge->remote_clientid)+strlen("$SYS/broker/connection//state"); + notification_topic = _mosquitto_malloc(sizeof(char)*(notification_topic_len+1)); + if(!notification_topic) return MOSQ_ERR_NOMEM; + + snprintf(notification_topic, notification_topic_len+1, "$SYS/broker/connection/%s/state", context->bridge->remote_clientid); + + if(!context->bridge->initial_notification_done){ + notification_payload = '0'; + mqtt3_db_messages_easy_queue(db, context, notification_topic, 1, 1, ¬ification_payload, 1); + context->bridge->initial_notification_done = true; + } + + notification_payload = '0'; + rc = _mosquitto_will_set(context, notification_topic, 1, ¬ification_payload, 1, true); + _mosquitto_free(notification_topic); + if(rc != MOSQ_ERR_SUCCESS){ + return rc; + } + } + } + + _mosquitto_log_printf(NULL, MOSQ_LOG_NOTICE, "Connecting bridge %s (%s:%d)", context->bridge->name, context->bridge->addresses[context->bridge->cur_address].address, context->bridge->addresses[context->bridge->cur_address].port); + rc = _mosquitto_socket_connect(context, context->bridge->addresses[context->bridge->cur_address].address, context->bridge->addresses[context->bridge->cur_address].port, NULL, false); + if(rc > 0 ){ + if(rc == MOSQ_ERR_TLS){ + _mosquitto_socket_close(db, context); + return rc; /* Error already printed */ + }else if(rc == MOSQ_ERR_ERRNO){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error creating bridge: %s.", strerror(errno)); + }else if(rc == MOSQ_ERR_EAI){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error creating bridge: %s.", gai_strerror(errno)); + } + + return rc; + } + + HASH_ADD(hh_sock, db->contexts_by_sock, sock, sizeof(context->sock), context); + + if(rc == MOSQ_ERR_CONN_PENDING){ + context->state = mosq_cs_connect_pending; + } + rc = _mosquitto_send_connect(context, context->keepalive, context->clean_session); + if(rc == MOSQ_ERR_SUCCESS){ + return MOSQ_ERR_SUCCESS; + }else if(rc == MOSQ_ERR_ERRNO && errno == ENOTCONN){ + return MOSQ_ERR_SUCCESS; + }else{ + if(rc == MOSQ_ERR_TLS){ + return rc; /* Error already printed */ + }else if(rc == MOSQ_ERR_ERRNO){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error creating bridge: %s.", strerror(errno)); + }else if(rc == MOSQ_ERR_EAI){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error creating bridge: %s.", gai_strerror(errno)); + } + _mosquitto_socket_close(db, context); + return rc; + } +} +#endif + + +void mqtt3_bridge_packet_cleanup(struct mosquitto *context) +{ + struct _mosquitto_packet *packet; + if(!context) return; + + if(context->current_out_packet){ + _mosquitto_packet_cleanup(context->current_out_packet); + _mosquitto_free(context->current_out_packet); + context->current_out_packet = NULL; + } + while(context->out_packet){ + _mosquitto_packet_cleanup(context->out_packet); + packet = context->out_packet; + context->out_packet = context->out_packet->next; + _mosquitto_free(packet); + } + context->out_packet = NULL; + context->out_packet_last = NULL; + + _mosquitto_packet_cleanup(&(context->in_packet)); +} + +#endif diff --git a/src/libs/mosquitto/src/cmake_install.cmake b/src/libs/mosquitto/src/cmake_install.cmake new file mode 100644 index 0000000..a4983bc --- /dev/null +++ b/src/libs/mosquitto/src/cmake_install.cmake @@ -0,0 +1,55 @@ +# Install script for directory: /Users/benjamin/orchestra/src/libs/mosquitto/src + +# Set the install prefix +if(NOT DEFINED CMAKE_INSTALL_PREFIX) + set(CMAKE_INSTALL_PREFIX "/usr/local") +endif() +string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") + +# Set the install configuration name. +if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) + if(BUILD_TYPE) + string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" + CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") + else() + set(CMAKE_INSTALL_CONFIG_NAME "") + endif() + message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") +endif() + +# Set the component getting installed. +if(NOT CMAKE_INSTALL_COMPONENT) + if(COMPONENT) + message(STATUS "Install component: \"${COMPONENT}\"") + set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") + else() + set(CMAKE_INSTALL_COMPONENT) + endif() +endif() + +# Is this installation the result of a crosscompile? +if(NOT DEFINED CMAKE_CROSSCOMPILING) + set(CMAKE_CROSSCOMPILING "FALSE") +endif() + +if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" OR NOT CMAKE_INSTALL_COMPONENT) + file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/sbin" TYPE EXECUTABLE FILES "/Users/benjamin/orchestra/src/libs/mosquitto/src/mosquitto") + if(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/sbin/mosquitto" AND + NOT IS_SYMLINK "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/sbin/mosquitto") + execute_process(COMMAND /usr/bin/install_name_tool + -add_rpath "/usr/local/lib" + "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/sbin/mosquitto") + if(CMAKE_INSTALL_DO_STRIP) + execute_process(COMMAND "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip" "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/sbin/mosquitto") + endif() + endif() +endif() + +if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" OR NOT CMAKE_INSTALL_COMPONENT) + file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/include" TYPE FILE FILES "/Users/benjamin/orchestra/src/libs/mosquitto/src/mosquitto_plugin.h") +endif() + +if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" OR NOT CMAKE_INSTALL_COMPONENT) + EXEC_PROGRAM(/sbin/ldconfig) +endif() + diff --git a/src/libs/mosquitto/src/conf.c b/src/libs/mosquitto/src/conf.c new file mode 100644 index 0000000..a3e233d --- /dev/null +++ b/src/libs/mosquitto/src/conf.c @@ -0,0 +1,1835 @@ +/* +Copyright (c) 2009-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include + +#include +#include +#include +#include +#include + +#ifdef WIN32 +#else +# include +#endif + +#ifndef WIN32 +# include +# include +#else +# include +# include +#endif + +#if !defined(WIN32) && !defined(__CYGWIN__) +# include +#endif + +#include +#include +#include "tls_mosq.h" +#include "util_mosq.h" +#include "mqtt3_protocol.h" + +struct config_recurse { + int log_dest; + int log_dest_set; + int log_type; + int log_type_set; + int max_inflight_messages; + int max_queued_messages; +}; + +#if defined(WIN32) || defined(__CYGWIN__) +#include +extern SERVICE_STATUS_HANDLE service_handle; +#endif + +static int _conf_parse_bool(char **token, const char *name, bool *value, char *saveptr); +static int _conf_parse_int(char **token, const char *name, int *value, char *saveptr); +static int _conf_parse_string(char **token, const char *name, char **value, char *saveptr); +static int _config_read_file(struct mqtt3_config *config, bool reload, const char *file, struct config_recurse *config_tmp, int level, int *lineno); + +static int _conf_attempt_resolve(const char *host, const char *text, int log, const char *msg) +{ + struct addrinfo gai_hints; + struct addrinfo *gai_res; + int rc; + + memset(&gai_hints, 0, sizeof(struct addrinfo)); + gai_hints.ai_family = PF_UNSPEC; + gai_hints.ai_flags = AI_ADDRCONFIG; + gai_hints.ai_socktype = SOCK_STREAM; + gai_res = NULL; + rc = getaddrinfo(host, NULL, &gai_hints, &gai_res); + if(gai_res){ + freeaddrinfo(gai_res); + } + if(rc != 0){ +#ifndef WIN32 + if(rc == EAI_SYSTEM){ + if(errno == ENOENT){ + _mosquitto_log_printf(NULL, log, "%s: Unable to resolve %s %s.", msg, text, host); + }else{ + _mosquitto_log_printf(NULL, log, "%s: Error resolving %s: %s.", msg, text, strerror(errno)); + } + }else{ + _mosquitto_log_printf(NULL, log, "%s: Error resolving %s: %s.", msg, text, gai_strerror(rc)); + } +#else + if(rc == WSAHOST_NOT_FOUND){ + _mosquitto_log_printf(NULL, log, "%s: Error resolving %s.", msg, text); + } +#endif + return MOSQ_ERR_INVAL; + } + return MOSQ_ERR_SUCCESS; +} + +static void _config_init_reload(struct mqtt3_config *config) +{ + int i; + /* Set defaults */ + if(config->acl_file) _mosquitto_free(config->acl_file); + config->acl_file = NULL; + config->allow_anonymous = true; + config->allow_duplicate_messages = false; + config->allow_zero_length_clientid = true; + config->auto_id_prefix = NULL; + config->auto_id_prefix_len = 0; + config->autosave_interval = 1800; + config->autosave_on_changes = false; + if(config->clientid_prefixes) _mosquitto_free(config->clientid_prefixes); + config->connection_messages = true; + config->clientid_prefixes = NULL; + if(config->log_fptr){ + fclose(config->log_fptr); + config->log_fptr = NULL; + } + if(config->log_file){ + _mosquitto_free(config->log_file); + config->log_file = NULL; + } +#if defined(WIN32) || defined(__CYGWIN__) + if(service_handle){ + /* This is running as a Windows service. Default to no logging. Using + * stdout/stderr is forbidden because the first clients to connect will + * get log information sent to them for some reason. */ + config->log_dest = MQTT3_LOG_NONE; + }else{ + config->log_dest = MQTT3_LOG_STDERR; + } +#else + config->log_facility = LOG_DAEMON; + config->log_dest = MQTT3_LOG_STDERR; + if(config->verbose){ + config->log_type = INT_MAX; + }else{ + config->log_type = MOSQ_LOG_ERR | MOSQ_LOG_WARNING | MOSQ_LOG_NOTICE | MOSQ_LOG_INFO; + } +#endif + config->log_timestamp = true; + if(config->password_file) _mosquitto_free(config->password_file); + config->password_file = NULL; + config->persistence = false; + if(config->persistence_location) _mosquitto_free(config->persistence_location); + config->persistence_location = NULL; + if(config->persistence_file) _mosquitto_free(config->persistence_file); + config->persistence_file = NULL; + config->persistent_client_expiration = 0; + if(config->psk_file) _mosquitto_free(config->psk_file); + config->psk_file = NULL; + config->queue_qos0_messages = false; + config->retry_interval = 20; + config->sys_interval = 10; + config->upgrade_outgoing_qos = false; + if(config->auth_options){ + for(i=0; iauth_option_count; i++){ + _mosquitto_free(config->auth_options[i].key); + _mosquitto_free(config->auth_options[i].value); + } + _mosquitto_free(config->auth_options); + config->auth_options = NULL; + config->auth_option_count = 0; + } +} + +void mqtt3_config_init(struct mqtt3_config *config) +{ + memset(config, 0, sizeof(struct mqtt3_config)); + _config_init_reload(config); + config->config_file = NULL; + config->daemon = false; + config->default_listener.host = NULL; + config->default_listener.port = 0; + config->default_listener.max_connections = -1; + config->default_listener.mount_point = NULL; + config->default_listener.socks = NULL; + config->default_listener.sock_count = 0; + config->default_listener.client_count = 0; + config->default_listener.protocol = mp_mqtt; + config->default_listener.use_username_as_clientid = false; +#ifdef WITH_TLS + config->default_listener.tls_version = NULL; + config->default_listener.cafile = NULL; + config->default_listener.capath = NULL; + config->default_listener.certfile = NULL; + config->default_listener.keyfile = NULL; + config->default_listener.ciphers = NULL; + config->default_listener.psk_hint = NULL; + config->default_listener.require_certificate = false; + config->default_listener.crlfile = NULL; + config->default_listener.use_identity_as_username = false; +#endif + config->listeners = NULL; + config->listener_count = 0; + config->pid_file = NULL; + config->user = NULL; +#ifdef WITH_BRIDGE + config->bridges = NULL; + config->bridge_count = 0; +#endif + config->auth_plugin = NULL; + config->auth_plugin_deny_special_chars = true; + config->verbose = false; + config->message_size_limit = 0; +} + +void mqtt3_config_cleanup(struct mqtt3_config *config) +{ + int i; +#ifdef WITH_BRIDGE + int j; +#endif + + if(config->acl_file) _mosquitto_free(config->acl_file); + if(config->auto_id_prefix) _mosquitto_free(config->auto_id_prefix); + if(config->clientid_prefixes) _mosquitto_free(config->clientid_prefixes); + if(config->config_file) _mosquitto_free(config->config_file); + if(config->password_file) _mosquitto_free(config->password_file); + if(config->persistence_location) _mosquitto_free(config->persistence_location); + if(config->persistence_file) _mosquitto_free(config->persistence_file); + if(config->persistence_filepath) _mosquitto_free(config->persistence_filepath); + if(config->psk_file) _mosquitto_free(config->psk_file); + if(config->pid_file) _mosquitto_free(config->pid_file); + if(config->listeners){ + for(i=0; ilistener_count; i++){ + if(config->listeners[i].host) _mosquitto_free(config->listeners[i].host); + if(config->listeners[i].mount_point) _mosquitto_free(config->listeners[i].mount_point); + if(config->listeners[i].socks) _mosquitto_free(config->listeners[i].socks); +#ifdef WITH_TLS + if(config->listeners[i].cafile) _mosquitto_free(config->listeners[i].cafile); + if(config->listeners[i].capath) _mosquitto_free(config->listeners[i].capath); + if(config->listeners[i].certfile) _mosquitto_free(config->listeners[i].certfile); + if(config->listeners[i].keyfile) _mosquitto_free(config->listeners[i].keyfile); + if(config->listeners[i].ciphers) _mosquitto_free(config->listeners[i].ciphers); + if(config->listeners[i].psk_hint) _mosquitto_free(config->listeners[i].psk_hint); + if(config->listeners[i].crlfile) _mosquitto_free(config->listeners[i].crlfile); + if(config->listeners[i].tls_version) _mosquitto_free(config->listeners[i].tls_version); + if(config->listeners[i].ssl_ctx) SSL_CTX_free(config->listeners[i].ssl_ctx); +#endif +#ifdef WITH_WEBSOCKETS + if(config->listeners[i].http_dir) _mosquitto_free(config->listeners[i].http_dir); +#endif + } + _mosquitto_free(config->listeners); + } +#ifdef WITH_BRIDGE + if(config->bridges){ + for(i=0; ibridge_count; i++){ + if(config->bridges[i].name) _mosquitto_free(config->bridges[i].name); + if(config->bridges[i].addresses){ + for(j=0; jbridges[i].address_count; j++){ + _mosquitto_free(config->bridges[i].addresses[j].address); + } + _mosquitto_free(config->bridges[i].addresses); + } + if(config->bridges[i].remote_clientid) _mosquitto_free(config->bridges[i].remote_clientid); + if(config->bridges[i].remote_username) _mosquitto_free(config->bridges[i].remote_username); + if(config->bridges[i].remote_password) _mosquitto_free(config->bridges[i].remote_password); + if(config->bridges[i].local_clientid) _mosquitto_free(config->bridges[i].local_clientid); + if(config->bridges[i].local_username) _mosquitto_free(config->bridges[i].local_username); + if(config->bridges[i].local_password) _mosquitto_free(config->bridges[i].local_password); + if(config->bridges[i].topics){ + for(j=0; jbridges[i].topic_count; j++){ + if(config->bridges[i].topics[j].topic) _mosquitto_free(config->bridges[i].topics[j].topic); + if(config->bridges[i].topics[j].local_prefix) _mosquitto_free(config->bridges[i].topics[j].local_prefix); + if(config->bridges[i].topics[j].remote_prefix) _mosquitto_free(config->bridges[i].topics[j].remote_prefix); + if(config->bridges[i].topics[j].local_topic) _mosquitto_free(config->bridges[i].topics[j].local_topic); + if(config->bridges[i].topics[j].remote_topic) _mosquitto_free(config->bridges[i].topics[j].remote_topic); + } + _mosquitto_free(config->bridges[i].topics); + } + if(config->bridges[i].notification_topic) _mosquitto_free(config->bridges[i].notification_topic); +#ifdef WITH_TLS + if(config->bridges[i].tls_version) _mosquitto_free(config->bridges[i].tls_version); + if(config->bridges[i].tls_cafile) _mosquitto_free(config->bridges[i].tls_cafile); +#ifdef REAL_WITH_TLS_PSK + if(config->bridges[i].tls_psk_identity) _mosquitto_free(config->bridges[i].tls_psk_identity); + if(config->bridges[i].tls_psk) _mosquitto_free(config->bridges[i].tls_psk); +#endif +#endif + } + _mosquitto_free(config->bridges); + } +#endif + if(config->auth_plugin) _mosquitto_free(config->auth_plugin); + if(config->auth_options){ + for(i=0; iauth_option_count; i++){ + _mosquitto_free(config->auth_options[i].key); + _mosquitto_free(config->auth_options[i].value); + } + _mosquitto_free(config->auth_options); + config->auth_options = NULL; + config->auth_option_count = 0; + } + if(config->log_fptr){ + fclose(config->log_fptr); + config->log_fptr = NULL; + } + if(config->log_file){ + _mosquitto_free(config->log_file); + config->log_file = NULL; + } +} + +static void print_usage(void) +{ + printf("mosquitto version %s (build date %s)\n\n", VERSION, TIMESTAMP); + printf("mosquitto is an MQTT v3.1.1/v3.1 broker.\n\n"); + printf("Usage: mosquitto [-c config_file] [-d] [-h] [-p port]\n\n"); + printf(" -c : specify the broker config file.\n"); + printf(" -d : put the broker into the background after starting.\n"); + printf(" -h : display this help.\n"); + printf(" -p : start the broker listening on the specified port.\n"); + printf(" Not recommended in conjunction with the -c option.\n"); + printf(" -v : verbose mode - enable all logging types. This overrides\n"); + printf(" any logging options given in the config file.\n"); + printf("\nSee http://mosquitto.org/ for more information.\n\n"); +} + +int mqtt3_config_parse_args(struct mqtt3_config *config, int argc, char *argv[]) +{ + int i; + int port_tmp; + + for(i=1; iconfig_file = _mosquitto_strdup(argv[i+1]); + if(!config->config_file){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + + if(mqtt3_config_read(config, false)){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Unable to open configuration file."); + return MOSQ_ERR_INVAL; + } + }else{ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: -c argument given, but no config file specified."); + return MOSQ_ERR_INVAL; + } + i++; + }else if(!strcmp(argv[i], "-d") || !strcmp(argv[i], "--daemon")){ + config->daemon = true; + }else if(!strcmp(argv[i], "-h") || !strcmp(argv[i], "--help")){ + print_usage(); + return MOSQ_ERR_INVAL; + }else if(!strcmp(argv[i], "-p") || !strcmp(argv[i], "--port")){ + if(i65535){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid port specified (%d).", port_tmp); + return MOSQ_ERR_INVAL; + }else{ + if(config->default_listener.port){ + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: Default listener port specified multiple times. Only the latest will be used."); + } + config->default_listener.port = port_tmp; + } + }else{ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: -p argument given, but no port specified."); + return MOSQ_ERR_INVAL; + } + i++; + }else if(!strcmp(argv[i], "-v") || !strcmp(argv[i], "--verbose")){ + config->verbose = true; + }else{ + fprintf(stderr, "Error: Unknown option '%s'.\n",argv[i]); + print_usage(); + return MOSQ_ERR_INVAL; + } + } + + if(config->listener_count == 0 +#ifdef WITH_TLS + || config->default_listener.cafile + || config->default_listener.capath + || config->default_listener.certfile + || config->default_listener.keyfile + || config->default_listener.ciphers + || config->default_listener.psk_hint + || config->default_listener.require_certificate + || config->default_listener.crlfile + || config->default_listener.use_identity_as_username +#endif + || config->default_listener.use_username_as_clientid + || config->default_listener.host + || config->default_listener.port + || config->default_listener.max_connections != -1 + || config->default_listener.mount_point + || config->default_listener.protocol != mp_mqtt){ + + config->listener_count++; + config->listeners = _mosquitto_realloc(config->listeners, sizeof(struct _mqtt3_listener)*config->listener_count); + if(!config->listeners){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + memset(&config->listeners[config->listener_count-1], 0, sizeof(struct _mqtt3_listener)); + if(config->default_listener.port){ + config->listeners[config->listener_count-1].port = config->default_listener.port; + }else{ + config->listeners[config->listener_count-1].port = 1883; + } + if(config->default_listener.host){ + config->listeners[config->listener_count-1].host = config->default_listener.host; + }else{ + config->listeners[config->listener_count-1].host = NULL; + } + if(config->default_listener.mount_point){ + config->listeners[config->listener_count-1].mount_point = config->default_listener.mount_point; + }else{ + config->listeners[config->listener_count-1].mount_point = NULL; + } + config->listeners[config->listener_count-1].max_connections = config->default_listener.max_connections; + config->listeners[config->listener_count-1].protocol = config->default_listener.protocol; + config->listeners[config->listener_count-1].client_count = 0; + config->listeners[config->listener_count-1].socks = NULL; + config->listeners[config->listener_count-1].sock_count = 0; + config->listeners[config->listener_count-1].client_count = 0; + config->listeners[config->listener_count-1].use_username_as_clientid = config->default_listener.use_username_as_clientid; +#ifdef WITH_TLS + config->listeners[config->listener_count-1].tls_version = config->default_listener.tls_version; + config->listeners[config->listener_count-1].cafile = config->default_listener.cafile; + config->listeners[config->listener_count-1].capath = config->default_listener.capath; + config->listeners[config->listener_count-1].certfile = config->default_listener.certfile; + config->listeners[config->listener_count-1].keyfile = config->default_listener.keyfile; + config->listeners[config->listener_count-1].ciphers = config->default_listener.ciphers; + config->listeners[config->listener_count-1].psk_hint = config->default_listener.psk_hint; + config->listeners[config->listener_count-1].require_certificate = config->default_listener.require_certificate; + config->listeners[config->listener_count-1].ssl_ctx = NULL; + config->listeners[config->listener_count-1].crlfile = config->default_listener.crlfile; + config->listeners[config->listener_count-1].use_identity_as_username = config->default_listener.use_identity_as_username; +#endif + } + + /* Default to drop to mosquitto user if we are privileged and no user specified. */ + if(!config->user){ + config->user = "mosquitto"; + } + if(config->verbose){ + config->log_type = INT_MAX; + } + return MOSQ_ERR_SUCCESS; +} + +int mqtt3_config_read(struct mqtt3_config *config, bool reload) +{ + int rc = MOSQ_ERR_SUCCESS; + struct config_recurse cr; + int lineno; + int len; +#ifdef WITH_BRIDGE + int i; +#endif + + cr.log_dest = MQTT3_LOG_NONE; + cr.log_dest_set = 0; + cr.log_type = MOSQ_LOG_NONE; + cr.log_type_set = 0; + cr.max_inflight_messages = 20; + cr.max_queued_messages = 100; + + if(!config->config_file) return 0; + + if(reload){ + /* Re-initialise appropriate config vars to default for reload. */ + _config_init_reload(config); + } + rc = _config_read_file(config, reload, config->config_file, &cr, 0, &lineno); + if(rc){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error found at %s:%d.", config->config_file, lineno); + return rc; + } + +#ifdef WITH_PERSISTENCE + if(config->persistence){ + if(!config->persistence_file){ + config->persistence_file = _mosquitto_strdup("mosquitto.db"); + if(!config->persistence_file) return MOSQ_ERR_NOMEM; + } + if(config->persistence_filepath){ + _mosquitto_free(config->persistence_filepath); + } + if(config->persistence_location && strlen(config->persistence_location)){ + len = strlen(config->persistence_location) + strlen(config->persistence_file) + 1; + config->persistence_filepath = _mosquitto_malloc(len); + if(!config->persistence_filepath) return MOSQ_ERR_NOMEM; + snprintf(config->persistence_filepath, len, "%s%s", config->persistence_location, config->persistence_file); + }else{ + config->persistence_filepath = _mosquitto_strdup(config->persistence_file); + if(!config->persistence_filepath) return MOSQ_ERR_NOMEM; + } + } +#endif + /* Default to drop to mosquitto user if no other user specified. This must + * remain here even though it is covered in mqtt3_parse_args() because this + * function may be called on its own. */ + if(!config->user){ + config->user = "mosquitto"; + } + + mqtt3_db_limits_set(cr.max_inflight_messages, cr.max_queued_messages); + +#ifdef WITH_BRIDGE + for(i=0; ibridge_count; i++){ + if(!config->bridges[i].name || !config->bridges[i].addresses || !config->bridges[i].topic_count){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } +#ifdef REAL_WITH_TLS_PSK + if(config->bridges[i].tls_psk && !config->bridges[i].tls_psk_identity){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration: missing bridge_identity.\n"); + return MOSQ_ERR_INVAL; + } + if(config->bridges[i].tls_psk_identity && !config->bridges[i].tls_psk){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration: missing bridge_psk.\n"); + return MOSQ_ERR_INVAL; + } +#endif + } +#endif + + if(cr.log_dest_set){ + config->log_dest = cr.log_dest; + } + if(config->verbose){ + config->log_type = INT_MAX; + }else if(cr.log_type_set){ + config->log_type = cr.log_type; + } + return MOSQ_ERR_SUCCESS; +} + +int _config_read_file_core(struct mqtt3_config *config, bool reload, const char *file, struct config_recurse *cr, int level, int *lineno, FILE *fptr) +{ + int rc; + char buf[1024]; + char *token; + int tmp_int; + char *saveptr = NULL; +#ifdef WITH_BRIDGE + struct _mqtt3_bridge *cur_bridge = NULL; + struct _mqtt3_bridge_topic *cur_topic; +#endif + time_t expiration_mult; + char *key; + char *conf_file; +#ifdef WIN32 + HANDLE fh; + char dirpath[MAX_PATH]; + WIN32_FIND_DATA find_data; +#else + DIR *dh; + struct dirent *de; +#endif + int len; + struct _mqtt3_listener *cur_listener = &config->default_listener; +#ifdef WITH_BRIDGE + char *address; + int i; +#endif + int lineno_ext; + + *lineno = 0; + + while(fgets(buf, 1024, fptr)){ + (*lineno)++; + if(buf[0] != '#' && buf[0] != 10 && buf[0] != 13){ + while(buf[strlen(buf)-1] == 10 || buf[strlen(buf)-1] == 13){ + buf[strlen(buf)-1] = 0; + } + token = strtok_r(buf, " ", &saveptr); + if(token){ + if(!strcmp(token, "acl_file")){ + if(reload){ + if(config->acl_file){ + _mosquitto_free(config->acl_file); + config->acl_file = NULL; + } + } + if(_conf_parse_string(&token, "acl_file", &config->acl_file, saveptr)) return MOSQ_ERR_INVAL; + }else if(!strcmp(token, "address") || !strcmp(token, "addresses")){ +#ifdef WITH_BRIDGE + if(reload) continue; // FIXME + if(!cur_bridge || cur_bridge->addresses){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + while((token = strtok_r(NULL, " ", &saveptr))){ + cur_bridge->address_count++; + cur_bridge->addresses = _mosquitto_realloc(cur_bridge->addresses, sizeof(struct bridge_address)*cur_bridge->address_count); + if(!cur_bridge->addresses){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + cur_bridge->addresses[cur_bridge->address_count-1].address = token; + } + for(i=0; iaddress_count; i++){ + address = strtok_r(cur_bridge->addresses[i].address, ":", &saveptr); + if(address){ + token = strtok_r(NULL, ":", &saveptr); + if(token){ + tmp_int = atoi(token); + if(tmp_int < 1 || tmp_int > 65535){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid port value (%d).", tmp_int); + return MOSQ_ERR_INVAL; + } + cur_bridge->addresses[i].port = tmp_int; + }else{ + cur_bridge->addresses[i].port = 1883; + } + cur_bridge->addresses[i].address = _mosquitto_strdup(address); + _conf_attempt_resolve(address, "bridge address", MOSQ_LOG_WARNING, "Warning"); + } + } + if(cur_bridge->address_count == 0){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Empty address value in configuration."); + return MOSQ_ERR_INVAL; + } +#else + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available."); +#endif + }else if(!strcmp(token, "allow_anonymous")){ + if(_conf_parse_bool(&token, "allow_anonymous", &config->allow_anonymous, saveptr)) return MOSQ_ERR_INVAL; + }else if(!strcmp(token, "allow_duplicate_messages")){ + if(_conf_parse_bool(&token, "allow_duplicate_messages", &config->allow_duplicate_messages, saveptr)) return MOSQ_ERR_INVAL; + }else if(!strcmp(token, "allow_zero_length_clientid")){ + if(_conf_parse_bool(&token, "allow_zero_length_clientid", &config->allow_zero_length_clientid, saveptr)) return MOSQ_ERR_INVAL; + }else if(!strncmp(token, "auth_opt_", 9)){ + if(strlen(token) < 12){ + /* auth_opt_ == 9, + one digit key == 10, + one space == 11, + one value == 12 */ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid auth_opt_ config option."); + return MOSQ_ERR_INVAL; + } + key = _mosquitto_strdup(&token[9]); + if(!key){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + }else if(STREMPTY(key)){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid auth_opt_ config option."); + return MOSQ_ERR_INVAL; + } + token += 9+strlen(key)+1; + while(token[0] == ' ' || token[0] == '\t'){ + token++; + } + if(token[0]){ + config->auth_option_count++; + config->auth_options = _mosquitto_realloc(config->auth_options, config->auth_option_count*sizeof(struct mosquitto_auth_opt)); + if(!config->auth_options){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + config->auth_options[config->auth_option_count-1].key = key; + config->auth_options[config->auth_option_count-1].value = _mosquitto_strdup(token); + if(!config->auth_options[config->auth_option_count-1].value){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + }else{ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Empty %s value in configuration.", key); + return MOSQ_ERR_INVAL; + } + }else if(!strcmp(token, "auth_plugin")){ + if(reload) continue; // Auth plugin not currently valid for reloading. + if(_conf_parse_string(&token, "auth_plugin", &config->auth_plugin, saveptr)) return MOSQ_ERR_INVAL; + }else if(!strcmp(token, "auth_plugin_deny_special_chars")){ + if(reload) continue; // Auth plugin not currently valid for reloading. + if(_conf_parse_bool(&token, "auth_plugin_deny_special_chars", &config->auth_plugin_deny_special_chars, saveptr)) return MOSQ_ERR_INVAL; + }else if(!strcmp(token, "auto_id_prefix")){ + if(_conf_parse_string(&token, "auto_id_prefix", &config->auto_id_prefix, saveptr)) return MOSQ_ERR_INVAL; + if(config->auto_id_prefix){ + config->auto_id_prefix_len = strlen(config->auto_id_prefix); + }else{ + config->auto_id_prefix_len = 0; + } + }else if(!strcmp(token, "autosave_interval")){ + if(_conf_parse_int(&token, "autosave_interval", &config->autosave_interval, saveptr)) return MOSQ_ERR_INVAL; + if(config->autosave_interval < 0) config->autosave_interval = 0; + }else if(!strcmp(token, "autosave_on_changes")){ + if(_conf_parse_bool(&token, "autosave_on_changes", &config->autosave_on_changes, saveptr)) return MOSQ_ERR_INVAL; + }else if(!strcmp(token, "bind_address")){ + if(reload) continue; // Listener not valid for reloading. + if(_conf_parse_string(&token, "default listener bind_address", &config->default_listener.host, saveptr)) return MOSQ_ERR_INVAL; + if(_conf_attempt_resolve(config->default_listener.host, "bind_address", MOSQ_LOG_ERR, "Error")){ + return MOSQ_ERR_INVAL; + } + }else if(!strcmp(token, "bridge_attempt_unsubscribe")){ +#ifdef WITH_BRIDGE + if(reload) continue; // FIXME + if(!cur_bridge){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + if(_conf_parse_bool(&token, "bridge_attempt_unsubscribe", &cur_bridge->attempt_unsubscribe, saveptr)) return MOSQ_ERR_INVAL; +#else + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available."); +#endif + }else if(!strcmp(token, "bridge_cafile")){ +#if defined(WITH_BRIDGE) && defined(WITH_TLS) + if(reload) continue; // FIXME + if(!cur_bridge){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } +#ifdef REAL_WITH_TLS_PSK + if(cur_bridge->tls_psk_identity || cur_bridge->tls_psk){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Cannot use both certificate and psk encryption in a single bridge."); + return MOSQ_ERR_INVAL; + } +#endif + if(_conf_parse_string(&token, "bridge_cafile", &cur_bridge->tls_cafile, saveptr)) return MOSQ_ERR_INVAL; +#else + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge and/or TLS support not available."); +#endif + }else if(!strcmp(token, "bridge_capath")){ +#if defined(WITH_BRIDGE) && defined(WITH_TLS) + if(reload) continue; // FIXME + if(!cur_bridge){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } +#ifdef REAL_WITH_TLS_PSK + if(cur_bridge->tls_psk_identity || cur_bridge->tls_psk){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Cannot use both certificate and psk encryption in a single bridge."); + return MOSQ_ERR_INVAL; + } +#endif + if(_conf_parse_string(&token, "bridge_capath", &cur_bridge->tls_capath, saveptr)) return MOSQ_ERR_INVAL; +#else + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge and/or TLS support not available."); +#endif + }else if(!strcmp(token, "bridge_certfile")){ +#if defined(WITH_BRIDGE) && defined(WITH_TLS) + if(reload) continue; // FIXME + if(!cur_bridge){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } +#ifdef REAL_WITH_TLS_PSK + if(cur_bridge->tls_psk_identity || cur_bridge->tls_psk){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Cannot use both certificate and psk encryption in a single bridge."); + return MOSQ_ERR_INVAL; + } +#endif + if(_conf_parse_string(&token, "bridge_certfile", &cur_bridge->tls_certfile, saveptr)) return MOSQ_ERR_INVAL; +#else + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge and/or TLS support not available."); +#endif + }else if(!strcmp(token, "bridge_identity")){ +#if defined(WITH_BRIDGE) && defined(REAL_WITH_TLS_PSK) + if(reload) continue; // FIXME + if(!cur_bridge){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + if(cur_bridge->tls_cafile || cur_bridge->tls_capath || cur_bridge->tls_certfile || cur_bridge->tls_keyfile){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Cannot use both certificate and identity encryption in a single bridge."); + return MOSQ_ERR_INVAL; + } + if(_conf_parse_string(&token, "bridge_identity", &cur_bridge->tls_psk_identity, saveptr)) return MOSQ_ERR_INVAL; +#else + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge and/or TLS-PSK support not available."); +#endif + }else if(!strcmp(token, "bridge_insecure")){ +#if defined(WITH_BRIDGE) && defined(WITH_TLS) + if(reload) continue; // FIXME + if(!cur_bridge){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + if(_conf_parse_bool(&token, "bridge_insecure", &cur_bridge->tls_insecure, saveptr)) return MOSQ_ERR_INVAL; + if(cur_bridge->tls_insecure){ + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge %s using insecure mode.", cur_bridge->name); + } +#else + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge and/or TLS-PSK support not available."); +#endif + }else if(!strcmp(token, "bridge_keyfile")){ +#if defined(WITH_BRIDGE) && defined(WITH_TLS) + if(reload) continue; // FIXME + if(!cur_bridge){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } +#ifdef REAL_WITH_TLS_PSK + if(cur_bridge->tls_psk_identity || cur_bridge->tls_psk){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Cannot use both certificate and psk encryption in a single bridge."); + return MOSQ_ERR_INVAL; + } +#endif + if(_conf_parse_string(&token, "bridge_keyfile", &cur_bridge->tls_keyfile, saveptr)) return MOSQ_ERR_INVAL; +#else + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge and/or TLS support not available."); +#endif + }else if(!strcmp(token, "bridge_protocol_version")){ +#ifdef WITH_BRIDGE + if(reload) continue; // FIXME + if(!cur_bridge){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + token = strtok_r(NULL, "", &saveptr); + if(token){ + if(!strcmp(token, "mqttv31")){ + cur_bridge->protocol_version = mosq_p_mqtt31; + }else if(!strcmp(token, "mqttv311")){ + cur_bridge->protocol_version = mosq_p_mqtt311; + }else{ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge_protocol_version value (%s).", token); + return MOSQ_ERR_INVAL; + } + }else{ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Empty bridge_protocol_version value in configuration."); + return MOSQ_ERR_INVAL; + } +#else + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available."); +#endif + }else if(!strcmp(token, "bridge_psk")){ +#if defined(WITH_BRIDGE) && defined(REAL_WITH_TLS_PSK) + if(reload) continue; // FIXME + if(!cur_bridge){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + if(cur_bridge->tls_cafile || cur_bridge->tls_capath || cur_bridge->tls_certfile || cur_bridge->tls_keyfile){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Cannot use both certificate and psk encryption in a single bridge."); + return MOSQ_ERR_INVAL; + } + if(_conf_parse_string(&token, "bridge_psk", &cur_bridge->tls_psk, saveptr)) return MOSQ_ERR_INVAL; +#else + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge and/or TLS-PSK support not available."); +#endif + }else if(!strcmp(token, "bridge_tls_version")){ +#if defined(WITH_BRIDGE) && defined(WITH_TLS) + if(reload) continue; // FIXME + if(!cur_bridge){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + if(_conf_parse_string(&token, "bridge_tls_version", &cur_bridge->tls_version, saveptr)) return MOSQ_ERR_INVAL; +#else + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge and/or TLS support not available."); +#endif + }else if(!strcmp(token, "cafile")){ +#if defined(WITH_TLS) + if(reload) continue; // Listeners not valid for reloading. + if(cur_listener->psk_hint){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Cannot use both certificate and psk encryption in a single listener."); + return MOSQ_ERR_INVAL; + } + if(_conf_parse_string(&token, "cafile", &cur_listener->cafile, saveptr)) return MOSQ_ERR_INVAL; +#else + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: TLS support not available."); +#endif + }else if(!strcmp(token, "capath")){ +#ifdef WITH_TLS + if(reload) continue; // Listeners not valid for reloading. + if(_conf_parse_string(&token, "capath", &cur_listener->capath, saveptr)) return MOSQ_ERR_INVAL; +#else + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: TLS support not available."); +#endif + }else if(!strcmp(token, "certfile")){ +#ifdef WITH_TLS + if(reload) continue; // Listeners not valid for reloading. + if(cur_listener->psk_hint){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Cannot use both certificate and psk encryption in a single listener."); + return MOSQ_ERR_INVAL; + } + if(_conf_parse_string(&token, "certfile", &cur_listener->certfile, saveptr)) return MOSQ_ERR_INVAL; +#else + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: TLS support not available."); +#endif + }else if(!strcmp(token, "ciphers")){ +#ifdef WITH_TLS + if(reload) continue; // Listeners not valid for reloading. + if(_conf_parse_string(&token, "ciphers", &cur_listener->ciphers, saveptr)) return MOSQ_ERR_INVAL; +#else + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: TLS support not available."); +#endif + }else if(!strcmp(token, "clientid") || !strcmp(token, "remote_clientid")){ +#ifdef WITH_BRIDGE + if(reload) continue; // FIXME + if(!cur_bridge){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + if(_conf_parse_string(&token, "bridge remote clientid", &cur_bridge->remote_clientid, saveptr)) return MOSQ_ERR_INVAL; +#else + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available."); +#endif + }else if(!strcmp(token, "cleansession")){ +#ifdef WITH_BRIDGE + if(reload) continue; // FIXME + if(!cur_bridge){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + if(_conf_parse_bool(&token, "cleansession", &cur_bridge->clean_session, saveptr)) return MOSQ_ERR_INVAL; +#else + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available."); +#endif + }else if(!strcmp(token, "clientid_prefixes")){ + if(reload){ + if(config->clientid_prefixes){ + _mosquitto_free(config->clientid_prefixes); + config->clientid_prefixes = NULL; + } + } + if(_conf_parse_string(&token, "clientid_prefixes", &config->clientid_prefixes, saveptr)) return MOSQ_ERR_INVAL; + }else if(!strcmp(token, "connection")){ +#ifdef WITH_BRIDGE + if(reload) continue; // FIXME + token = strtok_r(NULL, " ", &saveptr); + if(token){ + /* Check for existing bridge name. */ + for(i=0; ibridge_count; i++){ + if(!strcmp(config->bridges[i].name, token)){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Duplicate bridge name \"%s\".", token); + return MOSQ_ERR_INVAL; + } + } + + config->bridge_count++; + config->bridges = _mosquitto_realloc(config->bridges, config->bridge_count*sizeof(struct _mqtt3_bridge)); + if(!config->bridges){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + cur_bridge = &(config->bridges[config->bridge_count-1]); + memset(cur_bridge, 0, sizeof(struct _mqtt3_bridge)); + cur_bridge->name = _mosquitto_strdup(token); + if(!cur_bridge->name){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + cur_bridge->keepalive = 60; + cur_bridge->notifications = true; + cur_bridge->start_type = bst_automatic; + cur_bridge->idle_timeout = 60; + cur_bridge->restart_timeout = 30; + cur_bridge->threshold = 10; + cur_bridge->try_private = true; + cur_bridge->attempt_unsubscribe = true; + cur_bridge->protocol_version = mosq_p_mqtt31; + }else{ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Empty connection value in configuration."); + return MOSQ_ERR_INVAL; + } +#else + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available."); +#endif + }else if(!strcmp(token, "connection_messages")){ + if(_conf_parse_bool(&token, token, &config->connection_messages, saveptr)) return MOSQ_ERR_INVAL; + }else if(!strcmp(token, "crlfile")){ +#ifdef WITH_TLS + if(reload) continue; // Listeners not valid for reloading. + if(_conf_parse_string(&token, "crlfile", &cur_listener->crlfile, saveptr)) return MOSQ_ERR_INVAL; +#else + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: TLS support not available."); +#endif + }else if(!strcmp(token, "http_dir")){ +#ifdef WITH_WEBSOCKETS + if(reload) continue; // Listeners not valid for reloading. + if(_conf_parse_string(&token, "http_dir", &cur_listener->http_dir, saveptr)) return MOSQ_ERR_INVAL; +#else + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: Websockets support not available."); +#endif + }else if(!strcmp(token, "idle_timeout")){ +#ifdef WITH_BRIDGE + if(reload) continue; // FIXME + if(!cur_bridge){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + if(_conf_parse_int(&token, "idle_timeout", &cur_bridge->idle_timeout, saveptr)) return MOSQ_ERR_INVAL; + if(cur_bridge->idle_timeout < 1){ + _mosquitto_log_printf(NULL, MOSQ_LOG_NOTICE, "idle_timeout interval too low, using 1 second."); + cur_bridge->idle_timeout = 1; + } +#else + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available."); +#endif + }else if(!strcmp(token, "include_dir")){ + if(level == 0){ + /* Only process include_dir from the main config file. */ + token = strtok_r(NULL, "", &saveptr); + if(!token){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Empty include_dir value in configuration."); + } +#ifdef WIN32 + snprintf(dirpath, MAX_PATH, "%s\\*.conf", token); + fh = FindFirstFile(dirpath, &find_data); + if(fh == INVALID_HANDLE_VALUE){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Unable to open include_dir '%s'.", token); + return 1; + } + + do{ + len = strlen(token)+1+strlen(find_data.cFileName)+1; + conf_file = _mosquitto_malloc(len+1); + if(!conf_file){ + FindClose(fh); + return MOSQ_ERR_NOMEM; + } + snprintf(conf_file, len, "%s\\%s", token, find_data.cFileName); + conf_file[len] = '\0'; + + rc = _config_read_file(config, reload, conf_file, cr, level+1, &lineno_ext); + if(rc){ + FindClose(fh); + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error found at %s:%d.", conf_file, lineno_ext); + _mosquitto_free(conf_file); + return rc; + } + _mosquitto_free(conf_file); + }while(FindNextFile(fh, &find_data)); + + FindClose(fh); +#else + dh = opendir(token); + if(!dh){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Unable to open include_dir '%s'.", token); + return 1; + } + while((de = readdir(dh)) != NULL){ + if(strlen(de->d_name) > 5){ + if(!strcmp(&de->d_name[strlen(de->d_name)-5], ".conf")){ + len = strlen(token)+1+strlen(de->d_name)+1; + conf_file = _mosquitto_malloc(len+1); + if(!conf_file){ + closedir(dh); + return MOSQ_ERR_NOMEM; + } + snprintf(conf_file, len, "%s/%s", token, de->d_name); + conf_file[len] = '\0'; + + rc = _config_read_file(config, reload, conf_file, cr, level+1, &lineno_ext); + if(rc){ + closedir(dh); + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error found at %s:%d.", conf_file, lineno_ext); + _mosquitto_free(conf_file); + return rc; + } + _mosquitto_free(conf_file); + } + } + } + closedir(dh); +#endif + } + }else if(!strcmp(token, "keepalive_interval")){ +#ifdef WITH_BRIDGE + if(reload) continue; // FIXME + if(!cur_bridge){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + if(_conf_parse_int(&token, "keepalive_interval", &cur_bridge->keepalive, saveptr)) return MOSQ_ERR_INVAL; + if(cur_bridge->keepalive < 5){ + _mosquitto_log_printf(NULL, MOSQ_LOG_NOTICE, "keepalive interval too low, using 5 seconds."); + cur_bridge->keepalive = 5; + } +#else + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available."); +#endif + }else if(!strcmp(token, "keyfile")){ +#ifdef WITH_TLS + if(reload) continue; // Listeners not valid for reloading. + if(_conf_parse_string(&token, "keyfile", &cur_listener->keyfile, saveptr)) return MOSQ_ERR_INVAL; +#else + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: TLS support not available."); +#endif + }else if(!strcmp(token, "listener")){ + if(reload) continue; // Listeners not valid for reloading. + token = strtok_r(NULL, " ", &saveptr); + if(token){ + config->listener_count++; + config->listeners = _mosquitto_realloc(config->listeners, sizeof(struct _mqtt3_listener)*config->listener_count); + if(!config->listeners){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + tmp_int = atoi(token); + if(tmp_int < 1 || tmp_int > 65535){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid port value (%d).", tmp_int); + return MOSQ_ERR_INVAL; + } + cur_listener = &config->listeners[config->listener_count-1]; + memset(cur_listener, 0, sizeof(struct _mqtt3_listener)); + cur_listener->protocol = mp_mqtt; + cur_listener->port = tmp_int; + token = strtok_r(NULL, "", &saveptr); + if(token){ + cur_listener->host = _mosquitto_strdup(token); + }else{ + cur_listener->host = NULL; + } + }else{ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Empty listener value in configuration."); + return MOSQ_ERR_INVAL; + } + }else if(!strcmp(token, "local_clientid")){ +#ifdef WITH_BRIDGE + if(reload) continue; // FIXME + if(!cur_bridge){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + if(_conf_parse_string(&token, "bridge local clientd", &cur_bridge->local_clientid, saveptr)) return MOSQ_ERR_INVAL; +#else + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available."); +#endif + }else if(!strcmp(token, "local_password")){ +#ifdef WITH_BRIDGE + if(reload) continue; // FIXME + if(!cur_bridge){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + if(_conf_parse_string(&token, "bridge local_password", &cur_bridge->local_password, saveptr)) return MOSQ_ERR_INVAL; +#else + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available."); +#endif + }else if(!strcmp(token, "local_username")){ +#ifdef WITH_BRIDGE + if(reload) continue; // FIXME + if(!cur_bridge){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + if(_conf_parse_string(&token, "bridge local_username", &cur_bridge->local_username, saveptr)) return MOSQ_ERR_INVAL; +#else + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available."); +#endif + }else if(!strcmp(token, "log_dest")){ + token = strtok_r(NULL, " ", &saveptr); + if(token){ + cr->log_dest_set = 1; + if(!strcmp(token, "none")){ + cr->log_dest = MQTT3_LOG_NONE; + }else if(!strcmp(token, "syslog")){ + cr->log_dest |= MQTT3_LOG_SYSLOG; + }else if(!strcmp(token, "stdout")){ + cr->log_dest |= MQTT3_LOG_STDOUT; + }else if(!strcmp(token, "stderr")){ + cr->log_dest |= MQTT3_LOG_STDERR; + }else if(!strcmp(token, "topic")){ + cr->log_dest |= MQTT3_LOG_TOPIC; + }else if(!strcmp(token, "file")){ + cr->log_dest |= MQTT3_LOG_FILE; + if(config->log_fptr || config->log_file){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Duplicate \"log_dest file\" value."); + return MOSQ_ERR_INVAL; + } + /* Get remaining string. */ + token = &token[strlen(token)+1]; + while(token[0] == ' ' || token[0] == '\t'){ + token++; + } + if(token[0]){ + config->log_file = _mosquitto_strdup(token); + if(!config->log_file){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + }else{ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Empty \"log_dest file\" value in configuration."); + return MOSQ_ERR_INVAL; + } + }else{ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid log_dest value (%s).", token); + return MOSQ_ERR_INVAL; + } +#if defined(WIN32) || defined(__CYGWIN__) + if(service_handle){ + if(cr->log_dest == MQTT3_LOG_STDOUT || cr->log_dest == MQTT3_LOG_STDERR){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Cannot log to stdout/stderr when running as a Windows service."); + return MOSQ_ERR_INVAL; + } + } +#endif + }else{ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Empty log_dest value in configuration."); + return MOSQ_ERR_INVAL; + } + }else if(!strcmp(token, "log_facility")){ +#if defined(WIN32) || defined(__CYGWIN__) + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: log_facility not supported on Windows."); +#else + if(_conf_parse_int(&token, "log_facility", &tmp_int, saveptr)) return MOSQ_ERR_INVAL; + switch(tmp_int){ + case 0: + config->log_facility = LOG_LOCAL0; + break; + case 1: + config->log_facility = LOG_LOCAL1; + break; + case 2: + config->log_facility = LOG_LOCAL2; + break; + case 3: + config->log_facility = LOG_LOCAL3; + break; + case 4: + config->log_facility = LOG_LOCAL4; + break; + case 5: + config->log_facility = LOG_LOCAL5; + break; + case 6: + config->log_facility = LOG_LOCAL6; + break; + case 7: + config->log_facility = LOG_LOCAL7; + break; + default: + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid log_facility value (%d).", tmp_int); + return MOSQ_ERR_INVAL; + } +#endif + }else if(!strcmp(token, "log_timestamp")){ + if(_conf_parse_bool(&token, token, &config->log_timestamp, saveptr)) return MOSQ_ERR_INVAL; + }else if(!strcmp(token, "log_type")){ + token = strtok_r(NULL, " ", &saveptr); + if(token){ + cr->log_type_set = 1; + if(!strcmp(token, "none")){ + cr->log_type = MOSQ_LOG_NONE; + }else if(!strcmp(token, "information")){ + cr->log_type |= MOSQ_LOG_INFO; + }else if(!strcmp(token, "notice")){ + cr->log_type |= MOSQ_LOG_NOTICE; + }else if(!strcmp(token, "warning")){ + cr->log_type |= MOSQ_LOG_WARNING; + }else if(!strcmp(token, "error")){ + cr->log_type |= MOSQ_LOG_ERR; + }else if(!strcmp(token, "debug")){ + cr->log_type |= MOSQ_LOG_DEBUG; + }else if(!strcmp(token, "subscribe")){ + cr->log_type |= MOSQ_LOG_SUBSCRIBE; + }else if(!strcmp(token, "unsubscribe")){ + cr->log_type |= MOSQ_LOG_UNSUBSCRIBE; +#ifdef WITH_WEBSOCKETS + }else if(!strcmp(token, "websockets")){ + cr->log_type |= MOSQ_LOG_WEBSOCKETS; +#endif + }else if(!strcmp(token, "all")){ + cr->log_type = INT_MAX; + }else{ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid log_type value (%s).", token); + return MOSQ_ERR_INVAL; + } + }else{ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Empty log_type value in configuration."); + } + }else if(!strcmp(token, "max_connections")){ + if(reload) continue; // Listeners not valid for reloading. + token = strtok_r(NULL, " ", &saveptr); + if(token){ + cur_listener->max_connections = atoi(token); + if(cur_listener->max_connections < 0) cur_listener->max_connections = -1; + }else{ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Empty max_connections value in configuration."); + } + }else if(!strcmp(token, "max_inflight_messages")){ + token = strtok_r(NULL, " ", &saveptr); + if(token){ + cr->max_inflight_messages = atoi(token); + if(cr->max_inflight_messages < 0) cr->max_inflight_messages = 0; + }else{ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Empty max_inflight_messages value in configuration."); + } + }else if(!strcmp(token, "max_queued_messages")){ + token = strtok_r(NULL, " ", &saveptr); + if(token){ + cr->max_queued_messages = atoi(token); + if(cr->max_queued_messages < 0) cr->max_queued_messages = 0; + }else{ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Empty max_queued_messages value in configuration."); + } + }else if(!strcmp(token, "message_size_limit")){ + if(_conf_parse_int(&token, "message_size_limit", (int *)&config->message_size_limit, saveptr)) return MOSQ_ERR_INVAL; + if(config->message_size_limit > MQTT_MAX_PAYLOAD){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid message_size_limit value (%d).", config->message_size_limit); + return MOSQ_ERR_INVAL; + } + }else if(!strcmp(token, "mount_point")){ + if(reload) continue; // Listeners not valid for reloading. + if(config->listener_count == 0){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: You must use create a listener before using the mount_point option in the configuration file."); + return MOSQ_ERR_INVAL; + } + if(_conf_parse_string(&token, "mount_point", &cur_listener->mount_point, saveptr)) return MOSQ_ERR_INVAL; + if(mosquitto_pub_topic_check(cur_listener->mount_point) != MOSQ_ERR_SUCCESS){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, + "Error: Invalid mount_point '%s'. Does it contain a wildcard character?", + cur_listener->mount_point); + return MOSQ_ERR_INVAL; + } + }else if(!strcmp(token, "notifications")){ +#ifdef WITH_BRIDGE + if(reload) continue; // FIXME + if(!cur_bridge){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + if(_conf_parse_bool(&token, "notifications", &cur_bridge->notifications, saveptr)) return MOSQ_ERR_INVAL; +#else + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available."); +#endif + }else if(!strcmp(token, "notification_topic")){ +#ifdef WITH_BRIDGE + if(reload) continue; // FIXME + if(!cur_bridge){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + if(_conf_parse_string(&token, "notification_topic", &cur_bridge->notification_topic, saveptr)) return MOSQ_ERR_INVAL; +#else + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available."); +#endif + }else if(!strcmp(token, "password") || !strcmp(token, "remote_password")){ +#ifdef WITH_BRIDGE + if(reload) continue; // FIXME + if(!cur_bridge){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + if(_conf_parse_string(&token, "bridge remote_password", &cur_bridge->remote_password, saveptr)) return MOSQ_ERR_INVAL; +#else + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available."); +#endif + }else if(!strcmp(token, "password_file")){ + if(reload){ + if(config->password_file){ + _mosquitto_free(config->password_file); + config->password_file = NULL; + } + } + if(_conf_parse_string(&token, "password_file", &config->password_file, saveptr)) return MOSQ_ERR_INVAL; + }else if(!strcmp(token, "persistence") || !strcmp(token, "retained_persistence")){ + if(_conf_parse_bool(&token, token, &config->persistence, saveptr)) return MOSQ_ERR_INVAL; + }else if(!strcmp(token, "persistence_file")){ + if(_conf_parse_string(&token, "persistence_file", &config->persistence_file, saveptr)) return MOSQ_ERR_INVAL; + }else if(!strcmp(token, "persistence_location")){ + if(_conf_parse_string(&token, "persistence_location", &config->persistence_location, saveptr)) return MOSQ_ERR_INVAL; + }else if(!strcmp(token, "persistent_client_expiration")){ + token = strtok_r(NULL, " ", &saveptr); + if(token){ + switch(token[strlen(token)-1]){ + case 'h': + expiration_mult = 3600; + break; + case 'd': + expiration_mult = 86400; + break; + case 'w': + expiration_mult = 86400*7; + break; + case 'm': + expiration_mult = 86400*30; + break; + case 'y': + expiration_mult = 86400*365; + break; + default: + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid persistent_client_expiration duration in configuration."); + return MOSQ_ERR_INVAL; + } + token[strlen(token)-1] = '\0'; + config->persistent_client_expiration = atoi(token)*expiration_mult; + if(config->persistent_client_expiration <= 0){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid persistent_client_expiration duration in configuration."); + return MOSQ_ERR_INVAL; + } + }else{ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Empty persistent_client_expiration value in configuration."); + } + }else if(!strcmp(token, "pid_file")){ + if(reload) continue; // pid file not valid for reloading. + if(_conf_parse_string(&token, "pid_file", &config->pid_file, saveptr)) return MOSQ_ERR_INVAL; + }else if(!strcmp(token, "port")){ + if(reload) continue; // Listener not valid for reloading. + if(config->default_listener.port){ + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: Default listener port specified multiple times. Only the latest will be used."); + } + if(_conf_parse_int(&token, "port", &tmp_int, saveptr)) return MOSQ_ERR_INVAL; + if(tmp_int < 1 || tmp_int > 65535){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid port value (%d).", tmp_int); + return MOSQ_ERR_INVAL; + } + config->default_listener.port = tmp_int; + }else if(!strcmp(token, "protocol")){ + token = strtok_r(NULL, " ", &saveptr); + if(token){ + if(!strcmp(token, "mqtt")){ + cur_listener->protocol = mp_mqtt; + /* + }else if(!strcmp(token, "mqttsn")){ + cur_listener->protocol = mp_mqttsn; + */ + }else if(!strcmp(token, "websockets")){ +#ifdef WITH_WEBSOCKETS + cur_listener->protocol = mp_websockets; + config->have_websockets_listener = true; +#else + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Websockets support not available."); + return MOSQ_ERR_INVAL; +#endif + }else{ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid protocol value (%s).", token); + return MOSQ_ERR_INVAL; + } + }else{ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Empty protocol value in configuration."); + } + }else if(!strcmp(token, "psk_file")){ +#ifdef REAL_WITH_TLS_PSK + if(reload){ + if(config->psk_file){ + _mosquitto_free(config->psk_file); + config->psk_file = NULL; + } + } + if(_conf_parse_string(&token, "psk_file", &config->psk_file, saveptr)) return MOSQ_ERR_INVAL; +#else + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: TLS/TLS-PSK support not available."); +#endif + }else if(!strcmp(token, "psk_hint")){ +#ifdef REAL_WITH_TLS_PSK + if(reload) continue; // Listeners not valid for reloading. + if(_conf_parse_string(&token, "psk_hint", &cur_listener->psk_hint, saveptr)) return MOSQ_ERR_INVAL; +#else + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: TLS/TLS-PSK support not available."); +#endif + }else if(!strcmp(token, "queue_qos0_messages")){ + if(_conf_parse_bool(&token, token, &config->queue_qos0_messages, saveptr)) return MOSQ_ERR_INVAL; + }else if(!strcmp(token, "require_certificate")){ +#ifdef WITH_TLS + if(reload) continue; // Listeners not valid for reloading. + if(_conf_parse_bool(&token, "require_certificate", &cur_listener->require_certificate, saveptr)) return MOSQ_ERR_INVAL; +#else + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: TLS support not available."); +#endif + }else if(!strcmp(token, "restart_timeout")){ +#ifdef WITH_BRIDGE + if(reload) continue; // FIXME + if(!cur_bridge){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + if(_conf_parse_int(&token, "restart_timeout", &cur_bridge->restart_timeout, saveptr)) return MOSQ_ERR_INVAL; + if(cur_bridge->restart_timeout < 1){ + _mosquitto_log_printf(NULL, MOSQ_LOG_NOTICE, "restart_timeout interval too low, using 1 second."); + cur_bridge->restart_timeout = 1; + } +#else + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available."); +#endif + }else if(!strcmp(token, "retry_interval")){ + if(_conf_parse_int(&token, "retry_interval", &config->retry_interval, saveptr)) return MOSQ_ERR_INVAL; + if(config->retry_interval < 1 || config->retry_interval > 3600){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid retry_interval value (%d).", config->retry_interval); + return MOSQ_ERR_INVAL; + } + }else if(!strcmp(token, "round_robin")){ +#ifdef WITH_BRIDGE + if(reload) continue; // FIXME + if(!cur_bridge){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + if(_conf_parse_bool(&token, "round_robin", &cur_bridge->round_robin, saveptr)) return MOSQ_ERR_INVAL; +#else + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available."); +#endif + }else if(!strcmp(token, "start_type")){ +#ifdef WITH_BRIDGE + if(reload) continue; // FIXME + if(!cur_bridge){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + token = strtok_r(NULL, " ", &saveptr); + if(token){ + if(!strcmp(token, "automatic")){ + cur_bridge->start_type = bst_automatic; + }else if(!strcmp(token, "lazy")){ + cur_bridge->start_type = bst_lazy; + }else if(!strcmp(token, "manual")){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Manual start_type not supported."); + return MOSQ_ERR_INVAL; + }else if(!strcmp(token, "once")){ + cur_bridge->start_type = bst_once; + }else{ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid start_type value in configuration (%s).", token); + return MOSQ_ERR_INVAL; + } + }else{ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Empty start_type value in configuration."); + return MOSQ_ERR_INVAL; + } +#else + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available."); +#endif + }else if(!strcmp(token, "store_clean_interval")){ + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: store_clean_interval is no longer needed."); + }else if(!strcmp(token, "sys_interval")){ + if(_conf_parse_int(&token, "sys_interval", &config->sys_interval, saveptr)) return MOSQ_ERR_INVAL; + if(config->sys_interval < 0 || config->sys_interval > 65535){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid sys_interval value (%d).", config->sys_interval); + return MOSQ_ERR_INVAL; + } + }else if(!strcmp(token, "threshold")){ +#ifdef WITH_BRIDGE + if(reload) continue; // FIXME + if(!cur_bridge){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + if(_conf_parse_int(&token, "threshold", &cur_bridge->threshold, saveptr)) return MOSQ_ERR_INVAL; + if(cur_bridge->threshold < 1){ + _mosquitto_log_printf(NULL, MOSQ_LOG_NOTICE, "threshold too low, using 1 message."); + cur_bridge->threshold = 1; + } +#else + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available."); +#endif + }else if(!strcmp(token, "tls_version")){ +#if defined(WITH_TLS) + if(reload) continue; // Listeners not valid for reloading. + if(_conf_parse_string(&token, "tls_version", &cur_listener->tls_version, saveptr)) return MOSQ_ERR_INVAL; +#else + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: TLS support not available."); +#endif + }else if(!strcmp(token, "topic")){ +#ifdef WITH_BRIDGE + if(reload) continue; // FIXME + if(!cur_bridge){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + token = strtok_r(NULL, " ", &saveptr); + if(token){ + cur_bridge->topic_count++; + cur_bridge->topics = _mosquitto_realloc(cur_bridge->topics, + sizeof(struct _mqtt3_bridge_topic)*cur_bridge->topic_count); + if(!cur_bridge->topics){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + cur_topic = &cur_bridge->topics[cur_bridge->topic_count-1]; + if(!strcmp(token, "\"\"")){ + cur_topic->topic = NULL; + }else{ + cur_topic->topic = _mosquitto_strdup(token); + if(!cur_topic->topic){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + } + cur_topic->direction = bd_out; + cur_topic->qos = 0; + cur_topic->local_prefix = NULL; + cur_topic->remote_prefix = NULL; + }else{ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Empty topic value in configuration."); + return MOSQ_ERR_INVAL; + } + token = strtok_r(NULL, " ", &saveptr); + if(token){ + if(!strcasecmp(token, "out")){ + cur_topic->direction = bd_out; + }else if(!strcasecmp(token, "in")){ + cur_topic->direction = bd_in; + }else if(!strcasecmp(token, "both")){ + cur_topic->direction = bd_both; + }else{ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge topic direction '%s'.", token); + return MOSQ_ERR_INVAL; + } + token = strtok_r(NULL, " ", &saveptr); + if(token){ + cur_topic->qos = atoi(token); + if(cur_topic->qos < 0 || cur_topic->qos > 2){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge QoS level '%s'.", token); + return MOSQ_ERR_INVAL; + } + + token = strtok_r(NULL, " ", &saveptr); + if(token){ + cur_bridge->topic_remapping = true; + if(!strcmp(token, "\"\"")){ + cur_topic->local_prefix = NULL; + }else{ + if(mosquitto_pub_topic_check(token) != MOSQ_ERR_SUCCESS){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge topic local prefix '%s'.", token); + return MOSQ_ERR_INVAL; + } + cur_topic->local_prefix = _mosquitto_strdup(token); + if(!cur_topic->local_prefix){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + } + + token = strtok_r(NULL, " ", &saveptr); + if(token){ + if(!strcmp(token, "\"\"")){ + cur_topic->remote_prefix = NULL; + }else{ + if(mosquitto_pub_topic_check(token) != MOSQ_ERR_SUCCESS){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge topic remote prefix '%s'.", token); + return MOSQ_ERR_INVAL; + } + cur_topic->remote_prefix = _mosquitto_strdup(token); + if(!cur_topic->remote_prefix){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + } + } + } + } + } + if(cur_topic->topic == NULL && + (cur_topic->local_prefix == NULL || cur_topic->remote_prefix == NULL)){ + + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge remapping."); + return MOSQ_ERR_INVAL; + } + if(cur_topic->local_prefix){ + if(cur_topic->topic){ + len = strlen(cur_topic->topic) + strlen(cur_topic->local_prefix)+1; + cur_topic->local_topic = _mosquitto_malloc(len+1); + if(!cur_topic->local_topic){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + snprintf(cur_topic->local_topic, len+1, "%s%s", cur_topic->local_prefix, cur_topic->topic); + cur_topic->local_topic[len] = '\0'; + }else{ + cur_topic->local_topic = _mosquitto_strdup(cur_topic->local_prefix); + if(!cur_topic->local_topic){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + } + }else{ + cur_topic->local_topic = _mosquitto_strdup(cur_topic->topic); + if(!cur_topic->local_topic){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + } + + if(cur_topic->remote_prefix){ + if(cur_topic->topic){ + len = strlen(cur_topic->topic) + strlen(cur_topic->remote_prefix)+1; + cur_topic->remote_topic = _mosquitto_malloc(len+1); + if(!cur_topic->remote_topic){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + snprintf(cur_topic->remote_topic, len, "%s%s", cur_topic->remote_prefix, cur_topic->topic); + cur_topic->remote_topic[len] = '\0'; + }else{ + cur_topic->remote_topic = _mosquitto_strdup(cur_topic->remote_prefix); + if(!cur_topic->remote_topic){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + } + }else{ + cur_topic->remote_topic = _mosquitto_strdup(cur_topic->topic); + if(!cur_topic->remote_topic){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + } +#else + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available."); +#endif + }else if(!strcmp(token, "try_private")){ +#ifdef WITH_BRIDGE + if(reload) continue; // FIXME + if(!cur_bridge){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + if(_conf_parse_bool(&token, "try_private", &cur_bridge->try_private, saveptr)) return MOSQ_ERR_INVAL; +#else + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available."); +#endif + }else if(!strcmp(token, "upgrade_outgoing_qos")){ + if(_conf_parse_bool(&token, token, &config->upgrade_outgoing_qos, saveptr)) return MOSQ_ERR_INVAL; + }else if(!strcmp(token, "use_identity_as_username")){ +#ifdef WITH_TLS + if(reload) continue; // Listeners not valid for reloading. + if(_conf_parse_bool(&token, "use_identity_as_username", &cur_listener->use_identity_as_username, saveptr)) return MOSQ_ERR_INVAL; +#else + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: TLS support not available."); +#endif + }else if(!strcmp(token, "user")){ + if(reload) continue; // Drop privileges user not valid for reloading. + if(_conf_parse_string(&token, "user", &config->user, saveptr)) return MOSQ_ERR_INVAL; + }else if(!strcmp(token, "use_username_as_clientid")){ + if(reload) continue; // Listeners not valid for reloading. + if(_conf_parse_bool(&token, "use_username_as_clientid", &cur_listener->use_username_as_clientid, saveptr)) return MOSQ_ERR_INVAL; + }else if(!strcmp(token, "username") || !strcmp(token, "remote_username")){ +#ifdef WITH_BRIDGE + if(reload) continue; // FIXME + if(!cur_bridge){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); + return MOSQ_ERR_INVAL; + } + token = strtok_r(NULL, " ", &saveptr); + if(token){ + if(cur_bridge->remote_username){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Duplicate username value in bridge configuration."); + return MOSQ_ERR_INVAL; + } + cur_bridge->remote_username = _mosquitto_strdup(token); + if(!cur_bridge->remote_username){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + }else{ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Empty username value in configuration."); + return MOSQ_ERR_INVAL; + } +#else + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available."); +#endif + }else if(!strcmp(token, "websockets_log_level")){ +#ifdef WITH_WEBSOCKETS + if(_conf_parse_int(&token, "websockets_log_level", &config->websockets_log_level, saveptr)) return MOSQ_ERR_INVAL; +#else + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: Websockets support not available."); +#endif + }else if(!strcmp(token, "trace_level") + || !strcmp(token, "ffdc_output") + || !strcmp(token, "max_log_entries") + || !strcmp(token, "trace_output")){ + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: Unsupported rsmb configuration option \"%s\".", token); + }else{ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Unknown configuration variable \"%s\".", token); + return MOSQ_ERR_INVAL; + } + } + } + } + return MOSQ_ERR_SUCCESS; +} + +int _config_read_file(struct mqtt3_config *config, bool reload, const char *file, struct config_recurse *cr, int level, int *lineno) +{ + int rc; + FILE *fptr = NULL; + + fptr = _mosquitto_fopen(file, "rt", false); + if(!fptr){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Unable to open config file %s\n", file); + return 1; + } + + rc = _config_read_file_core(config, reload, file, cr, level, lineno, fptr); + fclose(fptr); + + return rc; +} + +static int _conf_parse_bool(char **token, const char *name, bool *value, char *saveptr) +{ + *token = strtok_r(NULL, " ", &saveptr); + if(*token){ + if(!strcmp(*token, "false") || !strcmp(*token, "0")){ + *value = false; + }else if(!strcmp(*token, "true") || !strcmp(*token, "1")){ + *value = true; + }else{ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid %s value (%s).", name, *token); + } + }else{ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Empty %s value in configuration.", name); + return MOSQ_ERR_INVAL; + } + + return MOSQ_ERR_SUCCESS; +} + +static int _conf_parse_int(char **token, const char *name, int *value, char *saveptr) +{ + *token = strtok_r(NULL, " ", &saveptr); + if(*token){ + *value = atoi(*token); + }else{ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Empty %s value in configuration.", name); + return MOSQ_ERR_INVAL; + } + + return MOSQ_ERR_SUCCESS; +} + +static int _conf_parse_string(char **token, const char *name, char **value, char *saveptr) +{ + *token = strtok_r(NULL, "", &saveptr); + if(*token){ + if(*value){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Duplicate %s value in configuration.", name); + return MOSQ_ERR_INVAL; + } + /* Deal with multiple spaces at the beginning of the string. */ + while((*token)[0] == ' ' || (*token)[0] == '\t'){ + (*token)++; + } + *value = _mosquitto_strdup(*token); + if(!*value){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + }else{ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Empty %s value in configuration.", name); + return MOSQ_ERR_INVAL; + } + return MOSQ_ERR_SUCCESS; +} diff --git a/src/libs/mosquitto/src/context.c b/src/libs/mosquitto/src/context.c new file mode 100644 index 0000000..561ff4a --- /dev/null +++ b/src/libs/mosquitto/src/context.c @@ -0,0 +1,233 @@ +/* +Copyright (c) 2009-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include +#include + +#include + +#include +#include +#include + +#include "uthash.h" + +struct mosquitto *mqtt3_context_init(struct mosquitto_db *db, mosq_sock_t sock) +{ + struct mosquitto *context; + char address[1024]; + + context = _mosquitto_calloc(1, sizeof(struct mosquitto)); + if(!context) return NULL; + + context->state = mosq_cs_new; + context->sock = sock; + context->last_msg_in = mosquitto_time(); + context->next_msg_out = mosquitto_time() + 60; + context->keepalive = 60; /* Default to 60s */ + context->clean_session = true; + context->disconnect_t = 0; + context->id = NULL; + context->last_mid = 0; + context->will = NULL; + context->username = NULL; + context->password = NULL; + context->listener = NULL; + context->acl_list = NULL; + /* is_bridge records whether this client is a bridge or not. This could be + * done by looking at context->bridge for bridges that we create ourself, + * but incoming bridges need some other way of being recorded. */ + context->is_bridge = false; + + context->in_packet.payload = NULL; + _mosquitto_packet_cleanup(&context->in_packet); + context->out_packet = NULL; + context->current_out_packet = NULL; + + context->address = NULL; + if((int)sock >= 0){ + if(!_mosquitto_socket_get_address(sock, address, 1024)){ + context->address = _mosquitto_strdup(address); + } + if(!context->address){ + /* getpeername and inet_ntop failed and not a bridge */ + _mosquitto_free(context); + return NULL; + } + } + context->bridge = NULL; + context->msgs = NULL; + context->last_msg = NULL; + context->msg_count = 0; + context->msg_count12 = 0; +#ifdef WITH_TLS + context->ssl = NULL; +#endif + + if((int)context->sock >= 0){ + HASH_ADD(hh_sock, db->contexts_by_sock, sock, sizeof(context->sock), context); + } + return context; +} + +/* + * This will result in any outgoing packets going unsent. If we're disconnected + * forcefully then it is usually an error condition and shouldn't be a problem, + * but it will mean that CONNACK messages will never get sent for bad protocol + * versions for example. + */ +void mqtt3_context_cleanup(struct mosquitto_db *db, struct mosquitto *context, bool do_free) +{ + struct _mosquitto_packet *packet; + struct mosquitto_client_msg *msg, *next; + int i; + + if(!context) return; + + if(context->username){ + _mosquitto_free(context->username); + context->username = NULL; + } + if(context->password){ + _mosquitto_free(context->password); + context->password = NULL; + } +#ifdef WITH_BRIDGE + if(context->bridge){ + for(i=0; ibridge_count; i++){ + if(db->bridges[i] == context){ + db->bridges[i] = NULL; + } + } + if(context->bridge->local_clientid){ + _mosquitto_free(context->bridge->local_clientid); + context->bridge->local_clientid = NULL; + } + if(context->bridge->remote_username){ + context->bridge->remote_username = NULL; + } + if(context->bridge->remote_password){ + context->bridge->remote_password = NULL; + } + if(context->bridge->local_username){ + context->bridge->local_username = NULL; + } + if(context->bridge->local_password){ + context->bridge->local_password = NULL; + } + if(context->bridge->local_clientid){ + context->bridge->local_clientid = NULL; + } + } +#endif + _mosquitto_socket_close(db, context); + if((do_free || context->clean_session) && db){ + mqtt3_subs_clean_session(db, context); + mqtt3_db_messages_delete(db, context); + } + if(context->address){ + _mosquitto_free(context->address); + context->address = NULL; + } + + mqtt3_context_send_will(db, context); + + if(context->id){ + assert(db); /* db can only be NULL here if the client hasn't sent a + CONNECT and hence wouldn't have an id. */ + + HASH_DELETE(hh_id, db->contexts_by_id, context); + _mosquitto_free(context->id); + context->id = NULL; + } + _mosquitto_packet_cleanup(&(context->in_packet)); + if(context->current_out_packet){ + _mosquitto_packet_cleanup(context->current_out_packet); + _mosquitto_free(context->current_out_packet); + context->current_out_packet = NULL; + } + while(context->out_packet){ + _mosquitto_packet_cleanup(context->out_packet); + packet = context->out_packet; + context->out_packet = context->out_packet->next; + _mosquitto_free(packet); + } + if(do_free || context->clean_session){ + msg = context->msgs; + while(msg){ + next = msg->next; + mosquitto__db_msg_store_deref(db, &msg->store); + _mosquitto_free(msg); + msg = next; + } + context->msgs = NULL; + context->last_msg = NULL; + } + if(do_free){ + _mosquitto_free(context); + } +} + + +void mqtt3_context_send_will(struct mosquitto_db *db, struct mosquitto *ctxt) +{ + if(ctxt->state != mosq_cs_disconnecting && ctxt->will){ + if(mosquitto_acl_check(db, ctxt, ctxt->will->topic, MOSQ_ACL_WRITE) == MOSQ_ERR_SUCCESS){ + /* Unexpected disconnect, queue the client will. */ + mqtt3_db_messages_easy_queue(db, ctxt, ctxt->will->topic, ctxt->will->qos, ctxt->will->payloadlen, ctxt->will->payload, ctxt->will->retain); + } + } + if(ctxt->will){ + if(ctxt->will->topic) _mosquitto_free(ctxt->will->topic); + if(ctxt->will->payload) _mosquitto_free(ctxt->will->payload); + _mosquitto_free(ctxt->will); + ctxt->will = NULL; + } +} + + +void mqtt3_context_disconnect(struct mosquitto_db *db, struct mosquitto *ctxt) +{ + mqtt3_context_send_will(db, ctxt); + + ctxt->disconnect_t = time(NULL); + _mosquitto_socket_close(db, ctxt); +} + +void mosquitto__add_context_to_disused(struct mosquitto_db *db, struct mosquitto *context) +{ + if(db->ll_for_free){ + context->for_free_next = db->ll_for_free; + db->ll_for_free = context; + }else{ + db->ll_for_free = context; + } +} + +void mosquitto__free_disused_contexts(struct mosquitto_db *db) +{ + struct mosquitto *context, *next; + assert(db); + + context = db->ll_for_free; + while(context){ + next = context->for_free_next; + mqtt3_context_cleanup(db, context, true); + context = next; + } + db->ll_for_free = NULL; +} + diff --git a/src/libs/mosquitto/src/database.c b/src/libs/mosquitto/src/database.c new file mode 100644 index 0000000..1ea994a --- /dev/null +++ b/src/libs/mosquitto/src/database.c @@ -0,0 +1,946 @@ +/* +Copyright (c) 2009-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include +#include + +#include + +#include +#include +#include +#include + +static int max_inflight = 20; +static int max_queued = 100; +#ifdef WITH_SYS_TREE +extern unsigned long g_msgs_dropped; +#endif + +int mqtt3_db_open(struct mqtt3_config *config, struct mosquitto_db *db) +{ + int rc = 0; + struct _mosquitto_subhier *child; + + if(!config || !db) return MOSQ_ERR_INVAL; + + db->last_db_id = 0; + + db->contexts_by_id = NULL; + db->contexts_by_sock = NULL; + db->contexts_for_free = NULL; +#ifdef WITH_BRIDGE + db->bridges = NULL; + db->bridge_count = 0; +#endif + + // Initialize the hashtable + db->clientid_index_hash = NULL; + + db->subs.next = NULL; + db->subs.subs = NULL; + db->subs.topic = ""; + + child = _mosquitto_malloc(sizeof(struct _mosquitto_subhier)); + if(!child){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + child->parent = NULL; + child->next = NULL; + child->topic = _mosquitto_strdup(""); + if(!child->topic){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + child->subs = NULL; + child->children = NULL; + child->retained = NULL; + db->subs.children = child; + + child = _mosquitto_malloc(sizeof(struct _mosquitto_subhier)); + if(!child){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + child->parent = NULL; + child->next = NULL; + child->topic = _mosquitto_strdup("$SYS"); + if(!child->topic){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + child->subs = NULL; + child->children = NULL; + child->retained = NULL; + db->subs.children->next = child; + + db->unpwd = NULL; + +#ifdef WITH_PERSISTENCE + if(config->persistence && config->persistence_filepath){ + if(mqtt3_db_restore(db)) return 1; + } +#endif + + return rc; +} + +static void subhier_clean(struct mosquitto_db *db, struct _mosquitto_subhier *subhier) +{ + struct _mosquitto_subhier *next; + struct _mosquitto_subleaf *leaf, *nextleaf; + + while(subhier){ + next = subhier->next; + leaf = subhier->subs; + while(leaf){ + nextleaf = leaf->next; + _mosquitto_free(leaf); + leaf = nextleaf; + } + if(subhier->retained){ + mosquitto__db_msg_store_deref(db, &subhier->retained); + } + subhier_clean(db, subhier->children); + if(subhier->topic) _mosquitto_free(subhier->topic); + + _mosquitto_free(subhier); + subhier = next; + } +} + +int mqtt3_db_close(struct mosquitto_db *db) +{ + subhier_clean(db, db->subs.children); + mosquitto__db_msg_store_clean(db); + + return MOSQ_ERR_SUCCESS; +} + + +void mosquitto__db_msg_store_add(struct mosquitto_db *db, struct mosquitto_msg_store *store) +{ + store->next = db->msg_store; + store->prev = NULL; + if(db->msg_store){ + db->msg_store->prev = store; + } + db->msg_store = store; +} + + +void mosquitto__db_msg_store_remove(struct mosquitto_db *db, struct mosquitto_msg_store *store) +{ + int i; + + if(store->prev){ + store->prev->next = store->next; + if(store->next){ + store->next->prev = store->prev; + } + }else{ + db->msg_store = store->next; + if(store->next){ + store->next->prev = NULL; + } + } + db->msg_store_count--; + + if(store->source_id) _mosquitto_free(store->source_id); + if(store->dest_ids){ + for(i=0; idest_id_count; i++){ + if(store->dest_ids[i]) _mosquitto_free(store->dest_ids[i]); + } + _mosquitto_free(store->dest_ids); + } + if(store->topic) _mosquitto_free(store->topic); + if(store->payload) _mosquitto_free(store->payload); + _mosquitto_free(store); +} + + +void mosquitto__db_msg_store_clean(struct mosquitto_db *db) +{ + struct mosquitto_msg_store *store, *next;; + + store = db->msg_store; + while(store){ + next = store->next; + mosquitto__db_msg_store_remove(db, store); + store = next; + } +} + +void mosquitto__db_msg_store_deref(struct mosquitto_db *db, struct mosquitto_msg_store **store) +{ + (*store)->ref_count--; + if((*store)->ref_count == 0){ + mosquitto__db_msg_store_remove(db, *store); + *store = NULL; + } +} + + +static void _message_remove(struct mosquitto_db *db, struct mosquitto *context, struct mosquitto_client_msg **msg, struct mosquitto_client_msg *last) +{ + int i; + struct mosquitto_client_msg *tail; + + if(!context || !msg || !(*msg)){ + return; + } + + if((*msg)->store){ + mosquitto__db_msg_store_deref(db, &(*msg)->store); + } + if(last){ + last->next = (*msg)->next; + if(!last->next){ + context->last_msg = last; + } + }else{ + context->msgs = (*msg)->next; + if(!context->msgs){ + context->last_msg = NULL; + } + } + context->msg_count--; + if((*msg)->qos > 0){ + context->msg_count12--; + } + _mosquitto_free(*msg); + if(last){ + *msg = last->next; + }else{ + *msg = context->msgs; + } + tail = context->msgs; + i = 0; + while(tail && tail->state == mosq_ms_queued && idirection == mosq_md_out){ + switch(tail->qos){ + case 0: + tail->state = mosq_ms_publish_qos0; + break; + case 1: + tail->state = mosq_ms_publish_qos1; + break; + case 2: + tail->state = mosq_ms_publish_qos2; + break; + } + }else{ + if(tail->qos == 2){ + tail->state = mosq_ms_send_pubrec; + } + } + + tail = tail->next; + } +} + +int mqtt3_db_message_delete(struct mosquitto_db *db, struct mosquitto *context, uint16_t mid, enum mosquitto_msg_direction dir) +{ + struct mosquitto_client_msg *tail, *last = NULL; + int msg_index = 0; + bool deleted = false; + + if(!context) return MOSQ_ERR_INVAL; + + tail = context->msgs; + while(tail){ + msg_index++; + if(tail->state == mosq_ms_queued && msg_index <= max_inflight){ + tail->timestamp = mosquitto_time(); + if(tail->direction == mosq_md_out){ + switch(tail->qos){ + case 0: + tail->state = mosq_ms_publish_qos0; + break; + case 1: + tail->state = mosq_ms_publish_qos1; + break; + case 2: + tail->state = mosq_ms_publish_qos2; + break; + } + }else{ + if(tail->qos == 2){ + tail->state = mosq_ms_wait_for_pubrel; + } + } + } + if(tail->mid == mid && tail->direction == dir){ + msg_index--; + _message_remove(db, context, &tail, last); + deleted = true; + }else{ + last = tail; + tail = tail->next; + } + if(msg_index > max_inflight && deleted){ + return MOSQ_ERR_SUCCESS; + } + } + + return MOSQ_ERR_SUCCESS; +} + +int mqtt3_db_message_insert(struct mosquitto_db *db, struct mosquitto *context, uint16_t mid, enum mosquitto_msg_direction dir, int qos, bool retain, struct mosquitto_msg_store *stored) +{ + struct mosquitto_client_msg *msg; + enum mosquitto_msg_state state = mosq_ms_invalid; + int rc = 0; + int i; + char **dest_ids; + + assert(stored); + if(!context) return MOSQ_ERR_INVAL; + if(!context->id) return MOSQ_ERR_SUCCESS; /* Protect against unlikely "client is disconnected but not entirely freed" scenario */ + + /* Check whether we've already sent this message to this client + * for outgoing messages only. + * If retain==true then this is a stale retained message and so should be + * sent regardless. FIXME - this does mean retained messages will received + * multiple times for overlapping subscriptions, although this is only the + * case for SUBSCRIPTION with multiple subs in so is a minor concern. + */ + if(db->config->allow_duplicate_messages == false + && dir == mosq_md_out && retain == false && stored->dest_ids){ + + for(i=0; idest_id_count; i++){ + if(!strcmp(stored->dest_ids[i], context->id)){ + /* We have already sent this message to this client. */ + return MOSQ_ERR_SUCCESS; + } + } + } + if(context->sock == INVALID_SOCKET){ + /* Client is not connected only queue messages with QoS>0. */ + if(qos == 0 && !db->config->queue_qos0_messages){ + if(!context->bridge){ + return 2; + }else{ + if(context->bridge->start_type != bst_lazy){ + return 2; + } + } + } + } + + if(context->sock != INVALID_SOCKET){ + if(qos == 0 || max_inflight == 0 || context->msg_count12 < max_inflight){ + if(dir == mosq_md_out){ + switch(qos){ + case 0: + state = mosq_ms_publish_qos0; + break; + case 1: + state = mosq_ms_publish_qos1; + break; + case 2: + state = mosq_ms_publish_qos2; + break; + } + }else{ + if(qos == 2){ + state = mosq_ms_wait_for_pubrel; + }else{ + return 1; + } + } + }else if(max_queued == 0 || context->msg_count12-max_inflight < max_queued){ + state = mosq_ms_queued; + rc = 2; + }else{ + /* Dropping message due to full queue. */ + if(context->is_dropping == false){ + context->is_dropping = true; + _mosquitto_log_printf(NULL, MOSQ_LOG_NOTICE, + "Outgoing messages are being dropped for client %s.", + context->id); + } +#ifdef WITH_SYS_TREE + g_msgs_dropped++; +#endif + return 2; + } + }else{ + if(max_queued > 0 && context->msg_count12 >= max_queued){ +#ifdef WITH_SYS_TREE + g_msgs_dropped++; +#endif + if(context->is_dropping == false){ + context->is_dropping = true; + _mosquitto_log_printf(NULL, MOSQ_LOG_NOTICE, + "Outgoing messages are being dropped for client %s.", + context->id); + } + return 2; + }else{ + state = mosq_ms_queued; + } + } + assert(state != mosq_ms_invalid); + +#ifdef WITH_PERSISTENCE + if(state == mosq_ms_queued){ + db->persistence_changes++; + } +#endif + + msg = _mosquitto_malloc(sizeof(struct mosquitto_client_msg)); + if(!msg) return MOSQ_ERR_NOMEM; + msg->next = NULL; + msg->store = stored; + msg->store->ref_count++; + msg->mid = mid; + msg->timestamp = mosquitto_time(); + msg->direction = dir; + msg->state = state; + msg->dup = false; + msg->qos = qos; + msg->retain = retain; + if(context->last_msg){ + context->last_msg->next = msg; + context->last_msg = msg; + }else{ + context->msgs = msg; + context->last_msg = msg; + } + context->msg_count++; + if(qos > 0){ + context->msg_count12++; + } + + if(db->config->allow_duplicate_messages == false && dir == mosq_md_out && retain == false){ + /* Record which client ids this message has been sent to so we can avoid duplicates. + * Outgoing messages only. + * If retain==true then this is a stale retained message and so should be + * sent regardless. FIXME - this does mean retained messages will received + * multiple times for overlapping subscriptions, although this is only the + * case for SUBSCRIPTION with multiple subs in so is a minor concern. + */ + dest_ids = _mosquitto_realloc(stored->dest_ids, sizeof(char *)*(stored->dest_id_count+1)); + if(dest_ids){ + stored->dest_ids = dest_ids; + stored->dest_id_count++; + stored->dest_ids[stored->dest_id_count-1] = _mosquitto_strdup(context->id); + if(!stored->dest_ids[stored->dest_id_count-1]){ + return MOSQ_ERR_NOMEM; + } + }else{ + return MOSQ_ERR_NOMEM; + } + } +#ifdef WITH_BRIDGE + if(context->bridge && context->bridge->start_type == bst_lazy + && context->sock == INVALID_SOCKET + && context->msg_count >= context->bridge->threshold){ + + context->bridge->lazy_reconnect = true; + } +#endif + +#ifdef WITH_WEBSOCKETS + if(context->wsi && rc == 0){ + return mqtt3_db_message_write(db, context); + }else{ + return rc; + } +#else + return rc; +#endif +} + +int mqtt3_db_message_update(struct mosquitto *context, uint16_t mid, enum mosquitto_msg_direction dir, enum mosquitto_msg_state state) +{ + struct mosquitto_client_msg *tail; + + tail = context->msgs; + while(tail){ + if(tail->mid == mid && tail->direction == dir){ + tail->state = state; + tail->timestamp = mosquitto_time(); + return MOSQ_ERR_SUCCESS; + } + tail = tail->next; + } + return MOSQ_ERR_NOT_FOUND; +} + +int mqtt3_db_messages_delete(struct mosquitto_db *db, struct mosquitto *context) +{ + struct mosquitto_client_msg *tail, *next; + + if(!context) return MOSQ_ERR_INVAL; + + tail = context->msgs; + while(tail){ + mosquitto__db_msg_store_deref(db, &tail->store); + next = tail->next; + _mosquitto_free(tail); + tail = next; + } + context->msgs = NULL; + context->last_msg = NULL; + context->msg_count = 0; + context->msg_count12 = 0; + + return MOSQ_ERR_SUCCESS; +} + +int mqtt3_db_messages_easy_queue(struct mosquitto_db *db, struct mosquitto *context, const char *topic, int qos, uint32_t payloadlen, const void *payload, int retain) +{ + struct mosquitto_msg_store *stored; + char *source_id; + + assert(db); + + if(!topic) return MOSQ_ERR_INVAL; + + if(context && context->id){ + source_id = context->id; + }else{ + source_id = ""; + } + if(mqtt3_db_message_store(db, source_id, 0, topic, qos, payloadlen, payload, retain, &stored, 0)) return 1; + + return mqtt3_db_messages_queue(db, source_id, topic, qos, retain, &stored); +} + +int mqtt3_db_message_store(struct mosquitto_db *db, const char *source, uint16_t source_mid, const char *topic, int qos, uint32_t payloadlen, const void *payload, int retain, struct mosquitto_msg_store **stored, dbid_t store_id) +{ + struct mosquitto_msg_store *temp; + + assert(db); + assert(stored); + + temp = _mosquitto_malloc(sizeof(struct mosquitto_msg_store)); + if(!temp) return MOSQ_ERR_NOMEM; + + temp->ref_count = 0; + if(source){ + temp->source_id = _mosquitto_strdup(source); + }else{ + temp->source_id = _mosquitto_strdup(""); + } + if(!temp->source_id){ + _mosquitto_free(temp); + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + temp->source_mid = source_mid; + temp->mid = 0; + temp->qos = qos; + temp->retain = retain; + if(topic){ + temp->topic = _mosquitto_strdup(topic); + if(!temp->topic){ + _mosquitto_free(temp->source_id); + _mosquitto_free(temp); + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + }else{ + temp->topic = NULL; + } + temp->payloadlen = payloadlen; + if(payloadlen){ + temp->payload = _mosquitto_malloc(sizeof(char)*payloadlen); + if(!temp->payload){ + if(temp->source_id) _mosquitto_free(temp->source_id); + if(temp->topic) _mosquitto_free(temp->topic); + if(temp->payload) _mosquitto_free(temp->payload); + _mosquitto_free(temp); + return MOSQ_ERR_NOMEM; + } + memcpy(temp->payload, payload, sizeof(char)*payloadlen); + }else{ + temp->payload = NULL; + } + + if(!temp->source_id || (payloadlen && !temp->payload)){ + if(temp->source_id) _mosquitto_free(temp->source_id); + if(temp->topic) _mosquitto_free(temp->topic); + if(temp->payload) _mosquitto_free(temp->payload); + _mosquitto_free(temp); + return 1; + } + temp->dest_ids = NULL; + temp->dest_id_count = 0; + db->msg_store_count++; + (*stored) = temp; + + if(!store_id){ + temp->db_id = ++db->last_db_id; + }else{ + temp->db_id = store_id; + } + + mosquitto__db_msg_store_add(db, temp); + + return MOSQ_ERR_SUCCESS; +} + +int mqtt3_db_message_store_find(struct mosquitto *context, uint16_t mid, struct mosquitto_msg_store **stored) +{ + struct mosquitto_client_msg *tail; + + if(!context) return MOSQ_ERR_INVAL; + + *stored = NULL; + tail = context->msgs; + while(tail){ + if(tail->store->source_mid == mid && tail->direction == mosq_md_in){ + *stored = tail->store; + return MOSQ_ERR_SUCCESS; + } + tail = tail->next; + } + + return 1; +} + +/* Called on reconnect to set outgoing messages to a sensible state and force a + * retry, and to set incoming messages to expect an appropriate retry. */ +int mqtt3_db_message_reconnect_reset(struct mosquitto_db *db, struct mosquitto *context) +{ + struct mosquitto_client_msg *msg; + struct mosquitto_client_msg *prev = NULL; + int count; + + msg = context->msgs; + context->msg_count = 0; + context->msg_count12 = 0; + while(msg){ + context->last_msg = msg; + + context->msg_count++; + if(msg->qos > 0){ + context->msg_count12++; + } + + if(msg->direction == mosq_md_out){ + if(msg->state != mosq_ms_queued){ + switch(msg->qos){ + case 0: + msg->state = mosq_ms_publish_qos0; + break; + case 1: + msg->state = mosq_ms_publish_qos1; + break; + case 2: + if(msg->state == mosq_ms_wait_for_pubcomp){ + msg->state = mosq_ms_resend_pubrel; + }else{ + msg->state = mosq_ms_publish_qos2; + } + break; + } + } + }else{ + if(msg->qos != 2){ + /* Anything next; + } + /* Messages received when the client was disconnected are put + * in the mosq_ms_queued state. If we don't change them to the + * appropriate "publish" state, then the queued messages won't + * get sent until the client next receives a message - and they + * will be sent out of order. + */ + if(context->msgs){ + count = 0; + msg = context->msgs; + while(msg && (max_inflight == 0 || count < max_inflight)){ + if(msg->state == mosq_ms_queued){ + switch(msg->qos){ + case 0: + msg->state = mosq_ms_publish_qos0; + break; + case 1: + msg->state = mosq_ms_publish_qos1; + break; + case 2: + msg->state = mosq_ms_publish_qos2; + break; + } + } + msg = msg->next; + count++; + } + } + + return MOSQ_ERR_SUCCESS; +} + +int mqtt3_db_message_timeout_check(struct mosquitto_db *db, unsigned int timeout) +{ + time_t threshold; + enum mosquitto_msg_state new_state; + struct mosquitto *context, *ctxt_tmp; + struct mosquitto_client_msg *msg; + + threshold = mosquitto_time() - timeout; + + HASH_ITER(hh_sock, db->contexts_by_sock, context, ctxt_tmp){ + msg = context->msgs; + while(msg){ + new_state = mosq_ms_invalid; + if(msg->timestamp < threshold && msg->state != mosq_ms_queued){ + switch(msg->state){ + case mosq_ms_wait_for_puback: + new_state = mosq_ms_publish_qos1; + break; + case mosq_ms_wait_for_pubrec: + new_state = mosq_ms_publish_qos2; + break; + case mosq_ms_wait_for_pubrel: + new_state = mosq_ms_send_pubrec; + break; + case mosq_ms_wait_for_pubcomp: + new_state = mosq_ms_resend_pubrel; + break; + default: + break; + } + if(new_state != mosq_ms_invalid){ + msg->timestamp = mosquitto_time(); + msg->state = new_state; + msg->dup = true; + } + } + msg = msg->next; + } + } + + return MOSQ_ERR_SUCCESS; +} + +int mqtt3_db_message_release(struct mosquitto_db *db, struct mosquitto *context, uint16_t mid, enum mosquitto_msg_direction dir) +{ + struct mosquitto_client_msg *tail, *last = NULL; + int qos; + int retain; + char *topic; + char *source_id; + int msg_index = 0; + bool deleted = false; + + if(!context) return MOSQ_ERR_INVAL; + + tail = context->msgs; + while(tail){ + msg_index++; + if(tail->state == mosq_ms_queued && msg_index <= max_inflight){ + tail->timestamp = mosquitto_time(); + if(tail->direction == mosq_md_out){ + switch(tail->qos){ + case 0: + tail->state = mosq_ms_publish_qos0; + break; + case 1: + tail->state = mosq_ms_publish_qos1; + break; + case 2: + tail->state = mosq_ms_publish_qos2; + break; + } + }else{ + if(tail->qos == 2){ + _mosquitto_send_pubrec(context, tail->mid); + tail->state = mosq_ms_wait_for_pubrel; + } + } + } + if(tail->mid == mid && tail->direction == dir){ + qos = tail->store->qos; + topic = tail->store->topic; + retain = tail->retain; + source_id = tail->store->source_id; + + /* topic==NULL should be a QoS 2 message that was + * denied/dropped and is being processed so the client doesn't + * keep resending it. That means we don't send it to other + * clients. */ + if(!topic || !mqtt3_db_messages_queue(db, source_id, topic, qos, retain, &tail->store)){ + _message_remove(db, context, &tail, last); + deleted = true; + }else{ + return 1; + } + }else{ + last = tail; + tail = tail->next; + } + if(msg_index > max_inflight && deleted){ + return MOSQ_ERR_SUCCESS; + } + } + if(deleted){ + return MOSQ_ERR_SUCCESS; + }else{ + return 1; + } +} + +int mqtt3_db_message_write(struct mosquitto_db *db, struct mosquitto *context) +{ + int rc; + struct mosquitto_client_msg *tail, *last = NULL; + uint16_t mid; + int retries; + int retain; + const char *topic; + int qos; + uint32_t payloadlen; + const void *payload; + int msg_count = 0; + + if(!context || context->sock == INVALID_SOCKET + || (context->state == mosq_cs_connected && !context->id)){ + return MOSQ_ERR_INVAL; + } + + if(context->state != mosq_cs_connected){ + return MOSQ_ERR_SUCCESS; + } + + tail = context->msgs; + while(tail){ + if(tail->direction == mosq_md_in){ + msg_count++; + } + if(tail->state != mosq_ms_queued){ + mid = tail->mid; + retries = tail->dup; + retain = tail->retain; + topic = tail->store->topic; + qos = tail->qos; + payloadlen = tail->store->payloadlen; + payload = tail->store->payload; + + switch(tail->state){ + case mosq_ms_publish_qos0: + rc = _mosquitto_send_publish(context, mid, topic, payloadlen, payload, qos, retain, retries); + if(!rc){ + _message_remove(db, context, &tail, last); + }else{ + return rc; + } + break; + + case mosq_ms_publish_qos1: + rc = _mosquitto_send_publish(context, mid, topic, payloadlen, payload, qos, retain, retries); + if(!rc){ + tail->timestamp = mosquitto_time(); + tail->dup = 1; /* Any retry attempts are a duplicate. */ + tail->state = mosq_ms_wait_for_puback; + }else{ + return rc; + } + last = tail; + tail = tail->next; + break; + + case mosq_ms_publish_qos2: + rc = _mosquitto_send_publish(context, mid, topic, payloadlen, payload, qos, retain, retries); + if(!rc){ + tail->timestamp = mosquitto_time(); + tail->dup = 1; /* Any retry attempts are a duplicate. */ + tail->state = mosq_ms_wait_for_pubrec; + }else{ + return rc; + } + last = tail; + tail = tail->next; + break; + + case mosq_ms_send_pubrec: + rc = _mosquitto_send_pubrec(context, mid); + if(!rc){ + tail->state = mosq_ms_wait_for_pubrel; + }else{ + return rc; + } + last = tail; + tail = tail->next; + break; + + case mosq_ms_resend_pubrel: + rc = _mosquitto_send_pubrel(context, mid); + if(!rc){ + tail->state = mosq_ms_wait_for_pubcomp; + }else{ + return rc; + } + last = tail; + tail = tail->next; + break; + + case mosq_ms_resend_pubcomp: + rc = _mosquitto_send_pubcomp(context, mid); + if(!rc){ + tail->state = mosq_ms_wait_for_pubrel; + }else{ + return rc; + } + last = tail; + tail = tail->next; + break; + + default: + last = tail; + tail = tail->next; + break; + } + }else{ + /* state == mosq_ms_queued */ + if(tail->direction == mosq_md_in && (max_inflight == 0 || msg_count < max_inflight)){ + if(tail->qos == 2){ + tail->state = mosq_ms_send_pubrec; + } + }else{ + last = tail; + tail = tail->next; + } + } + } + + return MOSQ_ERR_SUCCESS; +} + +void mqtt3_db_limits_set(int inflight, int queued) +{ + max_inflight = inflight; + max_queued = queued; +} + +void mqtt3_db_vacuum(void) +{ + /* FIXME - reimplement? */ +} + diff --git a/src/libs/mosquitto/src/db_dump/Makefile b/src/libs/mosquitto/src/db_dump/Makefile new file mode 100644 index 0000000..13ae261 --- /dev/null +++ b/src/libs/mosquitto/src/db_dump/Makefile @@ -0,0 +1,16 @@ +include ../../config.mk + +CFLAGS_FINAL=${CFLAGS} -I.. -I../../lib -I../.. + +.PHONY: all clean reallyclean + +all : mosquitto_db_dump + +mosquitto_db_dump : db_dump.o + ${CROSS_COMPILE}${CC} $^ -o $@ ${LDFLAGS} ${LIBS} + +db_dump.o : db_dump.c ../persist.h + ${CROSS_COMPILE}${CC} $(CFLAGS_FINAL) -c $< -o $@ + +clean : + -rm -f *.o mosquitto_db_dump diff --git a/src/libs/mosquitto/src/db_dump/db_dump.c b/src/libs/mosquitto/src/db_dump/db_dump.c new file mode 100644 index 0000000..660cc4b --- /dev/null +++ b/src/libs/mosquitto/src/db_dump/db_dump.c @@ -0,0 +1,426 @@ +/* +Copyright (c) 2010-2012 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +static uint32_t db_version; +static int stats = 0; + +static int _db_client_chunk_restore(struct mosquitto_db *db, FILE *db_fd) +{ + uint16_t i16temp, slen, last_mid; + char *client_id = NULL; + int rc = 0; + time_t disconnect_t; + + read_e(db_fd, &i16temp, sizeof(uint16_t)); + slen = ntohs(i16temp); + if(!slen){ + fprintf(stderr, "Error: Corrupt persistent database."); + fclose(db_fd); + return 1; + } + client_id = calloc(slen+1, sizeof(char)); + if(!client_id){ + fclose(db_fd); + fprintf(stderr, "Error: Out of memory."); + return 1; + } + read_e(db_fd, client_id, slen); + if(!stats) printf("\tClient ID: %s\n", client_id); + + read_e(db_fd, &i16temp, sizeof(uint16_t)); + last_mid = ntohs(i16temp); + if(!stats) printf("\tLast MID: %d\n", last_mid); + + if(db_version == 2){ + disconnect_t = time(NULL); + }else{ + read_e(db_fd, &disconnect_t, sizeof(time_t)); + if(!stats) printf("\tDisconnect time: %ld\n", disconnect_t); + } + + free(client_id); + + return rc; +error: + fprintf(stderr, "Error: %s.", strerror(errno)); + if(db_fd >= 0) fclose(db_fd); + if(client_id) free(client_id); + return 1; +} + +static int _db_client_msg_chunk_restore(struct mosquitto_db *db, FILE *db_fd) +{ + dbid_t i64temp, store_id; + uint16_t i16temp, slen, mid; + uint8_t qos, retain, direction, state, dup; + char *client_id = NULL; + + read_e(db_fd, &i16temp, sizeof(uint16_t)); + slen = ntohs(i16temp); + if(!slen){ + fprintf(stderr, "Error: Corrupt persistent database."); + fclose(db_fd); + return 1; + } + client_id = calloc(slen+1, sizeof(char)); + if(!client_id){ + fclose(db_fd); + fprintf(stderr, "Error: Out of memory."); + return 1; + } + read_e(db_fd, client_id, slen); + if(!stats) printf("\tClient ID: %s\n", client_id); + + read_e(db_fd, &i64temp, sizeof(dbid_t)); + store_id = i64temp; + if(!stats) printf("\tStore ID: %ld\n", (long )store_id); + + read_e(db_fd, &i16temp, sizeof(uint16_t)); + mid = ntohs(i16temp); + if(!stats) printf("\tMID: %d\n", mid); + + read_e(db_fd, &qos, sizeof(uint8_t)); + if(!stats) printf("\tQoS: %d\n", qos); + read_e(db_fd, &retain, sizeof(uint8_t)); + if(!stats) printf("\tRetain: %d\n", retain); + read_e(db_fd, &direction, sizeof(uint8_t)); + if(!stats) printf("\tDirection: %d\n", direction); + read_e(db_fd, &state, sizeof(uint8_t)); + if(!stats) printf("\tState: %d\n", state); + read_e(db_fd, &dup, sizeof(uint8_t)); + if(!stats) printf("\tDup: %d\n", dup); + + free(client_id); + + return 0; +error: + fprintf(stderr, "Error: %s.", strerror(errno)); + if(db_fd >= 0) fclose(db_fd); + if(client_id) free(client_id); + return 1; +} + +static int _db_msg_store_chunk_restore(struct mosquitto_db *db, FILE *db_fd) +{ + dbid_t i64temp, store_id; + uint32_t i32temp, payloadlen; + uint16_t i16temp, slen, source_mid, mid; + uint8_t qos, retain, *payload = NULL; + char *source_id = NULL; + char *topic = NULL; + int rc = 0; + bool binary; + int i; + + read_e(db_fd, &i64temp, sizeof(dbid_t)); + store_id = i64temp; + if(!stats) printf("\tStore ID: %ld\n", (long)store_id); + + read_e(db_fd, &i16temp, sizeof(uint16_t)); + slen = ntohs(i16temp); + if(slen){ + source_id = calloc(slen+1, sizeof(char)); + if(!source_id){ + fclose(db_fd); + fprintf(stderr, "Error: Out of memory."); + return 1; + } + if(fread(source_id, 1, slen, db_fd) != slen){ + fprintf(stderr, "Error: %s.", strerror(errno)); + fclose(db_fd); + free(source_id); + return 1; + } + if(!stats) printf("\tSource ID: %s\n", source_id); + free(source_id); + } + read_e(db_fd, &i16temp, sizeof(uint16_t)); + source_mid = ntohs(i16temp); + if(!stats) printf("\tSource MID: %d\n", source_mid); + + read_e(db_fd, &i16temp, sizeof(uint16_t)); + mid = ntohs(i16temp); + if(!stats) printf("\tMID: %d\n", mid); + + read_e(db_fd, &i16temp, sizeof(uint16_t)); + slen = ntohs(i16temp); + if(slen){ + topic = calloc(slen+1, sizeof(char)); + if(!topic){ + fclose(db_fd); + free(source_id); + fprintf(stderr, "Error: Out of memory."); + return 1; + } + if(fread(topic, 1, slen, db_fd) != slen){ + fprintf(stderr, "Error: %s.", strerror(errno)); + fclose(db_fd); + free(source_id); + free(topic); + return 1; + } + if(!stats) printf("\tTopic: %s\n", topic); + free(topic); + }else{ + fprintf(stderr, "Error: Invalid msg_store chunk when restoring persistent database."); + fclose(db_fd); + free(source_id); + return 1; + } + read_e(db_fd, &qos, sizeof(uint8_t)); + if(!stats) printf("\tQoS: %d\n", qos); + read_e(db_fd, &retain, sizeof(uint8_t)); + if(!stats) printf("\tRetain: %d\n", retain); + + read_e(db_fd, &i32temp, sizeof(uint32_t)); + payloadlen = ntohl(i32temp); + if(!stats) printf("\tPayload Length: %d\n", payloadlen); + + if(payloadlen){ + payload = malloc(payloadlen+1); + if(!payload){ + fclose(db_fd); + free(source_id); + free(topic); + fprintf(stderr, "Error: Out of memory."); + return 1; + } + memset(payload, 0, payloadlen+1); + if(fread(payload, 1, payloadlen, db_fd) != payloadlen){ + fprintf(stderr, "Error: %s.", strerror(errno)); + fclose(db_fd); + free(source_id); + free(topic); + free(payload); + return 1; + } + binary = false; + for(i=0; i= 0) fclose(db_fd); + if(source_id) free(source_id); + if(topic) free(topic); + return 1; +} + +static int _db_retain_chunk_restore(struct mosquitto_db *db, FILE *db_fd) +{ + dbid_t i64temp, store_id; + + if(fread(&i64temp, sizeof(dbid_t), 1, db_fd) != 1){ + fprintf(stderr, "Error: %s.", strerror(errno)); + fclose(db_fd); + return 1; + } + store_id = i64temp; + if(!stats) printf("\tStore ID: %ld\n", (long int)store_id); + return 0; +} + +static int _db_sub_chunk_restore(struct mosquitto_db *db, FILE *db_fd) +{ + uint16_t i16temp, slen; + uint8_t qos; + char *client_id; + char *topic; + int rc = 0; + + read_e(db_fd, &i16temp, sizeof(uint16_t)); + slen = ntohs(i16temp); + client_id = calloc(slen+1, sizeof(char)); + if(!client_id){ + fclose(db_fd); + fprintf(stderr, "Error: Out of memory."); + return 1; + } + read_e(db_fd, client_id, slen); + if(!stats) printf("\tClient ID: %s\n", client_id); + read_e(db_fd, &i16temp, sizeof(uint16_t)); + slen = ntohs(i16temp); + topic = calloc(slen+1, sizeof(char)); + if(!topic){ + fclose(db_fd); + fprintf(stderr, "Error: Out of memory."); + free(client_id); + return 1; + } + read_e(db_fd, topic, slen); + if(!stats) printf("\tTopic: %s\n", topic); + read_e(db_fd, &qos, sizeof(uint8_t)); + if(!stats) printf("\tQoS: %d\n", qos); + free(client_id); + free(topic); + + return rc; +error: + fprintf(stderr, "Error: %s.", strerror(errno)); + if(db_fd >= 0) fclose(db_fd); + return 1; +} + +int main(int argc, char *argv[]) +{ + FILE *fd; + char header[15]; + int rc = 0; + uint32_t crc; + dbid_t i64temp; + uint32_t i32temp, length; + uint16_t i16temp, chunk; + uint8_t i8temp; + ssize_t rlen; + struct mosquitto_db db; + char *filename; + long cfg_count = 0; + long msg_store_count = 0; + long client_msg_count = 0; + long retain_count = 0; + long sub_count = 0; + long client_count = 0; + + if(argc == 2){ + filename = argv[1]; + }else if(argc == 3 && !strcmp(argv[1], "--stats")){ + stats = 1; + filename = argv[2]; + }else{ + fprintf(stderr, "Usage: db_dump [--stats] \n"); + return 1; + } + memset(&db, 0, sizeof(struct mosquitto_db)); + fd = fopen(filename, "rb"); + if(!fd) return 0; + read_e(fd, &header, 15); + if(!memcmp(header, magic, 15)){ + if(!stats) printf("Mosquitto DB dump\n"); + // Restore DB as normal + read_e(fd, &crc, sizeof(uint32_t)); + if(!stats) printf("CRC: %d\n", crc); + read_e(fd, &i32temp, sizeof(uint32_t)); + db_version = ntohl(i32temp); + if(!stats) printf("DB version: %d\n", db_version); + + while(rlen = fread(&i16temp, sizeof(uint16_t), 1, fd), rlen == 1){ + chunk = ntohs(i16temp); + read_e(fd, &i32temp, sizeof(uint32_t)); + length = ntohl(i32temp); + switch(chunk){ + case DB_CHUNK_CFG: + cfg_count++; + if(!stats) printf("DB_CHUNK_CFG:\n"); + if(!stats) printf("\tLength: %d\n", length); + read_e(fd, &i8temp, sizeof(uint8_t)); // shutdown + if(!stats) printf("\tShutdown: %d\n", i8temp); + read_e(fd, &i8temp, sizeof(uint8_t)); // sizeof(dbid_t) + if(!stats) printf("\tDB ID size: %d\n", i8temp); + if(i8temp != sizeof(dbid_t)){ + fprintf(stderr, "Error: Incompatible database configuration (dbid size is %d bytes, expected %ld)", + i8temp, sizeof(dbid_t)); + fclose(fd); + return 1; + } + read_e(fd, &i64temp, sizeof(dbid_t)); + if(!stats) printf("\tLast DB ID: %ld\n", (long)i64temp); + break; + + case DB_CHUNK_MSG_STORE: + msg_store_count++; + if(!stats) printf("DB_CHUNK_MSG_STORE:\n"); + if(!stats) printf("\tLength: %d\n", length); + if(_db_msg_store_chunk_restore(&db, fd)) return 1; + break; + + case DB_CHUNK_CLIENT_MSG: + client_msg_count++; + if(!stats) printf("DB_CHUNK_CLIENT_MSG:\n"); + if(!stats) printf("\tLength: %d\n", length); + if(_db_client_msg_chunk_restore(&db, fd)) return 1; + break; + + case DB_CHUNK_RETAIN: + retain_count++; + if(!stats) printf("DB_CHUNK_RETAIN:\n"); + if(!stats) printf("\tLength: %d\n", length); + if(_db_retain_chunk_restore(&db, fd)) return 1; + break; + + case DB_CHUNK_SUB: + sub_count++; + if(!stats) printf("DB_CHUNK_SUB:\n"); + if(!stats) printf("\tLength: %d\n", length); + if(_db_sub_chunk_restore(&db, fd)) return 1; + break; + + case DB_CHUNK_CLIENT: + client_count++; + if(!stats) printf("DB_CHUNK_CLIENT:\n"); + if(!stats) printf("\tLength: %d\n", length); + if(_db_client_chunk_restore(&db, fd)) return 1; + break; + + default: + fprintf(stderr, "Warning: Unsupported chunk \"%d\" in persistent database file. Ignoring.", chunk); + fseek(fd, length, SEEK_CUR); + break; + } + } + if(rlen < 0) goto error; + }else{ + fprintf(stderr, "Error: Unrecognised file format."); + rc = 1; + } + + fclose(fd); + + if(stats){ + printf("DB_CHUNK_CFG: %ld\n", cfg_count); + printf("DB_CHUNK_MSG_STORE: %ld\n", msg_store_count); + printf("DB_CHUNK_CLIENT_MSG: %ld\n", client_msg_count); + printf("DB_CHUNK_RETAIN: %ld\n", retain_count); + printf("DB_CHUNK_SUB: %ld\n", sub_count); + printf("DB_CHUNK_CLIENT: %ld\n", client_count); + } + return rc; +error: + fprintf(stderr, "Error: %s.", strerror(errno)); + if(fd >= 0) fclose(fd); + return 1; +} + diff --git a/src/libs/mosquitto/src/lib_load.h b/src/libs/mosquitto/src/lib_load.h new file mode 100644 index 0000000..76fb8aa --- /dev/null +++ b/src/libs/mosquitto/src/lib_load.h @@ -0,0 +1,37 @@ +/* +Copyright (c) 2012-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#ifndef LIB_LOAD_H +#define LIB_LOAD_H + +#ifdef WIN32 +# include +#else +# include +#endif + +#ifdef WIN32 +# define LIB_LOAD(A) LoadLibrary(A) +# define LIB_CLOSE(A) FreeLibrary(A) +# define LIB_SYM(HANDLE, SYM) GetProcAddress(HANDLE, SYM) +#else +# define LIB_LOAD(A) dlopen(A, RTLD_NOW|RTLD_GLOBAL) +# define LIB_CLOSE(A) dlclose(A) +# define LIB_SYM(HANDLE, SYM) dlsym(HANDLE, SYM) +#endif + +#define LIB_SYM_EASY(MEMBER, HANDLE, SYM) if(!(MEMBER = LIB_SYM(HANDLE, SYM)) return 1 +#endif diff --git a/src/libs/mosquitto/src/linker-macosx.syms b/src/libs/mosquitto/src/linker-macosx.syms new file mode 100644 index 0000000..b60de06 --- /dev/null +++ b/src/libs/mosquitto/src/linker-macosx.syms @@ -0,0 +1 @@ +_mosquitto_log_printf diff --git a/src/libs/mosquitto/src/linker.syms b/src/libs/mosquitto/src/linker.syms new file mode 100644 index 0000000..83d2366 --- /dev/null +++ b/src/libs/mosquitto/src/linker.syms @@ -0,0 +1,3 @@ +{ + mosquitto_log_printf; +}; diff --git a/src/libs/mosquitto/src/logging.c b/src/libs/mosquitto/src/logging.c new file mode 100644 index 0000000..18d8d7d --- /dev/null +++ b/src/libs/mosquitto/src/logging.c @@ -0,0 +1,276 @@ +/* +Copyright (c) 2009-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ +#include +#include +#include +#ifndef WIN32 +#include +#endif +#include + +#ifndef CMAKE +#include +#endif + +#include +#include +#include + +extern struct mosquitto_db int_db; + +#ifdef WIN32 +HANDLE syslog_h; +#endif + +/* Options for logging should be: + * + * A combination of: + * Via syslog + * To a file + * To stdout/stderr + * To topics + */ + +/* Give option of logging timestamp. + * Logging pid. + */ +static int log_destinations = MQTT3_LOG_STDERR; +static int log_priorities = MOSQ_LOG_ERR | MOSQ_LOG_WARNING | MOSQ_LOG_NOTICE | MOSQ_LOG_INFO; + +int mqtt3_log_init(struct mqtt3_config *config) +{ + int rc = 0; + + log_priorities = config->log_type; + log_destinations = config->log_dest; + + if(log_destinations & MQTT3_LOG_SYSLOG){ +#ifndef WIN32 + openlog("mosquitto", LOG_PID|LOG_CONS, config->log_facility); +#else + syslog_h = OpenEventLog(NULL, "mosquitto"); +#endif + } + + if(log_destinations & MQTT3_LOG_FILE){ + if(drop_privileges(config, true)){ + return 1; + } + config->log_fptr = _mosquitto_fopen(config->log_file, "at", true); + if(!config->log_fptr){ + log_destinations = MQTT3_LOG_STDERR; + log_priorities = MOSQ_LOG_ERR; + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Unable to open log file %s for writing.", config->log_file); + return MOSQ_ERR_INVAL; + } + restore_privileges(); + } + return rc; +} + +int mqtt3_log_close(struct mqtt3_config *config) +{ + if(log_destinations & MQTT3_LOG_SYSLOG){ +#ifndef WIN32 + closelog(); +#else + CloseEventLog(syslog_h); +#endif + } + if(log_destinations & MQTT3_LOG_FILE){ + if(config->log_fptr){ + fclose(config->log_fptr); + config->log_fptr = NULL; + } + } + + /* FIXME - do something for all destinations! */ + return MOSQ_ERR_SUCCESS; +} + +int _mosquitto_log_vprintf(struct mosquitto *mosq, int priority, const char *fmt, va_list va) +{ + char *s; + char *st; + int len; +#ifdef WIN32 + char *sp; +#endif + const char *topic; + int syslog_priority; + time_t now = time(NULL); + static time_t last_flush = 0; + + if((log_priorities & priority) && log_destinations != MQTT3_LOG_NONE){ + switch(priority){ + case MOSQ_LOG_SUBSCRIBE: + topic = "$SYS/broker/log/M/subscribe"; +#ifndef WIN32 + syslog_priority = LOG_NOTICE; +#else + syslog_priority = EVENTLOG_INFORMATION_TYPE; +#endif + break; + case MOSQ_LOG_UNSUBSCRIBE: + topic = "$SYS/broker/log/M/unsubscribe"; +#ifndef WIN32 + syslog_priority = LOG_NOTICE; +#else + syslog_priority = EVENTLOG_INFORMATION_TYPE; +#endif + break; + case MOSQ_LOG_DEBUG: + topic = "$SYS/broker/log/D"; +#ifndef WIN32 + syslog_priority = LOG_DEBUG; +#else + syslog_priority = EVENTLOG_INFORMATION_TYPE; +#endif + break; + case MOSQ_LOG_ERR: + topic = "$SYS/broker/log/E"; +#ifndef WIN32 + syslog_priority = LOG_ERR; +#else + syslog_priority = EVENTLOG_ERROR_TYPE; +#endif + break; + case MOSQ_LOG_WARNING: + topic = "$SYS/broker/log/W"; +#ifndef WIN32 + syslog_priority = LOG_WARNING; +#else + syslog_priority = EVENTLOG_WARNING_TYPE; +#endif + break; + case MOSQ_LOG_NOTICE: + topic = "$SYS/broker/log/N"; +#ifndef WIN32 + syslog_priority = LOG_NOTICE; +#else + syslog_priority = EVENTLOG_INFORMATION_TYPE; +#endif + break; + case MOSQ_LOG_INFO: + topic = "$SYS/broker/log/I"; +#ifndef WIN32 + syslog_priority = LOG_INFO; +#else + syslog_priority = EVENTLOG_INFORMATION_TYPE; +#endif + break; +#ifdef WITH_WEBSOCKETS + case MOSQ_LOG_WEBSOCKETS: + topic = "$SYS/broker/log/WS"; +#ifndef WIN32 + syslog_priority = LOG_DEBUG; +#else + syslog_priority = EVENTLOG_INFORMATION_TYPE; +#endif + break; +#endif + default: + topic = "$SYS/broker/log/E"; +#ifndef WIN32 + syslog_priority = LOG_ERR; +#else + syslog_priority = EVENTLOG_ERROR_TYPE; +#endif + } + len = strlen(fmt) + 500; + s = _mosquitto_malloc(len*sizeof(char)); + if(!s) return MOSQ_ERR_NOMEM; + + vsnprintf(s, len, fmt, va); + s[len-1] = '\0'; /* Ensure string is null terminated. */ + + if(log_destinations & MQTT3_LOG_STDOUT){ + if(int_db.config && int_db.config->log_timestamp){ + fprintf(stdout, "%d: %s\n", (int)now, s); + }else{ + fprintf(stdout, "%s\n", s); + } + fflush(stdout); + } + if(log_destinations & MQTT3_LOG_STDERR){ + if(int_db.config && int_db.config->log_timestamp){ + fprintf(stderr, "%d: %s\n", (int)now, s); + }else{ + fprintf(stderr, "%s\n", s); + } + fflush(stderr); + } + if(log_destinations & MQTT3_LOG_FILE && int_db.config->log_fptr){ + if(int_db.config && int_db.config->log_timestamp){ + fprintf(int_db.config->log_fptr, "%d: %s\n", (int)now, s); + }else{ + fprintf(int_db.config->log_fptr, "%s\n", s); + } + if(now - last_flush > 1){ + fflush(int_db.config->log_fptr); + last_flush = now; + } + } + if(log_destinations & MQTT3_LOG_SYSLOG){ +#ifndef WIN32 + syslog(syslog_priority, "%s", s); +#else + sp = (char *)s; + ReportEvent(syslog_h, syslog_priority, 0, 0, NULL, 1, 0, &sp, NULL); +#endif + } + if(log_destinations & MQTT3_LOG_TOPIC && priority != MOSQ_LOG_DEBUG){ + if(int_db.config && int_db.config->log_timestamp){ + len += 30; + st = _mosquitto_malloc(len*sizeof(char)); + if(!st){ + _mosquitto_free(s); + return MOSQ_ERR_NOMEM; + } + snprintf(st, len, "%d: %s", (int)now, s); + mqtt3_db_messages_easy_queue(&int_db, NULL, topic, 2, strlen(st), st, 0); + _mosquitto_free(st); + }else{ + mqtt3_db_messages_easy_queue(&int_db, NULL, topic, 2, strlen(s), s, 0); + } + } + _mosquitto_free(s); + } + + return MOSQ_ERR_SUCCESS; +} + +int _mosquitto_log_printf(struct mosquitto *mosq, int priority, const char *fmt, ...) +{ + va_list va; + int rc; + + va_start(va, fmt); + rc = _mosquitto_log_vprintf(mosq, priority, fmt, va); + va_end(va); + + return rc; +} + +void mosquitto_log_printf(int level, const char *fmt, ...) +{ + va_list va; + + va_start(va, fmt); + _mosquitto_log_vprintf(NULL, level, fmt, va); + va_end(va); +} + diff --git a/src/libs/mosquitto/src/loop.c b/src/libs/mosquitto/src/loop.c new file mode 100644 index 0000000..3d06818 --- /dev/null +++ b/src/libs/mosquitto/src/loop.c @@ -0,0 +1,556 @@ +/* +Copyright (c) 2009-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#define _GNU_SOURCE + +#include + +#include +#ifndef WIN32 +#include +#else +#include +#include +#include +#endif + +#include +#include +#include +#include +#ifndef WIN32 +# include +#endif +#include + +#ifdef WITH_WEBSOCKETS +# include +#endif + +#include +#include +#include +#include +#include + +extern bool flag_reload; +#ifdef WITH_PERSISTENCE +extern bool flag_db_backup; +#endif +extern bool flag_tree_print; +extern int run; +#ifdef WITH_SYS_TREE +extern int g_clients_expired; +#endif + +static void loop_handle_reads_writes(struct mosquitto_db *db, struct pollfd *pollfds); + +#ifdef WITH_WEBSOCKETS +static void temp__expire_websockets_clients(struct mosquitto_db *db) +{ + struct mosquitto *context, *ctxt_tmp; + static time_t last_check = 0; + time_t now = mosquitto_time(); + char *id; + + if(now - last_check > 60){ + HASH_ITER(hh_id, db->contexts_by_id, context, ctxt_tmp){ + if(context->wsi && context->sock != INVALID_SOCKET){ + if(context->keepalive && now - context->last_msg_in > (time_t)(context->keepalive)*3/2){ + if(db->config->connection_messages == true){ + if(context->id){ + id = context->id; + }else{ + id = ""; + } + _mosquitto_log_printf(NULL, MOSQ_LOG_NOTICE, "Client %s has exceeded timeout, disconnecting.", id); + } + /* Client has exceeded keepalive*1.5 */ + do_disconnect(db, context); + } + } + } + last_check = mosquitto_time(); + } +} +#endif + +int mosquitto_main_loop(struct mosquitto_db *db, mosq_sock_t *listensock, int listensock_count, int listener_max) +{ +#ifdef WITH_SYS_TREE + time_t start_time = mosquitto_time(); +#endif +#ifdef WITH_PERSISTENCE + time_t last_backup = mosquitto_time(); +#endif + time_t now = 0; + time_t now_time; + int time_count; + int fdcount; + struct mosquitto *context, *ctxt_tmp; +#ifndef WIN32 + sigset_t sigblock, origsig; +#endif + int i; + struct pollfd *pollfds = NULL; + int pollfd_index; + int pollfd_max; +#ifdef WITH_BRIDGE + mosq_sock_t bridge_sock; + int rc; +#endif + time_t expiration_check_time = 0; + time_t last_timeout_check = 0; + char *id; + +#ifndef WIN32 + sigemptyset(&sigblock); + sigaddset(&sigblock, SIGINT); + sigaddset(&sigblock, SIGTERM); + sigaddset(&sigblock, SIGHUP); +#endif + +#ifdef WIN32 + pollfd_max = _getmaxstdio(); +#else + pollfd_max = getdtablesize(); +#endif + + pollfds = _mosquitto_malloc(sizeof(struct pollfd)*pollfd_max); + if(!pollfds){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + + if(db->config->persistent_client_expiration > 0){ + expiration_check_time = time(NULL) + 3600; + } + + while(run){ + mosquitto__free_disused_contexts(db); +#ifdef WITH_SYS_TREE + if(db->config->sys_interval > 0){ + mqtt3_db_sys_update(db, db->config->sys_interval, start_time); + } +#endif + + memset(pollfds, -1, sizeof(struct pollfd)*pollfd_max); + + pollfd_index = 0; + for(i=0; icontexts_by_sock, context, ctxt_tmp){ + if(time_count > 0){ + time_count--; + }else{ + time_count = 1000; + now = mosquitto_time(); + } + context->pollfd_index = -1; + + if(context->sock != INVALID_SOCKET){ +#ifdef WITH_BRIDGE + if(context->bridge){ + _mosquitto_check_keepalive(db, context); + if(context->bridge->round_robin == false + && context->bridge->cur_address != 0 + && now > context->bridge->primary_retry){ + + if(_mosquitto_try_connect(context, context->bridge->addresses[0].address, context->bridge->addresses[0].port, &bridge_sock, NULL, false) <= 0){ + COMPAT_CLOSE(bridge_sock); + _mosquitto_socket_close(db, context); + context->bridge->cur_address = context->bridge->address_count-1; + } + } + } +#endif + + /* Local bridges never time out in this fashion. */ + if(!(context->keepalive) + || context->bridge + || now - context->last_msg_in < (time_t)(context->keepalive)*3/2){ + + if(mqtt3_db_message_write(db, context) == MOSQ_ERR_SUCCESS){ + pollfds[pollfd_index].fd = context->sock; + pollfds[pollfd_index].events = POLLIN; + pollfds[pollfd_index].revents = 0; + if(context->current_out_packet || context->state == mosq_cs_connect_pending || context->ws_want_write){ + pollfds[pollfd_index].events |= POLLOUT; + context->ws_want_write = false; + } + context->pollfd_index = pollfd_index; + pollfd_index++; + }else{ + do_disconnect(db, context); + } + }else{ + if(db->config->connection_messages == true){ + if(context->id){ + id = context->id; + }else{ + id = ""; + } + _mosquitto_log_printf(NULL, MOSQ_LOG_NOTICE, "Client %s has exceeded timeout, disconnecting.", id); + } + /* Client has exceeded keepalive*1.5 */ + do_disconnect(db, context); + } + } + } + +#ifdef WITH_BRIDGE + time_count = 0; + for(i=0; ibridge_count; i++){ + if(!db->bridges[i]) continue; + + context = db->bridges[i]; + + if(context->sock == INVALID_SOCKET){ + if(time_count > 0){ + time_count--; + }else{ + time_count = 1000; + now = mosquitto_time(); + } + /* Want to try to restart the bridge connection */ + if(!context->bridge->restart_t){ + context->bridge->restart_t = now+context->bridge->restart_timeout; + context->bridge->cur_address++; + if(context->bridge->cur_address == context->bridge->address_count){ + context->bridge->cur_address = 0; + } + if(context->bridge->round_robin == false && context->bridge->cur_address != 0){ + context->bridge->primary_retry = now + 5; + } + }else{ + if((context->bridge->start_type == bst_lazy && context->bridge->lazy_reconnect) + || (context->bridge->start_type == bst_automatic && now > context->bridge->restart_t)){ + context->bridge->restart_t = 0; +#if defined(__GLIBC__) && defined(WITH_ADNS) + if(context->adns){ + /* Waiting on DNS lookup */ + rc = gai_error(context->adns); + if(rc == EAI_INPROGRESS){ + /* Just keep on waiting */ + }else if(rc == 0){ + rc = mqtt3_bridge_connect_step2(db, context); + if(rc == MOSQ_ERR_SUCCESS){ + pollfds[pollfd_index].fd = context->sock; + pollfds[pollfd_index].events = POLLIN; + pollfds[pollfd_index].revents = 0; + if(context->current_out_packet){ + pollfds[pollfd_index].events |= POLLOUT; + } + context->pollfd_index = pollfd_index; + pollfd_index++; + }else{ + context->bridge->cur_address++; + if(context->bridge->cur_address == context->bridge->address_count){ + context->bridge->cur_address = 0; + } + } + }else{ + /* Need to retry */ + if(context->adns->ar_result){ + freeaddrinfo(context->adns->ar_result); + } + _mosquitto_free(context->adns); + context->adns = NULL; + } + }else{ + rc = mqtt3_bridge_connect_step1(db, context); + if(rc){ + context->bridge->cur_address++; + if(context->bridge->cur_address == context->bridge->address_count){ + context->bridge->cur_address = 0; + } + } + } +#else + { + rc = mqtt3_bridge_connect(db, context); + if(rc == MOSQ_ERR_SUCCESS){ + pollfds[pollfd_index].fd = context->sock; + pollfds[pollfd_index].events = POLLIN; + pollfds[pollfd_index].revents = 0; + if(context->current_out_packet){ + pollfds[pollfd_index].events |= POLLOUT; + } + context->pollfd_index = pollfd_index; + pollfd_index++; + }else{ + context->bridge->cur_address++; + if(context->bridge->cur_address == context->bridge->address_count){ + context->bridge->cur_address = 0; + } + } + } +#endif + } + } + } + } +#endif + now_time = time(NULL); + if(db->config->persistent_client_expiration > 0 && now_time > expiration_check_time){ + HASH_ITER(hh_id, db->contexts_by_id, context, ctxt_tmp){ + if(context->sock == INVALID_SOCKET && context->clean_session == 0){ + /* This is a persistent client, check to see if the + * last time it connected was longer than + * persistent_client_expiration seconds ago. If so, + * expire it and clean up. + */ + if(now_time > context->disconnect_t+db->config->persistent_client_expiration){ + if(context->id){ + id = context->id; + }else{ + id = ""; + } + _mosquitto_log_printf(NULL, MOSQ_LOG_NOTICE, "Expiring persistent client %s due to timeout.", id); +#ifdef WITH_SYS_TREE + g_clients_expired++; +#endif + context->clean_session = true; + context->state = mosq_cs_expiring; + do_disconnect(db, context); + } + } + } + expiration_check_time = time(NULL) + 3600; + } + + if(last_timeout_check < mosquitto_time()){ + /* Only check at most once per second. */ + mqtt3_db_message_timeout_check(db, db->config->retry_interval); + last_timeout_check = mosquitto_time(); + } + +#ifndef WIN32 + sigprocmask(SIG_SETMASK, &sigblock, &origsig); + fdcount = poll(pollfds, pollfd_index, 100); + sigprocmask(SIG_SETMASK, &origsig, NULL); +#else + fdcount = WSAPoll(pollfds, pollfd_index, 100); +#endif + if(fdcount == -1){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error in poll: %s.", strerror(errno)); + }else{ + loop_handle_reads_writes(db, pollfds); + + for(i=0; iconfig->persistence && db->config->autosave_interval){ + if(db->config->autosave_on_changes){ + if(db->persistence_changes >= db->config->autosave_interval){ + mqtt3_db_backup(db, false); + db->persistence_changes = 0; + } + }else{ + if(last_backup + db->config->autosave_interval < mosquitto_time()){ + mqtt3_db_backup(db, false); + last_backup = mosquitto_time(); + } + } + } +#endif + +#ifdef WITH_PERSISTENCE + if(flag_db_backup){ + mqtt3_db_backup(db, false); + flag_db_backup = false; + } +#endif + if(flag_reload){ + _mosquitto_log_printf(NULL, MOSQ_LOG_INFO, "Reloading config."); + mqtt3_config_read(db->config, true); + mosquitto_security_cleanup(db, true); + mosquitto_security_init(db, true); + mosquitto_security_apply(db); + mqtt3_log_close(db->config); + mqtt3_log_init(db->config); + flag_reload = false; + } + if(flag_tree_print){ + mqtt3_sub_tree_print(&db->subs, 0); + flag_tree_print = false; + } +#ifdef WITH_WEBSOCKETS + for(i=0; iconfig->listener_count; i++){ + /* Extremely hacky, should be using the lws provided external poll + * interface, but their interface has changed recently and ours + * will soon, so for now websockets clients are second class + * citizens. */ + if(db->config->listeners[i].ws_context){ + libwebsocket_service(db->config->listeners[i].ws_context, 0); + } + } + if(db->config->have_websockets_listener){ + temp__expire_websockets_clients(db); + } +#endif + } + + if(pollfds) _mosquitto_free(pollfds); + return MOSQ_ERR_SUCCESS; +} + +void do_disconnect(struct mosquitto_db *db, struct mosquitto *context) +{ + char *id; + + if(context->state == mosq_cs_disconnected){ + return; + } +#ifdef WITH_WEBSOCKETS + if(context->wsi){ + if(context->state != mosq_cs_disconnecting){ + context->state = mosq_cs_disconnect_ws; + } + if(context->wsi){ + libwebsocket_callback_on_writable(context->ws_context, context->wsi); + } + if(context->sock != INVALID_SOCKET){ + HASH_DELETE(hh_sock, db->contexts_by_sock, context); + context->sock = INVALID_SOCKET; + context->pollfd_index = -1; + } + }else +#endif + { + if(db->config->connection_messages == true){ + if(context->id){ + id = context->id; + }else{ + id = ""; + } + if(context->state != mosq_cs_disconnecting){ + _mosquitto_log_printf(NULL, MOSQ_LOG_NOTICE, "Socket error on client %s, disconnecting.", id); + }else{ + _mosquitto_log_printf(NULL, MOSQ_LOG_NOTICE, "Client %s disconnected.", id); + } + } + mqtt3_context_disconnect(db, context); +#ifdef WITH_BRIDGE + if(context->clean_session && !context->bridge){ +#else + if(context->clean_session){ +#endif + mosquitto__add_context_to_disused(db, context); + if(context->id){ + HASH_DELETE(hh_id, db->contexts_by_id, context); + _mosquitto_free(context->id); + context->id = NULL; + } + } + context->state = mosq_cs_disconnected; + } +} + + +static void loop_handle_reads_writes(struct mosquitto_db *db, struct pollfd *pollfds) +{ + struct mosquitto *context, *ctxt_tmp; + int err; + socklen_t len; + + HASH_ITER(hh_sock, db->contexts_by_sock, context, ctxt_tmp){ + if(context->pollfd_index < 0){ + continue; + } + + assert(pollfds[context->pollfd_index].fd == context->sock); + +#ifdef WITH_WEBSOCKETS + if(context->wsi){ + struct lws_pollfd wspoll; + wspoll.fd = pollfds[context->pollfd_index].fd; + wspoll.events = pollfds[context->pollfd_index].events; + wspoll.revents = pollfds[context->pollfd_index].revents; + lws_service_fd(lws_get_context(context->wsi), &wspoll); + continue; + } +#endif + +#ifdef WITH_TLS + if(pollfds[context->pollfd_index].revents & POLLOUT || + context->want_write || + (context->ssl && context->state == mosq_cs_new)){ +#else + if(pollfds[context->pollfd_index].revents & POLLOUT){ +#endif + if(context->state == mosq_cs_connect_pending){ + len = sizeof(int); + if(!getsockopt(context->sock, SOL_SOCKET, SO_ERROR, (char *)&err, &len)){ + if(err == 0){ + context->state = mosq_cs_new; + } + }else{ + do_disconnect(db, context); + continue; + } + } + if(_mosquitto_packet_write(context)){ + do_disconnect(db, context); + continue; + } + } + } + + HASH_ITER(hh_sock, db->contexts_by_sock, context, ctxt_tmp){ + if(context->pollfd_index < 0){ + continue; + } +#ifdef WITH_WEBSOCKETS + if(context->wsi){ + // Websocket are already handled above + continue; + } +#endif + +#ifdef WITH_TLS + if(pollfds[context->pollfd_index].revents & POLLIN || + (context->ssl && context->state == mosq_cs_new)){ +#else + if(pollfds[context->pollfd_index].revents & POLLIN){ +#endif + do{ + if(_mosquitto_packet_read(db, context)){ + do_disconnect(db, context); + continue; + } + }while(SSL_DATA_PENDING(context)); + } + if(context->pollfd_index >= 0 && pollfds[context->pollfd_index].revents & (POLLERR | POLLNVAL | POLLHUP)){ + do_disconnect(db, context); + continue; + } + } +} + diff --git a/src/libs/mosquitto/src/mosquitto b/src/libs/mosquitto/src/mosquitto new file mode 100755 index 0000000000000000000000000000000000000000..dc8aa3542e8a687acc59e668d9959342f6c2f697 GIT binary patch literal 213200 zcmeFa3wTu3)i<61qXEH*3O4mpqhbZ68Wc1N=tMJm&_v@U7O$WvMMXs=ZETGOCxba0 zhEgjnt=gtu`eMaOl}n_83DQioUV>6hTUw)1J!7e+meOdg`Tu@v?|m*a6V&(X|9QUW zd*mT=&e?n2_S$Q&z4qno^U_Cu`(*cmg2KTC1&xCW3JRk5i|tlWkSr+0T|vQ@@n_+0 z`t+KL)8iM#&pn%|;eUnU$GlIZGX@N%Pd`6C?ffu^;P;Yy;GcemYy}bgK_vM%efqqs z>gVYPT(arKicuJ(AAYZ*$LAqFI3F5=kJG2$Jg@GGo4urLdb3vy5_%_U@yxS9DAM$N z`ABd2?5pO?z3L_aWz&1`mx^8o6wZHq4wXDdzL_`AyXordzoEc$=w0);qBm!<0^oD- zU-*gg%)H_Hn|%dl%h&UsqBmC);d4lTLE^ZdKE3YxZ(V);mD8`je%1~09IoG*_Z7Vr z8jsJ}G6hNcc2Ze!enlV$_8@kG`jmghUi35Vgevvx;rcn#Z@%TaD{h!GeeS%QAZLDh zhFk&Y=_(QOq%&Ra)X((k-?+io8p|D~SFGhL)i`|4rgwRW-ki&KC107Q*Qb@m=O8_n z_o@)RD=(iHV2~}}n13k!HESF`2k8Y!$?f#%SKREkirn(9)bxf+r6}wmy+E?2H}i(; zuDjuS!zWw5wjD~oIRV67(ewRM)zq`jj8{(ee9B;DCpCtXqS6&p&(vFhMZqEPdu5U} zxS$BvB4}lXJgcACcrJ%AwCpyxpcF~0juQN}6b&x8352>10sXHO6zqXC!*T@D`G@}n zd*bIxTnGBscF^F0O?fi+L|Q5ShU4$(x|?r0dd}5X9DU_2a}2Hhkxn_b{ppH@Kbv#x zEkEnOssE}QR-7^#X=2kOhCzs71xJ`?T={Pd%1gZ7j68Zjz3gnC5FEsFl2ENe17aI6N17B$1 z3k`gsf&YgzP;1$Lu@c*h$M0+{NBC!Nw9@VU_-EM-eU{VE=Z?ZaoHv#o?{ygsTTZ;s zN{b43+YviKC&f6=AosJ;60i#g3c|5-2A6dO9D?;y0J9y*b&>OkU$-cMNC!j%LNxtiA}|q zJ~NB|j*1@CB&kM!MqgIq_M(Dl(+G`hIrT+u^GimqSP_wgL9AFYitVMJ_m*d9h9SJ- z94qy2M;Bq}qcF$F)k@Ttg*lbEU(uX8V&#TfnIT~%T3dJ@ZNivIQE(*1eelP+iqm%r z1hP@t~k#QruN9>gRN$K9kp0s^NSsU((}Pdi1Yh0&&cyzE7| zgMHkd;c!V|Fe$2^IvSVYPL(9lx)S%0q*!NKj-u^O&hBVzCA`R-Xl>(t2$w1D zdoO5+bR(bnPa|~lK7_y&cfF4w5C$RL*i8id)A%m$L-eC1XIPA(g+`l};x`>9Qh^iSVL8=(ljfHpE1EhJNg|HZNLXuT^$x53 zjUiTHr{$EpA3Q&BE{ygSWP@I!tlYcxjgyJC8xcV z?y9{^Gn5ncB`9E^EtR;F{k$COFZJ@ufi_$V#Io+@NKxMA`%}=2+22?H>^cl^nESib{c3`QT*cdUZYo9IiEWhki z3^9a(hOnvQ^KhsyMghiuE*AC0?u^gJgTCl<@+fgX{>|qq2ffzkj-C`sjSl3`PL&@G*LYfh{G`+K5VnJcsSN?gY$T30hhP6DQpAQCJ3W zTxd8ZS|!pB^?6KjXZsNUhcV4p45d5~5BjzKXFesS`7;1SI|IfvDkyGITJqhf3ZyUo zZk|ATyAT{OkiOPuxr|it595qdj5DGKRTdQJ@kI^drCz&kyJgq*q~lwmHFOJGC&jl% zQws)*%spu0TPR5* zpU&%J%4x^9WSVya)J_Z|dtC>&B33r$GYa$HKNCz83YcA)vjCpS2HmJYyMmz4XAT7@ zlp=lQ*32c!B?e1P4(>jvqk+`&5CJ||tN@Za?(D?~w=h$bORka7n>2JjEnh)^2MoEr zP$KuzpSRl9JzPV@+blII~=q`*dVyWgg zbock8nJ*rThhXis-!-VfsqRJv&TH`mwd0+c^bjH3J1ZeQ|9%D!$*lE9fd{0Mfn>)w zIq~jUcDv=&_Rg};sL83l*A(#HK@M%1t3b-HJ;qclNWiE!1I?{X4P1Lq5MY7^NERy! zy=o+1m?`ITYT_~gSx)3nFY;3Evl!V4`G4zBQBS#RG1P|j(grgx;8&bnz8_!U>pvF9 z*Xw!E3pM|pv3Z5j~)$O0fzQz%Z)Ti2T?NAZq2-ldDgWbl+)*TKTTz_;hutQwp@-Ja+>Zq_yZ{6 z+dq-QtEStUc>(M=IRtvPH#vlcY&o~rSAkfC(@0(kx3FqvTlKYVt6?s; z)D&RmXl1lX2OPb#9IGZMtMj;^zXvz-s&(zl7@>5{vaRBb?t#FEWvcFVz9(?+0`56W zjbt#*RDAL7x zlF!Jc#Bgz}^L?3Wdvj&)vaOMXaICqX3Ro6`Sl9?A@bUEMO4aGuIKx*d8VqxxpoG%T z0G5u8`AkqA%hb5w^gO8pC{hJ`1{f} zoxMjFM%VPZ`@;{~aW~Q6YEujP=R#9pXK1Ape;%#%`5&W1b*^3au^n&Aysdr1PMQ1y zXGg0A6M3Bw0ur7`SyEG8fS+{FeoD)3-^pC9V-2W_LO+lJTjc~bh$zMjf-mcPGt-`dGNEg~4+SQ%b z%!W>PfiQy7?K{ahB$cTH5&U=f9shDwD)KJ+Kr^*X7pNq*X4YXYEZ$q?G`AT#PNU*K zWHi)!V3Iw;s*E1D6OXy>s9%%oXAt0g2;lb|TF|f+A41XSt&|lz4LwfXHuw8KqmHc- zL_(cPI93vRk#MC-xI_}RBjG%iaFryuNH|3$q$FV*62_~9HImSSgi@8TO%k>uA*vFJ z?ju`9V4oy-w*|hcOa=o~o;MztOMjJ`cp9MN<6rhX7l#LyUEN&?#40wHbi9>VFx8$) z`(^i&sVF^KmX&B|g)cY)SwZ*m5u|~-Dc`&wNFB2g(f-d+M6|c+0Z=y_(3UC(Je<1L z(S?=KHC>inx4hDRwaU44d6j*@Xtz|5VY>~jZtM<3mUWxNPd%ty@LUvYiHvXNZ;v73 zLXoPR+Ttqbz~g^2sG!=}zskN8%TDWi{@vdXznpv>SIb`7C6`nuE|qq26E0PDs#Pva zS28c1T!IUDqroSe&8?Fn9V^iuv+R_`TSu_cEMmb1Zj!W8>w6_b=(rEfhc?7lHB?cB zNiuPY7;zOvH>3!f`0&tZ(?!UQZb-^=->_)Y8Nuff(WVpeET+4%P;+Qb9uH)<1v;@1 zI7K%siYRKs7A|E@^U~w+8*LiRGANH@d4KhExTY zhSJIH5RUFA^EVh~<|X|2GESt7U(+(`$!f#kVCL;*k6^(^=owCj8CGNMY; zPL89f|1(v%OD#Al;p9v;Or4uXCRB7z&V`7a3p1RSPbVh>mj!g>4z)#0ndZI?#8Kp@ z(0dvq3lwH%ikN{}?$x)8I$}&stmg$PIT$pkYtWhJ({XJDE3$f4N=wuh;5IkFZzk^r zk;HobV$55N?D_IQfuoC$!E>-0_XT|?MPO*?+ut)9k`6982FaPE#bOdd7ZXDZ%+)WQ z%oL>;4k$`R4!_z$C56pj3^xZkSwi>a$3;i$P%rD?e4wZi>)8i5VtyE26;;g?#ZGPS z8G=ETWn-wLP@fp0*%QfN?+}AwWbp0$4BkUGh{E(x z(TTRb0t_}o3;BG)?@t4R75MQ>un|PuFXw0Q^ALl*0}SR4z@VNCP9uZV#00Qghe9P7 z94j~JzI3bB)PE!z7frdVkciG?cr=k+8E1k5%x*BIJbcGyCl6p{>?x(tF1c+e2lMx= z1YbKjSM;%-mpm1GIs6M~KDOA^sbi-bWk4l@9`|!SLUmB1jfFi(9>BpG2 zP$0a1>`OkN5LZ+)53vVR_>JXo6qnK2C<}3#%kUs`BD~S5X3^SNDpoY}F3I!#XzMQt zsxs|6WU1U3T&tRp&S^mf@IuhgS*fsshocag3oC`Q)R2xk99vNp9?s(;WR_1g*7Iu- zMg=RMj#fdhFQszS8oy%b{K{kTqVcn`?3+`N<8PCKBo~DXQpAERITclXEGi-BE2Zml zQY;-5Q0?I<6B$ChX~a7iKYjyT1A}yz-J%-?=f=Vv@2xvgr(PV;%`{P1{(PoM1{8YeXgrfrzJ~V&|t`pkAE>S-ki|%{+0;Xe(UkfsWL;U+-aPH!7 ziI1Sf-}$Ci31Z1CiKqXA zeV>j>b6W5y^ekwJ&maa0_8$doi7%3mXMh{g0YbeJ-$i~zvHg-Z4bZF>fkNh(khnhp z8Ta`*E$$(pBmQ9s38qFZKrY0Y0CDW($5;-`ypPEfzj~Gtd+|Wnmcrh7C$am8y&{A? zo7go2VGmQ-t%ALS*jIfrW7`#Vp#)N*?P^L{cYkjDx95Jpmb{_&V^NkSrsRUn|AAAtOvwNET zDUJ#tApBd&u<$(;{=Lb-18zYkJA~N_$iR9u3u`N}T8T9YKfYBSMB(~w8lZ0XMu-Dq zGeFEvc9TTkq#*Wo_Rj_Td14`r2D$MmtUwNr?_@x}qP)~m{WgkWzX_QN6U z;lysz*jWSh4}t5>Hk2_U%W{cT@9oOo2f_QJzE&o}Ceub4eoYxXm-sXAF)lIDW(6GL zsnAnC*Z&>hXa0CXPz^Uz*k8}pYRDD#r+?d(u(fdf5O#2uuuoCgJww9o5fb*$fUq5C z#QB7M5prh6hJ<|uzQEnn2n#RmYc@QEQ-;v`AY_{k*{LscH{9<(r(w%Huvt|Q3 z&r}6tW;3A<&3iICdPAI=qVT8HxmLWo1xW78*K4`5{nZZ;RQdku*!f}OYh`_&gkt6$ zvR|pjG?dC|<}|;IVR&PdsRi@KFp_um2Q8Ex!@?auBd8g}6bBH^PRX3WVKSOM3~ynh z5fn)9F{>!((&N!9>})0Vz^boI#ahnOBwwXsPAvb5xN7NaA?WQCr^kc-=OEmfmB z4m-IV9Nbq#U^UrfW1y(Q67I^(5%l};0}%9$+rxrBNI|#5Xf-n8P55;4)Df#URMn<* zWSKm*+z;6n0C&GNN1IlhjCGq*W@pSG(FQ~G;#0Qod~NDg(9RqZVlbTy_B9L+0fS)F zR*7Z=72kFnWxSU%zCIx+-dJLHqZY|6nTT#n|JY#v4!pzd`8Ib~ z4swF3{x=&;^(#%@O+J4kAJ6%$r86)AE=Hz!@Kp8I0IGUKBvq4Tt;8verj9b&f$sqM zQFD}bW$y?^-EGE$_FZET3>n|` zIDoT#m+S+PT2f<-Q3okGx^E@hMPRErx@}hr_6)GVK!F!<%JxqTe0~4)eGpN>plbHb zEX7ZNVj^5>lWWfJc5FZ1uZ){jo3Gau>S+c<|YjGVUQrKrf;CSwX3Lw<2J71PGDra zil#NH>CvuoHioGQB-ux0WEW2CV9exUBs;xJb1HLHT z`7GTGzjW@PD?j%t%o21E-YU$FZy5%v_G`$XAC5V9FPe@@xE)O-&$lBD%g7eX=g7s4 z%|uJtY5xnh`T!e=UI=w$VK`kOfo-LdWmepN4o#TYvnuU#ilKQ6vbcp;<*9`Os8+oU z@WC><7q<54MVYANCFR*He`afUhq9P|eKTD6N)~<)3ZFUhYaRp0{ttk=r$EzUez^mW zufDOXcD5D16IHn|i&>1!mXeRx&VCF&emk21bu1BM+2|e!q4Kq}THt4HLGgU2z@7XJ682~%?4Rnwnwd;tUGnjS-76&Q+<>riAyhtLmjgeOh9~faeG@^x>s~RS zu+P7~D`D@zpaYsM%M!Mn!cGbaYlDxk+1UYMp8;GxVgC&|GowPnUPNIh8DY;sgVA2& zAjo07#yQB(@ftf+Z{CU8Ovi?>Df=oIL8^bbT&rMjWxWE4TgdQ);2M{|4b8}1YoPb> zp|N4&S!|fdU}`x){3(Jr4*)&{;Ae)w?gveo(DxP>uZ(~2|OZ6l=So;7j8%A*C&0&k3KqENr z2r5IZm3hOWG01TjK@3^!a@O;iL5(eP<}9Wij_iRJ)0np~$=}brm^MR-CLG?OsOxs~W78A(gpOOu%t6JgJR z5QY%pm^&HA|eb8A&erzih&S{iSUZllBwKxsiW@|adOe18kb2r2O5IDTZ$8AMjd=8BB7c`MroS#S((3Kgv7=}`?-IA;l~N-k6Y%Z_=&Q|+K^d=9GOoIoGH$1g z&mA0;@pj6%XC4_pfKNAi9Q|oB9vYO9dQ>t7^r&PUnODZBlCfB1bSdM(AsNR|#%oYj z5-R@?G>o@PO&pFq(+x-Hj04`TA6_k=w@V9k>AL5)5(kwVjV?F=cR|%{;=odGAh8LC zx}I}Q*z~ti+HZkg=IYX*TGs&AT??&<$nO9-JeIv@3wk!yKbcpga)O83Km#m4ygJOX zhb)J%2wq2PiKJ>Ql?ZL6SOmCyD%d2_Dhvl3Cz|$EqBdcoJEVlmloBkM820#;K%T3! znt$LhTack-ejGZ%+-78 zE{pOiTqcUrgbpLPHr~aee3vToit-x_v`tYGZPNk;`O*LdIUD$yuZ0ToLlAMld%iZ3 zkls%g?U(?Y5f$e55TcN&MBVzpn-lKzlhTa>2O#N+d|{7P!U|r5FadFAL#%vyZ-Jzl zTcBKD?>iCCyFKUS)%)Ab+obc7r;~@)RaQ*KFfhRW%L6pggUSA%`v=)CBa6%Pu}Dq4 z6?sN8kbck>R9x z8`A95Q_Q&&77gl=L!?4e%(1-jLpoUx_ffnjWJPDr7bW=IcurwK=90kki9-uARsM59 z>hOZhWdFJG*f$DuMs$axv}jPrUKwsst>B+IN%WF6?p=u-_wI90CcF!Qa`Cxi$nGp6 z3+}Ex8(A~^tmtFwDI_dOtlECEo090Kggg~QzdH_z!A@-%rU4+%gEPb8te`lL?T7NC z9zzJfR0uZ%0ZWwxJNL`vW88cf^4%9|w82~m?6Bwj)eDf(a~k&p+OyIg00$aE57_6k z(h`c*T@qw^C7Dh$OyA65I+;wBo6xUld&L?;rm0cG;2@!gd#_-z9z?Nx8F#0Q;bH6Q z0bE1_RPmX&)jtiE-bn9IFb+D{7Hak=kW-^zd0|{;r{$gT-+d`q`fCy5x);F=sIBCG zP#_&wo&*l20nMeE*vhuN7Xuy>jhm_)M>=~OI(itup5E+b_)Z9X5W(L%OS8>3toISq zLZN3~9xm6tEY}67yr2MGx?upbueCB&W=!u}Jn2M>h(eT99kU@s!}_z?DTV*jQ(kK@d8|Gf|^VDQ!gr0|R5{xf=bu|LPJ+?~M$Rm`*6Y@$Wq>2Z2goW%Jzz;1EbxQ1!XeAC_ zr9maJu%t6z(%6SY7oULSpurCjcH*cVo2V$r!6-;jmAA44@c2~E*2#s`>Vap#<= zi;)}8)pYKv-gZMr0%of&4Ku4Jv!|&pPbCXEmt*#ww3P--^jm0)`Aih!WW2f(680Pl z`}7%F*cZ`XhmGuk^sa=x5FQ=E?w%#=JPNxvm}xinb$}T+XM$S61mos9F_dtR zG%~@`Ofmh9Fq!ux)nK#`VptLf(0U=}DV~^g7k09WVpfYX1FU4jpL0%G z!W`rxN7A7?lgQrqqinr$Rn{2GdfEuBTT!qs^?X!@DfJWJmt(i{!A`d& z_wfnjOrh`OtmQ@UQl`%Ej@zK<;_Uw7_K<)-t_=$~nF2n9y4GU73ny*FIv}4| zfAO1BM{EK|tgH~|`&S4^-6u}bnnU+(#4_fRxnI%*-W@bZ0XAieyAx#m?(MJVhs7QyA-6^)^L|&GA*bFPR9UIVsJ=9h%Dx1@ z0hL{KuBiv5vI8ji+@WYRJX|LQy?Xm2RY9EkQb)E(COWVK6G#6^a+PCYK}SQtpk%M) zlT%ollxWYHTB^5Ja-*c3EFm9^8$5M5I45-3=PAGiXu>GKgXe?`Fp`8HgHKo0jR4$d zQSKi1c{uDq+W?1CvN#lzL$%>xO0ABxzAn3hKMeCOHjc@pyuA7l6k+Y3Z8vq zu!7lpYs<{ndmpEyZ-P~;P+e8<5K8~u-E{@8pdU0FU`++%h*+s%ziz$e=a{(>^d=c`~z|R~V5_S}Y?ME$%*FK$QsDtpVS)7l>LcMXx`2(=Hge=kwSG;a9jUd^* z*RaSQI6bEv%n+0pYsxHTQwaNhVqa#kFU-;ADXr{#O&2_mBV{!`VMWxLaGuCFLbQBZ zc^C@G3=1(mhDO7W5q50=yc^p~Z<%c)uKD#k3 z>3&nQ%z7K{H_W@ph*NvuI_~)ZV5Ykt4PH6j z{W7rtGZLu5;#BsC`fHFA?Xf(IlS@vg`U-Ym!?p+5hpb@Qr`LE!To0l-UFTAC4O&~n(A%HV%tA_~di7-;UuQ8d|0q*{%T-SBBd7hxUkE=k; zPHrWM&7uZ_y@uFNYwRY3RRP2QIrAPcdF7$JA29DulXpNUZz1!pH4=?Q9;;{rYz7rH z>K5es;o-DA<8eI3Dp4t<%_%jD|K-B6Fh5aJBApn zBS-EmXT(1BG=rg*Q`={quoWg9?_shz&#A@b?k^ zio5&!zly)f_&XPWv+?%{-ZeN0uVt9O_p+Xu{*^$!fy;N@Q^OsFYpwdeP;7i#g^e>W zM@&EnQYZ*D*MGMoKd%YA`8aj5HYmU$4ob=p+>w%eYW8Ulv0|6 zw)CZ9>D4@W?r35<$<}fHc(3^Lnd2x~ zc0s-&;gS^OAEyNh(wRY3vRwGp2bjiqfN4z52S3l6zr7V1TF2EbQ1CK5{JIQ@mG&Q@ zYv{SI$FALq!vVXh>}T;hmfd05f2gu+o2%@2BTmq(N3qT(G@dwEz9dF^8cHb+*7YF_|V$O&N&}p;#+hg#mNBnM_DYy)M!cYaZ%w2-yM8n-kihu&{_J}5b zgiLqscx03h@;yC#RVC)IoI0Fe4)L6L56%^2WxgM$bDIZ78B7@l0qoUt$=*)Q#-++m z&cMaJ41_T{nu0>8mpeucBUuHCx3CE623dRu_MS7x;t^^LgO~U?1SKtoZq5^lIb+X1T9`O81(_Sut z@$9<2)I-lX?PV>9Ya>N$VL?`RKh_5(jC5?lGf>NscMS7BVU-|H&Q1khPX{EvK15?U z;a=5nSv3BM`73u_E{#Gt#W~ngU*Jp^DwiimS37JLdsL#1(Ne)Iw>^9vr6)Mx-a0kV z9=dYd0}jbF?E&92D>M2#;P_9|UpeH?(chQ+vb)D0O@M|Td-t67x)#*6e5VHG+mctl zCHN=)aQ^m{Xj-k}3ffy|;A(HIaw4&tcO^96{u4Mn(x5_qCNSw_A z*83m`NF~Frm|_NX5LeHv5$9c?PZFx{Yxqj|;0RHI zly6`qSkB4r6@bhqfB72+?bQNFI2)8%fU>|dx0`0~tdZaRtwO#lsVwMwta|g5tEpfeWEUN?gtAHn-q~43T>B0sqiSlloXzW*D-Yd% zf5YECNz3uTPu_C;Ptx*shPrD*@oCJ7^}HJ%z2iZ2(7Gs)*9m7)L1)p9oX{gh!)iA`oQohj{_hoV z@PDCz!~S~(jOHnzHh6>~!{MLU{G1dUXCgD)mYdAk@_iMtZAYv+(LO|*w*d4%%Pp|O zfXzLkc4{7eqj#PP@+S`#CTymrjcZ3{4H72#ateh>o*c0DQzbz8 z!j0_GPk!M>K0`<%9D^CFx`OW$qVJICOABC(zq3_twP z__c!=8v6^B0;h+#D$aDiUDW4`s1xLU8sO zW5OxvQ@EmnY5J8cAuC^#AUSf)u8MbX5ffPv{z1I?G{p83)u@gjp#9WOAfNeWLA z<>R~hl?(xMEG%J3Z|Aq0_BRW4(^*AAj#Pz{;)Bl!M`5WMsU=8 z+O^NgEv*>1c$5IVV+|K2ur$hq)trJF-pU+vs9G#)D~MlH-2QIi37ew}f|CwL!Lso$ zbqPhqZY+-dlJbCiEE(`NY+!apSvVnaOIcx*TkNyyE{#o4NED^y`!Pb|U|V6LFC)&G z&S9!q!GL~ikgaF59C^SjDJROXhH=mSSi_k4um1k2_&XYZqwx0$&hOrazvu9`5`W*t z-}U&b#$WWHCKk;5er9tQX2CJ7R;NDkg~{q(xDXELGvCHKzRZ=Xy%}FdnwmPrYoae; z;a?s+!;;VEVW&(}0It-1$cHNhzNXi@g!j=VZoo{(pXUR<+Jy;2e4?FM(NqO~LB9_l zUz>|>9U^Z?r!^_w8%?SWRDqoIkWLa%wikb%hKFT@6__7U(#jErYG$VCa7DHk4VZi^ zryk!wHX`b@bZiE)l%zUIecaJs^H9j?SWPbAG!!cra9S?l?7V=pa{=e(1)Q4;h^ePM ztY;8Vl!Lii=(DcZZNyFwet-?1bc`nVLN*n(Q_W*Wn~r2cq5-qsO{J2ju|C3x)R5pu z$j(4T;}b}tWcBIvK+PAqk5p?N>H{4Ns(TD9mtt6n+ls;C_n4Pb?3T7o!1s)zYw#(v z%@#TbeavcV%12nZz>NG*tkDmJABCE+t57F92Y{YQ>pG+1jU4P9df; zscEQxS02R?6(~_@Y+erh6W{O?gmg^mFH;Or)zlEa899HWP_S#;u+#{Hsss8rfxbo& z#vGBT`*tKfElEe7jcK44trI?oCdVsLXoeJ*hL3lu0ci{5;EK}hBne!kG^%_}$M_^z zKEQ*Tt*Bw;(>WK^?o!mwC`H^;EbmZhJK!2eqees9ub5`i+t5x}DY~7YXzXvQab?$^ zk8Y8ND&3>BORyI8dT}K`h843#GXYvfiwLfdV*= zbwJ>$(uvU;p!-G=R9iQ_$I68@r97ZA9$oW?N`CC^A22#QzC8m_RX$Hl>`zuHiV&){ z$TvVk9yMI#PPeil*+{iD2Ox{xiCK_P<{>62E%J&S>Ov<7!WY`| z*;0KnU?`1?nT;S|;uj^a^j3lH<3lUKXkMbd)RgE^(tSMlHFO`ZlX+^yhq!ku_SW48 zYSWX(20Mv?nvMeKI*P0-TO_pOt}!b2NrY3#!xn;gZw9Zk@u3e(J5o;KiI%yziGOCl zhuPnOFQftlFpRgF_E5JjIxe;Yy-_3cZ5VND84~!luMvA4zzV2!tu$?0-}3De?|w$$ zesRYuW>b^s|P6M3A>7@cAJ~)T|Bl`;d4@U>+cV#XGBcmLAcF{^#=mN-n zkzywIW4wE6&pxBry)3@V0-dNBHU}9#pV?0FQ&Zl+YT7^r+V`^+=nrU0Sh^n*q~DoY z<|Vv5i3`vWF*&$TTCNNR0J6VbulyAbf}~>xbA&m zCYv6#xv|nRv_kPyPJA0a0;;}78Q4#Q{R73~f0ge?o0(hes$jRF&wUrz`yRA~9>@qQqJDcM_Mp+}uIr*xB^|~R@5ywTUPWHL z(yovWiOm;Z$U%?vW3&?8OM%_oBKK+^hdn(9dy0L1sr#Q(^aC8--_^Zp*W9XtGVxQR z{C8B|{z&xkbR!9J`<5!IE(dtC?f7ov4#iiImvVUCIGcXZe>!V~zVzqEiyuy(ri~n- zXJP|$Q7V7z!I;t(9DIRK6;xa+lP-Nm`y=H)G5QmViQCu%(U258E(|ND7KQel`79(j z1OO-2iZT;Ic=Y0ArK+SHbfe}83eje5dc{7c`EKMU+WT#}QAiTA1*)mUy`aJnlwghB zcRJ2?iSgrh3OlJ{Of+>eo>c)59?q=ZZY3sng1;J}i@m92XL6@I1QfN+ZN(thsrF>_?;PixHZIZDZ=Z%4 z4A#kU2yxIS>|a0$w0S#a?#VKxf|6*Ts@hyW`>dH|cbP6{mK}fFuI|B>HSq>|;N21b zEqkHtuBQpNmov1$m-(qEN#HZ*QYro{PcJ-!c)7OxsYhe=(JHaQrqfKK&X@fXe72l9KQsbv% zr4XecqqGz6#xt6{a$}^A=OKJPSi_TF;zR7OlipSV>`nmusUMMQtyL0TTl+Sqi;~A{ zOay?Fs(Yfz!}*L&no|6JOf#TTP)pdYiT!!*g~)|A3p2Wb&{K7hr1Aj7niN@tJ@L`S z`vP<)K%-6C|KhnI!~4t+P`9BCjWvvUOuQ5G{He{Z47I78jSRh|7Mu126>xRcK8Xlv zeieF=B(yvgWvYE#Vo?wtsVa(}CEs}!H+-xigIxXxD;Z0HBP?Au)PiIWGJ4U{TgYZo zHVSi=sYG@{y!BCGy^SqQ!9S@2kn44tm*Y|V0B^L=s^*|K<9eLt6$XqqrfiH-r{Ga_ zBpMhZ0s!45zR!wHU<5{;DXUh=!4y!b*GyGQSBN8-ZxOWr2g#}v1&klA+`v+oR}_skbLXrI`(=E)nyv~JTIb@p z?^-&NN;|$4-=B{E5#OVR(l(J^I^M>M=q(zE$p3C7K7oJK5%~j$AcRUyT!qWJ@(3uk9w%!mQ;5&S1OQTVYHggUs=|CLV1N_c>+%1g% zQKp#W^Pbufb%7)Ug3FPgjz5K8II^eMq@_2B<5{UmdJ|+!?!+^i4Wgev?H<@5s+(=* z4m3K^F35;J zV#sV{qO}>|zC#h14`B$x)&C(1`8Qn)y{qrZA4*B4d~haE%(=;NSGBN7Beo(rn&OCB zDRDaPocPvcn;l;fGT;?rz{|C<0t#SAg8@GnZ8{K-8CE{b1bhp`MdDthqz}fu7%e?4 zq=J)H6}(9tw61KyJj^T8gM^)Ol9F4!DPrV4a>QsPPa1KENKZ!q26X$dPvJQe_f*Bg zX4*%w zrYpVQ1K?=|vl2Yamr5i8NKsUX-y!*i|$B%7MJ7cT4MnQc5AHpH9p0f>-UQ-Z1|(x zH@;Jd=lyZdhDBjv^SAtMp&lUtBRnvt*71EbAZ1p=XUF)K! z6^fc^_F=E}5;9eT`wi|wUTc-YgWHBbf|GL283Qd@GqEiH#$ZgpS@w(WCwPkjdS3~> zuSD^*qgzREsEsP>a%zZX*NhQOaPsm(Ru&=nva!?9<$QgNoJR2x-benBC_#?ums_S~R|d_tB2&dt$La^AQYEN(yGb%ih%VCo zxr_dsbUUP1FT`xFH+-GT=&911FDjd5qYrE7MJ)UtA}G6hn+oBcmN3P}RD_!C{JP@Y z9aYibdyEFPG~E&ny3r*4CPvCoSvPd*?)Q`*?3$hcEs*6l5n$#g=mwC7{tB2M>v3gB zKGVrUj_i>9`-&I~tE7!17L!=5TyhwSGD(GU_weJW5}?r%AOW(_B1dABCKA~gMeDg) z%pM3uP*Jty2W9|ugPW-NM8oAjT}Zzm+2iB$Fkw*d#EVfTL|=8_U)yb0Z$aFEcWp5J zAKxUUtcWh%Skd@Fzy7YzMr$T|RkOh^jMf zhU%@7wJNy>mR8DJQH(5Y==H817&8QmuasF2IPoWnzy;6aU$#>5R(vk#MOX&k$6%}J zu5=(bLO;YoozA73P@3gcc1PUqjN6;5FwJXUGP=mJD@PYw>B`Y1;D~d$@ssF-0IK)e zA+3RZU{$KRm9#N%0BwvWNIJgB9eP|L{PhmL1(VoRuU>%(%{NqBK#k7Dkgm$99RpEH zo!SyhMP^WLT{o=yRSXI`q2W!Hc6FO&U)pNdu0nhUX=_`=TA=NYipHJL_S^i5(yMeF zjD}2X_S-Luwo7nXhY3<@`?pwUbNBg=ukGc#=r|mO-wm8~`zZV(B)PA^9Y}4p)<6fa z#6Msa3<_Tcsg`+t!*B4OPGT`{)hb?#g4B-LMSPh9#MipoUqw9S9xW z9|kgrkHD@3q>(D*#QwoG_${cj2gy|2eZ{nA;f`0fG7muTSq_xxR4ZLh@uI6i;2gt<0D3 zCfo-ld=w{wAl&#jrcXQxmt>Hr{H&1F=QMH|3zFCsu|z`~WM~HuI>UB!4bb&V?kwR` z4b4@QYgss$n`2~A%VZS4C@kQZraZS88iFAymI#ulZUGQDekrG z8F_!g9GQSB0xTLrt5e&CnTqxvh`G^y;v=|HJKiiEi7p_0oT^2CJAx|Zcl?Y`E6lz| zs62)F2owIkPQr!xv&lnYUdFvCjK>;dDkGmiOWR{+wGaw$dP}G~waYDg5R9Y+ir-(Q z_W04Gz;IoWUIPy;tWbtJFnEB~Epy-eEBlb`WXDOb#HP6yS6r6&eYrqiC$E#rRDtQO z(ZmWe4T=fogh-D3di~zT^o8fBoNk6>=npF~J0ktzSe=gHtzQ&@g3LXLp9bm$A5^^{ zn>sp=(EDjI^c8(@Wtbd@_aGl4aUN{VGTvhB$;b2p##Q{Mo>r&_b_3`#o6ZGY6a=8& z%mmBjERkpoA&=Y;BD$t#KXx=Z(+a3B5+#fpyZ_vK!c4?opzB@D!>Xw1fme5EZ zX&4A~>A}%ini`CTI>_kNTo=!1)dd+CnC4wN)a?5~#~UkU+@Sg^cFTI4k2F2b(DVH$ zmzwBm+K+@%m?-krL92V*$MMzO3ejazSI?TbYSx6qxs`<&`{1mCg68;(Y7!XZ$4QX{l4Q!{#f9+~o8zI0lOJjUFfPX! zW3GNO>i%C&oKRt+Zr$iSb(`V_6)GB0#doT=GG4FVnkhAdcv&5aoQkSWVA?qFG#&5e>qeNwD?Q&lIapQL3@wPRA-uwEu_i2?*;%OepQ8(#1+W14}e)gS?D;+`g3( zA?uMF0%wlgN_oL}tu z>EBUxPJES23}N?_nLpnGT1cK0x#mPPjPG*T=cXU?hZG<-!2J0D^DwL>QAJ=L<}jum zi62tSY7Ya>pKG@w^Yt>3$jVd!EGF^SVn}|&63W@ooj$#k^EGz7MHrikFrz4$Q(vvQ zn>qD|^t1FXYb+Q%X4N@f;o?%P40YJX=Y=)9V&2tEE1NkL1TG$1nopDMmc%!;j z#MNz1_4A0U6*LA#cmdu0Iob_l@}vyqdE7#90)Lr{1J>hD6o$sH(?NCM8GY2(I=qW* zX7r!%C*XjFPYv^D2rO_X$eNLW99CdngoZJ&6GS%-`^@quJinkB`QG>`9q+^=+TOjq zpx8Zh1-!-hMrQRm(IyY|<1mA$JstddV9rzxkoH0A^#IKfg;X;is^GiFw_G|MHoR_? z!})Bea43MC_`PDs_kt9X**Tu6fo3^Y$t=4Xp)vZsH8rCXZx+g4IeFS&o-mavlM1Gy zS8CY(?AjG3%c+Ukh?so9a@2SWpPic0{^#tj#JgC1j4!ck7e((}%SM-qREh}IOFYMg zTJAwO4_RtgI@QZDsB6K1ZbhQuDT&@`K57uE_U%~qTb1_3MGWXGqig+1o^sMYn(7|CKmw620WR4R@@L%BnZc~6i8?w6`pS%KN z_(oY?>!KH>X3(&q0Tn4|QAUdt;zrpZAUFG&uFNv&NB#@aRpm%GY+&gkS<)>KDRQOz z2ym>s=-RptcNjMHd-^Yy94RV2PEhM73_$GBAh81nAV#AO5@VPx`eFwg(A$h4vEDmA zn`A#7fY?3*q|emps=ZCYQ)0@Q*!YU37{vn`-=xT7JV#RpYe*CMnI%qdt!E$>z(XI7 zcL;GD2k+Gp9CSLEe|Q$@Q?Vk*e)1iCeHqS-&j;a;*Cd|J`4V=+$97$xQ}?kw@gZ#4 z#gDniX0`tg9P|tBxBlGtf|-SIV3bQqvk2e7qd)n zVHzl~>r2)w-PfOBL&HGCUeF>$5b~P2<76BuvSLsq6h=J=3hBs-V+Iv4AszXNzLW8Y zV{;^f;XFGljE^WeqQlIdxVqEOs_pnTjOx7U%TnmhpC82e7$`(jTXgJtoMGJ`9lN@h z>L2@Pk6a$=lFNNUi8<&vzI#ME55ES-&uz4}W0s_Bd9 z7{Q8;O~%M=j3ysq2?wEPWl z`AN!R*~xNX;>8LrQkgt0)sl^or_~hDSx*6RUX7F_RgE)oMjeD5e$~$2nB(fhAtBv% z!xoGcJ9%zWDp?HFD*LqJs#Lrf*P`@kLof+aklsy&-VNPO-4^rX|V4tAn> z>5N(iQ%$@%1k(Zroquy?Zci9ijIgcrkI=(wUM8Jy;cx@M8cD_THB_Pu$=VFw*9g?!h ziTnd*pXezP*Qq6Z9tM#k;aVoDmNzYCe`h5VaoT!1&Qp}y-cF7FuGWVW~s>Z98~uRAffSN zOgm-sIDSH2PX7YK0w+?51k){!QZl@UX>F$g!%N|KGt}lp4ivCrsnzFU!HI_L#nGmX zxIR+yCDnCG12xFuHVc=YiWN2E#xJ47-C|y6tmVVf?yTVy&rp% z(9;2}AafOd9C$5Z*E+N~Lq30H?Uw zv(o;3rIX}cddO%nEO5vFg^&%MwseE;%jh^VcOnC#t$|9>_jf4K+MsTT#yEC8do!Hf zhnF*@C$m?x3$s(B`I{`oueu|n%)ThCO+kOdO0lce;+{E>lZQj*hTzg*{f$TI*|3B|0@G1NJ#sG(NR#C6^j%f z|7_fTt}1mYjPby((QNknWA(7NlA9duhPEpEbt`orV=2p?UTmef8*F+}`g9db?OqH+ zbLud0Qwzw~s_fspx8gligi;_kYQB(T5Y>wy3UAkfA3~`bs!3i}NBG2Q!HC2CZBJo= z3=;Hta5YFb(;qmd(MHGm_`UE7=#kxr)eUx##M{6h{v^)uAJ^nu2&!-CBY3MPO)$=( z8%Z?mD2*=WLKm8E@)E$v9FM&9?o{tcWC~yDQR#RE7`c1I@0G1IeH?h3A>nh)#n}FY}Axzza-GCR)3Zspqgr!JUeaZ(9+5!OF5l zm&(VaA}?ZEQ%+#8ga%$DnD;zQiHq5?g(C5EpQ5Gq$}ruV19et1k6n^`+3gs$L6&~6 z4?r9ni+|3IFp(}UdcTb9Mji%0I5*PJnR^RQ6Y{o6{tDEeR z@bKz(R=Tot2#OJSL>TDQHgVTWZ4(H|%+=kQhe1|KeI8T{eKK?vjv~3t*e?ea>=vq@ zVaA;%%goqI&yZm&03}S?r#N8Jj#=_Rw*~cth4ZEp5q5IjIJ%gFKA8!|R^nBH4c0EQ z-4}l(qO^hU@^s@?z=0n09A7T8e9K|Nd_bJT@C-!%j$c&`b<5qZdsyx|NWF&H3r{Qc z_dGr$fI!vzZe&lyFI6JgRU^YDk~OKKB)WJh?^3B-MMW4zz)gS)U^pdrm%usa7Fo_Q zSt-sbMc6gEu_C(mW%vGalouoR@16=`&U(^v_xuwjlr0d;?c`)8{dEFM;0f)VH4;rB zkYJxxtj36{luzjo9y9maALYmu(vMH-fHC$ z_NHp7elD;j7H19Cj~fzg;#vtacQ*Fm4w3z#DnZOR`t8~AnNXM1KOBjYRQANk zNw6{_VWlFE_0bX~Nt_EcifxhiGucVaK+VC&On;xj$T&QBGF(C#0IPmbfEF|X@M~y6 zZRu@MEs(8D9K1wC!S=%*O4qUEvHfIz{V`pcG*0am(2AiA*PI&gsA?A|bBw13;OJex z_>q)RVIn)v8G;a!4M8=kBsU~}TDv^%2h@hFNB~g=Wl&)ZJT@p5wgsEeOx2PKJA;XK zMT{&pwo_9qyYPy`X@RFnH6x=*8N2#e{@cZd&O)oyR4;_#i#$`x={frN%D|j%DDmo!8Osa@Q7w-%sSm{^{Dd4Hw*bC2a z6jhH}Pps!JXx*q${#UK7NlTu$IStT;sx?DXHU43Xes%FPE#A{4Yrv}UO+V|-?{{LD zQI&q@kG~hA!kU%WRl>1%Q$Nwgk1CC}T9c$BjxI*f!>V#&MYO?eT z{(6j13}U)#DhV_#-m_`xuIUJE2D16`MXip7%?oiCu&&iA1M-RywaFtl8Qewdum&%r z=++6H(ZvfS3;Oz0H)CP)C6AlAhRL3r>4PK2cC_)>hwO~U_jBy=6rp22g$?|E(ErnDO+Jt8J z%ufZSIatH%h?$lgU<964e2zu zgmETWqoa%16XRGc_#QU`NZtgdRFm7OfO8aHC(H``WY*rAId!xJXKp8Z0O207L~54z zQnOqV)KnjewCF-K3j}?7-$% z0ey&|d@%uSl-0Hb`v}nWZhNP{U$1Pi39e%kw3A!N`UFgBm_-j4=VLQ1c_;#Jp@2f$ z$>*82*Ju`mkDYwHUmgR*HZgS^Yy)wW&!UZ~$6>`2vYZVeJ2)xz6cQnHg%SDyT|QKg zY)ekNm3xC(Dsm7pU@6PFOIgM*vIdP>Z)W^|J!XS3XaP229GtbXsRlCVtdC=VMi~Z& zeX?H+%QJXca(CU^e-F(D#QLw6(NVNm5vmv0sp$51dHM}r3Yehm%~PU(`pvei94x*& z)!RPX={G(Ym+U8D!;LxphT@e%ygrCG4KB(Rsd4(vwye`{SgaCwN*(1JJY2ogZwOKv z1}V`cFU9Tx+_Ne9MPq1`d-_eQYINAUsm^!s3={jf(V#KME$`6>*T-rC?H3$y$hO+# ziDj_cW4`ScD~mWB`z0^O6PhuO7vaPi7ACv#%E8ujyc-Kj0IPPL6VM^M zzs6UyDM6Awi`sS~o(baWjq&<@R&foko5574eC)`07}wnm9!mNtD#GM6M`_0gwq5}jUIZsCoo7v@2o9;}qa;98D3S+UZG38vLg`6iT zkv@VTy#8$H5&uBq^K>0d1H1bwxuZ&|BB2y1motH_G4{-5V{7FIlSs;u) zy!|w($YD^PuaEiLXTVd%n!#kmzlW13_R68du-7wc#k^)yhZp? z09^QjNr6O165$5l#fqZaqw$*Xt`BG{JO$$RJW*kP!L23i3lN;Xr(`MDs z(WsNdNT`!agF26fOri7mu-~sEa_)#h1%>)Np;YA2JuwVy_&CiP15Wt7B!NFP0Poeu zWg>*Ck7;0IOJyh4OXWvXXMvczY*QYU+<;06>VL(yfc{x~P)U0?rcqD?P-Ts{?I2`G zFJ@edN`Dk-ZVx!qQWd{3`S|q%B*^cqAU{?t_?_ePlPQ36KnNrI;{|l$iM%+GTXArN zx5XCVKuLS2i?x@Q&nJxIPZK>ij5^LJjH$QrzDN$H;h#HUJshC-c&%evBt9xg) zI{jI`j^rM8EZrYBEhN_S7yU0+im*u%4`>yTDf4Tty`~~3(hsImq-WX99AWHCZpH)p zDTcQ0kFi?frL1H@FtyGyMVs#DQ)=QhZ^D>g#zp`pyB{^90Qeje>EWBXxB&8WLgI_G z!eo67E^Y}b1IT4SMh=tgjj;OvX_se0+Q}*cUWF8_+Tu3nQ?xs=zzm$je<#ig+*R|e zBBr6K#rY*A~PDt3_k0sWEKaA>jlFn+j-nMXl+{ z3|v~YOA$hPJ`eChojIu5`Jj%L_an^s;@j@Lpa@rj7mwZt0~B^LF6zay9l3v$GQ5ZBajy(`L4Ij3 zP!SzEDY;2*$0JHM6%(T<*_&_}x@7wdRI(oOX34h7O|lCYl&n)OOWSasZ|2ceO|mn$w<_c?9mMXNv>o{vI!;TzqFijk8&eQx*KV{ zbL4JPvIO-NO*N~yyqJ|YGesEd+Goo#hb^x^Cl4Pen^UlR!1^U@s{mQ3<+s>!>h63L zB(xhrlm>C4O=>W#d`Kfyi0=W2m~45hmCPQ9_7NNBN`WIt1}~+aKgxvc zu35>R7o)B&khe!R`}$)7ASNxPsYDm6mERyVGHuCJ-$~#m0x>2>^dXNdQ08q!G?}q9 zfPD1_E5bod;dvDC+{y}t4E30iW93wL2iJ7@-)YOcc4n`E>eDb!Sl+~+{Sz(df~T;= zC5wBhiA#_GdsqUsxhFB5W(L67D!rNMUuC*_%Wq<%N^fNPo=iVT!MAdc8djZ|zVp{e zAA$5INeqX7VB-_h|BQ6Mc_DQ+QcWvc2|Y(s^M%@!UvNvSqrRM>8{5^-wlI%tMjh@M z3-mas9BI-$=#kGe@KP{5eqEz#rnKMctJ{cJRS0J|6rQR71#0X{aL%jV>);H~LdQ~o zROAS3KTa2jN}SbfERM7;Cq-j$A4G5}0j$#5s2j*UHDc3dwh-0{*ewA&-BDua2eok2 zOH3J&#;FsQbIvrl(AfaB61PkP)+K<5HYr_49uyFnDehz0vFD6pW1f>`=GG{A#v_%* zdw|RkV(Up0F~=O{rKVgYlvXp*{p10_;SFy{c0q26UpteSd?m2kg64{qE>`9R0;{!raTDY zL5xojpyFMuT2P@NU;2B0&Y64n?q*vMfB*b`FZ=4v-a8Lx&YU@O=FFKhGkQUCX?4);J3!a__UcsvQcb=7=WEZjUT*d8YpW~SzC+1+ z&(6@uyN6AU?WhtggP5udVPQV)vMLTr;3Q=3z|YzMt?(? z2Vmg1S?j&!nZM-JpSW$JYU7g!d@2mD?5MwZwIH{u3CfecMGiJgXg(6}|6=;?9Sr}a zau1y~DoZE8ki%aLIUg_|vgDqdsBf|W_esW=?49|argK;xuD&XG1&`Z5*zQ8b_BIXY z$Ed@$Qa8Jtkl#1OOUTCh1WOvgWzxiwGIJv8&l@h23G+!Y0!=V%5Vmo@`R> z)-Pyd;)1dG#6Ix$a|lM!KqM}duY+O&WUT;SPmbYyOeAa9tc7q2iTe*6xu}P*T={zb zh7%h6_^>1a3vvtbf{hDjRrQYZNNkpG_j!O@Ny6%f>v67pbZydLKX-Gk@2ICqt)qAs z4S1qa7I*ZTp0a0t$j%%2O=67vrpmiSE)uCK78FyMSc5E(M;9;*hGpQ~rEgq1nOh}GOSK_z%O z6<)^b&@!athdt%8;=+k2fwJtAV3`;)w`So^@wG(bV`K=F_l)ku61#@;8#nToioWXS zQfSUri6?}dz_f}$!B5J)~&DonFG$ENASx|zwv{3N1|l}w@WQBa z3x7x=N^!8QssqJ16Y@u55~y_`@z*2C;m;X+!oBfx$VP_v4Wvk`b)s5g5vi^_&Eds+ zz=Pue+;uwuWC|33ow5MlCIIckn9y--+NX)_D!uqiLY(FCTgV_P70<)-`$8AiCT_!- z8b)Fhy;F96L`kbdjP^eyLyX=TV$`DnHX!Jt}lC zW2Y@gm9F-6j-^WPPGm68{|>40Qw}q@)%wV~UvDh!rwHF~pUA7SaRKlbQe{k{TedVO zCedh}$%E)>^`U6#Y5X0w)IE@;6e1Z+Z-`$6fy6a^B3N#9-zQ00+)CGf1K(k)W)8e~ zdeQHe3Sg-$fSUX?liN+&8sCR)_aZM%m9zEdME;~8kpc$NHP8ekeYg(f52}4b@wzp>R4EPUu0>twBD*T zPLg_hOlJ@kEw;eOE;;N7hRS<9ttA=m5yJYH$U1o$;vN)=w-{FZs?lLa0Xqf~Fmpk_1=^S$5%Re^ z$RlM{Are1~{H5dDqT6MGu=l;x7k5W@C!c(MaFx2SU75<0zGk8Y&2mCZA<~E$hb-85 z57-br5*@!+HL#7qW(#by&Kv&|jiY$@%W`)6K>X+MRa2EGDJQ;@7*y`cVVtMtcMp31 z%s+{y-&7gp4|=0kifu%)BiBIgC5Bu}fg#zE8{ERZ`@}!;X(~WN# zXD@jQQJoO|FE$i9{}d(?8iV5XXnyfaPm?U^-jZAMmTA##h32i+2+T`S^u{-_z@M7Lk;~zM`z7UH+#6|;QUGQ6DiMFjW@&EU#SY^DG%}(<2uJsRck8M zs(SlbKJurIp-R$Ln`Elw0!c(Z-fJo_{#rzau)V)6t$Q=swhT8jvT8h2lMRS_a=qs| zQR#|49o3D;R9X|lBn-LOl)Ll>&WQFi;0p7&nFC!U@y+}TVv=rg89!?u7r642zwsWw zhefTVA#~k{l}Nmwo7z@Ces{b>CoC`8EV&%+ylYwR)Oj$}Ir=q+Bxv5oF*27*_naMFU9g`^+xdxeP$}K= z+M`7*wll*mz~E$&($z|Y4rE$usjQsw2dSRx^u={jSs(}oOH>?vgl(1Y`<859uU9|| zMh9tMmE)O>B4`Fk|6abCWp5~y*?e0rOKGFLfjBoF^udOU?aqpC5!6u3;pB<``Arq0 z*J?2jRYj0%alV%rOOkX>3imB}wy(+NYW}9_n!hn)I}1ES#7O&l28&0aqD@j24z^+0 zlKBMmWrU)r-x`0BnA{o^cRH5MjK!*);k;AjEmnaf4{BzbN27n^JenlJh=Z{4NmMcF zI~3F_KcQWmubhgXcgRLP-z!NaPxVS3mqL&cmoT4R*{fz)k9{NP)mATQc7bC`K&KfrSmPL_H95P zH>gxF)}hs)@t6e%o(&q!Ceu)MC6({+w^O?|F=deG;5g=v_xSX%c7FIT&nNL;wX@Aw zj_%%yX3IqId8&8*@0?#iS8xmD*7*9%%mPUZ6Su|A6TVK`D_J=Bqss9sZX$!iFtzk?Ki}Qm_gQ;xI-}VAV4aq3#!x#{!t9JOXF5J8Ti)WizhYp( zkhZaZ?#-RiO`VJ9-pmE8H^uwO>dakb-M66V3MhAQakg6JFndL;c5RVlNubT;mJ!bS zU!4C{N6%O@o7Vv{7;DTjqoA@@O@rh8k*KfqIW+zSQm(1fb``mg57~(I=RroSFH4q{ zr|d&e{DVs~BbJ@b3wrr2vWR{z%nL}}R0+L<0a9GP#kBnP#fO^S-rhf5c{m@_widV5 z=%2J{R{w03b1<#hpMMOD8B!CBw-n|*Rdb8#uR)bD_DEs;O~-gX@9{q`sbah}#dzzH z+@kiS?T^?chxTWT6Dt)+3dp|$imNOI>)NC$FOn*^ zCjTI7ABA~a;4YoXu0PQP#R9={Ug z5@r!;ibFd!q{{~b_3GtMd;fwzDnlxKQc`4u6p3h?OrqTCxqlqGza_VtqtTvVh#4VP zLq%u{SKsTeqn1?sV?U+hcYDRZ%X@t2vb5sen0FWa zC3e38-w>iJ58@9zsi8`2TfL95)$dr4omd-+mGjX>4>n=bA9|{#z5n6d>WAZt7=)^E zM6n~oA{Hvb?NsCU`*1r^ZHM1jm{)6a+sCW&U6#StKH*jQHSh5Uz8tC&pU&Gb9qvo?t^{$@>fGQNO^$DKTuPO@|1U~{K}V-^8dhF!}6clUis~b z{2tEVWq6xDkl2wZq^WW=nvM8loT+ZVBx0NuZE}d|S$GZ_#Xm%k@`67On7(v_`g7ck zokkrFl8>S{zuS^bI`5w5ro~+_^xU}rxN~rLE-<1NqE;2p1a^rqOi$a0ZI)__p}E!h zKfc_xR!-Q`jkZR;rm#LTYTcl zTsd2}%Z&#o9rt_KfUYANlcPB&>#a2B#G(6liRPTRJ(9c? zknv@#s#a}_7lp4Hk{qaXpCBfX0ITTAs&MO)fZ@bk>dA`fuu= zW7RD#Jee(6HsA~E!pYIbEWyI6^2nhUbOHutzzdsC-=DcHE*$^sBp*hFd9{^P{h_R zq~zb&fc*WWNjUP;yjP@FW7<8^QICf^&LostB%EUnv3kxqi|$v4&02Y{WCFM7&BB<#=-BDpwH0+$mH0Y;l0}Wr zwhO=~hAb|);dR)~QXp``upOfiqO}*wUW>Nn4sF5BD9IkXWs3A!G_zAJ`C$fAAmU}j z;%vddw?WYeO_e-$0`rRyZ{dBN$N2_JhiCP3DoT;EGFcq{w&2yqU86XBbSWx+ElsWC zfT9i2)mIQuvcG88DF5;6@QA?lpc-Ixu!^{>%a$HrZEM@_rl9Pey%l7td=05@cuWxh6<<%y;t!Lz zcsPeO9Kcr=)sG2_QduA%%@r#I=@LFFXQlG7Jfn|9jA7zKD=gmh4szA+W2^^#LJjES z4fHaBZUr=6RBvIy+((-Y138hOL8m-Ig7|ByX>n^V9E&oBj7kzhJtZucHAJXg=xm$`pIA$`P$JFKuRrlN7L7S@J7foQ?F>M$_o+EM7ZkOAXN!T38e zoMuX39081^nOYJe4XWglb@M{$Xj&=+I8Zxm6ALg9PZh*(I>eShtUm%J&1`ki#L2B* zM$HZ56a0GT`aBqe1-l)4S|DxIccMZzm%-oL%}+0nA0&k7*`7ipiI}6LKk}rjc!#QE z_T$%Yl~%jxn5|@&kkM>%hTSyBPMP8><*G1ja)VF|WTS-ohQ5jhfmE1;b#CuxpC(s) z^#u*K_+3Cr*)4Z3zY>(oVe4)I*!1RmmQ!ZfW{krwf$6>kkw5+ofY}AaYgJ068%poH zO*E)FRlHu=P3)HX^p06?gtov*m%6nCfjZOYlxqqrzP2s(pE#IxvljH7(o<$dq8 zoHJfZ$>uC1In*_XbJ+Cw5Sra|pczU-7PQ&s+~>^+!@lsf>1z#fn)Ojga+jPco{?>q*?il z(mhyuOMCL&OrmCvYQHUhIqtRB&^UPP+ZH69VVmawtWA_~M-y|`u9$r~@u853{+o!V zQxVHa|4l@b-2{t{z?B5*rCqDyZHp~aB7`)>Nirp!Uhat95b(TKGU{CbRyu%{@pTR$ z>El`tvBpr9uLUEg$Oy|8Bk|cR%41)lB2Qg!a`y>U#1|!)T(V2gYw|&dnbhP&ah~HjkylMA(JPPHm3?7(U zspD<4IiKWSeC0AkeNLzzV2+J1edb`6)q+_M5o{snq-PFdZY_vKfPg5sHYCb)h;VBl z%8SV-qTE_Tlw-*5L@9Uw!YMk$6mYP8@ka`nE`FiupbatHsH!2NYk7PZD|MOip$Q0! z^Ve5TU8QlY=@%DfvBkH)>ldNN`~pFcEhE5P=5UwApRR?wGJq*9Y>yA5GbRjUJd8sb z%5DCxObgBQ>!K=y~&w!O(F{xuhHA@erP}(nc6R2I*+)GGm&pq`S%Gc-o5V++T zF9-Zup@w|jll8jz6p(OKcPw9T{(MZ`seocWG8+Xp)U!jd6xFWSRzCevp6^|_@{q|=WYMk`D z8&7DY-`!0+(|9KR4xe3BFIwdhsn)^*MJMJfwr8C|Y*sq7g>YUscosn1v1w4>4 zuZUkeu3Y*+rrbmdgK)fo$oZ zaZ|5VF_HP*0u|PmkQ-z1-wzL3U9g-`ou*2k{_v!|YSh@wOhgG{j4nM}NkYu_uR9#A zT!QtcrW?MuXx*@#`d7Q*eJfQT-4wFIUFL;GlwaZ9@Ko*$7-tXkBifcxmPJmoADi9GkwU<`G0BjW`gFY%|CoiQ$3hUB2VpP)b3)ipBhHds$vw3%~m zC}Yx58^G6;j;$!xQt5{6)E0__v%~Q+$q5Q(^{qX;>q#^o#KX>1d+i}MC!6xA*VGs96mDax`B-tNgW`p>Zv(&(5iGV&EAsFhLrk=xgETuA5zO-vq z4un~0xvRo#K*=F<-JI+ekOAa!MHbiT2arb@29_gUKmt?LB~-9X>;%T#Q$j-c?Db34 zX1`M|{^1G2TV)S02(XeF@E7S?PQ`L}g(lnMXXvVqUHl*gn2!2UN=Uk5BEiaoK&&FK zX`6{MpTOmWd~s_c&0a|<;{fP5n<{`)QviC4Z|$i8uo;VOX`OP!-vm}P>21T{HnWSr z6LO!!5XDD3AM}g&+Q)17z**X6OUDrs3X0o-o1NV}{Ox8u`Qd@4(v&9h_>>L;{_~3o z0j;mvysmO5Xc)EZj~{ow!7C=q!4GR{G$*Z*-r^_Et8Y&X-_4YqTeD6X<6i?jk?KZe zG>o#UoCtP1re}7^xy*IK?+9p>&Ob-l4`lij(A=7oTVomhQmILWsH{m`n6;gMxH^1! z(!r!=s;rnoa{X+fyzcvad-c%BmO7tmx_-FQ*>qiR@!pO_GF?Af6Xoq^o}OmbTfFHr zR)r+9j>p6|T_rOP6(2{kchNd#S)%2|=n+mz1A6a>26L;+N=kzr_l1<5I2&D%-v(sw z1Kxzw2&}XMKVe0|VDu}O2Z*V%Vw=9qbfCBR4US+k#Jm@tLI`*kvnp}*cI7n`0fZ3) zbhRiIA3;erWv|Ks;ZeB|0F?>j)Bk#}#_8X!^mnT2weX|88>fGj(tm4w`Wp{yoc<}8 zt@6?F>5q7I-n8_+P14g&9%Tkot6{8Sa zBYCY1*dkvLZ+>c|eDNy#C-6g?zY_QWJ{`b56p55nC9M8P&=sYn@=^n-bu1VKO95C4GW! zBc#GtFwm7&JD|fj>vL)yaWI-?oPpgA;pm$uy|Z>Hasay)CUmqRAsqEI&|Fe8b?!aX zYv^Q$njFJoSj|f9eWfor#OJ0i!7n3E4f)gzp{Qt)QYW!iL-!4aIn^FsXE~JH9gFTE z?1shqf)XEL%VTcBb;M2`h07Nh&UMkWQ^{fweB&I3pEj*p`A91|InF=9y#ZPA9$qRO zY8{9@gZmJNUHGB;0^zTTCvlRt4fd=}3mYV9+uWtN4)=PeVsBnJw4h@@II=>-i9(~B zeVj7n zdoWGv9n+*VWK5G^_(XHly<4|!YsIIaoo7DJa-I>MgTontNw`Y z9o<8L0|l@|7M1o~!D@+a$dtQ)Yvu*c!4Wx!O;seFE@V=t3$JP}y$;*OQz5V?iN~fl z^nGiLg#yB^bH&sunv{3!sGxuWib=`VqT(9>%FNufxSGlN7qG^Hh-b2~H@a!V#MbRn&iEu+*Q(kW z>Gc-R1AN9@F%zH(t&WA~6P47OK`N=5Atm7V_^4G$_oxN;7i@9cYsr95ONx));yXW9 zgU=5Dkl?c#S&a`eRgD4FemA7g|-gNYBtBGFA z>%I$MCvL5NF0tqOx!&SM6h#XsD)zfnKzZHD?PNAVXUe_a;?CO4FClZ%p3?nbQ=g>- zG9r~?D_u)(dW$DGfMhQCdo-&sNBI@P(&s42f_Lv-fGpW!7CmeK?^p{i2T^*TevnMA zsiwW}Czn@SaNb8$&!h!6QFv_&p6_Wz!1z7iTD{atw}hv7b%BB;}zQ7WtdptA`jPNM8ngLb;MJiD}1B@ue5 zTB=aGbih8>a3admQPAqdzp+%-+w5qMeLJI*_iZUeo%^D}p1kkW_{finwyww|<2_o{ z)e8kHdh_9_7LbIrCn7Dq?Z|0d98_A*)-f$48g8H7A{I=|IMUK+oK*~`37i@YE=d^_ z?XUrLpq*Sa^ik$G5l9nMcRW686chP=+VzFkW5wDQpEVyz`=|rBq3Z20Vx)2qrK96} z&t=Pg6QV1^y}4F-tydDGKNRwJ;7YGs(JIqczr5{3BF}id&_&TX9yz;|I>6H;k{*;rG3C_vK)*QJlSyT7*f2 zwQ$2}L-ckSr@kts6Cl^sPOfy4ap0TV3e8%@cXl~mYPrL$&u-MNXJ3nJF%<6* zSz)YlCHr)&wJl`0{m{Q&_vfdE`_3lpnoqv=>)cA2zMaXN__erBZu;L3killxIxxG{fq9OBA*+Zpp>SwaIJ9K-cUO!9h7uHwdZl9y-Cp=mJmob;E;keg za$5!=CqVjTpP2sIdu`azSj%gyWKJ1L6DDAeJCwx71=Jb_Qho@3%`t~Y;Q1_TG5O!E zMeDy;3od#yQvZ9knDFn`Vz+;<7P*>Q1kPkJY%)?qJ;t4Mij~Qn%*JQsa@la437J+G zhg!sk7PalhXk)Rm8~Fy2Hk{GP-`x2JYmg{UTDPl7P{mYjj!Dle>^5{C0w%-R0gv43 z!mdO2A&?qIwG7>-{!{G_)m*y(aDuUJeUIB2c#UHw0j_b(#KyrBtPu5*r0WGqQrO7~ zX%y3Jg*1qv=xV5G5zn??{HJ%*B12>U>D}9g;&HuOon^=7u#c&iGkj{u9O0d%QR#a! zX~`z0=vtdtb7aHV)1@^4VPw~lPS$TZ|7z+pEX(%;9qfpif>5vSV9Y5kHT>=_3_Uop z(EPCZ7;7WF7xoM?G}6hawu8N$b8`W^5!+!y;;gg6A5T&(oLn4kK5N@X@~kXn(^_cOF>LkVspa_ z5*^D?>3>>={@5ICW4oA)n1K7~X-eN=6P#3E+qKiqS_s-3U&l}GU^50sL3iBAnx!{d z>A9Vy6QmnDs(hW)(lPWvb4T${&H255(@}h)sUw%)(jls+X`4u#eUeDuc2WHIEcy~2y9{&uB1CS3I#3$*QV znBIu?^Y?W3GL`SORF-O~OzG_ZUCCM|Vb?BkyBW}-q&hJ)D!wb^|tGoj0B= z*@t+hWUp1$Wv4{-qxi|`&AHEEv=C83G0YWU3-4%FZv)%)jCu638>8EjYd~+6i%Vj=UQWF*KAgY6irENgeB}v? zF9KA85+-+oY7x7dWq#s?7|bpomjunPd5qAk#u(CzQr7?xA+>!U$EvE^zT?6Xw?};! zt1!C>nNv`C$M!8#G`sCFe}55Qq9yNmY}>Y(JTK$fmFJO1w{08cxsGQAPsDQ$&s%xq z-=gzAI^L!eKjh!*29+USM89Enx$kmNon4x811o)9rCn#UX&qbAAc0u82lSIMeU&T( zS5xA8EXl1jx!&T7K`mp>ycCIw`B1>)PsCKo&Z;;g>eHSH%!m3xe9EyRYYuw<`DPCK z2UZj)s^U5RQ82c>M~lk0@G9zYnl*2gE3FU%84Sl~Uo5+t!T0E+G#K z>c?!DxQm!b@SwjG{ET16YbhXOrf<)H<<*UWA~gV3Ie?Y^6~LXEg40_Zzq_WbI87>T ztD7GLN_pKkNaikgH~E2a*NMhZ@B~jMRn%Q`HZ!&rWxi}XndhXL^%fscoB0sW{Ppc*c3G>E^%ieF#p<4*{SU}T$(L>?b35UV zw%+0&)n*=0=2F-JakW_EjFORQaajah?3TpEeX3XI;<7O8T)b3e%`TaBF}G&4f9cVD zN59FfzOi%h)q3y9t-hzTzwao$MjX?y&fapX@9pd_&$Pf_cP{?6z2#Q_F4}8fGW+&6fQ}P4pc^DSlvS$vjEIj)Zr0 zoa{%9#23E{hfMve-A})0^Kw|gJJ^sjp9GtbMzB@Bo(MKM)r}E|@EX+*=f*3ENwZ}Z zE@`H>cmpN5>Hc)lY673*F2(u{wa(J&qxd*Mt1aY5jPn;-9dxeIO69mziVp)+b$5n0 zRHc1aF_J6!!JTcmZ;(tBt_Z_AxqiO)ENp5vbQa3NDaqC#hs`<0t#PZ!>(;od(zh#k zb8DR5u*SU<$p-M{e7QBw->TNQ@SR%Y!gpeg6KF2<;BN}WtZ^Y(YK;rusWmQqC)POO z8U?8skTHcOBulMv;XAd)g>SdUO)$9>*dt5mkC4n9BLG1MmVcVUpAqzQfB>f zSBd`Gdu^B*;H(0+2$3Wl2$}VpU^70*@WEte!zSl5F@&ET z+L+m%J=&Pqo;}*REZTu(gMCfBRI;U9v#+UxRPHhl3AGQGdM9;NjJxzMq>N8|@J+gG!EI|skh=ckwzWnv zZd+>B${nhg6_xgMLELGUi=9j8IZ{7+|f!Vbm% zKXlgA?{iGuDs_%49p56u!AN9VZGA{gx0h#4W!I9eYD%#A`db-UEk{^~bI7Ta92Oe` z%9(*?z+%n!xhM>ts(#@uS~^GpiKBqtHEugTMNbSk(=jW_?WXTYg@$3g z6r8(fVTVA5>{>WrD7W;6-0DY)Phnv(qjYeseoqR%WNHH2blNE5@FY0YNo5sEC$#;m zh`$jTXV_Q&px#-%a=q`S5a4e>1spT@3D)i0nIj8;mpZFGw|Z6q9~FIemD=0$>&1y$$t8=-s81s}@g~zdYNhl=rqi9rqfaiG$Cj>HJg?^2ljkYiBR28e#IuU$ zOFWg`}`fgyOZ+?>EeIi|_Z>AfmH(%6Y8BSkybC8UQS zAD)+@>Ry-e^~EfSD#ukTNR?E|IO3c~0S$>GgB8=xJIPd?EoVV&*f8-B_++WmL^J3m zs)o&=^%n07XrH0TC8BbQ046=sJrli;;i<1u;zJGyZsp!#@o6Y%z^H%qu{x6I!fk17XS=GPJ5q$R!z8fQw1FI=Gr+>FM(nuj zWSl{Jh)lY#-enL2bGmOI7}<2NZa!GtJUpC?LMpgnu+ z_ZqNH*fkK}1lSD2$!Ny*zX#)0zpQc_JFkn~n=oJ<0*tHy>vH&$Iv@I8)ww&4@>j*3 zz+`{(aP2sJqdSA63|RdVO@i&DlN0ji&+-G*^5d1QQt-; z8-qx}=DQOhyFUj@pnn1krytEb4UA^gj z6g^6nFq{qvuRk`S_K36Ntz3O$2QN%eC(yA7FQyuq4t-H|P)pD*cX1_5?Z)6( zTMMgOyiO()41Y`fz1zq8=62nhc7aq>S#PQ7 ztbfRKR@rVyT<#hH*FjEWfXsFxgTB>^(%rcSdBI69lC~rIvzd5m{LsiV#{Un68oIqx zV9MP$rvsLq74SmN3b?s?R=`RdqPkYbD?M{!XWgq|<`=d1JlI?dV7UWW9>2d9z;DGe zwWXJi*{i*OLv3~>38vnzW%0Dy?3Xmk-Zn1#63@OQuDsFeo}h2TYi;SAld$i2^!pt^ zf4s650GrIL4Qv??ad-{Jg_;e_%a1jQbRK9|B~shjU||yJfs;~k6Xkm)aTo@H={t(+ z?V+nwT2}tBs?!y2D~EkSlL)&_>IbX~lA06D&Vwq0?i?%fU! z6Zb{t{y47z?&8WTl5D%PbXS*65@9yyb&~wEmVAlJi1w)(V?c0_a`&d6iQToWY}{!B ze+zxV_MGX&ffpLS;XoG7ga=T6JV}A2?*2maZ~^T)dOW%<{sz~D`jSZI43;Yy;1M=g zHsONi!e$kCWrWSd>grKd*jyDlY>y9nJ@KbJQ{tBO%ykXKk5dTeJ zYB5-T%QM5^>jGIlmF5wUPB9QSgpxl|Tk_2=Fn*koHl<^xdWZdSDsPr9)Hq>UvEJfC zysV_#ve=vG55^BIVw1{UT2|HAQe4Q;(<_CDVQdRaA4wBg@6a@yVQd>9Z9nOq5IZ1V zRh+II&R<1%i!lMNs1n5CJ}J#$SSr~TU;2g`0z907leqGC1(vY0*u%n~vcAu=CXBH< zlQkU0;3^a~m)gOo(^1MwF>UX^e16p9BsOuk(P7FGGy{(fpJ`AUfZAlX=nfGYdib9ubCY!ST#HPYkV*mQ~i}l zk(G$K1IV0J?57|S!1G;mg{LW&EE`kX$_LOj;ii?ZPQ9%aC;qZrOFu_d8=zpV%5FYupUu}`tPmt`QGV22%A{l}Mq{H?kS z6u#4Cpzs}*fx0e;x-Llb+X7HXkS+j)?{onue1`>~uKuX2zY3rweVvmo{e%qZ(ogsf zOFvypqOK*Se1ECy0@h8sE-2-fWL~w(lD{CzdvL!}^q2VRN?)~zlkZ3FTksO4aB%6X z!C1lsUXOHqr1Og%bLVds2bL$DhZIBBDJHw*;f>@=9@a!@!bTXGFzUi=@uD`YWrBTM-`W8S{D;x#gPBef7!5}9p(5Ge zliKZ3_awPYiq$x`c3sSv?z_F++w_ejv$Ss7)^L=y)#op+HPkO4ew>wl?(&MHULrfa z=wkPBB$HPwYO6#vUebB0aI#k zDa}8q$ZZqzaSCLxEG-y}?-xaw9WWd&t1ENOIkjcpjkg>_V|%vDIV#g^3A$=EId3TJ zS67)#H%ifRE2O!?cD*J?h2UtB*%=Ho`&6o6u0sJ~;-leCULmKrUkK;azn$sSF+8v0 zc_GiPJpVvNxsT@;JlF7io97~)2L2;k0O&{TZ_&w5oJ9B_Trx_ixW#{~r=k5e9cJy6 z!2AFgy!aTq(FfOC^dl`SzV>xYY8X$}7rWOp)IKCtvy>mOaaKR+AZs7V2x}k7@On$s zb&KcG*lJP9z-k}KsA?a{kh&3-EM#g4nUcZO(j_CQeI&!^NYpigK2hqrMMK~%rTj?d z)rLT>hVkHyO0kh^W>5i>R~tq*qCi^kh=Ltl`f4ynIJj*Gr7(;>O(_hcPg4rR=+l(K zF#0s5FpNG;DM&Y!BJ%nenja|9&=m&I^_9u8REq=F9**AI#rc%Yw~HQK>#Lh{G&x{X z41aUy-z-)uPnwR$Y?wA=hElas7)RAc-k@O+%>?)enhEgXGs6o$c4h*6;LHRtYG%HC z$joq{kC&MMA1tc@jFkE?p|^upW~6)?`lFIP4gG=fG_Cyq952!3kc?XxZcaox#_&XS zsJzQ)O4}370ga^|MKdVrtoPcnauyMmIEaLD)8BmcBfsoLPC{LAfa&Tz z&_>qd{Ajd94Z&MDu(NNmf07PviaKcAz&67@8te4W_izu#M+g~PUODf?LUg_}Nl0BB z&?ney(eQex#BGd+Fo7Sp0bFJRvX`z``grW%%=YiV&WnZ|@?26@xzY9`*D!p#_q#51 zvKS!k9CgsN>AN0q8x!DyFh21NRj>w}ZTPP3NOjx2i&SC!cJG>MYP0vF)5YyIu!lR6 zt={dFUimO+SJ|?bA9XmC?eeb0-S&9brc8EtiwQ1L3sUH4p^gfnhZ{|6Dwo;eT@wz` zfcM$ZeOww!=m1;KnNHrUMBs;b9qZ9g7 zpUD1}@>i6)R!Kjh__?E{&njwsh-oXUShCF~xX{*idi5+2V-sa9V&Z_Hd@W~6 zW6Iac$_L!Q3qvC%k9f7ZX!mI8^Tq+v!|aXZRaNY8x@uHDl)t(2H3*=J-EMY0yX-Zq ziosT4lXNXp1)lUx(hZ}eo{_4C6+HIv$0fK~M+OqojTR>PAXGDw;ssQidsX!?KAeJVKjkw_9&xD4 zIOKs>vv+u0g6^xLhTDeUC1(d=>Wa7T8$Oo6gqleVq^sLF{Hs$?K%#sPI%Q9dF7=WF zq-3OPoTNa!1x39yZo}~6X-b`J7-snQ8G`Q^&V1Hx8BPKEp5e^r_BRbz6GhrJoPH+T zhV#p;ef?r$*>`L;*XAp>V;FynEUk=bmZiKUropNVHI|^eKgZK9fmPAi^8L_wiER*0 zNuAvx+;s`@J*BQos?dCyBiNR+e48|g?F=p?jONXk-5M-AH72l3J#BArn}!7K4c3eA z4OU9q8w~cKvTZD?cdJh&jC{OISD!F)r;FK`IYnGYIl{nYIDv zmsPZLEW>q1x?%PZ)r1C)E7<4~__I_aN9|DOcKAJ60;+krpVb)NsJS>*q!=l{9#AC}~oA=p=T<0l@X z?PSKX>s4yJJN7Z=wR9u&jrL#N%#Qj2X2{+tgg+5ss z@W41e5Wy)3-^r$W`z#OqLN@StOqWX8oeeyDrU#yx4cs56bftW2Ht>Wuc%VD12j=|H zb3E_>PZ`Gt9p?d4lYr8jJOE`~UPlkFK@HxwVA z;HL{S(I38!b`Y`8fJ0p<&T3_KWS<#Ykr5~3V!lvT&Jp}b&(%Q@E+$C~?x`n!f~ z5GvkKDB#;TfrB`ABW(qnyu>>s9|8&R?K>tcM4&u1rUEOwW~HSDS@Vds<;0>;GrnIGy8I z5F|Zd*Hc_L8L!9xQc3>Bnfre>h9%xkQtk^&KKjHw)_a?A@6z*ZBoUB>C>{$&;+yYR z`wp1vS@86wvNKrH!t5U9H&QDm!p9Fv#JAV&XF|?m5tZ|-;Zj1j3W*W?0yQwx$ z@vUj|SLAzPZFUZUyr4F8kEn~PjD#TaDzZeMv@*JT+`GqoW8%{-%q^&?i(1!;Qr8O3 z>nO~7JU&g38=&#z2~{-ymp)_udB1o$wMgzc2b*~dRtOOs?OLtU?w_~&OH@~M9HRZ6 z%5FAZX>BpS9H;zUJV(<)~;P+-wdmpILEp8C; zFO(l4{Y0KLaP%O3V>tdhTQRI}q}lh$WPcgiy{Ph}D^EAHM@z?ZEp6B6fybX2&0Sxb zyPj!4^%mLUfQf)y@2EF|`iVlES9@=$3)RhL_ZvC7M-nUJ9rnFW7RRdBV75taKi-;T z8JwX7)fDj$5T5kz4{~>bHOcE3sjE%0EHp`i7A*rm!;aoEpJ2L2-7HnLWjfU|lU1mq zXc?9u>1bi1HbxDXQLW;D%edZ;@=?mKCoxfW!RnEV6qWnjJNavZt(6x9+qIoeQMrC` zOltmT{OLjt=7;cKo_pQw(kUaQQ`UDx_kdkz^tNy=!R+W``%Xm;zHmA^bf1|( zhdN3Yn;<^p%3F+1!Mndorw*0`5;`4&F*s!hmeXlZam78K30(0KVJfLOnM}NFWD9s&-Z#g>=HUfDuU5rhPpee^h7fg$HZ4JPo@(v; z8FuxsjqzIu3sUZQTx^V^vkkFc9(^|TdNvJl(W_8#S1-7M&4nE809v^V?KJuF+?9}o zofZqOi!WvF!x<0aY4?f~%M{A_mAD+-v?2d95jha=|OmhyDct`XyhPTB-k*qB>= z%1}PHW=kPjIt@6So|}(0=A+wZb8toV?A+nbeWwDN`(IuZn(zRp!bm&|w}N`g%pfe` zg~Q;YaL?S&nk6*)2BW@xRUf-6(5P0jfMU$iN}A1~l>xmbW+#pdw-}9dl~*v1%r4_1 zVb#-2bUvbRE<<(K4PyDB_zlMg`Q?g-v2o>Z4vrAnoXGQmSMZ3`pe~n`ykvAQDV`uamuKb{8@$S3Rmh3-r zgjWF!9$W?7eRxZ8C|%tEhv#`(2Jvid1;J=Y=8^cDv&T2ng@gqLUScCN>Heodx-$q% zT5gZ}mQ#SWT&u+#n3P)T^B7ugvc>GD7)EUAN`{+T!2&CPiw|0G_ax#f2#xjr3jGM261j4jf_&!xQ&ap)fL|J8V$8RFQThOCja% z7r!8IcUGlaK=KCd3cszSDQ~2htylp%qno0kj!0W)^{KO`|hG_Is|A|5cM2wf+*IAfQWzXE1+n3!5@(Y zF&hdPuy1496%T%*rt(ixZd2v2@*ONMV1~~HYGH8ya-)PBNC@R0)YULI6^ajWqZ01x z(cFRD`R5yqNvrh3MUGi(Junj$_+;dSmEtP!qwNb(7@q=(4f#6{&P0%-2h12M=?dx? zR7;nEYJ1Ia{QX~sy9n87bf-KxG%~f61&LVO=h?qVyG!qD^ia6?i;DvdrU)<$L zb(LlnX#9u%yE#x)gahSB`YjA_L459AO@8aRXqOl9WF+cd0-d6{{WL2+xzMP;jz*o) z+}`+s9|k(@X*6b|$-$^v$v%|tGN76Wt|i#q(HauH1%W|%qfAobzp=;Ngx7F>42Y;c zV;KV5RA;|>O4?LsEKGHn;=n)q8aBH7&*xP>9m=HPGPDnnhTfvxnYE3GPvJcF2A*{X zQzsU%kDr#oKpuy)=jF$`&KjIPyLqV8(bCaB#6eFt#s@5Kz%eVqwer4NWFGDL3IQOQ zf5r&JSA3%Z@HYuKFfxB2m#Ot*m7gJu!YGiBhuaS#E%N0_Oa5Fwj2F{R7-oG5y*9M( zv6jx&x`glWgePPZo~?x9g>2Esd%^><3C|>9c4xyW_#@sA1rH*e3H-Lt z@O+0yvRMDZc>`NS$nvE9*n*de<-oWb^1r8N=0_-8zao@=2gC2m@GHel;SwKBB|AN{ zMNPwgOeCH6`3vYpO_f^@P+1G;4poVqUr-~uFHj>_zO96IxofcRU4XRUo;A;ZZ#MtW zKinYy=}IUCt2|>CZj$lB-NS7ABETT(?=6mxDF$B|bTC z@3az;9l2Jy0iDu;wH3Fv%X@&XuWzBbQB{n18nufXrpcK1 z29B1@);AtQ?G^cOB11eQQRJUYZae8D|x zWzjtTB#Lif>~LD@=9dR(e`%*}g6yCQD-6LGJG5$Vdv4O(!dxK>e6K8Uo$yfkyaV47 ze^@xzFD$s^IEysKA=N*b{*BRPI&A!zT0F4fO%FD_1T{=~(=p|ZhzZS)PzRL6v!;ky zllxv2BvalIgj)3ic_t;~IqADb9<@hg*P&H@fgm@;db+=(?gS-Gw}^%Z=xt5WhWOZ{ z1r#rKpA-k_X-&F>%rxm>wn=wk92wX4?^i-?$_|FyERZ*O9L$s0rEK@J1aggC>gP_P zG*ot}<0h;6><{-7%i`DBx1TGTnhK47O3p=YFnoVwjI6q?rLHqNf=C1%+9Y;JAL>lZTO~p3B3n^TzNLa5{OUM5*!#VnD zvHODR&}fbO6EZl<`YMHWIpme*r1T$z45XXlAD3ra92RP-EJ$e^m`OFXF4GTXoLjby!V4C*L)e&*n#v zaPE@$ijy?gy#TATtU#;avs|yLYOUrcq7~!k_@PI+-rW?V(Oo1*oD6&Yc*g4$Kuyugg8SmXc`q2P-;XD5NS_|kireKMYGew{j@<|XG%jgQ7S zxgCjp4MeQKQ#C|-X%?I1!sZJ~Mk@cq$7i^@|~PuDwLzL{#L=Xq_3%eYLYE+QBA(X{+qIB5ZT{SpMY^< zF@NzRwcnD_s8N_4RgGBg@SG$R2xT@<7GJXW+Aur8R7tp+T4jcW!bJ)7n_x3O%t|)2 z9l3uIZB8(?7Vt7d{hle>oM8Iw(dJOZXOA`~m_B>7Il=VVqsH@or4jh#)mdH%bGCg50^<2M7IK7@c?I^k` zXo3T^zbV7}&ZLGhwneF7jGtv{q^avkewJyY7(dIjQ4D99HVQU3S?f*pz246w{`K1QoxWu>%{tPUVW@nruH;a)a>*s zD-!E>c4PEglF^olt=vb*Q{7&pQ%o(-GuZF7^h}lf91YghaogCM!xI(9*nPhZxv^u&f%BR=*nsITT$yJlXgC1`^jO za9Qir-b7|?f`7t1Pt%WJZLsyYzK>CNC$j74DC1hZPG;k#ne*}c;zl!b{NB>`bgz*2 zpA^e|oBJ0nHVnGr#rC!@rm+#O0Lt}!6WRoH$DM$4gst=rmMcMTh| zJz}`WQd^n9O>4giQXl54*+avWdSs9cx&1ZCtuOrxNlQyc?IRyY;mr~b_b6EZLb@|b z^X2}@-t76W7&f;PMV9PMt6l#gESfQDTw(a#SiZvI!^FLZ;IaoZA6Ph*&tv_Q z*o7^89+JeGLll`x^IPI3jP*8i-6KhC6P87*_^jZ+*Hn?&gQ5eJzDDU}bWHdduuVd# zViF}a`49I9qW-zvr1x^Y`Zj+iNQ-*>bI`b^6xpYaC~&WcS9mN9Wy@e8w$kmZwe(D&PUtzl&FJ39`iw)R0e-aS z0*YX*<*P|aPXF0_TK~7!EbrOI>YqcO)q*wETqRb_#$MQwTXW1by>zkr5A(@vInE#@ z{xn%#>ugDh*VVz=ZHKVj1apODKU3MC2D3lC>|ey}cmu5imB(TB%N@dU%${r6PgQp6 zmGTawgUyy(6T76#I_+|e)fP)!*wK{3?d{5_hz&h5lOQw~+`H((9^Mu`rN6m88_g_% zHBVpx$uBzTLV6%W-F$usfGO80gkJJSmyP-=F5C-yht{#|=(ofqKrgl2wrya}^mr-u z1GD$67a+46cmiCd3m6RlfonhTttcO?QV1lsQ^NcXVuOke=xqm@EL8^UOztuIUW0CI zY;~ZUc~|u>i&(BSM_T%fpc?K`xc(&tQ^;SnPVc=ULy}+`a{Q6%hJt^oTRSE%%|hBv zn(rrVYh~1IX{IA0P91mFQb0<$vsv$g$LPb>*xTFEOgc2D9dBtq!z!l1=^1Tl{_;O$ z*BEH0PL!Rla(ni$rFjZz(i^RV>b8UJw>8S$|J5zcCqmV@?*O%2O(9RerFqrgt(tW= zSO+SF-63pgei_N?U{|*^&rzFdl`CkQv_|blf( zW0_seeFwqVZfBYv-cl~ynZ}MVeoP~xxK4kuHJvrVI!_y4eoUIbRc%e-JK5^&o@VK8 z=dwzP>@Qu=)0(X*WJ_&L;XAc8h3~}HB($Tl{#L=Xq_0(5Q^=Oun!tAjo2->VKbseivZ+HCrNr8?ND{=Mp8tNQn=qdnU-)d|cR>{jB-lJ_*(t<>2n z{ZA$X6GOr$A6CEXj>qlawzO6IRRPh2v6H{K^YH;-tz^=5yDF>Q`<8JEOFExlb)B#2 z2x&($82FpQ_{F6?@dkdJq~Yu(Of zNG6zQX0>*)Lus7UF2;6P-CAqgVRxKTsx`t1eIe|MU{L#1%T1ZF2}6uF=eyZU1STX#bFu@bAZFce_FZ2} zM~M2G)E|oL^ut6;E2-D>x-CBLA!(VZ7VYUoWIvszG;Uk_Pbf08t(}Cnkvwc`uYT5T zYfk`%ZSB?19c*h)6Zy9GjzsDw z%kv4K?7sITEW7XB^0l{E5AepZeecr&M=7PN_2T>9mD2CTwhC0YzB>jQV=Y39+>Vd; z4H<<(9ZBMe!v^?33J(;AJ3%4~uR4`_6PVRZG_HIAOk7P*h%bkY{h&-HH1MnmfNI6l z{qTV$wdkGM5?@WIE%E7B{g(JNB3zAq5D2AP;_X8W6z(r|Q6tn)xlI{^h($#Mz4->WQo3L9iIq?q*~4g5Sr*UJ7N8?IH!**6!Y2J$@v9 z?1hlacA+I<%i;$-OeZpgbW7sfJWPhu5VkS?sfP_#!v^E;co?TTuPU30j*^g&3&m#|TpEb{QJn!Lt>pahaJiGHe@hJQF zc{cD|!E+(ce4Z0{vitSjVQYgq%bGdndRaJ1Z)__LcIeifUN&N2qQp$v9S5Hs3{G1~ z(^UDs(JA%F2$ocn^QmosMyn<$&6l4CLycL+3-ji*#iN@bJ3jTpd0uF&?oI8vvdqcx zK@Va}n#J2!9(%la!}Rw4yG^<6+Jrf9OP7P_m{4e&J#Xlk{zG@sPIesyv8gg(q5zcV zb#2-(v4y7QJvj@ZxSkF8oP!$n-y>j{*GF9Czj#KHt`Ye8O;!YsscOMB-*7@`W20g3`9L1KS1o*xxfyc^* zTg@OEJZ$1UJ)xp~_ja3V)7j+pS+seH@`Wk|lG0p*O7G|Ii^tWF*^2&YqM0d%uM5># zoU5tMMUQ2xvm)1**p1Wbu!T9mGxB^5cwPf@XBG1d7R2c9X9I;<|3YeY#L9=#)KI8Y zI8%f=vT$;)c)x~TIejKh+e9Rge$TE1gVY8Hs#Md>+MjRKH0U{?6F))=mIY6X{Bt%b zOfG0|BDXc9($bLM$7?h+q-@GxepEGQ_ilc9{HN!cET}2ySA+%k`^x1B^qp1&6K6f} zo?76qOMzb!U)TWn|73vAa#CpzpkT_sO;=1@SdZQF zYO%ZIA4%1h#aq}hQ%~dH5tdZ_`?R`amUv-4U?_oWjTh!G>O$p(x&D4fo({SsUgIB2 zGW&u#K5kXms(p>ns5+CT)jqxfdNVWVO$I%4%lt0}m{i|l$gKAEhznos7N z#)KF<8%dS!6=rYF1ABml!r3UCl>yH+Z(7^anZFI*c^7W<3^2F3g`M+ya=l;nhC==! zZ+w%aS~NW;WEsj~#D0F|VkOpf$shc8m0jeYY4}xk3+4-VW|uc(vHPm3aH8Fs z>}YID4T>>G+}uM!(4RY+w#55?W;{7aHW(j8alC9PoxfZ_sf@iaMx=wRBqf7v?xnrF z1o>Iq+@1(eDqJrnWe?7__+igUg@rcreejX2n7r%h#pEhl&udnv;`17rP`1pmQ!D#ccQfL?mtDiwO8 z`eJFxa^A(s_9CWZ<@CY$+H*}!^g*}%l%ECtp%s4F3NfMF(!oQw$)#W;$4V56n#`xWnTUvD*x49{tyixAK$3_&n4v#ceIl>i%ay^r`T-+CJ|H@8spA~uRH(A`%s21 zwU_zLaJ;^XNn!0Vj@JRg>zdzG`vtpUsw3XC4rW*RQD@!fki%N_$;vl*&C>93AVR}r z7Y=7Htm(Q3Vs8A)Q`mGzGXCR$Uu9~$<+WDUNu3IG!RmRTV7p|LVsO@=!0kw^Z zV?t^+3v&tJa{u>zUPtnjWb2TySONi zmUG6nn@GjD;;vGGqiOP64lJChqvhu1f5*;jZs8k_zy2IkQ^t@u(w(x?i$&y3S{MLl z3V=;7<{Him{;Ytc=Nx-@27%{$sbebO&$}@V=luAtCo9tlMvEpN2f)l@=k&yj=OZPicN!{r{H@2>pE}t`ho}l?H^~ z6yI}XV+k>iH|T4b{k6r-r>6Q5XVB3IvuU>B{4HRGW*trgv)NXrC)P^+eZ4jZ^0W3z zQ(dO~fa5^opWT(TleOV?^KXLRpvIrXc0cj_&y_SRruoZK>)C2qA$FYdvrbv$S1FGa zv{*Q15N4BeD8YmHRG`*jVXQLKtT!Pvlo4Ha~ckQ-+W zfL1OS8yMt1S(^sLGjP#k*fNPv_Kw+LTWSzoDssP{s7FJjwgC@IFFOEl_Vyk8+|qCao29!jQK$q#poH=2y6?1wrS;957D(_bqr3I!79Vaa&5z-tEvjyU@DkzB|sJtn%mfgjnskZ~&bOZn_lO zuKlqPE>C#{LGg?`s@%vtV7uI?Mj`(x%73Nj{~Pb|KW3yoLSsiQg#y-f_bd@Q|r+V&} zC#vTvmzS?s#6*t=j|pJqYD7sewD>4;YF7V0HIc{B+)Y>{MkS9EgC7WB_Uc>6w3S!5 zxc9w!6^4G4;0gXo@$FM7i(Z~ea835hj;iEIE1%Mr$xK@y#6M0#;O3P^((leP61B4WQCRnyxd`EX-r0!hI8H`9gGS{8q2r zN}6mXMN0%5A*lD6JEg2pxz+pON<%4HWGKgrq`mysz%MVe*kq&?-;gjrGP~3i@5Zr+Ql}Z`1s5Tp;hJCZBLb!JHOQXq zKNsI2BsQ=fs5mdXMlTH9E%E?LqbaD+C+9(A59??%@IIPOO-mh)$AFqJ+_4Jxkv?bv zAY^1}Nk%{g3_`co>Zn&!v4iOb*@3NU&o6GKW{G{Fx7|_L>e6Bh$Zf3^D#TEMV^n9w z!7+#V`xa=h)g(#1{h&RO9~=;cyy;>cM)Z|3H)y{m#C-VUoV3AN^Pr{9&Iq=ROPEAy z{NrbBtOhSnxtHD$|Kp}a(C%29JK6KUSox)|k-t;g;MHk);#g+31sS#sB#1buKF%qMZ*ooA4KZwMkrsU zE3U@~bVlucyXYTt>gfp~Hv&4027RycPB9il?x3?ya<)5&QtFW`6!pc1q}DLKb8U<4 zh02oWa2g;mq_VUagV~|~EtOW!n1s`))?vwIs@ikY=qArK3;8PUheL*`359Sqy$S%Afle^`na9# zo*Y|!0 zFD-T|qV~k<=QKWTIB=Pj(QoO*k{2DV388^cn`tiSQj_n6ZSlG%WoFd&t>O5`yeBnk zOUjT?GLd6!Hd5h4l_Zf5^K%;7*XC#Wi}_b4D#C15BC2z+0ZI_JZP|g=`q*P6DbM&0 zKWm#cVwR^oc0axDXoR|rW#nfbyw=tj@_U_GGYzH8TKd=1;>_*342zT*G=HZ%k`8BxkkT;X|M|UnQ~{V z#+%A}T^bC;CqH3g0h~E|`RKJzAsVW)lliHAc>dyi8=F<8c9u>70HQp?3p~QfC&D~Q z+jXMHcSfg-%#P-6WQSUQ80>(lPRZEoi!Md5S)3nM^csRkJ3^zLS)~MvRTVBW-4-O63O(ILon7fLB6e26bMpuTgB~A za1;vO1qDY4-q^YLlrXI6g^05q^SRY`>QLL(7^}Vd0>~n_`i`&y6L<_djFy~- z3Lv_s0h$Y-`WrFVfu)s^=75mlkMo_4KUFPfe-YB)+$Cq>eN$sW65mu|FZ zA~iP$mC|N8Uu_UAp;~I63b&1UFH8>ShEg^-Y{~U4b}DQgKRA#lGdL(qi&~2dVkDlD z!%UKJ@QPfT&jsztw}-I;Alb2k)J+Z~87q)=!|`u$3rL1b2Pk82!8(Zga<#^)l8acW z-86E8*cMphbK8xTJU(-Kv8wQ!wiD@7vYPV3zywc^#>P%cW0IsV26=0I`$JpWfVH`@ zpL1{uhT8v*)q7*EErsFpMMM3Qm>E8Q)ISiy?rYMc@33AZej!I#sWT~^oc_MW`-e>s z6Azm`69#dP&H>2CXVmPiNg8ATI5xpMbW>58)HbXpthB%Zj4^D(MsL=a%g`{wjTw)* z{+f<(NgzVY<^{lIg!`>I2v7*bxQ+M93li8)bI&D~=y8^iu$r0*0Eq)JSy<<`Pqp%k z9EuAIuc1VT^w$NHMacy`= z66JTKutwfe84;T0nd^UVG)893ZzI`qk|Fx|)D?sa#++Fg9D4&lsDgGROE;{!wo4&8V|GQZTOnt5xn;e%Aic6@)LzCUehqiGpC`*mf0+^F05~${&0F za~>rB*E9Kdq@Wz_`8WK9{1wmtXXSr)n!l{8#Zge!|EYn3a=npC9musaI>`tWJk^6~ z9vfx>z%ctK65Hr=FtI@**bNFcu}C$IaO!cCzc&6b2{ovM`6A$g4!9Kh``F`Zry#-# zl%p;^=&#K1PBl*h!s&W%^Y=j#Y^65>=hRYOZQW20F;o6}CDsrY zln^AhP1{>UMH~JXw!pT}hqCb&sA*MSWO>wwHNt1W>`{N544wD-C*kj$v)ee%QFlBTO^k#AJ#C_xaC0amfsE9>)zOvg zE|$@+z4P1x;Vou7y0P+StT5O`5fj)U$IpMKXXOQ~Lnp1h{dXAv2U__9@5VS3z_-ch z`#dX)KG~!2WC(n}V=!7ZI2qfdW0C1Q`zDEuanW@&qlJaRo&PX%)Le1!!5(G_Mne>7 zN5Mm^83vVfJrwH+0)kXUIb13&&>K)JluH6Rc!~}5LbNEDrpZYYn#4;Eg6 zeG##8(Y}aSl|n>XQsip_B7}=jfmb6hFYJRAEBe;L$49^4Z>^cV_qn9B;P-!?|MQS1 zXYbjw*Q{A<&6=4tYi7@20gI-hvL?2|QDC%oFtM@}sxm{-LSyB7@rjZc+b^f)o=898 zTp4<$)=FwFdtt!3uK4lzL_F)LP*h@ifA>}?Snlj8leBo+z`` zwAyWu=1u#^la&;S@-_mP8i+(CC_(KSc6%Q%HNZ5IOoIL_x*>A~s(fJCMig(@%T{i8 zPZR6?!NlqZ4+3}UO^wp286I76&ue%mMBUm^>SAyc}Gd<)N>z3kFu2;Mkll2 zFSsrc{Sg3)Ge|3oEL-a`8U~8+HQtX`;@Bi7`tuAyaemUzHB(B%W1U2bmh|>>boV23 zI>V2G>r#}#x>V)QF-p3(yr<$vpm?y1d*9vvGzLhIa-ig1x{)gdAo`C2C3F$8*Fr>h zAmJkzfuC^h33Do1DL7v|pOy@8Itga%)ww!+E};G1qFnK`42yQ9=1p_9x<7-VhQ0)h zp&SkZF6;cb0b#8aDoIQO=_y#2FfNcr&3Qak@%XHYXT#TdQhpqhf!M85omXffE?6PL zeas3MMpST|Ka4XU9)q|ZXV0NW15{#Zm^~MuvR@7bnDkRFn2+eIi{;2ch7I1~?d)Se$;pS|G?X~JLNsp$m#Ekc^+R;fMHSvcLgtRFhSyLZNJj4?O zP$TD{_HTi*vMlgcbPwD9@U1%$*+I`yy*bcNo(ZVnl217yBO?W6}L4 zQke`m^}Pp^H+!%YAo@~b^-EX>UYdjEdY~!mgYkfKqhA8Pa=|y~-eU2c5XARL=BL01 znr{-CLFDI1BtM;ZuIUGo!n7uoR(Fsx=yyvk?kDdJ(E4Czf#SZ^;(i#f4er4aabKsn z*9h)D_Z9SiBE7aC?t69ODm~+Fi@VOpJv1Wj?<($Tf_tOeZE+tS#C><>yJEr4=(D&F z^l@{nSy(1_Deh+nD3cBDi5B;-ei4w#9htKg_hT0KJ$P+oGCU&gO^SP^;9l@xZM$P|4MNmA-LDM?H2dwAnqG8*DCJkEbd*>zKWh;AT)wZ zeyzCsw^1f*-SHOpkC52Y={1=Xh+FJCS`Ko!lho9}zC5hBiN1d1g!+uei14h+jFI|z z)mGLuu1-Z8gf};^gNdbnK2dOcF{vA-F~WIr4;n+WvXK^PuqJ*PRKrk4<@u-(-VJkw zEoT?tGU#PA?_lMYy55gB{4=Ce!}(_(sg(RPkJKanna5#y@E%!O{4;MUVE&nQokNYQ z9_d5`EW#ZBSOi}j#UxWhei%=eY5z6DRr1aAIB9ymQgy=jX!TJ11X*X1E^-h`tf0fQ7@z4fh3MbXS zvU+Dv^siiIywm;V$H~Dvne*{lN+u;+fr5>uX9*}XjnZJMZ(KUAZTz~fmxa8O94GBl_mu&8hb1fEFWoE6A$Fn5AbWAI3kK!}Poc6&pE;j-<%5J`70d+qfS_eZ??8vTM>+Zf`ONeP5941E>bH_uN z%Ia{Pj(7MK(MyQ5#yJa58(EngxX|V^KbX%chz<5#EyFqa$oUax2QnGXu=~up74 zu5tNIr;XR0JLkN%v@Xo z)f07F3&6G$Opyr`y@)O)K$0xcKa<1vXVKfE8^T;eR@-aOvspWaxfEXjuatTL;kny9 zjI(gCAKM^q%mu;qHkgo?5ZhsVkxB|^qR-GDM&v+p2Y`izOFrVm1j{z*!x4Yx6vCxv z6g`5n#aUE})DBzVj~r^jdndV_WFQczn$lt6m(P9jhB61jWIe;|s3mabZWnV0V6cOf-)Qo0);bW$WXGZgAh ze;2p#b@PCHV^K<8Co)+5^i+7un!|`T@z#Oe$(sozZnadB>2Q!>d}s z@!{@XLiGr2cams(BFfCV;$wLm3Dd%shuOFtb@n;mRZ)kSC;p@)!GdO91n5umK}Qkv+gVs2A!t`VsMO&qfCj7C4*-m6 zM!F&I=YAQK_ZmcI%lnfr`10O%XSTe%DT~uUPX<|-iz)+IV&;j>q9x&^Hgno8r8cp2 zQB^6+RGP5v_YYvj-iV-?fwrIm(~pAzk(oV{m>K-ha*On1_J6l5AX9-X|0uj(We{@5*1SoVo)^5 zs(Ciycj6-|p1A`k_boEvNHgvMCyzo-wg#MXhb<8*kdy2rZsH;Mut!r@3!u?$6(zjeI4Mb0`rgZajrDmvf~{!BW`%yk8349y%s+lI=j3l2$#I z8u#s2$mYwvzIgZ+{p9`bQjO@3owhBU$VERr3;o7T0rU_0N&xyeF9I6n zV__XgaRNnn+-P@mA&(m^j~mHj1{*NsO+@b7c+wl)ep8q==BpNj%YvvN^CJBInLQPM z#h3`wpyB)e=Dv;+^6bMv0__J`TK#jg5^xqF%jhcbJ!@%}y)AlZ6^f;isk3S!b1n82 z-h?t=vaeF53q^{mF$+=n<1G(-mFnEhN6y~{lxENhbdUlyN@Hx!VR&-I*iN}< z5j*Y8aPsq-EugV-%*=seG#(pW770G;QeZ=R*F--Np^zB!mg1~D1ViPwvcddhs*q~$^Z z^0P~Ok^?rZ;tZ$Vu@1S5jDsLdI4e5nZNC6A48`n#NYMeQ%4Z#Kn>m>YCJQJ{s}(j4 zSr`u)fMekjB^(5ys0l(bAxwQ2ittgcP+4MGrNq(7+vQBdQb}$e5~aX9>LWcdqDQHj zZl`?%J!#i)u#V@n!+pUDu9N;i)F&1ET=DvYFx9fGs)QM@{Q3JuL4ODRUuK$bTlA+P z)PkL$lufHv2;1CAOZYuh4ru4Fd-PM_i=Xc#R&PX&AY;fE>K)3g5*U!9Gt>X3JVR_~ zH*}%WATppo0Et~BK1v~2JdmHRBw$g{SH{LLGb;p1(!#T0O3xD~e;YmZHR| z$F^mI0t_+p%(uM8Q2c61n3bVEw$vzvvz`>5hCtR3=+GV?-zh$a-2yCg{7MgEDpJzB z&Xo)?DRPLE;A(XKUj$7s0+bgxhbXU&?hU|!z>w<%kX;C5)*Cn!`1%rIq!U&cUBYl* z1Q!tb??l8^H2OJ;N96PX-hToV9yTa$zkHBVu@N=2Kjxed(kl96T(3&x75xKcWZeYW zSTYFOSFxs_E|2_RMplLNiN1*%lOTB#q4s57)`q?xiJ_52mL)zzAY~=HATaNnAgdP! zy{{Ki`&dg1dauk3dJrNX@mTbHMn_XtDutY-^^53jFZcY3&^vZX9WKA0%hGSEpV3{> zZ<%o7wCOo2X6PgrMp+mNE>nZ6Esc-;R!W0i_jX@p2Ho2q_f>|+nSS6~u zlm=G3*wWbUmj-kn<)j}i%lIfg&OTKyf05bPri=*{<5* zX$zlOoM?>RftZcgo~A&~_cww0cND2zvZ%!>i!-EE8L0*11`D9gXrWz+YPhiF%=|Mq zDx~W>^o^#-+vWb-jg0UXwdSB=n#}B6U~3$@FbtX8)UiRk{B@8hweixGc|8Jz&v1A? z>apSEvHA>EDjjR$^6Jf2R?BoHzBWLqYg;+&Itz8Bk`ui{&uiC)V(^%<5^*R6dAtF2 zBCiEqYOOjgXj4PFFzTjUAuZ`+=kPH-?S-&Cb^Rf>jX>}RbeDl{2x+# zNQx6(pZOTbFsRus8PwH2>JqnkMAR#M)ZCNet_=ayw`4X3j6IYEEZ2pO-F^kmPL-ED9jd3a-6wiwJfS27rTEx`6Kq}1bJ&13*=%v6n*UPZvK0uED3@_&kBz zu0_{o)+u%?y04F%S;u>3HXfO6bQ?6Yjd_`Miw{489D@3ewP@hB=g_eb)Q0X7UeT~( zB#KpKmZ1zL>un{&SL+oI>RyyE1h~NMh)PPCTMKr%YXPZC1X*|YQtLRB6;hBPWX?u& zFw+DZ4-F%WFl#2h;CS2X@7Op(k9Yb#nDlaUwD8$dp@Gh7^kf!O%`&4dlH$`gMXGcr z=s{a8EhwA!!$6We@|6y*V87Nwhbp%87YV1nloPxp zV)YHXU$JQnp?DvX!#Ko1fUs!8W)|@hgt(9q_<1sB9bg9zn@`u>vs%2@XmKcW5^A=| zL?@WhRhjuqm4Ck6U-hKeN#)kVZM!R;H{x3eLQpeAvI{{BZ8PtcH`E_lxGZWIG+ir^ z&93P4m_R;JF_eJh=nlHsEE@2E~}A4#QFks&fX*uQ;Qf!x}s6{{A{sETUuHPQZ{W^J+oUS^2EHdyVJW0Sz0ooR0lMmD;#wu-k8_ z*$^D;dLQbsSLn~+i0|xb2U|aPJyHqeyBl<~K`92^8L9~gL)=WT!qz~ZFbaQ6`)9lf zj@@_5*!>Uv9J3)6hFwoHTzEgct9I;U)kzm`!=wVIPRAvmWCmEEj#WUI$Yl@VY=T#w z^SQ7;_8@<}H!rri%NO7glYRuiq#pso$&&#S^c8;u6^t{hcndS;zrGJMCduWR$Qq7# zId?36h^OCz#r^M;mQnB4&cE&1wbicKJ_>MKLPGQAoy;`V%S_#e0j~Dh+b9rNZwF%R z9!vL<-GaV!h*s1D5hi-7YZ;rP2{H$D4SE6mqGg~4CNr&ONe%kpjCL3 z`Ki!K&LQ86cN_5yL0T}wW7NwS_@}UG25g+^iMKIj{53>{jTg;ez(kY)W_)vJTxs~m zZKd6t2;C!Tyy@ao1H{756-c^mObNL4$of7cV#&(XLN8hTD21-;y;5-hokip%`;ZO9 z&l|)aWl^T&$?Z{DsMP3+Q1t4JI73KL`EPb4k+Oa^PGJNtcL!$ajm+I)ov}wWRV*_W zmaWBx=Gpxl1Z}C+iFnEc6Y&dh!zMIH6Oirfu?2-YUtlK%B~&^#D5CHd8k1JK1n)`m z+MQ%JJ#zIVJ#%C{S)vB@CkLp{oSD-FsK^FNBf#hLjF2jdQ-&7ME42*d=-`MpiE!qY zA|y4PElrXib$hUBiFcrI3V{yDY`)c3ij1Jho6(U%`~sIc8?L010IYslbRZxf0=;|O zo!6p)$UCOZOAOz!y96NKDQ%iPTBXERpzYO6)CcUGKOW3!jJQt+%Em^JQEucxY)k`@ z*_b9_$dZFL0$q)vpxpoBl7Or%L!I&`TmUaTPJu8QFpu&QblD=HLtTU! zWK0~zIDjQsnBvh^f}C^sLTO{&UJI&C#6W5JU$^|_-GSsSh||N_)|-%*WTuodYvMY* zN^Is8$Fo(yJ^&1n>G5nD@{eaT&))HD=6Uqim&X@9H9F0F9JzW}&$^9^a1n5;-Sl}(5|`J8eG zbiPk6a3tFY;{xX|eGo2i7~8*q3!KFE!MMOlY#)S+a26Lv{V=pY$W*_S)+HXm#_E*$ zp?pH%HTk;|tXpE4q%JIX9xi&yxe%I1Q2+e3nRs&2r{EgCRtDAS;&;bNTg5lAnnSx| zMGxTmNL+2(1MED?NFwU@AR!P2`kQ1NGRoLT~igwL))j>{_8{ zJ$6k>GpDuCW7i73(PP&Nyuq<+eryH}H%^XWrX$trk>WqB?NYzC4u4qN_sH>Tfi??O zNBW9bIYQf66=8>=JN9O#({~_JlrI|qa4C70Jx{GCs|7LT14O2%2l0?d~Pn{)9J2pPa7V_Y_%%sn{nWgEZ?{wOmd&OTK$KRZS@X z!n{+}yf>Ke&pB1?7e9l&h$Un!9~=~o8?0&HHvGpGw0*s;LlsVYCN647<(;Z_sU#>f zpO2aWA2#Ner2>J+>{HdW$be8!RSP_he5#rcE6AjY&Aee8I8{d*5-I-6;LfLI|*ygBNBR#BwV67MO$BruVp-y#r|Tkur1Zsg4g3MmV7 zs+z}+hv((@1{<3gzQ^~I<(#VKzc8n&9Rc#J zODri5RG^du1DfNMp>6S$Ik9S5QTQ6TdLTIu<6cfxlO|6u5B`M;p?-qiRo0=xJe}lt z(1InOxWdtO%Y(%3FZnza(RRrv!&vf3-x!vBx-0Q5_u5Zld&hThZrRKD4dVAR{Jw+V zYW!;Oi{UpJzeDijC)(mqziP*NkZ(4SqQH7fcin;{}#uyhz_DCOPa* zGnj~ZJL_6}vPXSe?sTc2P32@L?rr%)2Y93a1n9T8| z&pbx4oI)((^-PazMA&^}MHUwO`PW&@h+bFk^RJlai1niAo9)kr;xs^C#!T=cwXD7v zRG8B7KD?}F>tj5QG=Ogp4jRbfnb9}`j2_O+RFl6RcwpX+!CSVYc1lFt$mN)x7BN^S z9-ZlM;w}3zTVbw(TMZ|)^*p0MLz#n-1T$NMF27CXasvl*rdV-8G4^!=0__oeRV*B{ zOGhVT)y=vW89($B0HtRP;r74pG;f_(0aK9krzI-LA8VbU`$S`U^# zq8Sgnhx{kzRF1=wf{iiDkcoNC4W!S8#_f>CK=}}mJ!$LLE zBiOFeqY?QD!h@1=od|Sq?XGwxBOY@+Ne(#N>KXTcVF`Fo^e^&3YU0(Rt*;hgL1uUK zh0fJ4BC{_76ewPh^&2Ut6OTRfBG}w7eBYY_U3>sa1#3I>UFxzU60eTl`s(Ndb^`f} z0x{}ll zDpGyK?69+XouXUozT9EatpmEXM0X+314_bKki7Zrq<5#Q?gm;!`#D43`r&NrWX1P&#>wBMM`3c<#u2ZLE6&+ z@3{;7q@r?mN1anP5sa`92Ql}sp@2L`m4ZvjBTRx z&QJOZGDI!l$5RjVl9BYdqMK0huWvOK-%>W4fU;*4W@g}914X~P=G{G8hM5TQJVfat zwoZ1oCU^Z1&JXCOD(tjd{d7nFXjec&l7W5%L}njr@j9pjktdPJ4NBxCAlBUhg%R-~ z{jlE;<)yz%)4z$d4kAqnLP%M4uZi};nI#;J%sx8nEMxupZGvcKvrnwRzvAnzc#v0q1?27K^HqVQpwIT z;Hap7bT7kdaa*K6fjpQkaNwth-8_b)>xQuzb>$zq(-sPOXP2jTSWj`cTk^lSzk~Ub z9g~28^G?yJ`lXAa-4600qrDbw4QWWv_{xt^G`}NwdfZi*{&Ej)*|(xSM$;e8^v`Mf zzpqC6rX2OHBy3)74&g3lGG}MAc%VOn05Zh6#x1kGRP>XfDdjKpE zd@dqe=h$N1&SH%q1E>It70ddxSl@w7fMR_*yI3)0X^M3_iuGytliG%E4-_j}Ar@<& z`!>X(#oCY8eJs``&-o>J8raV*$){P8D8Q)+uK=;L#l7x@zYY{2)+t+iFKa*a5!;JV z%qczN6O{KPmG@KEL*CU*M&2@cS|V=_J6_1bY%IoCpybZ0L2hr_ zC8~o6MXDR-@gK#9{9ZM}_vl*peL8)lZzl!Mov1N!%az7C4 z1cd%6=RCVQ94?0`dZ^+qaJUoKJn<-?#H_4q9~)oSf>lqkdhmAr%oK9 zD9=M)rYJ84Fr>3%LI^&Et-Hr!*Eac_1oL_w!>RKkiT)5z`0PIDB!QyiAs<8z0R@Ow zTP` zK|ms}@*eE1-6MNz4?<^fj&)@pR%l{t?G4zT?+)3Ky8F`GxuJAEA#L%e^&!`UVxJpdc z(YpQ;$WFpxk;-_tVJQMmbRD4aWB;41r%5)C@u|%W$4(mvCk|GO>tds67-E2F2tYJe z&4GXnLxzgA42QecV{~Y!UWqBT9Y{<~|e6Dw`Hg z&(BVRG3`XGmAo;w^wDXtBG_V4n6uID#L9!Px7f#-lRly4E7p|V$a_27035bsgL7f|(v!+9mvwPejP`sPKHHT%g;3t0kBqRdeO5}T4Jp3n3UVr8Xc zz2MTkQxzb86>ucyGG(u%OfwuS!iSeny1)3I5K3JJO6Kd9-hwFjMiKUUh-Zc9+l4(* ze8ZeATO-DYAs|T3W^P62?0Id4bd(tJcF)203-D8kM6uN&TKkQ46kl3d?pUX%GYiR1 zlKbDeXCns-;G~%{*n#}&`%F$Xgqyb~dKdhE3^9<~Uaz%Z;5cyBxWt$6bC86ujeJ=grvYgJaIY(4xV*@>Coc zdWiw<0PLB+!Ddq4vkV!dspEOSN82cw`Y*s&x0pa zNbIZ${~(+Aua#X=c4^ty%c|7;$g@8dW%mJa0b*dPTUDbE7(yTLxak9aWBP!{(9QP) zGukXz{qNQ4Ur4#7XAIneR{LEhN{>rki&p!vTH7q{eOMRP^w%;y`x>PGCro$ucQrOW z`}2q5B&UBAyY469o1#^ZeN4IK~rap32|Io3{^mx3v3B)QkS^d7n>p;B*&!B6b-a zSN-loN3vM@)R$leh_w6N=Rg6z2B7K4uA9I#FHmh^S+3rwLxT(2EczP;Ll3)k)v$i z>=k7jhO!OkC|i$`Mz3dtMISU(dHP7fQO9?I&zP#`BRxpYH$Sa~igoAtFY|2EPi+b) z#R%h-X=pE|?<#Y4ii2TJdfZ(%LmOo7Ao>P{?%+FU>lP5t=SJ%R|box$5#r>+J@;|%_SU|7wu z_Z#lb@T95F#Z-;$tZMjT#vR6R*;I|~?kDcemO^kp+pBgAiPcj4?rp3Cv<`QJ`EIA9 zE9OWq<<@?N@{ry;vAPTO@XbRAs@-`_MOSPR&U`BV7DlV#>z>D}K2&Y2_LM%n?cV{K zUcDCfkMzwas2SvJ5>qoJHxBQfD3kqjGhb)lkBRB@VdY5qOPB(oGH%KsNYGh!!*Uvn zZox^8!4<~SZjJ|>-krE%uNPd)owSSF949%9o4aBWX+dAfCr}~qDS^i-942tmaQq_K zqgZFf(4177Ibe5w=IegB3X)8BfCC6c=Cj>n$baI@6h?hu`D_d+-wc-&Z(1++ao@w; zN+&gL35SN02H%W@j~@cmXTL2_Uw`4v@WJ0JAq%PEOCUK+kNxBhfvk&#n})&@Kl?2J z)`b^8Qx~2%;c5wA@@!rBil>3(CrtQe_~PFINv~Rr#YZZVmH-k>T{zW3&ALcaowJXr z=4z^6k*CzSL-#S27>23hw5EFXcAw3?QAkqR>O%V z2{kha%CdFC3VNx6erg0z7O49Q96}&up@M#71W=Zu`%4AANJ0P3Cc{*XAOS2o_c{fg zqoBhhfU>;Y8U;O1L4P{}C=1D*si0>l=mR5wvbfxF3OZFme>4Ipi_Co)6I)=Q_;uK1 zxQ}}Qcfa)R_(6fvyYs6ew7>WAHtu?Wyl3fMfm|SGSCcF^NeY(UJO%xeg4T=xDy8>% z1${|D=Z*j>rT4$tZlw>~uApa*04k+7q@Y6zdi)5WQhIkP=wk|c_z0jcOk?|$jMilJRz-Ft1JNMeOzf03iV_o{na z;1hxHmT8iHlO&fQseAvXpi30=CnJDL>D4P}je_1h0;rVUnF_i{L9ZPFR7&p<1-)27 z+eZME(t8b-1K7GqL90gqmC}1qLBFJ+7mNTZrFXr8o~@v>MgW!4t0O2n_Eh(cXj*5D zyY+kMRJ)!)IA}-wH~eC1M|5!q&qOyZq$i zxWanqms@WiBD z(ZZ}5-w}2n2SY)%-Fky%cgAu6#GDxe0H2c@*DqrXD($WX9<$#8v?}cbMLH$0$-l$WdbMt4nET@cbe=hBQDa=p${QVBl zh56fwyqx3?=ICr1mRs+3#-*Rd75ok12L1+dbMJt92!DJ6e*%w>i3pkMWdbMt2p@z$ zhQJ?lu>2+PIT*f5L=5;lkCe_T{wLVX=dZ};?>Q;48HX!>B_4mL&iBeMJR*O6$jeFI z%N(6e8|2ozo^k10a0P$sa07p9adRJm#DqUSfj@yy2|V~?0w=u&SLKf(@W&i1f4AeK zH>^%X4ESqWC;WZ1Ab&@#^~b_L$07v=FWGX4YFVFM%y9m&Q%dZo8Ims)SqqC_+ zZoT!4OV{EG{ubc|{ubiqz5pPJosY*C(Scfls|^RA9Jw$oqGZKYe5Y7JC&5qD*iUu%;)bLYdrp%q{L=?RQU^e z{Oy|K@pluT3-ecxyzt#RbHsd^+!7C^n+JSrAw>0QrsaMCy5XmbM=WM?DqhJPh#)3vu-85U@PfYL z$O*zoxN1>$!bMmu%)_1};jou**d!cwqHe1APFNMQqC3J}7Xea@6P$}ZCtZAfBPg(2 z?(A@iuK*y%Gdp36U4|fRldpcsE1OTHY}u$g4(lmko4|9o8i$P!z-tNiFgIJ-k7 zoT28v3u!o8v6=@=ucluTlWRC}D^>X*CgVl)(R;1H-~1B%o8#U=_c?3aCn0L={t&)q zJ(v%Y`|?ts+~Og?I>oR16#r2v-T=q3aUfpRGZMucgyK6u@j6hv)~Q$nio4x8L5eqk z;&q^SEht{&RCFoDU6$ffP>eY^6?F0Wpe9wZ;k7_bsF$0#0G;$Dc!1d}Bhaf*a8~$|3e`Y>Qv!@? zKxlNcl7?m=LzcOk^Kp>zqs|i;7j}5Gi0>aXqu9CgnoRf3ah}xaRnWrGB!(FrDWX>t zyh#}g{tt@8qa{Wtbcu2kVB}3`Cw;7>*@|a|EG^H^W?ke+F;)B;s^6@r8}6E$BjJGt zUo|M+EmBWKlYfCA#Je`;iTBstBZ+rBauM+!iU3#|E4SVdZm^hPAVa*nadVFjvcyzi zNq|!V4Dk{gou{Oscp0)RjR8wWyz@O;a>eT+fr$4N1VGDnxyjZWPWo{?l$G zeRMl6+yGaeKJ{k!l1mYD@o(M?FWgGtLBgO(cidm998 zMI+Oz8_`m&M@x0LQ*n#7RJT|`+;kpWs&$6kD9Ak+lNUU<-h4092~w>n+(9l}K(~R; zZuJ_(OLc?$CX1OrCxXmig6zzBgau!)T+Txfx^Sf73~k8WNvjJ%4$0lHG{i4~yCF2h zgHFXG<>*1&U!NCX4@H2tsmejH_lR^Zs87)cEqnJz$zGp(q)+(csgVdjDUa~=gjK?O z5d`6N<(?8BG$P>}h48yU_<9h&&Z)Q&gs*iE3=)nq!P`{jIuL%N^f4rSjV1iuauVJR z^MM7x1+8X3u!wsAWQRi7oj9`u!oTQ5C~TX= z>Q_SHYd#Jre4g?8xK0EFpeOn|D%H+dc+2eLy35D?nGZc>$BilKE;~+kjzPNaia&<0 zIoMJu$Azgp@ zy~_M!8OX`1aek*T^0#W&UoFL3f!hO%Nn?84&udY<=adDC*WcL`ZU8A;^Q~H<4^1D= z$W5*^@m#XlwNxKq`JpsVD4QvAxPRV6=PAw?Gg6oQ#cCWXIqm5+UqC>XD2-xF`mjSu zmw?Jj?9adnhswGe6>BFfPWMIh6PR$%RG@iRabi*pEIO8@(*Kp#SPuVXVUw)DoS;2|?L*ef| zj0LH(ItR;9aq9AJuyrKUrqBFMCvP*Z#q9z7Sc)YzD8(zzHl>(Bq-HxH2=!6r>0XC* zJKQ@`A`_34di`aI=#wnG4ypI^V4Y17VxL`4g)Xg1IzHB(0ik+EmG&EPO z-oZ7);p+|p7^#-dC6LoB!x0%4CRNqy7(*_81e}!cJIE(JmIWWt};6iiS;v^PY?|n1VkGFTyUuL*Xr_jOFnVXQA~& zS~OC+Z*Q_%kUfj_SBcDMIyb(A2x7p(BbFBrN8|Qt(5~shH>12aP@2Q_4Ol5c$rPCm zE3;{oVF$#EK43ZLkOYR5op6$EnBgVq%iY7!1`PJ~DgjkWx#e)O-q2%tO}u?VIJp3k z@>%V5lg(=~k_j@BBY8*+XPZezhDs>w@U|k4h&LcJ)$I-1cX-m39Cy9H9M?%n`0S*E z^kxaZ5WQd3)GAfg4=O}=#c#uDQyQk+xefEw(r_ln&aoBzvp(vcgzG@thfx{zxp}%aJ+^6f?;L{zi4_kqphhdVs+hB3JMDc zjzK+z(k#~VzjrGw_diJG5d~&PSkm&$K=g5vZCXUr4C0$iYXFOizYP@^^Lx!Wz+Scb z6?9@@ulqUxahc~W$aSJaSzjFrj{5)r23>c>ZnNKSuoGA(Z_)U8U-x73Q?(@3*~y@8 zpn6&hso01?iJzVBK|uV9S~AY>3BO_`Js?beR_y!bYDnc zoVqb&kPzv`x2B}&NjK?a`CqY&h#Ha zuMj3pjt8N0(&?Qo-L~K}iM(#z@@@3K|!4#b2h|AE86TsOBoB&tXrtZ*% z15GS~#L7izuverHVSp?GnA!$J9_NxKi*tON6{G(TMj{G>?=dZhtNU4!ZgwJb$`)C!gimv_ zih#Q}#)I2cXQIeiJ94mutbJ|8vBM&Vl?x%MN6}4~h9D_asrOg+(AJGn={DAlQSUGz zL!mp5g=Dt%Ol+oK8M~q$iKZ4*uEo>)+7*?V=<+ZR%lp|Cl~miEOARrykCf6ici(nJ z9i84FXn0M@dNkdhZW5R#ohe!GRwz!kM-*0)K|oT)#Js2UjfAt~WFu5zK=U+!q=JA! zYVzYGXGZH{y!|B`yPv*)vauK9`zO2jWRd3kBOBYDzJIc@)#>{uI~*k2s4SWbf1gv< ziv;&MWgsJ~DYS;W2Tz4DqbkM?PPJeKtnePEJT)ekF1`)cC7OhpKo={#$7xV+{aVB= zP7A-`4yT3R=mw`Eot(W#b%WDFZ*+sxLT|9aX`yJ{;8e;_s+CW&Zg5)Yjc#yS;0+k@ zW2I@^-zqTfgXq%O528!R`NNuvma#yaSSW7m@V~C+YEzDCHOy+2n!OOi3l}|SYMz{? zIpieoX7!cM)byaKQUG-l2zE;<&G-JUj=2x8&t%(T zTVEX$E5cW!*i~Yaf-MKweFA27M#p+ik|5(#zdu)!?3or_>UNjjKGi**<{zdF#6p0v zHWBIF?;cNrH#5v#3zA6Oe04vb7%o-}5^EO9;;Z`~ zOfuGGF}cP(muFazYz%700yRvIGwd596nUGvfp7PlcYe+$0`M;|@Q4u^sgFRdqve-i z!1F&C9Be@fl&@Iq?(pvaLmO7rBeo_P#9|8K<7?o zhrhm3Trhz9!`Emon$PyGTo`k%RYmjDB;=%Spg#~P9-=hd1K<=WaLj?KA&{gVA`(6^{3S8dfS^0ZrzJn-POKKaKUBoU;(dfIA2w_bdcW$YC7|-{70p(-LxCLA;`G&ecY5 zRQtI1hTZ9wF$0}PKsj}M(1m9mA9S0Lr~c6L$q=gpqqP(7bQfKW5$@12!b-&H7(qk+ z$qDA!J2}BT+mjQRk(1^XS?N0&BN#C6Cr~1zyD1SzuBjw(ri4Hm>`JHzHgz?@_VP;1cj3=$TAY=Pc!^Q)3qVT3*>N&{ zAc&)cWMS$d0f3jgQfdl4Rp1rKF>g;6${nTu12Kpp#s_8)BaMF*gFJ76CHSvn5QC8q z%pfeAe-(o~iXoRlqvd9xLWRc10=UXRg@Me4@c#!Za_!M{Q*`NnWPUlL#Ezy@4MK_oWwmNkUf_Gwzro`+lE zOev@-ntx!#iIT=UFhaAJLANG=_X81D#)7IMhK zcal4?AW)BPu;#W}{BnxK8uo8?xaT_qnA}reYNYwpH?g^1MAtP-)A0%Qg9DgF64cWi zVy9%|%sNY=T>)7JsWcz_jPQM*zT_=fYlb9R=#%3lF!z*0wyd4Qpa5&<1c{y~q3J}- za;St0Ss=UACI<9S31+2-N(eLlp%Q!{l~GTOaLOVEwN|aelmwMPT7m6}D#1vp6e1jz zVFp`PY15&F!bKeNO?C!fjr%5xEek5|$~hbsnxVJ6FbXbH0?MO__D`1(Rab+@jDYok zi7aqRD;VJ&Gr>h5Iq%F#6R$vW-boYk08pGX!C0uL!Ug||c&YLiT3uOCVM^1o{ z?IIiNi&*PZx2T;ni9{JQaL!tbD6*qI1h zm~F>z3w}SsFO6Rtei!366Tidp+w~9Nj5+^}ZCiJeX1k5NgQ@YTL4KpN$9-UkipK+=%ci+Mu@82g@$6%{eW<=hvGOB_PKq-%_t-jY zIfaNir)6T`MQP8HtsqFr&iBy8t8Wu1g4v-9X^()x5CP83a(FoK*n-9N@3OPOKG0 zgLsT!rZ;&U*;0}N1VU>;3{I3^`ZTs}g|};7B+*P^~%d!4*LMQU*;?lG+s`<@@CkB{UE)$VP?xq{E%@*)JoHiU#e94K z@&IG0p9`*sfeU+|xktW$zQ=qPVfLYY1-mL|evBf?Ow8dXwKC@3O4UmAf7ao4?{g~GdE>?q&cq&lhvLA0nYBneH=Zm)( z^-5!RU1gYD2`0nIbHMiqqO07VC9DGvDJ-n^!oupBXJp_Pz}6mvz*e89a7 zxTm6c0})+$EI#Vn<@_x=y&ptom-KvOk(YE%(bKWiNm&{(5?p!e{IPXW=Qr3C_8HxW z&+TtvQ=wncT*vAQfs73&KS!2r^YI`ST%;;q!A_id@J6NzD?I`C@o*B;wITN#5E%}* zo{hqtzGur=mDX+ZfI;@+`^hoLLbiv_a1{y?hQrC@nQ*!$q!P-17BH@Cy z(nUbUI>NucQe0pu-FmKVmabfc$%BZdROmz>AG6Hd$iIk^3klIH?Z<}#qvSpha_SSguW4({($ zVc7YAY}#cqARE%m2cn+Eoa?ofLvSxL&0;R#{m+V*O66Rwv_Q}BeIONVpp##~i>p8S zi1_)VgL>J!TpZLi^xexV>$sN(>$R5$ zF{A`UsAFLA1d35Fy^m9k~^Z6vuj{d$Q#2C=L5c*g^YBSjqb$ z3=Z-4N!aLpCG5cWMHn2}*@RI8)P)_zM%n#zURU&I8e||9byHH@iLGNyxmWc2F6tO+ zBlf()HGD0b)>yhYfwmlD2fhiosHsTCKb@^cMhn$5UGSCqqzk?hZ*)+Z#R(mZ5Z`k! zV$A5^lX#kgRY)An!3gmy2O`FfmIq@7epm%q=|`-a|G%mNM$w^==ugnAo83+3%EFbW zuyMP!9fGgvR>a9g7=XWwg(pJ+Ur`p8958X`pzCt3E`|J%Bh8VS2=Xt7fZU|AB8DcE zBrDc_Cc7iX8M~E_=O3_(T=oT=j-ou`fiKH%ng_7@ai^fi^jz_nB5M_=x=W|{?o#iK zaU}(Or5B$r!-#blMy$&+m)2v2L%>VQ(?n!wLs{heM``3>i)|ebv9nj3NS&jB$8682 zhfv+3fya@3qCSu~M7>Ar4UKM;^2P2xXdF|~jWBX7HR1$4$tr^}pQu|KJ>8F7fAFyKI(=b@zfaLgoTw)iFk zQ2Yei6M^TI#2WW(*-Ya?5ZQRfb4hYv8KqXXmbkd^VizgC8Aq;yl z4=fbG4W*+LasVGvDmIb#p0zyy;FsF>|1Esq)9%+De}He@SpW!S9>qmRWuHdKeHI#+ zn0cD_$(F#}sW2GfF<03V>YdD5jkLqL@3QL6bT3E6_D5yUoC_jlIQNIcIGmeEk>m{L z7Hh)OVEOt9Z}t-2DG86YvNTPwaZxS2*dJrcCOy%2;62<4$}au&e0&;KhTk;&j>PX^ z{6hHs73cN-0l#14w*kL2eu3}n_&p9je&a!3NwgcGjB(i@Ze;#(e~j>9;?{E__Dpyf!rU|A5xH)Y>!4g8lk4Mh zeL}87a(!B^&&u^Vxo(&13vzu)u78m0uv}l3>nn17Rj#gFUzh6+xxOLSopOCsuK$qh zF1hZO>)UdDN3QS6HB?T@N6B@JTt6b$v2s07t_R8W<8m#L>mhPIRIZv*|-TCPXP z^>cEK$n|Ks9xK<+%XOk$kC*F-a-AaAX>vVDuBXWLRJqQS>*;bmL#}7ZwN$R>$hBOq z=gBoD*Yo8%N3Ivhb*^0J%k?6;ep#*y<@!~*ULx18%XN`l7t6I)uG~Ln&xCrpenYN} za&3}pi(Fgf+Ai1Sa$PCc%jJ57T)%}YKQ;R7rDZq+VZojW6}YdhXJqD8=wbb#486qA zF$_J;&=(jQWavu_ZDFXIp?eux#n4?0UB}RRhS;)XZer*c46R}4A%?DI=y8TtGV~%t zO$@OC$k4k}|29KkW$0sQLNfFV)PIJd^B6jTp)(lb3}NOZhR$b*ZBYF}hCatooFVSG zReu>n2Qt*j5Pkaf*D%M8(?$Z*c4et@AT82TMUk1+HyLk}?Y zCPNz;;;P8Z4;dQA5Wi%oKboN%7&?ieZiY%3`W8bMFx1Y_r3~To%02b13~?r}{u+j` z0rH;uTNuLh+@AWo8G?6aPyK@o&17hZp(zZ#!VtWLd+Ptr(5D$1Ga8{1h7M=wBMhC$ z&^s6b*3V+-O@=BM;)G@WB8L9JP%}f^^|qd8tz{l#=uU?E8M>FD`xqKz=x&CdXXrMD zUS(((l9YY@w6`WG1*#n9^v?Z*18`nMQ*gQ0Qg6f)dZwEhT& zUSQ~WhK3kAlOcZbT|b8*?$%lVHHLo9P$NSd7`l?7TN%2Jp&J>xm7yMn?qP^~X4Y?J zXgNcVGt|h?e=@X~p|=>~{*v_{`3OQ6FmxzGi566i=4d~ zk2l3zbHSJ4WkU-&X;>C-n-aOOsc}`Ly*?gktZt9DwMSMoG&V*S$0HqWB+ZCqa?408 zWfKElmV@f$@z%x7ZJt0Yo0c{;uV{kcL|Dg7XghAofuUv1ZI^X4w6`~FCXu@4j;7j3 zb$et&+vyXKwfBBX?c&gcwh3*P7%PXxtqrwH;@KrJB@_u&*ECj1c~;lfw#M7qLgpTC z3!R>eL&%3%JK{!;2B}SI#A=g8m$kI7ikO!XP1lg43{yhYjg8GKs;Zlsn^rAr?m+(X zT-(vo*iZu@S3&M=)k{E*zPLQz+FaEbZ(7n`UscoC0JUkT4OMsG2?DFKSzE5X7gn28 zs$Nkki4)pJrjD3f8atLWG-)mxuBweUt*R2OtZuBTsjqGYeI4!1RSmUOEv@mohL!Tz zR=qr4)zH))Zw2>$Omh>HG?A&r4NbLGR(`d)+L-lLv@4_{uc~fuk3+mw9ZhW=i`!~i z8y3gytD0&lPfy3s(UPxjs-4>08o6lBf=F9Oixg#3b9%<9dsP(3LYMJjnLB5(=__n21GVP6R9(}no-;0!M zsztmtR<1P-E%o3sg9wGFMlhI}QyxUIQnX}rB{ zB(-R$ZH!m3jcx8|4+S40w)UVeX^xZCtX3+Cod?@fP$g!K&>=jY#hdLvPy@q*rCPosKOaRZJT@ zBFT--HEeTi+h+<>VvTmxh7_iyx~*+Rb8D^9Scs1)y;yxj*VRf*$OiIa8=IG)v1@A& zp@EKv+E%q8BGlGi%Ywo!-r5>!Z*FO*2}#)-ar&xuv`sJl_|eK#j=mLyfgp1`D}&s& z?H*>^Bjwfc9Eg031gNX7X=r4FRsg+yXUam22PP78puKuo3nY!FRV{I-VO?|UGO=(V ztM-PPcxZ*186gO%xiwT9U)%xFdChgO=|^S1gd8_ zFGo~2!hyHOh9&jweq}ep@=@i1>=of<9r2EM?OxF30E~=Gt%ItzhRfqsjSb5h@(e&@ zKLj8=iP98=&C%3e)zXZ1#+Jav%^i_t9kA|D2_iMEaabXdYTra$97jRZDO+NAlSRTQ!|gxDIP6<*(E>3#3s zET<*02tB>atI0VK`8>9?EmaCVs}2^%RQ&d4YcWwh^;#-Z)n(0X)BGCO8pn8|6=nwP z5R9y7YNMdr+N)dJy^c8NdBncW?~9=-t*d;CH%AcJZ#{9a8n$vgQ`OoGix=IB5Wz;3 zHZ|MSnowi)<*P!=s+&4sNE@^j@)YsGBQ$7@am(>oGqpE|h5&S7b->UjuYBG!(G(Dk zMgd9=qs-^uE3HCrBMogJ7@aZ(0NMn3? zym7BkicxHphz_mx0o)kN`v4Ef>XsHX<&XY#_@}D6t;#c!7?8I%hHpI!%|@briDmCS8?pG-l6~VBfDvm}N0MVcFC3ael(_L@h7%ytIge=u)JM0PJ+*SW=ge;xuX1$wjbQ zfI+Zg4;T=%$<6v)U9)tFG<}ikI&|yWmQfj*vK}dG8`@eLtC;~fp{GmUv@mP7l0mFG zaG+5F9~-R?&uJz^Gok!lfJPG4vw0bOZfJ6hq5X}HCK)Zl*l4epQt|IrZl%MnF{Y$D~Ny*7BIS5m~e(g{GlA$#OB83)EWFwk(W~Az&&4( zUMAo>-*4zA4|pzxBmf>5s;h2E{1qLI2{r2AHH?4GVoJ?!IJ-(90 z68e#jmeABnv@C5?7ss2vQN6682@af^dUVpQ)l=JAYo<0fEN=5fBT)vyl$sFyfS%N< zs_I(f93i)%v8c7Vw1tjcaPa~$b55?RU2JUwbU(RMvZc5+H+fp~W!sP8CD zv_4*W=4I~F>QhCtr?I)Yr3yY#`hhUws%@)ck)Z$C?;1c%&_I$~SKIbAQz0gwr4dl4 z+W5*#r_|L(&ODR!v${<_i|#4dpv|7X*g*+9*Py)tFHSo(CBkOAr7g0ezM&B#MNwvv zDeMPKZ@{&yveE{}ON0rD{Y%lY4=KD}xx(wjU<`Jk%cMPw*@@N;j3V12@WsvZnec*fIiy(&8jAQWhp@5dnJJqp|UTfVAOh~S|RJU22t?P)Y|y+sZAYlg|r5n zE}iRXK(o8wy5Kc{PzbbuY|$qk?PYWHiIJmQae*7Fp=nZR#RwoP6a-ai(%vDU{=m|X z3TlmGzts_Kj$ojvy_*F%m&Md{9H!7XP3ASAKKpyIgFIs)bgsA=(6_>3MFy?S%OK(@ zFm0%jc2dFCRZk`X)S+PGWqt0!IN#spDVxt5Ftc&tY@ab#nR}spBCv6wei+a-EwRm( zNi7qDN;ybw!c-rOvTXmA*R)LuT@YWv%4EnbB|O#q$fqsD4pY#`fCm>xOf%!n7EEa_xhFtLZR zEg0*gY%}yLPNiy}@uF#>cI45TA1`Edz?hzXY7m^VG?NvIe zFZI^6*du|R7(qi2obg7Qrud5YPS)W~iE|hzX6cmBipBerP#Otz^E8>r4di6#)y~E< zk+da#9}T843803xi=kH1t^|T8P~R^o!y}o?YF+Hl_007F)WX6@AkK+kkJ8}S(L;wW z)L4(?4lWq6U! zXic!FpdE-OGYBQx78xQ)IPAiv?s^3lht<43XJOnxwA`@MzaRn4$<8Tb9l# z7^`p~wgmk#+ijpS%%k;`;ec=LszIwp5elTLuB9EFqy;kdUo|{8*4o}CF@!^#$M1n! zTRU3X3({wFGtjT+OW;In+oL<;h^(er@OhFrSD*dDG4_v-v>M|vbue30Q$ie$7|B(^ z01p`kF%00-+{$yx&ixW^=U!MbH)L%!`jcQ$AbQU11u@$xj5wDPiy7kaWzj7*s_1r9=(R-#0cCWXqSulhhJ=ErN|m`$wx*C09f!V4~d zbi@qzdq}oy!4BQ;Jf~t(QwCi$BW#B{KVHX?;^`5zS~WHC77Xm5oW7fydVrbbLMhZi zhP67aDA#XD4J!y|d?Codu0SXVMiZ8+I8eVpP(ctg5JGmubYtdc|3*?YP{r0VNZK$9i7|VP z&+y#Y7kqJkbe@%0(DKU4xUD5O&4RgmOVqI#CMbJ&KN-y*Qx_&y$iNXr;92Kh5d^?! zEx`wDTM4ypBY|d$qlJLEX({el+!_z^Sb5I;=(+opIeMTV=m#O7(dS&S&e?YYe9-qv z0ICGU?-Kx}X2)X0UqED{r&&p)CIl0yaRSU-^tOL$NRKCLDaS}+_z;WQ(!M3+89VA1 zqZJt}3Ey1kKVae~2iH5zYERJII#N#$K`1S;zcd5lzgtiCdw%+HYE7Ooow(OVFXR zUG9*zRsbTqZBz+Axx%priKKptG8faP#iOX43$&wMP* z!-%5{RwL(Xbt#Ii2dMfTtys*$K6?e;!??ph8Z!*E#ioQ#I3`qf?i_lcR?#-2@!Qr$ z*MKp5WOl5UYj@%QZQ}|dSv)6oeZNu~d>EP1#55x<4)B?+U5le*!oW1D_z9J;#*tq_ zs==2NYC;n_tW^AJEZzhvfDAk}6AY!{qHD6i!8HM}nJqBp%jjRx;UbV z334TyHKu($CP_sDma&3wPn=nq<*Bz&-m)Sn=cQwB zt4quCllc~|HN#GfT*QT->>N+zhzJ3gX1T)gY*{Q=&&L|HoD1O1NB6!BT9Gw{3L!5r z^0Q{Fcmi``VW{Rrt2HE%5libNKb1NsG*RGvt~^>g7NhN{52h3Eg~7WYo(PW%wLbSk z*!<|6_oT}VfvVWxRV{-8<`Ul4unZr@K-p!el=m9V0+t%*Fh>QYHE3v~8A2Vglp6z6 z-iFXV>k4n3rnVEW@Ks@%cqr)0pgl6x8h#k5s5fQmbj&pD1r7?(J_3v(d#ahDeh;Yk z$j~C&OMc=@dN0BiXfIfFhM;W(YJG>#ND%oFoUsoQEDU3rwi4VslqbQxg9-12L2@Lx zH=w;>u@WqtJSf4!5cv|E{vLo@oP~jMWjF#Z3+4&&J>d41WsVp}z!cQP!lYY4j({L2 z$$St`ie?c>u&SFLNxUa*Q)Ol;tBU7(k}V8e{8?~b9#(3F-%?gtZ>+Gr^hUw=4pcCc zJXDg|gvK07vx_7vAHN*3qAlXRq|64%<5F$YwyEvS?O1Ial)rt0nc0SA9m@*7!~8B* zk}c0}qisUp6oE6h5azw4HEJ_LLRnajcN3%Wx%)DYPl{Jiw^KjQN*_fx%QA|AlUJo z^#D_3%7(xnE=MYt8*;bHBsf?=km2bAQ;} zA2;{s%zfD0UpM!EnESitK6az>bBMVgVeX$d_i5&Sy1AE|`vvB{(A*cBd!xB8H}_6+ z?=klq&HYw$-(c=PH}?n4eVe%tnfnXo{))N3VeY%lebmpCkAuwplja^V_v6j|6mvhz z++*fG-`p=T_d0WLG55>Oz02IMGxv4oew(@9ZSMD(d%w9qX710L`yb5RHTO5o{T*}v z$j_CZ5_A8wxgTrpQ_Ov)xu0Y1bIkqA=Dx_>xzR{1e%vF9yTr1-<0f}g_y0e+G0zYG zK9s5LxhhkxX#XK?$c*aF8%tSNog|J&ZV z2gy~{dHiueNQgo*1VmWW?#X0cFf(b>GY}N38mO&} zg|aP*gazGpYu%0Ps&^@h%3AAI^C&jHFS4#-6}hP8Mm8*s0>%Z!@9+G+=RQt%Pr_gO z&r+OBf6niB9`~Gc&pr3v-~F8lp+IP8C(Kd+`xVe3-i}ay4@a3EP@J4HjnXtUw0&4K z4;dI9pT=86U^OcVVNg*K+GPlq<&)b5YX)sqb}Q{LT~#-rog%7x44W7IAfGfOqP-Tx zahZIAE0GOG+RXPEt_%&C+ykYXCry*@H>6erNE!-`42)p}?ueT0fQf`|unw-N5(D66G_>d@eb>ZQy2!+{;K7-w=fVl&K;<`!;>MPh-ZW^dmw^6G)VP&?C5C zaAII^v^W6QS>x022WDP-LKH?KiIMMZk-2uk0TtPS-Hg$Azmbd&nK+!Iu&D%AyQQ3= z37npSy9A{JG4@w%+_ZV!CGR>%;%hdZr@(Gu`JhsSbpz&P7ThDa1J<(wz5y{70qnKl zOA+RwBvoN6Xmk}CwKhds^3^*Pm9)t;~? z$kls&WZ*BU&G)aaW`j&)p5KiMWc+L+8)TbVKU1I8oE6R~1=+CM?+Uy8?ht~YE9?$3 z)!Ef-p*GLQVb(K!^{#Rahh5857lmDj=?Z2yabWd%)vh`cmBW>d`B3O;K-kRmm%?nR zwxHHs!jEb;Tv?lsL+L69T|svp$I-}Edr;-sVWz&e*2{kAg|F|OUblA;7xUBbcj;bv z&(ZCz!yA-d{9Pa(+%w(Y%jaagrQny}moa+luG7DBEBd$lFEZXWkT>ATSo9uxLb-l+ z*68=%lQr_vKPZb!-sPE`sfE0EI2tcjmg9%KI}ttwya+$4*uYD84dp%_*b4WP!xNRq zZ2D7_Z(;fzJgSTSC&*3m{nT$@(=U-fM0p+UAuJAirF`$B%FmL6k14-I&V5`t3un1f zf1kXBod2}SPbUZWD6c0M?o}?4tK{3sA^A(>+Fz;uL*)L?D?bi4?L~fy^3oSn{%dlB z{1&+HmHOuYTIFYu>viQ#Wbcd0BVfrtz&k4Z@pe+)_a)^|lXL&5`~cY}KTfWGMdd#u z2VYhGU$O^J-ID*YbJ(8b^T_3gRemkG593wzE9A!4mG7|n7{?;7lWXLEBG<`}kb{Qm z?R`t{^`w{nqOn5%pfSn5|>p#0~QH^^Tk_b*iWqvR_28FCq!NHu;# z&c8)@9`?SF`ZdWXksCRcpGWqOQoh3KAFVt_4&SPL8@aSt`97PT?2`+}sQd{lC;!yS zk5~DNU^)I$UU}gH<;E$>E69C+qTB~I=LdNU<+;@=FOl=)Npe5=4lBP*^}kH^u26oA zT*h@s+VeljxuWvR+_0J6}zmwd&Uio5jAFgMT-v`MhT-Ssrz~=ngrFis#iV~6Y|8&P<){}r1c@gD}UnpNkdHI*hqm=g_P`-`w>hsEEi^)EDh2K9#Q^mo8LZOKy;_ zCI=f-K1B{UDu0sP_g>|{CD+N{AbXdo{D+n=SAHHW?Nur%zd>#eDbK^Y*tF+}@^Y~0 z?@{GdWN%D)139=}d61l+P`-uSAm2kSPpbSuvcFyV`{cru@^e;BewFO)RQbYVw0ZgP(N7oAWxCcCEri( zBR@{Ql>7p@pM2~x&Hozmh2#=>oIFati(Dq}CGR9ZORkbLFiw>I+C@H@TqCb1?*Tx0d&vJx_Q_9^A0i(FFUK0ILH-^25pvIoDu0xGJb54aG;%;*L*7sBCx_&%ZTO`QbJt#V0xZ4u?;37>~D7>HpN>3mx9*aKFQ{1(^Pi1H*r~ zElII#43?BnIy~+0#~l8I!*@A+ufuhR_c;8p!;d+P+lW+sf9x=p@hLf$*(t^{H^sAY z!f2GXPtIX18&mRA9X`upEb~(OSazlO3Wu?5O380__*RGSbog@)f5Bmx5vTIs>+rui z{Di~barg%g|J>n&4r3ZjmH)cKv+(>i+5U?hUgGd_hfj6*EQi-Pyusnk4qxr?R)?>5 zc!$HcIK0c@n#1=x{5K9i;P8VE|BJ&4$J0rN%;#7%Ua%CPw@9B1ex#f zXvbTMa2$fncgqk?KsXUW*7|Ql$Ro(y_jZJn5mq4J5skMJLFT|-1U!=QPDPMS3}qfX z9bpy183+Z0GZD^0I2%FcMLd%6-i7dPgmV$jLs)|#bL9C5YZ2aqZ~;Oeg3Of{AzX~G z4&f4n^#~gfE=7>J^SuaomEhs=j(0i2CWOrhGLK$?um#~tgsTwVk8m}@2M}aly%yom z5UxY`Ai{?bK8zr9YzbiiVJpHQ!Zrk%Yw_5}8$lRF7(>8gAMXZ)afAs3nSZw;(F|95?oPku6$cwY$XmW1sINMDxXN5bAj$y%C#QuZOjY3q_y zjGD}tD7BW+pJFSczl^1f`5Bv{0MkY&*8D^bPt@YXnwrper~VP+68$Bw)FYPxksS$s z@DR6+8;c4=h{=fBipVZ1p0y6aUoi_Q4vRfVaaavOXaQn;JHYg#IINk#6VMF+zJ(R9 z;CMA}oP+DXk+FruF^MtZC=OS|cB43~FL=||8e(h_rvxPIGmIgIyo--4GUP{OiXjl$ zU>Klk*;rjjj5W8A-?5#Aki4-^SXLPKE;OmIwiNA*C^Rl@J%Ko5e!#zKFJT53-q~9V zi5Alc6Ja{g7(>{%+iLzmC#2HENrMN8)}rXU2oc7%Au?((Kg_XVESsjoU$I{hLDU-f ztvYI|fEtfPHVQ@k02c|2Rf5>nSaSsPTaF2FVt^ojInwMe7zIeI*c!-RV`LydjCFzh z5VHdF7xo15R}Bf;S`et|0Br`aTcI%)ux>0}qcfb%qZr!Q84&g^_&QSz(Te&-BfgWw zPD-YSaXuyptta3AJ9^duPdarO+cXXp;qtNKsOxE9&I)Ymfej(zGDKv~qBc>e2evTO z>c9c8WRBLr*NisK?$QWXma-FpjaJpI+qdJaHOIolFpWr5%xnZ;JQl@Ak=h)YqaLaRvH$g#nwdlq+Bf!G5#?Vw9znA<+NB` zii@arIiPzgZ4QKIXPm-pt5%W8Cy~vK1B27}0GwKKsn(&I7-7llx3-DIaF959H`+^5 z+@lk4yo0T1U@}+SW`-w^*fWuBHw!?&M&p|Xp2;W~&eHdhj-B+AQE<+TeSpOKsiV46 zE(2|4(TtwR2NQvrUK3HcV!^L1js^~B%|=7IQGh31XwC?<0XGlu?BQWnAC+0!x?UW^ zHY@0c7^f>c&O|Rnhg6K+<)^jIf)-lT_LyEFqVn}Z#z2?&aTch|k6;5R*8KH@n`%7bNlaZBIrOvS7Jr8DHRODT{6+LCxAF zV0KP|=y+^t+$_f)lhm@!p-Qw(f%?S{NsNZ0oa!bV{+2u@h9| zor)dBSQ+u+=Cd^xUMJ?PRfM+4fRgUpu73db6Db4QiSsabB^Ckylh6n2ZgxxM}Bj6gR1z#1-DB>2MJ> zyLd5aEJUM;r&PtdIW=09p#f|mWjh6#$Ub$lXQACmx;QmaX2y~LGfP|^?i7af3SeV- z2H5$SXbUkV8gC#)?6HUCDH_fcDK{#5iC~H-;?7O^rH-pP~7e36i>Ij>@Tw34Wa z>v$=dDCIgSkp?Y5kI?q+DV}ROi*%;L-X%zc+a3mAH?WU57d<$pTFsGR~laVbmc94q=0<~e-r1RCah05wVmpl$@MV0cHTIWDx`GZRKAB%jvBQ?kJ~ng^o}^c4vOiSW2R$oqxmNCoKZD8 znhr-DPl2X_N0?U!HT%#BSN#sfB{Ys8j}9ulT4IZxnHts6I>Nl5mYlroRLL0^lNe@! zXayllmsL|(91M>S$ZfkWcMM>rvQI_~CvUh$S}rO!MtTdc*Tma$8=W}T>ZPVLNoXRh zRPxZ%E~VZd0i?1G AF#rGn literal 0 HcmV?d00001 diff --git a/src/libs/mosquitto/src/mosquitto.c b/src/libs/mosquitto/src/mosquitto.c new file mode 100644 index 0000000..b28150c --- /dev/null +++ b/src/libs/mosquitto/src/mosquitto.c @@ -0,0 +1,488 @@ +/* +Copyright (c) 2009-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include + +#ifndef WIN32 +/* For initgroups() */ +# define _BSD_SOURCE +# include +# include +# include +#endif + +#ifndef WIN32 +#include +#else +#include +#include +#include +#endif + +#ifndef WIN32 +# include +#endif + +#include +#include +#include +#include +#ifdef WITH_WRAP +#include +#endif +#ifdef WITH_WEBSOCKETS +# include +#endif + +#include +#include +#include "util_mosq.h" + +struct mosquitto_db int_db; + +bool flag_reload = false; +#ifdef WITH_PERSISTENCE +bool flag_db_backup = false; +#endif +bool flag_tree_print = false; +int run; +#ifdef WITH_WRAP +#include +int allow_severity = LOG_INFO; +int deny_severity = LOG_INFO; +#endif + +void handle_sigint(int signal); +void handle_sigusr1(int signal); +void handle_sigusr2(int signal); + +struct mosquitto_db *_mosquitto_get_db(void) +{ + return &int_db; +} + +/* mosquitto shouldn't run as root. + * This function will attempt to change to an unprivileged user and group if + * running as root. The user is given in config->user. + * Returns 1 on failure (unknown user, setuid/setgid failure) + * Returns 0 on success. + * Note that setting config->user to "root" does not produce an error, but it + * strongly discouraged. + */ +int drop_privileges(struct mqtt3_config *config, bool temporary) +{ +#if !defined(__CYGWIN__) && !defined(WIN32) + struct passwd *pwd; + char err[256]; + int rc; + + if(geteuid() == 0){ + if(config->user && strcmp(config->user, "root")){ + pwd = getpwnam(config->user); + if(!pwd){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid user '%s'.", config->user); + return 1; + } + if(initgroups(config->user, pwd->pw_gid) == -1){ + strerror_r(errno, err, 256); + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error setting groups whilst dropping privileges: %s.", err); + return 1; + } + if(temporary){ + rc = setegid(pwd->pw_gid); + }else{ + rc = setgid(pwd->pw_gid); + } + if(rc == -1){ + strerror_r(errno, err, 256); + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error setting gid whilst dropping privileges: %s.", err); + return 1; + } + if(temporary){ + rc = seteuid(pwd->pw_uid); + }else{ + rc = setuid(pwd->pw_uid); + } + if(rc == -1){ + strerror_r(errno, err, 256); + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error setting uid whilst dropping privileges: %s.", err); + return 1; + } + } + if(geteuid() == 0 || getegid() == 0){ + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: Mosquitto should not be run as root/administrator."); + } + } +#endif + return MOSQ_ERR_SUCCESS; +} + +int restore_privileges(void) +{ +#if !defined(__CYGWIN__) && !defined(WIN32) + char err[256]; + int rc; + + if(getuid() == 0){ + rc = setegid(0); + if(rc == -1){ + strerror_r(errno, err, 256); + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error setting gid whilst restoring privileges: %s.", err); + return 1; + } + rc = seteuid(0); + if(rc == -1){ + strerror_r(errno, err, 256); + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error setting uid whilst restoring privileges: %s.", err); + return 1; + } + } +#endif + return MOSQ_ERR_SUCCESS; +} + +#ifdef SIGHUP +/* Signal handler for SIGHUP - flag a config reload. */ +void handle_sighup(int signal) +{ + flag_reload = true; +} +#endif + +/* Signal handler for SIGINT and SIGTERM - just stop gracefully. */ +void handle_sigint(int signal) +{ + run = 0; +} + +/* Signal handler for SIGUSR1 - backup the db. */ +void handle_sigusr1(int signal) +{ +#ifdef WITH_PERSISTENCE + flag_db_backup = true; +#endif +} + +void mosquitto__daemonise(void) +{ +#ifndef WIN32 + char err[256]; + pid_t pid; + + pid = fork(); + if(pid < 0){ + strerror_r(errno, err, 256); + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error in fork: %s", err); + exit(1); + } + if(pid > 0){ + exit(0); + } + if(setsid() < 0){ + strerror_r(errno, err, 256); + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error in setsid: %s", err); + exit(1); + } + + assert(freopen("/dev/null", "r", stdin)); + assert(freopen("/dev/null", "w", stdout)); + assert(freopen("/dev/null", "w", stderr)); +#else + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: Can't start in daemon mode in Windows."); +#endif +} + +/* Signal handler for SIGUSR2 - vacuum the db. */ +void handle_sigusr2(int signal) +{ + flag_tree_print = true; +} + +int main(int argc, char *argv[]) +{ + mosq_sock_t *listensock = NULL; + int listensock_count = 0; + int listensock_index = 0; + struct mqtt3_config config; +#ifdef WITH_SYS_TREE + char buf[1024]; +#endif + int i, j; + FILE *pid; + int listener_max; + int rc; +#ifdef WIN32 + SYSTEMTIME st; +#else + struct timeval tv; +#endif + struct mosquitto *ctxt, *ctxt_tmp; + +#if defined(WIN32) || defined(__CYGWIN__) + if(argc == 2){ + if(!strcmp(argv[1], "run")){ + service_run(); + return 0; + }else if(!strcmp(argv[1], "install")){ + service_install(); + return 0; + }else if(!strcmp(argv[1], "uninstall")){ + service_uninstall(); + return 0; + } + } +#endif + + +#ifdef WIN32 + GetSystemTime(&st); + srand(st.wSecond + st.wMilliseconds); +#else + gettimeofday(&tv, NULL); + srand(tv.tv_sec + tv.tv_usec); +#endif + + memset(&int_db, 0, sizeof(struct mosquitto_db)); + + _mosquitto_net_init(); + + mqtt3_config_init(&config); + rc = mqtt3_config_parse_args(&config, argc, argv); + if(rc != MOSQ_ERR_SUCCESS) return rc; + int_db.config = &config; + + if(config.daemon){ + mosquitto__daemonise(); + } + + if(config.daemon && config.pid_file){ + pid = _mosquitto_fopen(config.pid_file, "wt", false); + if(pid){ + fprintf(pid, "%d", getpid()); + fclose(pid); + }else{ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Unable to write pid file."); + return 1; + } + } + + rc = mqtt3_db_open(&config, &int_db); + if(rc != MOSQ_ERR_SUCCESS){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Couldn't open database."); + return rc; + } + + /* Initialise logging only after initialising the database in case we're + * logging to topics */ + if(mqtt3_log_init(&config)){ + rc = 1; + return rc; + } + _mosquitto_log_printf(NULL, MOSQ_LOG_INFO, "mosquitto version %s (build date %s) starting", VERSION, TIMESTAMP); + if(config.config_file){ + _mosquitto_log_printf(NULL, MOSQ_LOG_INFO, "Config loaded from %s.", config.config_file); + }else{ + _mosquitto_log_printf(NULL, MOSQ_LOG_INFO, "Using default config."); + } + + rc = mosquitto_security_module_init(&int_db); + if(rc) return rc; + rc = mosquitto_security_init(&int_db, false); + if(rc) return rc; + +#ifdef WITH_SYS_TREE + if(config.sys_interval > 0){ + /* Set static $SYS messages */ + snprintf(buf, 1024, "mosquitto version %s", VERSION); + mqtt3_db_messages_easy_queue(&int_db, NULL, "$SYS/broker/version", 2, strlen(buf), buf, 1); + snprintf(buf, 1024, "%s", TIMESTAMP); + mqtt3_db_messages_easy_queue(&int_db, NULL, "$SYS/broker/timestamp", 2, strlen(buf), buf, 1); + } +#endif + + listener_max = -1; + listensock_index = 0; + for(i=0; i listener_max){ + listener_max = listensock[listensock_index]; + } + listensock_index++; + } + }else if(config.listeners[i].protocol == mp_websockets){ +#ifdef WITH_WEBSOCKETS + config.listeners[i].ws_context = mosq_websockets_init(&config.listeners[i], config.websockets_log_level); + if(!config.listeners[i].ws_context){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Unable to create websockets listener on port %d.", config.listeners[i].port); + return 1; + } +#endif + } + } + + rc = drop_privileges(&config, false); + if(rc != MOSQ_ERR_SUCCESS) return rc; + + signal(SIGINT, handle_sigint); + signal(SIGTERM, handle_sigint); +#ifdef SIGHUP + signal(SIGHUP, handle_sighup); +#endif +#ifndef WIN32 + signal(SIGUSR1, handle_sigusr1); + signal(SIGUSR2, handle_sigusr2); + signal(SIGPIPE, SIG_IGN); +#endif + +#ifdef WITH_BRIDGE + for(i=0; ilistener_count; i++){ + if(int_db.config->listeners[i].ws_context){ + libwebsocket_context_destroy(int_db.config->listeners[i].ws_context); + } + if(int_db.config->listeners[i].ws_protocol){ + _mosquitto_free(int_db.config->listeners[i].ws_protocol); + } + } +#endif + + HASH_ITER(hh_id, int_db.contexts_by_id, ctxt, ctxt_tmp){ + mqtt3_context_send_will(&int_db, ctxt); + } + +#ifdef WITH_PERSISTENCE + if(config.persistence){ + mqtt3_db_backup(&int_db, true); + } +#endif + + HASH_ITER(hh_id, int_db.contexts_by_id, ctxt, ctxt_tmp){ +#ifdef WITH_WEBSOCKETS + if(!ctxt->wsi){ + mqtt3_context_cleanup(&int_db, ctxt, true); + } +#else + mqtt3_context_cleanup(&int_db, ctxt, true); +#endif + } + HASH_ITER(hh_sock, int_db.contexts_by_sock, ctxt, ctxt_tmp){ + mqtt3_context_cleanup(&int_db, ctxt, true); + } +#ifdef WITH_BRIDGE + for(i=0; i + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#ifndef MQTT3_H +#define MQTT3_H + +#include +#include + +#ifdef WITH_WEBSOCKETS +# include + +# if defined(LWS_LIBRARY_VERSION_NUMBER) +# define libwebsocket_callback_on_writable(A, B) lws_callback_on_writable((B)) +# define libwebsocket_service(A, B) lws_service((A), (B)) +# define libwebsocket_create_context(A) lws_create_context((A)) +# define libwebsocket_context_destroy(A) lws_context_destroy((A)) +# define libwebsocket_write(A, B, C, D) lws_write((A), (B), (C), (D)) +# define libwebsocket_get_socket_fd(A) lws_get_socket_fd((A)) +# define libwebsockets_return_http_status(A, B, C, D) lws_return_http_status((B), (C), (D)) +# define libwebsockets_get_protocol(A) lws_get_protocol((A)) + +# define libwebsocket_context lws_context +# define libwebsocket_protocols lws_protocols +# define libwebsocket_callback_reasons lws_callback_reasons +# define libwebsocket lws +# endif +#endif + +#include +#include +#include +#include "tls_mosq.h" +#include "uthash.h" + +#ifndef __GNUC__ +#define __attribute__(attrib) +#endif + +/* Log destinations */ +#define MQTT3_LOG_NONE 0x00 +#define MQTT3_LOG_SYSLOG 0x01 +#define MQTT3_LOG_FILE 0x02 +#define MQTT3_LOG_STDOUT 0x04 +#define MQTT3_LOG_STDERR 0x08 +#define MQTT3_LOG_TOPIC 0x10 +#define MQTT3_LOG_ALL 0xFF + +#define WEBSOCKET_CLIENT -2 + +enum mosquitto_protocol { + mp_mqtt, + mp_mqttsn, + mp_websockets +}; + +typedef uint64_t dbid_t; + +struct _mqtt3_listener { + int fd; + char *host; + uint16_t port; + int max_connections; + char *mount_point; + mosq_sock_t *socks; + int sock_count; + int client_count; + enum mosquitto_protocol protocol; + bool use_username_as_clientid; +#ifdef WITH_TLS + char *cafile; + char *capath; + char *certfile; + char *keyfile; + char *ciphers; + char *psk_hint; + bool require_certificate; + SSL_CTX *ssl_ctx; + char *crlfile; + bool use_identity_as_username; + char *tls_version; +#endif +#ifdef WITH_WEBSOCKETS + struct libwebsocket_context *ws_context; + char *http_dir; + struct libwebsocket_protocols *ws_protocol; +#endif +}; + +struct mqtt3_config { + char *config_file; + char *acl_file; + bool allow_anonymous; + bool allow_duplicate_messages; + bool allow_zero_length_clientid; + bool auth_plugin_deny_special_chars; + char *auto_id_prefix; + int auto_id_prefix_len; + int autosave_interval; + bool autosave_on_changes; + char *clientid_prefixes; + bool connection_messages; + bool daemon; + struct _mqtt3_listener default_listener; + struct _mqtt3_listener *listeners; + int listener_count; + int log_dest; + int log_facility; + int log_type; + bool log_timestamp; + char *log_file; + FILE *log_fptr; + uint32_t message_size_limit; + char *password_file; + bool persistence; + char *persistence_location; + char *persistence_file; + char *persistence_filepath; + time_t persistent_client_expiration; + char *pid_file; + char *psk_file; + bool queue_qos0_messages; + int retry_interval; + int sys_interval; + bool upgrade_outgoing_qos; + char *user; + bool verbose; +#ifdef WITH_WEBSOCKETS + int websockets_log_level; + bool have_websockets_listener; +#endif +#ifdef WITH_BRIDGE + struct _mqtt3_bridge *bridges; + int bridge_count; +#endif + char *auth_plugin; + struct mosquitto_auth_opt *auth_options; + int auth_option_count; +}; + +struct _mosquitto_subleaf { + struct _mosquitto_subleaf *prev; + struct _mosquitto_subleaf *next; + struct mosquitto *context; + int qos; +}; + +struct _mosquitto_subhier { + struct _mosquitto_subhier *parent; + struct _mosquitto_subhier *children; + struct _mosquitto_subhier *next; + struct _mosquitto_subleaf *subs; + char *topic; + struct mosquitto_msg_store *retained; +}; + +struct mosquitto_msg_store_load{ + UT_hash_handle hh; + dbid_t db_id; + struct mosquitto_msg_store *store; +}; + +struct mosquitto_msg_store{ + struct mosquitto_msg_store *next; + struct mosquitto_msg_store *prev; + dbid_t db_id; + char *source_id; + char **dest_ids; + int dest_id_count; + int ref_count; + char *topic; + void *payload; + uint32_t payloadlen; + uint16_t source_mid; + uint16_t mid; + uint8_t qos; + bool retain; +}; + +struct mosquitto_client_msg{ + struct mosquitto_client_msg *next; + struct mosquitto_msg_store *store; + time_t timestamp; + uint16_t mid; + uint8_t qos; + bool retain; + enum mosquitto_msg_direction direction; + enum mosquitto_msg_state state; + bool dup; +}; + +struct _mosquitto_unpwd{ + char *username; + char *password; +#ifdef WITH_TLS + unsigned int password_len; + unsigned int salt_len; + unsigned char *salt; +#endif + UT_hash_handle hh; +}; + +struct _mosquitto_acl{ + struct _mosquitto_acl *next; + char *topic; + int access; + int ucount; + int ccount; +}; + +struct _mosquitto_acl_user{ + struct _mosquitto_acl_user *next; + char *username; + struct _mosquitto_acl *acl; +}; + +struct _mosquitto_auth_plugin{ + void *lib; + void *user_data; + int (*plugin_version)(void); + int (*plugin_init)(void **user_data, struct mosquitto_auth_opt *auth_opts, int auth_opt_count); + int (*plugin_cleanup)(void *user_data, struct mosquitto_auth_opt *auth_opts, int auth_opt_count); + int (*security_init)(void *user_data, struct mosquitto_auth_opt *auth_opts, int auth_opt_count, bool reload); + int (*security_cleanup)(void *user_data, struct mosquitto_auth_opt *auth_opts, int auth_opt_count, bool reload); + int (*acl_check)(void *user_data, const char *clientid, const char *username, const char *topic, int access); + int (*unpwd_check)(void *user_data, const char *username, const char *password); + int (*psk_key_get)(void *user_data, const char *hint, const char *identity, char *key, int max_key_len); +}; + +struct mosquitto_db{ + dbid_t last_db_id; + struct _mosquitto_subhier subs; + struct _mosquitto_unpwd *unpwd; + struct _mosquitto_acl_user *acl_list; + struct _mosquitto_acl *acl_patterns; + struct _mosquitto_unpwd *psk_id; + struct mosquitto *contexts_by_id; + struct mosquitto *contexts_by_sock; + struct mosquitto *contexts_for_free; +#ifdef WITH_BRIDGE + struct mosquitto **bridges; +#endif + struct _clientid_index_hash *clientid_index_hash; + struct mosquitto_msg_store *msg_store; + struct mosquitto_msg_store_load *msg_store_load; +#ifdef WITH_BRIDGE + int bridge_count; +#endif + int msg_store_count; + struct mqtt3_config *config; + int persistence_changes; + struct _mosquitto_auth_plugin auth_plugin; +#ifdef WITH_SYS_TREE + int subscription_count; + int retained_count; +#endif + struct mosquitto *ll_for_free; +}; + +enum mqtt3_bridge_direction{ + bd_out = 0, + bd_in = 1, + bd_both = 2 +}; + +enum mosquitto_bridge_start_type{ + bst_automatic = 0, + bst_lazy = 1, + bst_manual = 2, + bst_once = 3 +}; + +struct _mqtt3_bridge_topic{ + char *topic; + int qos; + enum mqtt3_bridge_direction direction; + char *local_prefix; + char *remote_prefix; + char *local_topic; /* topic prefixed with local_prefix */ + char *remote_topic; /* topic prefixed with remote_prefix */ +}; + +struct bridge_address{ + char *address; + int port; +}; + +struct _mqtt3_bridge{ + char *name; + struct bridge_address *addresses; + int cur_address; + int address_count; + time_t primary_retry; + bool round_robin; + bool try_private; + bool try_private_accepted; + bool clean_session; + int keepalive; + struct _mqtt3_bridge_topic *topics; + int topic_count; + bool topic_remapping; + enum _mosquitto_protocol protocol_version; + time_t restart_t; + char *remote_clientid; + char *remote_username; + char *remote_password; + char *local_clientid; + char *local_username; + char *local_password; + bool notifications; + char *notification_topic; + enum mosquitto_bridge_start_type start_type; + int idle_timeout; + int restart_timeout; + int threshold; + bool lazy_reconnect; + bool attempt_unsubscribe; + bool initial_notification_done; +#ifdef WITH_TLS + char *tls_cafile; + char *tls_capath; + char *tls_certfile; + char *tls_keyfile; + bool tls_insecure; + char *tls_version; +# ifdef REAL_WITH_TLS_PSK + char *tls_psk_identity; + char *tls_psk; +# endif +#endif +}; + +#ifdef WITH_WEBSOCKETS +struct libws_mqtt_hack { + char *http_dir; +}; + +struct libws_mqtt_data { + struct mosquitto *mosq; +}; +#endif + +#include + +/* ============================================================ + * Main functions + * ============================================================ */ +int mosquitto_main_loop(struct mosquitto_db *db, mosq_sock_t *listensock, int listensock_count, int listener_max); +struct mosquitto_db *_mosquitto_get_db(void); + +/* ============================================================ + * Config functions + * ============================================================ */ +/* Initialise config struct to default values. */ +void mqtt3_config_init(struct mqtt3_config *config); +/* Parse command line options into config. */ +int mqtt3_config_parse_args(struct mqtt3_config *config, int argc, char *argv[]); +/* Read configuration data from config->config_file into config. + * If reload is true, don't process config options that shouldn't be reloaded (listeners etc) + * Returns 0 on success, 1 if there is a configuration error or if a file cannot be opened. + */ +int mqtt3_config_read(struct mqtt3_config *config, bool reload); +/* Free all config data. */ +void mqtt3_config_cleanup(struct mqtt3_config *config); + +int drop_privileges(struct mqtt3_config *config, bool temporary); +int restore_privileges(void); + +/* ============================================================ + * Server send functions + * ============================================================ */ +int _mosquitto_send_connack(struct mosquitto *context, int ack, int result); +int _mosquitto_send_suback(struct mosquitto *context, uint16_t mid, uint32_t payloadlen, const void *payload); + +/* ============================================================ + * Network functions + * ============================================================ */ +int mqtt3_socket_accept(struct mosquitto_db *db, mosq_sock_t listensock); +int mqtt3_socket_listen(struct _mqtt3_listener *listener); +int _mosquitto_socket_get_address(mosq_sock_t sock, char *buf, int len); + +/* ============================================================ + * Read handling functions + * ============================================================ */ +int mqtt3_packet_handle(struct mosquitto_db *db, struct mosquitto *context); +int mqtt3_handle_connack(struct mosquitto_db *db, struct mosquitto *context); +int mqtt3_handle_connect(struct mosquitto_db *db, struct mosquitto *context); +int mqtt3_handle_disconnect(struct mosquitto_db *db, struct mosquitto *context); +int mqtt3_handle_publish(struct mosquitto_db *db, struct mosquitto *context); +int mqtt3_handle_subscribe(struct mosquitto_db *db, struct mosquitto *context); +int mqtt3_handle_unsubscribe(struct mosquitto_db *db, struct mosquitto *context); + +/* ============================================================ + * Database handling + * ============================================================ */ +int mqtt3_db_open(struct mqtt3_config *config, struct mosquitto_db *db); +int mqtt3_db_close(struct mosquitto_db *db); +#ifdef WITH_PERSISTENCE +int mqtt3_db_backup(struct mosquitto_db *db, bool shutdown); +int mqtt3_db_restore(struct mosquitto_db *db); +#endif +void mqtt3_db_limits_set(int inflight, int queued); +/* Return the number of in-flight messages in count. */ +int mqtt3_db_message_count(int *count); +int mqtt3_db_message_delete(struct mosquitto_db *db, struct mosquitto *context, uint16_t mid, enum mosquitto_msg_direction dir); +int mqtt3_db_message_insert(struct mosquitto_db *db, struct mosquitto *context, uint16_t mid, enum mosquitto_msg_direction dir, int qos, bool retain, struct mosquitto_msg_store *stored); +int mqtt3_db_message_release(struct mosquitto_db *db, struct mosquitto *context, uint16_t mid, enum mosquitto_msg_direction dir); +int mqtt3_db_message_update(struct mosquitto *context, uint16_t mid, enum mosquitto_msg_direction dir, enum mosquitto_msg_state state); +int mqtt3_db_message_write(struct mosquitto_db *db, struct mosquitto *context); +int mqtt3_db_messages_delete(struct mosquitto_db *db, struct mosquitto *context); +int mqtt3_db_messages_easy_queue(struct mosquitto_db *db, struct mosquitto *context, const char *topic, int qos, uint32_t payloadlen, const void *payload, int retain); +int mqtt3_db_messages_queue(struct mosquitto_db *db, const char *source_id, const char *topic, int qos, int retain, struct mosquitto_msg_store **stored); +int mqtt3_db_message_store(struct mosquitto_db *db, const char *source, uint16_t source_mid, const char *topic, int qos, uint32_t payloadlen, const void *payload, int retain, struct mosquitto_msg_store **stored, dbid_t store_id); +int mqtt3_db_message_store_find(struct mosquitto *context, uint16_t mid, struct mosquitto_msg_store **stored); +void mosquitto__db_msg_store_add(struct mosquitto_db *db, struct mosquitto_msg_store *store); +void mosquitto__db_msg_store_remove(struct mosquitto_db *db, struct mosquitto_msg_store *store); +void mosquitto__db_msg_store_deref(struct mosquitto_db *db, struct mosquitto_msg_store **store); +void mosquitto__db_msg_store_clean(struct mosquitto_db *db); +/* Check all messages waiting on a client reply and resend if timeout has been exceeded. */ +int mqtt3_db_message_timeout_check(struct mosquitto_db *db, unsigned int timeout); +int mqtt3_db_message_reconnect_reset(struct mosquitto_db *db, struct mosquitto *context); +int mqtt3_retain_queue(struct mosquitto_db *db, struct mosquitto *context, const char *sub, int sub_qos); +void mqtt3_db_sys_update(struct mosquitto_db *db, int interval, time_t start_time); +void mqtt3_db_vacuum(void); + +/* ============================================================ + * Subscription functions + * ============================================================ */ +int mqtt3_sub_add(struct mosquitto_db *db, struct mosquitto *context, const char *sub, int qos, struct _mosquitto_subhier *root); +int mqtt3_sub_remove(struct mosquitto_db *db, struct mosquitto *context, const char *sub, struct _mosquitto_subhier *root); +int mqtt3_sub_search(struct mosquitto_db *db, struct _mosquitto_subhier *root, const char *source_id, const char *topic, int qos, int retain, struct mosquitto_msg_store *stored); +void mqtt3_sub_tree_print(struct _mosquitto_subhier *root, int level); +int mqtt3_subs_clean_session(struct mosquitto_db *db, struct mosquitto *context); + +/* ============================================================ + * Context functions + * ============================================================ */ +struct mosquitto *mqtt3_context_init(struct mosquitto_db *db, mosq_sock_t sock); +void mqtt3_context_cleanup(struct mosquitto_db *db, struct mosquitto *context, bool do_free); +void mqtt3_context_disconnect(struct mosquitto_db *db, struct mosquitto *context); +void mosquitto__add_context_to_disused(struct mosquitto_db *db, struct mosquitto *context); +void mosquitto__free_disused_contexts(struct mosquitto_db *db); +void mqtt3_context_send_will(struct mosquitto_db *db, struct mosquitto *context); + +/* ============================================================ + * Logging functions + * ============================================================ */ +int mqtt3_log_init(struct mqtt3_config *config); +int mqtt3_log_close(struct mqtt3_config *config); +int _mosquitto_log_printf(struct mosquitto *mosq, int level, const char *fmt, ...) __attribute__((format(printf, 3, 4))); + +/* ============================================================ + * Bridge functions + * ============================================================ */ +#ifdef WITH_BRIDGE +int mqtt3_bridge_new(struct mosquitto_db *db, struct _mqtt3_bridge *bridge); +int mqtt3_bridge_connect(struct mosquitto_db *db, struct mosquitto *context); +int mqtt3_bridge_connect_step1(struct mosquitto_db *db, struct mosquitto *context); +int mqtt3_bridge_connect_step2(struct mosquitto_db *db, struct mosquitto *context); +void mqtt3_bridge_packet_cleanup(struct mosquitto *context); +#endif + +/* ============================================================ + * Security related functions + * ============================================================ */ +int mosquitto_security_module_init(struct mosquitto_db *db); +int mosquitto_security_module_cleanup(struct mosquitto_db *db); + +int mosquitto_security_init(struct mosquitto_db *db, bool reload); +int mosquitto_security_apply(struct mosquitto_db *db); +int mosquitto_security_cleanup(struct mosquitto_db *db, bool reload); +int mosquitto_acl_check(struct mosquitto_db *db, struct mosquitto *context, const char *topic, int access); +int mosquitto_unpwd_check(struct mosquitto_db *db, const char *username, const char *password); +int mosquitto_psk_key_get(struct mosquitto_db *db, const char *hint, const char *identity, char *key, int max_key_len); + +int mosquitto_security_init_default(struct mosquitto_db *db, bool reload); +int mosquitto_security_apply_default(struct mosquitto_db *db); +int mosquitto_security_cleanup_default(struct mosquitto_db *db, bool reload); +int mosquitto_acl_check_default(struct mosquitto_db *db, struct mosquitto *context, const char *topic, int access); +int mosquitto_unpwd_check_default(struct mosquitto_db *db, const char *username, const char *password); +int mosquitto_psk_key_get_default(struct mosquitto_db *db, const char *hint, const char *identity, char *key, int max_key_len); + +/* ============================================================ + * Window service related functions + * ============================================================ */ +#if defined(WIN32) || defined(__CYGWIN__) +void service_install(void); +void service_uninstall(void); +void service_run(void); +#endif + +/* ============================================================ + * Websockets related functions + * ============================================================ */ +#ifdef WITH_WEBSOCKETS +# if defined(LWS_LIBRARY_VERSION_NUMBER) +struct lws_context *mosq_websockets_init(struct _mqtt3_listener *listener, int log_level); +# else +struct libwebsocket_context *mosq_websockets_init(struct _mqtt3_listener *listener, int log_level); +# endif +#endif +void do_disconnect(struct mosquitto_db *db, struct mosquitto *context); + +#endif diff --git a/src/libs/mosquitto/src/mosquitto_passwd.c b/src/libs/mosquitto/src/mosquitto_passwd.c new file mode 100644 index 0000000..c3dd05a --- /dev/null +++ b/src/libs/mosquitto/src/mosquitto_passwd.c @@ -0,0 +1,513 @@ +/* +Copyright (c) 2012-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + + +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef WIN32 +# include +# ifndef __cplusplus +# define bool char +# define true 1 +# define false 0 +# endif +# define snprintf sprintf_s +# include +#else +# include +# include +# include +#endif + +#define MAX_BUFFER_LEN 1024 +#define SALT_LEN 12 + +int base64_encode(unsigned char *in, unsigned int in_len, char **encoded) +{ + BIO *bmem, *b64; + BUF_MEM *bptr; + + b64 = BIO_new(BIO_f_base64()); + BIO_set_flags(b64, BIO_FLAGS_BASE64_NO_NL); + bmem = BIO_new(BIO_s_mem()); + b64 = BIO_push(b64, bmem); + BIO_write(b64, in, in_len); + if(BIO_flush(b64) != 1){ + BIO_free_all(b64); + return 1; + } + BIO_get_mem_ptr(b64, &bptr); + *encoded = malloc(bptr->length+1); + if(!(*encoded)){ + BIO_free_all(b64); + return 1; + } + memcpy(*encoded, bptr->data, bptr->length); + (*encoded)[bptr->length] = '\0'; + BIO_free_all(b64); + + return 0; +} + + +void print_usage(void) +{ + printf("mosquitto_passwd is a tool for managing password files for mosquitto.\n\n"); + printf("Usage: mosquitto_passwd [-c | -D] passwordfile username\n"); + printf(" mosquitto_passwd -b passwordfile username password\n"); + printf(" mosquitto_passwd -U passwordfile\n"); + printf(" -b : run in batch mode to allow passing passwords on the command line.\n"); + printf(" -c : create a new password file. This will overwrite existing files.\n"); + printf(" -D : delete the username rather than adding/updating its password.\n"); + printf(" -U : update a plain text password file to use hashed passwords.\n"); + printf("\nSee http://mosquitto.org/ for more information.\n\n"); +} + +int output_new_password(FILE *fptr, const char *username, const char *password) +{ + int rc; + unsigned char salt[SALT_LEN]; + char *salt64 = NULL, *hash64 = NULL; + unsigned char hash[EVP_MAX_MD_SIZE]; + unsigned int hash_len; + const EVP_MD *digest; +#if OPENSSL_VERSION_NUMBER < 0x10100000L + EVP_MD_CTX context; +#else + EVP_MD_CTX *context; +#endif + + rc = RAND_bytes(salt, SALT_LEN); + if(!rc){ + fprintf(stderr, "Error: Insufficient entropy available to perform password generation.\n"); + return 1; + } + + rc = base64_encode(salt, SALT_LEN, &salt64); + if(rc){ + if(salt64) free(salt64); + fprintf(stderr, "Error: Unable to encode salt.\n"); + return 1; + } + + + digest = EVP_get_digestbyname("sha512"); + if(!digest){ + if(salt64) free(salt64); + fprintf(stderr, "Error: Unable to create openssl digest.\n"); + return 1; + } + +#if OPENSSL_VERSION_NUMBER < 0x10100000L + EVP_MD_CTX_init(&context); + EVP_DigestInit_ex(&context, digest, NULL); + EVP_DigestUpdate(&context, password, strlen(password)); + EVP_DigestUpdate(&context, salt, SALT_LEN); + EVP_DigestFinal_ex(&context, hash, &hash_len); + EVP_MD_CTX_cleanup(&context); +#else + context = EVP_MD_CTX_new(); + EVP_DigestInit_ex(context, digest, NULL); + EVP_DigestUpdate(context, password, strlen(password)); + EVP_DigestUpdate(context, salt, SALT_LEN); + EVP_DigestFinal_ex(context, hash, &hash_len); + EVP_MD_CTX_free(context); +#endif + + rc = base64_encode(hash, hash_len, &hash64); + if(rc){ + if(salt64) free(salt64); + if(hash64) free(hash64); + fprintf(stderr, "Error: Unable to encode hash.\n"); + return 1; + } + + fprintf(fptr, "%s:$6$%s$%s\n", username, salt64, hash64); + free(salt64); + free(hash64); + + return 0; +} + +int delete_pwuser(FILE *fptr, FILE *ftmp, const char *username) +{ + char buf[MAX_BUFFER_LEN]; + char lbuf[MAX_BUFFER_LEN], *token; + bool found = false; + + while(!feof(fptr) && fgets(buf, MAX_BUFFER_LEN, fptr)){ + memcpy(lbuf, buf, MAX_BUFFER_LEN); + token = strtok(lbuf, ":"); + if(strcmp(username, token)){ + fprintf(ftmp, "%s", buf); + }else{ + found = true; + } + } + if(!found){ + fprintf(stderr, "Warning: User %s not found in password file.\n", username); + } + return 0; +} + +int update_file(FILE *fptr, FILE *ftmp) +{ + char buf[MAX_BUFFER_LEN]; + char lbuf[MAX_BUFFER_LEN]; + char *username, *password; + int rc; + int len; + + while(!feof(fptr) && fgets(buf, MAX_BUFFER_LEN, fptr)){ + memcpy(lbuf, buf, MAX_BUFFER_LEN); + username = strtok(lbuf, ":"); + password = strtok(NULL, ":"); + if(password){ + len = strlen(password); + while(len && (password[len-1] == '\n' || password[len-1] == '\r')){ + password[len-1] = '\0'; + len = strlen(password); + } + rc = output_new_password(ftmp, username, password); + if(rc) return rc; + }else{ + fprintf(ftmp, "%s", username); + } + } + return 0; +} + +int update_pwuser(FILE *fptr, FILE *ftmp, const char *username, const char *password) +{ + char buf[MAX_BUFFER_LEN]; + char lbuf[MAX_BUFFER_LEN], *token; + bool found = false; + int rc = 1; + + while(!feof(fptr) && fgets(buf, MAX_BUFFER_LEN, fptr)){ + memcpy(lbuf, buf, MAX_BUFFER_LEN); + token = strtok(lbuf, ":"); + if(strcmp(username, token)){ + fprintf(ftmp, "%s", buf); + }else{ + rc = output_new_password(ftmp, username, password); + found = true; + } + } + if(found){ + return rc; + }else{ + return output_new_password(ftmp, username, password); + } +} + +int gets_quiet(char *s, int len) +{ +#ifdef WIN32 + HANDLE h; + DWORD con_orig, con_quiet; + DWORD read_len = 0; + + memset(s, 0, len); + h = GetStdHandle(STD_INPUT_HANDLE); + GetConsoleMode(h, &con_orig); + con_quiet = con_orig; + con_quiet &= ~ENABLE_ECHO_INPUT; + con_quiet |= ENABLE_LINE_INPUT; + SetConsoleMode(h, con_quiet); + if(!ReadConsole(h, s, len, &read_len, NULL)){ + SetConsoleMode(h, con_orig); + return 1; + } + while(s[strlen(s)-1] == 10 || s[strlen(s)-1] == 13){ + s[strlen(s)-1] = 0; + } + if(strlen(s) == 0){ + return 1; + } + SetConsoleMode(h, con_orig); + + return 0; +#else + struct termios ts_quiet, ts_orig; + char *rs; + + memset(s, 0, len); + tcgetattr(0, &ts_orig); + ts_quiet = ts_orig; + ts_quiet.c_lflag &= ~(ECHO | ICANON); + tcsetattr(0, TCSANOW, &ts_quiet); + + rs = fgets(s, len, stdin); + tcsetattr(0, TCSANOW, &ts_orig); + + if(!rs){ + return 1; + }else{ + while(s[strlen(s)-1] == 10 || s[strlen(s)-1] == 13){ + s[strlen(s)-1] = 0; + } + if(strlen(s) == 0){ + return 1; + } + } + return 0; +#endif +} + +int get_password(char *password, int len) +{ + char pw1[MAX_BUFFER_LEN], pw2[MAX_BUFFER_LEN]; + + printf("Password: "); + if(gets_quiet(pw1, MAX_BUFFER_LEN)){ + fprintf(stderr, "Error: Empty password.\n"); + return 1; + } + printf("\n"); + + printf("Reenter password: "); + if(gets_quiet(pw2, MAX_BUFFER_LEN)){ + fprintf(stderr, "Error: Empty password.\n"); + return 1; + } + printf("\n"); + + if(strcmp(pw1, pw2)){ + fprintf(stderr, "Error: Passwords do not match.\n"); + return 1; + } + + strncpy(password, pw1, len); + return 0; +} + +int copy_contents(FILE *src, FILE *dest) +{ + char buf[MAX_BUFFER_LEN]; + int len; + + rewind(src); + rewind(dest); + +#ifdef WIN32 + _chsize(fileno(dest), 0); +#else + if(ftruncate(fileno(dest), 0)) return 1; +#endif + + while(!feof(src)){ + len = fread(buf, 1, MAX_BUFFER_LEN, src); + if(len > 0){ + if(fwrite(buf, 1, len, dest) != len){ + return 1; + } + }else{ + return !feof(src); + } + } + return 0; +} + +int create_backup(const char *backup_file, FILE *fptr) +{ + FILE *fbackup; + + fbackup = fopen(backup_file, "wt"); + if(!fbackup){ + fprintf(stderr, "Error creating backup password file \"%s\", not continuing.\n", backup_file); + return 1; + } + if(copy_contents(fptr, fbackup)){ + fprintf(stderr, "Error copying data to backup password file \"%s\", not continuing.\n", backup_file); + fclose(fbackup); + return 1; + } + fclose(fbackup); + rewind(fptr); + return 0; +} +void handle_sigint(int signal) +{ +#ifndef WIN32 + struct termios ts; + + tcgetattr(0, &ts); + ts.c_lflag |= ECHO | ICANON; + tcsetattr(0, TCSANOW, &ts); +#endif + exit(0); +} + +int main(int argc, char *argv[]) +{ + char *password_file_tmp = NULL; + char password_file[1024]; + char *username = NULL; + char *password_cmd = NULL; + bool batch_mode = false; + bool create_new = false; + bool delete_user = false; + FILE *fptr, *ftmp; + char password[MAX_BUFFER_LEN]; + int rc; + bool do_update_file = false; + char *backup_file; + + signal(SIGINT, handle_sigint); + signal(SIGTERM, handle_sigint); + + OpenSSL_add_all_digests(); + + if(argc == 1){ + print_usage(); + return 1; + } + + if(!strcmp(argv[1], "-c")){ + create_new = true; + if(argc != 4){ + fprintf(stderr, "Error: -c argument given but password file or username missing.\n"); + return 1; + }else{ + password_file_tmp = argv[2]; + username = argv[3]; + } + }else if(!strcmp(argv[1], "-D")){ + delete_user = true; + if(argc != 4){ + fprintf(stderr, "Error: -D argument given but password file or username missing.\n"); + return 1; + }else{ + password_file_tmp = argv[2]; + username = argv[3]; + } + }else if(!strcmp(argv[1], "-b")){ + batch_mode = true; + if(argc != 5){ + fprintf(stderr, "Error: -b argument given but password file, username or password missing.\n"); + return 1; + }else{ + password_file_tmp = argv[2]; + username = argv[3]; + password_cmd = argv[4]; + } + }else if(!strcmp(argv[1], "-U")){ + if(argc != 3){ + fprintf(stderr, "Error: -U argument given but password file missing.\n"); + return 1; + }else{ + do_update_file = true; + password_file_tmp = argv[2]; + } + }else if(argc == 3){ + password_file_tmp = argv[1]; + username = argv[2]; + }else{ + print_usage(); + return 1; + } + + snprintf(password_file, 1024, "%s", password_file_tmp); + + if(create_new){ + rc = get_password(password, 1024); + if(rc) return rc; + fptr = fopen(password_file, "wt"); + if(!fptr){ + fprintf(stderr, "Error: Unable to open file %s for writing. %s.\n", password_file, strerror(errno)); + return 1; + } + rc = output_new_password(fptr, username, password); + fclose(fptr); + return rc; + }else{ + fptr = fopen(password_file, "r+t"); + if(!fptr){ + fprintf(stderr, "Error: Unable to open password file %s. %s.\n", password_file, strerror(errno)); + return 1; + } + + backup_file = malloc(strlen(password_file)+5); + snprintf(backup_file, strlen(password_file)+5, "%s.tmp", password_file); + + if(create_backup(backup_file, fptr)){ + fclose(fptr); + free(backup_file); + return 1; + } + + ftmp = tmpfile(); + if(!ftmp){ + fprintf(stderr, "Error: Unable to open temporary file. %s.\n", strerror(errno)); + fclose(fptr); + free(backup_file); + return 1; + } + if(delete_user){ + rc = delete_pwuser(fptr, ftmp, username); + }else if(do_update_file){ + rc = update_file(fptr, ftmp); + }else{ + if(batch_mode){ + /* Update password for individual user */ + rc = update_pwuser(fptr, ftmp, username, password_cmd); + }else{ + rc = get_password(password, 1024); + if(rc){ + fclose(fptr); + fclose(ftmp); + unlink(backup_file); + free(backup_file); + return rc; + } + /* Update password for individual user */ + rc = update_pwuser(fptr, ftmp, username, password); + } + } + if(rc){ + fclose(fptr); + fclose(ftmp); + unlink(backup_file); + free(backup_file); + return rc; + } + + if(copy_contents(ftmp, fptr)){ + fclose(fptr); + fclose(ftmp); + fprintf(stderr, "Error occurred updating password file.\n"); + fprintf(stderr, "Password file may be corrupt, check the backup file: %s.\n", backup_file); + free(backup_file); + return 1; + } + fclose(fptr); + fclose(ftmp); + + /* Everything was ok so backup no longer needed. May contain old + * passwords so shouldn't be kept around. */ + unlink(backup_file); + free(backup_file); + } + + return 0; +} diff --git a/src/libs/mosquitto/src/mosquitto_plugin.h b/src/libs/mosquitto/src/mosquitto_plugin.h new file mode 100644 index 0000000..5b6449c --- /dev/null +++ b/src/libs/mosquitto/src/mosquitto_plugin.h @@ -0,0 +1,228 @@ +/* +Copyright (c) 2012-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#ifndef MOSQUITTO_PLUGIN_H +#define MOSQUITTO_PLUGIN_H + +#define MOSQ_AUTH_PLUGIN_VERSION 2 + +#define MOSQ_ACL_NONE 0x00 +#define MOSQ_ACL_READ 0x01 +#define MOSQ_ACL_WRITE 0x02 + +struct mosquitto_auth_opt { + char *key; + char *value; +}; + +/* + * To create an authentication plugin you must include this file then implement + * the functions listed below. The resulting code should then be compiled as a + * shared library. Using gcc this can be achieved as follows: + * + * gcc -I -fPIC -shared plugin.c -o plugin.so + * + * On Mac OS X: + * + * gcc -I -fPIC -shared plugin.c -undefined dynamic_lookup -o plugin.so + * + */ + +/* ========================================================================= + * + * Utility Functions + * + * Use these functions from within your plugin. + * + * There are also very useful functions in libmosquitto. + * + * ========================================================================= */ + +/* + * Function: mosquitto_log_printf + * + * Write a log message using the broker configured logging. + * + * Parameters: + * level - Log message priority. Can currently be one of: + * + * MOSQ_LOG_INFO + * MOSQ_LOG_NOTICE + * MOSQ_LOG_WARNING + * MOSQ_LOG_ERR + * MOSQ_LOG_DEBUG + * MOSQ_LOG_SUBSCRIBE (not recommended for use by plugins) + * MOSQ_LOG_UNSUBSCRIBE (not recommended for use by plugins) + * + * These values are defined in mosquitto.h. + * + * fmt, ... - printf style format and arguments. + */ +void mosquitto_log_printf(int level, const char *fmt, ...); + + + +/* ========================================================================= + * + * Plugin Functions + * + * You must implement these functions in your plugin. + * + * ========================================================================= */ + +/* + * Function: mosquitto_auth_plugin_version + * + * The broker will call this function immediately after loading the plugin to + * check it is a supported plugin version. Your code must simply return + * MOSQ_AUTH_PLUGIN_VERSION. + */ +int mosquitto_auth_plugin_version(void); + +/* + * Function: mosquitto_auth_plugin_init + * + * Called after the plugin has been loaded and + * has been called. This will only ever be called once and can be used to + * initialise the plugin. + * + * Parameters: + * + * user_data : The pointer set here will be passed to the other plugin + * functions. Use to hold connection information for example. + * auth_opts : Pointer to an array of struct mosquitto_auth_opt, which + * provides the plugin options defined in the configuration file. + * auth_opt_count : The number of elements in the auth_opts array. + * + * Return value: + * Return 0 on success + * Return >0 on failure. + */ +int mosquitto_auth_plugin_init(void **user_data, struct mosquitto_auth_opt *auth_opts, int auth_opt_count); + +/* + * Function: mosquitto_auth_plugin_cleanup + * + * Called when the broker is shutting down. This will only ever be called once. + * Note that will be called directly before + * this function. + * + * Parameters: + * + * user_data : The pointer provided in . + * auth_opts : Pointer to an array of struct mosquitto_auth_opt, which + * provides the plugin options defined in the configuration file. + * auth_opt_count : The number of elements in the auth_opts array. + * + * Return value: + * Return 0 on success + * Return >0 on failure. + */ +int mosquitto_auth_plugin_cleanup(void *user_data, struct mosquitto_auth_opt *auth_opts, int auth_opt_count); + +/* + * Function: mosquitto_auth_security_init + * + * Called when the broker initialises the security functions when it starts up. + * If the broker is requested to reload its configuration whilst running, + * will be called, followed by this function. + * In this situation, the reload parameter will be true. + * + * Parameters: + * + * user_data : The pointer provided in . + * auth_opts : Pointer to an array of struct mosquitto_auth_opt, which + * provides the plugin options defined in the configuration file. + * auth_opt_count : The number of elements in the auth_opts array. + * reload : If set to false, this is the first time the function has + * been called. If true, the broker has received a signal + * asking to reload its configuration. + * + * Return value: + * Return 0 on success + * Return >0 on failure. + */ +int mosquitto_auth_security_init(void *user_data, struct mosquitto_auth_opt *auth_opts, int auth_opt_count, bool reload); + +/* + * Function: mosquitto_auth_security_cleanup + * + * Called when the broker cleans up the security functions when it shuts down. + * If the broker is requested to reload its configuration whilst running, + * this function will be called, followed by . + * In this situation, the reload parameter will be true. + * + * Parameters: + * + * user_data : The pointer provided in . + * auth_opts : Pointer to an array of struct mosquitto_auth_opt, which + * provides the plugin options defined in the configuration file. + * auth_opt_count : The number of elements in the auth_opts array. + * reload : If set to false, this is the first time the function has + * been called. If true, the broker has received a signal + * asking to reload its configuration. + * + * Return value: + * Return 0 on success + * Return >0 on failure. + */ +int mosquitto_auth_security_cleanup(void *user_data, struct mosquitto_auth_opt *auth_opts, int auth_opt_count, bool reload); + +/* + * Function: mosquitto_auth_acl_check + * + * Called by the broker when topic access must be checked. access will be one + * of MOSQ_ACL_READ (for subscriptions) or MOSQ_ACL_WRITE (for publish). Return + * MOSQ_ERR_SUCCESS if access was granted, MOSQ_ERR_ACL_DENIED if access was + * not granted, or MOSQ_ERR_UNKNOWN for an application specific error. + */ +int mosquitto_auth_acl_check(void *user_data, const char *clientid, const char *username, const char *topic, int access); + +/* + * Function: mosquitto_auth_unpwd_check + * + * Called by the broker when a username/password must be checked. Return + * MOSQ_ERR_SUCCESS if the user is authenticated, MOSQ_ERR_AUTH if + * authentication failed, or MOSQ_ERR_UNKNOWN for an application specific + * error. + */ +int mosquitto_auth_unpwd_check(void *user_data, const char *username, const char *password); + +/* + * Function: mosquitto_psk_key_get + * + * Called by the broker when a client connects to a listener using TLS/PSK. + * This is used to retrieve the pre-shared-key associated with a client + * identity. + * + * Examine hint and identity to determine the required PSK (which must be a + * hexadecimal string with no leading "0x") and copy this string into key. + * + * Parameters: + * user_data : the pointer provided in . + * hint : the psk_hint for the listener the client is connecting to. + * identity : the identity string provided by the client + * key : a string where the hex PSK should be copied + * max_key_len : the size of key + * + * Return value: + * Return 0 on success. + * Return >0 on failure. + * Return >0 if this function is not required. + */ +int mosquitto_auth_psk_key_get(void *user_data, const char *hint, const char *identity, char *key, int max_key_len); + +#endif diff --git a/src/libs/mosquitto/src/net.c b/src/libs/mosquitto/src/net.c new file mode 100644 index 0000000..b8a03dc --- /dev/null +++ b/src/libs/mosquitto/src/net.c @@ -0,0 +1,532 @@ +/* +Copyright (c) 2009-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include + +#ifndef WIN32 +#include +#include +#include +#include +#else +#include +#include +#endif + +#include +#include +#include +#include +#include +#ifdef WITH_WRAP +#include +#endif + +#ifdef __FreeBSD__ +# include +# include +#endif + +#ifdef __QNX__ +#include +#include +#include +#endif + +#include +#include +#include +#include +#include + +#ifdef WITH_TLS +#include "tls_mosq.h" +#include +static int tls_ex_index_context = -1; +static int tls_ex_index_listener = -1; +#endif + +#ifdef WITH_SYS_TREE +extern unsigned int g_socket_connections; +#endif + + +static void net__print_error(int log, const char *format_str) +{ +#ifdef WIN32 + char *buf; + + FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, + NULL, WSAGetLastError(), LANG_NEUTRAL, &buf, 0, NULL); + + _mosquitto_log_printf(NULL, log, format_str, buf); + LocalFree(buf); +#else + char buf[256]; + + strerror_r(errno, buf, 256); + _mosquitto_log_printf(NULL, log, format_str, buf); +#endif +} + + +int mqtt3_socket_accept(struct mosquitto_db *db, mosq_sock_t listensock) +{ + int i; + int j; + mosq_sock_t new_sock = INVALID_SOCKET; + struct mosquitto *new_context; +#ifdef WITH_TLS + BIO *bio; + int rc; + char ebuf[256]; + unsigned long e; +#endif +#ifdef WITH_WRAP + struct request_info wrap_req; + char address[1024]; +#endif + + new_sock = accept(listensock, NULL, 0); + if(new_sock == INVALID_SOCKET) return -1; + +#ifdef WITH_SYS_TREE + g_socket_connections++; +#endif + + if(_mosquitto_socket_nonblock(new_sock)){ + return INVALID_SOCKET; + } + +#ifdef WITH_WRAP + /* Use tcpd / libwrap to determine whether a connection is allowed. */ + request_init(&wrap_req, RQ_FILE, new_sock, RQ_DAEMON, "mosquitto", 0); + fromhost(&wrap_req); + if(!hosts_access(&wrap_req)){ + /* Access is denied */ + if(!_mosquitto_socket_get_address(new_sock, address, 1024)){ + _mosquitto_log_printf(NULL, MOSQ_LOG_NOTICE, "Client connection from %s denied access by tcpd.", address); + } + COMPAT_CLOSE(new_sock); + return -1; + } +#endif + new_context = mqtt3_context_init(db, new_sock); + if(!new_context){ + COMPAT_CLOSE(new_sock); + return -1; + } + for(i=0; iconfig->listener_count; i++){ + for(j=0; jconfig->listeners[i].sock_count; j++){ + if(db->config->listeners[i].socks[j] == listensock){ + new_context->listener = &db->config->listeners[i]; + new_context->listener->client_count++; + break; + } + } + } + if(!new_context->listener){ + mqtt3_context_cleanup(db, new_context, true); + return -1; + } + + if(new_context->listener->max_connections > 0 && new_context->listener->client_count > new_context->listener->max_connections){ + _mosquitto_log_printf(NULL, MOSQ_LOG_NOTICE, "Client connection from %s denied: max_connections exceeded.", new_context->address); + mqtt3_context_cleanup(db, new_context, true); + return -1; + } + +#ifdef WITH_TLS + /* TLS init */ + for(i=0; iconfig->listener_count; i++){ + for(j=0; jconfig->listeners[i].sock_count; j++){ + if(db->config->listeners[i].socks[j] == listensock){ + if(db->config->listeners[i].ssl_ctx){ + new_context->ssl = SSL_new(db->config->listeners[i].ssl_ctx); + if(!new_context->ssl){ + mqtt3_context_cleanup(db, new_context, true); + return -1; + } + SSL_set_ex_data(new_context->ssl, tls_ex_index_context, new_context); + SSL_set_ex_data(new_context->ssl, tls_ex_index_listener, &db->config->listeners[i]); + new_context->want_write = true; + bio = BIO_new_socket(new_sock, BIO_NOCLOSE); + SSL_set_bio(new_context->ssl, bio, bio); + ERR_clear_error(); + rc = SSL_accept(new_context->ssl); + if(rc != 1){ + rc = SSL_get_error(new_context->ssl, rc); + if(rc == SSL_ERROR_WANT_READ){ + /* We always want to read. */ + }else if(rc == SSL_ERROR_WANT_WRITE){ + new_context->want_write = true; + }else{ + e = ERR_get_error(); + while(e){ + _mosquitto_log_printf(NULL, MOSQ_LOG_NOTICE, + "Client connection from %s failed: %s.", + new_context->address, ERR_error_string(e, ebuf)); + e = ERR_get_error(); + } + mqtt3_context_cleanup(db, new_context, true); + return -1; + } + } + } + } + } + } +#endif + + _mosquitto_log_printf(NULL, MOSQ_LOG_NOTICE, "New connection from %s on port %d.", new_context->address, new_context->listener->port); + + return new_sock; +} + +#ifdef WITH_TLS +static int client_certificate_verify(int preverify_ok, X509_STORE_CTX *ctx) +{ + /* Preverify should check expiry, revocation. */ + return preverify_ok; +} +#endif + +#ifdef REAL_WITH_TLS_PSK +static unsigned int psk_server_callback(SSL *ssl, const char *identity, unsigned char *psk, unsigned int max_psk_len) +{ + struct mosquitto_db *db; + struct mosquitto *context; + struct _mqtt3_listener *listener; + char *psk_key = NULL; + int len; + const char *psk_hint; + + if(!identity) return 0; + + db = _mosquitto_get_db(); + + context = SSL_get_ex_data(ssl, tls_ex_index_context); + if(!context) return 0; + + listener = SSL_get_ex_data(ssl, tls_ex_index_listener); + if(!listener) return 0; + + psk_hint = listener->psk_hint; + + /* The hex to BN conversion results in the length halving, so we can pass + * max_psk_len*2 as the max hex key here. */ + psk_key = _mosquitto_calloc(1, max_psk_len*2 + 1); + if(!psk_key) return 0; + + if(mosquitto_psk_key_get(db, psk_hint, identity, psk_key, max_psk_len*2) != MOSQ_ERR_SUCCESS){ + _mosquitto_free(psk_key); + return 0; + } + + len = _mosquitto_hex2bin(psk_key, psk, max_psk_len); + if (len < 0){ + _mosquitto_free(psk_key); + return 0; + } + + if(listener->use_identity_as_username){ + context->username = _mosquitto_strdup(identity); + if(!context->username){ + _mosquitto_free(psk_key); + return 0; + } + } + + _mosquitto_free(psk_key); + return len; +} +#endif + +#ifdef WITH_TLS +static int _mosquitto_tls_server_ctx(struct _mqtt3_listener *listener) +{ + int ssl_options = 0; + char buf[256]; + int rc; +#ifdef WITH_EC +#if OPENSSL_VERSION_NUMBER >= 0x10000000L && OPENSSL_VERSION_NUMBER < 0x10002000L + EC_KEY *ecdh = NULL; +#endif +#endif + +#if OPENSSL_VERSION_NUMBER >= 0x10001000L + if(listener->tls_version == NULL){ + listener->ssl_ctx = SSL_CTX_new(SSLv23_server_method()); + }else if(!strcmp(listener->tls_version, "tlsv1.2")){ + listener->ssl_ctx = SSL_CTX_new(TLSv1_2_server_method()); + }else if(!strcmp(listener->tls_version, "tlsv1.1")){ + listener->ssl_ctx = SSL_CTX_new(TLSv1_1_server_method()); + }else if(!strcmp(listener->tls_version, "tlsv1")){ + listener->ssl_ctx = SSL_CTX_new(TLSv1_server_method()); + } +#else + listener->ssl_ctx = SSL_CTX_new(SSLv23_server_method()); +#endif + if(!listener->ssl_ctx){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Unable to create TLS context."); + return 1; + } + + /* Don't accept SSLv2 or SSLv3 */ + ssl_options = SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3; +#ifdef SSL_OP_NO_COMPRESSION + /* Disable compression */ + ssl_options |= SSL_OP_NO_COMPRESSION; +#endif +#ifdef SSL_OP_CIPHER_SERVER_PREFERENCE + /* Server chooses cipher */ + ssl_options |= SSL_OP_CIPHER_SERVER_PREFERENCE; +#endif + SSL_CTX_set_options(listener->ssl_ctx, ssl_options); + +#ifdef SSL_MODE_RELEASE_BUFFERS + /* Use even less memory per SSL connection. */ + SSL_CTX_set_mode(listener->ssl_ctx, SSL_MODE_RELEASE_BUFFERS); +#endif + +#ifdef WITH_EC +#if OPENSSL_VERSION_NUMBER >= 0x10002000L && OPENSSL_VERSION_NUMBER < 0x10100000L + SSL_CTX_set_ecdh_auto(listener->ssl_ctx, 1); +#elif OPENSSL_VERSION_NUMBER >= 0x10000000L && OPENSSL_VERSION_NUMBER < 0x10002000L + ecdh = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1); + if(!ecdh){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Unable to create TLS ECDH curve."); + return 1; + } + SSL_CTX_set_tmp_ecdh(listener->ssl_ctx, ecdh); + EC_KEY_free(ecdh); +#endif +#endif + + snprintf(buf, 256, "mosquitto-%d", listener->port); + SSL_CTX_set_session_id_context(listener->ssl_ctx, (unsigned char *)buf, strlen(buf)); + + if(listener->ciphers){ + rc = SSL_CTX_set_cipher_list(listener->ssl_ctx, listener->ciphers); + if(rc == 0){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Unable to set TLS ciphers. Check cipher list \"%s\".", listener->ciphers); + return 1; + } + }else{ + rc = SSL_CTX_set_cipher_list(listener->ssl_ctx, "DEFAULT:!aNULL:!eNULL:!LOW:!EXPORT:!SSLv2:@STRENGTH"); + if(rc == 0){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Unable to set TLS ciphers. Check cipher list \"%s\".", listener->ciphers); + return 1; + } + } + return MOSQ_ERR_SUCCESS; +} +#endif + +/* Creates a socket and listens on port 'port'. + * Returns 1 on failure + * Returns 0 on success. + */ +int mqtt3_socket_listen(struct _mqtt3_listener *listener) +{ + mosq_sock_t sock = INVALID_SOCKET; + struct addrinfo hints; + struct addrinfo *ainfo, *rp; + char service[10]; +#ifndef WIN32 + int ss_opt = 1; +#else + char ss_opt = 1; +#endif +#ifdef WITH_TLS + int rc; + X509_STORE *store; + X509_LOOKUP *lookup; +#endif + + if(!listener) return MOSQ_ERR_INVAL; + + snprintf(service, 10, "%d", listener->port); + memset(&hints, 0, sizeof(struct addrinfo)); + hints.ai_family = PF_UNSPEC; + hints.ai_flags = AI_PASSIVE; + hints.ai_socktype = SOCK_STREAM; + + if(getaddrinfo(listener->host, service, &hints, &ainfo)) return INVALID_SOCKET; + + listener->sock_count = 0; + listener->socks = NULL; + + for(rp = ainfo; rp; rp = rp->ai_next){ + if(rp->ai_family == AF_INET){ + _mosquitto_log_printf(NULL, MOSQ_LOG_INFO, "Opening ipv4 listen socket on port %d.", ntohs(((struct sockaddr_in *)rp->ai_addr)->sin_port)); + }else if(rp->ai_family == AF_INET6){ + _mosquitto_log_printf(NULL, MOSQ_LOG_INFO, "Opening ipv6 listen socket on port %d.", ntohs(((struct sockaddr_in6 *)rp->ai_addr)->sin6_port)); + }else{ + continue; + } + + sock = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol); + if(sock == INVALID_SOCKET){ + net__print_error(MOSQ_LOG_WARNING, "Warning: %s"); + continue; + } + listener->sock_count++; + listener->socks = _mosquitto_realloc(listener->socks, sizeof(mosq_sock_t)*listener->sock_count); + if(!listener->socks){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + listener->socks[listener->sock_count-1] = sock; + +#ifndef WIN32 + ss_opt = 1; + setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &ss_opt, sizeof(ss_opt)); +#endif + ss_opt = 1; + setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY, &ss_opt, sizeof(ss_opt)); + + if(_mosquitto_socket_nonblock(sock)){ + return 1; + } + + if(bind(sock, rp->ai_addr, rp->ai_addrlen) == -1){ + net__print_error(MOSQ_LOG_ERR, "Error: %s"); + COMPAT_CLOSE(sock); + return 1; + } + + if(listen(sock, 100) == -1){ + net__print_error(MOSQ_LOG_ERR, "Error: %s"); + COMPAT_CLOSE(sock); + return 1; + } + } + freeaddrinfo(ainfo); + + /* We need to have at least one working socket. */ + if(listener->sock_count > 0){ +#ifdef WITH_TLS + if((listener->cafile || listener->capath) && listener->certfile && listener->keyfile){ + if(_mosquitto_tls_server_ctx(listener)){ + COMPAT_CLOSE(sock); + return 1; + } + + rc = SSL_CTX_load_verify_locations(listener->ssl_ctx, listener->cafile, listener->capath); + if(rc == 0){ + if(listener->cafile && listener->capath){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Unable to load CA certificates. Check cafile \"%s\" and capath \"%s\".", listener->cafile, listener->capath); + }else if(listener->cafile){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Unable to load CA certificates. Check cafile \"%s\".", listener->cafile); + }else{ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Unable to load CA certificates. Check capath \"%s\".", listener->capath); + } + COMPAT_CLOSE(sock); + return 1; + } + /* FIXME user data? */ + if(listener->require_certificate){ + SSL_CTX_set_verify(listener->ssl_ctx, SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT, client_certificate_verify); + }else{ + SSL_CTX_set_verify(listener->ssl_ctx, SSL_VERIFY_NONE, client_certificate_verify); + } + rc = SSL_CTX_use_certificate_chain_file(listener->ssl_ctx, listener->certfile); + if(rc != 1){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Unable to load server certificate \"%s\". Check certfile.", listener->certfile); + COMPAT_CLOSE(sock); + return 1; + } + rc = SSL_CTX_use_PrivateKey_file(listener->ssl_ctx, listener->keyfile, SSL_FILETYPE_PEM); + if(rc != 1){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Unable to load server key file \"%s\". Check keyfile.", listener->keyfile); + COMPAT_CLOSE(sock); + return 1; + } + rc = SSL_CTX_check_private_key(listener->ssl_ctx); + if(rc != 1){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Server certificate/key are inconsistent."); + COMPAT_CLOSE(sock); + return 1; + } + /* Load CRLs if they exist. */ + if(listener->crlfile){ + store = SSL_CTX_get_cert_store(listener->ssl_ctx); + if(!store){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Unable to obtain TLS store."); + COMPAT_CLOSE(sock); + return 1; + } + lookup = X509_STORE_add_lookup(store, X509_LOOKUP_file()); + rc = X509_load_crl_file(lookup, listener->crlfile, X509_FILETYPE_PEM); + if(rc != 1){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Unable to load certificate revocation file \"%s\". Check crlfile.", listener->crlfile); + COMPAT_CLOSE(sock); + return 1; + } + X509_STORE_set_flags(store, X509_V_FLAG_CRL_CHECK); + } + +# ifdef REAL_WITH_TLS_PSK + }else if(listener->psk_hint){ + if(tls_ex_index_context == -1){ + tls_ex_index_context = SSL_get_ex_new_index(0, "client context", NULL, NULL, NULL); + } + if(tls_ex_index_listener == -1){ + tls_ex_index_listener = SSL_get_ex_new_index(0, "listener", NULL, NULL, NULL); + } + + if(_mosquitto_tls_server_ctx(listener)){ + COMPAT_CLOSE(sock); + return 1; + } + SSL_CTX_set_psk_server_callback(listener->ssl_ctx, psk_server_callback); + if(listener->psk_hint){ + rc = SSL_CTX_use_psk_identity_hint(listener->ssl_ctx, listener->psk_hint); + if(rc == 0){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Unable to set TLS PSK hint."); + COMPAT_CLOSE(sock); + return 1; + } + } +# endif /* REAL_WITH_TLS_PSK */ + } +#endif /* WITH_TLS */ + return 0; + }else{ + return 1; + } +} + +int _mosquitto_socket_get_address(mosq_sock_t sock, char *buf, int len) +{ + struct sockaddr_storage addr; + socklen_t addrlen; + + addrlen = sizeof(addr); + if(!getpeername(sock, (struct sockaddr *)&addr, &addrlen)){ + if(addr.ss_family == AF_INET){ + if(inet_ntop(AF_INET, &((struct sockaddr_in *)&addr)->sin_addr.s_addr, buf, len)){ + return 0; + } + }else if(addr.ss_family == AF_INET6){ + if(inet_ntop(AF_INET6, &((struct sockaddr_in6 *)&addr)->sin6_addr.s6_addr, buf, len)){ + return 0; + } + } + } + return 1; +} diff --git a/src/libs/mosquitto/src/persist.c b/src/libs/mosquitto/src/persist.c new file mode 100644 index 0000000..1632358 --- /dev/null +++ b/src/libs/mosquitto/src/persist.c @@ -0,0 +1,929 @@ +/* +Copyright (c) 2010-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include + +#ifdef WITH_PERSISTENCE + +#ifndef WIN32 +#include +#endif +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include "util_mosq.h" + +static uint32_t db_version; + + +static int _db_restore_sub(struct mosquitto_db *db, const char *client_id, const char *sub, int qos); + +static struct mosquitto *_db_find_or_add_context(struct mosquitto_db *db, const char *client_id, uint16_t last_mid) +{ + struct mosquitto *context; + + context = NULL; + HASH_FIND(hh_id, db->contexts_by_id, client_id, strlen(client_id), context); + if(!context){ + context = mqtt3_context_init(db, -1); + if(!context) return NULL; + context->id = _mosquitto_strdup(client_id); + if(!context->id){ + _mosquitto_free(context); + return NULL; + } + + context->clean_session = false; + + HASH_ADD_KEYPTR(hh_id, db->contexts_by_id, context->id, strlen(context->id), context); + } + if(last_mid){ + context->last_mid = last_mid; + } + return context; +} + +static int mqtt3_db_client_messages_write(struct mosquitto_db *db, FILE *db_fptr, struct mosquitto *context) +{ + uint32_t length; + dbid_t i64temp; + uint16_t i16temp, slen; + uint8_t i8temp; + struct mosquitto_client_msg *cmsg; + + assert(db); + assert(db_fptr); + assert(context); + + cmsg = context->msgs; + while(cmsg){ + if(!strncmp(cmsg->store->topic, "$SYS", 4) + && cmsg->store->ref_count <= 1 + && cmsg->store->dest_id_count == 0){ + + /* This $SYS message won't have been persisted, so we can't persist + * this client message. */ + cmsg = cmsg->next; + continue; + } + + slen = strlen(context->id); + + length = htonl(sizeof(dbid_t) + sizeof(uint16_t) + sizeof(uint8_t) + + sizeof(uint8_t) + sizeof(uint8_t) + sizeof(uint8_t) + + sizeof(uint8_t) + 2+slen); + + i16temp = htons(DB_CHUNK_CLIENT_MSG); + write_e(db_fptr, &i16temp, sizeof(uint16_t)); + write_e(db_fptr, &length, sizeof(uint32_t)); + + i16temp = htons(slen); + write_e(db_fptr, &i16temp, sizeof(uint16_t)); + write_e(db_fptr, context->id, slen); + + i64temp = cmsg->store->db_id; + write_e(db_fptr, &i64temp, sizeof(dbid_t)); + + i16temp = htons(cmsg->mid); + write_e(db_fptr, &i16temp, sizeof(uint16_t)); + + i8temp = (uint8_t )cmsg->qos; + write_e(db_fptr, &i8temp, sizeof(uint8_t)); + + i8temp = (uint8_t )cmsg->retain; + write_e(db_fptr, &i8temp, sizeof(uint8_t)); + + i8temp = (uint8_t )cmsg->direction; + write_e(db_fptr, &i8temp, sizeof(uint8_t)); + + i8temp = (uint8_t )cmsg->state; + write_e(db_fptr, &i8temp, sizeof(uint8_t)); + + i8temp = (uint8_t )cmsg->dup; + write_e(db_fptr, &i8temp, sizeof(uint8_t)); + + cmsg = cmsg->next; + } + + return MOSQ_ERR_SUCCESS; +error: + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: %s.", strerror(errno)); + return 1; +} + + +static int mqtt3_db_message_store_write(struct mosquitto_db *db, FILE *db_fptr) +{ + uint32_t length; + dbid_t i64temp; + uint32_t i32temp; + uint16_t i16temp, slen, tlen; + uint8_t i8temp; + struct mosquitto_msg_store *stored; + bool force_no_retain; + + assert(db); + assert(db_fptr); + + stored = db->msg_store; + while(stored){ + if(stored->topic && !strncmp(stored->topic, "$SYS", 4)){ + if(stored->ref_count <= 1 && stored->dest_id_count == 0){ + /* $SYS messages that are only retained shouldn't be persisted. */ + stored = stored->next; + continue; + } + /* Don't save $SYS messages as retained otherwise they can give + * misleading information when reloaded. They should still be saved + * because a disconnected durable client may have them in their + * queue. */ + force_no_retain = true; + }else{ + force_no_retain = false; + } + if(stored->topic){ + tlen = strlen(stored->topic); + }else{ + tlen = 0; + } + length = htonl(sizeof(dbid_t) + 2+strlen(stored->source_id) + + sizeof(uint16_t) + sizeof(uint16_t) + + 2+tlen + sizeof(uint32_t) + + stored->payloadlen + sizeof(uint8_t) + sizeof(uint8_t)); + + i16temp = htons(DB_CHUNK_MSG_STORE); + write_e(db_fptr, &i16temp, sizeof(uint16_t)); + write_e(db_fptr, &length, sizeof(uint32_t)); + + i64temp = stored->db_id; + write_e(db_fptr, &i64temp, sizeof(dbid_t)); + + slen = strlen(stored->source_id); + i16temp = htons(slen); + write_e(db_fptr, &i16temp, sizeof(uint16_t)); + if(slen){ + write_e(db_fptr, stored->source_id, slen); + } + + i16temp = htons(stored->source_mid); + write_e(db_fptr, &i16temp, sizeof(uint16_t)); + + i16temp = htons(stored->mid); + write_e(db_fptr, &i16temp, sizeof(uint16_t)); + + i16temp = htons(tlen); + write_e(db_fptr, &i16temp, sizeof(uint16_t)); + if(tlen){ + write_e(db_fptr, stored->topic, tlen); + } + + i8temp = (uint8_t )stored->qos; + write_e(db_fptr, &i8temp, sizeof(uint8_t)); + + if(force_no_retain == false){ + i8temp = (uint8_t )stored->retain; + }else{ + i8temp = 0; + } + write_e(db_fptr, &i8temp, sizeof(uint8_t)); + + i32temp = htonl(stored->payloadlen); + write_e(db_fptr, &i32temp, sizeof(uint32_t)); + if(stored->payloadlen){ + write_e(db_fptr, stored->payload, (unsigned int)stored->payloadlen); + } + stored = stored->next; + } + + return MOSQ_ERR_SUCCESS; +error: + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: %s.", strerror(errno)); + return 1; +} + +static int mqtt3_db_client_write(struct mosquitto_db *db, FILE *db_fptr) +{ + struct mosquitto *context, *ctxt_tmp; + uint16_t i16temp, slen; + uint32_t length; + time_t disconnect_t; + + assert(db); + assert(db_fptr); + + HASH_ITER(hh_id, db->contexts_by_id, context, ctxt_tmp){ + if(context && context->clean_session == false){ + length = htonl(2+strlen(context->id) + sizeof(uint16_t) + sizeof(time_t)); + + i16temp = htons(DB_CHUNK_CLIENT); + write_e(db_fptr, &i16temp, sizeof(uint16_t)); + write_e(db_fptr, &length, sizeof(uint32_t)); + + slen = strlen(context->id); + i16temp = htons(slen); + write_e(db_fptr, &i16temp, sizeof(uint16_t)); + write_e(db_fptr, context->id, slen); + i16temp = htons(context->last_mid); + write_e(db_fptr, &i16temp, sizeof(uint16_t)); + if(context->disconnect_t){ + disconnect_t = context->disconnect_t; + }else{ + disconnect_t = time(NULL); + } + write_e(db_fptr, &disconnect_t, sizeof(time_t)); + + if(mqtt3_db_client_messages_write(db, db_fptr, context)) return 1; + } + } + + return MOSQ_ERR_SUCCESS; +error: + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: %s.", strerror(errno)); + return 1; +} + +static int _db_subs_retain_write(struct mosquitto_db *db, FILE *db_fptr, struct _mosquitto_subhier *node, const char *topic, int level) +{ + struct _mosquitto_subhier *subhier; + struct _mosquitto_subleaf *sub; + char *thistopic; + uint32_t length; + uint16_t i16temp; + uint8_t i8temp; + dbid_t i64temp; + size_t slen; + + slen = strlen(topic) + strlen(node->topic) + 2; + thistopic = _mosquitto_malloc(sizeof(char)*slen); + if(!thistopic) return MOSQ_ERR_NOMEM; + if(level > 1 || strlen(topic)){ + snprintf(thistopic, slen, "%s/%s", topic, node->topic); + }else{ + snprintf(thistopic, slen, "%s", node->topic); + } + + sub = node->subs; + while(sub){ + if(sub->context->clean_session == false){ + length = htonl(2+strlen(sub->context->id) + 2+strlen(thistopic) + sizeof(uint8_t)); + + i16temp = htons(DB_CHUNK_SUB); + write_e(db_fptr, &i16temp, sizeof(uint16_t)); + write_e(db_fptr, &length, sizeof(uint32_t)); + + slen = strlen(sub->context->id); + i16temp = htons(slen); + write_e(db_fptr, &i16temp, sizeof(uint16_t)); + write_e(db_fptr, sub->context->id, slen); + + slen = strlen(thistopic); + i16temp = htons(slen); + write_e(db_fptr, &i16temp, sizeof(uint16_t)); + write_e(db_fptr, thistopic, slen); + + i8temp = (uint8_t )sub->qos; + write_e(db_fptr, &i8temp, sizeof(uint8_t)); + } + sub = sub->next; + } + if(node->retained){ + if(strncmp(node->retained->topic, "$SYS", 4)){ + /* Don't save $SYS messages. */ + length = htonl(sizeof(dbid_t)); + + i16temp = htons(DB_CHUNK_RETAIN); + write_e(db_fptr, &i16temp, sizeof(uint16_t)); + write_e(db_fptr, &length, sizeof(uint32_t)); + + i64temp = node->retained->db_id; + write_e(db_fptr, &i64temp, sizeof(dbid_t)); + } + } + + subhier = node->children; + while(subhier){ + _db_subs_retain_write(db, db_fptr, subhier, thistopic, level+1); + subhier = subhier->next; + } + _mosquitto_free(thistopic); + return MOSQ_ERR_SUCCESS; +error: + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: %s.", strerror(errno)); + return 1; +} + +static int mqtt3_db_subs_retain_write(struct mosquitto_db *db, FILE *db_fptr) +{ + struct _mosquitto_subhier *subhier; + + subhier = db->subs.children; + while(subhier){ + if(subhier->children){ + _db_subs_retain_write(db, db_fptr, subhier->children, "", 0); + } + subhier = subhier->next; + } + + return MOSQ_ERR_SUCCESS; +} + +int mqtt3_db_backup(struct mosquitto_db *db, bool shutdown) +{ + int rc = 0; + FILE *db_fptr = NULL; + uint32_t db_version_w = htonl(MOSQ_DB_VERSION); + uint32_t crc = htonl(0); + dbid_t i64temp; + uint32_t i32temp; + uint16_t i16temp; + uint8_t i8temp; + char err[256]; + char *outfile = NULL; + int len; + + if(!db || !db->config || !db->config->persistence_filepath) return MOSQ_ERR_INVAL; + _mosquitto_log_printf(NULL, MOSQ_LOG_INFO, "Saving in-memory database to %s.", db->config->persistence_filepath); + + len = strlen(db->config->persistence_filepath)+5; + outfile = _mosquitto_malloc(len+1); + if(!outfile){ + _mosquitto_log_printf(NULL, MOSQ_LOG_INFO, "Error saving in-memory database, out of memory."); + return MOSQ_ERR_NOMEM; + } + snprintf(outfile, len, "%s.new", db->config->persistence_filepath); + outfile[len] = '\0'; + +#ifndef WIN32 + /** + * + * If a system lost power during the rename operation at the + * end of this file the filesystem could potentially be left + * with a directory that looks like this after powerup: + * + * 24094 -rw-r--r-- 2 root root 4099 May 30 16:27 mosquitto.db + * 24094 -rw-r--r-- 2 root root 4099 May 30 16:27 mosquitto.db.new + * + * The 24094 shows that mosquitto.db.new is hard-linked to the + * same file as mosquitto.db. If fopen(outfile, "wb") is naively + * called then mosquitto.db will be truncated and the database + * potentially corrupted. + * + * Any existing mosquitto.db.new file must be removed prior to + * opening to guarantee that it is not hard-linked to + * mosquitto.db. + * + */ + rc = unlink(outfile); + if (rc != 0) { + if (errno != ENOENT) { + _mosquitto_log_printf(NULL, MOSQ_LOG_INFO, "Error saving in-memory database, unable to remove %s.", outfile); + goto error; + } + } +#endif + + db_fptr = _mosquitto_fopen(outfile, "wb", true); + if(db_fptr == NULL){ + _mosquitto_log_printf(NULL, MOSQ_LOG_INFO, "Error saving in-memory database, unable to open %s for writing.", outfile); + goto error; + } + + /* Header */ + write_e(db_fptr, magic, 15); + write_e(db_fptr, &crc, sizeof(uint32_t)); + write_e(db_fptr, &db_version_w, sizeof(uint32_t)); + + /* DB config */ + i16temp = htons(DB_CHUNK_CFG); + write_e(db_fptr, &i16temp, sizeof(uint16_t)); + /* chunk length */ + i32temp = htonl(sizeof(dbid_t) + sizeof(uint8_t) + sizeof(uint8_t)); + write_e(db_fptr, &i32temp, sizeof(uint32_t)); + /* db written at broker shutdown or not */ + i8temp = shutdown; + write_e(db_fptr, &i8temp, sizeof(uint8_t)); + i8temp = sizeof(dbid_t); + write_e(db_fptr, &i8temp, sizeof(uint8_t)); + /* last db mid */ + i64temp = db->last_db_id; + write_e(db_fptr, &i64temp, sizeof(dbid_t)); + + if(mqtt3_db_message_store_write(db, db_fptr)){ + goto error; + } + + mqtt3_db_client_write(db, db_fptr); + mqtt3_db_subs_retain_write(db, db_fptr); + +#ifndef WIN32 + /** + * + * Closing a file does not guarantee that the contents are + * written to disk. Need to flush to send data from app to OS + * buffers, then fsync to deliver data from OS buffers to disk + * (as well as disk hardware permits). + * + * man close (http://linux.die.net/man/2/close, 2016-06-20): + * + * "successful close does not guarantee that the data has + * been successfully saved to disk, as the kernel defers + * writes. It is not common for a filesystem to flush + * the buffers when the stream is closed. If you need + * to be sure that the data is physically stored, use + * fsync(2). (It will depend on the disk hardware at this + * point." + * + * This guarantees that the new state file will not overwrite + * the old state file before its contents are valid. + * + */ + + fflush(db_fptr); + fsync(fileno(db_fptr)); +#endif + fclose(db_fptr); + +#ifdef WIN32 + if(remove(db->config->persistence_filepath) != 0){ + if(errno != ENOENT){ + goto error; + } + } +#endif + if(rename(outfile, db->config->persistence_filepath) != 0){ + goto error; + } + _mosquitto_free(outfile); + outfile = NULL; + return rc; +error: + if(outfile) _mosquitto_free(outfile); + strerror_r(errno, err, 256); + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: %s.", err); + if(db_fptr) fclose(db_fptr); + return 1; +} + +static int _db_client_msg_restore(struct mosquitto_db *db, const char *client_id, uint16_t mid, uint8_t qos, uint8_t retain, uint8_t direction, uint8_t state, uint8_t dup, uint64_t store_id) +{ + struct mosquitto_client_msg *cmsg; + struct mosquitto_msg_store_load *load; + struct mosquitto *context; + + cmsg = _mosquitto_malloc(sizeof(struct mosquitto_client_msg)); + if(!cmsg){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + + cmsg->next = NULL; + cmsg->store = NULL; + cmsg->mid = mid; + cmsg->qos = qos; + cmsg->retain = retain; + cmsg->timestamp = 0; + cmsg->direction = direction; + cmsg->state = state; + cmsg->dup = dup; + + HASH_FIND(hh, db->msg_store_load, &store_id, sizeof(dbid_t), load); + if(!load){ + _mosquitto_free(cmsg); + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error restoring persistent database, message store corrupt."); + return 1; + } + cmsg->store = load->store; + cmsg->store->ref_count++; + + context = _db_find_or_add_context(db, client_id, 0); + if(!context){ + _mosquitto_free(cmsg); + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error restoring persistent database, message store corrupt."); + return 1; + } + if(context->msgs){ + context->last_msg->next = cmsg; + }else{ + context->msgs = cmsg; + } + context->last_msg = cmsg; + + return MOSQ_ERR_SUCCESS; +} + +static int _db_client_chunk_restore(struct mosquitto_db *db, FILE *db_fptr) +{ + uint16_t i16temp, slen, last_mid; + char *client_id = NULL; + int rc = 0; + struct mosquitto *context; + time_t disconnect_t; + + read_e(db_fptr, &i16temp, sizeof(uint16_t)); + slen = ntohs(i16temp); + if(!slen){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Corrupt persistent database."); + fclose(db_fptr); + return 1; + } + client_id = _mosquitto_malloc(slen+1); + if(!client_id){ + fclose(db_fptr); + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + read_e(db_fptr, client_id, slen); + client_id[slen] = '\0'; + + read_e(db_fptr, &i16temp, sizeof(uint16_t)); + last_mid = ntohs(i16temp); + + if(db_version == 2){ + disconnect_t = time(NULL); + }else{ + read_e(db_fptr, &disconnect_t, sizeof(time_t)); + } + + context = _db_find_or_add_context(db, client_id, last_mid); + if(context){ + context->disconnect_t = disconnect_t; + }else{ + rc = 1; + } + + _mosquitto_free(client_id); + + return rc; +error: + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: %s.", strerror(errno)); + fclose(db_fptr); + if(client_id) _mosquitto_free(client_id); + return 1; +} + +static int _db_client_msg_chunk_restore(struct mosquitto_db *db, FILE *db_fptr) +{ + dbid_t i64temp, store_id; + uint16_t i16temp, slen, mid; + uint8_t qos, retain, direction, state, dup; + char *client_id = NULL; + int rc; + char err[256]; + + read_e(db_fptr, &i16temp, sizeof(uint16_t)); + slen = ntohs(i16temp); + if(!slen){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Corrupt persistent database."); + fclose(db_fptr); + return 1; + } + client_id = _mosquitto_malloc(slen+1); + if(!client_id){ + fclose(db_fptr); + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + read_e(db_fptr, client_id, slen); + client_id[slen] = '\0'; + + read_e(db_fptr, &i64temp, sizeof(dbid_t)); + store_id = i64temp; + + read_e(db_fptr, &i16temp, sizeof(uint16_t)); + mid = ntohs(i16temp); + + read_e(db_fptr, &qos, sizeof(uint8_t)); + read_e(db_fptr, &retain, sizeof(uint8_t)); + read_e(db_fptr, &direction, sizeof(uint8_t)); + read_e(db_fptr, &state, sizeof(uint8_t)); + read_e(db_fptr, &dup, sizeof(uint8_t)); + + rc = _db_client_msg_restore(db, client_id, mid, qos, retain, direction, state, dup, store_id); + _mosquitto_free(client_id); + + return rc; +error: + strerror_r(errno, err, 256); + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: %s.", err); + fclose(db_fptr); + if(client_id) _mosquitto_free(client_id); + return 1; +} + +static int _db_msg_store_chunk_restore(struct mosquitto_db *db, FILE *db_fptr) +{ + dbid_t i64temp, store_id; + uint32_t i32temp, payloadlen; + uint16_t i16temp, slen, source_mid; + uint8_t qos, retain, *payload = NULL; + char *source_id = NULL; + char *topic = NULL; + int rc = 0; + struct mosquitto_msg_store *stored = NULL; + struct mosquitto_msg_store_load *load; + char err[256]; + + load = _mosquitto_malloc(sizeof(struct mosquitto_msg_store_load)); + if(!load){ + fclose(db_fptr); + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + + read_e(db_fptr, &i64temp, sizeof(dbid_t)); + store_id = i64temp; + + read_e(db_fptr, &i16temp, sizeof(uint16_t)); + slen = ntohs(i16temp); + if(slen){ + source_id = _mosquitto_malloc(slen+1); + if(!source_id){ + _mosquitto_free(load); + fclose(db_fptr); + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + read_e(db_fptr, source_id, slen); + source_id[slen] = '\0'; + } + read_e(db_fptr, &i16temp, sizeof(uint16_t)); + source_mid = ntohs(i16temp); + + /* This is the mid - don't need it */ + read_e(db_fptr, &i16temp, sizeof(uint16_t)); + + read_e(db_fptr, &i16temp, sizeof(uint16_t)); + slen = ntohs(i16temp); + if(slen){ + topic = _mosquitto_malloc(slen+1); + if(!topic){ + _mosquitto_free(load); + fclose(db_fptr); + if(source_id) _mosquitto_free(source_id); + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + read_e(db_fptr, topic, slen); + topic[slen] = '\0'; + }else{ + topic = NULL; + } + read_e(db_fptr, &qos, sizeof(uint8_t)); + read_e(db_fptr, &retain, sizeof(uint8_t)); + + read_e(db_fptr, &i32temp, sizeof(uint32_t)); + payloadlen = ntohl(i32temp); + + if(payloadlen){ + payload = _mosquitto_malloc(payloadlen); + if(!payload){ + _mosquitto_free(load); + fclose(db_fptr); + if(source_id) _mosquitto_free(source_id); + _mosquitto_free(topic); + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + read_e(db_fptr, payload, payloadlen); + } + + rc = mqtt3_db_message_store(db, source_id, source_mid, topic, qos, payloadlen, payload, retain, &stored, store_id); + + load->db_id = stored->db_id; + load->store = stored; + + HASH_ADD(hh, db->msg_store_load, db_id, sizeof(dbid_t), load); + + if(source_id) _mosquitto_free(source_id); + _mosquitto_free(topic); + _mosquitto_free(payload); + + return rc; +error: + strerror_r(errno, err, 256); + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: %s.", err); + fclose(db_fptr); + if(source_id) _mosquitto_free(source_id); + if(topic) _mosquitto_free(topic); + if(payload) _mosquitto_free(payload); + return 1; +} + +static int _db_retain_chunk_restore(struct mosquitto_db *db, FILE *db_fptr) +{ + dbid_t i64temp, store_id; + struct mosquitto_msg_store_load *load; + char err[256]; + + if(fread(&i64temp, sizeof(dbid_t), 1, db_fptr) != 1){ + strerror_r(errno, err, 256); + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: %s.", err); + fclose(db_fptr); + return 1; + } + store_id = i64temp; + HASH_FIND(hh, db->msg_store_load, &store_id, sizeof(dbid_t), load); + if(load){ + mqtt3_db_messages_queue(db, NULL, load->store->topic, load->store->qos, load->store->retain, &load->store); + }else{ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Corrupt database whilst restoring a retained message."); + return MOSQ_ERR_INVAL; + } + return MOSQ_ERR_SUCCESS; +} + +static int _db_sub_chunk_restore(struct mosquitto_db *db, FILE *db_fptr) +{ + uint16_t i16temp, slen; + uint8_t qos; + char *client_id; + char *topic; + int rc = 0; + char err[256]; + + read_e(db_fptr, &i16temp, sizeof(uint16_t)); + slen = ntohs(i16temp); + client_id = _mosquitto_malloc(slen+1); + if(!client_id){ + fclose(db_fptr); + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + read_e(db_fptr, client_id, slen); + client_id[slen] = '\0'; + + read_e(db_fptr, &i16temp, sizeof(uint16_t)); + slen = ntohs(i16temp); + topic = _mosquitto_malloc(slen+1); + if(!topic){ + fclose(db_fptr); + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + _mosquitto_free(client_id); + return MOSQ_ERR_NOMEM; + } + read_e(db_fptr, topic, slen); + topic[slen] = '\0'; + + read_e(db_fptr, &qos, sizeof(uint8_t)); + if(_db_restore_sub(db, client_id, topic, qos)){ + rc = 1; + } + _mosquitto_free(client_id); + _mosquitto_free(topic); + + return rc; +error: + strerror_r(errno, err, 256); + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: %s.", err); + fclose(db_fptr); + return 1; +} + +int mqtt3_db_restore(struct mosquitto_db *db) +{ + FILE *fptr; + char header[15]; + int rc = 0; + uint32_t crc; + dbid_t i64temp; + uint32_t i32temp, length; + uint16_t i16temp, chunk; + uint8_t i8temp; + ssize_t rlen; + char err[256]; + struct mosquitto_msg_store_load *load, *load_tmp; + + assert(db); + assert(db->config); + assert(db->config->persistence_filepath); + + db->msg_store_load = NULL; + + fptr = _mosquitto_fopen(db->config->persistence_filepath, "rb", false); + if(fptr == NULL) return MOSQ_ERR_SUCCESS; + rlen = fread(&header, 1, 15, fptr); + if(rlen == 0){ + fclose(fptr); + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: Persistence file is empty."); + return 0; + }else if(rlen != 15){ + goto error; + } + if(!memcmp(header, magic, 15)){ + // Restore DB as normal + read_e(fptr, &crc, sizeof(uint32_t)); + read_e(fptr, &i32temp, sizeof(uint32_t)); + db_version = ntohl(i32temp); + /* IMPORTANT - this is where compatibility checks are made. + * Is your DB change still compatible with previous versions? + */ + if(db_version > MOSQ_DB_VERSION && db_version != 0){ + if(db_version == 2){ + /* Addition of disconnect_t to client chunk in v3. */ + }else{ + fclose(fptr); + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Unsupported persistent database format version %d (need version %d).", db_version, MOSQ_DB_VERSION); + return 1; + } + } + + while(rlen = fread(&i16temp, sizeof(uint16_t), 1, fptr), rlen == 1){ + chunk = ntohs(i16temp); + read_e(fptr, &i32temp, sizeof(uint32_t)); + length = ntohl(i32temp); + switch(chunk){ + case DB_CHUNK_CFG: + read_e(fptr, &i8temp, sizeof(uint8_t)); // shutdown + read_e(fptr, &i8temp, sizeof(uint8_t)); // sizeof(dbid_t) + if(i8temp != sizeof(dbid_t)){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Incompatible database configuration (dbid size is %d bytes, expected %lu)", + i8temp, (unsigned long)sizeof(dbid_t)); + fclose(fptr); + return 1; + } + read_e(fptr, &i64temp, sizeof(dbid_t)); + db->last_db_id = i64temp; + break; + + case DB_CHUNK_MSG_STORE: + if(_db_msg_store_chunk_restore(db, fptr)) return 1; + break; + + case DB_CHUNK_CLIENT_MSG: + if(_db_client_msg_chunk_restore(db, fptr)) return 1; + break; + + case DB_CHUNK_RETAIN: + if(_db_retain_chunk_restore(db, fptr)) return 1; + break; + + case DB_CHUNK_SUB: + if(_db_sub_chunk_restore(db, fptr)) return 1; + break; + + case DB_CHUNK_CLIENT: + if(_db_client_chunk_restore(db, fptr)) return 1; + break; + + default: + _mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: Unsupported chunk \"%d\" in persistent database file. Ignoring.", chunk); + fseek(fptr, length, SEEK_CUR); + break; + } + } + if(rlen < 0) goto error; + }else{ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Unable to restore persistent database. Unrecognised file format."); + rc = 1; + } + + fclose(fptr); + + HASH_ITER(hh, db->msg_store_load, load, load_tmp){ + HASH_DELETE(hh, db->msg_store_load, load); + _mosquitto_free(load); + } + return rc; +error: + strerror_r(errno, err, 256); + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: %s.", err); + if(fptr) fclose(fptr); + return 1; +} + +static int _db_restore_sub(struct mosquitto_db *db, const char *client_id, const char *sub, int qos) +{ + struct mosquitto *context; + + assert(db); + assert(client_id); + assert(sub); + + context = _db_find_or_add_context(db, client_id, 0); + if(!context) return 1; + return mqtt3_sub_add(db, context, sub, qos, &db->subs); +} + +#endif diff --git a/src/libs/mosquitto/src/persist.h b/src/libs/mosquitto/src/persist.h new file mode 100644 index 0000000..808b05f --- /dev/null +++ b/src/libs/mosquitto/src/persist.h @@ -0,0 +1,35 @@ +/* +Copyright (c) 2010-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#ifndef PERSIST_H +#define PERSIST_H + +#define MOSQ_DB_VERSION 3 + +/* DB read/write */ +const unsigned char magic[15] = {0x00, 0xB5, 0x00, 'm','o','s','q','u','i','t','t','o',' ','d','b'}; +#define DB_CHUNK_CFG 1 +#define DB_CHUNK_MSG_STORE 2 +#define DB_CHUNK_CLIENT_MSG 3 +#define DB_CHUNK_RETAIN 4 +#define DB_CHUNK_SUB 5 +#define DB_CHUNK_CLIENT 6 +/* End DB read/write */ + +#define read_e(f, b, c) if(fread(b, 1, c, f) != c){ goto error; } +#define write_e(f, b, c) if(fwrite(b, 1, c, f) != c){ goto error; } + +#endif diff --git a/src/libs/mosquitto/src/read_handle.c b/src/libs/mosquitto/src/read_handle.c new file mode 100644 index 0000000..ddc16ce --- /dev/null +++ b/src/libs/mosquitto/src/read_handle.c @@ -0,0 +1,283 @@ +/* +Copyright (c) 2009-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +#ifdef WITH_SYS_TREE +extern uint64_t g_pub_bytes_received; +#endif + +int mqtt3_packet_handle(struct mosquitto_db *db, struct mosquitto *context) +{ + if(!context) return MOSQ_ERR_INVAL; + + switch((context->in_packet.command)&0xF0){ + case PINGREQ: + return _mosquitto_handle_pingreq(context); + case PINGRESP: + return _mosquitto_handle_pingresp(context); + case PUBACK: + return _mosquitto_handle_pubackcomp(db, context, "PUBACK"); + case PUBCOMP: + return _mosquitto_handle_pubackcomp(db, context, "PUBCOMP"); + case PUBLISH: + return mqtt3_handle_publish(db, context); + case PUBREC: + return _mosquitto_handle_pubrec(context); + case PUBREL: + return _mosquitto_handle_pubrel(db, context); + case CONNECT: + return mqtt3_handle_connect(db, context); + case DISCONNECT: + return mqtt3_handle_disconnect(db, context); + case SUBSCRIBE: + return mqtt3_handle_subscribe(db, context); + case UNSUBSCRIBE: + return mqtt3_handle_unsubscribe(db, context); +#ifdef WITH_BRIDGE + case CONNACK: + return mqtt3_handle_connack(db, context); + case SUBACK: + return _mosquitto_handle_suback(context); + case UNSUBACK: + return _mosquitto_handle_unsuback(context); +#endif + default: + /* If we don't recognise the command, return an error straight away. */ + return MOSQ_ERR_PROTOCOL; + } +} + +int mqtt3_handle_publish(struct mosquitto_db *db, struct mosquitto *context) +{ + char *topic; + void *payload = NULL; + uint32_t payloadlen; + uint8_t dup, qos, retain; + uint16_t mid = 0; + int rc = 0; + uint8_t header = context->in_packet.command; + int res = 0; + struct mosquitto_msg_store *stored = NULL; + int len; + char *topic_mount; +#ifdef WITH_BRIDGE + char *topic_temp; + int i; + struct _mqtt3_bridge_topic *cur_topic; + bool match; +#endif + + dup = (header & 0x08)>>3; + qos = (header & 0x06)>>1; + if(qos == 3){ + _mosquitto_log_printf(NULL, MOSQ_LOG_INFO, + "Invalid QoS in PUBLISH from %s, disconnecting.", context->id); + return 1; + } + retain = (header & 0x01); + + if(_mosquitto_read_string(&context->in_packet, &topic)) return 1; + if(STREMPTY(topic)){ + /* Invalid publish topic, disconnect client. */ + _mosquitto_free(topic); + return 1; + } +#ifdef WITH_BRIDGE + if(context->bridge && context->bridge->topics && context->bridge->topic_remapping){ + for(i=0; ibridge->topic_count; i++){ + cur_topic = &context->bridge->topics[i]; + if((cur_topic->direction == bd_both || cur_topic->direction == bd_in) + && (cur_topic->remote_prefix || cur_topic->local_prefix)){ + + /* Topic mapping required on this topic if the message matches */ + + rc = mosquitto_topic_matches_sub(cur_topic->remote_topic, topic, &match); + if(rc){ + _mosquitto_free(topic); + return rc; + } + if(match){ + if(cur_topic->remote_prefix){ + /* This prefix needs removing. */ + if(!strncmp(cur_topic->remote_prefix, topic, strlen(cur_topic->remote_prefix))){ + topic_temp = _mosquitto_strdup(topic+strlen(cur_topic->remote_prefix)); + if(!topic_temp){ + _mosquitto_free(topic); + return MOSQ_ERR_NOMEM; + } + _mosquitto_free(topic); + topic = topic_temp; + } + } + + if(cur_topic->local_prefix){ + /* This prefix needs adding. */ + len = strlen(topic) + strlen(cur_topic->local_prefix)+1; + topic_temp = _mosquitto_malloc(len+1); + if(!topic_temp){ + _mosquitto_free(topic); + return MOSQ_ERR_NOMEM; + } + snprintf(topic_temp, len, "%s%s", cur_topic->local_prefix, topic); + topic_temp[len] = '\0'; + + _mosquitto_free(topic); + topic = topic_temp; + } + break; + } + } + } + } +#endif + if(mosquitto_pub_topic_check(topic) != MOSQ_ERR_SUCCESS){ + /* Invalid publish topic, just swallow it. */ + _mosquitto_free(topic); + return 1; + } + + if(qos > 0){ + if(_mosquitto_read_uint16(&context->in_packet, &mid)){ + _mosquitto_free(topic); + return 1; + } + } + + payloadlen = context->in_packet.remaining_length - context->in_packet.pos; +#ifdef WITH_SYS_TREE + g_pub_bytes_received += payloadlen; +#endif + if(context->listener && context->listener->mount_point){ + len = strlen(context->listener->mount_point) + strlen(topic) + 1; + topic_mount = _mosquitto_malloc(len+1); + if(!topic_mount){ + _mosquitto_free(topic); + return MOSQ_ERR_NOMEM; + } + snprintf(topic_mount, len, "%s%s", context->listener->mount_point, topic); + topic_mount[len] = '\0'; + + _mosquitto_free(topic); + topic = topic_mount; + } + + if(payloadlen){ + if(db->config->message_size_limit && payloadlen > db->config->message_size_limit){ + _mosquitto_log_printf(NULL, MOSQ_LOG_DEBUG, "Dropped too large PUBLISH from %s (d%d, q%d, r%d, m%d, '%s', ... (%ld bytes))", context->id, dup, qos, retain, mid, topic, (long)payloadlen); + goto process_bad_message; + } + payload = _mosquitto_calloc(payloadlen+1, 1); + if(!payload){ + _mosquitto_free(topic); + return 1; + } + if(_mosquitto_read_bytes(&context->in_packet, payload, payloadlen)){ + _mosquitto_free(topic); + _mosquitto_free(payload); + return 1; + } + } + + /* Check for topic access */ + rc = mosquitto_acl_check(db, context, topic, MOSQ_ACL_WRITE); + if(rc == MOSQ_ERR_ACL_DENIED){ + _mosquitto_log_printf(NULL, MOSQ_LOG_DEBUG, "Denied PUBLISH from %s (d%d, q%d, r%d, m%d, '%s', ... (%ld bytes))", context->id, dup, qos, retain, mid, topic, (long)payloadlen); + goto process_bad_message; + }else if(rc != MOSQ_ERR_SUCCESS){ + _mosquitto_free(topic); + if(payload) _mosquitto_free(payload); + return rc; + } + + _mosquitto_log_printf(NULL, MOSQ_LOG_DEBUG, "Received PUBLISH from %s (d%d, q%d, r%d, m%d, '%s', ... (%ld bytes))", context->id, dup, qos, retain, mid, topic, (long)payloadlen); + if(qos > 0){ + mqtt3_db_message_store_find(context, mid, &stored); + } + if(!stored){ + dup = 0; + if(mqtt3_db_message_store(db, context->id, mid, topic, qos, payloadlen, payload, retain, &stored, 0)){ + _mosquitto_free(topic); + if(payload) _mosquitto_free(payload); + return 1; + } + }else{ + dup = 1; + } + switch(qos){ + case 0: + if(mqtt3_db_messages_queue(db, context->id, topic, qos, retain, &stored)) rc = 1; + break; + case 1: + if(mqtt3_db_messages_queue(db, context->id, topic, qos, retain, &stored)) rc = 1; + if(_mosquitto_send_puback(context, mid)) rc = 1; + break; + case 2: + if(!dup){ + res = mqtt3_db_message_insert(db, context, mid, mosq_md_in, qos, retain, stored); + }else{ + res = 0; + } + /* mqtt3_db_message_insert() returns 2 to indicate dropped message + * due to queue. This isn't an error so don't disconnect them. */ + if(!res){ + if(_mosquitto_send_pubrec(context, mid)) rc = 1; + }else if(res == 1){ + rc = 1; + } + break; + } + _mosquitto_free(topic); + if(payload) _mosquitto_free(payload); + + return rc; +process_bad_message: + _mosquitto_free(topic); + if(payload) _mosquitto_free(payload); + switch(qos){ + case 0: + return MOSQ_ERR_SUCCESS; + case 1: + return _mosquitto_send_puback(context, mid); + case 2: + mqtt3_db_message_store_find(context, mid, &stored); + if(!stored){ + if(mqtt3_db_message_store(db, context->id, mid, NULL, qos, 0, NULL, false, &stored, 0)){ + return 1; + } + res = mqtt3_db_message_insert(db, context, mid, mosq_md_in, qos, false, stored); + }else{ + res = 0; + } + if(!res){ + res = _mosquitto_send_pubrec(context, mid); + } + return res; + } + return 1; +} + diff --git a/src/libs/mosquitto/src/read_handle_client.c b/src/libs/mosquitto/src/read_handle_client.c new file mode 100644 index 0000000..b1e1d1f --- /dev/null +++ b/src/libs/mosquitto/src/read_handle_client.c @@ -0,0 +1,114 @@ +/* +Copyright (c) 2009-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include +#include +#include + +#include +#include +#include +#include +#include + +int mqtt3_handle_connack(struct mosquitto_db *db, struct mosquitto *context) +{ + uint8_t byte; + uint8_t rc; + int i; + char *notification_topic; + int notification_topic_len; + char notification_payload; + + if(!context){ + return MOSQ_ERR_INVAL; + } + _mosquitto_log_printf(NULL, MOSQ_LOG_DEBUG, "Received CONNACK on connection %s.", context->id); + if(_mosquitto_read_byte(&context->in_packet, &byte)) return 1; // Reserved byte, not used + if(_mosquitto_read_byte(&context->in_packet, &rc)) return 1; + switch(rc){ + case CONNACK_ACCEPTED: + if(context->bridge){ + if(context->bridge->notifications){ + notification_payload = '1'; + if(context->bridge->notification_topic){ + if(_mosquitto_send_real_publish(context, _mosquitto_mid_generate(context), + context->bridge->notification_topic, 1, ¬ification_payload, 1, true, 0)){ + + return 1; + } + mqtt3_db_messages_easy_queue(db, context, context->bridge->notification_topic, 1, 1, ¬ification_payload, 1); + }else{ + notification_topic_len = strlen(context->bridge->remote_clientid)+strlen("$SYS/broker/connection//state"); + notification_topic = _mosquitto_malloc(sizeof(char)*(notification_topic_len+1)); + if(!notification_topic) return MOSQ_ERR_NOMEM; + + snprintf(notification_topic, notification_topic_len+1, "$SYS/broker/connection/%s/state", context->bridge->remote_clientid); + notification_payload = '1'; + if(_mosquitto_send_real_publish(context, _mosquitto_mid_generate(context), + notification_topic, 1, ¬ification_payload, 1, true, 0)){ + + _mosquitto_free(notification_topic); + return 1; + } + mqtt3_db_messages_easy_queue(db, context, notification_topic, 1, 1, ¬ification_payload, 1); + _mosquitto_free(notification_topic); + } + } + for(i=0; ibridge->topic_count; i++){ + if(context->bridge->topics[i].direction == bd_in || context->bridge->topics[i].direction == bd_both){ + if(_mosquitto_send_subscribe(context, NULL, context->bridge->topics[i].remote_topic, context->bridge->topics[i].qos)){ + return 1; + } + }else{ + if(context->bridge->attempt_unsubscribe){ + if(_mosquitto_send_unsubscribe(context, NULL, context->bridge->topics[i].remote_topic)){ + /* direction = inwards only. This means we should not be subscribed + * to the topic. It is possible that we used to be subscribed to + * this topic so unsubscribe. */ + return 1; + } + } + } + } + } + context->state = mosq_cs_connected; + return MOSQ_ERR_SUCCESS; + case CONNACK_REFUSED_PROTOCOL_VERSION: + if(context->bridge){ + context->bridge->try_private_accepted = false; + } + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Connection Refused: unacceptable protocol version"); + return 1; + case CONNACK_REFUSED_IDENTIFIER_REJECTED: + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Connection Refused: identifier rejected"); + return 1; + case CONNACK_REFUSED_SERVER_UNAVAILABLE: + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Connection Refused: broker unavailable"); + return 1; + case CONNACK_REFUSED_BAD_USERNAME_PASSWORD: + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Connection Refused: broker unavailable"); + return 1; + case CONNACK_REFUSED_NOT_AUTHORIZED: + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Connection Refused: not authorised"); + return 1; + default: + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Connection Refused: unknown reason"); + return 1; + } + return 1; +} + diff --git a/src/libs/mosquitto/src/read_handle_server.c b/src/libs/mosquitto/src/read_handle_server.c new file mode 100644 index 0000000..6be6a25 --- /dev/null +++ b/src/libs/mosquitto/src/read_handle_server.c @@ -0,0 +1,811 @@ +/* +Copyright (c) 2009-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +#ifdef WITH_UUID +# include +#endif + +#ifdef WITH_WEBSOCKETS +# include +#endif + +#ifdef WITH_SYS_TREE +extern unsigned int g_connection_count; +#endif + +static char *client_id_gen(struct mosquitto_db *db) +{ + char *client_id; +#ifdef WITH_UUID + uuid_t uuid; +#else + int i; +#endif + +#ifdef WITH_UUID + client_id = (char *)_mosquitto_calloc(37 + db->config->auto_id_prefix_len, sizeof(char)); + if(!client_id){ + return NULL; + } + if(db->config->auto_id_prefix){ + memcpy(client_id, db->config->auto_id_prefix, db->config->auto_id_prefix_len); + } + uuid_generate_random(uuid); + uuid_unparse_lower(uuid, &client_id[db->config->auto_id_prefix_len]); +#else + client_id = (char *)_mosquitto_calloc(65 + db->config->auto_id_prefix_len, sizeof(char)); + if(!client_id){ + return NULL; + } + if(db->config->auto_id_prefix){ + memcpy(client_id, db->config->auto_id_prefix, db->config->auto_id_prefix_len); + } + for(i=0; i<64; i++){ + client_id[i+db->config->auto_id_prefix_len] = (rand()%73)+48; + } + client_id[i] = '\0'; +#endif + return client_id; +} + +int mqtt3_handle_connect(struct mosquitto_db *db, struct mosquitto *context) +{ + char *protocol_name = NULL; + uint8_t protocol_version; + uint8_t connect_flags; + uint8_t connect_ack = 0; + char *client_id = NULL; + char *will_payload = NULL, *will_topic = NULL; + char *will_topic_mount; + uint16_t will_payloadlen; + struct mosquitto_message *will_struct = NULL; + uint8_t will, will_retain, will_qos, clean_session; + uint8_t username_flag, password_flag; + char *username = NULL, *password = NULL; + int rc; + struct _mosquitto_acl_user *acl_tail; + struct mosquitto_client_msg *msg_tail, *msg_prev; + struct mosquitto *found_context; + int slen; + struct _mosquitto_subleaf *leaf; + int i; +#ifdef WITH_TLS + X509 *client_cert = NULL; + X509_NAME *name; + X509_NAME_ENTRY *name_entry; +#endif + +#ifdef WITH_SYS_TREE + g_connection_count++; +#endif + + /* Don't accept multiple CONNECT commands. */ + if(context->state != mosq_cs_new){ + rc = MOSQ_ERR_PROTOCOL; + goto handle_connect_error; + } + + if(_mosquitto_read_string(&context->in_packet, &protocol_name)){ + rc = 1; + goto handle_connect_error; + return 1; + } + if(!protocol_name){ + rc = 3; + goto handle_connect_error; + return 3; + } + if(_mosquitto_read_byte(&context->in_packet, &protocol_version)){ + rc = 1; + goto handle_connect_error; + return 1; + } + if(!strcmp(protocol_name, PROTOCOL_NAME_v31)){ + if((protocol_version&0x7F) != PROTOCOL_VERSION_v31){ + if(db->config->connection_messages == true){ + _mosquitto_log_printf(NULL, MOSQ_LOG_INFO, "Invalid protocol version %d in CONNECT from %s.", + protocol_version, context->address); + } + _mosquitto_send_connack(context, 0, CONNACK_REFUSED_PROTOCOL_VERSION); + _mosquitto_free(protocol_name); + rc = MOSQ_ERR_PROTOCOL; + goto handle_connect_error; + } + context->protocol = mosq_p_mqtt31; + }else if(!strcmp(protocol_name, PROTOCOL_NAME_v311)){ + if((protocol_version&0x7F) != PROTOCOL_VERSION_v311){ + if(db->config->connection_messages == true){ + _mosquitto_log_printf(NULL, MOSQ_LOG_INFO, "Invalid protocol version %d in CONNECT from %s.", + protocol_version, context->address); + } + _mosquitto_send_connack(context, 0, CONNACK_REFUSED_PROTOCOL_VERSION); + _mosquitto_free(protocol_name); + rc = MOSQ_ERR_PROTOCOL; + goto handle_connect_error; + } + if((context->in_packet.command&0x0F) != 0x00){ + /* Reserved flags not set to 0, must disconnect. */ + _mosquitto_free(protocol_name); + rc = MOSQ_ERR_PROTOCOL; + goto handle_connect_error; + } + context->protocol = mosq_p_mqtt311; + }else{ + if(db->config->connection_messages == true){ + _mosquitto_log_printf(NULL, MOSQ_LOG_INFO, "Invalid protocol \"%s\" in CONNECT from %s.", + protocol_name, context->address); + } + _mosquitto_free(protocol_name); + rc = MOSQ_ERR_PROTOCOL; + goto handle_connect_error; + } + _mosquitto_free(protocol_name); + + if(_mosquitto_read_byte(&context->in_packet, &connect_flags)){ + rc = 1; + goto handle_connect_error; + } + if(context->protocol == mosq_p_mqtt311){ + if((connect_flags & 0x01) != 0x00){ + rc = MOSQ_ERR_PROTOCOL; + goto handle_connect_error; + } + } + + clean_session = (connect_flags & 0x02) >> 1; + will = connect_flags & 0x04; + will_qos = (connect_flags & 0x18) >> 3; + if(will_qos == 3){ + _mosquitto_log_printf(NULL, MOSQ_LOG_INFO, "Invalid Will QoS in CONNECT from %s.", + context->address); + rc = MOSQ_ERR_PROTOCOL; + goto handle_connect_error; + } + will_retain = ((connect_flags & 0x20) == 0x20); // Temporary hack because MSVC<1800 doesn't have stdbool.h. + password_flag = connect_flags & 0x40; + username_flag = connect_flags & 0x80; + + if(_mosquitto_read_uint16(&context->in_packet, &(context->keepalive))){ + rc = 1; + goto handle_connect_error; + } + + if(_mosquitto_read_string(&context->in_packet, &client_id)){ + rc = 1; + goto handle_connect_error; + } + + slen = strlen(client_id); + if(slen == 0){ + if(context->protocol == mosq_p_mqtt31){ + _mosquitto_send_connack(context, 0, CONNACK_REFUSED_IDENTIFIER_REJECTED); + rc = MOSQ_ERR_PROTOCOL; + goto handle_connect_error; + }else{ /* mqtt311 */ + _mosquitto_free(client_id); + client_id = NULL; + + if(clean_session == 0 || db->config->allow_zero_length_clientid == false){ + _mosquitto_send_connack(context, 0, CONNACK_REFUSED_IDENTIFIER_REJECTED); + rc = MOSQ_ERR_PROTOCOL; + goto handle_connect_error; + }else{ + client_id = client_id_gen(db); + if(!client_id){ + rc = MOSQ_ERR_NOMEM; + goto handle_connect_error; + } + } + } + } + + /* clientid_prefixes check */ + if(db->config->clientid_prefixes){ + if(strncmp(db->config->clientid_prefixes, client_id, strlen(db->config->clientid_prefixes))){ + _mosquitto_send_connack(context, 0, CONNACK_REFUSED_NOT_AUTHORIZED); + rc = 1; + goto handle_connect_error; + } + } + + if(will){ + will_struct = _mosquitto_calloc(1, sizeof(struct mosquitto_message)); + if(!will_struct){ + rc = MOSQ_ERR_NOMEM; + goto handle_connect_error; + } + if(_mosquitto_read_string(&context->in_packet, &will_topic)){ + rc = 1; + goto handle_connect_error; + } + if(STREMPTY(will_topic)){ + rc = 1; + goto handle_connect_error; + } + + if(context->listener && context->listener->mount_point){ + slen = strlen(context->listener->mount_point) + strlen(will_topic) + 1; + will_topic_mount = _mosquitto_malloc(slen+1); + if(!will_topic_mount){ + rc = MOSQ_ERR_NOMEM; + goto handle_connect_error; + } + snprintf(will_topic_mount, slen, "%s%s", context->listener->mount_point, will_topic); + will_topic_mount[slen] = '\0'; + + _mosquitto_free(will_topic); + will_topic = will_topic_mount; + } + + if(mosquitto_pub_topic_check(will_topic)){ + rc = 1; + goto handle_connect_error; + } + + if(_mosquitto_read_uint16(&context->in_packet, &will_payloadlen)){ + rc = 1; + goto handle_connect_error; + } + if(will_payloadlen > 0){ + will_payload = _mosquitto_malloc(will_payloadlen); + if(!will_payload){ + rc = 1; + goto handle_connect_error; + } + + rc = _mosquitto_read_bytes(&context->in_packet, will_payload, will_payloadlen); + if(rc){ + rc = 1; + goto handle_connect_error; + } + } + }else{ + if(context->protocol == mosq_p_mqtt311){ + if(will_qos != 0 || will_retain != 0){ + rc = MOSQ_ERR_PROTOCOL; + goto handle_connect_error; + } + } + } + + if(username_flag){ + rc = _mosquitto_read_string(&context->in_packet, &username); + if(rc == MOSQ_ERR_SUCCESS){ + if(password_flag){ + rc = _mosquitto_read_string(&context->in_packet, &password); + if(rc == MOSQ_ERR_NOMEM){ + rc = MOSQ_ERR_NOMEM; + goto handle_connect_error; + }else if(rc == MOSQ_ERR_PROTOCOL){ + if(context->protocol == mosq_p_mqtt31){ + /* Password flag given, but no password. Ignore. */ + password_flag = 0; + }else if(context->protocol == mosq_p_mqtt311){ + rc = MOSQ_ERR_PROTOCOL; + goto handle_connect_error; + } + } + } + }else if(rc == MOSQ_ERR_NOMEM){ + rc = MOSQ_ERR_NOMEM; + goto handle_connect_error; + }else{ + if(context->protocol == mosq_p_mqtt31){ + /* Username flag given, but no username. Ignore. */ + username_flag = 0; + }else if(context->protocol == mosq_p_mqtt311){ + rc = MOSQ_ERR_PROTOCOL; + goto handle_connect_error; + } + } + }else{ + if(context->protocol == mosq_p_mqtt311){ + if(password_flag){ + /* username_flag == 0 && password_flag == 1 is forbidden */ + rc = MOSQ_ERR_PROTOCOL; + goto handle_connect_error; + } + } + } + +#ifdef WITH_TLS + if(context->listener && context->listener->ssl_ctx && context->listener->use_identity_as_username){ + if(!context->ssl){ + _mosquitto_send_connack(context, 0, CONNACK_REFUSED_BAD_USERNAME_PASSWORD); + rc = 1; + goto handle_connect_error; + } +#ifdef REAL_WITH_TLS_PSK + if(context->listener->psk_hint){ + /* Client should have provided an identity to get this far. */ + if(!context->username){ + _mosquitto_send_connack(context, 0, CONNACK_REFUSED_BAD_USERNAME_PASSWORD); + rc = 1; + goto handle_connect_error; + } + }else{ +#endif /* REAL_WITH_TLS_PSK */ + client_cert = SSL_get_peer_certificate(context->ssl); + if(!client_cert){ + _mosquitto_send_connack(context, 0, CONNACK_REFUSED_BAD_USERNAME_PASSWORD); + rc = 1; + goto handle_connect_error; + } + name = X509_get_subject_name(client_cert); + if(!name){ + _mosquitto_send_connack(context, 0, CONNACK_REFUSED_BAD_USERNAME_PASSWORD); + rc = 1; + goto handle_connect_error; + } + + i = X509_NAME_get_index_by_NID(name, NID_commonName, -1); + if(i == -1){ + _mosquitto_send_connack(context, 0, CONNACK_REFUSED_BAD_USERNAME_PASSWORD); + rc = 1; + goto handle_connect_error; + } + name_entry = X509_NAME_get_entry(name, i); + context->username = _mosquitto_strdup((char *)ASN1_STRING_data(X509_NAME_ENTRY_get_data(name_entry))); + if(!context->username){ + rc = 1; + goto handle_connect_error; + } + X509_free(client_cert); + client_cert = NULL; +#ifdef REAL_WITH_TLS_PSK + } +#endif /* REAL_WITH_TLS_PSK */ + }else{ +#endif /* WITH_TLS */ + if(username_flag){ + rc = mosquitto_unpwd_check(db, username, password); + switch(rc){ + case MOSQ_ERR_SUCCESS: + break; + case MOSQ_ERR_AUTH: + _mosquitto_send_connack(context, 0, CONNACK_REFUSED_NOT_AUTHORIZED); + mqtt3_context_disconnect(db, context); + rc = 1; + goto handle_connect_error; + break; + default: + mqtt3_context_disconnect(db, context); + rc = 1; + goto handle_connect_error; + break; + } + context->username = username; + context->password = password; + username = NULL; /* Avoid free() in error: below. */ + password = NULL; + } + + if(!username_flag && db->config->allow_anonymous == false){ + _mosquitto_send_connack(context, 0, CONNACK_REFUSED_NOT_AUTHORIZED); + rc = 1; + goto handle_connect_error; + } +#ifdef WITH_TLS + } +#endif + + if(context->listener && context->listener->use_username_as_clientid){ + if(context->username){ + _mosquitto_free(client_id); + client_id = _mosquitto_strdup(context->username); + if(!client_id){ + rc = MOSQ_ERR_NOMEM; + goto handle_connect_error; + } + }else{ + _mosquitto_send_connack(context, 0, CONNACK_REFUSED_NOT_AUTHORIZED); + rc = 1; + goto handle_connect_error; + } + } + + /* Find if this client already has an entry. This must be done *after* any security checks. */ + HASH_FIND(hh_id, db->contexts_by_id, client_id, strlen(client_id), found_context); + if(found_context){ + /* Found a matching client */ + if(found_context->sock == INVALID_SOCKET){ + /* Client is reconnecting after a disconnect */ + /* FIXME - does anything need to be done here? */ + }else{ + /* Client is already connected, disconnect old version. This is + * done in mqtt3_context_cleanup() below. */ + if(db->config->connection_messages == true){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Client %s already connected, closing old connection.", client_id); + } + } + + if(context->protocol == mosq_p_mqtt311){ + if(clean_session == 0){ + connect_ack |= 0x01; + } + } + + context->clean_session = clean_session; + + if(context->clean_session == false && found_context->clean_session == false){ + if(found_context->msgs){ + context->msgs = found_context->msgs; + found_context->msgs = NULL; + mqtt3_db_message_reconnect_reset(db, context); + } + context->subs = found_context->subs; + found_context->subs = NULL; + context->sub_count = found_context->sub_count; + found_context->sub_count = 0; + context->last_mid = found_context->last_mid; + + for(i=0; isub_count; i++){ + if(context->subs[i]){ + leaf = context->subs[i]->subs; + while(leaf){ + if(leaf->context == found_context){ + leaf->context = context; + } + leaf = leaf->next; + } + } + } + } + + found_context->clean_session = true; + found_context->state = mosq_cs_disconnecting; + do_disconnect(db, found_context); + } + + /* Associate user with its ACL, assuming we have ACLs loaded. */ + if(db->acl_list){ + acl_tail = db->acl_list; + while(acl_tail){ + if(context->username){ + if(acl_tail->username && !strcmp(context->username, acl_tail->username)){ + context->acl_list = acl_tail; + break; + } + }else{ + if(acl_tail->username == NULL){ + context->acl_list = acl_tail; + break; + } + } + acl_tail = acl_tail->next; + } + }else{ + context->acl_list = NULL; + } + + if(will_struct){ + context->will = will_struct; + context->will->topic = will_topic; + if(will_payload){ + context->will->payload = will_payload; + context->will->payloadlen = will_payloadlen; + }else{ + context->will->payload = NULL; + context->will->payloadlen = 0; + } + context->will->qos = will_qos; + context->will->retain = will_retain; + } + + if(db->config->connection_messages == true){ + if(context->is_bridge){ + if(context->username){ + _mosquitto_log_printf(NULL, MOSQ_LOG_NOTICE, "New bridge connected from %s as %s (c%d, k%d, u'%s').", context->address, client_id, clean_session, context->keepalive, context->username); + }else{ + _mosquitto_log_printf(NULL, MOSQ_LOG_NOTICE, "New bridge connected from %s as %s (c%d, k%d).", context->address, client_id, clean_session, context->keepalive); + } + }else{ + if(context->username){ + _mosquitto_log_printf(NULL, MOSQ_LOG_NOTICE, "New client connected from %s as %s (c%d, k%d, u'%s').", context->address, client_id, clean_session, context->keepalive, context->username); + }else{ + _mosquitto_log_printf(NULL, MOSQ_LOG_NOTICE, "New client connected from %s as %s (c%d, k%d).", context->address, client_id, clean_session, context->keepalive); + } + } + } + + context->id = client_id; + client_id = NULL; + context->clean_session = clean_session; + context->ping_t = 0; + context->is_dropping = false; + if((protocol_version&0x80) == 0x80){ + context->is_bridge = true; + } + + /* Remove any queued messages that are no longer allowed through ACL, + * assuming a possible change of username. */ + msg_tail = context->msgs; + msg_prev = NULL; + while(msg_tail){ + if(msg_tail->direction == mosq_md_out){ + if(mosquitto_acl_check(db, context, msg_tail->store->topic, MOSQ_ACL_READ) != MOSQ_ERR_SUCCESS){ + mosquitto__db_msg_store_deref(db, &msg_tail->store); + if(msg_prev){ + msg_prev->next = msg_tail->next; + _mosquitto_free(msg_tail); + msg_tail = msg_prev->next; + }else{ + context->msgs = context->msgs->next; + if(context->last_msg == msg_tail){ + context->last_msg = NULL; + } + _mosquitto_free(msg_tail); + msg_tail = context->msgs; + } + }else{ + msg_prev = msg_tail; + msg_tail = msg_tail->next; + } + }else{ + msg_prev = msg_tail; + msg_tail = msg_tail->next; + } + } + + HASH_ADD_KEYPTR(hh_id, db->contexts_by_id, context->id, strlen(context->id), context); + +#ifdef WITH_PERSISTENCE + if(!clean_session){ + db->persistence_changes++; + } +#endif + context->state = mosq_cs_connected; + return _mosquitto_send_connack(context, connect_ack, CONNACK_ACCEPTED); + +handle_connect_error: + if(client_id) _mosquitto_free(client_id); + if(username) _mosquitto_free(username); + if(password) _mosquitto_free(password); + if(will_payload) _mosquitto_free(will_payload); + if(will_topic) _mosquitto_free(will_topic); + if(will_struct) _mosquitto_free(will_struct); +#ifdef WITH_TLS + if(client_cert) X509_free(client_cert); +#endif + /* We return an error here which means the client is freed later on. */ + return rc; +} + +int mqtt3_handle_disconnect(struct mosquitto_db *db, struct mosquitto *context) +{ + if(!context){ + return MOSQ_ERR_INVAL; + } + if(context->in_packet.remaining_length != 0){ + return MOSQ_ERR_PROTOCOL; + } + _mosquitto_log_printf(NULL, MOSQ_LOG_DEBUG, "Received DISCONNECT from %s", context->id); + if(context->protocol == mosq_p_mqtt311){ + if((context->in_packet.command&0x0F) != 0x00){ + do_disconnect(db, context); + return MOSQ_ERR_PROTOCOL; + } + } + context->state = mosq_cs_disconnecting; + do_disconnect(db, context); + return MOSQ_ERR_SUCCESS; +} + + +int mqtt3_handle_subscribe(struct mosquitto_db *db, struct mosquitto *context) +{ + int rc = 0; + int rc2; + uint16_t mid; + char *sub; + uint8_t qos; + uint8_t *payload = NULL, *tmp_payload; + uint32_t payloadlen = 0; + int len; + char *sub_mount; + + if(!context) return MOSQ_ERR_INVAL; + _mosquitto_log_printf(NULL, MOSQ_LOG_DEBUG, "Received SUBSCRIBE from %s", context->id); + /* FIXME - plenty of potential for memory leaks here */ + + if(context->protocol == mosq_p_mqtt311){ + if((context->in_packet.command&0x0F) != 0x02){ + return MOSQ_ERR_PROTOCOL; + } + } + if(_mosquitto_read_uint16(&context->in_packet, &mid)) return 1; + + while(context->in_packet.pos < context->in_packet.remaining_length){ + sub = NULL; + if(_mosquitto_read_string(&context->in_packet, &sub)){ + if(payload) _mosquitto_free(payload); + return 1; + } + + if(sub){ + if(!strlen(sub)){ + _mosquitto_log_printf(NULL, MOSQ_LOG_INFO, "Empty subscription string from %s, disconnecting.", + context->address); + _mosquitto_free(sub); + if(payload) _mosquitto_free(payload); + return 1; + } + if(mosquitto_sub_topic_check(sub)){ + _mosquitto_log_printf(NULL, MOSQ_LOG_INFO, "Invalid subscription string from %s, disconnecting.", + context->address); + _mosquitto_free(sub); + if(payload) _mosquitto_free(payload); + return 1; + } + + if(_mosquitto_read_byte(&context->in_packet, &qos)){ + _mosquitto_free(sub); + if(payload) _mosquitto_free(payload); + return 1; + } + if(qos > 2){ + _mosquitto_log_printf(NULL, MOSQ_LOG_INFO, "Invalid QoS in subscription command from %s, disconnecting.", + context->address); + _mosquitto_free(sub); + if(payload) _mosquitto_free(payload); + return 1; + } + if(context->listener && context->listener->mount_point){ + len = strlen(context->listener->mount_point) + strlen(sub) + 1; + sub_mount = _mosquitto_malloc(len+1); + if(!sub_mount){ + _mosquitto_free(sub); + if(payload) _mosquitto_free(payload); + return MOSQ_ERR_NOMEM; + } + snprintf(sub_mount, len, "%s%s", context->listener->mount_point, sub); + sub_mount[len] = '\0'; + + _mosquitto_free(sub); + sub = sub_mount; + + } + _mosquitto_log_printf(NULL, MOSQ_LOG_DEBUG, "\t%s (QoS %d)", sub, qos); + +#if 0 + /* FIXME + * This section has been disabled temporarily. mosquitto_acl_check + * calls mosquitto_topic_matches_sub, which can't cope with + * checking subscriptions that have wildcards against ACLs that + * have wildcards. Bug #1374291 is related. + * + * It's a very difficult problem when an ACL looks like foo/+/bar + * and a subscription request to foo/# is made. + * + * This should be changed to using MOSQ_ACL_SUBSCRIPTION in the + * future anyway. + */ + if(context->protocol == mosq_p_mqtt311){ + rc = mosquitto_acl_check(db, context, sub, MOSQ_ACL_READ); + switch(rc){ + case MOSQ_ERR_SUCCESS: + break; + case MOSQ_ERR_ACL_DENIED: + qos = 0x80; + break; + default: + _mosquitto_free(sub); + return rc; + } + } +#endif + + if(qos != 0x80){ + rc2 = mqtt3_sub_add(db, context, sub, qos, &db->subs); + if(rc2 == MOSQ_ERR_SUCCESS){ + if(mqtt3_retain_queue(db, context, sub, qos)) rc = 1; + }else if(rc2 != -1){ + rc = rc2; + } + _mosquitto_log_printf(NULL, MOSQ_LOG_SUBSCRIBE, "%s %d %s", context->id, qos, sub); + } + _mosquitto_free(sub); + + tmp_payload = _mosquitto_realloc(payload, payloadlen + 1); + if(tmp_payload){ + payload = tmp_payload; + payload[payloadlen] = qos; + payloadlen++; + }else{ + if(payload) _mosquitto_free(payload); + + return MOSQ_ERR_NOMEM; + } + } + } + + if(context->protocol == mosq_p_mqtt311){ + if(payloadlen == 0){ + /* No subscriptions specified, protocol error. */ + return MOSQ_ERR_PROTOCOL; + } + } + if(_mosquitto_send_suback(context, mid, payloadlen, payload)) rc = 1; + _mosquitto_free(payload); + +#ifdef WITH_PERSISTENCE + db->persistence_changes++; +#endif + + return rc; +} + +int mqtt3_handle_unsubscribe(struct mosquitto_db *db, struct mosquitto *context) +{ + uint16_t mid; + char *sub; + + if(!context) return MOSQ_ERR_INVAL; + _mosquitto_log_printf(NULL, MOSQ_LOG_DEBUG, "Received UNSUBSCRIBE from %s", context->id); + + if(context->protocol == mosq_p_mqtt311){ + if((context->in_packet.command&0x0F) != 0x02){ + return MOSQ_ERR_PROTOCOL; + } + } + if(_mosquitto_read_uint16(&context->in_packet, &mid)) return 1; + + while(context->in_packet.pos < context->in_packet.remaining_length){ + sub = NULL; + if(_mosquitto_read_string(&context->in_packet, &sub)){ + return 1; + } + + if(sub){ + if(!strlen(sub)){ + _mosquitto_log_printf(NULL, MOSQ_LOG_INFO, "Empty unsubscription string from %s, disconnecting.", + context->id); + _mosquitto_free(sub); + return 1; + } + if(mosquitto_sub_topic_check(sub)){ + _mosquitto_log_printf(NULL, MOSQ_LOG_INFO, "Invalid unsubscription string from %s, disconnecting.", + context->id); + _mosquitto_free(sub); + return 1; + } + + _mosquitto_log_printf(NULL, MOSQ_LOG_DEBUG, "\t%s", sub); + mqtt3_sub_remove(db, context, sub, &db->subs); + _mosquitto_log_printf(NULL, MOSQ_LOG_UNSUBSCRIBE, "%s %s", context->id, sub); + _mosquitto_free(sub); + } + } +#ifdef WITH_PERSISTENCE + db->persistence_changes++; +#endif + + return _mosquitto_send_command_with_mid(context, UNSUBACK, mid, false); +} + diff --git a/src/libs/mosquitto/src/security.c b/src/libs/mosquitto/src/security.c new file mode 100644 index 0000000..67a4f79 --- /dev/null +++ b/src/libs/mosquitto/src/security.c @@ -0,0 +1,274 @@ +/* +Copyright (c) 2011-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include + +#include +#include + +#include +#include "mosquitto_plugin.h" +#include +#include "lib_load.h" + +typedef int (*FUNC_auth_plugin_version)(void); +typedef int (*FUNC_auth_plugin_init)(void **, struct mosquitto_auth_opt *, int); +typedef int (*FUNC_auth_plugin_cleanup)(void *, struct mosquitto_auth_opt *, int); +typedef int (*FUNC_auth_plugin_security_init)(void *, struct mosquitto_auth_opt *, int, bool); +typedef int (*FUNC_auth_plugin_security_cleanup)(void *, struct mosquitto_auth_opt *, int, bool); +typedef int (*FUNC_auth_plugin_acl_check)(void *, const char *, const char *, const char *, int); +typedef int (*FUNC_auth_plugin_unpwd_check)(void *, const char *, const char *); +typedef int (*FUNC_auth_plugin_psk_key_get)(void *, const char *, const char *, char *, int); + +void LIB_ERROR(void) +{ +#ifdef WIN32 + char *buf; + FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_STRING, + NULL, GetLastError(), LANG_NEUTRAL, &buf, 0, NULL); + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Load error: %s", buf); + LocalFree(buf); +#else + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Load error: %s", dlerror()); +#endif +} + +int mosquitto_security_module_init(struct mosquitto_db *db) +{ + void *lib; + int (*plugin_version)(void) = NULL; + int version; + int rc; + if(db->config->auth_plugin){ + lib = LIB_LOAD(db->config->auth_plugin); + if(!lib){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, + "Error: Unable to load auth plugin \"%s\".", db->config->auth_plugin); + LIB_ERROR(); + return 1; + } + + db->auth_plugin.lib = NULL; + if(!(plugin_version = (FUNC_auth_plugin_version)LIB_SYM(lib, "mosquitto_auth_plugin_version"))){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, + "Error: Unable to load auth plugin function mosquitto_auth_plugin_version()."); + LIB_ERROR(); + LIB_CLOSE(lib); + return 1; + } + version = plugin_version(); + if(version != MOSQ_AUTH_PLUGIN_VERSION){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, + "Error: Incorrect auth plugin version (got %d, expected %d).", + version, MOSQ_AUTH_PLUGIN_VERSION); + LIB_ERROR(); + + LIB_CLOSE(lib); + return 1; + } + if(!(db->auth_plugin.plugin_init = (FUNC_auth_plugin_init)LIB_SYM(lib, "mosquitto_auth_plugin_init"))){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, + "Error: Unable to load auth plugin function mosquitto_auth_plugin_init()."); + LIB_ERROR(); + LIB_CLOSE(lib); + return 1; + } + if(!(db->auth_plugin.plugin_cleanup = (FUNC_auth_plugin_cleanup)LIB_SYM(lib, "mosquitto_auth_plugin_cleanup"))){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, + "Error: Unable to load auth plugin function mosquitto_auth_plugin_cleanup()."); + LIB_ERROR(); + LIB_CLOSE(lib); + return 1; + } + + if(!(db->auth_plugin.security_init = (FUNC_auth_plugin_security_init)LIB_SYM(lib, "mosquitto_auth_security_init"))){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, + "Error: Unable to load auth plugin function mosquitto_auth_security_init()."); + LIB_ERROR(); + LIB_CLOSE(lib); + return 1; + } + + if(!(db->auth_plugin.security_cleanup = (FUNC_auth_plugin_security_cleanup)LIB_SYM(lib, "mosquitto_auth_security_cleanup"))){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, + "Error: Unable to load auth plugin function mosquitto_auth_security_cleanup()."); + LIB_ERROR(); + LIB_CLOSE(lib); + return 1; + } + + if(!(db->auth_plugin.acl_check = (FUNC_auth_plugin_acl_check)LIB_SYM(lib, "mosquitto_auth_acl_check"))){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, + "Error: Unable to load auth plugin function mosquitto_auth_acl_check()."); + LIB_ERROR(); + LIB_CLOSE(lib); + return 1; + } + + if(!(db->auth_plugin.unpwd_check = (FUNC_auth_plugin_unpwd_check)LIB_SYM(lib, "mosquitto_auth_unpwd_check"))){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, + "Error: Unable to load auth plugin function mosquitto_auth_unpwd_check()."); + LIB_ERROR(); + LIB_CLOSE(lib); + return 1; + } + + if(!(db->auth_plugin.psk_key_get = (FUNC_auth_plugin_psk_key_get)LIB_SYM(lib, "mosquitto_auth_psk_key_get"))){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, + "Error: Unable to load auth plugin function mosquitto_auth_psk_key_get()."); + LIB_ERROR(); + LIB_CLOSE(lib); + return 1; + } + + db->auth_plugin.lib = lib; + db->auth_plugin.user_data = NULL; + if(db->auth_plugin.plugin_init){ + rc = db->auth_plugin.plugin_init(&db->auth_plugin.user_data, db->config->auth_options, db->config->auth_option_count); + if(rc){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, + "Error: Authentication plugin returned %d when initialising.", rc); + } + return rc; + } + }else{ + db->auth_plugin.lib = NULL; + db->auth_plugin.plugin_init = NULL; + db->auth_plugin.plugin_cleanup = NULL; + db->auth_plugin.security_init = NULL; + db->auth_plugin.security_cleanup = NULL; + db->auth_plugin.acl_check = NULL; + db->auth_plugin.unpwd_check = NULL; + db->auth_plugin.psk_key_get = NULL; + } + + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_security_module_cleanup(struct mosquitto_db *db) +{ + mosquitto_security_cleanup(db, false); + + if(db->auth_plugin.plugin_cleanup){ + db->auth_plugin.plugin_cleanup(db->auth_plugin.user_data, db->config->auth_options, db->config->auth_option_count); + } + + if(db->config->auth_plugin){ + if(db->auth_plugin.lib){ + LIB_CLOSE(db->auth_plugin.lib); + } + } + db->auth_plugin.lib = NULL; + db->auth_plugin.plugin_init = NULL; + db->auth_plugin.plugin_cleanup = NULL; + db->auth_plugin.security_init = NULL; + db->auth_plugin.security_cleanup = NULL; + db->auth_plugin.acl_check = NULL; + db->auth_plugin.unpwd_check = NULL; + db->auth_plugin.psk_key_get = NULL; + + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_security_init(struct mosquitto_db *db, bool reload) +{ + if(!db->auth_plugin.lib){ + return mosquitto_security_init_default(db, reload); + }else{ + return db->auth_plugin.security_init(db->auth_plugin.user_data, db->config->auth_options, db->config->auth_option_count, reload); + } +} + +/* Apply security settings after a reload. + * Includes: + * - Disconnecting anonymous users if appropriate + * - Disconnecting users with invalid passwords + * - Reapplying ACLs + */ +int mosquitto_security_apply(struct mosquitto_db *db) +{ + if(!db->auth_plugin.lib){ + return mosquitto_security_apply_default(db); + } + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_security_cleanup(struct mosquitto_db *db, bool reload) +{ + if(!db->auth_plugin.lib){ + return mosquitto_security_cleanup_default(db, reload); + }else{ + return db->auth_plugin.security_cleanup(db->auth_plugin.user_data, db->config->auth_options, db->config->auth_option_count, reload); + } +} + +int mosquitto_acl_check(struct mosquitto_db *db, struct mosquitto *context, const char *topic, int access) +{ + char *username; + + if(!context->id){ + return MOSQ_ERR_ACL_DENIED; + } + if(!db->auth_plugin.lib){ + return mosquitto_acl_check_default(db, context, topic, access); + }else{ +#ifdef WITH_BRIDGE + if(context->bridge){ + username = context->bridge->local_username; + }else +#endif + { + username = context->username; + } + + if(db->config->auth_plugin_deny_special_chars == true){ + /* Check whether the client id or username contains a + or # and if + * so deny access. + * + * Do this check for every message regardless, we have to protect the + * plugins against possible pattern based attacks. + */ + if(username && strpbrk(username, "+#")){ + _mosquitto_log_printf(NULL, MOSQ_LOG_NOTICE, "ACL denying access to client with dangerous username \"%s\"", username); + return MOSQ_ERR_ACL_DENIED; + } + if(context->id && strpbrk(context->id, "+#")){ + _mosquitto_log_printf(NULL, MOSQ_LOG_NOTICE, "ACL denying access to client with dangerous client id \"%s\"", context->id); + return MOSQ_ERR_ACL_DENIED; + } + } + return db->auth_plugin.acl_check(db->auth_plugin.user_data, context->id, username, topic, access); + } +} + +int mosquitto_unpwd_check(struct mosquitto_db *db, const char *username, const char *password) +{ + if(!db->auth_plugin.lib){ + return mosquitto_unpwd_check_default(db, username, password); + }else{ + return db->auth_plugin.unpwd_check(db->auth_plugin.user_data, username, password); + } +} + +int mosquitto_psk_key_get(struct mosquitto_db *db, const char *hint, const char *identity, char *key, int max_key_len) +{ + if(!db->auth_plugin.lib){ + return mosquitto_psk_key_get_default(db, hint, identity, key, max_key_len); + }else{ + return db->auth_plugin.psk_key_get(db->auth_plugin.user_data, hint, identity, key, max_key_len); + } +} + diff --git a/src/libs/mosquitto/src/security_default.c b/src/libs/mosquitto/src/security_default.c new file mode 100644 index 0000000..43cd3f0 --- /dev/null +++ b/src/libs/mosquitto/src/security_default.c @@ -0,0 +1,851 @@ +/* +Copyright (c) 2011-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include + +#include +#include + +#include +#include +#include "util_mosq.h" + +static int _aclfile_parse(struct mosquitto_db *db); +static int _unpwd_file_parse(struct mosquitto_db *db); +static int _acl_cleanup(struct mosquitto_db *db, bool reload); +static int _unpwd_cleanup(struct _mosquitto_unpwd **unpwd, bool reload); +static int _psk_file_parse(struct mosquitto_db *db); +#ifdef WITH_TLS +static int _pw_digest(const char *password, const unsigned char *salt, unsigned int salt_len, unsigned char *hash, unsigned int *hash_len); +static int _base64_decode(char *in, unsigned char **decoded, unsigned int *decoded_len); +#endif + +int mosquitto_security_init_default(struct mosquitto_db *db, bool reload) +{ + int rc; + + /* Load username/password data if required. */ + if(db->config->password_file){ + rc = _unpwd_file_parse(db); + if(rc){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error opening password file \"%s\".", db->config->password_file); + return rc; + } + } + + /* Load acl data if required. */ + if(db->config->acl_file){ + rc = _aclfile_parse(db); + if(rc){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error opening acl file \"%s\".", db->config->acl_file); + return rc; + } + } + + /* Load psk data if required. */ + if(db->config->psk_file){ + rc = _psk_file_parse(db); + if(rc){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error opening psk file \"%s\".", db->config->psk_file); + return rc; + } + } + + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_security_cleanup_default(struct mosquitto_db *db, bool reload) +{ + int rc; + rc = _acl_cleanup(db, reload); + if(rc != MOSQ_ERR_SUCCESS) return rc; + rc = _unpwd_cleanup(&db->unpwd, reload); + if(rc != MOSQ_ERR_SUCCESS) return rc; + return _unpwd_cleanup(&db->psk_id, reload); +} + + +int _add_acl(struct mosquitto_db *db, const char *user, const char *topic, int access) +{ + struct _mosquitto_acl_user *acl_user=NULL, *user_tail; + struct _mosquitto_acl *acl, *acl_tail; + char *local_topic; + bool new_user = false; + + if(!db || !topic) return MOSQ_ERR_INVAL; + + local_topic = _mosquitto_strdup(topic); + if(!local_topic){ + return MOSQ_ERR_NOMEM; + } + + if(db->acl_list){ + user_tail = db->acl_list; + while(user_tail){ + if(user == NULL){ + if(user_tail->username == NULL){ + acl_user = user_tail; + break; + } + }else if(user_tail->username && !strcmp(user_tail->username, user)){ + acl_user = user_tail; + break; + } + user_tail = user_tail->next; + } + } + if(!acl_user){ + acl_user = _mosquitto_malloc(sizeof(struct _mosquitto_acl_user)); + if(!acl_user){ + _mosquitto_free(local_topic); + return MOSQ_ERR_NOMEM; + } + new_user = true; + if(user){ + acl_user->username = _mosquitto_strdup(user); + if(!acl_user->username){ + _mosquitto_free(local_topic); + _mosquitto_free(acl_user); + return MOSQ_ERR_NOMEM; + } + }else{ + acl_user->username = NULL; + } + acl_user->next = NULL; + acl_user->acl = NULL; + } + + acl = _mosquitto_malloc(sizeof(struct _mosquitto_acl)); + if(!acl){ + _mosquitto_free(local_topic); + return MOSQ_ERR_NOMEM; + } + acl->access = access; + acl->topic = local_topic; + acl->next = NULL; + acl->ccount = 0; + acl->ucount = 0; + + /* Add acl to user acl list */ + if(acl_user->acl){ + acl_tail = acl_user->acl; + while(acl_tail->next){ + acl_tail = acl_tail->next; + } + acl_tail->next = acl; + }else{ + acl_user->acl = acl; + } + + if(new_user){ + /* Add to end of list */ + if(db->acl_list){ + user_tail = db->acl_list; + while(user_tail->next){ + user_tail = user_tail->next; + } + user_tail->next = acl_user; + }else{ + db->acl_list = acl_user; + } + } + + return MOSQ_ERR_SUCCESS; +} + +int _add_acl_pattern(struct mosquitto_db *db, const char *topic, int access) +{ + struct _mosquitto_acl *acl, *acl_tail; + char *local_topic; + char *s; + + if(!db || !topic) return MOSQ_ERR_INVAL; + + local_topic = _mosquitto_strdup(topic); + if(!local_topic){ + return MOSQ_ERR_NOMEM; + } + + acl = _mosquitto_malloc(sizeof(struct _mosquitto_acl)); + if(!acl){ + _mosquitto_free(local_topic); + return MOSQ_ERR_NOMEM; + } + acl->access = access; + acl->topic = local_topic; + acl->next = NULL; + + acl->ccount = 0; + s = local_topic; + while(s){ + s = strstr(s, "%c"); + if(s){ + acl->ccount++; + s+=2; + } + } + + acl->ucount = 0; + s = local_topic; + while(s){ + s = strstr(s, "%u"); + if(s){ + acl->ucount++; + s+=2; + } + } + + if(db->acl_patterns){ + acl_tail = db->acl_patterns; + while(acl_tail->next){ + acl_tail = acl_tail->next; + } + acl_tail->next = acl; + }else{ + db->acl_patterns = acl; + } + + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_acl_check_default(struct mosquitto_db *db, struct mosquitto *context, const char *topic, int access) +{ + char *local_acl; + struct _mosquitto_acl *acl_root; + bool result; + int i; + int len, tlen, clen, ulen; + char *s; + + if(!db || !context || !topic) return MOSQ_ERR_INVAL; + if(!db->acl_list && !db->acl_patterns) return MOSQ_ERR_SUCCESS; + if(context->bridge) return MOSQ_ERR_SUCCESS; + if(!context->acl_list && !db->acl_patterns) return MOSQ_ERR_ACL_DENIED; + + if(context->acl_list){ + acl_root = context->acl_list->acl; + }else{ + acl_root = NULL; + } + + /* Loop through all ACLs for this client. */ + while(acl_root){ + /* Loop through the topic looking for matches to this ACL. */ + + /* If subscription starts with $, acl_root->topic must also start with $. */ + if(topic[0] == '$' && acl_root->topic[0] != '$'){ + acl_root = acl_root->next; + continue; + } + mosquitto_topic_matches_sub(acl_root->topic, topic, &result); + if(result){ + if(access & acl_root->access){ + /* And access is allowed. */ + return MOSQ_ERR_SUCCESS; + } + } + acl_root = acl_root->next; + } + + acl_root = db->acl_patterns; + + if(acl_root){ + /* We are using pattern based acls. Check whether the username or + * client id contains a + or # and if so deny access. + * + * Without this, a malicious client may configure its username/client + * id to bypass ACL checks (or have a username/client id that cannot + * publish or receive messages to its own place in the hierarchy). + */ + if(context->username && strpbrk(context->username, "+#")){ + _mosquitto_log_printf(NULL, MOSQ_LOG_NOTICE, "ACL denying access to client with dangerous username \"%s\"", context->username); + return MOSQ_ERR_ACL_DENIED; + } + + if(context->id && strpbrk(context->id, "+#")){ + _mosquitto_log_printf(NULL, MOSQ_LOG_NOTICE, "ACL denying access to client with dangerous client id \"%s\"", context->id); + return MOSQ_ERR_ACL_DENIED; + } + } + + /* Loop through all pattern ACLs. */ + clen = strlen(context->id); + while(acl_root){ + tlen = strlen(acl_root->topic); + + if(acl_root->ucount && !context->username){ + acl_root = acl_root->next; + continue; + } + + if(context->username){ + ulen = strlen(context->username); + len = tlen + acl_root->ccount*(clen-2) + acl_root->ucount*(ulen-2); + }else{ + ulen = 0; + len = tlen + acl_root->ccount*(clen-2); + } + local_acl = _mosquitto_malloc(len+1); + if(!local_acl) return 1; // FIXME + s = local_acl; + for(i=0; itopic[i] == '%'){ + if(acl_root->topic[i+1] == 'c'){ + i++; + strncpy(s, context->id, clen); + s+=clen; + continue; + }else if(context->username && acl_root->topic[i+1] == 'u'){ + i++; + strncpy(s, context->username, ulen); + s+=ulen; + continue; + } + } + s[0] = acl_root->topic[i]; + s++; + } + local_acl[len] = '\0'; + + mosquitto_topic_matches_sub(local_acl, topic, &result); + _mosquitto_free(local_acl); + if(result){ + if(access & acl_root->access){ + /* And access is allowed. */ + return MOSQ_ERR_SUCCESS; + } + } + + acl_root = acl_root->next; + } + + return MOSQ_ERR_ACL_DENIED; +} + +static int _aclfile_parse(struct mosquitto_db *db) +{ + FILE *aclfile; + char buf[1024]; + char *token; + char *user = NULL; + char *topic; + char *access_s; + int access; + int rc; + int slen; + int topic_pattern; + char *saveptr = NULL; + + if(!db || !db->config) return MOSQ_ERR_INVAL; + if(!db->config->acl_file) return MOSQ_ERR_SUCCESS; + + aclfile = _mosquitto_fopen(db->config->acl_file, "rt", false); + if(!aclfile){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Unable to open acl_file \"%s\".", db->config->acl_file); + return 1; + } + + // topic [read|write] + // user + + while(fgets(buf, 1024, aclfile)){ + slen = strlen(buf); + while(slen > 0 && (buf[slen-1] == 10 || buf[slen-1] == 13)){ + buf[slen-1] = '\0'; + slen = strlen(buf); + } + if(buf[0] == '#'){ + continue; + } + token = strtok_r(buf, " ", &saveptr); + if(token){ + if(!strcmp(token, "topic") || !strcmp(token, "pattern")){ + if(!strcmp(token, "topic")){ + topic_pattern = 0; + }else{ + topic_pattern = 1; + } + + access_s = strtok_r(NULL, " ", &saveptr); + if(!access_s){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Empty topic in acl_file."); + if(user) _mosquitto_free(user); + fclose(aclfile); + return MOSQ_ERR_INVAL; + } + token = strtok_r(NULL, "", &saveptr); + if(token){ + topic = token; + /* Ignore duplicate spaces */ + while(topic[0] == ' '){ + topic++; + } + }else{ + topic = access_s; + access_s = NULL; + } + if(access_s){ + if(!strcmp(access_s, "read")){ + access = MOSQ_ACL_READ; + }else if(!strcmp(access_s, "write")){ + access = MOSQ_ACL_WRITE; + }else if(!strcmp(access_s, "readwrite")){ + access = MOSQ_ACL_READ | MOSQ_ACL_WRITE; + }else{ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid topic access type \"%s\" in acl_file.", access_s); + if(user) _mosquitto_free(user); + fclose(aclfile); + return MOSQ_ERR_INVAL; + } + }else{ + access = MOSQ_ACL_READ | MOSQ_ACL_WRITE; + } + if(topic_pattern == 0){ + rc = _add_acl(db, user, topic, access); + }else{ + rc = _add_acl_pattern(db, topic, access); + } + if(rc){ + if(user) _mosquitto_free(user); + fclose(aclfile); + return rc; + } + }else if(!strcmp(token, "user")){ + token = strtok_r(NULL, "", &saveptr); + if(token){ + /* Ignore duplicate spaces */ + while(token[0] == ' '){ + token++; + } + if(user) _mosquitto_free(user); + user = _mosquitto_strdup(token); + if(!user){ + fclose(aclfile); + return MOSQ_ERR_NOMEM; + } + }else{ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Missing username in acl_file."); + if(user) _mosquitto_free(user); + fclose(aclfile); + return 1; + } + } + } + } + + if(user) _mosquitto_free(user); + fclose(aclfile); + + return MOSQ_ERR_SUCCESS; +} + +static void _free_acl(struct _mosquitto_acl *acl) +{ + if(!acl) return; + + if(acl->next){ + _free_acl(acl->next); + } + if(acl->topic){ + _mosquitto_free(acl->topic); + } + _mosquitto_free(acl); +} + +static int _acl_cleanup(struct mosquitto_db *db, bool reload) +{ + struct mosquitto *context, *ctxt_tmp; + struct _mosquitto_acl_user *user_tail; + + if(!db) return MOSQ_ERR_INVAL; + if(!db->acl_list) return MOSQ_ERR_SUCCESS; + + /* As we're freeing ACLs, we must clear context->acl_list to ensure no + * invalid memory accesses take place later. + * This *requires* the ACLs to be reapplied after _acl_cleanup() + * is called if we are reloading the config. If this is not done, all + * access will be denied to currently connected clients. + */ + HASH_ITER(hh_id, db->contexts_by_id, context, ctxt_tmp){ + context->acl_list = NULL; + } + + while(db->acl_list){ + user_tail = db->acl_list->next; + + _free_acl(db->acl_list->acl); + if(db->acl_list->username){ + _mosquitto_free(db->acl_list->username); + } + _mosquitto_free(db->acl_list); + + db->acl_list = user_tail; + } + + if(db->acl_patterns){ + _free_acl(db->acl_patterns); + db->acl_patterns = NULL; + } + return MOSQ_ERR_SUCCESS; +} + +static int _pwfile_parse(const char *file, struct _mosquitto_unpwd **root) +{ + FILE *pwfile; + struct _mosquitto_unpwd *unpwd; + char buf[256]; + char *username, *password; + int len; + char *saveptr = NULL; + + pwfile = _mosquitto_fopen(file, "rt", false); + if(!pwfile){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Unable to open pwfile \"%s\".", file); + return 1; + } + + while(!feof(pwfile)){ + if(fgets(buf, 256, pwfile)){ + username = strtok_r(buf, ":", &saveptr); + if(username){ + unpwd = _mosquitto_calloc(1, sizeof(struct _mosquitto_unpwd)); + if(!unpwd){ + fclose(pwfile); + return MOSQ_ERR_NOMEM; + } + unpwd->username = _mosquitto_strdup(username); + if(!unpwd->username){ + _mosquitto_free(unpwd); + fclose(pwfile); + return MOSQ_ERR_NOMEM; + } + len = strlen(unpwd->username); + while(unpwd->username[len-1] == 10 || unpwd->username[len-1] == 13){ + unpwd->username[len-1] = '\0'; + len = strlen(unpwd->username); + } + password = strtok_r(NULL, ":", &saveptr); + if(password){ + unpwd->password = _mosquitto_strdup(password); + if(!unpwd->password){ + fclose(pwfile); + _mosquitto_free(unpwd->username); + _mosquitto_free(unpwd); + return MOSQ_ERR_NOMEM; + } + len = strlen(unpwd->password); + while(len && (unpwd->password[len-1] == 10 || unpwd->password[len-1] == 13)){ + unpwd->password[len-1] = '\0'; + len = strlen(unpwd->password); + } + } + HASH_ADD_KEYPTR(hh, *root, unpwd->username, strlen(unpwd->username), unpwd); + } + } + } + fclose(pwfile); + + return MOSQ_ERR_SUCCESS; +} + +static int _unpwd_file_parse(struct mosquitto_db *db) +{ + int rc; +#ifdef WITH_TLS + struct _mosquitto_unpwd *u, *tmp; + char *token; + unsigned char *salt; + unsigned int salt_len; + unsigned char *password; + unsigned int password_len; +#endif + + if(!db || !db->config) return MOSQ_ERR_INVAL; + + if(!db->config->password_file) return MOSQ_ERR_SUCCESS; + + rc = _pwfile_parse(db->config->password_file, &db->unpwd); +#ifdef WITH_TLS + if(rc) return rc; + + HASH_ITER(hh, db->unpwd, u, tmp){ + /* Need to decode password into hashed data + salt. */ + if(u->password){ + token = strtok(u->password, "$"); + if(token && !strcmp(token, "6")){ + token = strtok(NULL, "$"); + if(token){ + rc = _base64_decode(token, &salt, &salt_len); + if(rc){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Unable to decode password salt for user %s.", u->username); + return MOSQ_ERR_INVAL; + } + u->salt = salt; + u->salt_len = salt_len; + token = strtok(NULL, "$"); + if(token){ + rc = _base64_decode(token, &password, &password_len); + if(rc){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Unable to decode password for user %s.", u->username); + return MOSQ_ERR_INVAL; + } + _mosquitto_free(u->password); + u->password = (char *)password; + u->password_len = password_len; + }else{ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid password hash for user %s.", u->username); + return MOSQ_ERR_INVAL; + } + }else{ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid password hash for user %s.", u->username); + return MOSQ_ERR_INVAL; + } + }else{ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid password hash for user %s.", u->username); + return MOSQ_ERR_INVAL; + } + } + } +#endif + return rc; +} + +static int _psk_file_parse(struct mosquitto_db *db) +{ + int rc; + struct _mosquitto_unpwd *u, *tmp; + + if(!db || !db->config) return MOSQ_ERR_INVAL; + + /* We haven't been asked to parse a psk file. */ + if(!db->config->psk_file) return MOSQ_ERR_SUCCESS; + + rc = _pwfile_parse(db->config->psk_file, &db->psk_id); + if(rc) return rc; + + HASH_ITER(hh, db->psk_id, u, tmp){ + /* Check for hex only digits */ + if(!u->password){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Empty psk for identity \"%s\".", u->username); + return MOSQ_ERR_INVAL; + } + if(strspn(u->password, "0123456789abcdefABCDEF") < strlen(u->password)){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: psk for identity \"%s\" contains non-hexadecimal characters.", u->username); + return MOSQ_ERR_INVAL; + } + } + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_unpwd_check_default(struct mosquitto_db *db, const char *username, const char *password) +{ + struct _mosquitto_unpwd *u, *tmp; +#ifdef WITH_TLS + unsigned char hash[EVP_MAX_MD_SIZE]; + unsigned int hash_len; + int rc; +#endif + + if(!db) return MOSQ_ERR_INVAL; + if(!db->unpwd) return MOSQ_ERR_SUCCESS; + if(!username) return MOSQ_ERR_INVAL; /* Check must be made only after checking db->unpwd. */ + + HASH_ITER(hh, db->unpwd, u, tmp){ + if(!strcmp(u->username, username)){ + if(u->password){ + if(password){ +#ifdef WITH_TLS + rc = _pw_digest(password, u->salt, u->salt_len, hash, &hash_len); + if(rc == MOSQ_ERR_SUCCESS){ + if(hash_len == u->password_len && !memcmp(u->password, hash, hash_len)){ + return MOSQ_ERR_SUCCESS; + }else{ + return MOSQ_ERR_AUTH; + } + }else{ + return rc; + } +#else + if(!strcmp(u->password, password)){ + return MOSQ_ERR_SUCCESS; + } +#endif + }else{ + return MOSQ_ERR_AUTH; + } + }else{ + return MOSQ_ERR_SUCCESS; + } + } + } + + return MOSQ_ERR_AUTH; +} + +static int _unpwd_cleanup(struct _mosquitto_unpwd **root, bool reload) +{ + struct _mosquitto_unpwd *u, *tmp; + + if(!root) return MOSQ_ERR_INVAL; + + HASH_ITER(hh, *root, u, tmp){ + HASH_DEL(*root, u); + if(u->password) _mosquitto_free(u->password); + if(u->username) _mosquitto_free(u->username); +#ifdef WITH_TLS + if(u->salt) _mosquitto_free(u->salt); +#endif + _mosquitto_free(u); + } + + *root = NULL; + + return MOSQ_ERR_SUCCESS; +} + +/* Apply security settings after a reload. + * Includes: + * - Disconnecting anonymous users if appropriate + * - Disconnecting users with invalid passwords + * - Reapplying ACLs + */ +int mosquitto_security_apply_default(struct mosquitto_db *db) +{ + struct mosquitto *context, *ctxt_tmp; + struct _mosquitto_acl_user *acl_user_tail; + bool allow_anonymous; + + if(!db) return MOSQ_ERR_INVAL; + + allow_anonymous = db->config->allow_anonymous; + + HASH_ITER(hh_id, db->contexts_by_id, context, ctxt_tmp){ + /* Check for anonymous clients when allow_anonymous is false */ + if(!allow_anonymous && !context->username){ + context->state = mosq_cs_disconnecting; + do_disconnect(db, context); + continue; + } + /* Check for connected clients that are no longer authorised */ + if(mosquitto_unpwd_check_default(db, context->username, context->password) != MOSQ_ERR_SUCCESS){ + context->state = mosq_cs_disconnecting; + do_disconnect(db, context); + continue; + } + /* Check for ACLs and apply to user. */ + if(db->acl_list){ + acl_user_tail = db->acl_list; + while(acl_user_tail){ + if(acl_user_tail->username){ + if(context->username){ + if(!strcmp(acl_user_tail->username, context->username)){ + context->acl_list = acl_user_tail; + break; + } + } + }else{ + if(!context->username){ + context->acl_list = acl_user_tail; + break; + } + } + acl_user_tail = acl_user_tail->next; + } + } + } + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_psk_key_get_default(struct mosquitto_db *db, const char *hint, const char *identity, char *key, int max_key_len) +{ + struct _mosquitto_unpwd *u, *tmp; + + if(!db || !hint || !identity || !key) return MOSQ_ERR_INVAL; + if(!db->psk_id) return MOSQ_ERR_AUTH; + + HASH_ITER(hh, db->psk_id, u, tmp){ + if(!strcmp(u->username, identity)){ + strncpy(key, u->password, max_key_len); + return MOSQ_ERR_SUCCESS; + } + } + + return MOSQ_ERR_AUTH; +} + +#ifdef WITH_TLS +int _pw_digest(const char *password, const unsigned char *salt, unsigned int salt_len, unsigned char *hash, unsigned int *hash_len) +{ + const EVP_MD *digest; +#if OPENSSL_VERSION_NUMBER < 0x10100000L + EVP_MD_CTX context; + + digest = EVP_get_digestbyname("sha512"); + if(!digest){ + // FIXME fprintf(stderr, "Error: Unable to create openssl digest.\n"); + return 1; + } + + EVP_MD_CTX_init(&context); + EVP_DigestInit_ex(&context, digest, NULL); + EVP_DigestUpdate(&context, password, strlen(password)); + EVP_DigestUpdate(&context, salt, salt_len); + /* hash is assumed to be EVP_MAX_MD_SIZE bytes long. */ + EVP_DigestFinal_ex(&context, hash, hash_len); + EVP_MD_CTX_cleanup(&context); +#else + EVP_MD_CTX *context; + + digest = EVP_get_digestbyname("sha512"); + if(!digest){ + // FIXME fprintf(stderr, "Error: Unable to create openssl digest.\n"); + return 1; + } + + context = EVP_MD_CTX_new(); + EVP_DigestInit_ex(context, digest, NULL); + EVP_DigestUpdate(context, password, strlen(password)); + EVP_DigestUpdate(context, salt, salt_len); + /* hash is assumed to be EVP_MAX_MD_SIZE bytes long. */ + EVP_DigestFinal_ex(context, hash, hash_len); + EVP_MD_CTX_free(context); +#endif + + return MOSQ_ERR_SUCCESS; +} + +int _base64_decode(char *in, unsigned char **decoded, unsigned int *decoded_len) +{ + BIO *bmem, *b64; + + b64 = BIO_new(BIO_f_base64()); + BIO_set_flags(b64, BIO_FLAGS_BASE64_NO_NL); + bmem = BIO_new(BIO_s_mem()); + b64 = BIO_push(b64, bmem); + BIO_write(bmem, in, strlen(in)); + + if(BIO_flush(bmem) != 1){ + BIO_free_all(b64); + return 1; + } + *decoded = _mosquitto_calloc(strlen(in), 1); + *decoded_len = BIO_read(b64, *decoded, strlen(in)); + BIO_free_all(b64); + + return 0; +} + +#endif diff --git a/src/libs/mosquitto/src/send_server.c b/src/libs/mosquitto/src/send_server.c new file mode 100644 index 0000000..3d64bce --- /dev/null +++ b/src/libs/mosquitto/src/send_server.c @@ -0,0 +1,76 @@ +/* +Copyright (c) 2009-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#include + +#include +#include +#include +#include + +int _mosquitto_send_connack(struct mosquitto *context, int ack, int result) +{ + struct _mosquitto_packet *packet = NULL; + int rc; + + if(context){ + if(context->id){ + _mosquitto_log_printf(NULL, MOSQ_LOG_DEBUG, "Sending CONNACK to %s (%d, %d)", context->id, ack, result); + }else{ + _mosquitto_log_printf(NULL, MOSQ_LOG_DEBUG, "Sending CONNACK to %s (%d, %d)", context->address, ack, result); + } + } + + packet = _mosquitto_calloc(1, sizeof(struct _mosquitto_packet)); + if(!packet) return MOSQ_ERR_NOMEM; + + packet->command = CONNACK; + packet->remaining_length = 2; + rc = _mosquitto_packet_alloc(packet); + if(rc){ + _mosquitto_free(packet); + return rc; + } + packet->payload[packet->pos+0] = ack; + packet->payload[packet->pos+1] = result; + + return _mosquitto_packet_queue(context, packet); +} + +int _mosquitto_send_suback(struct mosquitto *context, uint16_t mid, uint32_t payloadlen, const void *payload) +{ + struct _mosquitto_packet *packet = NULL; + int rc; + + _mosquitto_log_printf(NULL, MOSQ_LOG_DEBUG, "Sending SUBACK to %s", context->id); + + packet = _mosquitto_calloc(1, sizeof(struct _mosquitto_packet)); + if(!packet) return MOSQ_ERR_NOMEM; + + packet->command = SUBACK; + packet->remaining_length = 2+payloadlen; + rc = _mosquitto_packet_alloc(packet); + if(rc){ + _mosquitto_free(packet); + return rc; + } + _mosquitto_write_uint16(packet, mid); + if(payloadlen){ + _mosquitto_write_bytes(packet, payload, payloadlen); + } + + return _mosquitto_packet_queue(context, packet); +} diff --git a/src/libs/mosquitto/src/service.c b/src/libs/mosquitto/src/service.c new file mode 100644 index 0000000..ffe9ffe --- /dev/null +++ b/src/libs/mosquitto/src/service.c @@ -0,0 +1,143 @@ +/* +Copyright (c) 2011-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#if defined(WIN32) || defined(__CYGWIN__) + +#include + +#include + +extern int run; +SERVICE_STATUS_HANDLE service_handle = 0; +static SERVICE_STATUS service_status; +int main(int argc, char *argv[]); + +/* Service control callback */ +void __stdcall service_handler(DWORD fdwControl) +{ + switch(fdwControl){ + case SERVICE_CONTROL_CONTINUE: + /* Continue from Paused state. */ + break; + case SERVICE_CONTROL_PAUSE: + /* Pause service. */ + break; + case SERVICE_CONTROL_SHUTDOWN: + /* System is shutting down. */ + case SERVICE_CONTROL_STOP: + /* Service should stop. */ + service_status.dwCurrentState = SERVICE_STOP_PENDING; + SetServiceStatus(service_handle, &service_status); + run = 0; + break; + } +} + +/* Function called when started as a service. */ +void __stdcall service_main(DWORD dwArgc, LPTSTR *lpszArgv) +{ + char **argv; + int argc = 1; + char conf_path[MAX_PATH + 20]; + int rc; + + service_handle = RegisterServiceCtrlHandler("mosquitto", service_handler); + if(service_handle){ + rc = GetEnvironmentVariable("MOSQUITTO_DIR", conf_path, MAX_PATH); + if(!rc || rc == MAX_PATH){ + service_status.dwCurrentState = SERVICE_STOPPED; + SetServiceStatus(service_handle, &service_status); + return; + } + strcat(conf_path, "/mosquitto.conf"); + + argv = _mosquitto_malloc(sizeof(char *)*3); + argv[0] = "mosquitto"; + argv[1] = "-c"; + argv[2] = conf_path; + argc = 3; + + service_status.dwServiceType = SERVICE_WIN32_OWN_PROCESS; + service_status.dwCurrentState = SERVICE_RUNNING; + service_status.dwControlsAccepted = SERVICE_ACCEPT_SHUTDOWN | SERVICE_ACCEPT_STOP; + service_status.dwWin32ExitCode = NO_ERROR; + service_status.dwCheckPoint = 0; + SetServiceStatus(service_handle, &service_status); + + main(argc, argv); + _mosquitto_free(argv); + + service_status.dwCurrentState = SERVICE_STOPPED; + SetServiceStatus(service_handle, &service_status); + } +} + +void service_install(void) +{ + SC_HANDLE sc_manager, svc_handle; + char exe_path[MAX_PATH + 5]; + SERVICE_DESCRIPTION svc_desc; + + GetModuleFileName(NULL, exe_path, MAX_PATH); + strcat(exe_path, " run"); + + sc_manager = OpenSCManager(NULL, NULL, SC_MANAGER_CREATE_SERVICE); + if(sc_manager){ + svc_handle = CreateService(sc_manager, "mosquitto", "Mosquitto Broker", + SERVICE_START | SERVICE_STOP | SERVICE_CHANGE_CONFIG, + SERVICE_WIN32_OWN_PROCESS, SERVICE_AUTO_START, SERVICE_ERROR_NORMAL, + exe_path, NULL, NULL, NULL, NULL, NULL); + + if(svc_handle){ + svc_desc.lpDescription = "MQTT v3.1 broker"; + ChangeServiceConfig2(svc_handle, SERVICE_CONFIG_DESCRIPTION, &svc_desc); + CloseServiceHandle(svc_handle); + } + CloseServiceHandle(sc_manager); + } +} + +void service_uninstall(void) +{ + SC_HANDLE sc_manager, svc_handle; + SERVICE_STATUS status; + + sc_manager = OpenSCManager(NULL, SERVICES_ACTIVE_DATABASE, SC_MANAGER_CONNECT); + if(sc_manager){ + svc_handle = OpenService(sc_manager, "mosquitto", SERVICE_QUERY_STATUS | DELETE); + if(svc_handle){ + if(QueryServiceStatus(svc_handle, &status)){ + if(status.dwCurrentState == SERVICE_STOPPED){ + DeleteService(svc_handle); + } + } + CloseServiceHandle(svc_handle); + } + CloseServiceHandle(sc_manager); + } +} + +void service_run(void) +{ + SERVICE_TABLE_ENTRY ste[] = { + { "mosquitto", service_main }, + { NULL, NULL } + }; + + StartServiceCtrlDispatcher(ste); +} + +#endif diff --git a/src/libs/mosquitto/src/subs.c b/src/libs/mosquitto/src/subs.c new file mode 100644 index 0000000..dcf1b3a --- /dev/null +++ b/src/libs/mosquitto/src/subs.c @@ -0,0 +1,766 @@ +/* +Copyright (c) 2010-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +/* A note on matching topic subscriptions. + * + * Topics can be up to 32767 characters in length. The / character is used as a + * hierarchy delimiter. Messages are published to a particular topic. + * Clients may subscribe to particular topics directly, but may also use + * wildcards in subscriptions. The + and # characters are used as wildcards. + * The # wildcard can be used at the end of a subscription only, and is a + * wildcard for the level of hierarchy at which it is placed and all subsequent + * levels. + * The + wildcard may be used at any point within the subscription and is a + * wildcard for only the level of hierarchy at which it is placed. + * Neither wildcard may be used as part of a substring. + * Valid: + * a/b/+ + * a/+/c + * a/# + * a/b/# + * # + * +/b/c + * +/+/+ + * Invalid: + * a/#/c + * a+/b/c + * Valid but non-matching: + * a/b + * a/+ + * +/b + * b/c/a + * a/b/d + */ + +#include + +#include +#include +#include + +#include +#include +#include + +struct _sub_token { + struct _sub_token *next; + char *topic; +}; + +static int _subs_process(struct mosquitto_db *db, struct _mosquitto_subhier *hier, const char *source_id, const char *topic, int qos, int retain, struct mosquitto_msg_store *stored, bool set_retain) +{ + int rc = 0; + int rc2; + int client_qos, msg_qos; + uint16_t mid; + struct _mosquitto_subleaf *leaf; + bool client_retain; + + leaf = hier->subs; + + if(retain && set_retain){ +#ifdef WITH_PERSISTENCE + if(strncmp(topic, "$SYS", 4)){ + /* Retained messages count as a persistence change, but only if + * they aren't for $SYS. */ + db->persistence_changes++; + } +#endif + if(hier->retained){ + mosquitto__db_msg_store_deref(db, &hier->retained); +#ifdef WITH_SYS_TREE + db->retained_count--; +#endif + } + if(stored->payloadlen){ + hier->retained = stored; + hier->retained->ref_count++; +#ifdef WITH_SYS_TREE + db->retained_count++; +#endif + }else{ + hier->retained = NULL; + } + } + while(source_id && leaf){ + if(!leaf->context->id || (leaf->context->is_bridge && !strcmp(leaf->context->id, source_id))){ + leaf = leaf->next; + continue; + } + /* Check for ACL topic access. */ + rc2 = mosquitto_acl_check(db, leaf->context, topic, MOSQ_ACL_READ); + if(rc2 == MOSQ_ERR_ACL_DENIED){ + leaf = leaf->next; + continue; + }else if(rc2 == MOSQ_ERR_SUCCESS){ + client_qos = leaf->qos; + + if(db->config->upgrade_outgoing_qos){ + msg_qos = client_qos; + }else{ + if(qos > client_qos){ + msg_qos = client_qos; + }else{ + msg_qos = qos; + } + } + if(msg_qos){ + mid = _mosquitto_mid_generate(leaf->context); + }else{ + mid = 0; + } + if(leaf->context->is_bridge){ + /* If we know the client is a bridge then we should set retain + * even if the message is fresh. If we don't do this, retained + * messages won't be propagated. */ + client_retain = retain; + }else{ + /* Client is not a bridge and this isn't a stale message so + * retain should be false. */ + client_retain = false; + } + if(mqtt3_db_message_insert(db, leaf->context, mid, mosq_md_out, msg_qos, client_retain, stored) == 1) rc = 1; + }else{ + return 1; /* Application error */ + } + leaf = leaf->next; + } + return rc; +} + +static struct _sub_token *_sub_topic_append(struct _sub_token **tail, struct _sub_token **topics, char *topic) +{ + struct _sub_token *new_topic; + + if(!topic){ + return NULL; + } + new_topic = _mosquitto_malloc(sizeof(struct _sub_token)); + if(!new_topic){ + _mosquitto_free(topic); + return NULL; + } + new_topic->next = NULL; + new_topic->topic = topic; + + if(*tail){ + (*tail)->next = new_topic; + *tail = (*tail)->next; + }else{ + *topics = new_topic; + *tail = new_topic; + } + return new_topic; +} + +static int _sub_topic_tokenise(const char *subtopic, struct _sub_token **topics) +{ + struct _sub_token *new_topic, *tail = NULL; + int len; + int start, stop, tlen; + int i; + char *topic; + + assert(subtopic); + assert(topics); + + if(subtopic[0] != '$'){ + new_topic = _sub_topic_append(&tail, topics, _mosquitto_strdup("")); + if(!new_topic) goto cleanup; + } + + len = strlen(subtopic); + + if(subtopic[0] == '/'){ + new_topic = _sub_topic_append(&tail, topics, _mosquitto_strdup("")); + if(!new_topic) goto cleanup; + + start = 1; + }else{ + start = 0; + } + + stop = 0; + for(i=start; itopic) _mosquitto_free(tail->topic); + new_topic = tail->next; + _mosquitto_free(tail); + tail = new_topic; + } + return 1; +} + +static void _sub_topic_tokens_free(struct _sub_token *tokens) +{ + struct _sub_token *tail; + + while(tokens){ + tail = tokens->next; + if(tokens->topic){ + _mosquitto_free(tokens->topic); + } + _mosquitto_free(tokens); + tokens = tail; + } +} + +static int _sub_add(struct mosquitto_db *db, struct mosquitto *context, int qos, struct _mosquitto_subhier *subhier, struct _sub_token *tokens) + /* FIXME - this function has the potential to leak subhier, audit calling functions. */ +{ + struct _mosquitto_subhier *branch, *last = NULL; + struct _mosquitto_subleaf *leaf, *last_leaf; + struct _mosquitto_subhier **subs; + int i; + + if(!tokens){ + if(context && context->id){ + leaf = subhier->subs; + last_leaf = NULL; + while(leaf){ + if(leaf->context && leaf->context->id && !strcmp(leaf->context->id, context->id)){ + /* Client making a second subscription to same topic. Only + * need to update QoS. Return -1 to indicate this to the + * calling function. */ + leaf->qos = qos; + if(context->protocol == mosq_p_mqtt31){ + return -1; + }else{ + /* mqttv311 requires retained messages are resent on + * resubscribe. */ + return 0; + } + } + last_leaf = leaf; + leaf = leaf->next; + } + leaf = _mosquitto_malloc(sizeof(struct _mosquitto_subleaf)); + if(!leaf) return MOSQ_ERR_NOMEM; + leaf->next = NULL; + leaf->context = context; + leaf->qos = qos; + for(i=0; isub_count; i++){ + if(!context->subs[i]){ + context->subs[i] = subhier; + break; + } + } + if(i == context->sub_count){ + subs = _mosquitto_realloc(context->subs, sizeof(struct _mosquitto_subhier *)*(context->sub_count + 1)); + if(!subs){ + _mosquitto_free(leaf); + return MOSQ_ERR_NOMEM; + } + context->subs = subs; + context->sub_count++; + context->subs[context->sub_count-1] = subhier; + } + if(last_leaf){ + last_leaf->next = leaf; + leaf->prev = last_leaf; + }else{ + subhier->subs = leaf; + leaf->prev = NULL; + } +#ifdef WITH_SYS_TREE + db->subscription_count++; +#endif + } + return MOSQ_ERR_SUCCESS; + } + + branch = subhier->children; + while(branch){ + if(!strcmp(branch->topic, tokens->topic)){ + return _sub_add(db, context, qos, branch, tokens->next); + } + last = branch; + branch = branch->next; + } + /* Not found */ + branch = _mosquitto_calloc(1, sizeof(struct _mosquitto_subhier)); + if(!branch) return MOSQ_ERR_NOMEM; + branch->parent = subhier; + branch->topic = _mosquitto_strdup(tokens->topic); + if(!branch->topic){ + _mosquitto_free(branch); + return MOSQ_ERR_NOMEM; + } + if(!last){ + subhier->children = branch; + }else{ + last->next = branch; + } + return _sub_add(db, context, qos, branch, tokens->next); +} + +static int _sub_remove(struct mosquitto_db *db, struct mosquitto *context, struct _mosquitto_subhier *subhier, struct _sub_token *tokens) +{ + struct _mosquitto_subhier *branch, *last = NULL; + struct _mosquitto_subleaf *leaf; + int i; + + if(!tokens){ + leaf = subhier->subs; + while(leaf){ + if(leaf->context==context){ +#ifdef WITH_SYS_TREE + db->subscription_count--; +#endif + if(leaf->prev){ + leaf->prev->next = leaf->next; + }else{ + subhier->subs = leaf->next; + } + if(leaf->next){ + leaf->next->prev = leaf->prev; + } + _mosquitto_free(leaf); + + /* Remove the reference to the sub that the client is keeping. + * It would be nice to be able to use the reference directly, + * but that would involve keeping a copy of the topic string in + * each subleaf. Might be worth considering though. */ + for(i=0; isub_count; i++){ + if(context->subs[i] == subhier){ + context->subs[i] = NULL; + break; + } + } + return MOSQ_ERR_SUCCESS; + } + leaf = leaf->next; + } + return MOSQ_ERR_SUCCESS; + } + + branch = subhier->children; + while(branch){ + if(!strcmp(branch->topic, tokens->topic)){ + _sub_remove(db, context, branch, tokens->next); + if(!branch->children && !branch->subs && !branch->retained){ + if(last){ + last->next = branch->next; + }else{ + subhier->children = branch->next; + } + _mosquitto_free(branch->topic); + _mosquitto_free(branch); + } + return MOSQ_ERR_SUCCESS; + } + last = branch; + branch = branch->next; + } + return MOSQ_ERR_SUCCESS; +} + +static void _sub_search(struct mosquitto_db *db, struct _mosquitto_subhier *subhier, struct _sub_token *tokens, const char *source_id, const char *topic, int qos, int retain, struct mosquitto_msg_store *stored, bool set_retain) +{ + /* FIXME - need to take into account source_id if the client is a bridge */ + struct _mosquitto_subhier *branch; + bool sr; + + branch = subhier->children; + while(branch){ + sr = set_retain; + + if(tokens && tokens->topic && (!strcmp(branch->topic, tokens->topic) || !strcmp(branch->topic, "+"))){ + /* The topic matches this subscription. + * Doesn't include # wildcards */ + if(!strcmp(branch->topic, "+")){ + /* Don't set a retained message where + is in the hierarchy. */ + sr = false; + } + _sub_search(db, branch, tokens->next, source_id, topic, qos, retain, stored, sr); + if(!tokens->next){ + _subs_process(db, branch, source_id, topic, qos, retain, stored, sr); + } + }else if(!strcmp(branch->topic, "#") && !branch->children){ + /* The topic matches due to a # wildcard - process the + * subscriptions but *don't* return. Although this branch has ended + * there may still be other subscriptions to deal with. + */ + _subs_process(db, branch, source_id, topic, qos, retain, stored, false); + } + branch = branch->next; + } +} + +int mqtt3_sub_add(struct mosquitto_db *db, struct mosquitto *context, const char *sub, int qos, struct _mosquitto_subhier *root) +{ + int rc = 0; + struct _mosquitto_subhier *subhier, *child; + struct _sub_token *tokens = NULL; + + assert(root); + assert(sub); + + if(_sub_topic_tokenise(sub, &tokens)) return 1; + + subhier = root->children; + while(subhier){ + if(!strcmp(subhier->topic, tokens->topic)){ + rc = _sub_add(db, context, qos, subhier, tokens); + break; + } + subhier = subhier->next; + } + if(!subhier){ + child = _mosquitto_malloc(sizeof(struct _mosquitto_subhier)); + if(!child){ + _sub_topic_tokens_free(tokens); + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + child->parent = root; + child->topic = _mosquitto_strdup(tokens->topic); + if(!child->topic){ + _sub_topic_tokens_free(tokens); + _mosquitto_free(child); + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); + return MOSQ_ERR_NOMEM; + } + child->subs = NULL; + child->children = NULL; + child->retained = NULL; + if(root->children){ + child->next = root->children; + }else{ + child->next = NULL; + } + root->children = child; + + rc = _sub_add(db, context, qos, child, tokens); + } + + _sub_topic_tokens_free(tokens); + + /* We aren't worried about -1 (already subscribed) return codes. */ + if(rc == -1) rc = MOSQ_ERR_SUCCESS; + return rc; +} + +int mqtt3_sub_remove(struct mosquitto_db *db, struct mosquitto *context, const char *sub, struct _mosquitto_subhier *root) +{ + int rc = 0; + struct _mosquitto_subhier *subhier; + struct _sub_token *tokens = NULL; + + assert(root); + assert(sub); + + if(_sub_topic_tokenise(sub, &tokens)) return 1; + + subhier = root->children; + while(subhier){ + if(!strcmp(subhier->topic, tokens->topic)){ + rc = _sub_remove(db, context, subhier, tokens); + break; + } + subhier = subhier->next; + } + + _sub_topic_tokens_free(tokens); + + return rc; +} + +int mqtt3_db_messages_queue(struct mosquitto_db *db, const char *source_id, const char *topic, int qos, int retain, struct mosquitto_msg_store **stored) +{ + int rc = 0; + struct _mosquitto_subhier *subhier; + struct _sub_token *tokens = NULL; + + assert(db); + assert(topic); + + if(_sub_topic_tokenise(topic, &tokens)) return 1; + + /* Protect this message until we have sent it to all + clients - this is required because websockets client calls + mqtt3_db_message_write(), which could remove the message if ref_count==0. + */ + (*stored)->ref_count++; + + subhier = db->subs.children; + while(subhier){ + if(!strcmp(subhier->topic, tokens->topic)){ + if(retain){ + /* We have a message that needs to be retained, so ensure that the subscription + * tree for its topic exists. + */ + _sub_add(db, NULL, 0, subhier, tokens); + } + _sub_search(db, subhier, tokens, source_id, topic, qos, retain, *stored, true); + } + subhier = subhier->next; + } + _sub_topic_tokens_free(tokens); + + /* Remove our reference and free if needed. */ + mosquitto__db_msg_store_deref(db, stored); + + return rc; +} + + +/* Remove a subhier element, and return its parent if that needs freeing as well. */ +static struct _mosquitto_subhier *tmp_remove_subs(struct _mosquitto_subhier *sub) +{ + struct _mosquitto_subhier *parent; + struct _mosquitto_subhier *hier; + struct _mosquitto_subhier *last = NULL; + + if(!sub || !sub->parent){ + return NULL; + } + + if(sub->children || sub->subs){ + return NULL; + } + + parent = sub->parent; + hier = sub->parent->children; + + while(hier){ + if(hier == sub){ + if(last){ + last->next = hier->next; + }else{ + parent->children = hier->next; + } + _mosquitto_free(sub->topic); + _mosquitto_free(sub); + break; + } + last = hier; + hier = hier->next; + } + if(parent->subs == NULL + && parent->children == NULL + && parent->retained == NULL + && parent->parent){ + + return parent; + }else{ + return NULL; + } +} + + +/* Remove all subscriptions for a client. + */ +int mqtt3_subs_clean_session(struct mosquitto_db *db, struct mosquitto *context) +{ + int i; + struct _mosquitto_subleaf *leaf; + struct _mosquitto_subhier *hier; + + for(i=0; isub_count; i++){ + if(context->subs[i] == NULL){ + continue; + } + leaf = context->subs[i]->subs; + while(leaf){ + if(leaf->context==context){ +#ifdef WITH_SYS_TREE + db->subscription_count--; +#endif + if(leaf->prev){ + leaf->prev->next = leaf->next; + }else{ + context->subs[i]->subs = leaf->next; + } + if(leaf->next){ + leaf->next->prev = leaf->prev; + } + _mosquitto_free(leaf); + break; + } + leaf = leaf->next; + } + if(context->subs[i]->subs == NULL + && context->subs[i]->children == NULL + && context->subs[i]->retained == NULL + && context->subs[i]->parent){ + + hier = context->subs[i]; + context->subs[i] = NULL; + do{ + hier = tmp_remove_subs(hier); + }while(hier); + } + } + _mosquitto_free(context->subs); + context->subs = NULL; + context->sub_count = 0; + + return MOSQ_ERR_SUCCESS; +} + +void mqtt3_sub_tree_print(struct _mosquitto_subhier *root, int level) +{ + int i; + struct _mosquitto_subhier *branch; + struct _mosquitto_subleaf *leaf; + + for(i=0; itopic); + leaf = root->subs; + while(leaf){ + if(leaf->context){ + printf(" (%s, %d)", leaf->context->id, leaf->qos); + }else{ + printf(" (%s, %d)", "", leaf->qos); + } + leaf = leaf->next; + } + if(root->retained){ + printf(" (r)"); + } + printf("\n"); + + branch = root->children; + while(branch){ + mqtt3_sub_tree_print(branch, level+1); + branch = branch->next; + } +} + +static int _retain_process(struct mosquitto_db *db, struct mosquitto_msg_store *retained, struct mosquitto *context, const char *sub, int sub_qos) +{ + int rc = 0; + int qos; + uint16_t mid; + + rc = mosquitto_acl_check(db, context, retained->topic, MOSQ_ACL_READ); + if(rc == MOSQ_ERR_ACL_DENIED){ + return MOSQ_ERR_SUCCESS; + }else if(rc != MOSQ_ERR_SUCCESS){ + return rc; + } + + qos = retained->qos; + + if(qos > sub_qos) qos = sub_qos; + if(qos > 0){ + mid = _mosquitto_mid_generate(context); + }else{ + mid = 0; + } + return mqtt3_db_message_insert(db, context, mid, mosq_md_out, qos, true, retained); +} + +static int _retain_search(struct mosquitto_db *db, struct _mosquitto_subhier *subhier, struct _sub_token *tokens, struct mosquitto *context, const char *sub, int sub_qos, int level) +{ + struct _mosquitto_subhier *branch; + int flag = 0; + + branch = subhier->children; + while(branch){ + /* Subscriptions with wildcards in aren't really valid topics to publish to + * so they can't have retained messages. + */ + if(!strcmp(tokens->topic, "#") && !tokens->next){ + /* Set flag to indicate that we should check for retained messages + * on "foo" when we are subscribing to e.g. "foo/#" and then exit + * this function and return to an earlier _retain_search(). + */ + flag = -1; + if(branch->retained){ + _retain_process(db, branch->retained, context, sub, sub_qos); + } + if(branch->children){ + _retain_search(db, branch, tokens, context, sub, sub_qos, level+1); + } + }else if(strcmp(branch->topic, "+") && (!strcmp(branch->topic, tokens->topic) || !strcmp(tokens->topic, "+"))){ + if(tokens->next){ + if(_retain_search(db, branch, tokens->next, context, sub, sub_qos, level+1) == -1 + || (!branch->next && tokens->next && !strcmp(tokens->next->topic, "#") && level>0)){ + + if(branch->retained){ + _retain_process(db, branch->retained, context, sub, sub_qos); + } + } + }else{ + if(branch->retained){ + _retain_process(db, branch->retained, context, sub, sub_qos); + } + } + } + + branch = branch->next; + } + return flag; +} + +int mqtt3_retain_queue(struct mosquitto_db *db, struct mosquitto *context, const char *sub, int sub_qos) +{ + struct _mosquitto_subhier *subhier; + struct _sub_token *tokens = NULL, *tail; + + assert(db); + assert(context); + assert(sub); + + if(_sub_topic_tokenise(sub, &tokens)) return 1; + + subhier = db->subs.children; + while(subhier){ + if(!strcmp(subhier->topic, tokens->topic)){ + _retain_search(db, subhier, tokens, context, sub, sub_qos, 0); + break; + } + subhier = subhier->next; + } + while(tokens){ + tail = tokens->next; + _mosquitto_free(tokens->topic); + _mosquitto_free(tokens); + tokens = tail; + } + + return MOSQ_ERR_SUCCESS; +} + diff --git a/src/libs/mosquitto/src/sys_tree.c b/src/libs/mosquitto/src/sys_tree.c new file mode 100644 index 0000000..be421b1 --- /dev/null +++ b/src/libs/mosquitto/src/sys_tree.c @@ -0,0 +1,333 @@ +/* +Copyright (c) 2009-2014 Roger Light + +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +and Eclipse Distribution License v1.0 which accompany this distribution. + +The Eclipse Public License is available at + http://www.eclipse.org/legal/epl-v10.html +and the Eclipse Distribution License is available at + http://www.eclipse.org/org/documents/edl-v10.php. + +Contributors: + Roger Light - initial implementation and documentation. +*/ + +#ifdef WITH_SYS_TREE + +#include +#include + +#include + +#include +#include +#include + +#define BUFLEN 100 + +uint64_t g_bytes_received = 0; +uint64_t g_bytes_sent = 0; +uint64_t g_pub_bytes_received = 0; +uint64_t g_pub_bytes_sent = 0; +unsigned long g_msgs_received = 0; +unsigned long g_msgs_sent = 0; +unsigned long g_pub_msgs_received = 0; +unsigned long g_pub_msgs_sent = 0; +unsigned long g_msgs_dropped = 0; +int g_clients_expired = 0; +unsigned int g_socket_connections = 0; +unsigned int g_connection_count = 0; + +static void _sys_update_clients(struct mosquitto_db *db, char *buf) +{ + static unsigned int client_count = -1; + static int clients_expired = -1; + static unsigned int client_max = 0; + static unsigned int disconnected_count = -1; + static unsigned int connected_count = -1; + + unsigned int count_total, count_by_sock; + + count_total = HASH_CNT(hh_id, db->contexts_by_id); + count_by_sock = HASH_CNT(hh_sock, db->contexts_by_sock); + + if(client_count != count_total){ + client_count = count_total; + snprintf(buf, BUFLEN, "%d", client_count); + mqtt3_db_messages_easy_queue(db, NULL, "$SYS/broker/clients/total", 2, strlen(buf), buf, 1); + + if(client_count > client_max){ + client_max = client_count; + snprintf(buf, BUFLEN, "%d", client_max); + mqtt3_db_messages_easy_queue(db, NULL, "$SYS/broker/clients/maximum", 2, strlen(buf), buf, 1); + } + } + + if(disconnected_count != count_total-count_by_sock){ + disconnected_count = count_total-count_by_sock; + snprintf(buf, BUFLEN, "%d", disconnected_count); + mqtt3_db_messages_easy_queue(db, NULL, "$SYS/broker/clients/inactive", 2, strlen(buf), buf, 1); + mqtt3_db_messages_easy_queue(db, NULL, "$SYS/broker/clients/disconnected", 2, strlen(buf), buf, 1); + } + if(connected_count != count_by_sock){ + connected_count = count_by_sock; + snprintf(buf, BUFLEN, "%d", connected_count); + mqtt3_db_messages_easy_queue(db, NULL, "$SYS/broker/clients/active", 2, strlen(buf), buf, 1); + mqtt3_db_messages_easy_queue(db, NULL, "$SYS/broker/clients/connected", 2, strlen(buf), buf, 1); + } + if(g_clients_expired != clients_expired){ + clients_expired = g_clients_expired; + snprintf(buf, BUFLEN, "%d", clients_expired); + mqtt3_db_messages_easy_queue(db, NULL, "$SYS/broker/clients/expired", 2, strlen(buf), buf, 1); + } +} + +#ifdef REAL_WITH_MEMORY_TRACKING +static void _sys_update_memory(struct mosquitto_db *db, char *buf) +{ + static unsigned long current_heap = -1; + static unsigned long max_heap = -1; + unsigned long value_ul; + + value_ul = _mosquitto_memory_used(); + if(current_heap != value_ul){ + current_heap = value_ul; + snprintf(buf, BUFLEN, "%lu", current_heap); + mqtt3_db_messages_easy_queue(db, NULL, "$SYS/broker/heap/current", 2, strlen(buf), buf, 1); + } + value_ul =_mosquitto_max_memory_used(); + if(max_heap != value_ul){ + max_heap = value_ul; + snprintf(buf, BUFLEN, "%lu", max_heap); + mqtt3_db_messages_easy_queue(db, NULL, "$SYS/broker/heap/maximum", 2, strlen(buf), buf, 1); + } +} +#endif + +static void calc_load(struct mosquitto_db *db, char *buf, const char *topic, double exponent, double interval, double *current) +{ + double new_value; + + new_value = interval + exponent*((*current) - interval); + if(fabs(new_value - (*current)) >= 0.01){ + snprintf(buf, BUFLEN, "%.2f", new_value); + mqtt3_db_messages_easy_queue(db, NULL, topic, 2, strlen(buf), buf, 1); + } + (*current) = new_value; +} + +/* Send messages for the $SYS hierarchy if the last update is longer than + * 'interval' seconds ago. + * 'interval' is the amount of seconds between updates. If 0, then no periodic + * messages are sent for the $SYS hierarchy. + * 'start_time' is the result of time() that the broker was started at. + */ +void mqtt3_db_sys_update(struct mosquitto_db *db, int interval, time_t start_time) +{ + static time_t last_update = 0; + time_t now; + time_t uptime; + char buf[BUFLEN]; + + static int msg_store_count = -1; + static unsigned long msgs_received = -1; + static unsigned long msgs_sent = -1; + static unsigned long publish_dropped = -1; + static unsigned long pub_msgs_received = -1; + static unsigned long pub_msgs_sent = -1; + static unsigned long long bytes_received = -1; + static unsigned long long bytes_sent = -1; + static unsigned long long pub_bytes_received = -1; + static unsigned long long pub_bytes_sent = -1; + static int subscription_count = -1; + static int retained_count = -1; + + static double msgs_received_load1 = 0; + static double msgs_received_load5 = 0; + static double msgs_received_load15 = 0; + static double msgs_sent_load1 = 0; + static double msgs_sent_load5 = 0; + static double msgs_sent_load15 = 0; + static double publish_dropped_load1 = 0; + static double publish_dropped_load5 = 0; + static double publish_dropped_load15 = 0; + double msgs_received_interval, msgs_sent_interval, publish_dropped_interval; + + static double publish_received_load1 = 0; + static double publish_received_load5 = 0; + static double publish_received_load15 = 0; + static double publish_sent_load1 = 0; + static double publish_sent_load5 = 0; + static double publish_sent_load15 = 0; + double publish_received_interval, publish_sent_interval; + + static double bytes_received_load1 = 0; + static double bytes_received_load5 = 0; + static double bytes_received_load15 = 0; + static double bytes_sent_load1 = 0; + static double bytes_sent_load5 = 0; + static double bytes_sent_load15 = 0; + double bytes_received_interval, bytes_sent_interval; + + static double socket_load1 = 0; + static double socket_load5 = 0; + static double socket_load15 = 0; + double socket_interval; + + static double connection_load1 = 0; + static double connection_load5 = 0; + static double connection_load15 = 0; + double connection_interval; + + double exponent; + double i_mult; + + now = mosquitto_time(); + + if(interval && now - interval > last_update){ + uptime = now - start_time; + snprintf(buf, BUFLEN, "%d seconds", (int)uptime); + mqtt3_db_messages_easy_queue(db, NULL, "$SYS/broker/uptime", 2, strlen(buf), buf, 1); + + _sys_update_clients(db, buf); + if(last_update > 0){ + i_mult = 60.0/(double)(now-last_update); + + msgs_received_interval = (g_msgs_received - msgs_received)*i_mult; + msgs_sent_interval = (g_msgs_sent - msgs_sent)*i_mult; + publish_dropped_interval = (g_msgs_dropped - publish_dropped)*i_mult; + + publish_received_interval = (g_pub_msgs_received - pub_msgs_received)*i_mult; + publish_sent_interval = (g_pub_msgs_sent - pub_msgs_sent)*i_mult; + + bytes_received_interval = (g_bytes_received - bytes_received)*i_mult; + bytes_sent_interval = (g_bytes_sent - bytes_sent)*i_mult; + + socket_interval = g_socket_connections*i_mult; + g_socket_connections = 0; + connection_interval = g_connection_count*i_mult; + g_connection_count = 0; + + /* 1 minute load */ + exponent = exp(-1.0*(now-last_update)/60.0); + + calc_load(db, buf, "$SYS/broker/load/messages/received/1min", exponent, msgs_received_interval, &msgs_received_load1); + calc_load(db, buf, "$SYS/broker/load/messages/sent/1min", exponent, msgs_sent_interval, &msgs_sent_load1); + calc_load(db, buf, "$SYS/broker/load/publish/dropped/1min", exponent, publish_dropped_interval, &publish_dropped_load1); + calc_load(db, buf, "$SYS/broker/load/publish/received/1min", exponent, publish_received_interval, &publish_received_load1); + calc_load(db, buf, "$SYS/broker/load/publish/sent/1min", exponent, publish_sent_interval, &publish_sent_load1); + calc_load(db, buf, "$SYS/broker/load/bytes/received/1min", exponent, bytes_received_interval, &bytes_received_load1); + calc_load(db, buf, "$SYS/broker/load/bytes/sent/1min", exponent, bytes_sent_interval, &bytes_sent_load1); + calc_load(db, buf, "$SYS/broker/load/sockets/1min", exponent, socket_interval, &socket_load1); + calc_load(db, buf, "$SYS/broker/load/connections/1min", exponent, connection_interval, &connection_load1); + + /* 5 minute load */ + exponent = exp(-1.0*(now-last_update)/300.0); + + calc_load(db, buf, "$SYS/broker/load/messages/received/5min", exponent, msgs_received_interval, &msgs_received_load5); + calc_load(db, buf, "$SYS/broker/load/messages/sent/5min", exponent, msgs_sent_interval, &msgs_sent_load5); + calc_load(db, buf, "$SYS/broker/load/publish/dropped/5min", exponent, publish_dropped_interval, &publish_dropped_load5); + calc_load(db, buf, "$SYS/broker/load/publish/received/5min", exponent, publish_received_interval, &publish_received_load5); + calc_load(db, buf, "$SYS/broker/load/publish/sent/5min", exponent, publish_sent_interval, &publish_sent_load5); + calc_load(db, buf, "$SYS/broker/load/bytes/received/5min", exponent, bytes_received_interval, &bytes_received_load5); + calc_load(db, buf, "$SYS/broker/load/bytes/sent/5min", exponent, bytes_sent_interval, &bytes_sent_load5); + calc_load(db, buf, "$SYS/broker/load/sockets/5min", exponent, socket_interval, &socket_load5); + calc_load(db, buf, "$SYS/broker/load/connections/5min", exponent, connection_interval, &connection_load5); + + /* 15 minute load */ + exponent = exp(-1.0*(now-last_update)/900.0); + + calc_load(db, buf, "$SYS/broker/load/messages/received/15min", exponent, msgs_received_interval, &msgs_received_load15); + calc_load(db, buf, "$SYS/broker/load/messages/sent/15min", exponent, msgs_sent_interval, &msgs_sent_load15); + calc_load(db, buf, "$SYS/broker/load/publish/dropped/15min", exponent, publish_dropped_interval, &publish_dropped_load15); + calc_load(db, buf, "$SYS/broker/load/publish/received/15min", exponent, publish_received_interval, &publish_received_load15); + calc_load(db, buf, "$SYS/broker/load/publish/sent/15min", exponent, publish_sent_interval, &publish_sent_load15); + calc_load(db, buf, "$SYS/broker/load/bytes/received/15min", exponent, bytes_received_interval, &bytes_received_load15); + calc_load(db, buf, "$SYS/broker/load/bytes/sent/15min", exponent, bytes_sent_interval, &bytes_sent_load15); + calc_load(db, buf, "$SYS/broker/load/sockets/15min", exponent, socket_interval, &socket_load15); + calc_load(db, buf, "$SYS/broker/load/connections/15min", exponent, connection_interval, &connection_load15); + } + + if(db->msg_store_count != msg_store_count){ + msg_store_count = db->msg_store_count; + snprintf(buf, BUFLEN, "%d", msg_store_count); + mqtt3_db_messages_easy_queue(db, NULL, "$SYS/broker/messages/stored", 2, strlen(buf), buf, 1); + } + + if(db->subscription_count != subscription_count){ + subscription_count = db->subscription_count; + snprintf(buf, BUFLEN, "%d", subscription_count); + mqtt3_db_messages_easy_queue(db, NULL, "$SYS/broker/subscriptions/count", 2, strlen(buf), buf, 1); + } + + if(db->retained_count != retained_count){ + retained_count = db->retained_count; + snprintf(buf, BUFLEN, "%d", retained_count); + mqtt3_db_messages_easy_queue(db, NULL, "$SYS/broker/retained messages/count", 2, strlen(buf), buf, 1); + } + +#ifdef REAL_WITH_MEMORY_TRACKING + _sys_update_memory(db, buf); +#endif + + if(msgs_received != g_msgs_received){ + msgs_received = g_msgs_received; + snprintf(buf, BUFLEN, "%lu", msgs_received); + mqtt3_db_messages_easy_queue(db, NULL, "$SYS/broker/messages/received", 2, strlen(buf), buf, 1); + } + + if(msgs_sent != g_msgs_sent){ + msgs_sent = g_msgs_sent; + snprintf(buf, BUFLEN, "%lu", msgs_sent); + mqtt3_db_messages_easy_queue(db, NULL, "$SYS/broker/messages/sent", 2, strlen(buf), buf, 1); + } + + if(publish_dropped != g_msgs_dropped){ + publish_dropped = g_msgs_dropped; + snprintf(buf, BUFLEN, "%lu", publish_dropped); + mqtt3_db_messages_easy_queue(db, NULL, "$SYS/broker/publish/messages/dropped", 2, strlen(buf), buf, 1); + } + + if(pub_msgs_received != g_pub_msgs_received){ + pub_msgs_received = g_pub_msgs_received; + snprintf(buf, BUFLEN, "%lu", pub_msgs_received); + mqtt3_db_messages_easy_queue(db, NULL, "$SYS/broker/publish/messages/received", 2, strlen(buf), buf, 1); + } + + if(pub_msgs_sent != g_pub_msgs_sent){ + pub_msgs_sent = g_pub_msgs_sent; + snprintf(buf, BUFLEN, "%lu", pub_msgs_sent); + mqtt3_db_messages_easy_queue(db, NULL, "$SYS/broker/publish/messages/sent", 2, strlen(buf), buf, 1); + } + + if(bytes_received != g_bytes_received){ + bytes_received = g_bytes_received; + snprintf(buf, BUFLEN, "%llu", bytes_received); + mqtt3_db_messages_easy_queue(db, NULL, "$SYS/broker/bytes/received", 2, strlen(buf), buf, 1); + } + + if(bytes_sent != g_bytes_sent){ + bytes_sent = g_bytes_sent; + snprintf(buf, BUFLEN, "%llu", bytes_sent); + mqtt3_db_messages_easy_queue(db, NULL, "$SYS/broker/bytes/sent", 2, strlen(buf), buf, 1); + } + + if(pub_bytes_received != g_pub_bytes_received){ + pub_bytes_received = g_pub_bytes_received; + snprintf(buf, BUFLEN, "%llu", pub_bytes_received); + mqtt3_db_messages_easy_queue(db, NULL, "$SYS/broker/publish/bytes/received", 2, strlen(buf), buf, 1); + } + + if(pub_bytes_sent != g_pub_bytes_sent){ + pub_bytes_sent = g_pub_bytes_sent; + snprintf(buf, BUFLEN, "%llu", pub_bytes_sent); + mqtt3_db_messages_easy_queue(db, NULL, "$SYS/broker/publish/bytes/sent", 2, strlen(buf), buf, 1); + } + + last_update = mosquitto_time(); + } +} + +#endif diff --git a/src/libs/mosquitto/src/uthash.h b/src/libs/mosquitto/src/uthash.h new file mode 100644 index 0000000..915a825 --- /dev/null +++ b/src/libs/mosquitto/src/uthash.h @@ -0,0 +1,948 @@ +/* +Copyright (c) 2003-2013, Troy D. Hanson http://troydhanson.github.com/uthash/ +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef UTHASH_H +#define UTHASH_H + +#include /* memcmp,strlen */ +#include /* ptrdiff_t */ +#include /* exit() */ + +/* These macros use decltype or the earlier __typeof GNU extension. + As decltype is only available in newer compilers (VS2010 or gcc 4.3+ + when compiling c++ source) this code uses whatever method is needed + or, for VS2008 where neither is available, uses casting workarounds. */ +#ifdef _MSC_VER /* MS compiler */ +#if _MSC_VER >= 1600 && defined(__cplusplus) /* VS2010 or newer in C++ mode */ +#define DECLTYPE(x) (decltype(x)) +#else /* VS2008 or older (or VS2010 in C mode) */ +#define NO_DECLTYPE +#define DECLTYPE(x) +#endif +#else /* GNU, Sun and other compilers */ +#define DECLTYPE(x) (__typeof(x)) +#endif + +#ifdef NO_DECLTYPE +#define DECLTYPE_ASSIGN(dst,src) \ +do { \ + char **_da_dst = (char**)(&(dst)); \ + *_da_dst = (char*)(src); \ +} while(0) +#else +#define DECLTYPE_ASSIGN(dst,src) \ +do { \ + (dst) = DECLTYPE(dst)(src); \ +} while(0) +#endif + +/* a number of the hash function use uint32_t which isn't defined on win32 */ +#ifdef _MSC_VER +typedef unsigned int uint32_t; +typedef unsigned char uint8_t; +#else +#include /* uint32_t */ +#endif + +#define UTHASH_VERSION 1.9.8 + +#ifndef uthash_fatal +#define uthash_fatal(msg) exit(-1) /* fatal error (out of memory,etc) */ +#endif +#ifndef uthash_malloc +#define uthash_malloc(sz) malloc(sz) /* malloc fcn */ +#endif +#ifndef uthash_free +#define uthash_free(ptr,sz) free(ptr) /* free fcn */ +#endif + +#ifndef uthash_noexpand_fyi +#define uthash_noexpand_fyi(tbl) /* can be defined to log noexpand */ +#endif +#ifndef uthash_expand_fyi +#define uthash_expand_fyi(tbl) /* can be defined to log expands */ +#endif + +/* initial number of buckets */ +#define HASH_INITIAL_NUM_BUCKETS 32 /* initial number of buckets */ +#define HASH_INITIAL_NUM_BUCKETS_LOG2 5 /* lg2 of initial number of buckets */ +#define HASH_BKT_CAPACITY_THRESH 10 /* expand when bucket count reaches */ + +/* calculate the element whose hash handle address is hhe */ +#define ELMT_FROM_HH(tbl,hhp) ((void*)(((char*)(hhp)) - ((tbl)->hho))) + +#define HASH_FIND(hh,head,keyptr,keylen,out) \ +do { \ + unsigned _hf_bkt,_hf_hashv; \ + out=NULL; \ + if (head) { \ + HASH_FCN(keyptr,keylen, (head)->hh.tbl->num_buckets, _hf_hashv, _hf_bkt); \ + if (HASH_BLOOM_TEST((head)->hh.tbl, _hf_hashv)) { \ + HASH_FIND_IN_BKT((head)->hh.tbl, hh, (head)->hh.tbl->buckets[ _hf_bkt ], \ + keyptr,keylen,out); \ + } \ + } \ +} while (0) + +#ifdef HASH_BLOOM +#define HASH_BLOOM_BITLEN (1ULL << HASH_BLOOM) +#define HASH_BLOOM_BYTELEN (HASH_BLOOM_BITLEN/8) + ((HASH_BLOOM_BITLEN%8) ? 1:0) +#define HASH_BLOOM_MAKE(tbl) \ +do { \ + (tbl)->bloom_nbits = HASH_BLOOM; \ + (tbl)->bloom_bv = (uint8_t*)uthash_malloc(HASH_BLOOM_BYTELEN); \ + if (!((tbl)->bloom_bv)) { uthash_fatal( "out of memory"); } \ + memset((tbl)->bloom_bv, 0, HASH_BLOOM_BYTELEN); \ + (tbl)->bloom_sig = HASH_BLOOM_SIGNATURE; \ +} while (0) + +#define HASH_BLOOM_FREE(tbl) \ +do { \ + uthash_free((tbl)->bloom_bv, HASH_BLOOM_BYTELEN); \ +} while (0) + +#define HASH_BLOOM_BITSET(bv,idx) (bv[(idx)/8] |= (1U << ((idx)%8))) +#define HASH_BLOOM_BITTEST(bv,idx) (bv[(idx)/8] & (1U << ((idx)%8))) + +#define HASH_BLOOM_ADD(tbl,hashv) \ + HASH_BLOOM_BITSET((tbl)->bloom_bv, (hashv & (uint32_t)((1ULL << (tbl)->bloom_nbits) - 1))) + +#define HASH_BLOOM_TEST(tbl,hashv) \ + HASH_BLOOM_BITTEST((tbl)->bloom_bv, (hashv & (uint32_t)((1ULL << (tbl)->bloom_nbits) - 1))) + +#else +#define HASH_BLOOM_MAKE(tbl) +#define HASH_BLOOM_FREE(tbl) +#define HASH_BLOOM_ADD(tbl,hashv) +#define HASH_BLOOM_TEST(tbl,hashv) (1) +#define HASH_BLOOM_BYTELEN 0 +#endif + +#define HASH_MAKE_TABLE(hh,head) \ +do { \ + (head)->hh.tbl = (UT_hash_table*)uthash_malloc( \ + sizeof(UT_hash_table)); \ + if (!((head)->hh.tbl)) { uthash_fatal( "out of memory"); } \ + memset((head)->hh.tbl, 0, sizeof(UT_hash_table)); \ + (head)->hh.tbl->tail = &((head)->hh); \ + (head)->hh.tbl->num_buckets = HASH_INITIAL_NUM_BUCKETS; \ + (head)->hh.tbl->log2_num_buckets = HASH_INITIAL_NUM_BUCKETS_LOG2; \ + (head)->hh.tbl->hho = (char*)(&(head)->hh) - (char*)(head); \ + (head)->hh.tbl->buckets = (UT_hash_bucket*)uthash_malloc( \ + HASH_INITIAL_NUM_BUCKETS*sizeof(struct UT_hash_bucket)); \ + if (! (head)->hh.tbl->buckets) { uthash_fatal( "out of memory"); } \ + memset((head)->hh.tbl->buckets, 0, \ + HASH_INITIAL_NUM_BUCKETS*sizeof(struct UT_hash_bucket)); \ + HASH_BLOOM_MAKE((head)->hh.tbl); \ + (head)->hh.tbl->signature = HASH_SIGNATURE; \ +} while(0) + +#define HASH_ADD(hh,head,fieldname,keylen_in,add) \ + HASH_ADD_KEYPTR(hh,head,&((add)->fieldname),keylen_in,add) + +#define HASH_REPLACE(hh,head,fieldname,keylen_in,add,replaced) \ +do { \ + replaced=NULL; \ + HASH_FIND(hh,head,&((add)->fieldname),keylen_in,replaced); \ + if (replaced!=NULL) { \ + HASH_DELETE(hh,head,replaced); \ + }; \ + HASH_ADD(hh,head,fieldname,keylen_in,add); \ +} while(0) + +#define HASH_ADD_KEYPTR(hh,head,keyptr,keylen_in,add) \ +do { \ + unsigned _ha_bkt; \ + (add)->hh.next = NULL; \ + (add)->hh.key = (char*)keyptr; \ + (add)->hh.keylen = (unsigned)keylen_in; \ + if (!(head)) { \ + head = (add); \ + (head)->hh.prev = NULL; \ + HASH_MAKE_TABLE(hh,head); \ + } else { \ + (head)->hh.tbl->tail->next = (add); \ + (add)->hh.prev = ELMT_FROM_HH((head)->hh.tbl, (head)->hh.tbl->tail); \ + (head)->hh.tbl->tail = &((add)->hh); \ + } \ + (head)->hh.tbl->num_items++; \ + (add)->hh.tbl = (head)->hh.tbl; \ + HASH_FCN(keyptr,keylen_in, (head)->hh.tbl->num_buckets, \ + (add)->hh.hashv, _ha_bkt); \ + HASH_ADD_TO_BKT((head)->hh.tbl->buckets[_ha_bkt],&(add)->hh); \ + HASH_BLOOM_ADD((head)->hh.tbl,(add)->hh.hashv); \ + HASH_EMIT_KEY(hh,head,keyptr,keylen_in); \ + HASH_FSCK(hh,head); \ +} while(0) + +#define HASH_TO_BKT( hashv, num_bkts, bkt ) \ +do { \ + bkt = ((hashv) & ((num_bkts) - 1)); \ +} while(0) + +/* delete "delptr" from the hash table. + * "the usual" patch-up process for the app-order doubly-linked-list. + * The use of _hd_hh_del below deserves special explanation. + * These used to be expressed using (delptr) but that led to a bug + * if someone used the same symbol for the head and deletee, like + * HASH_DELETE(hh,users,users); + * We want that to work, but by changing the head (users) below + * we were forfeiting our ability to further refer to the deletee (users) + * in the patch-up process. Solution: use scratch space to + * copy the deletee pointer, then the latter references are via that + * scratch pointer rather than through the repointed (users) symbol. + */ +#define HASH_DELETE(hh,head,delptr) \ +do { \ + unsigned _hd_bkt; \ + struct UT_hash_handle *_hd_hh_del; \ + if ( ((delptr)->hh.prev == NULL) && ((delptr)->hh.next == NULL) ) { \ + uthash_free((head)->hh.tbl->buckets, \ + (head)->hh.tbl->num_buckets*sizeof(struct UT_hash_bucket) ); \ + HASH_BLOOM_FREE((head)->hh.tbl); \ + uthash_free((head)->hh.tbl, sizeof(UT_hash_table)); \ + head = NULL; \ + } else { \ + _hd_hh_del = &((delptr)->hh); \ + if ((delptr) == ELMT_FROM_HH((head)->hh.tbl,(head)->hh.tbl->tail)) { \ + (head)->hh.tbl->tail = \ + (UT_hash_handle*)((ptrdiff_t)((delptr)->hh.prev) + \ + (head)->hh.tbl->hho); \ + } \ + if ((delptr)->hh.prev) { \ + ((UT_hash_handle*)((ptrdiff_t)((delptr)->hh.prev) + \ + (head)->hh.tbl->hho))->next = (delptr)->hh.next; \ + } else { \ + DECLTYPE_ASSIGN(head,(delptr)->hh.next); \ + } \ + if (_hd_hh_del->next) { \ + ((UT_hash_handle*)((ptrdiff_t)_hd_hh_del->next + \ + (head)->hh.tbl->hho))->prev = \ + _hd_hh_del->prev; \ + } \ + HASH_TO_BKT( _hd_hh_del->hashv, (head)->hh.tbl->num_buckets, _hd_bkt); \ + HASH_DEL_IN_BKT(hh,(head)->hh.tbl->buckets[_hd_bkt], _hd_hh_del); \ + (head)->hh.tbl->num_items--; \ + } \ + HASH_FSCK(hh,head); \ +} while (0) + + +/* convenience forms of HASH_FIND/HASH_ADD/HASH_DEL */ +#define HASH_FIND_STR(head,findstr,out) \ + HASH_FIND(hh,head,findstr,strlen(findstr),out) +#define HASH_ADD_STR(head,strfield,add) \ + HASH_ADD(hh,head,strfield,strlen(add->strfield),add) +#define HASH_REPLACE_STR(head,strfield,add,replaced) \ + HASH_REPLACE(hh,head,strfield,strlen(add->strfield),add,replaced) +#define HASH_FIND_INT(head,findint,out) \ + HASH_FIND(hh,head,findint,sizeof(int),out) +#define HASH_ADD_INT(head,intfield,add) \ + HASH_ADD(hh,head,intfield,sizeof(int),add) +#define HASH_REPLACE_INT(head,intfield,add,replaced) \ + HASH_REPLACE(hh,head,intfield,sizeof(int),add,replaced) +#define HASH_FIND_PTR(head,findptr,out) \ + HASH_FIND(hh,head,findptr,sizeof(void *),out) +#define HASH_ADD_PTR(head,ptrfield,add) \ + HASH_ADD(hh,head,ptrfield,sizeof(void *),add) +#define HASH_REPLACE_PTR(head,ptrfield,add) \ + HASH_REPLACE(hh,head,ptrfield,sizeof(void *),add,replaced) +#define HASH_DEL(head,delptr) \ + HASH_DELETE(hh,head,delptr) + +/* HASH_FSCK checks hash integrity on every add/delete when HASH_DEBUG is defined. + * This is for uthash developer only; it compiles away if HASH_DEBUG isn't defined. + */ +#ifdef HASH_DEBUG +#define HASH_OOPS(...) do { fprintf(stderr,__VA_ARGS__); exit(-1); } while (0) +#define HASH_FSCK(hh,head) \ +do { \ + unsigned _bkt_i; \ + unsigned _count, _bkt_count; \ + char *_prev; \ + struct UT_hash_handle *_thh; \ + if (head) { \ + _count = 0; \ + for( _bkt_i = 0; _bkt_i < (head)->hh.tbl->num_buckets; _bkt_i++) { \ + _bkt_count = 0; \ + _thh = (head)->hh.tbl->buckets[_bkt_i].hh_head; \ + _prev = NULL; \ + while (_thh) { \ + if (_prev != (char*)(_thh->hh_prev)) { \ + HASH_OOPS("invalid hh_prev %p, actual %p\n", \ + _thh->hh_prev, _prev ); \ + } \ + _bkt_count++; \ + _prev = (char*)(_thh); \ + _thh = _thh->hh_next; \ + } \ + _count += _bkt_count; \ + if ((head)->hh.tbl->buckets[_bkt_i].count != _bkt_count) { \ + HASH_OOPS("invalid bucket count %d, actual %d\n", \ + (head)->hh.tbl->buckets[_bkt_i].count, _bkt_count); \ + } \ + } \ + if (_count != (head)->hh.tbl->num_items) { \ + HASH_OOPS("invalid hh item count %d, actual %d\n", \ + (head)->hh.tbl->num_items, _count ); \ + } \ + /* traverse hh in app order; check next/prev integrity, count */ \ + _count = 0; \ + _prev = NULL; \ + _thh = &(head)->hh; \ + while (_thh) { \ + _count++; \ + if (_prev !=(char*)(_thh->prev)) { \ + HASH_OOPS("invalid prev %p, actual %p\n", \ + _thh->prev, _prev ); \ + } \ + _prev = (char*)ELMT_FROM_HH((head)->hh.tbl, _thh); \ + _thh = ( _thh->next ? (UT_hash_handle*)((char*)(_thh->next) + \ + (head)->hh.tbl->hho) : NULL ); \ + } \ + if (_count != (head)->hh.tbl->num_items) { \ + HASH_OOPS("invalid app item count %d, actual %d\n", \ + (head)->hh.tbl->num_items, _count ); \ + } \ + } \ +} while (0) +#else +#define HASH_FSCK(hh,head) +#endif + +/* When compiled with -DHASH_EMIT_KEYS, length-prefixed keys are emitted to + * the descriptor to which this macro is defined for tuning the hash function. + * The app can #include to get the prototype for write(2). */ +#ifdef HASH_EMIT_KEYS +#define HASH_EMIT_KEY(hh,head,keyptr,fieldlen) \ +do { \ + unsigned _klen = fieldlen; \ + write(HASH_EMIT_KEYS, &_klen, sizeof(_klen)); \ + write(HASH_EMIT_KEYS, keyptr, fieldlen); \ +} while (0) +#else +#define HASH_EMIT_KEY(hh,head,keyptr,fieldlen) +#endif + +/* default to Jenkin's hash unless overridden e.g. DHASH_FUNCTION=HASH_SAX */ +#ifdef HASH_FUNCTION +#define HASH_FCN HASH_FUNCTION +#else +#define HASH_FCN HASH_JEN +#endif + +/* The Bernstein hash function, used in Perl prior to v5.6 */ +#define HASH_BER(key,keylen,num_bkts,hashv,bkt) \ +do { \ + unsigned _hb_keylen=keylen; \ + char *_hb_key=(char*)(key); \ + (hashv) = 0; \ + while (_hb_keylen--) { (hashv) = ((hashv) * 33) + *_hb_key++; } \ + bkt = (hashv) & (num_bkts-1); \ +} while (0) + + +/* SAX/FNV/OAT/JEN hash functions are macro variants of those listed at + * http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_hashing.aspx */ +#define HASH_SAX(key,keylen,num_bkts,hashv,bkt) \ +do { \ + unsigned _sx_i; \ + char *_hs_key=(char*)(key); \ + hashv = 0; \ + for(_sx_i=0; _sx_i < keylen; _sx_i++) \ + hashv ^= (hashv << 5) + (hashv >> 2) + _hs_key[_sx_i]; \ + bkt = hashv & (num_bkts-1); \ +} while (0) + +#define HASH_FNV(key,keylen,num_bkts,hashv,bkt) \ +do { \ + unsigned _fn_i; \ + char *_hf_key=(char*)(key); \ + hashv = 2166136261UL; \ + for(_fn_i=0; _fn_i < keylen; _fn_i++) \ + hashv = (hashv * 16777619) ^ _hf_key[_fn_i]; \ + bkt = hashv & (num_bkts-1); \ +} while(0) + +#define HASH_OAT(key,keylen,num_bkts,hashv,bkt) \ +do { \ + unsigned _ho_i; \ + char *_ho_key=(char*)(key); \ + hashv = 0; \ + for(_ho_i=0; _ho_i < keylen; _ho_i++) { \ + hashv += _ho_key[_ho_i]; \ + hashv += (hashv << 10); \ + hashv ^= (hashv >> 6); \ + } \ + hashv += (hashv << 3); \ + hashv ^= (hashv >> 11); \ + hashv += (hashv << 15); \ + bkt = hashv & (num_bkts-1); \ +} while(0) + +#define HASH_JEN_MIX(a,b,c) \ +do { \ + a -= b; a -= c; a ^= ( c >> 13 ); \ + b -= c; b -= a; b ^= ( a << 8 ); \ + c -= a; c -= b; c ^= ( b >> 13 ); \ + a -= b; a -= c; a ^= ( c >> 12 ); \ + b -= c; b -= a; b ^= ( a << 16 ); \ + c -= a; c -= b; c ^= ( b >> 5 ); \ + a -= b; a -= c; a ^= ( c >> 3 ); \ + b -= c; b -= a; b ^= ( a << 10 ); \ + c -= a; c -= b; c ^= ( b >> 15 ); \ +} while (0) + +#define HASH_JEN(key,keylen,num_bkts,hashv,bkt) \ +do { \ + unsigned _hj_i,_hj_j,_hj_k; \ + unsigned char *_hj_key=(unsigned char*)(key); \ + hashv = 0xfeedbeef; \ + _hj_i = _hj_j = 0x9e3779b9; \ + _hj_k = (unsigned)keylen; \ + while (_hj_k >= 12) { \ + _hj_i += (_hj_key[0] + ( (unsigned)_hj_key[1] << 8 ) \ + + ( (unsigned)_hj_key[2] << 16 ) \ + + ( (unsigned)_hj_key[3] << 24 ) ); \ + _hj_j += (_hj_key[4] + ( (unsigned)_hj_key[5] << 8 ) \ + + ( (unsigned)_hj_key[6] << 16 ) \ + + ( (unsigned)_hj_key[7] << 24 ) ); \ + hashv += (_hj_key[8] + ( (unsigned)_hj_key[9] << 8 ) \ + + ( (unsigned)_hj_key[10] << 16 ) \ + + ( (unsigned)_hj_key[11] << 24 ) ); \ + \ + HASH_JEN_MIX(_hj_i, _hj_j, hashv); \ + \ + _hj_key += 12; \ + _hj_k -= 12; \ + } \ + hashv += keylen; \ + switch ( _hj_k ) { \ + case 11: hashv += ( (unsigned)_hj_key[10] << 24 ); \ + case 10: hashv += ( (unsigned)_hj_key[9] << 16 ); \ + case 9: hashv += ( (unsigned)_hj_key[8] << 8 ); \ + case 8: _hj_j += ( (unsigned)_hj_key[7] << 24 ); \ + case 7: _hj_j += ( (unsigned)_hj_key[6] << 16 ); \ + case 6: _hj_j += ( (unsigned)_hj_key[5] << 8 ); \ + case 5: _hj_j += _hj_key[4]; \ + case 4: _hj_i += ( (unsigned)_hj_key[3] << 24 ); \ + case 3: _hj_i += ( (unsigned)_hj_key[2] << 16 ); \ + case 2: _hj_i += ( (unsigned)_hj_key[1] << 8 ); \ + case 1: _hj_i += _hj_key[0]; \ + } \ + HASH_JEN_MIX(_hj_i, _hj_j, hashv); \ + bkt = hashv & (num_bkts-1); \ +} while(0) + +/* The Paul Hsieh hash function */ +#undef get16bits +#if (defined(__GNUC__) && defined(__i386__)) || defined(__WATCOMC__) \ + || defined(_MSC_VER) || defined (__BORLANDC__) || defined (__TURBOC__) +#define get16bits(d) (*((const uint16_t *) (d))) +#endif + +#if !defined (get16bits) +#define get16bits(d) ((((uint32_t)(((const uint8_t *)(d))[1])) << 8) \ + +(uint32_t)(((const uint8_t *)(d))[0]) ) +#endif +#define HASH_SFH(key,keylen,num_bkts,hashv,bkt) \ +do { \ + unsigned char *_sfh_key=(unsigned char*)(key); \ + uint32_t _sfh_tmp, _sfh_len = keylen; \ + \ + int _sfh_rem = _sfh_len & 3; \ + _sfh_len >>= 2; \ + hashv = 0xcafebabe; \ + \ + /* Main loop */ \ + for (;_sfh_len > 0; _sfh_len--) { \ + hashv += get16bits (_sfh_key); \ + _sfh_tmp = (uint32_t)(get16bits (_sfh_key+2)) << 11 ^ hashv; \ + hashv = (hashv << 16) ^ _sfh_tmp; \ + _sfh_key += 2*sizeof (uint16_t); \ + hashv += hashv >> 11; \ + } \ + \ + /* Handle end cases */ \ + switch (_sfh_rem) { \ + case 3: hashv += get16bits (_sfh_key); \ + hashv ^= hashv << 16; \ + hashv ^= (uint32_t)(_sfh_key[sizeof (uint16_t)] << 18); \ + hashv += hashv >> 11; \ + break; \ + case 2: hashv += get16bits (_sfh_key); \ + hashv ^= hashv << 11; \ + hashv += hashv >> 17; \ + break; \ + case 1: hashv += *_sfh_key; \ + hashv ^= hashv << 10; \ + hashv += hashv >> 1; \ + } \ + \ + /* Force "avalanching" of final 127 bits */ \ + hashv ^= hashv << 3; \ + hashv += hashv >> 5; \ + hashv ^= hashv << 4; \ + hashv += hashv >> 17; \ + hashv ^= hashv << 25; \ + hashv += hashv >> 6; \ + bkt = hashv & (num_bkts-1); \ +} while(0) + +#ifdef HASH_USING_NO_STRICT_ALIASING +/* The MurmurHash exploits some CPU's (x86,x86_64) tolerance for unaligned reads. + * For other types of CPU's (e.g. Sparc) an unaligned read causes a bus error. + * MurmurHash uses the faster approach only on CPU's where we know it's safe. + * + * Note the preprocessor built-in defines can be emitted using: + * + * gcc -m64 -dM -E - < /dev/null (on gcc) + * cc -## a.c (where a.c is a simple test file) (Sun Studio) + */ +#if (defined(__i386__) || defined(__x86_64__) || defined(_M_IX86)) +#define MUR_GETBLOCK(p,i) p[i] +#else /* non intel */ +#define MUR_PLUS0_ALIGNED(p) (((unsigned long)p & 0x3) == 0) +#define MUR_PLUS1_ALIGNED(p) (((unsigned long)p & 0x3) == 1) +#define MUR_PLUS2_ALIGNED(p) (((unsigned long)p & 0x3) == 2) +#define MUR_PLUS3_ALIGNED(p) (((unsigned long)p & 0x3) == 3) +#define WP(p) ((uint32_t*)((unsigned long)(p) & ~3UL)) +#if (defined(__BIG_ENDIAN__) || defined(SPARC) || defined(__ppc__) || defined(__ppc64__)) +#define MUR_THREE_ONE(p) ((((*WP(p))&0x00ffffff) << 8) | (((*(WP(p)+1))&0xff000000) >> 24)) +#define MUR_TWO_TWO(p) ((((*WP(p))&0x0000ffff) <<16) | (((*(WP(p)+1))&0xffff0000) >> 16)) +#define MUR_ONE_THREE(p) ((((*WP(p))&0x000000ff) <<24) | (((*(WP(p)+1))&0xffffff00) >> 8)) +#else /* assume little endian non-intel */ +#define MUR_THREE_ONE(p) ((((*WP(p))&0xffffff00) >> 8) | (((*(WP(p)+1))&0x000000ff) << 24)) +#define MUR_TWO_TWO(p) ((((*WP(p))&0xffff0000) >>16) | (((*(WP(p)+1))&0x0000ffff) << 16)) +#define MUR_ONE_THREE(p) ((((*WP(p))&0xff000000) >>24) | (((*(WP(p)+1))&0x00ffffff) << 8)) +#endif +#define MUR_GETBLOCK(p,i) (MUR_PLUS0_ALIGNED(p) ? ((p)[i]) : \ + (MUR_PLUS1_ALIGNED(p) ? MUR_THREE_ONE(p) : \ + (MUR_PLUS2_ALIGNED(p) ? MUR_TWO_TWO(p) : \ + MUR_ONE_THREE(p)))) +#endif +#define MUR_ROTL32(x,r) (((x) << (r)) | ((x) >> (32 - (r)))) +#define MUR_FMIX(_h) \ +do { \ + _h ^= _h >> 16; \ + _h *= 0x85ebca6b; \ + _h ^= _h >> 13; \ + _h *= 0xc2b2ae35l; \ + _h ^= _h >> 16; \ +} while(0) + +#define HASH_MUR(key,keylen,num_bkts,hashv,bkt) \ +do { \ + const uint8_t *_mur_data = (const uint8_t*)(key); \ + const int _mur_nblocks = (keylen) / 4; \ + uint32_t _mur_h1 = 0xf88D5353; \ + uint32_t _mur_c1 = 0xcc9e2d51; \ + uint32_t _mur_c2 = 0x1b873593; \ + uint32_t _mur_k1 = 0; \ + const uint8_t *_mur_tail; \ + const uint32_t *_mur_blocks = (const uint32_t*)(_mur_data+_mur_nblocks*4); \ + int _mur_i; \ + for(_mur_i = -_mur_nblocks; _mur_i; _mur_i++) { \ + _mur_k1 = MUR_GETBLOCK(_mur_blocks,_mur_i); \ + _mur_k1 *= _mur_c1; \ + _mur_k1 = MUR_ROTL32(_mur_k1,15); \ + _mur_k1 *= _mur_c2; \ + \ + _mur_h1 ^= _mur_k1; \ + _mur_h1 = MUR_ROTL32(_mur_h1,13); \ + _mur_h1 = _mur_h1*5+0xe6546b64; \ + } \ + _mur_tail = (const uint8_t*)(_mur_data + _mur_nblocks*4); \ + _mur_k1=0; \ + switch((keylen) & 3) { \ + case 3: _mur_k1 ^= _mur_tail[2] << 16; \ + case 2: _mur_k1 ^= _mur_tail[1] << 8; \ + case 1: _mur_k1 ^= _mur_tail[0]; \ + _mur_k1 *= _mur_c1; \ + _mur_k1 = MUR_ROTL32(_mur_k1,15); \ + _mur_k1 *= _mur_c2; \ + _mur_h1 ^= _mur_k1; \ + } \ + _mur_h1 ^= (keylen); \ + MUR_FMIX(_mur_h1); \ + hashv = _mur_h1; \ + bkt = hashv & (num_bkts-1); \ +} while(0) +#endif /* HASH_USING_NO_STRICT_ALIASING */ + +/* key comparison function; return 0 if keys equal */ +#define HASH_KEYCMP(a,b,len) memcmp(a,b,len) + +/* iterate over items in a known bucket to find desired item */ +#define HASH_FIND_IN_BKT(tbl,hh,head,keyptr,keylen_in,out) \ +do { \ + if (head.hh_head) DECLTYPE_ASSIGN(out,ELMT_FROM_HH(tbl,head.hh_head)); \ + else out=NULL; \ + while (out) { \ + if ((out)->hh.keylen == keylen_in) { \ + if ((HASH_KEYCMP((out)->hh.key,keyptr,keylen_in)) == 0) break; \ + } \ + if ((out)->hh.hh_next) DECLTYPE_ASSIGN(out,ELMT_FROM_HH(tbl,(out)->hh.hh_next)); \ + else out = NULL; \ + } \ +} while(0) + +/* add an item to a bucket */ +#define HASH_ADD_TO_BKT(head,addhh) \ +do { \ + head.count++; \ + (addhh)->hh_next = head.hh_head; \ + (addhh)->hh_prev = NULL; \ + if (head.hh_head) { (head).hh_head->hh_prev = (addhh); } \ + (head).hh_head=addhh; \ + if (head.count >= ((head.expand_mult+1) * HASH_BKT_CAPACITY_THRESH) \ + && (addhh)->tbl->noexpand != 1) { \ + HASH_EXPAND_BUCKETS((addhh)->tbl); \ + } \ +} while(0) + +/* remove an item from a given bucket */ +#define HASH_DEL_IN_BKT(hh,head,hh_del) \ + (head).count--; \ + if ((head).hh_head == hh_del) { \ + (head).hh_head = hh_del->hh_next; \ + } \ + if (hh_del->hh_prev) { \ + hh_del->hh_prev->hh_next = hh_del->hh_next; \ + } \ + if (hh_del->hh_next) { \ + hh_del->hh_next->hh_prev = hh_del->hh_prev; \ + } + +/* Bucket expansion has the effect of doubling the number of buckets + * and redistributing the items into the new buckets. Ideally the + * items will distribute more or less evenly into the new buckets + * (the extent to which this is true is a measure of the quality of + * the hash function as it applies to the key domain). + * + * With the items distributed into more buckets, the chain length + * (item count) in each bucket is reduced. Thus by expanding buckets + * the hash keeps a bound on the chain length. This bounded chain + * length is the essence of how a hash provides constant time lookup. + * + * The calculation of tbl->ideal_chain_maxlen below deserves some + * explanation. First, keep in mind that we're calculating the ideal + * maximum chain length based on the *new* (doubled) bucket count. + * In fractions this is just n/b (n=number of items,b=new num buckets). + * Since the ideal chain length is an integer, we want to calculate + * ceil(n/b). We don't depend on floating point arithmetic in this + * hash, so to calculate ceil(n/b) with integers we could write + * + * ceil(n/b) = (n/b) + ((n%b)?1:0) + * + * and in fact a previous version of this hash did just that. + * But now we have improved things a bit by recognizing that b is + * always a power of two. We keep its base 2 log handy (call it lb), + * so now we can write this with a bit shift and logical AND: + * + * ceil(n/b) = (n>>lb) + ( (n & (b-1)) ? 1:0) + * + */ +#define HASH_EXPAND_BUCKETS(tbl) \ +do { \ + unsigned _he_bkt; \ + unsigned _he_bkt_i; \ + struct UT_hash_handle *_he_thh, *_he_hh_nxt; \ + UT_hash_bucket *_he_new_buckets, *_he_newbkt; \ + _he_new_buckets = (UT_hash_bucket*)uthash_malloc( \ + 2 * tbl->num_buckets * sizeof(struct UT_hash_bucket)); \ + if (!_he_new_buckets) { uthash_fatal( "out of memory"); } \ + memset(_he_new_buckets, 0, \ + 2 * tbl->num_buckets * sizeof(struct UT_hash_bucket)); \ + tbl->ideal_chain_maxlen = \ + (tbl->num_items >> (tbl->log2_num_buckets+1)) + \ + ((tbl->num_items & ((tbl->num_buckets*2)-1)) ? 1 : 0); \ + tbl->nonideal_items = 0; \ + for(_he_bkt_i = 0; _he_bkt_i < tbl->num_buckets; _he_bkt_i++) \ + { \ + _he_thh = tbl->buckets[ _he_bkt_i ].hh_head; \ + while (_he_thh) { \ + _he_hh_nxt = _he_thh->hh_next; \ + HASH_TO_BKT( _he_thh->hashv, tbl->num_buckets*2, _he_bkt); \ + _he_newbkt = &(_he_new_buckets[ _he_bkt ]); \ + if (++(_he_newbkt->count) > tbl->ideal_chain_maxlen) { \ + tbl->nonideal_items++; \ + _he_newbkt->expand_mult = _he_newbkt->count / \ + tbl->ideal_chain_maxlen; \ + } \ + _he_thh->hh_prev = NULL; \ + _he_thh->hh_next = _he_newbkt->hh_head; \ + if (_he_newbkt->hh_head) _he_newbkt->hh_head->hh_prev = \ + _he_thh; \ + _he_newbkt->hh_head = _he_thh; \ + _he_thh = _he_hh_nxt; \ + } \ + } \ + uthash_free( tbl->buckets, tbl->num_buckets*sizeof(struct UT_hash_bucket) ); \ + tbl->num_buckets *= 2; \ + tbl->log2_num_buckets++; \ + tbl->buckets = _he_new_buckets; \ + tbl->ineff_expands = (tbl->nonideal_items > (tbl->num_items >> 1)) ? \ + (tbl->ineff_expands+1) : 0; \ + if (tbl->ineff_expands > 1) { \ + tbl->noexpand=1; \ + uthash_noexpand_fyi(tbl); \ + } \ + uthash_expand_fyi(tbl); \ +} while(0) + + +/* This is an adaptation of Simon Tatham's O(n log(n)) mergesort */ +/* Note that HASH_SORT assumes the hash handle name to be hh. + * HASH_SRT was added to allow the hash handle name to be passed in. */ +#define HASH_SORT(head,cmpfcn) HASH_SRT(hh,head,cmpfcn) +#define HASH_SRT(hh,head,cmpfcn) \ +do { \ + unsigned _hs_i; \ + unsigned _hs_looping,_hs_nmerges,_hs_insize,_hs_psize,_hs_qsize; \ + struct UT_hash_handle *_hs_p, *_hs_q, *_hs_e, *_hs_list, *_hs_tail; \ + if (head) { \ + _hs_insize = 1; \ + _hs_looping = 1; \ + _hs_list = &((head)->hh); \ + while (_hs_looping) { \ + _hs_p = _hs_list; \ + _hs_list = NULL; \ + _hs_tail = NULL; \ + _hs_nmerges = 0; \ + while (_hs_p) { \ + _hs_nmerges++; \ + _hs_q = _hs_p; \ + _hs_psize = 0; \ + for ( _hs_i = 0; _hs_i < _hs_insize; _hs_i++ ) { \ + _hs_psize++; \ + _hs_q = (UT_hash_handle*)((_hs_q->next) ? \ + ((void*)((char*)(_hs_q->next) + \ + (head)->hh.tbl->hho)) : NULL); \ + if (! (_hs_q) ) break; \ + } \ + _hs_qsize = _hs_insize; \ + while ((_hs_psize > 0) || ((_hs_qsize > 0) && _hs_q )) { \ + if (_hs_psize == 0) { \ + _hs_e = _hs_q; \ + _hs_q = (UT_hash_handle*)((_hs_q->next) ? \ + ((void*)((char*)(_hs_q->next) + \ + (head)->hh.tbl->hho)) : NULL); \ + _hs_qsize--; \ + } else if ( (_hs_qsize == 0) || !(_hs_q) ) { \ + _hs_e = _hs_p; \ + if (_hs_p){ \ + _hs_p = (UT_hash_handle*)((_hs_p->next) ? \ + ((void*)((char*)(_hs_p->next) + \ + (head)->hh.tbl->hho)) : NULL); \ + } \ + _hs_psize--; \ + } else if (( \ + cmpfcn(DECLTYPE(head)(ELMT_FROM_HH((head)->hh.tbl,_hs_p)), \ + DECLTYPE(head)(ELMT_FROM_HH((head)->hh.tbl,_hs_q))) \ + ) <= 0) { \ + _hs_e = _hs_p; \ + if (_hs_p){ \ + _hs_p = (UT_hash_handle*)((_hs_p->next) ? \ + ((void*)((char*)(_hs_p->next) + \ + (head)->hh.tbl->hho)) : NULL); \ + } \ + _hs_psize--; \ + } else { \ + _hs_e = _hs_q; \ + _hs_q = (UT_hash_handle*)((_hs_q->next) ? \ + ((void*)((char*)(_hs_q->next) + \ + (head)->hh.tbl->hho)) : NULL); \ + _hs_qsize--; \ + } \ + if ( _hs_tail ) { \ + _hs_tail->next = ((_hs_e) ? \ + ELMT_FROM_HH((head)->hh.tbl,_hs_e) : NULL); \ + } else { \ + _hs_list = _hs_e; \ + } \ + if (_hs_e) { \ + _hs_e->prev = ((_hs_tail) ? \ + ELMT_FROM_HH((head)->hh.tbl,_hs_tail) : NULL); \ + } \ + _hs_tail = _hs_e; \ + } \ + _hs_p = _hs_q; \ + } \ + if (_hs_tail){ \ + _hs_tail->next = NULL; \ + } \ + if ( _hs_nmerges <= 1 ) { \ + _hs_looping=0; \ + (head)->hh.tbl->tail = _hs_tail; \ + DECLTYPE_ASSIGN(head,ELMT_FROM_HH((head)->hh.tbl, _hs_list)); \ + } \ + _hs_insize *= 2; \ + } \ + HASH_FSCK(hh,head); \ + } \ +} while (0) + +/* This function selects items from one hash into another hash. + * The end result is that the selected items have dual presence + * in both hashes. There is no copy of the items made; rather + * they are added into the new hash through a secondary hash + * hash handle that must be present in the structure. */ +#define HASH_SELECT(hh_dst, dst, hh_src, src, cond) \ +do { \ + unsigned _src_bkt, _dst_bkt; \ + void *_last_elt=NULL, *_elt; \ + UT_hash_handle *_src_hh, *_dst_hh, *_last_elt_hh=NULL; \ + ptrdiff_t _dst_hho = ((char*)(&(dst)->hh_dst) - (char*)(dst)); \ + if (src) { \ + for(_src_bkt=0; _src_bkt < (src)->hh_src.tbl->num_buckets; _src_bkt++) { \ + for(_src_hh = (src)->hh_src.tbl->buckets[_src_bkt].hh_head; \ + _src_hh; \ + _src_hh = _src_hh->hh_next) { \ + _elt = ELMT_FROM_HH((src)->hh_src.tbl, _src_hh); \ + if (cond(_elt)) { \ + _dst_hh = (UT_hash_handle*)(((char*)_elt) + _dst_hho); \ + _dst_hh->key = _src_hh->key; \ + _dst_hh->keylen = _src_hh->keylen; \ + _dst_hh->hashv = _src_hh->hashv; \ + _dst_hh->prev = _last_elt; \ + _dst_hh->next = NULL; \ + if (_last_elt_hh) { _last_elt_hh->next = _elt; } \ + if (!dst) { \ + DECLTYPE_ASSIGN(dst,_elt); \ + HASH_MAKE_TABLE(hh_dst,dst); \ + } else { \ + _dst_hh->tbl = (dst)->hh_dst.tbl; \ + } \ + HASH_TO_BKT(_dst_hh->hashv, _dst_hh->tbl->num_buckets, _dst_bkt); \ + HASH_ADD_TO_BKT(_dst_hh->tbl->buckets[_dst_bkt],_dst_hh); \ + (dst)->hh_dst.tbl->num_items++; \ + _last_elt = _elt; \ + _last_elt_hh = _dst_hh; \ + } \ + } \ + } \ + } \ + HASH_FSCK(hh_dst,dst); \ +} while (0) + +#define HASH_CLEAR(hh,head) \ +do { \ + if (head) { \ + uthash_free((head)->hh.tbl->buckets, \ + (head)->hh.tbl->num_buckets*sizeof(struct UT_hash_bucket)); \ + HASH_BLOOM_FREE((head)->hh.tbl); \ + uthash_free((head)->hh.tbl, sizeof(UT_hash_table)); \ + (head)=NULL; \ + } \ +} while(0) + +#define HASH_OVERHEAD(hh,head) \ + (size_t)((((head)->hh.tbl->num_items * sizeof(UT_hash_handle)) + \ + ((head)->hh.tbl->num_buckets * sizeof(UT_hash_bucket)) + \ + (sizeof(UT_hash_table)) + \ + (HASH_BLOOM_BYTELEN))) + +#ifdef NO_DECLTYPE +#define HASH_ITER(hh,head,el,tmp) \ +for((el)=(head), (*(char**)(&(tmp)))=(char*)((head)?(head)->hh.next:NULL); \ + el; (el)=(tmp),(*(char**)(&(tmp)))=(char*)((tmp)?(tmp)->hh.next:NULL)) +#else +#define HASH_ITER(hh,head,el,tmp) \ +for((el)=(head),(tmp)=DECLTYPE(el)((head)?(head)->hh.next:NULL); \ + el; (el)=(tmp),(tmp)=DECLTYPE(el)((tmp)?(tmp)->hh.next:NULL)) +#endif + +/* obtain a count of items in the hash */ +#define HASH_COUNT(head) HASH_CNT(hh,head) +#define HASH_CNT(hh,head) ((head)?((head)->hh.tbl->num_items):0) + +typedef struct UT_hash_bucket { + struct UT_hash_handle *hh_head; + unsigned count; + + /* expand_mult is normally set to 0. In this situation, the max chain length + * threshold is enforced at its default value, HASH_BKT_CAPACITY_THRESH. (If + * the bucket's chain exceeds this length, bucket expansion is triggered). + * However, setting expand_mult to a non-zero value delays bucket expansion + * (that would be triggered by additions to this particular bucket) + * until its chain length reaches a *multiple* of HASH_BKT_CAPACITY_THRESH. + * (The multiplier is simply expand_mult+1). The whole idea of this + * multiplier is to reduce bucket expansions, since they are expensive, in + * situations where we know that a particular bucket tends to be overused. + * It is better to let its chain length grow to a longer yet-still-bounded + * value, than to do an O(n) bucket expansion too often. + */ + unsigned expand_mult; + +} UT_hash_bucket; + +/* random signature used only to find hash tables in external analysis */ +#define HASH_SIGNATURE 0xa0111fe1 +#define HASH_BLOOM_SIGNATURE 0xb12220f2 + +typedef struct UT_hash_table { + UT_hash_bucket *buckets; + unsigned num_buckets, log2_num_buckets; + unsigned num_items; + struct UT_hash_handle *tail; /* tail hh in app order, for fast append */ + ptrdiff_t hho; /* hash handle offset (byte pos of hash handle in element */ + + /* in an ideal situation (all buckets used equally), no bucket would have + * more than ceil(#items/#buckets) items. that's the ideal chain length. */ + unsigned ideal_chain_maxlen; + + /* nonideal_items is the number of items in the hash whose chain position + * exceeds the ideal chain maxlen. these items pay the penalty for an uneven + * hash distribution; reaching them in a chain traversal takes >ideal steps */ + unsigned nonideal_items; + + /* ineffective expands occur when a bucket doubling was performed, but + * afterward, more than half the items in the hash had nonideal chain + * positions. If this happens on two consecutive expansions we inhibit any + * further expansion, as it's not helping; this happens when the hash + * function isn't a good fit for the key domain. When expansion is inhibited + * the hash will still work, albeit no longer in constant time. */ + unsigned ineff_expands, noexpand; + + uint32_t signature; /* used only to find hash tables in external analysis */ +#ifdef HASH_BLOOM + uint32_t bloom_sig; /* used only to test bloom exists in external analysis */ + uint8_t *bloom_bv; + char bloom_nbits; +#endif + +} UT_hash_table; + +typedef struct UT_hash_handle { + struct UT_hash_table *tbl; + void *prev; /* prev element in app order */ + void *next; /* next element in app order */ + struct UT_hash_handle *hh_prev; /* previous hh in bucket order */ + struct UT_hash_handle *hh_next; /* next hh in bucket order */ + void *key; /* ptr to enclosing struct's key */ + unsigned keylen; /* enclosing struct's key len */ + unsigned hashv; /* result of hash-fcn(key) */ +} UT_hash_handle; + +#endif /* UTHASH_H */ diff --git a/src/libs/mosquitto/src/websockets.c b/src/libs/mosquitto/src/websockets.c new file mode 100644 index 0000000..dde0c9c --- /dev/null +++ b/src/libs/mosquitto/src/websockets.c @@ -0,0 +1,693 @@ +/* +Copyright (c) 2014 Roger Light +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. Neither the name of mosquitto nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifdef WITH_WEBSOCKETS + +#include +#include "mosquitto_internal.h" +#include "mosquitto_broker.h" +#include "mqtt3_protocol.h" +#include "memory_mosq.h" + +#include +#include +#include + +#ifdef WITH_SYS_TREE +extern uint64_t g_bytes_received; +extern uint64_t g_bytes_sent; +extern unsigned long g_msgs_received; +extern unsigned long g_msgs_sent; +extern unsigned long g_pub_msgs_received; +extern unsigned long g_pub_msgs_sent; +#endif +extern struct mosquitto_db int_db; + +#if defined(LWS_LIBRARY_VERSION_NUMBER) +static int callback_mqtt( +#else +static int callback_mqtt(struct libwebsocket_context *context, +#endif + struct libwebsocket *wsi, + enum libwebsocket_callback_reasons reason, + void *user, + void *in, + size_t len); + +#if defined(LWS_LIBRARY_VERSION_NUMBER) +static int callback_http( +#else +static int callback_http(struct libwebsocket_context *context, +#endif + struct libwebsocket *wsi, + enum libwebsocket_callback_reasons reason, + void *user, + void *in, + size_t len); + +enum mosq_ws_protocols { + PROTOCOL_HTTP = 0, + PROTOCOL_MQTT, + DEMO_PROTOCOL_COUNT +}; + +struct libws_http_data { + FILE *fptr; +}; + +#ifndef LWS_FEATURE_SERVE_HTTP_FILE_HAS_OTHER_HEADERS_ARG + /* This is libwebsockets 1.2.x or earlier, we have to degrade our capabilities. + * Once lws 1.3 is widely available this should be removed. */ +# define LWS_IS_OLD +# define HTTP_STATUS_FORBIDDEN 403 +# define HTTP_STATUS_NOT_FOUND 404 +# define HTTP_STATUS_METHOD_NOT_ALLOWED 405 +# define HTTP_STATUS_REQ_URI_TOO_LONG 414 +# define HTTP_STATUS_INTERNAL_SERVER_ERROR 500 +# define libwebsockets_return_http_status(A, B, C, D) +#endif + +static struct libwebsocket_protocols protocols[] = { + /* first protocol must always be HTTP handler */ + { + "http-only", + callback_http, + sizeof (struct libws_http_data), + 0, +#ifdef LWS_FEATURE_PROTOCOLS_HAS_ID_FIELD + 0, +#endif + NULL, +#if !defined(LWS_LIBRARY_VERSION_NUMBER) + 0 +#endif + }, + { + "mqtt", + callback_mqtt, + sizeof(struct libws_mqtt_data), + 0, +#ifdef LWS_FEATURE_PROTOCOLS_HAS_ID_FIELD + 1, +#endif + NULL, +#if !defined(LWS_LIBRARY_VERSION_NUMBER) + 0 +#endif + }, + { + "mqttv3.1", + callback_mqtt, + sizeof(struct libws_mqtt_data), + 0, +#ifdef LWS_FEATURE_PROTOCOLS_HAS_ID_FIELD + 1, +#endif + NULL, +#if !defined(LWS_LIBRARY_VERSION_NUMBER) + 0 +#endif + }, +#ifdef LWS_FEATURE_PROTOCOLS_HAS_ID_FIELD +# if defined(LWS_LIBRARY_VERSION_NUMBER) + { NULL, NULL, 0, 0, 0, NULL} +# else + { NULL, NULL, 0, 0, 0, NULL, 0} +# endif +#else + { NULL, NULL, 0, 0, NULL, 0} +#endif +}; + +static void easy_address(int sock, struct mosquitto *mosq) +{ + char address[1024]; + + if(!_mosquitto_socket_get_address(sock, address, 1024)){ + mosq->address = _mosquitto_strdup(address); + } +} + +#if defined(LWS_LIBRARY_VERSION_NUMBER) +static int callback_mqtt( +#else +static int callback_mqtt(struct libwebsocket_context *context, +#endif + struct libwebsocket *wsi, + enum libwebsocket_callback_reasons reason, + void *user, + void *in, + size_t len) +{ + struct mosquitto_db *db; + struct mosquitto *mosq = NULL; + struct _mosquitto_packet *packet; + int count, i, j; + const struct libwebsocket_protocols *p; + struct libws_mqtt_data *u = (struct libws_mqtt_data *)user; + size_t pos; + uint8_t *buf; + int rc; + uint8_t byte; + + db = &int_db; + + switch (reason) { + case LWS_CALLBACK_ESTABLISHED: + mosq = mqtt3_context_init(db, WEBSOCKET_CLIENT); + if(mosq){ + p = libwebsockets_get_protocol(wsi); + for (i=0; iconfig->listener_count; i++){ + if (db->config->listeners[i].protocol == mp_websockets) { + for (j=0; db->config->listeners[i].ws_protocol[j].name; j++){ + if (p == &db->config->listeners[i].ws_protocol[j]){ + mosq->listener = &db->config->listeners[i]; + mosq->listener->client_count++; + } + } + } + } + if(!mosq->listener){ + _mosquitto_free(mosq); + return -1; + } +#if !defined(LWS_LIBRARY_VERSION_NUMBER) + mosq->ws_context = context; +#endif + mosq->wsi = wsi; + u->mosq = mosq; + }else{ + return -1; + } + easy_address(libwebsocket_get_socket_fd(wsi), mosq); + if(!mosq->address){ + /* getpeername and inet_ntop failed and not a bridge */ + _mosquitto_free(mosq); + u->mosq = NULL; + return -1; + } + if(mosq->listener->max_connections > 0 && mosq->listener->client_count > mosq->listener->max_connections){ + _mosquitto_log_printf(NULL, MOSQ_LOG_NOTICE, "Client connection from %s denied: max_connections exceeded.", mosq->address); + _mosquitto_free(mosq); + u->mosq = NULL; + return -1; + } + mosq->sock = libwebsocket_get_socket_fd(wsi); + HASH_ADD(hh_sock, db->contexts_by_sock, sock, sizeof(mosq->sock), mosq); + break; + + case LWS_CALLBACK_CLOSED: + if(!u){ + return -1; + } + mosq = u->mosq; + if(mosq){ + if(mosq->sock > 0){ + HASH_DELETE(hh_sock, db->contexts_by_sock, mosq); + mosq->sock = INVALID_SOCKET; + mosq->pollfd_index = -1; + } + mosq->wsi = NULL; + do_disconnect(db, mosq); + } + break; + + case LWS_CALLBACK_SERVER_WRITEABLE: + if(!u){ + return -1; + } + mosq = u->mosq; + if(!mosq || mosq->state == mosq_cs_disconnect_ws || mosq->state == mosq_cs_disconnecting){ + return -1; + } + + mqtt3_db_message_write(db, mosq); + + if(mosq->out_packet && !mosq->current_out_packet){ + mosq->current_out_packet = mosq->out_packet; + mosq->out_packet = mosq->out_packet->next; + if(!mosq->out_packet){ + mosq->out_packet_last = NULL; + } + } + + if(mosq->current_out_packet && !lws_send_pipe_choked(mosq->wsi)){ + packet = mosq->current_out_packet; + + if(packet->pos == 0 && packet->to_process == packet->packet_length){ + /* First time this packet has been dealt with. + * libwebsockets requires that the payload has + * LWS_SEND_BUFFER_PRE_PADDING space available before the + * actual data and LWS_SEND_BUFFER_POST_PADDING afterwards. + * We've already made the payload big enough to allow this, + * but need to move it into position here. */ + memmove(&packet->payload[LWS_SEND_BUFFER_PRE_PADDING], packet->payload, packet->packet_length); + packet->pos += LWS_SEND_BUFFER_PRE_PADDING; + } + count = libwebsocket_write(wsi, &packet->payload[packet->pos], packet->to_process, LWS_WRITE_BINARY); +#ifdef LWS_IS_OLD + /* lws < 1.3 doesn't return a valid count, assume everything sent. */ + count = packet->to_process; +#endif + if(count < 0){ + return 0; + } + packet->to_process -= count; + packet->pos += count; + if(packet->to_process > 0){ + break; + } + + /* Free data and reset values */ + mosq->current_out_packet = mosq->out_packet; + if(mosq->out_packet){ + mosq->out_packet = mosq->out_packet->next; + if(!mosq->out_packet){ + mosq->out_packet_last = NULL; + } + } + + _mosquitto_packet_cleanup(packet); + _mosquitto_free(packet); + + mosq->next_msg_out = mosquitto_time() + mosq->keepalive; + } + if(mosq->current_out_packet){ + libwebsocket_callback_on_writable(mosq->ws_context, mosq->wsi); + } + break; + + case LWS_CALLBACK_RECEIVE: + if(!u || !u->mosq){ + return -1; + } + mosq = u->mosq; + pos = 0; + buf = (uint8_t *)in; +#ifdef WITH_SYS_TREE + g_bytes_received += len; +#endif + while(pos < len){ + if(!mosq->in_packet.command){ + mosq->in_packet.command = buf[pos]; + pos++; + /* Clients must send CONNECT as their first command. */ + if(mosq->state == mosq_cs_new && (mosq->in_packet.command&0xF0) != CONNECT){ + return -1; + } + } + if(mosq->in_packet.remaining_count <= 0){ + do{ + if(pos == len){ + return 0; + } + byte = buf[pos]; + pos++; + + mosq->in_packet.remaining_count--; + /* Max 4 bytes length for remaining length as defined by protocol. + * Anything more likely means a broken/malicious client. + */ + if(mosq->in_packet.remaining_count < -4){ + return -1; + } + + mosq->in_packet.remaining_length += (byte & 127) * mosq->in_packet.remaining_mult; + mosq->in_packet.remaining_mult *= 128; + }while((byte & 128) != 0); + mosq->in_packet.remaining_count *= -1; + + if(mosq->in_packet.remaining_length > 0){ + mosq->in_packet.payload = _mosquitto_malloc(mosq->in_packet.remaining_length*sizeof(uint8_t)); + if(!mosq->in_packet.payload){ + return -1; + } + mosq->in_packet.to_process = mosq->in_packet.remaining_length; + } + } + if(mosq->in_packet.to_process>0){ + if(len - pos >= mosq->in_packet.to_process){ + memcpy(&mosq->in_packet.payload[mosq->in_packet.pos], &buf[pos], mosq->in_packet.to_process); + mosq->in_packet.pos += mosq->in_packet.to_process; + pos += mosq->in_packet.to_process; + mosq->in_packet.to_process = 0; + }else{ + memcpy(&mosq->in_packet.payload[mosq->in_packet.pos], &buf[pos], len-pos); + mosq->in_packet.pos += len-pos; + mosq->in_packet.to_process -= len-pos; + return 0; + } + } + /* All data for this packet is read. */ + mosq->in_packet.pos = 0; +#ifdef WITH_SYS_TREE + g_msgs_received++; + if(((mosq->in_packet.command)&0xF5) == PUBLISH){ + g_pub_msgs_received++; + } +#endif + rc = mqtt3_packet_handle(db, mosq); + + /* Free data and reset values */ + _mosquitto_packet_cleanup(&mosq->in_packet); + + mosq->last_msg_in = mosquitto_time(); + + if(rc){ + do_disconnect(db, mosq); + return -1; + } + } + break; + + default: + break; + } + + return 0; +} + + +#if defined(LWS_LIBRARY_VERSION_NUMBER) +static int callback_http( +#else +static int callback_http(struct libwebsocket_context *context, +#endif + struct libwebsocket *wsi, + enum libwebsocket_callback_reasons reason, + void *user, + void *in, + size_t len) +{ + struct libws_http_data *u = (struct libws_http_data *)user; + struct libws_mqtt_hack *hack; + char *http_dir; + size_t buflen, slen; +#ifndef LWS_IS_OLD + size_t wlen; +#endif + char *filename, *filename_canonical; + unsigned char buf[4096]; + struct stat filestat; + struct mosquitto_db *db = &int_db; + struct mosquitto *mosq; + struct lws_pollargs *pollargs = (struct lws_pollargs *)in; + + /* FIXME - ssl cert verification is done here. */ + + switch (reason) { + case LWS_CALLBACK_HTTP: + if(!u){ + return -1; + } + +#if defined(LWS_LIBRARY_VERSION_NUMBER) + hack = (struct libws_mqtt_hack *)lws_context_user(lws_get_context(wsi)); +#else + hack = (struct libws_mqtt_hack *)libwebsocket_context_user(context); +#endif + if(!hack){ + return -1; + } + http_dir = hack->http_dir; + + if(!http_dir){ + /* http disabled */ + return -1; + } + +#ifndef LWS_IS_OLD + /* Forbid POST */ + if(lws_hdr_total_length(wsi, WSI_TOKEN_POST_URI)){ + libwebsockets_return_http_status(context, wsi, HTTP_STATUS_METHOD_NOT_ALLOWED, NULL); + return -1; + } +#endif + + if(!strcmp((char *)in, "/")){ + slen = strlen(http_dir) + strlen("/index.html") + 2; + }else{ + slen = strlen(http_dir) + strlen((char *)in) + 2; + } + filename = _mosquitto_malloc(slen); + if(!filename){ + libwebsockets_return_http_status(context, wsi, HTTP_STATUS_INTERNAL_SERVER_ERROR, NULL); + return -1; + } + if(!strcmp((char *)in, "/")){ + snprintf(filename, slen, "%s/index.html", http_dir); + }else{ + snprintf(filename, slen, "%s%s", http_dir, (char *)in); + } + + + /* Get canonical path and check it is within our http_dir */ +#ifdef WIN32 + filename_canonical = _fullpath(NULL, filename, 0); + if(!filename_canonical){ + _mosquitto_free(filename); + libwebsockets_return_http_status(context, wsi, HTTP_STATUS_INTERNAL_SERVER_ERROR, NULL); + return -1; + } +#else + filename_canonical = realpath(filename, NULL); + if(!filename_canonical){ + _mosquitto_free(filename); + if(errno == EACCES){ + libwebsockets_return_http_status(context, wsi, HTTP_STATUS_FORBIDDEN, NULL); + }else if(errno == EINVAL || errno == EIO || errno == ELOOP){ + libwebsockets_return_http_status(context, wsi, HTTP_STATUS_INTERNAL_SERVER_ERROR, NULL); + }else if(errno == ENAMETOOLONG){ + libwebsockets_return_http_status(context, wsi, HTTP_STATUS_REQ_URI_TOO_LONG, NULL); + }else if(errno == ENOENT || errno == ENOTDIR){ + libwebsockets_return_http_status(context, wsi, HTTP_STATUS_NOT_FOUND, NULL); + } + return -1; + } +#endif + if(strncmp(http_dir, filename_canonical, strlen(http_dir))){ + /* Requested file isn't within http_dir, deny access. */ + free(filename_canonical); + _mosquitto_free(filename); + libwebsockets_return_http_status(context, wsi, HTTP_STATUS_FORBIDDEN, NULL); + return -1; + } + free(filename_canonical); + + _mosquitto_log_printf(NULL, MOSQ_LOG_DEBUG, "http serving file \"%s\".", filename); + u->fptr = fopen(filename, "rb"); + _mosquitto_free(filename); + if(!u->fptr){ + libwebsockets_return_http_status(context, wsi, HTTP_STATUS_NOT_FOUND, NULL); + return -1; + } + if(fstat(fileno(u->fptr), &filestat) < 0){ + libwebsockets_return_http_status(context, wsi, HTTP_STATUS_INTERNAL_SERVER_ERROR, NULL); + fclose(u->fptr); + u->fptr = NULL; + return -1; + } +#ifdef WIN32 + if((filestat.st_mode & S_IFREG) != S_IFREG){ +#else + if(!S_ISREG(filestat.st_mode)){ +#endif + libwebsockets_return_http_status(context, wsi, HTTP_STATUS_FORBIDDEN, NULL); + fclose(u->fptr); + u->fptr = NULL; + return -1; + } + + buflen = snprintf((char *)buf, 4096, "HTTP/1.0 200 OK\r\n" + "Server: mosquitto\r\n" + "Content-Length: %u\r\n\r\n", + (unsigned int)filestat.st_size); + if(libwebsocket_write(wsi, buf, buflen, LWS_WRITE_HTTP) < 0){ + fclose(u->fptr); + u->fptr = NULL; + return -1; + } + libwebsocket_callback_on_writable(context, wsi); + break; + +#ifndef LWS_IS_OLD + case LWS_CALLBACK_HTTP_BODY: + /* For extra POST data? */ + return -1; + + case LWS_CALLBACK_HTTP_BODY_COMPLETION: + /* For end of extra POST data? */ + return -1; + + case LWS_CALLBACK_FILTER_HTTP_CONNECTION: + /* Access control here */ + return 0; + + case LWS_CALLBACK_HTTP_WRITEABLE: + /* Send our data here */ + if(u && u->fptr){ + do{ + buflen = fread(buf, 1, sizeof(buf), u->fptr); + if(buflen < 1){ + fclose(u->fptr); + u->fptr = NULL; + return -1; + } + wlen = libwebsocket_write(wsi, buf, buflen, LWS_WRITE_HTTP); + if(wlen < buflen){ + if(fseek(u->fptr, buflen-wlen, SEEK_CUR) < 0){ + fclose(u->fptr); + u->fptr = NULL; + return -1; + } + }else{ + if(buflen < sizeof(buf)){ + fclose(u->fptr); + u->fptr = NULL; + } + } + }while(u->fptr && !lws_send_pipe_choked(wsi)); + libwebsocket_callback_on_writable(context, wsi); + }else{ + return -1; + } + break; + + case LWS_CALLBACK_CLOSED: + case LWS_CALLBACK_CLOSED_HTTP: + case LWS_CALLBACK_HTTP_FILE_COMPLETION: + if(u && u->fptr){ + fclose(u->fptr); + u->fptr = NULL; + } + break; +#endif + + case LWS_CALLBACK_ADD_POLL_FD: + case LWS_CALLBACK_DEL_POLL_FD: + case LWS_CALLBACK_CHANGE_MODE_POLL_FD: + HASH_FIND(hh_sock, db->contexts_by_sock, &pollargs->fd, sizeof(pollargs->fd), mosq); + if(mosq && (pollargs->events & POLLOUT)){ + mosq->ws_want_write = true; + } + break; + + default: + return 0; + } + + return 0; +} + +static void log_wrap(int level, const char *line) +{ + char *l = (char *)line; + l[strlen(line)-1] = '\0'; // Remove \n + _mosquitto_log_printf(NULL, MOSQ_LOG_WEBSOCKETS, "%s", l); +} + +struct libwebsocket_context *mosq_websockets_init(struct _mqtt3_listener *listener, int log_level) +{ + struct lws_context_creation_info info; + struct libwebsocket_protocols *p; + int protocol_count; + int i; + struct libws_mqtt_hack *user; + + /* Count valid protocols */ + for(protocol_count=0; protocols[protocol_count].name; protocol_count++); + + p = _mosquitto_calloc(protocol_count+1, sizeof(struct libwebsocket_protocols)); + if(!p){ + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Out of memory."); + return NULL; + } + for(i=0; protocols[i].name; i++){ + p[i].name = protocols[i].name; + p[i].callback = protocols[i].callback; + p[i].per_session_data_size = protocols[i].per_session_data_size; + p[i].rx_buffer_size = protocols[i].rx_buffer_size; + } + + memset(&info, 0, sizeof(info)); + info.iface = listener->host; + info.port = listener->port; + info.protocols = p; + info.gid = -1; + info.uid = -1; +#ifdef WITH_TLS + info.ssl_ca_filepath = listener->cafile; + info.ssl_cert_filepath = listener->certfile; + info.ssl_private_key_filepath = listener->keyfile; +#ifndef LWS_IS_OLD + info.ssl_cipher_list = listener->ciphers; +#endif + if(listener->require_certificate){ + info.options |= LWS_SERVER_OPTION_REQUIRE_VALID_OPENSSL_CLIENT_CERT; + } +#endif +#ifndef LWS_IS_OLD + info.options |= LWS_SERVER_OPTION_DISABLE_IPV6; +#endif +#if LWS_LIBRARY_VERSION_MAJOR>1 + info.options |= LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT; +#endif + + user = _mosquitto_calloc(1, sizeof(struct libws_mqtt_hack)); + if(!user){ + _mosquitto_free(p); + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Out of memory."); + return NULL; + } + + if(listener->http_dir){ +#ifdef WIN32 + user->http_dir = _fullpath(NULL, listener->http_dir, 0); +#else + user->http_dir = realpath(listener->http_dir, NULL); +#endif + if(!user->http_dir){ + _mosquitto_free(user); + _mosquitto_free(p); + _mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Unable to open http dir \"%s\".", listener->http_dir); + return NULL; + } + } + + info.user = user; + listener->ws_protocol = p; + + lws_set_log_level(log_level, log_wrap); + + _mosquitto_log_printf(NULL, MOSQ_LOG_INFO, "Opening websockets listen socket on port %d.", listener->port); + return libwebsocket_create_context(&info); +} + + +#endif diff --git a/src/libs/mosquitto/test/Makefile b/src/libs/mosquitto/test/Makefile new file mode 100644 index 0000000..8c9a44d --- /dev/null +++ b/src/libs/mosquitto/test/Makefile @@ -0,0 +1,91 @@ +include ../config.mk + +CC=cc +CFLAGS=-I../src -I../lib -I. -I.. -Wall -ggdb -DDEBUG -DWITH_CLIENT +LDFLAGS= +OBJS=context.o database.o logging.o memory.o net.o raw_send.o raw_send_client.o read_handle.o read_handle_client.o util.o +SOVERSION=1 + +.PHONY: all test clean reallyclean + +all : fake_user msgsps_pub msgsps_sub +#packet-gen qos + +test : + $(MAKE) -C broker test + $(MAKE) -C lib test + +fake_user : fake_user.o + ${CC} $^ -o $@ ../lib/libmosquitto.so.${SOVERSION} + #${CC} $^ -o $@ -lmosquitto + +fake_user.o : fake_user.c + ${CC} $(CFLAGS) -c $< -o $@ + +msgsps_pub : msgsps_pub.o + ${CC} $^ -o $@ ../lib/libmosquitto.so.${SOVERSION} + +msgsps_pub.o : msgsps_pub.c msgsps_common.h + ${CC} $(CFLAGS) -c $< -o $@ + +msgsps_sub : msgsps_sub.o + ${CC} $^ -o $@ ../lib/libmosquitto.so.${SOVERSION} + +msgsps_sub.o : msgsps_sub.c msgsps_common.h + ${CC} $(CFLAGS) -c $< -o $@ + +packet-gen : packet-gen.o + ${CC} $^ -o $@ ../lib/libmosquitto.so.${SOVERSION} + +packet-gen.o : packet-gen.c + ${CC} $(CFLAGS) -c $< -o $@ + +qos : qos.o + ${CC} $^ -o $@ ../lib/libmosquitto.so.${SOVERSION} + +qos.o : qos.c + ${CC} $(CFLAGS) -c $< -o $@ + +random_client : random_client.o ${OBJS} + ${CC} $^ -o $@ ${LDFLAGS} + +random_client.o : random_client.c ../src/mqtt3.h + ${CC} $(CFLAGS) -c $< -o $@ + +context.o : ../src/context.c ../src/mqtt3.h + ${CC} $(CFLAGS) -c $< -o $@ + +database.o : ../src/database.c ../src/mqtt3.h + ${CC} $(CFLAGS) -c $< -o $@ + +logging.o : ../src/logging.c ../src/mqtt3.h + ${CC} $(CFLAGS) -c $< -o $@ + +memory.o : ../src/memory.c ../src/mqtt3.h + ${CC} $(CFLAGS) -c $< -o $@ + +net.o : ../src/net.c ../src/mqtt3.h + ${CC} $(CFLAGS) -c $< -o $@ + +raw_send.o : ../src/raw_send.c ../src/mqtt3.h + ${CC} $(CFLAGS) -c $< -o $@ + +raw_send_client.o : ../src/raw_send_client.c ../src/mqtt3.h + ${CC} $(CFLAGS) -c $< -o $@ + +read_handle.o : ../src/read_handle.c ../src/mqtt3.h + ${CC} $(CFLAGS) -c $< -o $@ + +read_handle_client.o : ../src/read_handle_client.c ../src/mqtt3.h + ${CC} $(CFLAGS) -c $< -o $@ + +util.o : ../src/util.c ../src/mqtt3.h + ${CC} $(CFLAGS) -c $< -o $@ + +reallyclean : clean + -rm -f *.orig + +clean : + -rm -f *.o random_client qos msgsps_pub msgsps_sub fake_user test_client *.pyc + $(MAKE) -C lib clean + $(MAKE) -C broker clean diff --git a/src/libs/mosquitto/test/broker/01-connect-anon-denied.conf b/src/libs/mosquitto/test/broker/01-connect-anon-denied.conf new file mode 100644 index 0000000..02567f0 --- /dev/null +++ b/src/libs/mosquitto/test/broker/01-connect-anon-denied.conf @@ -0,0 +1,3 @@ +port 1888 +password_file 01-connect-anon-denied.pwfile +allow_anonymous false diff --git a/src/libs/mosquitto/test/broker/01-connect-anon-denied.pwfile b/src/libs/mosquitto/test/broker/01-connect-anon-denied.pwfile new file mode 100644 index 0000000..0fec1e9 --- /dev/null +++ b/src/libs/mosquitto/test/broker/01-connect-anon-denied.pwfile @@ -0,0 +1 @@ +user:$6$kyuI0x+unN8lbv9U$b6c3O8U/3fCJLEg7/qDHnE9oOE6gu8JqwBXNLAPBQInJuHhpB3teOaSxb3Lx9O+ukglIRPOI0NCENcincSPCvQ== diff --git a/src/libs/mosquitto/test/broker/01-connect-anon-denied.py b/src/libs/mosquitto/test/broker/01-connect-anon-denied.py new file mode 100755 index 0000000..b3d4036 --- /dev/null +++ b/src/libs/mosquitto/test/broker/01-connect-anon-denied.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python + +# Test whether an anonymous connection is correctly denied. + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-anon-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=5) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__)) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet) + sock.close() + rc = 0 +finally: + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/01-connect-invalid-id-0-311.py b/src/libs/mosquitto/test/broker/01-connect-invalid-id-0-311.py new file mode 100755 index 0000000..f5deced --- /dev/null +++ b/src/libs/mosquitto/test/broker/01-connect-invalid-id-0-311.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python + +# Test whether a CONNECT with a zero length client id results in the correct CONNACK packet. + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("", keepalive=keepalive, proto_ver=4) +connack_packet = mosq_test.gen_connack(rc=0) + +cmd = ['../../src/mosquitto', '-p', '1888'] +broker = mosq_test.start_broker(filename=os.path.basename(__file__), cmd=cmd) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet) + sock.close() + rc = 0 +finally: + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) diff --git a/src/libs/mosquitto/test/broker/01-connect-invalid-id-0.py b/src/libs/mosquitto/test/broker/01-connect-invalid-id-0.py new file mode 100755 index 0000000..34faf0f --- /dev/null +++ b/src/libs/mosquitto/test/broker/01-connect-invalid-id-0.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python + +# Test whether a CONNECT with a zero length client id results in the correct CONNACK packet. + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=2) + +cmd = ['../../src/mosquitto', '-p', '1888'] +broker = mosq_test.start_broker(filename=os.path.basename(__file__), cmd=cmd) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet) + sock.close() + rc = 0 +finally: + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) diff --git a/src/libs/mosquitto/test/broker/01-connect-invalid-id-missing.py b/src/libs/mosquitto/test/broker/01-connect-invalid-id-missing.py new file mode 100755 index 0000000..b42888f --- /dev/null +++ b/src/libs/mosquitto/test/broker/01-connect-invalid-id-missing.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python + +# Test whether a CONNECT with a zero length client id results in the correct CONNACK packet. + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect(None, keepalive=keepalive) + +cmd = ['../../src/mosquitto', '-p', '1888'] +broker = mosq_test.start_broker(filename=os.path.basename(__file__), cmd=cmd) + +try: + sock = mosq_test.do_client_connect(connect_packet, "") + sock.close() + rc = 0 +finally: + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) diff --git a/src/libs/mosquitto/test/broker/01-connect-invalid-protonum.py b/src/libs/mosquitto/test/broker/01-connect-invalid-protonum.py new file mode 100755 index 0000000..6128164 --- /dev/null +++ b/src/libs/mosquitto/test/broker/01-connect-invalid-protonum.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python + +# Test whether a CONNECT with an invalid protocol number results in the correct CONNACK packet. + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-invalid-test", keepalive=keepalive, proto_ver=0) +connack_packet = mosq_test.gen_connack(rc=1) + +cmd = ['../../src/mosquitto', '-p', '1888'] +broker = mosq_test.start_broker(filename=os.path.basename(__file__), cmd=cmd) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet) + sock.close() + rc = 0 + +finally: + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/01-connect-invalid-reserved.py b/src/libs/mosquitto/test/broker/01-connect-invalid-reserved.py new file mode 100755 index 0000000..182fcc9 --- /dev/null +++ b/src/libs/mosquitto/test/broker/01-connect-invalid-reserved.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python + +# Test whether a CONNECT with reserved set to 1 results in a disconnect. MQTT-3.1.2-3 + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-invalid-test", keepalive=keepalive, connect_reserved=True, proto_ver=4) + +cmd = ['../../src/mosquitto', '-p', '1888'] +broker = mosq_test.start_broker(filename=os.path.basename(__file__), cmd=cmd) + +try: + sock = mosq_test.do_client_connect(connect_packet, "") + sock.close() + rc = 0 + +finally: + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/01-connect-success.py b/src/libs/mosquitto/test/broker/01-connect-success.py new file mode 100755 index 0000000..e231188 --- /dev/null +++ b/src/libs/mosquitto/test/broker/01-connect-success.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python + +# Test whether a valid CONNECT results in the correct CONNACK packet. + +import inspect, os, sys + +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-success-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +cmd = ['../../src/mosquitto', '-p', '1888'] +broker = mosq_test.start_broker(filename=os.path.basename(__file__), cmd=cmd) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet) + sock.close() + rc = 0 +finally: + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/01-connect-uname-no-password-denied.conf b/src/libs/mosquitto/test/broker/01-connect-uname-no-password-denied.conf new file mode 100644 index 0000000..9873273 --- /dev/null +++ b/src/libs/mosquitto/test/broker/01-connect-uname-no-password-denied.conf @@ -0,0 +1,3 @@ +port 1888 +password_file 01-connect-uname-no-password-denied.pwfile +allow_anonymous false diff --git a/src/libs/mosquitto/test/broker/01-connect-uname-no-password-denied.pwfile b/src/libs/mosquitto/test/broker/01-connect-uname-no-password-denied.pwfile new file mode 100644 index 0000000..fd4ac0a --- /dev/null +++ b/src/libs/mosquitto/test/broker/01-connect-uname-no-password-denied.pwfile @@ -0,0 +1 @@ +user:$6$Ut1cUS9PG8+gC3vn$tOjCfSJJDe1Alu9HktxxyyzwN4+6mAMSWGRAF9gmMN8pzcGTPVEYYMAZpCEp96Oz2ZRRz5YKM6lPMf1tUbb6zA== diff --git a/src/libs/mosquitto/test/broker/01-connect-uname-no-password-denied.py b/src/libs/mosquitto/test/broker/01-connect-uname-no-password-denied.py new file mode 100755 index 0000000..3dbd570 --- /dev/null +++ b/src/libs/mosquitto/test/broker/01-connect-uname-no-password-denied.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python + +# Test whether a connection is denied if it provides just a username when it +# needs a username and password. + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-uname-test", keepalive=keepalive, username="user") +connack_packet = mosq_test.gen_connack(rc=5) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__)) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet) + sock.close() + rc = 0 +finally: + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/01-connect-uname-password-denied.conf b/src/libs/mosquitto/test/broker/01-connect-uname-password-denied.conf new file mode 100644 index 0000000..2d66a6a --- /dev/null +++ b/src/libs/mosquitto/test/broker/01-connect-uname-password-denied.conf @@ -0,0 +1,3 @@ +port 1888 +password_file 01-connect-uname-password-denied.pwfile +allow_anonymous false diff --git a/src/libs/mosquitto/test/broker/01-connect-uname-password-denied.pwfile b/src/libs/mosquitto/test/broker/01-connect-uname-password-denied.pwfile new file mode 100644 index 0000000..913477d --- /dev/null +++ b/src/libs/mosquitto/test/broker/01-connect-uname-password-denied.pwfile @@ -0,0 +1 @@ +user:$6$vZY4TS+/HBxHw38S$vvjVFECzb8dyuu/mruD2QKTfdFn0WmKxbc+1TsdB0L8EdHk3v9JRmfjHd56+VaTnUcSZOZ/hzkdvWCtxlX7AUQ== diff --git a/src/libs/mosquitto/test/broker/01-connect-uname-password-denied.py b/src/libs/mosquitto/test/broker/01-connect-uname-password-denied.py new file mode 100755 index 0000000..4cb7a3a --- /dev/null +++ b/src/libs/mosquitto/test/broker/01-connect-uname-password-denied.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python + +# Test whether a connection is denied if it provides a correct username but +# incorrect password. + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-uname-pwd-test", keepalive=keepalive, username="user", password="password9") +connack_packet = mosq_test.gen_connack(rc=5) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__)) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet) + sock.close() + rc = 0 + +finally: + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/01-connect-uname-password-success-no-tls.conf b/src/libs/mosquitto/test/broker/01-connect-uname-password-success-no-tls.conf new file mode 100644 index 0000000..2cb39d1 --- /dev/null +++ b/src/libs/mosquitto/test/broker/01-connect-uname-password-success-no-tls.conf @@ -0,0 +1,3 @@ +port 1888 +password_file 01-connect-uname-password-success-no-tls.pwfile +allow_anonymous false diff --git a/src/libs/mosquitto/test/broker/01-connect-uname-password-success-no-tls.pwfile b/src/libs/mosquitto/test/broker/01-connect-uname-password-success-no-tls.pwfile new file mode 100644 index 0000000..28b9bb2 --- /dev/null +++ b/src/libs/mosquitto/test/broker/01-connect-uname-password-success-no-tls.pwfile @@ -0,0 +1 @@ +user:password diff --git a/src/libs/mosquitto/test/broker/01-connect-uname-password-success-no-tls.py b/src/libs/mosquitto/test/broker/01-connect-uname-password-success-no-tls.py new file mode 100755 index 0000000..5421f70 --- /dev/null +++ b/src/libs/mosquitto/test/broker/01-connect-uname-password-success-no-tls.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python + +# Test whether a connection is denied if it provides a correct username but +# incorrect password. + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-uname-pwd-test", keepalive=keepalive, username="user", password="password") +connack_packet = mosq_test.gen_connack(rc=0) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__)) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet) + sock.close() + rc = 0 + +finally: + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/01-connect-uname-password-success.conf b/src/libs/mosquitto/test/broker/01-connect-uname-password-success.conf new file mode 100644 index 0000000..99bc880 --- /dev/null +++ b/src/libs/mosquitto/test/broker/01-connect-uname-password-success.conf @@ -0,0 +1,3 @@ +port 1888 +password_file 01-connect-uname-password-success.pwfile +allow_anonymous false diff --git a/src/libs/mosquitto/test/broker/01-connect-uname-password-success.pwfile b/src/libs/mosquitto/test/broker/01-connect-uname-password-success.pwfile new file mode 100644 index 0000000..e516eb7 --- /dev/null +++ b/src/libs/mosquitto/test/broker/01-connect-uname-password-success.pwfile @@ -0,0 +1 @@ +user:$6$LIg/OiUz2yPftClP$dQu0vVNqRHOcMOzDLuqv4e+5rTFW83DFm3s+C8fy9F7Ip73cdIGUlsNGBs4MtKWNjtMl8LnT+pIQZ7ic1ZttyQ== diff --git a/src/libs/mosquitto/test/broker/01-connect-uname-password-success.py b/src/libs/mosquitto/test/broker/01-connect-uname-password-success.py new file mode 100755 index 0000000..5421f70 --- /dev/null +++ b/src/libs/mosquitto/test/broker/01-connect-uname-password-success.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python + +# Test whether a connection is denied if it provides a correct username but +# incorrect password. + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-uname-pwd-test", keepalive=keepalive, username="user", password="password") +connack_packet = mosq_test.gen_connack(rc=0) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__)) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet) + sock.close() + rc = 0 + +finally: + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/02-subpub-qos0.py b/src/libs/mosquitto/test/broker/02-subpub-qos0.py new file mode 100755 index 0000000..295b017 --- /dev/null +++ b/src/libs/mosquitto/test/broker/02-subpub-qos0.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python + +# Test whether a client subscribed to a topic receives its own message sent to that topic. + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +mid = 53 +keepalive = 60 +connect_packet = mosq_test.gen_connect("subpub-qos0-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +subscribe_packet = mosq_test.gen_subscribe(mid, "subpub/qos0", 0) +suback_packet = mosq_test.gen_suback(mid, 0) + +publish_packet = mosq_test.gen_publish("subpub/qos0", qos=0, payload="message") + +cmd = ['../../src/mosquitto', '-p', '1888'] +broker = mosq_test.start_broker(filename=os.path.basename(__file__), cmd=cmd) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20) + sock.send(subscribe_packet) + + if mosq_test.expect_packet(sock, "suback", suback_packet): + sock.send(publish_packet) + + if mosq_test.expect_packet(sock, "publish", publish_packet): + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/02-subpub-qos1.py b/src/libs/mosquitto/test/broker/02-subpub-qos1.py new file mode 100755 index 0000000..f321151 --- /dev/null +++ b/src/libs/mosquitto/test/broker/02-subpub-qos1.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python + +# Test whether a client subscribed to a topic receives its own message sent to that topic. + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +mid = 530 +keepalive = 60 +connect_packet = mosq_test.gen_connect("subpub-qos1-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +subscribe_packet = mosq_test.gen_subscribe(mid, "subpub/qos1", 1) +suback_packet = mosq_test.gen_suback(mid, 1) + +mid = 300 +publish_packet = mosq_test.gen_publish("subpub/qos1", qos=1, mid=mid, payload="message") +puback_packet = mosq_test.gen_puback(mid) + +mid = 1 +publish_packet2 = mosq_test.gen_publish("subpub/qos1", qos=1, mid=mid, payload="message") + +cmd = ['../../src/mosquitto', '-p', '1888'] +broker = mosq_test.start_broker(filename=os.path.basename(__file__), cmd=cmd) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20) + sock.send(subscribe_packet) + + if mosq_test.expect_packet(sock, "suback", suback_packet): + sock.send(publish_packet) + + if mosq_test.expect_packet(sock, "puback", puback_packet): + + if mosq_test.expect_packet(sock, "publish2", publish_packet2): + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/02-subpub-qos2.py b/src/libs/mosquitto/test/broker/02-subpub-qos2.py new file mode 100755 index 0000000..6d32a8c --- /dev/null +++ b/src/libs/mosquitto/test/broker/02-subpub-qos2.py @@ -0,0 +1,64 @@ +#!/usr/bin/env python + +# Test whether a client subscribed to a topic receives its own message sent to that topic. + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +mid = 530 +keepalive = 60 +connect_packet = mosq_test.gen_connect("subpub-qos2-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +subscribe_packet = mosq_test.gen_subscribe(mid, "subpub/qos2", 2) +suback_packet = mosq_test.gen_suback(mid, 2) + +mid = 301 +publish_packet = mosq_test.gen_publish("subpub/qos2", qos=2, mid=mid, payload="message") +pubrec_packet = mosq_test.gen_pubrec(mid) +pubrel_packet = mosq_test.gen_pubrel(mid) +pubcomp_packet = mosq_test.gen_pubcomp(mid) + +mid = 1 +publish_packet2 = mosq_test.gen_publish("subpub/qos2", qos=2, mid=mid, payload="message") +pubrec_packet2 = mosq_test.gen_pubrec(mid) +pubrel_packet2 = mosq_test.gen_pubrel(mid) +pubcomp_packet2 = mosq_test.gen_pubcomp(mid) + +cmd = ['../../src/mosquitto', '-p', '1888'] +broker = mosq_test.start_broker(filename=os.path.basename(__file__), cmd=cmd) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20) + sock.send(subscribe_packet) + + if mosq_test.expect_packet(sock, "suback", suback_packet): + sock.send(publish_packet) + + if mosq_test.expect_packet(sock, "pubrec", pubrec_packet): + sock.send(pubrel_packet) + + if mosq_test.expect_packet(sock, "pubcomp", pubcomp_packet): + if mosq_test.expect_packet(sock, "publish2", publish_packet2): + sock.send(pubrec_packet2) + + if mosq_test.expect_packet(sock, "pubrel2", pubrel_packet2): + # Broker side of flow complete so can quit here. + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/02-subscribe-qos0.py b/src/libs/mosquitto/test/broker/02-subscribe-qos0.py new file mode 100755 index 0000000..22f1904 --- /dev/null +++ b/src/libs/mosquitto/test/broker/02-subscribe-qos0.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python + +# Test whether a SUBSCRIBE to a topic with QoS 0 results in the correct SUBACK packet. + +import time +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +mid = 53 +keepalive = 60 +connect_packet = mosq_test.gen_connect("subscribe-qos0-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +subscribe_packet = mosq_test.gen_subscribe(mid, "qos0/test", 0) +suback_packet = mosq_test.gen_suback(mid, 0) + +cmd = ['../../src/mosquitto', '-p', '1888'] +broker = mosq_test.start_broker(filename=os.path.basename(__file__), cmd=cmd) + +try: + time.sleep(0.5) + + sock = mosq_test.do_client_connect(connect_packet, connack_packet) + sock.send(subscribe_packet) + + if mosq_test.expect_packet(sock, "suback", suback_packet): + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/02-subscribe-qos1.py b/src/libs/mosquitto/test/broker/02-subscribe-qos1.py new file mode 100755 index 0000000..ca150d7 --- /dev/null +++ b/src/libs/mosquitto/test/broker/02-subscribe-qos1.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python + +# Test whether a SUBSCRIBE to a topic with QoS 1 results in the correct SUBACK packet. + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +mid = 79 +keepalive = 60 +connect_packet = mosq_test.gen_connect("subscribe-qos1-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +subscribe_packet = mosq_test.gen_subscribe(mid, "qos1/test", 1) +suback_packet = mosq_test.gen_suback(mid, 1) + +cmd = ['../../src/mosquitto', '-p', '1888'] +broker = mosq_test.start_broker(filename=os.path.basename(__file__), cmd=cmd) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet) + sock.send(subscribe_packet) + + if mosq_test.expect_packet(sock, "suback", suback_packet): + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/02-subscribe-qos2.py b/src/libs/mosquitto/test/broker/02-subscribe-qos2.py new file mode 100755 index 0000000..5f2ebdc --- /dev/null +++ b/src/libs/mosquitto/test/broker/02-subscribe-qos2.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python + +# Test whether a SUBSCRIBE to a topic with QoS 2 results in the correct SUBACK packet. + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +mid = 3 +keepalive = 60 +connect_packet = mosq_test.gen_connect("subscribe-qos2-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +subscribe_packet = mosq_test.gen_subscribe(mid, "qos2/test", 2) +suback_packet = mosq_test.gen_suback(mid, 2) + +cmd = ['../../src/mosquitto', '-p', '1888'] +broker = mosq_test.start_broker(filename=os.path.basename(__file__), cmd=cmd) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet) + sock.send(subscribe_packet) + + if mosq_test.expect_packet(sock, "suback", suback_packet): + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/02-unsubscribe-qos0.py b/src/libs/mosquitto/test/broker/02-unsubscribe-qos0.py new file mode 100755 index 0000000..fbfec67 --- /dev/null +++ b/src/libs/mosquitto/test/broker/02-unsubscribe-qos0.py @@ -0,0 +1,42 @@ +#!/usr/bin/env python + +# Test whether a UNSUBSCRIBE to a topic with QoS 0 results in the correct UNSUBACK packet. +# This doesn't assume a subscription exists. + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +mid = 53 +keepalive = 60 +connect_packet = mosq_test.gen_connect("unsubscribe-qos0-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +unsubscribe_packet = mosq_test.gen_unsubscribe(mid, "qos0/test") +unsuback_packet = mosq_test.gen_unsuback(mid) + +cmd = ['../../src/mosquitto', '-p', '1888'] +broker = mosq_test.start_broker(filename=os.path.basename(__file__), cmd=cmd) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet) + sock.send(unsubscribe_packet) + + if mosq_test.expect_packet(sock, "unsuback", unsuback_packet): + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/02-unsubscribe-qos1.py b/src/libs/mosquitto/test/broker/02-unsubscribe-qos1.py new file mode 100755 index 0000000..2bbf31a --- /dev/null +++ b/src/libs/mosquitto/test/broker/02-unsubscribe-qos1.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python + +# Test whether a SUBSCRIBE to a topic with QoS 1 results in the correct SUBACK packet. + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +mid = 79 +keepalive = 60 +connect_packet = mosq_test.gen_connect("unsubscribe-qos1-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +unsubscribe_packet = mosq_test.gen_unsubscribe(mid, "qos1/test") +unsuback_packet = mosq_test.gen_unsuback(mid) + +cmd = ['../../src/mosquitto', '-p', '1888'] +broker = mosq_test.start_broker(filename=os.path.basename(__file__), cmd=cmd) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet) + sock.send(unsubscribe_packet) + + if mosq_test.expect_packet(sock, "unsuback", unsuback_packet): + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/02-unsubscribe-qos2.py b/src/libs/mosquitto/test/broker/02-unsubscribe-qos2.py new file mode 100755 index 0000000..3333ed6 --- /dev/null +++ b/src/libs/mosquitto/test/broker/02-unsubscribe-qos2.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python + +# Test whether a SUBSCRIBE to a topic with QoS 2 results in the correct SUBACK packet. + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +mid = 3 +keepalive = 60 +connect_packet = mosq_test.gen_connect("unsubscribe-qos2-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +unsubscribe_packet = mosq_test.gen_unsubscribe(mid, "qos2/test") +unsuback_packet = mosq_test.gen_unsuback(mid) + +cmd = ['../../src/mosquitto', '-p', '1888'] +broker = mosq_test.start_broker(filename=os.path.basename(__file__), cmd=cmd) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet) + sock.send(unsubscribe_packet) + + if mosq_test.expect_packet(sock, "unsuback", unsuback_packet): + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/03-pattern-matching-helper.py b/src/libs/mosquitto/test/broker/03-pattern-matching-helper.py new file mode 100755 index 0000000..4db430a --- /dev/null +++ b/src/libs/mosquitto/test/broker/03-pattern-matching-helper.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("test-helper", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +publish_packet = mosq_test.gen_publish(sys.argv[1], qos=0, retain=True, payload="message") + +sock = mosq_test.do_client_connect(connect_packet, connack_packet, connack_error="helper connack") +sock.send(publish_packet) +rc = 0 +sock.close() + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/03-pattern-matching.py b/src/libs/mosquitto/test/broker/03-pattern-matching.py new file mode 100755 index 0000000..4e9a467 --- /dev/null +++ b/src/libs/mosquitto/test/broker/03-pattern-matching.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python + +import subprocess +import time + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +def pattern_test(sub_topic, pub_topic): + rc = 1 + keepalive = 60 + connect_packet = mosq_test.gen_connect("pattern-sub-test", keepalive=keepalive) + connack_packet = mosq_test.gen_connack(rc=0) + + publish_packet = mosq_test.gen_publish(pub_topic, qos=0, payload="message") + publish_retained_packet = mosq_test.gen_publish(pub_topic, qos=0, retain=True, payload="message") + + mid = 312 + subscribe_packet = mosq_test.gen_subscribe(mid, sub_topic, 0) + suback_packet = mosq_test.gen_suback(mid, 0) + + mid = 234; + unsubscribe_packet = mosq_test.gen_unsubscribe(mid, sub_topic) + unsuback_packet = mosq_test.gen_unsuback(mid) + + broker = subprocess.Popen(['../../src/mosquitto', '-p', '1888'], stderr=subprocess.PIPE) + + try: + time.sleep(0.5) + + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20) + sock.send(subscribe_packet) + + if mosq_test.expect_packet(sock, "suback", suback_packet): + pub = subprocess.Popen(['./03-pattern-matching-helper.py', pub_topic]) + pub.wait() + + if mosq_test.expect_packet(sock, "publish", publish_packet): + sock.send(unsubscribe_packet) + + if mosq_test.expect_packet(sock, "unsuback", unsuback_packet): + sock.send(subscribe_packet) + + if mosq_test.expect_packet(sock, "suback", suback_packet): + if mosq_test.expect_packet(sock, "publish retained", publish_retained_packet): + rc = 0 + + sock.close() + finally: + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + raise + + return rc + +pattern_test("#", "test/topic") +pattern_test("#", "/test/topic") +pattern_test("foo/#", "foo/bar/baz") +pattern_test("foo/+/baz", "foo/bar/baz") +pattern_test("foo/+/baz/#", "foo/bar/baz") +pattern_test("foo/+/baz/#", "foo/bar/baz/bar") +pattern_test("foo/foo/baz/#", "foo/foo/baz/bar") +pattern_test("foo/#", "foo") +pattern_test("/#", "/foo") +pattern_test("test/topic/", "test/topic/") +pattern_test("test/topic/+", "test/topic/") +pattern_test("+/+/+/+/+/+/+/+/+/+/test", "one/two/three/four/five/six/seven/eight/nine/ten/test") + +pattern_test("#", "test////a//topic") +pattern_test("#", "/test////a//topic") +pattern_test("foo/#", "foo//bar///baz") +pattern_test("foo/+/baz", "foo//baz") +pattern_test("foo/+/baz//", "foo//baz//") +pattern_test("foo/+/baz/#", "foo//baz") +pattern_test("foo/+/baz/#", "foo//baz/bar") +pattern_test("foo//baz/#", "foo//baz/bar") +pattern_test("foo/foo/baz/#", "foo/foo/baz/bar") +pattern_test("/#", "////foo///bar") + +exit(0) + diff --git a/src/libs/mosquitto/test/broker/03-publish-b2c-disconnect-qos1-helper.py b/src/libs/mosquitto/test/broker/03-publish-b2c-disconnect-qos1-helper.py new file mode 100755 index 0000000..3ad3eba --- /dev/null +++ b/src/libs/mosquitto/test/broker/03-publish-b2c-disconnect-qos1-helper.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("test-helper", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 128 +publish_packet = mosq_test.gen_publish("qos1/disconnect/test", qos=1, mid=mid, payload="disconnect-message") +puback_packet = mosq_test.gen_puback(mid) + +sock = mosq_test.do_client_connect(connect_packet, connack_packet, connack_error="helper connack") +sock.send(publish_packet) + +if mosq_test.expect_packet(sock, "helper puback", puback_packet): + rc = 0 + +sock.close() + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/03-publish-b2c-disconnect-qos1.conf b/src/libs/mosquitto/test/broker/03-publish-b2c-disconnect-qos1.conf new file mode 100644 index 0000000..425d667 --- /dev/null +++ b/src/libs/mosquitto/test/broker/03-publish-b2c-disconnect-qos1.conf @@ -0,0 +1,3 @@ +retry_interval 10 +port 1888 +log_type debug diff --git a/src/libs/mosquitto/test/broker/03-publish-b2c-disconnect-qos1.py b/src/libs/mosquitto/test/broker/03-publish-b2c-disconnect-qos1.py new file mode 100755 index 0000000..ea1ca09 --- /dev/null +++ b/src/libs/mosquitto/test/broker/03-publish-b2c-disconnect-qos1.py @@ -0,0 +1,69 @@ +#!/usr/bin/env python + +import subprocess +import socket + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +mid = 3265 +keepalive = 60 +connect_packet = mosq_test.gen_connect("pub-qos1-disco-test", keepalive=keepalive, clean_session=False) +connack_packet = mosq_test.gen_connack(rc=0) + +subscribe_packet = mosq_test.gen_subscribe(mid, "qos1/disconnect/test", 1) +suback_packet = mosq_test.gen_suback(mid, 1) + +mid = 1 +publish_packet = mosq_test.gen_publish("qos1/disconnect/test", qos=1, mid=mid, payload="disconnect-message") +publish_dup_packet = mosq_test.gen_publish("qos1/disconnect/test", qos=1, mid=mid, payload="disconnect-message", dup=True) +puback_packet = mosq_test.gen_puback(mid) + +mid = 3266 +publish2_packet = mosq_test.gen_publish("qos1/outgoing", qos=1, mid=mid, payload="outgoing-message") +puback2_packet = mosq_test.gen_puback(mid) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__)) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet) + sock.send(subscribe_packet) + + if mosq_test.expect_packet(sock, "suback", suback_packet): + pub = subprocess.Popen(['./03-publish-b2c-disconnect-qos1-helper.py']) + pub.wait() + # Should have now received a publish command + + if mosq_test.expect_packet(sock, "publish", publish_packet): + # Send our outgoing message. When we disconnect the broker + # should get rid of it and assume we're going to retry. + sock.send(publish2_packet) + sock.close() + + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + sock.settimeout(60) # 60 seconds timeout is much longer than 5 seconds message retry. + sock.connect(("localhost", 1888)) + sock.send(connect_packet) + + if mosq_test.expect_packet(sock, "connack", connack_packet): + + if mosq_test.expect_packet(sock, "dup publish", publish_dup_packet): + sock.send(puback_packet) + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/03-publish-b2c-disconnect-qos2-helper.py b/src/libs/mosquitto/test/broker/03-publish-b2c-disconnect-qos2-helper.py new file mode 100755 index 0000000..afc8cf8 --- /dev/null +++ b/src/libs/mosquitto/test/broker/03-publish-b2c-disconnect-qos2-helper.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python + +# Test whether a PUBLISH to a topic with QoS 2 results in the correct packet flow. + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("test-helper", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 312 +publish_packet = mosq_test.gen_publish("qos2/disconnect/test", qos=2, mid=mid, payload="disconnect-message") +pubrec_packet = mosq_test.gen_pubrec(mid) +pubrel_packet = mosq_test.gen_pubrel(mid) +pubcomp_packet = mosq_test.gen_pubcomp(mid) + +sock = mosq_test.do_client_connect(connect_packet, connack_packet, connack_error="helper connack") +sock.send(publish_packet) + +if mosq_test.expect_packet(sock, "helper pubrec", pubrec_packet): + sock.send(pubrel_packet) + + if mosq_test.expect_packet(sock, "helper pubcomp", pubcomp_packet): + rc = 0 + +sock.close() + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/03-publish-b2c-disconnect-qos2.conf b/src/libs/mosquitto/test/broker/03-publish-b2c-disconnect-qos2.conf new file mode 100644 index 0000000..425d667 --- /dev/null +++ b/src/libs/mosquitto/test/broker/03-publish-b2c-disconnect-qos2.conf @@ -0,0 +1,3 @@ +retry_interval 10 +port 1888 +log_type debug diff --git a/src/libs/mosquitto/test/broker/03-publish-b2c-disconnect-qos2.py b/src/libs/mosquitto/test/broker/03-publish-b2c-disconnect-qos2.py new file mode 100755 index 0000000..cc889c6 --- /dev/null +++ b/src/libs/mosquitto/test/broker/03-publish-b2c-disconnect-qos2.py @@ -0,0 +1,73 @@ +#!/usr/bin/env python + +import subprocess + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +mid = 3265 +keepalive = 60 +connect_packet = mosq_test.gen_connect("pub-qos2-disco-test", keepalive=keepalive, clean_session=False) +connack_packet = mosq_test.gen_connack(rc=0) + +subscribe_packet = mosq_test.gen_subscribe(mid, "qos2/disconnect/test", 2) +suback_packet = mosq_test.gen_suback(mid, 2) + +mid = 1 +publish_packet = mosq_test.gen_publish("qos2/disconnect/test", qos=2, mid=mid, payload="disconnect-message") +publish_dup_packet = mosq_test.gen_publish("qos2/disconnect/test", qos=2, mid=mid, payload="disconnect-message", dup=True) +pubrec_packet = mosq_test.gen_pubrec(mid) +pubrel_packet = mosq_test.gen_pubrel(mid) +pubcomp_packet = mosq_test.gen_pubcomp(mid) + +mid = 3266 +publish2_packet = mosq_test.gen_publish("qos1/outgoing", qos=1, mid=mid, payload="outgoing-message") +puback2_packet = mosq_test.gen_puback(mid) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__)) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet) + sock.send(subscribe_packet) + + if mosq_test.expect_packet(sock, "suback", suback_packet): + pub = subprocess.Popen(['./03-publish-b2c-disconnect-qos2-helper.py']) + hrc = pub.wait() + if hrc: + exit(hrc) + # Should have now received a publish command + + if mosq_test.expect_packet(sock, "publish", publish_packet): + # Send our outgoing message. When we disconnect the broker + # should get rid of it and assume we're going to retry. + sock.send(publish2_packet) + sock.close() + + sock = mosq_test.do_client_connect(connect_packet, connack_packet) + if mosq_test.expect_packet(sock, "dup publish", publish_dup_packet): + sock.send(pubrec_packet) + + if mosq_test.expect_packet(sock, "pubrel", pubrel_packet): + sock.close() + + sock = mosq_test.do_client_connect(connect_packet, connack_packet) + if mosq_test.expect_packet(sock, "dup pubrel", pubrel_packet): + sock.send(pubcomp_packet) + rc = 0 + sock.close() + +finally: + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/03-publish-b2c-timeout-qos1-helper.py b/src/libs/mosquitto/test/broker/03-publish-b2c-timeout-qos1-helper.py new file mode 100755 index 0000000..18c4626 --- /dev/null +++ b/src/libs/mosquitto/test/broker/03-publish-b2c-timeout-qos1-helper.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python + +# Test whether a PUBLISH to a topic with QoS 2 results in the correct packet flow. + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("test-helper", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 128 +publish_packet = mosq_test.gen_publish("qos1/timeout/test", qos=1, mid=mid, payload="timeout-message") +puback_packet = mosq_test.gen_puback(mid) + +sock = mosq_test.do_client_connect(connect_packet, connack_packet, connack_error="helper connack") +sock.send(publish_packet) + +if mosq_test.expect_packet(sock, "helper puback", puback_packet): + rc = 0 + +sock.close() + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/03-publish-b2c-timeout-qos1.conf b/src/libs/mosquitto/test/broker/03-publish-b2c-timeout-qos1.conf new file mode 100644 index 0000000..425d667 --- /dev/null +++ b/src/libs/mosquitto/test/broker/03-publish-b2c-timeout-qos1.conf @@ -0,0 +1,3 @@ +retry_interval 10 +port 1888 +log_type debug diff --git a/src/libs/mosquitto/test/broker/03-publish-b2c-timeout-qos1.py b/src/libs/mosquitto/test/broker/03-publish-b2c-timeout-qos1.py new file mode 100755 index 0000000..7fb8719 --- /dev/null +++ b/src/libs/mosquitto/test/broker/03-publish-b2c-timeout-qos1.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python + +# Test whether a SUBSCRIBE to a topic with QoS 2 results in the correct SUBACK packet. + +import subprocess + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +mid = 3265 +keepalive = 60 +connect_packet = mosq_test.gen_connect("pub-qos1-timeout-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +subscribe_packet = mosq_test.gen_subscribe(mid, "qos1/timeout/test", 1) +suback_packet = mosq_test.gen_suback(mid, 1) + +mid = 1 +publish_packet = mosq_test.gen_publish("qos1/timeout/test", qos=1, mid=mid, payload="timeout-message") +publish_dup_packet = mosq_test.gen_publish("qos1/timeout/test", qos=1, mid=mid, payload="timeout-message", dup=True) +puback_packet = mosq_test.gen_puback(mid) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__)) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet) + sock.send(subscribe_packet) + + if mosq_test.expect_packet(sock, "suback", suback_packet): + pub = subprocess.Popen(['./03-publish-b2c-timeout-qos1-helper.py']) + pub.wait() + # Should have now received a publish command + + if mosq_test.expect_packet(sock, "publish", publish_packet): + # Wait for longer than 5 seconds to get republish with dup set + # This is covered by the 8 second timeout + + if mosq_test.expect_packet(sock, "dup publish", publish_dup_packet): + sock.send(puback_packet) + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/03-publish-b2c-timeout-qos2-helper.py b/src/libs/mosquitto/test/broker/03-publish-b2c-timeout-qos2-helper.py new file mode 100755 index 0000000..45a1e23 --- /dev/null +++ b/src/libs/mosquitto/test/broker/03-publish-b2c-timeout-qos2-helper.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python + +# Test whether a PUBLISH to a topic with QoS 2 results in the correct packet flow. + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("test-helper", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 312 +publish_packet = mosq_test.gen_publish("qos2/timeout/test", qos=2, mid=mid, payload="timeout-message") +pubrec_packet = mosq_test.gen_pubrec(mid) +pubrel_packet = mosq_test.gen_pubrel(mid) +pubcomp_packet = mosq_test.gen_pubcomp(mid) + +sock = mosq_test.do_client_connect(connect_packet, connack_packet, connack_error="helper connack") +sock.send(publish_packet) + +if mosq_test.expect_packet(sock, "helper pubrec", pubrec_packet): + sock.send(pubrel_packet) + + if mosq_test.expect_packet(sock, "helper pubcomp", pubcomp_packet): + rc = 0 + +sock.close() + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/03-publish-b2c-timeout-qos2.conf b/src/libs/mosquitto/test/broker/03-publish-b2c-timeout-qos2.conf new file mode 100644 index 0000000..425d667 --- /dev/null +++ b/src/libs/mosquitto/test/broker/03-publish-b2c-timeout-qos2.conf @@ -0,0 +1,3 @@ +retry_interval 10 +port 1888 +log_type debug diff --git a/src/libs/mosquitto/test/broker/03-publish-b2c-timeout-qos2.py b/src/libs/mosquitto/test/broker/03-publish-b2c-timeout-qos2.py new file mode 100755 index 0000000..81efafb --- /dev/null +++ b/src/libs/mosquitto/test/broker/03-publish-b2c-timeout-qos2.py @@ -0,0 +1,66 @@ +#!/usr/bin/env python + +# Test whether a SUBSCRIBE to a topic with QoS 2 results in the correct SUBACK packet. + +import subprocess + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +mid = 3265 +keepalive = 60 +connect_packet = mosq_test.gen_connect("pub-qo2-timeout-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +subscribe_packet = mosq_test.gen_subscribe(mid, "qos2/timeout/test", 2) +suback_packet = mosq_test.gen_suback(mid, 2) + +mid = 1 +publish_packet = mosq_test.gen_publish("qos2/timeout/test", qos=2, mid=mid, payload="timeout-message") +publish_dup_packet = mosq_test.gen_publish("qos2/timeout/test", qos=2, mid=mid, payload="timeout-message", dup=True) +pubrec_packet = mosq_test.gen_pubrec(mid) +pubrel_packet = mosq_test.gen_pubrel(mid) +pubcomp_packet = mosq_test.gen_pubcomp(mid) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__)) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet) + sock.send(subscribe_packet) + + if mosq_test.expect_packet(sock, "suback", suback_packet): + pub = subprocess.Popen(['./03-publish-b2c-timeout-qos2-helper.py']) + pub.wait() + # Should have now received a publish command + + if mosq_test.expect_packet(sock, "publish", publish_packet): + # Wait for longer than 5 seconds to get republish with dup set + # This is covered by the 8 second timeout + + if mosq_test.expect_packet(sock, "dup publish", publish_dup_packet): + sock.send(pubrec_packet) + + if mosq_test.expect_packet(sock, "pubrel", pubrel_packet): + # Wait for longer than 5 seconds to get republish with dup set + # This is covered by the 8 second timeout + + if mosq_test.expect_packet(sock, "dup pubrel", pubrel_packet): + sock.send(pubcomp_packet) + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/03-publish-c2b-disconnect-qos2.conf b/src/libs/mosquitto/test/broker/03-publish-c2b-disconnect-qos2.conf new file mode 100644 index 0000000..a427f24 --- /dev/null +++ b/src/libs/mosquitto/test/broker/03-publish-c2b-disconnect-qos2.conf @@ -0,0 +1,2 @@ +retry_interval 10 +port 1888 diff --git a/src/libs/mosquitto/test/broker/03-publish-c2b-disconnect-qos2.py b/src/libs/mosquitto/test/broker/03-publish-c2b-disconnect-qos2.py new file mode 100755 index 0000000..e082b69 --- /dev/null +++ b/src/libs/mosquitto/test/broker/03-publish-c2b-disconnect-qos2.py @@ -0,0 +1,67 @@ +#!/usr/bin/env python + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +mid = 3265 +keepalive = 60 +connect_packet = mosq_test.gen_connect("pub-qos2-disco-test", keepalive=keepalive, clean_session=False) +connack_packet = mosq_test.gen_connack(rc=0) + +subscribe_packet = mosq_test.gen_subscribe(mid, "qos2/disconnect/test", 2) +suback_packet = mosq_test.gen_suback(mid, 2) + +mid = 1 +publish_packet = mosq_test.gen_publish("qos2/disconnect/test", qos=2, mid=mid, payload="disconnect-message") +publish_dup_packet = mosq_test.gen_publish("qos2/disconnect/test", qos=2, mid=mid, payload="disconnect-message", dup=True) +pubrec_packet = mosq_test.gen_pubrec(mid) +pubrel_packet = mosq_test.gen_pubrel(mid) +pubrel_dup_packet = mosq_test.gen_pubrel(mid, dup=True) +pubcomp_packet = mosq_test.gen_pubcomp(mid) + +mid = 3266 +publish2_packet = mosq_test.gen_publish("qos1/outgoing", qos=1, mid=mid, payload="outgoing-message") +puback2_packet = mosq_test.gen_puback(mid) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__)) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet) + + sock.send(publish_packet) + if mosq_test.expect_packet(sock, "pubrec", pubrec_packet): + # We're now going to disconnect and pretend we didn't receive the pubrec. + sock.close() + + sock = mosq_test.do_client_connect(connect_packet, connack_packet) + sock.send(publish_dup_packet) + + if mosq_test.expect_packet(sock, "pubrec", pubrec_packet): + sock.send(pubrel_packet) + + if mosq_test.expect_packet(sock, "pubcomp", pubcomp_packet): + # Again, pretend we didn't receive this pubcomp + sock.close() + + sock = mosq_test.do_client_connect(connect_packet, connack_packet) + sock.send(pubrel_dup_packet) + + if mosq_test.expect_packet(sock, "pubcomp", pubcomp_packet): + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/03-publish-c2b-timeout-qos2.conf b/src/libs/mosquitto/test/broker/03-publish-c2b-timeout-qos2.conf new file mode 100644 index 0000000..a427f24 --- /dev/null +++ b/src/libs/mosquitto/test/broker/03-publish-c2b-timeout-qos2.conf @@ -0,0 +1,2 @@ +retry_interval 10 +port 1888 diff --git a/src/libs/mosquitto/test/broker/03-publish-c2b-timeout-qos2.py b/src/libs/mosquitto/test/broker/03-publish-c2b-timeout-qos2.py new file mode 100755 index 0000000..e6fdecb --- /dev/null +++ b/src/libs/mosquitto/test/broker/03-publish-c2b-timeout-qos2.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python + +# Test whether a PUBLISH to a topic with QoS 2 results in the correct packet +# flow. This test introduces delays into the flow in order to force the broker +# to send duplicate PUBREC and PUBCOMP messages. + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 600 +connect_packet = mosq_test.gen_connect("pub-qos2-timeout-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 1926 +publish_packet = mosq_test.gen_publish("pub/qos2/test", qos=2, mid=mid, payload="timeout-message") +pubrec_packet = mosq_test.gen_pubrec(mid) +pubrel_packet = mosq_test.gen_pubrel(mid) +pubcomp_packet = mosq_test.gen_pubcomp(mid) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__)) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet) + sock.send(publish_packet) + + if mosq_test.expect_packet(sock, "pubrec", pubrec_packet): + # Timeout is 8 seconds which means the broker should repeat the PUBREC. + + if mosq_test.expect_packet(sock, "pubrec", pubrec_packet): + sock.send(pubrel_packet) + + if mosq_test.expect_packet(sock, "pubcomp", pubcomp_packet): + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/03-publish-qos1.py b/src/libs/mosquitto/test/broker/03-publish-qos1.py new file mode 100755 index 0000000..ce594c0 --- /dev/null +++ b/src/libs/mosquitto/test/broker/03-publish-qos1.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python + +# Test whether a PUBLISH to a topic with QoS 1 results in the correct PUBACK packet. + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +mid = 19 +keepalive = 60 +connect_packet = mosq_test.gen_connect("pub-qos1-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +publish_packet = mosq_test.gen_publish("pub/qos1/test", qos=1, mid=mid, payload="message") +puback_packet = mosq_test.gen_puback(mid) + +cmd = ['../../src/mosquitto', '-p', '1888'] +broker = mosq_test.start_broker(filename=os.path.basename(__file__), cmd=cmd) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet) + sock.send(publish_packet) + + if mosq_test.expect_packet(sock, "puback", puback_packet): + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/03-publish-qos2.py b/src/libs/mosquitto/test/broker/03-publish-qos2.py new file mode 100755 index 0000000..b69e90e --- /dev/null +++ b/src/libs/mosquitto/test/broker/03-publish-qos2.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python + +# Test whether a PUBLISH to a topic with QoS 2 results in the correct packet flow. + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("pub-qos2-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 312 +publish_packet = mosq_test.gen_publish("pub/qos2/test", qos=2, mid=mid, payload="message") +pubrec_packet = mosq_test.gen_pubrec(mid) +pubrel_packet = mosq_test.gen_pubrel(mid) +pubcomp_packet = mosq_test.gen_pubcomp(mid) + +cmd = ['../../src/mosquitto', '-p', '1888'] +broker = mosq_test.start_broker(filename=os.path.basename(__file__), cmd=cmd) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet) + sock.send(publish_packet) + + if mosq_test.expect_packet(sock, "pubrec", pubrec_packet): + sock.send(pubrel_packet) + + if mosq_test.expect_packet(sock, "pubcomp", pubcomp_packet): + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/04-retain-qos0-clear.py b/src/libs/mosquitto/test/broker/04-retain-qos0-clear.py new file mode 100755 index 0000000..e2c41c0 --- /dev/null +++ b/src/libs/mosquitto/test/broker/04-retain-qos0-clear.py @@ -0,0 +1,72 @@ +#!/usr/bin/env python + +# Test whether a retained PUBLISH is cleared when a zero length retained +# message is published to a topic. + +import socket + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("retain-clear-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +publish_packet = mosq_test.gen_publish("retain/clear/test", qos=0, payload="retained message", retain=True) +retain_clear_packet = mosq_test.gen_publish("retain/clear/test", qos=0, payload=None, retain=True) +mid_sub = 592 +subscribe_packet = mosq_test.gen_subscribe(mid_sub, "retain/clear/test", 0) +suback_packet = mosq_test.gen_suback(mid_sub, 0) + +mid_unsub = 593 +unsubscribe_packet = mosq_test.gen_unsubscribe(mid_unsub, "retain/clear/test") +unsuback_packet = mosq_test.gen_unsuback(mid_unsub) + +cmd = ['../../src/mosquitto', '-p', '1888'] +broker = mosq_test.start_broker(filename=os.path.basename(__file__), cmd=cmd) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=4) + # Send retained message + sock.send(publish_packet) + # Subscribe to topic, we should get the retained message back. + sock.send(subscribe_packet) + + if mosq_test.expect_packet(sock, "suback", suback_packet): + if mosq_test.expect_packet(sock, "publish", publish_packet): + # Now unsubscribe from the topic before we clear the retained + # message. + sock.send(unsubscribe_packet) + + if mosq_test.expect_packet(sock, "unsuback", unsuback_packet): + # Now clear the retained message. + sock.send(retain_clear_packet) + + # Subscribe to topic, we shouldn't get anything back apart + # from the SUBACK. + sock.send(subscribe_packet) + if mosq_test.expect_packet(sock, "suback", suback_packet): + try: + retain_clear = sock.recv(256) + except socket.timeout: + # This is the expected event + rc = 0 + else: + print("FAIL: Received unexpected message.") + + sock.close() +finally: + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/04-retain-qos0-fresh.py b/src/libs/mosquitto/test/broker/04-retain-qos0-fresh.py new file mode 100755 index 0000000..39f58ae --- /dev/null +++ b/src/libs/mosquitto/test/broker/04-retain-qos0-fresh.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python + +# Test whether a retained PUBLISH to a topic with QoS 0 is sent with +# retain=false to an already subscribed client. + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +mid = 16 +connect_packet = mosq_test.gen_connect("retain-qos0-fresh-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +publish_packet = mosq_test.gen_publish("retain/qos0/test", qos=0, payload="retained message", retain=True) +publish_fresh_packet = mosq_test.gen_publish("retain/qos0/test", qos=0, payload="retained message") +subscribe_packet = mosq_test.gen_subscribe(mid, "retain/qos0/test", 0) +suback_packet = mosq_test.gen_suback(mid, 0) + +cmd = ['../../src/mosquitto', '-p', '1888'] +broker = mosq_test.start_broker(filename=os.path.basename(__file__), cmd=cmd) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet) + sock.send(subscribe_packet) + + if mosq_test.expect_packet(sock, "suback", suback_packet): + sock.send(publish_packet) + + if mosq_test.expect_packet(sock, "publish", publish_fresh_packet): + rc = 0 + sock.close() +finally: + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/04-retain-qos0-repeated.py b/src/libs/mosquitto/test/broker/04-retain-qos0-repeated.py new file mode 100755 index 0000000..74644a6 --- /dev/null +++ b/src/libs/mosquitto/test/broker/04-retain-qos0-repeated.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python + +# Test whether a retained PUBLISH to a topic with QoS 0 is actually retained +# and delivered when multiple sub/unsub operations are carried out. + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +mid = 16 +connect_packet = mosq_test.gen_connect("retain-qos0-rep-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +publish_packet = mosq_test.gen_publish("retain/qos0/test", qos=0, payload="retained message", retain=True) +subscribe_packet = mosq_test.gen_subscribe(mid, "retain/qos0/test", 0) +suback_packet = mosq_test.gen_suback(mid, 0) + +unsub_mid = 13 +unsubscribe_packet = mosq_test.gen_unsubscribe(unsub_mid, "retain/qos0/test") +unsuback_packet = mosq_test.gen_unsuback(unsub_mid) + +cmd = ['../../src/mosquitto', '-p', '1888'] +broker = mosq_test.start_broker(filename=os.path.basename(__file__), cmd=cmd) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20) + sock.send(publish_packet) + sock.send(subscribe_packet) + + if mosq_test.expect_packet(sock, "suback", suback_packet): + if mosq_test.expect_packet(sock, "publish", publish_packet): + sock.send(unsubscribe_packet) + + if mosq_test.expect_packet(sock, "unsuback", unsuback_packet): + sock.send(subscribe_packet) + + if mosq_test.expect_packet(sock, "suback", suback_packet): + if mosq_test.expect_packet(sock, "publish", publish_packet): + rc = 0 + sock.close() +finally: + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/04-retain-qos0.py b/src/libs/mosquitto/test/broker/04-retain-qos0.py new file mode 100755 index 0000000..b0fa51b --- /dev/null +++ b/src/libs/mosquitto/test/broker/04-retain-qos0.py @@ -0,0 +1,43 @@ +#!/usr/bin/env python + +# Test whether a retained PUBLISH to a topic with QoS 0 is actually retained. + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +mid = 16 +connect_packet = mosq_test.gen_connect("retain-qos0-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +publish_packet = mosq_test.gen_publish("retain/qos0/test", qos=0, payload="retained message", retain=True) +subscribe_packet = mosq_test.gen_subscribe(mid, "retain/qos0/test", 0) +suback_packet = mosq_test.gen_suback(mid, 0) + +cmd = ['../../src/mosquitto', '-p', '1888'] +broker = mosq_test.start_broker(filename=os.path.basename(__file__), cmd=cmd) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet) + sock.send(publish_packet) + sock.send(subscribe_packet) + + if mosq_test.expect_packet(sock, "suback", suback_packet): + if mosq_test.expect_packet(sock, "publish", publish_packet): + rc = 0 + sock.close() +finally: + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/04-retain-qos1-qos0.py b/src/libs/mosquitto/test/broker/04-retain-qos1-qos0.py new file mode 100755 index 0000000..59d4c9d --- /dev/null +++ b/src/libs/mosquitto/test/broker/04-retain-qos1-qos0.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python + +# Test whether a retained PUBLISH to a topic with QoS 1 is retained. +# Subscription is made with QoS 0 so the retained message should also have QoS +# 0. + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("retain-qos1-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 6 +publish_packet = mosq_test.gen_publish("retain/qos1/test", qos=1, mid=mid, payload="retained message", retain=True) +puback_packet = mosq_test.gen_puback(mid) +mid = 18 +subscribe_packet = mosq_test.gen_subscribe(mid, "retain/qos1/test", 0) +suback_packet = mosq_test.gen_suback(mid, 0) +publish0_packet = mosq_test.gen_publish("retain/qos1/test", qos=0, payload="retained message", retain=True) + +cmd = ['../../src/mosquitto', '-p', '1888'] +broker = mosq_test.start_broker(filename=os.path.basename(__file__), cmd=cmd) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet) + sock.send(publish_packet) + + if mosq_test.expect_packet(sock, "puback", puback_packet): + sock.send(subscribe_packet) + + if mosq_test.expect_packet(sock, "suback", suback_packet): + if mosq_test.expect_packet(sock, "publish0", publish0_packet): + rc = 0 + sock.close() +finally: + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/05-clean-session-qos1-helper.py b/src/libs/mosquitto/test/broker/05-clean-session-qos1-helper.py new file mode 100755 index 0000000..c3b129d --- /dev/null +++ b/src/libs/mosquitto/test/broker/05-clean-session-qos1-helper.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python + +# Test whether a clean session client has a QoS 1 message queued for it. + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("test-helper", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 128 +publish_packet = mosq_test.gen_publish("qos1/clean_session/test", qos=1, mid=mid, payload="clean-session-message") +puback_packet = mosq_test.gen_puback(mid) + +sock = mosq_test.do_client_connect(connect_packet, connack_packet) +sock.send(publish_packet) + +if mosq_test.expect_packet(sock, "puback", puback_packet): + rc = 0 + +sock.close() + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/05-clean-session-qos1.py b/src/libs/mosquitto/test/broker/05-clean-session-qos1.py new file mode 100755 index 0000000..5619773 --- /dev/null +++ b/src/libs/mosquitto/test/broker/05-clean-session-qos1.py @@ -0,0 +1,59 @@ +#!/usr/bin/env python + +# Test whether a clean session client has a QoS 1 message queued for it. + +import subprocess + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +mid = 109 +keepalive = 60 +connect_packet = mosq_test.gen_connect("clean-qos2-test", keepalive=keepalive, clean_session=False) +connack_packet = mosq_test.gen_connack(rc=0) + +disconnect_packet = mosq_test.gen_disconnect() + +subscribe_packet = mosq_test.gen_subscribe(mid, "qos1/clean_session/test", 1) +suback_packet = mosq_test.gen_suback(mid, 1) + +mid = 1 +publish_packet = mosq_test.gen_publish("qos1/clean_session/test", qos=1, mid=mid, payload="clean-session-message") +puback_packet = mosq_test.gen_puback(mid) + +cmd = ['../../src/mosquitto', '-p', '1888'] +broker = mosq_test.start_broker(filename=os.path.basename(__file__), cmd=cmd) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet) + sock.send(subscribe_packet) + + if mosq_test.expect_packet(sock, "suback", suback_packet): + sock.send(disconnect_packet) + sock.close() + + pub = subprocess.Popen(['./05-clean-session-qos1-helper.py']) + pub.wait() + + # Now reconnect and expect a publish message. + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=30) + if mosq_test.expect_packet(sock, "publish", publish_packet): + sock.send(puback_packet) + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/06-bridge-b2br-disconnect-qos1.conf b/src/libs/mosquitto/test/broker/06-bridge-b2br-disconnect-qos1.conf new file mode 100644 index 0000000..7561186 --- /dev/null +++ b/src/libs/mosquitto/test/broker/06-bridge-b2br-disconnect-qos1.conf @@ -0,0 +1,9 @@ +port 1889 + +retry_interval 10 + +connection bridge_sample +address 127.0.0.1:1888 +topic bridge/# both 1 +notifications false +restart_timeout 5 diff --git a/src/libs/mosquitto/test/broker/06-bridge-b2br-disconnect-qos1.py b/src/libs/mosquitto/test/broker/06-bridge-b2br-disconnect-qos1.py new file mode 100755 index 0000000..e48003e --- /dev/null +++ b/src/libs/mosquitto/test/broker/06-bridge-b2br-disconnect-qos1.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python + +# Does a bridge resend a QoS=1 message correctly after a disconnect? + +import socket + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +client_id = socket.gethostname()+".bridge_sample" +connect_packet = mosq_test.gen_connect(client_id, keepalive=keepalive, clean_session=False, proto_ver=128+3) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 1 +subscribe_packet = mosq_test.gen_subscribe(mid, "bridge/#", 1) +suback_packet = mosq_test.gen_suback(mid, 1) + +mid = 2 +subscribe2_packet = mosq_test.gen_subscribe(mid, "bridge/#", 1) +suback2_packet = mosq_test.gen_suback(mid, 1) + +mid = 3 +publish_packet = mosq_test.gen_publish("bridge/disconnect/test", qos=1, mid=mid, payload="disconnect-message") +publish_dup_packet = mosq_test.gen_publish("bridge/disconnect/test", qos=1, mid=mid, payload="disconnect-message", dup=True) +puback_packet = mosq_test.gen_puback(mid) + +mid = 20 +publish2_packet = mosq_test.gen_publish("bridge/disconnect/test", qos=1, mid=mid, payload="disconnect-message") +puback2_packet = mosq_test.gen_puback(mid) + +ssock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +ssock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +ssock.settimeout(40) +ssock.bind(('', 1888)) +ssock.listen(5) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=1889) + +try: + (bridge, address) = ssock.accept() + bridge.settimeout(20) + + if mosq_test.expect_packet(bridge, "connect", connect_packet): + bridge.send(connack_packet) + + if mosq_test.expect_packet(bridge, "subscribe", subscribe_packet): + bridge.send(suback_packet) + + bridge.send(publish_packet) + # Bridge doesn't have time to respond but should expect us to retry + # and so remove PUBACK. + bridge.close() + + (bridge, address) = ssock.accept() + bridge.settimeout(20) + + if mosq_test.expect_packet(bridge, "connect", connect_packet): + bridge.send(connack_packet) + + if mosq_test.expect_packet(bridge, "2nd subscribe", subscribe2_packet): + bridge.send(suback2_packet) + + # Send a different publish message to make sure the response isn't to the old one. + bridge.send(publish2_packet) + if mosq_test.expect_packet(bridge, "puback", puback2_packet): + rc = 0 + + bridge.close() +finally: + try: + bridge.close() + except NameError: + pass + + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + ssock.close() + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/06-bridge-b2br-disconnect-qos2.conf b/src/libs/mosquitto/test/broker/06-bridge-b2br-disconnect-qos2.conf new file mode 100644 index 0000000..ed5fa9f --- /dev/null +++ b/src/libs/mosquitto/test/broker/06-bridge-b2br-disconnect-qos2.conf @@ -0,0 +1,11 @@ +port 1889 + +retry_interval 10 + +connection bridge_sample +address 127.0.0.1:1888 +topic bridge/# both 2 +notifications false +restart_timeout 5 + +log_type debug diff --git a/src/libs/mosquitto/test/broker/06-bridge-b2br-disconnect-qos2.py b/src/libs/mosquitto/test/broker/06-bridge-b2br-disconnect-qos2.py new file mode 100755 index 0000000..243eb61 --- /dev/null +++ b/src/libs/mosquitto/test/broker/06-bridge-b2br-disconnect-qos2.py @@ -0,0 +1,107 @@ +#!/usr/bin/env python + +# Does a bridge resend a QoS=1 message correctly after a disconnect? + +import socket + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +client_id = socket.gethostname()+".bridge_sample" +connect_packet = mosq_test.gen_connect(client_id, keepalive=keepalive, clean_session=False, proto_ver=128+3) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 1 +subscribe_packet = mosq_test.gen_subscribe(mid, "bridge/#", 2) +suback_packet = mosq_test.gen_suback(mid, 2) + +mid = 2 +subscribe2_packet = mosq_test.gen_subscribe(mid, "bridge/#", 2) +suback2_packet = mosq_test.gen_suback(mid, 2) + +mid = 3 +subscribe3_packet = mosq_test.gen_subscribe(mid, "bridge/#", 2) +suback3_packet = mosq_test.gen_suback(mid, 2) + +mid = 5 +publish_packet = mosq_test.gen_publish("bridge/disconnect/test", qos=2, mid=mid, payload="disconnect-message") +publish_dup_packet = mosq_test.gen_publish("bridge/disconnect/test", qos=2, mid=mid, payload="disconnect-message", dup=True) +pubrec_packet = mosq_test.gen_pubrec(mid) +pubrel_packet = mosq_test.gen_pubrel(mid) +pubcomp_packet = mosq_test.gen_pubcomp(mid) + +ssock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +ssock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +ssock.settimeout(40) +ssock.bind(('', 1888)) +ssock.listen(5) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=1889) + +try: + (bridge, address) = ssock.accept() + bridge.settimeout(20) + + if mosq_test.expect_packet(bridge, "connect", connect_packet): + bridge.send(connack_packet) + + if mosq_test.expect_packet(bridge, "subscribe", subscribe_packet): + bridge.send(suback_packet) + + bridge.send(publish_packet) + bridge.close() + + (bridge, address) = ssock.accept() + bridge.settimeout(20) + + if mosq_test.expect_packet(bridge, "connect", connect_packet): + bridge.send(connack_packet) + + if mosq_test.expect_packet(bridge, "2nd subscribe", subscribe2_packet): + bridge.send(suback2_packet) + bridge.send(publish_dup_packet) + + if mosq_test.expect_packet(bridge, "pubrec", pubrec_packet): + bridge.send(pubrel_packet) + bridge.close() + + (bridge, address) = ssock.accept() + bridge.settimeout(20) + + if mosq_test.expect_packet(bridge, "connect", connect_packet): + bridge.send(connack_packet) + + if mosq_test.expect_packet(bridge, "3rd subscribe", subscribe3_packet): + bridge.send(suback3_packet) + + bridge.send(publish_dup_packet) + + if mosq_test.expect_packet(bridge, "2nd pubrec", pubrec_packet): + bridge.send(pubrel_packet) + + if mosq_test.expect_packet(bridge, "pubcomp", pubcomp_packet): + rc = 0 + + bridge.close() +finally: + try: + bridge.close() + except NameError: + pass + + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + ssock.close() + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/06-bridge-br2b-disconnect-qos1-helper.py b/src/libs/mosquitto/test/broker/06-bridge-br2b-disconnect-qos1-helper.py new file mode 100755 index 0000000..afa93c3 --- /dev/null +++ b/src/libs/mosquitto/test/broker/06-bridge-br2b-disconnect-qos1-helper.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("test-helper", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 128 +publish_packet = mosq_test.gen_publish("bridge/disconnect/test", qos=1, mid=mid, payload="disconnect-message") +puback_packet = mosq_test.gen_puback(mid) + +sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=1889, connack_error="helper connack") +sock.send(publish_packet) + +if mosq_test.expect_packet(sock, "helper puback", puback_packet): + rc = 0 + +sock.close() + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/06-bridge-br2b-disconnect-qos1.conf b/src/libs/mosquitto/test/broker/06-bridge-br2b-disconnect-qos1.conf new file mode 100644 index 0000000..dccb952 --- /dev/null +++ b/src/libs/mosquitto/test/broker/06-bridge-br2b-disconnect-qos1.conf @@ -0,0 +1,10 @@ +port 1889 + +retry_interval 10 + +connection bridge_sample +address 127.0.0.1:1888 +topic bridge/# both 1 +notifications false +restart_timeout 5 +try_private true diff --git a/src/libs/mosquitto/test/broker/06-bridge-br2b-disconnect-qos1.py b/src/libs/mosquitto/test/broker/06-bridge-br2b-disconnect-qos1.py new file mode 100755 index 0000000..9047d45 --- /dev/null +++ b/src/libs/mosquitto/test/broker/06-bridge-br2b-disconnect-qos1.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python + +# Does a bridge resend a QoS=1 message correctly after a disconnect? + +import subprocess +import socket + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +client_id = socket.gethostname()+".bridge_sample" +connect_packet = mosq_test.gen_connect(client_id, keepalive=keepalive, clean_session=False, proto_ver=128+3) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 1 +subscribe_packet = mosq_test.gen_subscribe(mid, "bridge/#", 1) +suback_packet = mosq_test.gen_suback(mid, 1) + +mid = 3 +subscribe2_packet = mosq_test.gen_subscribe(mid, "bridge/#", 1) +suback2_packet = mosq_test.gen_suback(mid, 1) + +mid = 2 +publish_packet = mosq_test.gen_publish("bridge/disconnect/test", qos=1, mid=mid, payload="disconnect-message") +publish_dup_packet = mosq_test.gen_publish("bridge/disconnect/test", qos=1, mid=mid, payload="disconnect-message", dup=True) +puback_packet = mosq_test.gen_puback(mid) + +ssock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +ssock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +ssock.settimeout(40) +ssock.bind(('', 1888)) +ssock.listen(5) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=1889) + +try: + (bridge, address) = ssock.accept() + bridge.settimeout(20) + + if mosq_test.expect_packet(bridge, "connect", connect_packet): + bridge.send(connack_packet) + + if mosq_test.expect_packet(bridge, "subscribe", subscribe_packet): + bridge.send(suback_packet) + + pub = subprocess.Popen(['./06-bridge-br2b-disconnect-qos1-helper.py']) + if pub.wait(): + exit(1) + + if mosq_test.expect_packet(bridge, "publish", publish_packet): + bridge.close() + + (bridge, address) = ssock.accept() + bridge.settimeout(20) + + if mosq_test.expect_packet(bridge, "2nd connect", connect_packet): + bridge.send(connack_packet) + + if mosq_test.expect_packet(bridge, "2nd subscribe", subscribe2_packet): + bridge.send(suback2_packet) + + if mosq_test.expect_packet(bridge, "2nd publish", publish_dup_packet): + rc = 0 + + bridge.close() +finally: + try: + bridge.close() + except NameError: + pass + + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + ssock.close() + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/06-bridge-br2b-disconnect-qos2-helper.py b/src/libs/mosquitto/test/broker/06-bridge-br2b-disconnect-qos2-helper.py new file mode 100755 index 0000000..d7f04b7 --- /dev/null +++ b/src/libs/mosquitto/test/broker/06-bridge-br2b-disconnect-qos2-helper.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("test-helper", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 312 +publish_packet = mosq_test.gen_publish("bridge/disconnect/test", qos=2, mid=mid, payload="disconnect-message") +pubrec_packet = mosq_test.gen_pubrec(mid) +pubrel_packet = mosq_test.gen_pubrel(mid) +pubcomp_packet = mosq_test.gen_pubcomp(mid) + +sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=1889, connack_error="helper connack") +sock.send(publish_packet) + +if mosq_test.expect_packet(sock, "helper pubrec", pubrec_packet): + sock.send(pubrel_packet) + + if mosq_test.expect_packet(sock, "helper pubcomp", pubcomp_packet): + rc = 0 + +sock.close() + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/06-bridge-br2b-disconnect-qos2.conf b/src/libs/mosquitto/test/broker/06-bridge-br2b-disconnect-qos2.conf new file mode 100644 index 0000000..ed5fa9f --- /dev/null +++ b/src/libs/mosquitto/test/broker/06-bridge-br2b-disconnect-qos2.conf @@ -0,0 +1,11 @@ +port 1889 + +retry_interval 10 + +connection bridge_sample +address 127.0.0.1:1888 +topic bridge/# both 2 +notifications false +restart_timeout 5 + +log_type debug diff --git a/src/libs/mosquitto/test/broker/06-bridge-br2b-disconnect-qos2.py b/src/libs/mosquitto/test/broker/06-bridge-br2b-disconnect-qos2.py new file mode 100755 index 0000000..acb105a --- /dev/null +++ b/src/libs/mosquitto/test/broker/06-bridge-br2b-disconnect-qos2.py @@ -0,0 +1,109 @@ +#!/usr/bin/env python + +# Does a bridge resend a QoS=1 message correctly after a disconnect? + +import subprocess +import socket + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +client_id = socket.gethostname()+".bridge_sample" +connect_packet = mosq_test.gen_connect(client_id, keepalive=keepalive, clean_session=False, proto_ver=128+3) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 1 +subscribe_packet = mosq_test.gen_subscribe(mid, "bridge/#", 2) +suback_packet = mosq_test.gen_suback(mid, 2) + +mid = 3 +subscribe2_packet = mosq_test.gen_subscribe(mid, "bridge/#", 2) +suback2_packet = mosq_test.gen_suback(mid, 2) + +mid = 4 +subscribe3_packet = mosq_test.gen_subscribe(mid, "bridge/#", 2) +suback3_packet = mosq_test.gen_suback(mid, 2) + +mid = 2 +publish_packet = mosq_test.gen_publish("bridge/disconnect/test", qos=2, mid=mid, payload="disconnect-message") +publish_dup_packet = mosq_test.gen_publish("bridge/disconnect/test", qos=2, mid=mid, payload="disconnect-message", dup=True) +pubrec_packet = mosq_test.gen_pubrec(mid) +pubrel_packet = mosq_test.gen_pubrel(mid) +pubcomp_packet = mosq_test.gen_pubcomp(mid) + +ssock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +ssock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +ssock.settimeout(40) +ssock.bind(('', 1888)) +ssock.listen(5) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=1889) + +try: + (bridge, address) = ssock.accept() + bridge.settimeout(20) + + if mosq_test.expect_packet(bridge, "connect", connect_packet): + bridge.send(connack_packet) + + if mosq_test.expect_packet(bridge, "subscribe", subscribe_packet): + bridge.send(suback_packet) + + pub = subprocess.Popen(['./06-bridge-br2b-disconnect-qos2-helper.py']) + if pub.wait(): + exit(1) + + if mosq_test.expect_packet(bridge, "publish", publish_packet): + bridge.close() + + (bridge, address) = ssock.accept() + bridge.settimeout(20) + + if mosq_test.expect_packet(bridge, "connect", connect_packet): + bridge.send(connack_packet) + + if mosq_test.expect_packet(bridge, "2nd subscribe", subscribe2_packet): + bridge.send(suback2_packet) + + if mosq_test.expect_packet(bridge, "2nd publish", publish_dup_packet): + bridge.send(pubrec_packet) + + if mosq_test.expect_packet(bridge, "pubrel", pubrel_packet): + bridge.close() + + (bridge, address) = ssock.accept() + bridge.settimeout(20) + + if mosq_test.expect_packet(bridge, "connect", connect_packet): + bridge.send(connack_packet) + + if mosq_test.expect_packet(bridge, "3rd subscribe", subscribe3_packet): + bridge.send(suback3_packet) + + if mosq_test.expect_packet(bridge, "2nd pubrel", pubrel_packet): + bridge.send(pubcomp_packet) + rc = 0 + + bridge.close() +finally: + try: + bridge.close() + except NameError: + pass + + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + ssock.close() + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/06-bridge-fail-persist-resend-qos1.conf b/src/libs/mosquitto/test/broker/06-bridge-fail-persist-resend-qos1.conf new file mode 100644 index 0000000..daaf157 --- /dev/null +++ b/src/libs/mosquitto/test/broker/06-bridge-fail-persist-resend-qos1.conf @@ -0,0 +1,11 @@ +port 1889 + +connection bridge-u-test +remote_clientid bridge-u-test +address 127.0.0.1:1888 +topic bridge/# out + +cleansession true +notifications false +restart_timeout 5 +try_private false diff --git a/src/libs/mosquitto/test/broker/06-bridge-fail-persist-resend-qos1.py b/src/libs/mosquitto/test/broker/06-bridge-fail-persist-resend-qos1.py new file mode 100755 index 0000000..0b4e93c --- /dev/null +++ b/src/libs/mosquitto/test/broker/06-bridge-fail-persist-resend-qos1.py @@ -0,0 +1,77 @@ +#!/usr/bin/env python + +# Test whether a bridge can cope with an unknown PUBACK + +import socket +import subprocess +import time + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("bridge-u-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 180 +mid_unknown = 2000 + +publish_packet = mosq_test.gen_publish("bridge/unknown/qos1", qos=1, payload="bridge-message", mid=mid) +puback_packet = mosq_test.gen_puback(mid) +puback_packet_unknown = mosq_test.gen_puback(mid_unknown) + + +unsubscribe_packet = mosq_test.gen_unsubscribe(1, "bridge/#") +unsuback_packet = mosq_test.gen_unsuback(1) + + +if os.environ.get('MOSQ_USE_VALGRIND') is not None: + sleep_time = 5 +else: + sleep_time = 0.5 + + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', 1888)) +sock.listen(5) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=1889) +time.sleep(sleep_time) + +try: + (conn, address) = sock.accept() + conn.settimeout(20) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "unsubscribe", unsubscribe_packet): + conn.send(unsuback_packet) + + # Send the unexpected puback packet + conn.send(puback_packet_unknown) + + # Send a legitimate publish packet to verify everything is still ok + conn.send(publish_packet) + + if mosq_test.expect_packet(conn, "puback", puback_packet): + rc = 0 + +finally: + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + sock.close() + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/06-bridge-fail-persist-resend-qos2.conf b/src/libs/mosquitto/test/broker/06-bridge-fail-persist-resend-qos2.conf new file mode 100644 index 0000000..daaf157 --- /dev/null +++ b/src/libs/mosquitto/test/broker/06-bridge-fail-persist-resend-qos2.conf @@ -0,0 +1,11 @@ +port 1889 + +connection bridge-u-test +remote_clientid bridge-u-test +address 127.0.0.1:1888 +topic bridge/# out + +cleansession true +notifications false +restart_timeout 5 +try_private false diff --git a/src/libs/mosquitto/test/broker/06-bridge-fail-persist-resend-qos2.py b/src/libs/mosquitto/test/broker/06-bridge-fail-persist-resend-qos2.py new file mode 100755 index 0000000..e6b0b5e --- /dev/null +++ b/src/libs/mosquitto/test/broker/06-bridge-fail-persist-resend-qos2.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python + +# Test whether a bridge can cope with an unknown PUBACK + +import socket +import subprocess +import time + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("bridge-u-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 180 +mid_unknown = 2000 + +publish_packet = mosq_test.gen_publish("bridge/unknown/qos2", qos=1, payload="bridge-message", mid=mid) +puback_packet = mosq_test.gen_puback(mid) + +pubrec_packet_unknown1 = mosq_test.gen_pubrec(mid_unknown+1) +pubrel_packet_unknown1 = mosq_test.gen_pubrel(mid_unknown+1) + +pubrel_packet_unknown2 = mosq_test.gen_pubrel(mid_unknown+2) +pubcomp_packet_unknown2 = mosq_test.gen_pubcomp(mid_unknown+2) + +pubcomp_packet_unknown3 = mosq_test.gen_pubcomp(mid_unknown+3) + + +unsubscribe_packet = mosq_test.gen_unsubscribe(1, "bridge/#") +unsuback_packet = mosq_test.gen_unsuback(1) + + +if os.environ.get('MOSQ_USE_VALGRIND') is not None: + sleep_time = 5 +else: + sleep_time = 0.5 + + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', 1888)) +sock.listen(5) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=1889) +time.sleep(sleep_time) + +try: + (conn, address) = sock.accept() + conn.settimeout(20) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "unsubscribe", unsubscribe_packet): + conn.send(unsuback_packet) + + # Send the unexpected pubrec packet + conn.send(pubrec_packet_unknown1) + if mosq_test.expect_packet(conn, "pubrel", pubrel_packet_unknown1): + + conn.send(pubrel_packet_unknown2) + if mosq_test.expect_packet(conn, "pubcomp", pubcomp_packet_unknown2): + + conn.send(pubcomp_packet_unknown3) + + # Send a legitimate publish packet to verify everything is still ok + conn.send(publish_packet) + + if mosq_test.expect_packet(conn, "puback", puback_packet): + rc = 0 + +finally: + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + sock.close() + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/06-bridge-reconnect-local-out-helper.py b/src/libs/mosquitto/test/broker/06-bridge-reconnect-local-out-helper.py new file mode 100755 index 0000000..08a5636 --- /dev/null +++ b/src/libs/mosquitto/test/broker/06-bridge-reconnect-local-out-helper.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("test-helper", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +publish_packet = mosq_test.gen_publish("bridge/reconnect", qos=1, mid=1, payload="bridge-reconnect-message") +puback_packet = mosq_test.gen_puback(mid=1) + +disconnect_packet = mosq_test.gen_disconnect() + +sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=1889, connack_error="helper connack") +sock.send(publish_packet) + +if mosq_test.expect_packet(sock, "puback", puback_packet): + sock.send(disconnect_packet) + rc = 0 + +sock.close() + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/06-bridge-reconnect-local-out.conf b/src/libs/mosquitto/test/broker/06-bridge-reconnect-local-out.conf new file mode 100644 index 0000000..6f3bc6e --- /dev/null +++ b/src/libs/mosquitto/test/broker/06-bridge-reconnect-local-out.conf @@ -0,0 +1,9 @@ +port 1889 + +persistence true + +retry_interval 10 + +connection bridge_sample +address 127.0.0.1:1888 +topic bridge/# out diff --git a/src/libs/mosquitto/test/broker/06-bridge-reconnect-local-out.py b/src/libs/mosquitto/test/broker/06-bridge-reconnect-local-out.py new file mode 100755 index 0000000..e846c69 --- /dev/null +++ b/src/libs/mosquitto/test/broker/06-bridge-reconnect-local-out.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python + +# Test whether a bridge topics work correctly after reconnection. +# Important point here is that persistence is enabled. + +import subprocess +import time + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("bridge-reconnect-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 180 +subscribe_packet = mosq_test.gen_subscribe(mid, "bridge/#", 0) +suback_packet = mosq_test.gen_suback(mid, 0) +publish_packet = mosq_test.gen_publish("bridge/reconnect", qos=0, payload="bridge-reconnect-message") + +try: + os.remove('mosquitto.db') +except OSError: + pass + +cmd = ['../../src/mosquitto', '-p', '1888'] +broker = mosq_test.start_broker(filename=os.path.basename(__file__), cmd=cmd) + +local_cmd = ['../../src/mosquitto', '-c', '06-bridge-reconnect-local-out.conf'] +local_broker = mosq_test.start_broker(cmd=local_cmd, filename=os.path.basename(__file__)+'_local1') +if os.environ.get('MOSQ_USE_VALGRIND') is not None: + time.sleep(5) +else: + time.sleep(0.5) +local_broker.terminate() +local_broker.wait() +if os.environ.get('MOSQ_USE_VALGRIND') is not None: + time.sleep(5) +else: + time.sleep(0.5) +local_broker = mosq_test.start_broker(cmd=local_cmd, filename=os.path.basename(__file__)+'_local2') +if os.environ.get('MOSQ_USE_VALGRIND') is not None: + time.sleep(5) +else: + time.sleep(0.5) + +pub = None +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet) + sock.send(subscribe_packet) + + if mosq_test.expect_packet(sock, "suback", suback_packet): + sock.send(subscribe_packet) + + if mosq_test.expect_packet(sock, "suback", suback_packet): + pub = subprocess.Popen(['./06-bridge-reconnect-local-out-helper.py'], stdout=subprocess.PIPE) + pub.wait() + # Should have now received a publish command + + if mosq_test.expect_packet(sock, "publish", publish_packet): + rc = 0 + sock.close() +finally: + time.sleep(1) + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + local_broker.terminate() + local_broker.wait() + if rc: + (stdo, stde) = local_broker.communicate() + print(stde) + if pub: + (stdo, stde) = pub.communicate() + print(stdo) + + try: + os.remove('mosquitto.db') + except OSError: + pass + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/07-will-null-helper.py b/src/libs/mosquitto/test/broker/07-will-null-helper.py new file mode 100755 index 0000000..8cfa041 --- /dev/null +++ b/src/libs/mosquitto/test/broker/07-will-null-helper.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python + +# Connect a client with a will, then disconnect without DISCONNECT. + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("test-helper", keepalive=keepalive, will_topic="will/null/test") +connack_packet = mosq_test.gen_connack(rc=0) + +sock = mosq_test.do_client_connect(connect_packet, connack_packet) +rc = 0 +sock.close() + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/07-will-null-topic.py b/src/libs/mosquitto/test/broker/07-will-null-topic.py new file mode 100755 index 0000000..bb1ca65 --- /dev/null +++ b/src/libs/mosquitto/test/broker/07-will-null-topic.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python + +import struct + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("will-null-topic", keepalive=keepalive, will_topic="", will_payload=struct.pack("!4sB7s", "will", 0, "message")) +connack_packet = mosq_test.gen_connack(rc=2) + +cmd = ['../../src/mosquitto', '-p', '1888'] +broker = mosq_test.start_broker(filename=os.path.basename(__file__), cmd=cmd) + +try: + sock = mosq_test.do_client_connect(connect_packet, "", timeout=30) + rc = 0 + sock.close() +finally: + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/07-will-null.py b/src/libs/mosquitto/test/broker/07-will-null.py new file mode 100755 index 0000000..6d3bd7c --- /dev/null +++ b/src/libs/mosquitto/test/broker/07-will-null.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python + +# Test whether a client will is transmitted correctly with a null character in the middle. + +import subprocess +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +mid = 53 +keepalive = 60 +connect_packet = mosq_test.gen_connect("will-qos0-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +subscribe_packet = mosq_test.gen_subscribe(mid, "will/null/test", 0) +suback_packet = mosq_test.gen_suback(mid, 0) + +publish_packet = mosq_test.gen_publish("will/null/test", qos=0) + +cmd = ['../../src/mosquitto', '-p', '1888'] +broker = mosq_test.start_broker(filename=os.path.basename(__file__), cmd=cmd) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=30) + sock.send(subscribe_packet) + + if mosq_test.expect_packet(sock, "suback", suback_packet): + will = subprocess.Popen(['./07-will-null-helper.py']) + will.wait() + + if mosq_test.expect_packet(sock, "publish", publish_packet): + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/07-will-qos0-helper.py b/src/libs/mosquitto/test/broker/07-will-qos0-helper.py new file mode 100755 index 0000000..8aec34e --- /dev/null +++ b/src/libs/mosquitto/test/broker/07-will-qos0-helper.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python + +# Connect a client with a will, then disconnect without DISCONNECT. + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("test-helper", keepalive=keepalive, will_topic="will/qos0/test", will_payload="will-message") +connack_packet = mosq_test.gen_connack(rc=0) + +sock = mosq_test.do_client_connect(connect_packet, connack_packet) +rc = 0 +sock.close() + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/07-will-qos0.py b/src/libs/mosquitto/test/broker/07-will-qos0.py new file mode 100755 index 0000000..6bc3b1e --- /dev/null +++ b/src/libs/mosquitto/test/broker/07-will-qos0.py @@ -0,0 +1,49 @@ +#!/usr/bin/env python + +# Test whether a client will is transmitted correctly. + +import subprocess + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +mid = 53 +keepalive = 60 +connect_packet = mosq_test.gen_connect("will-qos0-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +subscribe_packet = mosq_test.gen_subscribe(mid, "will/qos0/test", 0) +suback_packet = mosq_test.gen_suback(mid, 0) + +publish_packet = mosq_test.gen_publish("will/qos0/test", qos=0, payload="will-message") + +cmd = ['../../src/mosquitto', '-p', '1888'] +broker = mosq_test.start_broker(filename=os.path.basename(__file__), cmd=cmd) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=30) + sock.send(subscribe_packet) + + if mosq_test.expect_packet(sock, "suback", suback_packet): + will = subprocess.Popen(['./07-will-qos0-helper.py']) + will.wait() + + if mosq_test.expect_packet(sock, "publish", publish_packet): + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/08-ssl-bridge-helper.py b/src/libs/mosquitto/test/broker/08-ssl-bridge-helper.py new file mode 100755 index 0000000..20dca40 --- /dev/null +++ b/src/libs/mosquitto/test/broker/08-ssl-bridge-helper.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("test-helper", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +publish_packet = mosq_test.gen_publish("bridge/ssl/test", qos=0, payload="message") + +disconnect_packet = mosq_test.gen_disconnect() + +sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=1889, connack_error="helper connack") +sock.send(publish_packet) +sock.send(disconnect_packet) +sock.close() + +exit(0) diff --git a/src/libs/mosquitto/test/broker/08-ssl-bridge.conf b/src/libs/mosquitto/test/broker/08-ssl-bridge.conf new file mode 100644 index 0000000..fc2c17b --- /dev/null +++ b/src/libs/mosquitto/test/broker/08-ssl-bridge.conf @@ -0,0 +1,12 @@ +port 1889 + +connection bridge_test +address localhost:1888 +topic bridge/# both 0 +notifications false + +#bridge_cafile ../ssl/test-root-ca.crt +bridge_cafile ../ssl/all-ca.crt +bridge_insecure true + +bridge_tls_version tlsv1 diff --git a/src/libs/mosquitto/test/broker/08-ssl-bridge.py b/src/libs/mosquitto/test/broker/08-ssl-bridge.py new file mode 100755 index 0000000..3339e32 --- /dev/null +++ b/src/libs/mosquitto/test/broker/08-ssl-bridge.py @@ -0,0 +1,67 @@ +#!/usr/bin/env python + +import subprocess +import socket +import ssl + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +client_id = socket.gethostname()+".bridge_test" +connect_packet = mosq_test.gen_connect(client_id, keepalive=keepalive, clean_session=False, proto_ver=128+3) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 1 +subscribe_packet = mosq_test.gen_subscribe(mid, "bridge/#", 0) +suback_packet = mosq_test.gen_suback(mid, 0) + +publish_packet = mosq_test.gen_publish("bridge/ssl/test", qos=0, payload="message") + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +ssock = ssl.wrap_socket(sock, ca_certs="../ssl/all-ca.crt", keyfile="../ssl/server.key", certfile="../ssl/server.crt", server_side=True, ssl_version=ssl.PROTOCOL_TLSv1) +ssock.settimeout(20) +ssock.bind(('', 1888)) +ssock.listen(5) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=1889) + +try: + (bridge, address) = ssock.accept() + bridge.settimeout(20) + + if mosq_test.expect_packet(bridge, "connect", connect_packet): + bridge.send(connack_packet) + + if mosq_test.expect_packet(bridge, "subscribe", subscribe_packet): + bridge.send(suback_packet) + + pub = subprocess.Popen(['./08-ssl-bridge-helper.py'], stdout=subprocess.PIPE) + pub.wait() + + if mosq_test.expect_packet(bridge, "publish", publish_packet): + rc = 0 + + bridge.close() +finally: + try: + bridge.close() + except NameError: + pass + + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + ssock.close() + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-crl.conf b/src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-crl.conf new file mode 100644 index 0000000..31c3651 --- /dev/null +++ b/src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-crl.conf @@ -0,0 +1,9 @@ +port 1889 + +listener 1888 +cafile ../ssl/all-ca.crt +certfile ../ssl/server.crt +keyfile ../ssl/server.key +require_certificate true +crlfile ../ssl/crl.pem + diff --git a/src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-crl.py b/src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-crl.py new file mode 100755 index 0000000..e6343cc --- /dev/null +++ b/src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-crl.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python + +import socket +import ssl +import sys + +if sys.version < '2.7': + print("WARNING: SSL not supported on Python 2.6") + exit(0) + +import inspect, os +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-success-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=1889) + +try: + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + ssock = ssl.wrap_socket(sock, ca_certs="../ssl/test-root-ca.crt", certfile="../ssl/client.crt", keyfile="../ssl/client.key", cert_reqs=ssl.CERT_REQUIRED) + ssock.settimeout(20) + ssock.connect(("localhost", 1888)) + ssock.send(connect_packet) + + if mosq_test.expect_packet(ssock, "connack", connack_packet): + rc = 0 + + ssock.close() +finally: + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-expired.conf b/src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-expired.conf new file mode 100644 index 0000000..c85c24f --- /dev/null +++ b/src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-expired.conf @@ -0,0 +1,8 @@ +port 1889 + +listener 1888 +cafile ../ssl/all-ca.crt +certfile ../ssl/server.crt +keyfile ../ssl/server.key +require_certificate true + diff --git a/src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-expired.py b/src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-expired.py new file mode 100755 index 0000000..76c291e --- /dev/null +++ b/src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-expired.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python + +# Test whether a valid CONNECT results in the correct CONNACK packet using an +# SSL connection with client certificates required. + +import socket +import ssl +import sys +import time + +if sys.version < '2.7': + print("WARNING: SSL not supported on Python 2.6") + exit(0) + +import inspect, os +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-success-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=1889) + +try: + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + ssock = ssl.wrap_socket(sock, ca_certs="../ssl/test-root-ca.crt", certfile="../ssl/client-expired.crt", keyfile="../ssl/client.key", cert_reqs=ssl.CERT_REQUIRED) + ssock.settimeout(20) + try: + ssock.connect(("localhost", 1888)) + except ssl.SSLError as err: + if err.errno == 1: + rc = 0 + else: + broker.terminate() + raise ValueError(err.errno) +finally: + time.sleep(0.5) + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-revoked.conf b/src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-revoked.conf new file mode 100644 index 0000000..31c3651 --- /dev/null +++ b/src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-revoked.conf @@ -0,0 +1,9 @@ +port 1889 + +listener 1888 +cafile ../ssl/all-ca.crt +certfile ../ssl/server.crt +keyfile ../ssl/server.key +require_certificate true +crlfile ../ssl/crl.pem + diff --git a/src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-revoked.py b/src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-revoked.py new file mode 100755 index 0000000..d04e672 --- /dev/null +++ b/src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-revoked.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python + +import socket +import ssl +import sys +import time + +if sys.version < '2.7': + print("WARNING: SSL not supported on Python 2.6") + exit(0) + +import inspect, os +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-revoked-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=1889) + +try: + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + ssock = ssl.wrap_socket(sock, ca_certs="../ssl/test-root-ca.crt", certfile="../ssl/client-revoked.crt", keyfile="../ssl/client-revoked.key", cert_reqs=ssl.CERT_REQUIRED) + ssock.settimeout(20) + try: + ssock.connect(("localhost", 1888)) + except ssl.SSLError as err: + if err.errno == 1 and "certificate revoked" in err.strerror: + rc = 0 + else: + broker.terminate() + print(err.strerror) + raise ValueError(err.errno) + +finally: + time.sleep(0.5) + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-without.conf b/src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-without.conf new file mode 100644 index 0000000..c85c24f --- /dev/null +++ b/src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-without.conf @@ -0,0 +1,8 @@ +port 1889 + +listener 1888 +cafile ../ssl/all-ca.crt +certfile ../ssl/server.crt +keyfile ../ssl/server.key +require_certificate true + diff --git a/src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-without.py b/src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-without.py new file mode 100755 index 0000000..b82a6eb --- /dev/null +++ b/src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-without.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python + +# Test whether a client can connect without an SSL certificate if one is required. + +import errno +import socket +import ssl +import sys +import time + +if sys.version < '2.7': + print("WARNING: SSL not supported on Python 2.6") + exit(0) + +import inspect, os +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-cert-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=1889) + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +ssock = ssl.wrap_socket(sock, ca_certs="../ssl/test-root-ca.crt", cert_reqs=ssl.CERT_REQUIRED) +ssock.settimeout(20) +try: + ssock.connect(("localhost", 1888)) +except ssl.SSLError as err: + if err.errno == 1: + rc = 0 +except socket.error as err: + if err.errno == errno.ECONNRESET: + rc = 0 + +time.sleep(0.5) +broker.terminate() +broker.wait() +if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth.conf b/src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth.conf new file mode 100644 index 0000000..a37ed22 --- /dev/null +++ b/src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth.conf @@ -0,0 +1,9 @@ +port 1889 + +listener 1888 +cafile ../ssl/all-ca.crt +certfile ../ssl/server.crt +keyfile ../ssl/server.key +require_certificate true + + diff --git a/src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth.py b/src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth.py new file mode 100755 index 0000000..6213306 --- /dev/null +++ b/src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python + +# Test whether a valid CONNECT results in the correct CONNACK packet using an SSL connection. + +import socket +import ssl +import sys + +if sys.version < '2.7': + print("WARNING: SSL not supported on Python 2.6") + exit(0) + +import inspect, os +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-success-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=1889) + +try: + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + ssock = ssl.wrap_socket(sock, ca_certs="../ssl/test-root-ca.crt", certfile="../ssl/client.crt", keyfile="../ssl/client.key", cert_reqs=ssl.CERT_REQUIRED) + ssock.settimeout(20) + ssock.connect(("localhost", 1888)) + ssock.send(connect_packet) + + if mosq_test.expect_packet(ssock, "connack", connack_packet): + rc = 0 + + ssock.close() +finally: + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/08-ssl-connect-identity.conf b/src/libs/mosquitto/test/broker/08-ssl-connect-identity.conf new file mode 100644 index 0000000..763174f --- /dev/null +++ b/src/libs/mosquitto/test/broker/08-ssl-connect-identity.conf @@ -0,0 +1,10 @@ +port 1889 + +listener 1888 +cafile ../ssl/all-ca.crt +certfile ../ssl/server.crt +keyfile ../ssl/server.key + +use_identity_as_username true +require_certificate true + diff --git a/src/libs/mosquitto/test/broker/08-ssl-connect-identity.py b/src/libs/mosquitto/test/broker/08-ssl-connect-identity.py new file mode 100755 index 0000000..b8c781f --- /dev/null +++ b/src/libs/mosquitto/test/broker/08-ssl-connect-identity.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python + +# Client connects with a certificate to a server that has use_identity_as_username=true. Shouldn't be rejected. +import socket +import ssl +import sys +import time + +if sys.version < '2.7': + print("WARNING: SSL not supported on Python 2.6") + exit(0) + +import inspect, os +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-identity-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=1889) + +try: + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + ssock = ssl.wrap_socket(sock, ca_certs="../ssl/test-root-ca.crt", certfile="../ssl/client.crt", keyfile="../ssl/client.key", cert_reqs=ssl.CERT_REQUIRED) + ssock.settimeout(20) + ssock.connect(("localhost", 1888)) + ssock.send(connect_packet) + + if mosq_test.expect_packet(ssock, "connack", connack_packet): + rc = 0 + + ssock.close() +finally: + time.sleep(0.5) + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/08-ssl-connect-no-auth-wrong-ca.conf b/src/libs/mosquitto/test/broker/08-ssl-connect-no-auth-wrong-ca.conf new file mode 100644 index 0000000..28de36a --- /dev/null +++ b/src/libs/mosquitto/test/broker/08-ssl-connect-no-auth-wrong-ca.conf @@ -0,0 +1,7 @@ +port 1889 + +listener 1888 +cafile ../ssl/all-ca.crt +certfile ../ssl/server.crt +keyfile ../ssl/server.key + diff --git a/src/libs/mosquitto/test/broker/08-ssl-connect-no-auth-wrong-ca.py b/src/libs/mosquitto/test/broker/08-ssl-connect-no-auth-wrong-ca.py new file mode 100755 index 0000000..c911189 --- /dev/null +++ b/src/libs/mosquitto/test/broker/08-ssl-connect-no-auth-wrong-ca.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python + +# Test whether a valid CONNECT results in the correct CONNACK packet using an SSL connection. + +import socket +import ssl +import sys +import time + +if sys.version < '2.7': + print("WARNING: SSL not supported on Python 2.6") + exit(0) + +import inspect, os +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-success-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=1889) + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +ssock = ssl.wrap_socket(sock, ca_certs="../ssl/test-alt-ca.crt", cert_reqs=ssl.CERT_REQUIRED) +ssock.settimeout(20) +try: + ssock.connect(("localhost", 1888)) +except ssl.SSLError as err: + if err.errno == 1: + rc = 0 +finally: + ssock.close() + +time.sleep(0.5) +broker.terminate() +broker.wait() +if rc: + (stdo, stde) = broker.communicate() + print(stde) +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/08-ssl-connect-no-auth.conf b/src/libs/mosquitto/test/broker/08-ssl-connect-no-auth.conf new file mode 100644 index 0000000..28de36a --- /dev/null +++ b/src/libs/mosquitto/test/broker/08-ssl-connect-no-auth.conf @@ -0,0 +1,7 @@ +port 1889 + +listener 1888 +cafile ../ssl/all-ca.crt +certfile ../ssl/server.crt +keyfile ../ssl/server.key + diff --git a/src/libs/mosquitto/test/broker/08-ssl-connect-no-auth.py b/src/libs/mosquitto/test/broker/08-ssl-connect-no-auth.py new file mode 100755 index 0000000..e534532 --- /dev/null +++ b/src/libs/mosquitto/test/broker/08-ssl-connect-no-auth.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python + +# Test whether a valid CONNECT results in the correct CONNACK packet using an SSL connection. + +import socket +import ssl +import sys + +if sys.version < '2.7': + print("WARNING: SSL not supported on Python 2.6") + exit(0) + +import inspect, os +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-success-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=1889) + +try: + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + ssock = ssl.wrap_socket(sock, ca_certs="../ssl/test-root-ca.crt", cert_reqs=ssl.CERT_REQUIRED, ssl_version=ssl.PROTOCOL_TLSv1) + ssock.settimeout(20) + ssock.connect(("localhost", 1888)) + ssock.send(connect_packet) + + if mosq_test.expect_packet(ssock, "connack", connack_packet): + rc = 0 + + ssock.close() +finally: + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/08-ssl-connect-no-identity.conf b/src/libs/mosquitto/test/broker/08-ssl-connect-no-identity.conf new file mode 100644 index 0000000..37a59e3 --- /dev/null +++ b/src/libs/mosquitto/test/broker/08-ssl-connect-no-identity.conf @@ -0,0 +1,9 @@ +port 1889 + +listener 1888 +cafile ../ssl/all-ca.crt +certfile ../ssl/server.crt +keyfile ../ssl/server.key + +use_identity_as_username true + diff --git a/src/libs/mosquitto/test/broker/08-ssl-connect-no-identity.py b/src/libs/mosquitto/test/broker/08-ssl-connect-no-identity.py new file mode 100755 index 0000000..1ce22f5 --- /dev/null +++ b/src/libs/mosquitto/test/broker/08-ssl-connect-no-identity.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python + +# Client connects without a certificate to a server that has use_identity_as_username=true. Should be rejected. +import socket +import ssl +import sys +import time + +if sys.version < '2.7': + print("WARNING: SSL not supported on Python 2.6") + exit(0) + +import inspect, os +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-no-identity-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=4) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=1889) + +try: + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + ssock = ssl.wrap_socket(sock, ca_certs="../ssl/test-root-ca.crt", cert_reqs=ssl.CERT_REQUIRED) + ssock.settimeout(20) + ssock.connect(("localhost", 1888)) + ssock.send(connect_packet) + + if mosq_test.expect_packet(ssock, "connack", connack_packet): + rc = 0 + + ssock.close() +finally: + time.sleep(2) + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/08-tls-psk-bridge.conf b/src/libs/mosquitto/test/broker/08-tls-psk-bridge.conf new file mode 100644 index 0000000..6b48914 --- /dev/null +++ b/src/libs/mosquitto/test/broker/08-tls-psk-bridge.conf @@ -0,0 +1,12 @@ +psk_file 08-tls-psk-bridge.psk + +port 1888 + +listener 1889 +psk_hint hint + +log_type debug +log_type error +log_type warning +log_type information +log_type notice diff --git a/src/libs/mosquitto/test/broker/08-tls-psk-bridge.conf2 b/src/libs/mosquitto/test/broker/08-tls-psk-bridge.conf2 new file mode 100644 index 0000000..e54e7eb --- /dev/null +++ b/src/libs/mosquitto/test/broker/08-tls-psk-bridge.conf2 @@ -0,0 +1,13 @@ +port 1890 + +connection bridge-psk +address localhost:1889 +topic psk/test out +bridge_identity psk-test +bridge_psk deadbeef + +log_type debug +log_type error +log_type warning +log_type information +log_type notice diff --git a/src/libs/mosquitto/test/broker/08-tls-psk-bridge.psk b/src/libs/mosquitto/test/broker/08-tls-psk-bridge.psk new file mode 100644 index 0000000..a12d690 --- /dev/null +++ b/src/libs/mosquitto/test/broker/08-tls-psk-bridge.psk @@ -0,0 +1 @@ +psk-test:deadbeef diff --git a/src/libs/mosquitto/test/broker/08-tls-psk-bridge.py b/src/libs/mosquitto/test/broker/08-tls-psk-bridge.py new file mode 100755 index 0000000..97c27bb --- /dev/null +++ b/src/libs/mosquitto/test/broker/08-tls-psk-bridge.py @@ -0,0 +1,80 @@ +#!/usr/bin/env python + +import subprocess +import ssl +import sys +import time + +if sys.version < '2.7': + print("WARNING: SSL not supported on Python 2.6") + exit(0) + +if ssl.OPENSSL_VERSION_NUMBER < 0x10000000: + print("WARNING: TLS-PSK not supported on OpenSSL < 1.0") + exit(0) + + +import inspect, os +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp + + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("no-psk-test-client", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 1 +subscribe_packet = mosq_test.gen_subscribe(mid, "psk/test", 0) +suback_packet = mosq_test.gen_suback(mid, 0) + +publish_packet = mosq_test.gen_publish(topic="psk/test", payload="message", qos=0) + +bridge_cmd = ['../../src/mosquitto', '-c', '08-tls-psk-bridge.conf2'] +broker = mosq_test.start_broker(filename=os.path.basename(__file__)) +bridge = mosq_test.start_broker(filename=os.path.basename(__file__)+'_bridge', cmd=bridge_cmd, port=1890) + +pub = None +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=30) + sock.send(subscribe_packet) + + if mosq_test.expect_packet(sock, "suback", suback_packet): + pub = subprocess.Popen(['./c/08-tls-psk-bridge.test'], env=env, stdout=subprocess.PIPE) + if pub.wait(): + raise ValueError + + if mosq_test.expect_packet(sock, "publish", publish_packet): + rc = 0 + sock.close() +finally: + time.sleep(1) + broker.terminate() + broker.wait() + time.sleep(1) + bridge.terminate() + bridge.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + (stdo, stde) = bridge.communicate() + print(stde) + if pub: + (stdo, stde) = pub.communicate() + print(stdo) + + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/08-tls-psk-pub.conf b/src/libs/mosquitto/test/broker/08-tls-psk-pub.conf new file mode 100644 index 0000000..b963fa0 --- /dev/null +++ b/src/libs/mosquitto/test/broker/08-tls-psk-pub.conf @@ -0,0 +1,14 @@ +psk_file 08-tls-psk-pub.psk + +port 1888 +psk_hint hint + +listener 1889 + + +log_type debug +log_type error +log_type warning +log_type information +log_type notice + diff --git a/src/libs/mosquitto/test/broker/08-tls-psk-pub.psk b/src/libs/mosquitto/test/broker/08-tls-psk-pub.psk new file mode 100644 index 0000000..6e98667 --- /dev/null +++ b/src/libs/mosquitto/test/broker/08-tls-psk-pub.psk @@ -0,0 +1 @@ +psk-id:deadbeef diff --git a/src/libs/mosquitto/test/broker/08-tls-psk-pub.py b/src/libs/mosquitto/test/broker/08-tls-psk-pub.py new file mode 100755 index 0000000..a552f5a --- /dev/null +++ b/src/libs/mosquitto/test/broker/08-tls-psk-pub.py @@ -0,0 +1,66 @@ +#!/usr/bin/env python + +import subprocess +import ssl +import sys + +if sys.version < '2.7': + print("WARNING: SSL not supported on Python 2.6") + exit(0) + +if ssl.OPENSSL_VERSION_NUMBER < 0x10000000: + print("WARNING: TLS-PSK not supported on OpenSSL < 1.0") + exit(0) + + +import inspect, os +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp + + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("no-psk-test-client", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 1 +subscribe_packet = mosq_test.gen_subscribe(mid, "psk/test", 0) +suback_packet = mosq_test.gen_suback(mid, 0) + +publish_packet = mosq_test.gen_publish(topic="psk/test", payload="message", qos=0) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=1889) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=1889, timeout=20) + sock.send(subscribe_packet) + + if mosq_test.expect_packet(sock, "suback", suback_packet): + pub = subprocess.Popen(['./c/08-tls-psk-pub.test'], env=env) + if pub.wait(): + raise ValueError + + if mosq_test.expect_packet(sock, "publish", publish_packet): + rc = 0 + sock.close() +finally: + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/09-plugin-auth-unpwd-fail.conf b/src/libs/mosquitto/test/broker/09-plugin-auth-unpwd-fail.conf new file mode 100644 index 0000000..fca6276 --- /dev/null +++ b/src/libs/mosquitto/test/broker/09-plugin-auth-unpwd-fail.conf @@ -0,0 +1,3 @@ +port 1888 +allow_anonymous false +auth_plugin c/auth_plugin.so diff --git a/src/libs/mosquitto/test/broker/09-plugin-auth-unpwd-fail.py b/src/libs/mosquitto/test/broker/09-plugin-auth-unpwd-fail.py new file mode 100755 index 0000000..4d54cdb --- /dev/null +++ b/src/libs/mosquitto/test/broker/09-plugin-auth-unpwd-fail.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python + +# Test whether a connection is successful with correct username and password +# when using a simple auth_plugin. + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-uname-pwd-test", keepalive=keepalive, username="test-username", password="wrong") +connack_packet = mosq_test.gen_connack(rc=5) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__)) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20) + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/09-plugin-auth-unpwd-success.conf b/src/libs/mosquitto/test/broker/09-plugin-auth-unpwd-success.conf new file mode 100644 index 0000000..fca6276 --- /dev/null +++ b/src/libs/mosquitto/test/broker/09-plugin-auth-unpwd-success.conf @@ -0,0 +1,3 @@ +port 1888 +allow_anonymous false +auth_plugin c/auth_plugin.so diff --git a/src/libs/mosquitto/test/broker/09-plugin-auth-unpwd-success.py b/src/libs/mosquitto/test/broker/09-plugin-auth-unpwd-success.py new file mode 100755 index 0000000..422e8e7 --- /dev/null +++ b/src/libs/mosquitto/test/broker/09-plugin-auth-unpwd-success.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python + +# Test whether a connection is successful with correct username and password +# when using a simple auth_plugin. + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 10 +connect_packet = mosq_test.gen_connect("connect-uname-pwd-test", keepalive=keepalive, username="test-username", password="cnwTICONIURW") +connack_packet = mosq_test.gen_connack(rc=0) + +broker = mosq_test.start_broker(filename=os.path.basename(__file__)) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20) + rc = 0 + sock.close() +finally: + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/10-listener-mount-point-helper.py b/src/libs/mosquitto/test/broker/10-listener-mount-point-helper.py new file mode 100755 index 0000000..fa73e94 --- /dev/null +++ b/src/libs/mosquitto/test/broker/10-listener-mount-point-helper.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("test-helper", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +publish_packet = mosq_test.gen_publish("test", qos=0, payload="mount point") + +sock = mosq_test.do_client_connect(connect_packet, connack_packet, port=1889, connack_error="helper connack") +sock.send(publish_packet) +rc = 0 +sock.close() + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/10-listener-mount-point.conf b/src/libs/mosquitto/test/broker/10-listener-mount-point.conf new file mode 100644 index 0000000..1943864 --- /dev/null +++ b/src/libs/mosquitto/test/broker/10-listener-mount-point.conf @@ -0,0 +1,7 @@ +port 1888 + +listener 1889 +mount_point mount/ + +log_type debug + diff --git a/src/libs/mosquitto/test/broker/10-listener-mount-point.py b/src/libs/mosquitto/test/broker/10-listener-mount-point.py new file mode 100755 index 0000000..62d1545 --- /dev/null +++ b/src/libs/mosquitto/test/broker/10-listener-mount-point.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python + +import subprocess + +import inspect, os, sys +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("test2", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +mid = 1 +subscribe_packet = mosq_test.gen_subscribe(mid, "#", 0) +suback_packet = mosq_test.gen_suback(mid, 0) + +publish_packet = mosq_test.gen_publish("mount/test", qos=0, payload="mount point") + +broker = mosq_test.start_broker(filename=os.path.basename(__file__)) + +try: + sock = mosq_test.do_client_connect(connect_packet, connack_packet, timeout=20) + sock.send(subscribe_packet) + + if mosq_test.expect_packet(sock, "suback", suback_packet): + pub = subprocess.Popen(['./10-listener-mount-point-helper.py'], stdout=subprocess.PIPE) + pub.wait() + # Should have now received a publish command + + if mosq_test.expect_packet(sock, "publish", publish_packet): + rc = 0 + + sock.close() +finally: + broker.terminate() + broker.wait() + if rc: + (stdo, stde) = broker.communicate() + print(stde) + +exit(rc) + diff --git a/src/libs/mosquitto/test/broker/Makefile b/src/libs/mosquitto/test/broker/Makefile new file mode 100644 index 0000000..45f08b2 --- /dev/null +++ b/src/libs/mosquitto/test/broker/Makefile @@ -0,0 +1,102 @@ +include ../../config.mk + +.PHONY: all clean test +.NOTPARALLEL: + +all : + +clean : + -rm -f *.vglog + $(MAKE) -C c clean + +test-compile : + $(MAKE) -C c + +test : test-compile 01 02 03 04 05 06 07 08 09 10 + +01 : + ./01-connect-success.py + ./01-connect-invalid-protonum.py + ./01-connect-invalid-id-0.py + ./01-connect-invalid-id-0-311.py + ./01-connect-invalid-id-missing.py + ./01-connect-invalid-reserved.py + ./01-connect-anon-denied.py + ./01-connect-uname-no-password-denied.py + ./01-connect-uname-password-denied.py +ifeq ($(WITH_TLS),yes) + ./01-connect-uname-password-success.py +else + ./01-connect-uname-password-success-no-tls.py +endif + + +02 : + ./02-subscribe-qos0.py + ./02-subscribe-qos1.py + ./02-subscribe-qos2.py + ./02-subpub-qos0.py + ./02-subpub-qos1.py + ./02-subpub-qos2.py + ./02-unsubscribe-qos0.py + ./02-unsubscribe-qos1.py + ./02-unsubscribe-qos2.py + +03 : + ./03-publish-qos1.py + ./03-publish-qos2.py + ./03-publish-b2c-timeout-qos1.py + ./03-publish-b2c-disconnect-qos1.py + ./03-publish-c2b-timeout-qos2.py + ./03-publish-c2b-disconnect-qos2.py + ./03-publish-b2c-timeout-qos2.py + ./03-publish-b2c-disconnect-qos2.py + ./03-pattern-matching.py + +04 : + ./04-retain-qos0.py + ./04-retain-qos0-fresh.py + ./04-retain-qos0-repeated.py + ./04-retain-qos1-qos0.py + ./04-retain-qos0-clear.py + +05 : + ./05-clean-session-qos1.py + +06 : + ./06-bridge-reconnect-local-out.py + ./06-bridge-br2b-disconnect-qos1.py + ./06-bridge-br2b-disconnect-qos2.py + ./06-bridge-b2br-disconnect-qos1.py + ./06-bridge-b2br-disconnect-qos2.py + ./06-bridge-fail-persist-resend-qos1.py + ./06-bridge-fail-persist-resend-qos2.py + +07 : + ./07-will-qos0.py + ./07-will-null.py + ./07-will-null-topic.py + +08 : +ifeq ($(WITH_TLS),yes) + ./08-ssl-connect-no-auth.py + ./08-ssl-connect-no-auth-wrong-ca.py + ./08-ssl-connect-cert-auth.py + ./08-ssl-connect-cert-auth-without.py + ./08-ssl-connect-cert-auth-expired.py + ./08-ssl-connect-cert-auth-revoked.py + ./08-ssl-connect-cert-auth-crl.py + ./08-ssl-connect-identity.py + ./08-ssl-connect-no-identity.py + ./08-ssl-bridge.py + ./08-tls-psk-pub.py + ./08-tls-psk-bridge.py +endif + +09 : + ./09-plugin-auth-unpwd-success.py + ./09-plugin-auth-unpwd-fail.py + +10 : + ./10-listener-mount-point.py + diff --git a/src/libs/mosquitto/test/broker/c/08-tls-psk-bridge.c b/src/libs/mosquitto/test/broker/c/08-tls-psk-bridge.c new file mode 100644 index 0000000..c4d0286 --- /dev/null +++ b/src/libs/mosquitto/test/broker/c/08-tls-psk-bridge.c @@ -0,0 +1,63 @@ +#include +#include +#include +#include +#include +#include + +static int run = -1; +static int sent_mid; + +void on_log(struct mosquitto *mosq, void *obj, int level, const char *str) +{ + printf("%s\n", str); +} + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + }else{ + mosquitto_publish(mosq, &sent_mid, "psk/test", strlen("message"), "message", 1, false); + } +} + +void on_publish(struct mosquitto *mosq, void *obj, int mid) +{ + if(mid == sent_mid){ + mosquitto_disconnect(mosq); + run = 0; + }else{ + exit(1); + } +} + +void on_disconnect(struct mosquitto *mosq, void *obj, int rc) +{ + run = rc; +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + mosquitto_lib_init(); + + mosq = mosquitto_new("08-tls-psk-bridge", true, NULL); + mosquitto_tls_opts_set(mosq, 1, "tlsv1", NULL); + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_disconnect_callback_set(mosq, on_disconnect); + mosquitto_publish_callback_set(mosq, on_publish); + mosquitto_log_callback_set(mosq, on_log); + + rc = mosquitto_connect(mosq, "localhost", 1890, 60); + if(rc) return rc; + + while(run == -1){ + mosquitto_loop(mosq, -1, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/src/libs/mosquitto/test/broker/c/08-tls-psk-pub.c b/src/libs/mosquitto/test/broker/c/08-tls-psk-pub.c new file mode 100644 index 0000000..26fefeb --- /dev/null +++ b/src/libs/mosquitto/test/broker/c/08-tls-psk-pub.c @@ -0,0 +1,67 @@ +#include +#include +#include +#include +#include +#include + +static int run = -1; +static int sent_mid; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + }else{ + mosquitto_publish(mosq, &sent_mid, "psk/test", strlen("message"), "message", 0, false); + } +} + +void on_publish(struct mosquitto *mosq, void *obj, int mid) +{ + if(mid == sent_mid){ + mosquitto_disconnect(mosq); + run = 0; + }else{ + exit(1); + } +} + +void on_disconnect(struct mosquitto *mosq, void *obj, int rc) +{ + run = rc; +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + mosquitto_lib_init(); + + mosq = mosquitto_new("08-tls-psk-pub", true, NULL); + mosquitto_tls_opts_set(mosq, 1, "tlsv1", NULL); + rc = mosquitto_tls_psk_set(mosq, "deadbeef", "psk-id", NULL); + if(rc){ + mosquitto_destroy(mosq); + return rc; + } + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_disconnect_callback_set(mosq, on_disconnect); + mosquitto_publish_callback_set(mosq, on_publish); + + rc = mosquitto_connect(mosq, "localhost", 1888, 60); + if(rc){ + mosquitto_destroy(mosq); + return rc; + } + + while(run == -1){ + mosquitto_loop(mosq, -1, 1); + } + + mosquitto_destroy(mosq); + + mosquitto_lib_cleanup(); + return run; +} diff --git a/src/libs/mosquitto/test/broker/c/Makefile b/src/libs/mosquitto/test/broker/c/Makefile new file mode 100644 index 0000000..4e43637 --- /dev/null +++ b/src/libs/mosquitto/test/broker/c/Makefile @@ -0,0 +1,23 @@ +.PHONY: all test clean reallyclean 08 + +CFLAGS=-I../../../lib -I../../../src -Wall -Werror + +all : auth_plugin.so 08 + +08 : 08-tls-psk-pub.test 08-tls-psk-bridge.test + +auth_plugin.so : auth_plugin.c + $(CC) ${CFLAGS} -fPIC -shared $^ -o $@ + +08-tls-psk-pub.test : 08-tls-psk-pub.c + $(CC) ${CFLAGS} $^ -o $@ ../../../lib/libmosquitto.so.1 + +08-tls-psk-bridge.test : 08-tls-psk-bridge.c + $(CC) ${CFLAGS} $^ -o $@ ../../../lib/libmosquitto.so.1 + + +reallyclean : clean + -rm -f *.orig + +clean : + rm -f *.so *.test diff --git a/src/libs/mosquitto/test/broker/c/auth_plugin.c b/src/libs/mosquitto/test/broker/c/auth_plugin.c new file mode 100644 index 0000000..81d2f41 --- /dev/null +++ b/src/libs/mosquitto/test/broker/c/auth_plugin.c @@ -0,0 +1,55 @@ +#include +#include +#include +#include + +int mosquitto_auth_plugin_version(void) +{ + return MOSQ_AUTH_PLUGIN_VERSION; +} + +int mosquitto_auth_plugin_init(void **user_data, struct mosquitto_auth_opt *auth_opts, int auth_opt_count) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_plugin_cleanup(void *user_data, struct mosquitto_auth_opt *auth_opts, int auth_opt_count) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_security_init(void *user_data, struct mosquitto_auth_opt *auth_opts, int auth_opt_count, bool reload) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_security_cleanup(void *user_data, struct mosquitto_auth_opt *auth_opts, int auth_opt_count, bool reload) +{ + return MOSQ_ERR_SUCCESS; +} + +int mosquitto_auth_acl_check(void *user_data, const char *clientid, const char *username, const char *topic, int access) +{ + if(!strcmp(username, "readonly") && access == MOSQ_ACL_READ){ + return MOSQ_ERR_SUCCESS; + }else{ + return MOSQ_ERR_ACL_DENIED; + } +} + +int mosquitto_auth_unpwd_check(void *user_data, const char *username, const char *password) +{ + if(!strcmp(username, "test-username") && password && !strcmp(password, "cnwTICONIURW")){ + return MOSQ_ERR_SUCCESS; + }else if(!strcmp(username, "readonly")){ + return MOSQ_ERR_SUCCESS; + }else{ + return MOSQ_ERR_AUTH; + } +} + +int mosquitto_auth_psk_key_get(void *user_data, const char *hint, const char *identity, char *key, int max_key_len) +{ + return MOSQ_ERR_AUTH; +} + diff --git a/src/libs/mosquitto/test/broker/readme.txt b/src/libs/mosquitto/test/broker/readme.txt new file mode 100644 index 0000000..82eff27 --- /dev/null +++ b/src/libs/mosquitto/test/broker/readme.txt @@ -0,0 +1,14 @@ +----- Broker Tests ----- + +This folder contains a number of tests to exercise the functionality of the +broker. Feel free to add more. + +Numbering is as follows: + +01: Connection tests +02: Subscribe/unsubscribe tests +03: Publish tests +04: Retained message tests +05: Clean session tests +06: Bridge tests +07: Will tests diff --git a/src/libs/mosquitto/test/fake_user.c b/src/libs/mosquitto/test/fake_user.c new file mode 100644 index 0000000..cbbb57a --- /dev/null +++ b/src/libs/mosquitto/test/fake_user.c @@ -0,0 +1,114 @@ +/* +Copyright (c) 2009,2010, Roger Light +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. Neither the name of mosquitto nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +#include +#include +#include +#include +#ifndef WIN32 +#include +#else +#include +#define snprintf sprintf_s +#endif + +#include + +void my_connect_callback(struct mosquitto *mosq, void *obj, int result) +{ + char topic[100]; + + if(!result){ + snprintf(topic, 100, "fake/%d", getpid()%100); + mosquitto_subscribe(mosq, NULL, topic, rand()%3); + } +} + +int main(int argc, char *argv[]) +{ + char id[30]; + char *host = "localhost"; + int port = 1883; + int keepalive = 60; + bool clean_session = false; + struct mosquitto *mosq = NULL; + + void *will_payload = NULL; + long will_payloadlen = 0; + int will_qos = 0; + bool will_retain = false; + char will_topic[100], topic[100]; + int pid; + + pid = getpid(); + + srand(pid); + snprintf(id, 30, "fake_user_%d", pid); + + mosquitto_lib_init(); + mosq = mosquitto_new(id, clean_session, NULL); + if(!mosq){ + fprintf(stderr, "Error: Out of memory.\n"); + return 1; + } + + if(rand()%5 == 0){ + snprintf(will_topic, 100, "fake/wills/%d", rand()%100); + if(mosquitto_will_set(mosq, will_topic, will_payloadlen, will_payload, will_qos, will_retain)){ + fprintf(stderr, "Error: Problem setting will.\n"); + return 1; + } + } + mosquitto_connect_callback_set(mosq, my_connect_callback); + while(1){ + clean_session = rand()%10==0?false:true; + + if(mosquitto_connect(mosq, host, port, keepalive)){ + fprintf(stderr, "Unable to connect.\n"); + return 1; + } + mosquitto_subscribe(mosq, NULL, "#", 0); + + while(!mosquitto_loop(mosq, -1, 5)){ + if(rand()%100==0){ + snprintf(topic, 100, "fake/%d", rand()%100); + mosquitto_publish(mosq, NULL, topic, 10, "0123456789", rand()%3, rand()%2); + } + if(rand()%50==0){ + mosquitto_disconnect(mosq); + } + } + sleep(10); + } + mosquitto_destroy(mosq); + mosquitto_lib_cleanup(); + + return 0; +} + diff --git a/src/libs/mosquitto/test/lib/01-con-discon-success.py b/src/libs/mosquitto/test/lib/01-con-discon-success.py new file mode 100755 index 0000000..5eaf67c --- /dev/null +++ b/src/libs/mosquitto/test/lib/01-con-discon-success.py @@ -0,0 +1,63 @@ +#!/usr/bin/env python + +# Test whether a client produces a correct connect and subsequent disconnect. + +# The client should connect to port 1888 with keepalive=60, clean session set, +# and client id 01-con-discon-success +# The test will send a CONNACK message to the client with rc=0. Upon receiving +# the CONNACK and verifying that rc=0, the client should send a DISCONNECT +# message. If rc!=0, the client should exit with an error. + +import inspect +import os +import socket +import sys + +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("01-con-discon-success", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +disconnect_packet = mosq_test.gen_disconnect() + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', 1888)) +sock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env) + +try: + (conn, address) = sock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): + rc = 0 + + conn.close() +finally: + #client.terminate() + client.wait() + sock.close() + +exit(rc) + diff --git a/src/libs/mosquitto/test/lib/01-keepalive-pingreq.py b/src/libs/mosquitto/test/lib/01-keepalive-pingreq.py new file mode 100755 index 0000000..e438964 --- /dev/null +++ b/src/libs/mosquitto/test/lib/01-keepalive-pingreq.py @@ -0,0 +1,68 @@ +#!/usr/bin/env python + +# Test whether a client sends a pingreq after the keepalive time + +# The client should connect to port 1888 with keepalive=4, clean session set, +# and client id 01-keepalive-pingreq +# The client should send a PINGREQ message after the appropriate amount of time +# (4 seconds after no traffic). + +import inspect +import os +import socket +import sys +import time + +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 4 +connect_packet = mosq_test.gen_connect("01-keepalive-pingreq", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +pingreq_packet = mosq_test.gen_pingreq() +pingresp_packet = mosq_test.gen_pingresp() + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', 1888)) +sock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env) + +try: + (conn, address) = sock.accept() + conn.settimeout(keepalive+10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "pingreq", pingreq_packet): + time.sleep(1.0) + conn.send(pingresp_packet) + + if mosq_test.expect_packet(conn, "pingreq", pingreq_packet): + rc = 0 + + conn.close() +finally: + client.terminate() + client.wait() + sock.close() + +exit(rc) + diff --git a/src/libs/mosquitto/test/lib/01-no-clean-session.py b/src/libs/mosquitto/test/lib/01-no-clean-session.py new file mode 100755 index 0000000..15b3c9d --- /dev/null +++ b/src/libs/mosquitto/test/lib/01-no-clean-session.py @@ -0,0 +1,54 @@ +#!/usr/bin/env python + +# Test whether a client produces a correct connect with clean session not set. + +# The client should connect to port 1888 with keepalive=60, clean session not +# set, and client id 01-no-clean-session. + +import inspect +import os +import socket +import sys + +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("01-no-clean-session", clean_session=False, keepalive=keepalive) + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', 1888)) +sock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env) + +try: + (conn, address) = sock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + rc = 0 + + conn.close() +finally: + client.terminate() + client.wait() + sock.close() + +exit(rc) + diff --git a/src/libs/mosquitto/test/lib/01-unpwd-set.py b/src/libs/mosquitto/test/lib/01-unpwd-set.py new file mode 100755 index 0000000..b727f23 --- /dev/null +++ b/src/libs/mosquitto/test/lib/01-unpwd-set.py @@ -0,0 +1,54 @@ +#!/usr/bin/env python + +# Test whether a client produces a correct connect with a username and password. + +# The client should connect to port 1888 with keepalive=60, clean session set, +# client id 01-unpwd-set, username set to uname and password set to ;'[08gn=# + +import inspect +import os +import socket +import sys + +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("01-unpwd-set", keepalive=keepalive, username="uname", password=";'[08gn=#") + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', 1888)) +sock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env) + +try: + (conn, address) = sock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + rc = 0 + + conn.close() +finally: + client.terminate() + client.wait() + sock.close() + +exit(rc) + diff --git a/src/libs/mosquitto/test/lib/01-will-set.py b/src/libs/mosquitto/test/lib/01-will-set.py new file mode 100755 index 0000000..48aa483 --- /dev/null +++ b/src/libs/mosquitto/test/lib/01-will-set.py @@ -0,0 +1,56 @@ +#!/usr/bin/env python + +# Test whether a client produces a correct connect with a will. +# Will QoS=1, will retain=1. + +# The client should connect to port 1888 with keepalive=60, clean session set, +# client id 01-will-set will topic set to topic/on/unexpected/disconnect , will +# payload set to "will message", will qos set to 1 and will retain set. + +import inspect +import os +import socket +import sys + +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("01-will-set", keepalive=keepalive, will_topic="topic/on/unexpected/disconnect", will_qos=1, will_retain=True, will_payload="will message") + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', 1888)) +sock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env) + +try: + (conn, address) = sock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + rc = 0 + + conn.close() +finally: + client.terminate() + client.wait() + sock.close() + +exit(rc) + diff --git a/src/libs/mosquitto/test/lib/01-will-unpwd-set.py b/src/libs/mosquitto/test/lib/01-will-unpwd-set.py new file mode 100755 index 0000000..9104f34 --- /dev/null +++ b/src/libs/mosquitto/test/lib/01-will-unpwd-set.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python + +# Test whether a client produces a correct connect with a will, username and password. + +# The client should connect to port 1888 with keepalive=60, clean session set, +# client id 01-will-unpwd-set , will topic set to "will-topic", will payload +# set to "will message", will qos=2, will retain not set, username set to +# "oibvvwqw" and password set to "#'^2hg9a&nm38*us". + +import inspect +import os +import socket +import sys + +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("01-will-unpwd-set", + keepalive=keepalive, username="oibvvwqw", password="#'^2hg9a&nm38*us", + will_topic="will-topic", will_qos=2, will_payload="will message") + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', 1888)) +sock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env) + +try: + (conn, address) = sock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + rc = 0 + + conn.close() +finally: + client.terminate() + client.wait() + sock.close() + +exit(rc) + diff --git a/src/libs/mosquitto/test/lib/02-subscribe-qos0.py b/src/libs/mosquitto/test/lib/02-subscribe-qos0.py new file mode 100755 index 0000000..7b0d598 --- /dev/null +++ b/src/libs/mosquitto/test/lib/02-subscribe-qos0.py @@ -0,0 +1,73 @@ +#!/usr/bin/env python + +# Test whether a client sends a correct SUBSCRIBE to a topic with QoS 0. + +# The client should connect to port 1888 with keepalive=60, clean session set, +# and client id subscribe-qos0-test +# The test will send a CONNACK message to the client with rc=0. Upon receiving +# the CONNACK and verifying that rc=0, the client should send a SUBSCRIBE +# message to subscribe to topic "qos0/test" with QoS=0. If rc!=0, the client +# should exit with an error. +# Upon receiving the correct SUBSCRIBE message, the test will reply with a +# SUBACK message with the accepted QoS set to 0. On receiving the SUBACK +# message, the client should send a DISCONNECT message. + +import inspect +import os +import socket +import sys + +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("subscribe-qos0-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +disconnect_packet = mosq_test.gen_disconnect() + +mid = 1 +subscribe_packet = mosq_test.gen_subscribe(mid, "qos0/test", 0) +suback_packet = mosq_test.gen_suback(mid, 0) + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', 1888)) +sock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env) + +try: + (conn, address) = sock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "subscribe", subscribe_packet): + conn.send(suback_packet) + + if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): + rc = 0 + + conn.close() +finally: + client.terminate() + client.wait() + sock.close() + +exit(rc) diff --git a/src/libs/mosquitto/test/lib/02-subscribe-qos1.py b/src/libs/mosquitto/test/lib/02-subscribe-qos1.py new file mode 100755 index 0000000..fa5144b --- /dev/null +++ b/src/libs/mosquitto/test/lib/02-subscribe-qos1.py @@ -0,0 +1,73 @@ +#!/usr/bin/env python + +# Test whether a client sends a correct SUBSCRIBE to a topic with QoS 1. + +# The client should connect to port 1888 with keepalive=60, clean session set, +# and client id subscribe-qos1-test +# The test will send a CONNACK message to the client with rc=0. Upon receiving +# the CONNACK and verifying that rc=0, the client should send a SUBSCRIBE +# message to subscribe to topic "qos1/test" with QoS=1. If rc!=0, the client +# should exit with an error. +# Upon receiving the correct SUBSCRIBE message, the test will reply with a +# SUBACK message with the accepted QoS set to 1. On receiving the SUBACK +# message, the client should send a DISCONNECT message. + +import inspect +import os +import socket +import sys + +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("subscribe-qos1-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +disconnect_packet = mosq_test.gen_disconnect() + +mid = 1 +subscribe_packet = mosq_test.gen_subscribe(mid, "qos1/test", 1) +suback_packet = mosq_test.gen_suback(mid, 1) + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', 1888)) +sock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env) + +try: + (conn, address) = sock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "subscribe", subscribe_packet): + conn.send(suback_packet) + + if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): + rc = 0 + + conn.close() +finally: + client.terminate() + client.wait() + sock.close() + +exit(rc) diff --git a/src/libs/mosquitto/test/lib/02-subscribe-qos2.py b/src/libs/mosquitto/test/lib/02-subscribe-qos2.py new file mode 100755 index 0000000..0fd1a72 --- /dev/null +++ b/src/libs/mosquitto/test/lib/02-subscribe-qos2.py @@ -0,0 +1,73 @@ +#!/usr/bin/env python + +# Test whether a client sends a correct SUBSCRIBE to a topic with QoS 2. + +# The client should connect to port 1888 with keepalive=60, clean session set, +# and client id subscribe-qos2-test +# The test will send a CONNACK message to the client with rc=0. Upon receiving +# the CONNACK and verifying that rc=0, the client should send a SUBSCRIBE +# message to subscribe to topic "qos2/test" with QoS=2. If rc!=0, the client +# should exit with an error. +# Upon receiving the correct SUBSCRIBE message, the test will reply with a +# SUBACK message with the accepted QoS set to 2. On receiving the SUBACK +# message, the client should send a DISCONNECT message. + +import inspect +import os +import socket +import sys + +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("subscribe-qos2-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +disconnect_packet = mosq_test.gen_disconnect() + +mid = 1 +subscribe_packet = mosq_test.gen_subscribe(mid, "qos2/test", 2) +suback_packet = mosq_test.gen_suback(mid, 2) + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', 1888)) +sock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env) + +try: + (conn, address) = sock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "subscribe", subscribe_packet): + conn.send(suback_packet) + + if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): + rc = 0 + + conn.close() +finally: + client.terminate() + client.wait() + sock.close() + +exit(rc) diff --git a/src/libs/mosquitto/test/lib/02-unsubscribe.py b/src/libs/mosquitto/test/lib/02-unsubscribe.py new file mode 100755 index 0000000..ec9805b --- /dev/null +++ b/src/libs/mosquitto/test/lib/02-unsubscribe.py @@ -0,0 +1,63 @@ +#!/usr/bin/env python + +# Test whether a client sends a correct UNSUBSCRIBE packet. + +import inspect +import os +import socket +import sys + +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("unsubscribe-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +disconnect_packet = mosq_test.gen_disconnect() + +mid = 1 +unsubscribe_packet = mosq_test.gen_unsubscribe(mid, "unsubscribe/test") +unsuback_packet = mosq_test.gen_unsuback(mid) + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', 1888)) +sock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env) + +try: + (conn, address) = sock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "unsubscribe", unsubscribe_packet): + conn.send(unsuback_packet) + + if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): + rc = 0 + + conn.close() +finally: + client.terminate() + client.wait() + sock.close() + +exit(rc) diff --git a/src/libs/mosquitto/test/lib/03-publish-b2c-qos1.py b/src/libs/mosquitto/test/lib/03-publish-b2c-qos1.py new file mode 100755 index 0000000..53f3db4 --- /dev/null +++ b/src/libs/mosquitto/test/lib/03-publish-b2c-qos1.py @@ -0,0 +1,81 @@ +#!/usr/bin/env python + +# Test whether a client responds correctly to a PUBLISH with QoS 1. + +# The client should connect to port 1888 with keepalive=60, clean session set, +# and client id publish-qos1-test +# The test will send a CONNACK message to the client with rc=0. Upon receiving +# the CONNACK the client should verify that rc==0. +# The test will send the client a PUBLISH message with topic +# "pub/qos1/receive", payload of "message", QoS=1 and mid=123. The client +# should handle this as per the spec by sending a PUBACK message. +# The client should then exit with return code==0. + +import inspect +import os +import socket +import sys +import time + +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("publish-qos1-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +disconnect_packet = mosq_test.gen_disconnect() + +mid = 123 +publish_packet = mosq_test.gen_publish("pub/qos1/receive", qos=1, mid=mid, payload="message") +puback_packet = mosq_test.gen_puback(mid) + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', 1888)) +sock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env) + +try: + (conn, address) = sock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + conn.send(publish_packet) + + if mosq_test.expect_packet(conn, "puback", puback_packet): + rc = 0 + + conn.close() +finally: + for i in range(0, 5): + if client.returncode != None: + break + time.sleep(0.1) + + try: + client.terminate() + except OSError: + pass + client.wait() + sock.close() + if client.returncode != 0: + exit(1) + +exit(rc) diff --git a/src/libs/mosquitto/test/lib/03-publish-b2c-qos2.py b/src/libs/mosquitto/test/lib/03-publish-b2c-qos2.py new file mode 100755 index 0000000..f2af9d7 --- /dev/null +++ b/src/libs/mosquitto/test/lib/03-publish-b2c-qos2.py @@ -0,0 +1,94 @@ +#!/usr/bin/env python + +# Test whether a client responds correctly to a PUBLISH with QoS 1. + +# The client should connect to port 1888 with keepalive=60, clean session set, +# and client id publish-qos2-test +# The test will send a CONNACK message to the client with rc=0. Upon receiving +# the CONNACK the client should verify that rc==0. +# The test will send the client a PUBLISH message with topic +# "pub/qos2/receive", payload of "message", QoS=2 and mid=13423. The client +# should handle this as per the spec by sending a PUBREC message. +# The test will not respond to the first PUBREC message, so the client must +# resend the PUBREC message with dup=1. Note that to keep test durations low, a +# message retry timeout of less than 10 seconds is required for this test. +# On receiving the second PUBREC with dup==1, the test will send the correct +# PUBREL message. The client should respond to this with the correct PUBCOMP +# message and then exit with return code=0. + +import inspect +import os +import socket +import sys +import time + +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("publish-qos2-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +disconnect_packet = mosq_test.gen_disconnect() + +mid = 13423 +publish_packet = mosq_test.gen_publish("pub/qos2/receive", qos=2, mid=mid, payload="message") +pubrec_packet = mosq_test.gen_pubrec(mid) +pubrel_packet = mosq_test.gen_pubrel(mid) +pubcomp_packet = mosq_test.gen_pubcomp(mid) + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', 1888)) +sock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env) + +try: + (conn, address) = sock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + conn.send(publish_packet) + + if mosq_test.expect_packet(conn, "pubrec", pubrec_packet): + # Should be repeated due to timeout + if mosq_test.expect_packet(conn, "pubrec", pubrec_packet): + conn.send(pubrel_packet) + + if mosq_test.expect_packet(conn, "pubcomp", pubcomp_packet): + rc = 0 + + conn.close() +finally: + for i in range(0, 5): + if client.returncode != None: + break + time.sleep(0.1) + + try: + client.terminate() + except OSError: + pass + + client.wait() + sock.close() + if client.returncode != 0: + exit(1) + +exit(rc) diff --git a/src/libs/mosquitto/test/lib/03-publish-c2b-qos1-disconnect.py b/src/libs/mosquitto/test/lib/03-publish-c2b-qos1-disconnect.py new file mode 100755 index 0000000..bcddecc --- /dev/null +++ b/src/libs/mosquitto/test/lib/03-publish-c2b-qos1-disconnect.py @@ -0,0 +1,75 @@ +#!/usr/bin/env python + +# Test whether a client sends a correct PUBLISH to a topic with QoS 1, then responds correctly to a disconnect. + +import inspect +import os +import socket +import sys + +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("publish-qos1-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +disconnect_packet = mosq_test.gen_disconnect() + +mid = 1 +publish_packet = mosq_test.gen_publish("pub/qos1/test", qos=1, mid=mid, payload="message") +publish_packet_dup = mosq_test.gen_publish("pub/qos1/test", qos=1, mid=mid, payload="message", dup=True) +puback_packet = mosq_test.gen_puback(mid) + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', 1888)) +sock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp + +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env) + +try: + (conn, address) = sock.accept() + conn.settimeout(15) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "publish", publish_packet): + # Disconnect client. It should reconnect. + conn.close() + + (conn, address) = sock.accept() + conn.settimeout(15) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "retried publish", publish_packet_dup): + conn.send(puback_packet) + + if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): + rc = 0 + + conn.close() +finally: + client.terminate() + client.wait() + sock.close() + +exit(rc) diff --git a/src/libs/mosquitto/test/lib/03-publish-c2b-qos1-timeout.py b/src/libs/mosquitto/test/lib/03-publish-c2b-qos1-timeout.py new file mode 100755 index 0000000..3d0663e --- /dev/null +++ b/src/libs/mosquitto/test/lib/03-publish-c2b-qos1-timeout.py @@ -0,0 +1,81 @@ +#!/usr/bin/env python + +# Test whether a client sends a correct PUBLISH to a topic with QoS 1 and responds to a delay. + +# The client should connect to port 1888 with keepalive=60, clean session set, +# and client id publish-qos1-test +# The test will send a CONNACK message to the client with rc=0. Upon receiving +# the CONNACK the client should verify that rc==0. If not, it should exit with +# return code=1. +# On a successful CONNACK, the client should send a PUBLISH message with topic +# "pub/qos1/test", payload "message" and QoS=1. +# The test will not respond to the first PUBLISH message, so the client must +# resend the PUBLISH message with dup=1. Note that to keep test durations low, a +# message retry timeout of less than 10 seconds is required for this test. +# On receiving the second PUBLISH message, the test will send the correct +# PUBACK response. On receiving the correct PUBACK response, the client should +# send a DISCONNECT message. + +import inspect +import os +import socket +import sys + +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("publish-qos1-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +disconnect_packet = mosq_test.gen_disconnect() + +mid = 1 +publish_packet = mosq_test.gen_publish("pub/qos1/test", qos=1, mid=mid, payload="message") +publish_packet_dup = mosq_test.gen_publish("pub/qos1/test", qos=1, mid=mid, payload="message", dup=True) +puback_packet = mosq_test.gen_puback(mid) + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', 1888)) +sock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env) + +try: + (conn, address) = sock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "publish", publish_packet): + # Delay for > 3 seconds (message retry time) + + if mosq_test.expect_packet(conn, "dup publish", publish_packet_dup): + conn.send(puback_packet) + + if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): + rc = 0 + + conn.close() +finally: + client.terminate() + client.wait() + sock.close() + +exit(rc) diff --git a/src/libs/mosquitto/test/lib/03-publish-c2b-qos2-disconnect.py b/src/libs/mosquitto/test/lib/03-publish-c2b-qos2-disconnect.py new file mode 100755 index 0000000..7119586 --- /dev/null +++ b/src/libs/mosquitto/test/lib/03-publish-c2b-qos2-disconnect.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python + +# Test whether a client sends a correct PUBLISH to a topic with QoS 2 and responds to a disconnect. + +import inspect +import os +import socket +import sys + +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("publish-qos2-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +disconnect_packet = mosq_test.gen_disconnect() + +mid = 1 +publish_packet = mosq_test.gen_publish("pub/qos2/test", qos=2, mid=mid, payload="message") +publish_dup_packet = mosq_test.gen_publish("pub/qos2/test", qos=2, mid=mid, payload="message", dup=True) +pubrec_packet = mosq_test.gen_pubrec(mid) +pubrel_packet = mosq_test.gen_pubrel(mid) +pubcomp_packet = mosq_test.gen_pubcomp(mid) + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', 1888)) +sock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env) + +try: + (conn, address) = sock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "publish", publish_packet): + # Disconnect client. It should reconnect. + conn.close() + + (conn, address) = sock.accept() + conn.settimeout(15) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "retried publish", publish_dup_packet): + conn.send(pubrec_packet) + + if mosq_test.expect_packet(conn, "pubrel", pubrel_packet): + # Disconnect client. It should reconnect. + conn.close() + + (conn, address) = sock.accept() + conn.settimeout(15) + + # Complete connection and message flow. + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "retried pubrel", pubrel_packet): + conn.send(pubcomp_packet) + + if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): + rc = 0 + + conn.close() +finally: + client.terminate() + client.wait() + sock.close() + +exit(rc) diff --git a/src/libs/mosquitto/test/lib/03-publish-c2b-qos2-timeout.py b/src/libs/mosquitto/test/lib/03-publish-c2b-qos2-timeout.py new file mode 100755 index 0000000..00543f0 --- /dev/null +++ b/src/libs/mosquitto/test/lib/03-publish-c2b-qos2-timeout.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python + +# Test whether a client sends a correct PUBLISH to a topic with QoS 1 and responds to a delay. + +# The client should connect to port 1888 with keepalive=60, clean session set, +# and client id publish-qos2-test +# The test will send a CONNACK message to the client with rc=0. Upon receiving +# the CONNACK the client should verify that rc==0. If not, it should exit with +# return code=1. +# On a successful CONNACK, the client should send a PUBLISH message with topic +# "pub/qos2/test", payload "message" and QoS=2. +# The test will not respond to the first PUBLISH message, so the client must +# resend the PUBLISH message with dup=1. Note that to keep test durations low, a +# message retry timeout of less than 10 seconds is required for this test. +# On receiving the second PUBLISH message, the test will send the correct +# PUBREC response. On receiving the correct PUBREC response, the client should +# send a PUBREL message. +# The test will not respond to the first PUBREL message, so the client must +# resend the PUBREL message with dup=1. On receiving the second PUBREL message, +# the test will send the correct PUBCOMP response. On receiving the correct +# PUBCOMP response, the client should send a DISCONNECT message. + +import inspect +import os +import socket +import sys + +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("publish-qos2-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +disconnect_packet = mosq_test.gen_disconnect() + +mid = 1 +publish_packet = mosq_test.gen_publish("pub/qos2/test", qos=2, mid=mid, payload="message") +publish_dup_packet = mosq_test.gen_publish("pub/qos2/test", qos=2, mid=mid, payload="message", dup=True) +pubrec_packet = mosq_test.gen_pubrec(mid) +pubrel_packet = mosq_test.gen_pubrel(mid) +pubcomp_packet = mosq_test.gen_pubcomp(mid) + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', 1888)) +sock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env) + +try: + (conn, address) = sock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "publish", publish_packet): + # Delay for > 3 seconds (message retry time) + + if mosq_test.expect_packet(conn, "dup publish", publish_dup_packet): + conn.send(pubrec_packet) + + if mosq_test.expect_packet(conn, "pubrel", pubrel_packet): + if mosq_test.expect_packet(conn, "dup pubrel", pubrel_packet): + conn.send(pubcomp_packet) + + if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): + rc = 0 + + conn.close() +finally: + client.terminate() + client.wait() + sock.close() + +exit(rc) diff --git a/src/libs/mosquitto/test/lib/03-publish-c2b-qos2.py b/src/libs/mosquitto/test/lib/03-publish-c2b-qos2.py new file mode 100755 index 0000000..f8a604a --- /dev/null +++ b/src/libs/mosquitto/test/lib/03-publish-c2b-qos2.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python + +# Test whether a client sends a correct PUBLISH to a topic with QoS 2. + +# The client should connect to port 1888 with keepalive=60, clean session set, +# and client id publish-qos2-test +# The test will send a CONNACK message to the client with rc=0. Upon receiving +# the CONNACK the client should verify that rc==0. If not, it should exit with +# return code=1. +# On a successful CONNACK, the client should send a PUBLISH message with topic +# "pub/qos2/test", payload "message" and QoS=2. +# The test will not respond to the first PUBLISH message, so the client must +# resend the PUBLISH message with dup=1. Note that to keep test durations low, a +# message retry timeout of less than 10 seconds is required for this test. +# On receiving the second PUBLISH message, the test will send the correct +# PUBREC response. On receiving the correct PUBREC response, the client should +# send a PUBREL message. +# The test will not respond to the first PUBREL message, so the client must +# resend the PUBREL message with dup=1. On receiving the second PUBREL message, +# the test will send the correct PUBCOMP response. On receiving the correct +# PUBCOMP response, the client should send a DISCONNECT message. + +import inspect +import os +import socket +import sys + +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("publish-qos2-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +disconnect_packet = mosq_test.gen_disconnect() + +mid = 1 +publish_packet = mosq_test.gen_publish("pub/qos2/test", qos=2, mid=mid, payload="message") +publish_dup_packet = mosq_test.gen_publish("pub/qos2/test", qos=2, mid=mid, payload="message", dup=True) +pubrec_packet = mosq_test.gen_pubrec(mid) +pubrel_packet = mosq_test.gen_pubrel(mid) +pubcomp_packet = mosq_test.gen_pubcomp(mid) + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', 1888)) +sock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env) + +try: + (conn, address) = sock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "publish", publish_packet): + conn.send(pubrec_packet) + + if mosq_test.expect_packet(conn, "pubrel", pubrel_packet): + conn.send(pubcomp_packet) + + if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): + rc = 0 + + conn.close() +finally: + client.terminate() + client.wait() + sock.close() + +exit(rc) diff --git a/src/libs/mosquitto/test/lib/03-publish-qos0-no-payload.py b/src/libs/mosquitto/test/lib/03-publish-qos0-no-payload.py new file mode 100755 index 0000000..a858ad5 --- /dev/null +++ b/src/libs/mosquitto/test/lib/03-publish-qos0-no-payload.py @@ -0,0 +1,67 @@ +#!/usr/bin/env python + +# Test whether a client sends a correct PUBLISH to a topic with QoS 0 and no payload. + +# The client should connect to port 1888 with keepalive=60, clean session set, +# and client id publish-qos0-test-np +# The test will send a CONNACK message to the client with rc=0. Upon receiving +# the CONNACK and verifying that rc=0, the client should send a PUBLISH message +# to topic "pub/qos0/no-payload/test" with zero length payload and QoS=0. If +# rc!=0, the client should exit with an error. +# After sending the PUBLISH message, the client should send a DISCONNECT message. + +import inspect +import os +import socket +import sys + +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("publish-qos0-test-np", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +publish_packet = mosq_test.gen_publish("pub/qos0/no-payload/test", qos=0) + +disconnect_packet = mosq_test.gen_disconnect() + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', 1888)) +sock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env) + +try: + (conn, address) = sock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "publish", publish_packet): + if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): + rc = 0 + + conn.close() +finally: + client.terminate() + client.wait() + sock.close() + +exit(rc) diff --git a/src/libs/mosquitto/test/lib/03-publish-qos0.py b/src/libs/mosquitto/test/lib/03-publish-qos0.py new file mode 100755 index 0000000..c8d154d --- /dev/null +++ b/src/libs/mosquitto/test/lib/03-publish-qos0.py @@ -0,0 +1,67 @@ +#!/usr/bin/env python + +# Test whether a client sends a correct PUBLISH to a topic with QoS 0. + +# The client should connect to port 1888 with keepalive=60, clean session set, +# and client id publish-qos0-test +# The test will send a CONNACK message to the client with rc=0. Upon receiving +# the CONNACK and verifying that rc=0, the client should send a PUBLISH message +# to topic "pub/qos0/test" with payload "message" and QoS=0. If rc!=0, the +# client should exit with an error. +# After sending the PUBLISH message, the client should send a DISCONNECT message. + +import inspect +import os +import socket +import sys + +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("publish-qos0-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +publish_packet = mosq_test.gen_publish("pub/qos0/test", qos=0, payload="message") + +disconnect_packet = mosq_test.gen_disconnect() + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', 1888)) +sock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env) + +try: + (conn, address) = sock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "publish", publish_packet): + if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): + rc = 0 + + conn.close() +finally: + client.terminate() + client.wait() + sock.close() + +exit(rc) diff --git a/src/libs/mosquitto/test/lib/04-retain-qos0.py b/src/libs/mosquitto/test/lib/04-retain-qos0.py new file mode 100755 index 0000000..ef23451 --- /dev/null +++ b/src/libs/mosquitto/test/lib/04-retain-qos0.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python + +# Test whether a client sends a correct retained PUBLISH to a topic with QoS 0. + +import inspect +import os +import socket +import sys + +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +rc = 1 +keepalive = 60 +mid = 16 +connect_packet = mosq_test.gen_connect("retain-qos0-test", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) + +publish_packet = mosq_test.gen_publish("retain/qos0/test", qos=0, payload="retained message", retain=True) + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +sock.settimeout(10) +sock.bind(('', 1888)) +sock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env) + +try: + (conn, address) = sock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "publish", publish_packet): + rc = 0 + + conn.close() +finally: + client.terminate() + client.wait() + sock.close() + +exit(rc) diff --git a/src/libs/mosquitto/test/lib/08-ssl-bad-cacert.py b/src/libs/mosquitto/test/lib/08-ssl-bad-cacert.py new file mode 100755 index 0000000..20dc6fe --- /dev/null +++ b/src/libs/mosquitto/test/lib/08-ssl-bad-cacert.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python + +import inspect +import os +import sys + +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +if sys.version < '2.7': + print("WARNING: SSL not supported on Python 2.6") + exit(0) + +rc = 1 + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp + +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env) +client.wait() + +rc = client.returncode + +exit(rc) diff --git a/src/libs/mosquitto/test/lib/08-ssl-connect-cert-auth-enc.py b/src/libs/mosquitto/test/lib/08-ssl-connect-cert-auth-enc.py new file mode 100755 index 0000000..854fe12 --- /dev/null +++ b/src/libs/mosquitto/test/lib/08-ssl-connect-cert-auth-enc.py @@ -0,0 +1,71 @@ +#!/usr/bin/env python + +# Test whether a client produces a correct connect and subsequent disconnect when using SSL. +# Client must provide a certificate. + +# The client should connect to port 1888 with keepalive=60, clean session set, +# and client id 08-ssl-connect-crt-auth +# It should use the CA certificate ssl/test-root-ca.crt for verifying the server. +# The test will send a CONNACK message to the client with rc=0. Upon receiving +# the CONNACK and verifying that rc=0, the client should send a DISCONNECT +# message. If rc!=0, the client should exit with an error. + +import inspect +import os +import socket +import ssl +import sys + +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +if sys.version < '2.7': + print("WARNING: SSL not supported on Python 2.6") + exit(0) + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("08-ssl-connect-crt-auth-enc", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) +disconnect_packet = mosq_test.gen_disconnect() + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +ssock = ssl.wrap_socket(sock, ca_certs="../ssl/all-ca.crt", + keyfile="../ssl/server.key", certfile="../ssl/server.crt", + server_side=True, ssl_version=ssl.PROTOCOL_TLSv1, cert_reqs=ssl.CERT_REQUIRED) +ssock.settimeout(10) +ssock.bind(('', 1888)) +ssock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env) + +try: + (conn, address) = ssock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): + rc = 0 + + conn.close() +finally: + client.terminate() + client.wait() + ssock.close() + +exit(rc) diff --git a/src/libs/mosquitto/test/lib/08-ssl-connect-cert-auth.py b/src/libs/mosquitto/test/lib/08-ssl-connect-cert-auth.py new file mode 100755 index 0000000..cd36e45 --- /dev/null +++ b/src/libs/mosquitto/test/lib/08-ssl-connect-cert-auth.py @@ -0,0 +1,71 @@ +#!/usr/bin/env python + +# Test whether a client produces a correct connect and subsequent disconnect when using SSL. +# Client must provide a certificate. + +# The client should connect to port 1888 with keepalive=60, clean session set, +# and client id 08-ssl-connect-crt-auth +# It should use the CA certificate ssl/test-root-ca.crt for verifying the server. +# The test will send a CONNACK message to the client with rc=0. Upon receiving +# the CONNACK and verifying that rc=0, the client should send a DISCONNECT +# message. If rc!=0, the client should exit with an error. + +import inspect +import os +import socket +import ssl +import sys + +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +if sys.version < '2.7': + print("WARNING: SSL not supported on Python 2.6") + exit(0) + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("08-ssl-connect-crt-auth", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) +disconnect_packet = mosq_test.gen_disconnect() + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +ssock = ssl.wrap_socket(sock, ca_certs="../ssl/all-ca.crt", + keyfile="../ssl/server.key", certfile="../ssl/server.crt", + server_side=True, ssl_version=ssl.PROTOCOL_TLSv1, cert_reqs=ssl.CERT_REQUIRED) +ssock.settimeout(10) +ssock.bind(('', 1888)) +ssock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env) + +try: + (conn, address) = ssock.accept() + conn.settimeout(10) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): + rc = 0 + + conn.close() +finally: + client.terminate() + client.wait() + ssock.close() + +exit(rc) diff --git a/src/libs/mosquitto/test/lib/08-ssl-connect-no-auth.py b/src/libs/mosquitto/test/lib/08-ssl-connect-no-auth.py new file mode 100755 index 0000000..03d04a8 --- /dev/null +++ b/src/libs/mosquitto/test/lib/08-ssl-connect-no-auth.py @@ -0,0 +1,68 @@ +#!/usr/bin/env python + +# Test whether a client produces a correct connect and subsequent disconnect when using SSL. + +# The client should connect to port 1888 with keepalive=60, clean session set, +# and client id 08-ssl-connect-no-auth +# It should use the CA certificate ssl/test-ca.crt for verifying the server. +# The test will send a CONNACK message to the client with rc=0. Upon receiving +# the CONNACK and verifying that rc=0, the client should send a DISCONNECT +# message. If rc!=0, the client should exit with an error. + +import inspect +import os +import socket +import ssl +import sys + +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +if sys.version < '2.7': + print("WARNING: SSL not supported on Python 2.6") + exit(0) + +rc = 1 +keepalive = 60 +connect_packet = mosq_test.gen_connect("08-ssl-connect-no-auth", keepalive=keepalive) +connack_packet = mosq_test.gen_connack(rc=0) +disconnect_packet = mosq_test.gen_disconnect() + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +ssock = ssl.wrap_socket(sock, ca_certs="../ssl/all-ca.crt", keyfile="../ssl/server.key", certfile="../ssl/server.crt", server_side=True, ssl_version=ssl.PROTOCOL_TLSv1) +ssock.settimeout(10) +ssock.bind(('', 1888)) +ssock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env) + +try: + (conn, address) = ssock.accept() + conn.settimeout(100) + + if mosq_test.expect_packet(conn, "connect", connect_packet): + conn.send(connack_packet) + + if mosq_test.expect_packet(conn, "disconnect", disconnect_packet): + rc = 0 + + conn.close() +finally: + client.terminate() + client.wait() + ssock.close() + +exit(rc) diff --git a/src/libs/mosquitto/test/lib/08-ssl-fake-cacert.py b/src/libs/mosquitto/test/lib/08-ssl-fake-cacert.py new file mode 100755 index 0000000..1dbc026 --- /dev/null +++ b/src/libs/mosquitto/test/lib/08-ssl-fake-cacert.py @@ -0,0 +1,60 @@ +#!/usr/bin/env python + +import inspect +import os +import socket +import ssl +import sys +import time + +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + +import mosq_test + +if sys.version < '2.7': + print("WARNING: SSL not supported on Python 2.6") + exit(0) + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +ssock = ssl.wrap_socket(sock, ca_certs="../ssl/all-ca.crt", + keyfile="../ssl/server.key", certfile="../ssl/server.crt", + server_side=True, ssl_version=ssl.PROTOCOL_TLSv1, cert_reqs=ssl.CERT_REQUIRED) +ssock.settimeout(10) +ssock.bind(('', 1888)) +ssock.listen(5) + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env) + +try: + (conn, address) = ssock.accept() + + conn.close() +except ssl.SSLError: + # Expected error due to ca certs not matching. + pass +finally: + time.sleep(1.0) + try: + client.terminate() + except OSError: + pass + client.wait() + ssock.close() + +if client.returncode == 0: + exit(0) +else: + exit(1) + diff --git a/src/libs/mosquitto/test/lib/09-util-topic-matching.py b/src/libs/mosquitto/test/lib/09-util-topic-matching.py new file mode 100755 index 0000000..3dc19e0 --- /dev/null +++ b/src/libs/mosquitto/test/lib/09-util-topic-matching.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python + +import inspect +import os +import sys + +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) +import mosq_test + +rc = 1 + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp + +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env) +client.wait() +if client.returncode: + (stdo, stde) = client.communicate() + print(stdo) +exit(client.returncode) diff --git a/src/libs/mosquitto/test/lib/09-util-topic-tokenise.py b/src/libs/mosquitto/test/lib/09-util-topic-tokenise.py new file mode 100755 index 0000000..6f8dc12 --- /dev/null +++ b/src/libs/mosquitto/test/lib/09-util-topic-tokenise.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +import inspect +import os +import sys + +# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder +cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) +if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) +import mosq_test + +rc = 1 + +client_args = sys.argv[1:] +env = dict(os.environ) +env['LD_LIBRARY_PATH'] = '../../lib:../../lib/cpp' +try: + pp = env['PYTHONPATH'] +except KeyError: + pp = '' +env['PYTHONPATH'] = '../../lib/python:'+pp + +client = mosq_test.start_client(filename=sys.argv[1].replace('/', '-'), cmd=client_args, env=env) +client.wait() +exit(client.returncode) diff --git a/src/libs/mosquitto/test/lib/Makefile b/src/libs/mosquitto/test/lib/Makefile new file mode 100644 index 0000000..03f1390 --- /dev/null +++ b/src/libs/mosquitto/test/lib/Makefile @@ -0,0 +1,53 @@ +include ../../config.mk + +.PHONY: all test test-compile test-compile-c test-compile-cpp c cpp +.NOTPARALLEL: + +LD_LIBRARY_PATH=../../lib + +all : + +test : c cpp + +test-compile : test-compile-c test-compile-cpp + +test-compile-c : + $(MAKE) -C c + +test-compile-cpp : + $(MAKE) -C cpp + +c cpp : test-compile + ./01-con-discon-success.py $@/01-con-discon-success.test + ./01-will-set.py $@/01-will-set.test + ./01-unpwd-set.py $@/01-unpwd-set.test + ./01-will-unpwd-set.py $@/01-will-unpwd-set.test + ./01-no-clean-session.py $@/01-no-clean-session.test + ./01-keepalive-pingreq.py $@/01-keepalive-pingreq.test + ./02-subscribe-qos0.py $@/02-subscribe-qos0.test + ./02-subscribe-qos1.py $@/02-subscribe-qos1.test + ./02-subscribe-qos2.py $@/02-subscribe-qos2.test + ./02-unsubscribe.py $@/02-unsubscribe.test + ./03-publish-qos0.py $@/03-publish-qos0.test + ./03-publish-qos0-no-payload.py $@/03-publish-qos0-no-payload.test + ./03-publish-c2b-qos1-timeout.py $@/03-publish-c2b-qos1-timeout.test + ./03-publish-c2b-qos1-disconnect.py $@/03-publish-c2b-qos1-disconnect.test + ./03-publish-c2b-qos2.py $@/03-publish-c2b-qos2.test + ./03-publish-c2b-qos2-timeout.py $@/03-publish-c2b-qos2-timeout.test + ./03-publish-c2b-qos2-disconnect.py $@/03-publish-c2b-qos2-disconnect.test + ./03-publish-b2c-qos1.py $@/03-publish-b2c-qos1.test + ./03-publish-b2c-qos2.py $@/03-publish-b2c-qos2.test + ./04-retain-qos0.py $@/04-retain-qos0.test +ifeq ($(WITH_TLS),yes) + ./08-ssl-connect-no-auth.py $@/08-ssl-connect-no-auth.test + ./08-ssl-connect-cert-auth.py $@/08-ssl-connect-cert-auth.test + ./08-ssl-connect-cert-auth-enc.py $@/08-ssl-connect-cert-auth-enc.test + ./08-ssl-bad-cacert.py $@/08-ssl-bad-cacert.test + #./08-ssl-fake-cacert.py $@/08-ssl-fake-cacert.test +endif + ./09-util-topic-matching.py $@/09-util-topic-matching.test + ./09-util-topic-tokenise.py $@/09-util-topic-tokenise.test + +clean : + $(MAKE) -C c clean + $(MAKE) -C cpp clean diff --git a/src/libs/mosquitto/test/lib/c/01-con-discon-success.c b/src/libs/mosquitto/test/lib/c/01-con-discon-success.c new file mode 100644 index 0000000..9fac2f6 --- /dev/null +++ b/src/libs/mosquitto/test/lib/c/01-con-discon-success.c @@ -0,0 +1,41 @@ +#include +#include +#include +#include + +static int run = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + }else{ + mosquitto_disconnect(mosq); + } +} + +void on_disconnect(struct mosquitto *mosq, void *obj, int rc) +{ + run = rc; +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + mosquitto_lib_init(); + + mosq = mosquitto_new("01-con-discon-success", true, NULL); + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_disconnect_callback_set(mosq, on_disconnect); + + rc = mosquitto_connect(mosq, "localhost", 1888, 60); + + while(run == -1){ + mosquitto_loop(mosq, -1, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/src/libs/mosquitto/test/lib/c/01-keepalive-pingreq.c b/src/libs/mosquitto/test/lib/c/01-keepalive-pingreq.c new file mode 100644 index 0000000..427a535 --- /dev/null +++ b/src/libs/mosquitto/test/lib/c/01-keepalive-pingreq.c @@ -0,0 +1,33 @@ +#include +#include +#include +#include + +static int run = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + } +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + mosquitto_lib_init(); + + mosq = mosquitto_new("01-keepalive-pingreq", true, NULL); + mosquitto_connect_callback_set(mosq, on_connect); + + rc = mosquitto_connect(mosq, "localhost", 1888, 4); + + while(run == -1){ + mosquitto_loop(mosq, -1, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/src/libs/mosquitto/test/lib/c/01-no-clean-session.c b/src/libs/mosquitto/test/lib/c/01-no-clean-session.c new file mode 100644 index 0000000..43f7951 --- /dev/null +++ b/src/libs/mosquitto/test/lib/c/01-no-clean-session.c @@ -0,0 +1,25 @@ +#include +#include +#include +#include +#include + +static int run = -1; +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + mosquitto_lib_init(); + + mosq = mosquitto_new("01-no-clean-session", false, NULL); + + rc = mosquitto_connect(mosq, "localhost", 1888, 60); + + while(run == -1){ + mosquitto_loop(mosq, -1, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/src/libs/mosquitto/test/lib/c/01-unpwd-set.c b/src/libs/mosquitto/test/lib/c/01-unpwd-set.c new file mode 100644 index 0000000..bec7164 --- /dev/null +++ b/src/libs/mosquitto/test/lib/c/01-unpwd-set.c @@ -0,0 +1,26 @@ +#include +#include +#include +#include +#include + +static int run = -1; +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + mosquitto_lib_init(); + + mosq = mosquitto_new("01-unpwd-set", true, NULL); + mosquitto_username_pw_set(mosq, "uname", ";'[08gn=#"); + + rc = mosquitto_connect(mosq, "localhost", 1888, 60); + + while(run == -1){ + mosquitto_loop(mosq, -1, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/src/libs/mosquitto/test/lib/c/01-will-set.c b/src/libs/mosquitto/test/lib/c/01-will-set.c new file mode 100644 index 0000000..041eef7 --- /dev/null +++ b/src/libs/mosquitto/test/lib/c/01-will-set.c @@ -0,0 +1,26 @@ +#include +#include +#include +#include +#include + +static int run = -1; +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + mosquitto_lib_init(); + + mosq = mosquitto_new("01-will-set", true, NULL); + mosquitto_will_set(mosq, "topic/on/unexpected/disconnect", strlen("will message"), "will message", 1, true); + + rc = mosquitto_connect(mosq, "localhost", 1888, 60); + + while(run == -1){ + mosquitto_loop(mosq, -1, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/src/libs/mosquitto/test/lib/c/01-will-unpwd-set.c b/src/libs/mosquitto/test/lib/c/01-will-unpwd-set.c new file mode 100644 index 0000000..af812f0 --- /dev/null +++ b/src/libs/mosquitto/test/lib/c/01-will-unpwd-set.c @@ -0,0 +1,27 @@ +#include +#include +#include +#include +#include + +static int run = -1; +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + mosquitto_lib_init(); + + mosq = mosquitto_new("01-will-unpwd-set", true, NULL); + mosquitto_username_pw_set(mosq, "oibvvwqw", "#'^2hg9a&nm38*us"); + mosquitto_will_set(mosq, "will-topic", strlen("will message"), "will message", 2, false); + + rc = mosquitto_connect(mosq, "localhost", 1888, 60); + + while(run == -1){ + mosquitto_loop(mosq, -1, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/src/libs/mosquitto/test/lib/c/02-subscribe-qos0.c b/src/libs/mosquitto/test/lib/c/02-subscribe-qos0.c new file mode 100644 index 0000000..9763f6a --- /dev/null +++ b/src/libs/mosquitto/test/lib/c/02-subscribe-qos0.c @@ -0,0 +1,47 @@ +#include +#include +#include +#include + +static int run = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + }else{ + mosquitto_subscribe(mosq, NULL, "qos0/test", 0); + } +} + +void on_disconnect(struct mosquitto *mosq, void *obj, int rc) +{ + run = rc; +} + +void on_subscribe(struct mosquitto *mosq, void *obj, int mid, int qos_count, const int *granted_qos) +{ + mosquitto_disconnect(mosq); +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + mosquitto_lib_init(); + + mosq = mosquitto_new("subscribe-qos0-test", true, NULL); + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_disconnect_callback_set(mosq, on_disconnect); + mosquitto_subscribe_callback_set(mosq, on_subscribe); + + rc = mosquitto_connect(mosq, "localhost", 1888, 60); + + while(run == -1){ + mosquitto_loop(mosq, -1, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/src/libs/mosquitto/test/lib/c/02-subscribe-qos1.c b/src/libs/mosquitto/test/lib/c/02-subscribe-qos1.c new file mode 100644 index 0000000..1f4677a --- /dev/null +++ b/src/libs/mosquitto/test/lib/c/02-subscribe-qos1.c @@ -0,0 +1,47 @@ +#include +#include +#include +#include + +static int run = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + }else{ + mosquitto_subscribe(mosq, NULL, "qos1/test", 1); + } +} + +void on_disconnect(struct mosquitto *mosq, void *obj, int rc) +{ + run = rc; +} + +void on_subscribe(struct mosquitto *mosq, void *obj, int mid, int qos_count, const int *granted_qos) +{ + mosquitto_disconnect(mosq); +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + mosquitto_lib_init(); + + mosq = mosquitto_new("subscribe-qos1-test", true, NULL); + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_disconnect_callback_set(mosq, on_disconnect); + mosquitto_subscribe_callback_set(mosq, on_subscribe); + + rc = mosquitto_connect(mosq, "localhost", 1888, 60); + + while(run == -1){ + mosquitto_loop(mosq, -1, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/src/libs/mosquitto/test/lib/c/02-subscribe-qos2.c b/src/libs/mosquitto/test/lib/c/02-subscribe-qos2.c new file mode 100644 index 0000000..7832e8b --- /dev/null +++ b/src/libs/mosquitto/test/lib/c/02-subscribe-qos2.c @@ -0,0 +1,47 @@ +#include +#include +#include +#include + +static int run = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + }else{ + mosquitto_subscribe(mosq, NULL, "qos2/test", 2); + } +} + +void on_disconnect(struct mosquitto *mosq, void *obj, int rc) +{ + run = rc; +} + +void on_subscribe(struct mosquitto *mosq, void *obj, int mid, int qos_count, const int *granted_qos) +{ + mosquitto_disconnect(mosq); +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + mosquitto_lib_init(); + + mosq = mosquitto_new("subscribe-qos2-test", true, NULL); + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_disconnect_callback_set(mosq, on_disconnect); + mosquitto_subscribe_callback_set(mosq, on_subscribe); + + rc = mosquitto_connect(mosq, "localhost", 1888, 60); + + while(run == -1){ + mosquitto_loop(mosq, -1, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/src/libs/mosquitto/test/lib/c/02-unsubscribe.c b/src/libs/mosquitto/test/lib/c/02-unsubscribe.c new file mode 100644 index 0000000..406401f --- /dev/null +++ b/src/libs/mosquitto/test/lib/c/02-unsubscribe.c @@ -0,0 +1,47 @@ +#include +#include +#include +#include + +static int run = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + }else{ + mosquitto_unsubscribe(mosq, NULL, "unsubscribe/test"); + } +} + +void on_disconnect(struct mosquitto *mosq, void *obj, int rc) +{ + run = rc; +} + +void on_unsubscribe(struct mosquitto *mosq, void *obj, int mid) +{ + mosquitto_disconnect(mosq); +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + mosquitto_lib_init(); + + mosq = mosquitto_new("unsubscribe-test", true, NULL); + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_disconnect_callback_set(mosq, on_disconnect); + mosquitto_unsubscribe_callback_set(mosq, on_unsubscribe); + + rc = mosquitto_connect(mosq, "localhost", 1888, 60); + + while(run == -1){ + mosquitto_loop(mosq, -1, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/src/libs/mosquitto/test/lib/c/03-publish-b2c-qos1.c b/src/libs/mosquitto/test/lib/c/03-publish-b2c-qos1.c new file mode 100644 index 0000000..64a06ea --- /dev/null +++ b/src/libs/mosquitto/test/lib/c/03-publish-b2c-qos1.c @@ -0,0 +1,64 @@ +#include +#include +#include +#include +#include + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + } +} + +void on_message(struct mosquitto *mosq, void *obj, const struct mosquitto_message *msg) +{ + if(msg->mid != 123){ + printf("Invalid mid (%d)\n", msg->mid); + exit(1); + } + if(msg->qos != 1){ + printf("Invalid qos (%d)\n", msg->qos); + exit(1); + } + if(strcmp(msg->topic, "pub/qos1/receive")){ + printf("Invalid topic (%s)\n", msg->topic); + exit(1); + } + if(strcmp(msg->payload, "message")){ + printf("Invalid payload (%s)\n", (char *)msg->payload); + exit(1); + } + if(msg->payloadlen != 7){ + printf("Invalid payloadlen (%d)\n", msg->payloadlen); + exit(1); + } + if(msg->retain != false){ + printf("Invalid retain (%d)\n", msg->retain); + exit(1); + } + + exit(0); +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + mosquitto_lib_init(); + + mosq = mosquitto_new("publish-qos1-test", true, NULL); + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_message_callback_set(mosq, on_message); + mosquitto_message_retry_set(mosq, 3); + + rc = mosquitto_connect(mosq, "localhost", 1888, 60); + + while(1){ + mosquitto_loop(mosq, 300, 1); + } + + mosquitto_lib_cleanup(); + return 1; +} diff --git a/src/libs/mosquitto/test/lib/c/03-publish-b2c-qos2.c b/src/libs/mosquitto/test/lib/c/03-publish-b2c-qos2.c new file mode 100644 index 0000000..9e1a0cc --- /dev/null +++ b/src/libs/mosquitto/test/lib/c/03-publish-b2c-qos2.c @@ -0,0 +1,66 @@ +#include +#include +#include +#include +#include + +static int run = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + } +} + +void on_message(struct mosquitto *mosq, void *obj, const struct mosquitto_message *msg) +{ + if(msg->mid != 13423){ + printf("Invalid mid (%d)\n", msg->mid); + exit(1); + } + if(msg->qos != 2){ + printf("Invalid qos (%d)\n", msg->qos); + exit(1); + } + if(strcmp(msg->topic, "pub/qos2/receive")){ + printf("Invalid topic (%s)\n", msg->topic); + exit(1); + } + if(strcmp(msg->payload, "message")){ + printf("Invalid payload (%s)\n", (char *)msg->payload); + exit(1); + } + if(msg->payloadlen != 7){ + printf("Invalid payloadlen (%d)\n", msg->payloadlen); + exit(1); + } + if(msg->retain != false){ + printf("Invalid retain (%d)\n", msg->retain); + exit(1); + } + + run = 0; +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + mosquitto_lib_init(); + + mosq = mosquitto_new("publish-qos2-test", true, &run); + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_message_callback_set(mosq, on_message); + mosquitto_message_retry_set(mosq, 5); + + rc = mosquitto_connect(mosq, "localhost", 1888, 60); + + while(run == -1){ + mosquitto_loop(mosq, 300, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/src/libs/mosquitto/test/lib/c/03-publish-c2b-qos1-disconnect.c b/src/libs/mosquitto/test/lib/c/03-publish-c2b-qos1-disconnect.c new file mode 100644 index 0000000..51b76a6 --- /dev/null +++ b/src/libs/mosquitto/test/lib/c/03-publish-c2b-qos1-disconnect.c @@ -0,0 +1,57 @@ +#include +#include +#include +#include +#include + +static int run = -1; +static int first_connection = 1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + }else{ + if(first_connection == 1){ + mosquitto_publish(mosq, NULL, "pub/qos1/test", strlen("message"), "message", 1, false); + first_connection = 0; + } + } +} + +void on_publish(struct mosquitto *mosq, void *obj, int mid) +{ + mosquitto_disconnect(mosq); +} + +void on_disconnect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + mosquitto_reconnect(mosq); + }else{ + run = 0; + } +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + mosquitto_lib_init(); + + mosq = mosquitto_new("publish-qos1-test", true, NULL); + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_disconnect_callback_set(mosq, on_disconnect); + mosquitto_publish_callback_set(mosq, on_publish); + mosquitto_message_retry_set(mosq, 3); + + rc = mosquitto_connect(mosq, "localhost", 1888, 60); + + while(run == -1){ + mosquitto_loop(mosq, 300, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/src/libs/mosquitto/test/lib/c/03-publish-c2b-qos1-timeout.c b/src/libs/mosquitto/test/lib/c/03-publish-c2b-qos1-timeout.c new file mode 100644 index 0000000..b01473f --- /dev/null +++ b/src/libs/mosquitto/test/lib/c/03-publish-c2b-qos1-timeout.c @@ -0,0 +1,49 @@ +#include +#include +#include +#include +#include + +static int run = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + }else{ + mosquitto_publish(mosq, NULL, "pub/qos1/test", strlen("message"), "message", 1, false); + } +} + +void on_publish(struct mosquitto *mosq, void *obj, int mid) +{ + mosquitto_disconnect(mosq); +} + +void on_disconnect(struct mosquitto *mosq, void *obj, int rc) +{ + run = 0; +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + mosquitto_lib_init(); + + mosq = mosquitto_new("publish-qos1-test", true, NULL); + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_disconnect_callback_set(mosq, on_disconnect); + mosquitto_publish_callback_set(mosq, on_publish); + mosquitto_message_retry_set(mosq, 3); + + rc = mosquitto_connect(mosq, "localhost", 1888, 60); + + while(run == -1){ + mosquitto_loop(mosq, 300, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/src/libs/mosquitto/test/lib/c/03-publish-c2b-qos2-disconnect.c b/src/libs/mosquitto/test/lib/c/03-publish-c2b-qos2-disconnect.c new file mode 100644 index 0000000..c957526 --- /dev/null +++ b/src/libs/mosquitto/test/lib/c/03-publish-c2b-qos2-disconnect.c @@ -0,0 +1,57 @@ +#include +#include +#include +#include +#include + +static int run = -1; +static int first_connection = 1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + }else{ + if(first_connection == 1){ + mosquitto_publish(mosq, NULL, "pub/qos2/test", strlen("message"), "message", 2, false); + first_connection = 0; + } + } +} + +void on_publish(struct mosquitto *mosq, void *obj, int mid) +{ + mosquitto_disconnect(mosq); +} + +void on_disconnect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + mosquitto_reconnect(mosq); + }else{ + run = 0; + } +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + mosquitto_lib_init(); + + mosq = mosquitto_new("publish-qos2-test", true, NULL); + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_disconnect_callback_set(mosq, on_disconnect); + mosquitto_publish_callback_set(mosq, on_publish); + mosquitto_message_retry_set(mosq, 3); + + rc = mosquitto_connect(mosq, "localhost", 1888, 60); + + while(run == -1){ + mosquitto_loop(mosq, 300, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/src/libs/mosquitto/test/lib/c/03-publish-c2b-qos2-timeout.c b/src/libs/mosquitto/test/lib/c/03-publish-c2b-qos2-timeout.c new file mode 100644 index 0000000..f4c379e --- /dev/null +++ b/src/libs/mosquitto/test/lib/c/03-publish-c2b-qos2-timeout.c @@ -0,0 +1,49 @@ +#include +#include +#include +#include +#include + +static int run = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + }else{ + mosquitto_publish(mosq, NULL, "pub/qos2/test", strlen("message"), "message", 2, false); + } +} + +void on_publish(struct mosquitto *mosq, void *obj, int mid) +{ + mosquitto_disconnect(mosq); +} + +void on_disconnect(struct mosquitto *mosq, void *obj, int rc) +{ + run = 0; +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + mosquitto_lib_init(); + + mosq = mosquitto_new("publish-qos2-test", true, NULL); + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_disconnect_callback_set(mosq, on_disconnect); + mosquitto_publish_callback_set(mosq, on_publish); + mosquitto_message_retry_set(mosq, 3); + + rc = mosquitto_connect(mosq, "localhost", 1888, 60); + + while(run == -1){ + mosquitto_loop(mosq, 300, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/src/libs/mosquitto/test/lib/c/03-publish-c2b-qos2.c b/src/libs/mosquitto/test/lib/c/03-publish-c2b-qos2.c new file mode 100644 index 0000000..2c14818 --- /dev/null +++ b/src/libs/mosquitto/test/lib/c/03-publish-c2b-qos2.c @@ -0,0 +1,48 @@ +#include +#include +#include +#include +#include + +static int run = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + }else{ + mosquitto_publish(mosq, NULL, "pub/qos2/test", strlen("message"), "message", 2, false); + } +} + +void on_publish(struct mosquitto *mosq, void *obj, int mid) +{ + mosquitto_disconnect(mosq); +} + +void on_disconnect(struct mosquitto *mosq, void *obj, int rc) +{ + run = 0; +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + mosquitto_lib_init(); + + mosq = mosquitto_new("publish-qos2-test", true, NULL); + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_disconnect_callback_set(mosq, on_disconnect); + mosquitto_publish_callback_set(mosq, on_publish); + + rc = mosquitto_connect(mosq, "localhost", 1888, 60); + + while(run == -1){ + mosquitto_loop(mosq, 300, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/src/libs/mosquitto/test/lib/c/03-publish-qos0-no-payload.c b/src/libs/mosquitto/test/lib/c/03-publish-qos0-no-payload.c new file mode 100644 index 0000000..8757790 --- /dev/null +++ b/src/libs/mosquitto/test/lib/c/03-publish-qos0-no-payload.c @@ -0,0 +1,48 @@ +#include +#include +#include +#include +#include + +static int run = -1; +static int sent_mid = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + }else{ + mosquitto_publish(mosq, &sent_mid, "pub/qos0/no-payload/test", 0, NULL, 0, false); + } +} + +void on_publish(struct mosquitto *mosq, void *obj, int mid) +{ + if(mid == sent_mid){ + mosquitto_disconnect(mosq); + run = 0; + }else{ + exit(1); + } +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + mosquitto_lib_init(); + + mosq = mosquitto_new("publish-qos0-test-np", true, NULL); + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_publish_callback_set(mosq, on_publish); + + rc = mosquitto_connect(mosq, "localhost", 1888, 60); + + while(run == -1){ + mosquitto_loop(mosq, -1, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/src/libs/mosquitto/test/lib/c/03-publish-qos0.c b/src/libs/mosquitto/test/lib/c/03-publish-qos0.c new file mode 100644 index 0000000..0bb7692 --- /dev/null +++ b/src/libs/mosquitto/test/lib/c/03-publish-qos0.c @@ -0,0 +1,48 @@ +#include +#include +#include +#include +#include + +static int run = -1; +static int sent_mid = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + }else{ + mosquitto_publish(mosq, &sent_mid, "pub/qos0/test", strlen("message"), "message", 0, false); + } +} + +void on_publish(struct mosquitto *mosq, void *obj, int mid) +{ + if(mid == sent_mid){ + mosquitto_disconnect(mosq); + run = 0; + }else{ + exit(1); + } +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + mosquitto_lib_init(); + + mosq = mosquitto_new("publish-qos0-test", true, NULL); + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_publish_callback_set(mosq, on_publish); + + rc = mosquitto_connect(mosq, "localhost", 1888, 60); + + while(run == -1){ + mosquitto_loop(mosq, -1, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/src/libs/mosquitto/test/lib/c/04-retain-qos0.c b/src/libs/mosquitto/test/lib/c/04-retain-qos0.c new file mode 100644 index 0000000..c2a9678 --- /dev/null +++ b/src/libs/mosquitto/test/lib/c/04-retain-qos0.c @@ -0,0 +1,36 @@ +#include +#include +#include +#include +#include + +static int run = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + }else{ + mosquitto_publish(mosq, NULL, "retain/qos0/test", strlen("retained message"), "retained message", 0, true); + } +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + mosquitto_lib_init(); + + mosq = mosquitto_new("retain-qos0-test", true, NULL); + mosquitto_connect_callback_set(mosq, on_connect); + + rc = mosquitto_connect(mosq, "localhost", 1888, 60); + + while(run == -1){ + mosquitto_loop(mosq, -1, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/src/libs/mosquitto/test/lib/c/08-ssl-bad-cacert.c b/src/libs/mosquitto/test/lib/c/08-ssl-bad-cacert.c new file mode 100644 index 0000000..fc39a96 --- /dev/null +++ b/src/libs/mosquitto/test/lib/c/08-ssl-bad-cacert.c @@ -0,0 +1,21 @@ +#include +#include +#include +#include +#include + +int main(int argc, char *argv[]) +{ + int rc = 1; + struct mosquitto *mosq; + + mosquitto_lib_init(); + + mosq = mosquitto_new("08-ssl-bad-cacert", true, NULL); + mosquitto_tls_opts_set(mosq, 1, "tlsv1", NULL); + if(mosquitto_tls_set(mosq, "this/file/doesnt/exist", NULL, NULL, NULL, NULL) == MOSQ_ERR_INVAL){ + rc = 0; + } + mosquitto_lib_cleanup(); + return rc; +} diff --git a/src/libs/mosquitto/test/lib/c/08-ssl-connect-cert-auth-enc.c b/src/libs/mosquitto/test/lib/c/08-ssl-connect-cert-auth-enc.c new file mode 100644 index 0000000..12b2638 --- /dev/null +++ b/src/libs/mosquitto/test/lib/c/08-ssl-connect-cert-auth-enc.c @@ -0,0 +1,53 @@ +#include +#include +#include +#include +#include +#include + +static int run = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + }else{ + mosquitto_disconnect(mosq); + } +} + +void on_disconnect(struct mosquitto *mosq, void *obj, int rc) +{ + run = rc; +} + +static int password_callback(char* buf, int size, int rwflag, void* userdata) +{ + strncpy(buf, "password", size); + buf[size-1] = '\0'; + + return strlen(buf); +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + mosquitto_lib_init(); + + mosq = mosquitto_new("08-ssl-connect-crt-auth-enc", true, NULL); + mosquitto_tls_opts_set(mosq, 1, "tlsv1", NULL); + mosquitto_tls_set(mosq, "../ssl/test-root-ca.crt", "../ssl/certs", "../ssl/client-encrypted.crt", "../ssl/client-encrypted.key", password_callback); + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_disconnect_callback_set(mosq, on_disconnect); + + rc = mosquitto_connect(mosq, "localhost", 1888, 60); + + while(run == -1){ + mosquitto_loop(mosq, -1, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/src/libs/mosquitto/test/lib/c/08-ssl-connect-cert-auth.c b/src/libs/mosquitto/test/lib/c/08-ssl-connect-cert-auth.c new file mode 100644 index 0000000..3adc772 --- /dev/null +++ b/src/libs/mosquitto/test/lib/c/08-ssl-connect-cert-auth.c @@ -0,0 +1,44 @@ +#include +#include +#include +#include +#include + +static int run = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + }else{ + mosquitto_disconnect(mosq); + } +} + +void on_disconnect(struct mosquitto *mosq, void *obj, int rc) +{ + run = rc; +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + mosquitto_lib_init(); + + mosq = mosquitto_new("08-ssl-connect-crt-auth", true, NULL); + mosquitto_tls_opts_set(mosq, 1, "tlsv1", NULL); + mosquitto_tls_set(mosq, "../ssl/test-root-ca.crt", "../ssl/certs", "../ssl/client.crt", "../ssl/client.key", NULL); + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_disconnect_callback_set(mosq, on_disconnect); + + rc = mosquitto_connect(mosq, "localhost", 1888, 60); + + while(run == -1){ + mosquitto_loop(mosq, -1, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/src/libs/mosquitto/test/lib/c/08-ssl-connect-no-auth.c b/src/libs/mosquitto/test/lib/c/08-ssl-connect-no-auth.c new file mode 100644 index 0000000..84fe8e7 --- /dev/null +++ b/src/libs/mosquitto/test/lib/c/08-ssl-connect-no-auth.c @@ -0,0 +1,45 @@ +#include +#include +#include +#include +#include + +static int run = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + if(rc){ + exit(1); + }else{ + mosquitto_disconnect(mosq); + } +} + +void on_disconnect(struct mosquitto *mosq, void *obj, int rc) +{ + run = rc; +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + mosquitto_lib_init(); + + mosq = mosquitto_new("08-ssl-connect-no-auth", true, NULL); + mosquitto_tls_opts_set(mosq, 1, "tlsv1", NULL); + //mosquitto_tls_set(mosq, "../ssl/test-root-ca.crt", NULL, NULL, NULL, NULL); + mosquitto_tls_set(mosq, "../ssl/all-ca.crt", NULL, NULL, NULL, NULL); + mosquitto_connect_callback_set(mosq, on_connect); + mosquitto_disconnect_callback_set(mosq, on_disconnect); + + rc = mosquitto_connect(mosq, "localhost", 1888, 60); + + while(run == -1){ + mosquitto_loop(mosq, -1, 1); + } + + mosquitto_lib_cleanup(); + return run; +} diff --git a/src/libs/mosquitto/test/lib/c/08-ssl-fake-cacert.c b/src/libs/mosquitto/test/lib/c/08-ssl-fake-cacert.c new file mode 100644 index 0000000..8bf0699 --- /dev/null +++ b/src/libs/mosquitto/test/lib/c/08-ssl-fake-cacert.c @@ -0,0 +1,35 @@ +#include +#include +#include +#include +#include + +static int run = -1; + +void on_connect(struct mosquitto *mosq, void *obj, int rc) +{ + exit(1); +} + +int main(int argc, char *argv[]) +{ + int rc; + struct mosquitto *mosq; + + mosquitto_lib_init(); + + mosq = mosquitto_new("08-ssl-connect-crt-auth", true, NULL); + mosquitto_tls_opts_set(mosq, 1, "tlsv1", NULL); + mosquitto_tls_set(mosq, "../ssl/test-fake-root-ca.crt", NULL, "../ssl/client.crt", "../ssl/client.key", NULL); + mosquitto_connect_callback_set(mosq, on_connect); + + rc = mosquitto_connect(mosq, "localhost", 1888, 60); + + rc = mosquitto_loop_forever(mosq, -1, 1); + if(rc == MOSQ_ERR_ERRNO && errno == EPROTO){ + return 0; + }else{ + return 1; + } +} + diff --git a/src/libs/mosquitto/test/lib/c/09-util-topic-matching.c b/src/libs/mosquitto/test/lib/c/09-util-topic-matching.c new file mode 100644 index 0000000..8b59a63 --- /dev/null +++ b/src/libs/mosquitto/test/lib/c/09-util-topic-matching.c @@ -0,0 +1,58 @@ +#include +#include +#include + +void do_check(const char *sub, const char *topic, bool bad_res) +{ + bool match; + + mosquitto_topic_matches_sub(sub, topic, &match); + + if(match == bad_res){ + printf("s: %s t: %s\n", sub, topic); + exit(1); + } +} + +int main(int argc, char *argv[]) +{ + do_check("foo/#", "foo/", false); + do_check("foo#", "foo", true); + do_check("fo#o/", "foo", true); + do_check("foo#", "fooa", true); + do_check("foo+", "foo", true); + do_check("foo+", "fooa", true); + + do_check("test/6/#", "test/3", true); + do_check("foo/bar", "foo/bar", false); + do_check("foo/+", "foo/bar", false); + do_check("foo/+/baz", "foo/bar/baz", false); + + do_check("A/B/+/#", "A/B/B/C", false); + + do_check("foo/+/#", "foo/bar/baz", false); + do_check("#", "foo/bar/baz", false); + + do_check("foo/bar", "foo", true); + do_check("foo/+", "foo/bar/baz", true); + do_check("foo/+/baz", "foo/bar/bar", true); + + do_check("foo/+/#", "fo2/bar/baz", true); + + do_check("#", "/foo/bar", false); + do_check("/#", "/foo/bar", false); + do_check("/#", "foo/bar", true); + + + do_check("foo//bar", "foo//bar", false); + do_check("foo//+", "foo//bar", false); + do_check("foo/+/+/baz", "foo///baz", false); + do_check("foo/bar/+", "foo/bar/", false); + + do_check("$SYS/bar", "$SYS/bar", false); + do_check("#", "$SYS/bar", true); + do_check("$BOB/bar", "$SYS/bar", true); + + return 0; +} + diff --git a/src/libs/mosquitto/test/lib/c/09-util-topic-tokenise.c b/src/libs/mosquitto/test/lib/c/09-util-topic-tokenise.c new file mode 100644 index 0000000..24baf07 --- /dev/null +++ b/src/libs/mosquitto/test/lib/c/09-util-topic-tokenise.c @@ -0,0 +1,130 @@ +#include +#include +#include + +void print_error(const char *topic, char **topics, int topic_count) +{ + int i; + printf("TOPIC: %s\n", topic); + printf("TOKENS: "); + for(i=0; i +//#include +//#include +#include + +static int run = -1; + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id); + + void on_connect(int rc); + void on_disconnect(int rc); +}; + +mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id) +{ +} + +void mosquittopp_test::on_connect(int rc) +{ + if(rc){ + exit(1); + }else{ + disconnect(); + } +} + +void mosquittopp_test::on_disconnect(int rc) +{ + run = rc; +} + + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("01-con-discon-success"); + + mosq->connect("localhost", 1888, 60); + + while(run == -1){ + mosq->loop(); + } + + mosqpp::lib_cleanup(); + + return run; +} diff --git a/src/libs/mosquitto/test/lib/cpp/01-keepalive-pingreq.cpp b/src/libs/mosquitto/test/lib/cpp/01-keepalive-pingreq.cpp new file mode 100644 index 0000000..fda1592 --- /dev/null +++ b/src/libs/mosquitto/test/lib/cpp/01-keepalive-pingreq.cpp @@ -0,0 +1,41 @@ +#include + +static int run = -1; + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id); + + void on_connect(int rc); +}; + +mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id) +{ +} + +void mosquittopp_test::on_connect(int rc) +{ + if(rc){ + exit(1); + } +} + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("01-keepalive-pingreq"); + + mosq->connect("localhost", 1888, 4); + + while(run == -1){ + mosq->loop(); + } + + mosqpp::lib_cleanup(); + + return run; +} diff --git a/src/libs/mosquitto/test/lib/cpp/01-no-clean-session.cpp b/src/libs/mosquitto/test/lib/cpp/01-no-clean-session.cpp new file mode 100644 index 0000000..508f05d --- /dev/null +++ b/src/libs/mosquitto/test/lib/cpp/01-no-clean-session.cpp @@ -0,0 +1,33 @@ +#include +#include + +static int run = -1; + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id, bool clean_session); +}; + +mosquittopp_test::mosquittopp_test(const char *id, bool clean_session) : mosqpp::mosquittopp(id, clean_session) +{ +} + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("01-no-clean-session", false); + + mosq->connect("localhost", 1888, 60); + + while(run == -1){ + mosq->loop(); + } + + mosqpp::lib_cleanup(); + + return run; +} diff --git a/src/libs/mosquitto/test/lib/cpp/01-unpwd-set.cpp b/src/libs/mosquitto/test/lib/cpp/01-unpwd-set.cpp new file mode 100644 index 0000000..39017a0 --- /dev/null +++ b/src/libs/mosquitto/test/lib/cpp/01-unpwd-set.cpp @@ -0,0 +1,34 @@ +#include +#include + +static int run = -1; + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id); +}; + +mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id) +{ +} + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("01-unpwd-set"); + mosq->username_pw_set("uname", ";'[08gn=#"); + + mosq->connect("localhost", 1888, 60); + + while(run == -1){ + mosq->loop(); + } + + mosqpp::lib_cleanup(); + + return run; +} diff --git a/src/libs/mosquitto/test/lib/cpp/01-will-set.cpp b/src/libs/mosquitto/test/lib/cpp/01-will-set.cpp new file mode 100644 index 0000000..4b6f337 --- /dev/null +++ b/src/libs/mosquitto/test/lib/cpp/01-will-set.cpp @@ -0,0 +1,37 @@ +//#include +//#include +//#include +#include +#include + +static int run = -1; + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id); +}; + +mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id) +{ +} + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("01-will-set"); + mosq->will_set("topic/on/unexpected/disconnect", strlen("will message"), "will message", 1, true); + + mosq->connect("localhost", 1888, 60); + + while(run == -1){ + mosq->loop(); + } + + mosqpp::lib_cleanup(); + + return run; +} diff --git a/src/libs/mosquitto/test/lib/cpp/01-will-unpwd-set.cpp b/src/libs/mosquitto/test/lib/cpp/01-will-unpwd-set.cpp new file mode 100644 index 0000000..4210162 --- /dev/null +++ b/src/libs/mosquitto/test/lib/cpp/01-will-unpwd-set.cpp @@ -0,0 +1,35 @@ +#include +#include + +static int run = -1; + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id); +}; + +mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id) +{ +} + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("01-will-unpwd-set"); + mosq->username_pw_set("oibvvwqw", "#'^2hg9a&nm38*us"); + mosq->will_set("will-topic", strlen("will message"), "will message", 2, false); + + mosq->connect("localhost", 1888, 60); + + while(run == -1){ + mosq->loop(); + } + + mosqpp::lib_cleanup(); + + return run; +} diff --git a/src/libs/mosquitto/test/lib/cpp/02-subscribe-qos0.cpp b/src/libs/mosquitto/test/lib/cpp/02-subscribe-qos0.cpp new file mode 100644 index 0000000..9ef54d1 --- /dev/null +++ b/src/libs/mosquitto/test/lib/cpp/02-subscribe-qos0.cpp @@ -0,0 +1,55 @@ +#include + +static int run = -1; + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id); + + void on_connect(int rc); + void on_disconnect(int rc); + void on_subscribe(int mid, int qos_count, const int *granted_qos); +}; + +mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id) +{ +} + +void mosquittopp_test::on_connect(int rc) +{ + if(rc){ + exit(1); + }else{ + subscribe(NULL, "qos0/test", 0); + } +} + +void mosquittopp_test::on_disconnect(int rc) +{ + run = rc; +} + +void mosquittopp_test::on_subscribe(int mid, int qos_count, const int *granted_qos) +{ + disconnect(); +} + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("subscribe-qos0-test"); + + mosq->connect("localhost", 1888, 60); + + while(run == -1){ + mosq->loop(); + } + + mosqpp::lib_cleanup(); + + return run; +} diff --git a/src/libs/mosquitto/test/lib/cpp/02-subscribe-qos1.cpp b/src/libs/mosquitto/test/lib/cpp/02-subscribe-qos1.cpp new file mode 100644 index 0000000..7bbcde0 --- /dev/null +++ b/src/libs/mosquitto/test/lib/cpp/02-subscribe-qos1.cpp @@ -0,0 +1,56 @@ +#include + +static int run = -1; + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id); + + void on_connect(int rc); + void on_disconnect(int rc); + void on_subscribe(int mid, int qos_count, const int *granted_qos); +}; + +mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id) +{ +} + +void mosquittopp_test::on_connect(int rc) +{ + if(rc){ + exit(1); + }else{ + subscribe(NULL, "qos1/test", 1); + } +} + +void mosquittopp_test::on_disconnect(int rc) +{ + run = rc; +} + +void mosquittopp_test::on_subscribe(int mid, int qos_count, const int *granted_qos) +{ + disconnect(); +} + + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("subscribe-qos1-test"); + + mosq->connect("localhost", 1888, 60); + + while(run == -1){ + mosq->loop(); + } + + mosqpp::lib_cleanup(); + + return run; +} diff --git a/src/libs/mosquitto/test/lib/cpp/02-subscribe-qos2.cpp b/src/libs/mosquitto/test/lib/cpp/02-subscribe-qos2.cpp new file mode 100644 index 0000000..362fad7 --- /dev/null +++ b/src/libs/mosquitto/test/lib/cpp/02-subscribe-qos2.cpp @@ -0,0 +1,56 @@ +#include + +static int run = -1; + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id); + + void on_connect(int rc); + void on_disconnect(int rc); + void on_subscribe(int mid, int qos_count, const int *granted_qos); +}; + +mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id) +{ +} + +void mosquittopp_test::on_connect(int rc) +{ + if(rc){ + exit(1); + }else{ + subscribe(NULL, "qos2/test", 2); + } +} + +void mosquittopp_test::on_disconnect(int rc) +{ + run = rc; +} + +void mosquittopp_test::on_subscribe(int mid, int qos_count, const int *granted_qos) +{ + disconnect(); +} + + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("subscribe-qos2-test"); + + mosq->connect("localhost", 1888, 60); + + while(run == -1){ + mosq->loop(); + } + + mosqpp::lib_cleanup(); + + return run; +} diff --git a/src/libs/mosquitto/test/lib/cpp/02-unsubscribe.cpp b/src/libs/mosquitto/test/lib/cpp/02-unsubscribe.cpp new file mode 100644 index 0000000..5d07476 --- /dev/null +++ b/src/libs/mosquitto/test/lib/cpp/02-unsubscribe.cpp @@ -0,0 +1,55 @@ +#include + +static int run = -1; + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id); + + void on_connect(int rc); + void on_disconnect(int rc); + void on_unsubscribe(int mid); +}; + +mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id) +{ +} + +void mosquittopp_test::on_connect(int rc) +{ + if(rc){ + exit(1); + }else{ + unsubscribe(NULL, "unsubscribe/test"); + } +} + +void mosquittopp_test::on_disconnect(int rc) +{ + run = rc; +} + +void mosquittopp_test::on_unsubscribe(int mid) +{ + disconnect(); +} + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("unsubscribe-test"); + + mosq->connect("localhost", 1888, 60); + + while(run == -1){ + mosq->loop(); + } + + mosqpp::lib_cleanup(); + + return run; +} diff --git a/src/libs/mosquitto/test/lib/cpp/03-publish-b2c-qos1.cpp b/src/libs/mosquitto/test/lib/cpp/03-publish-b2c-qos1.cpp new file mode 100644 index 0000000..e3950bb --- /dev/null +++ b/src/libs/mosquitto/test/lib/cpp/03-publish-b2c-qos1.cpp @@ -0,0 +1,76 @@ +#include +#include +#include + +#include + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id); + + void on_connect(int rc); + void on_message(const struct mosquitto_message *msg); +}; + +mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id) +{ +} + +void mosquittopp_test::on_connect(int rc) +{ + if(rc){ + exit(1); + } +} + +void mosquittopp_test::on_message(const struct mosquitto_message *msg) +{ + if(msg->mid != 123){ + printf("Invalid mid (%d)\n", msg->mid); + exit(1); + } + if(msg->qos != 1){ + printf("Invalid qos (%d)\n", msg->qos); + exit(1); + } + if(strcmp(msg->topic, "pub/qos1/receive")){ + printf("Invalid topic (%s)\n", msg->topic); + exit(1); + } + if(strcmp((char *)msg->payload, "message")){ + printf("Invalid payload (%s)\n", (char *)msg->payload); + exit(1); + } + if(msg->payloadlen != 7){ + printf("Invalid payloadlen (%d)\n", msg->payloadlen); + exit(1); + } + if(msg->retain != false){ + printf("Invalid retain (%d)\n", msg->retain); + exit(1); + } + + exit(0); +} + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("publish-qos1-test"); + mosq->message_retry_set(3); + + mosq->connect("localhost", 1888, 60); + + while(1){ + mosq->loop(); + } + + mosqpp::lib_cleanup(); + + return 1; +} + diff --git a/src/libs/mosquitto/test/lib/cpp/03-publish-b2c-qos2.cpp b/src/libs/mosquitto/test/lib/cpp/03-publish-b2c-qos2.cpp new file mode 100644 index 0000000..b8a1222 --- /dev/null +++ b/src/libs/mosquitto/test/lib/cpp/03-publish-b2c-qos2.cpp @@ -0,0 +1,78 @@ +#include +#include +#include + +#include + +static int run = -1; + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id); + + void on_connect(int rc); + void on_message(const struct mosquitto_message *msg); +}; + +mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id) +{ +} + +void mosquittopp_test::on_connect(int rc) +{ + if(rc){ + exit(1); + } +} + +void mosquittopp_test::on_message(const struct mosquitto_message *msg) +{ + if(msg->mid != 13423){ + printf("Invalid mid (%d)\n", msg->mid); + exit(1); + } + if(msg->qos != 2){ + printf("Invalid qos (%d)\n", msg->qos); + exit(1); + } + if(strcmp(msg->topic, "pub/qos2/receive")){ + printf("Invalid topic (%s)\n", msg->topic); + exit(1); + } + if(strcmp((char *)msg->payload, "message")){ + printf("Invalid payload (%s)\n", (char *)msg->payload); + exit(1); + } + if(msg->payloadlen != 7){ + printf("Invalid payloadlen (%d)\n", msg->payloadlen); + exit(1); + } + if(msg->retain != false){ + printf("Invalid retain (%d)\n", msg->retain); + exit(1); + } + + run = 0; +} + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("publish-qos2-test"); + mosq->message_retry_set(3); + + mosq->connect("localhost", 1888, 60); + + while(run == -1){ + mosq->loop(); + } + + mosqpp::lib_cleanup(); + + return run; +} + diff --git a/src/libs/mosquitto/test/lib/cpp/03-publish-c2b-qos1-disconnect.cpp b/src/libs/mosquitto/test/lib/cpp/03-publish-c2b-qos1-disconnect.cpp new file mode 100644 index 0000000..dde6f26 --- /dev/null +++ b/src/libs/mosquitto/test/lib/cpp/03-publish-c2b-qos1-disconnect.cpp @@ -0,0 +1,68 @@ +#include +#include + +#include + +static int run = -1; +static int first_connection = 1; + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id); + + void on_connect(int rc); + void on_disconnect(int rc); + void on_publish(int mid); +}; + +mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id) +{ +} + +void mosquittopp_test::on_connect(int rc) +{ + if(rc){ + exit(1); + }else{ + if(first_connection == 1){ + publish(NULL, "pub/qos1/test", strlen("message"), "message", 1, false); + first_connection = 0; + } + } +} + +void mosquittopp_test::on_disconnect(int rc) +{ + if(rc){ + reconnect(); + }else{ + run = 0; + } +} + +void mosquittopp_test::on_publish(int mid) +{ + disconnect(); +} + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("publish-qos1-test"); + mosq->message_retry_set(3); + + mosq->connect("localhost", 1888, 60); + + while(run == -1){ + mosq->loop(); + } + + mosqpp::lib_cleanup(); + + return run; +} + diff --git a/src/libs/mosquitto/test/lib/cpp/03-publish-c2b-qos1-timeout.cpp b/src/libs/mosquitto/test/lib/cpp/03-publish-c2b-qos1-timeout.cpp new file mode 100644 index 0000000..417c84c --- /dev/null +++ b/src/libs/mosquitto/test/lib/cpp/03-publish-c2b-qos1-timeout.cpp @@ -0,0 +1,60 @@ +#include +#include + +#include + +static int run = -1; + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id); + + void on_connect(int rc); + void on_disconnect(int rc); + void on_publish(int mid); +}; + +mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id) +{ +} + +void mosquittopp_test::on_connect(int rc) +{ + if(rc){ + exit(1); + }else{ + publish(NULL, "pub/qos1/test", strlen("message"), "message", 1, false); + } +} + +void mosquittopp_test::on_disconnect(int rc) +{ + run = 0; +} + +void mosquittopp_test::on_publish(int mid) +{ + disconnect(); +} + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("publish-qos1-test"); + mosq->message_retry_set(3); + + mosq->connect("localhost", 1888, 60); + + while(run == -1){ + mosq->loop(); + } + + mosqpp::lib_cleanup(); + + return run; +} + diff --git a/src/libs/mosquitto/test/lib/cpp/03-publish-c2b-qos2-disconnect.cpp b/src/libs/mosquitto/test/lib/cpp/03-publish-c2b-qos2-disconnect.cpp new file mode 100644 index 0000000..16c7cc0 --- /dev/null +++ b/src/libs/mosquitto/test/lib/cpp/03-publish-c2b-qos2-disconnect.cpp @@ -0,0 +1,68 @@ +#include +#include + +#include + +static int run = -1; +static int first_connection = 1; + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id); + + void on_connect(int rc); + void on_disconnect(int rc); + void on_publish(int mid); +}; + +mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id) +{ +} + +void mosquittopp_test::on_connect(int rc) +{ + if(rc){ + exit(1); + }else{ + if(first_connection == 1){ + publish(NULL, "pub/qos2/test", strlen("message"), "message", 2, false); + first_connection = 0; + } + } +} + +void mosquittopp_test::on_disconnect(int rc) +{ + if(rc){ + reconnect(); + }else{ + run = 0; + } +} + +void mosquittopp_test::on_publish(int mid) +{ + disconnect(); +} + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("publish-qos2-test"); + mosq->message_retry_set(3); + + mosq->connect("localhost", 1888, 60); + + while(run == -1){ + mosq->loop(); + } + + mosqpp::lib_cleanup(); + + return run; +} + diff --git a/src/libs/mosquitto/test/lib/cpp/03-publish-c2b-qos2-timeout.cpp b/src/libs/mosquitto/test/lib/cpp/03-publish-c2b-qos2-timeout.cpp new file mode 100644 index 0000000..6f53e5a --- /dev/null +++ b/src/libs/mosquitto/test/lib/cpp/03-publish-c2b-qos2-timeout.cpp @@ -0,0 +1,60 @@ +#include +#include + +#include + +static int run = -1; + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id); + + void on_connect(int rc); + void on_disconnect(int rc); + void on_publish(int mid); +}; + +mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id) +{ +} + +void mosquittopp_test::on_connect(int rc) +{ + if(rc){ + exit(1); + }else{ + publish(NULL, "pub/qos2/test", strlen("message"), "message", 2, false); + } +} + +void mosquittopp_test::on_disconnect(int rc) +{ + run = 0; +} + +void mosquittopp_test::on_publish(int mid) +{ + disconnect(); +} + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("publish-qos2-test"); + mosq->message_retry_set(3); + + mosq->connect("localhost", 1888, 60); + + while(run == -1){ + mosq->loop(); + } + + mosqpp::lib_cleanup(); + + return run; +} + diff --git a/src/libs/mosquitto/test/lib/cpp/03-publish-c2b-qos2.cpp b/src/libs/mosquitto/test/lib/cpp/03-publish-c2b-qos2.cpp new file mode 100644 index 0000000..2529576 --- /dev/null +++ b/src/libs/mosquitto/test/lib/cpp/03-publish-c2b-qos2.cpp @@ -0,0 +1,59 @@ +#include +#include + +#include + +static int run = -1; + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id); + + void on_connect(int rc); + void on_disconnect(int rc); + void on_publish(int mid); +}; + +mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id) +{ +} + +void mosquittopp_test::on_connect(int rc) +{ + if(rc){ + exit(1); + }else{ + publish(NULL, "pub/qos2/test", strlen("message"), "message", 2, false); + } +} + +void mosquittopp_test::on_disconnect(int rc) +{ + run = 0; +} + +void mosquittopp_test::on_publish(int mid) +{ + disconnect(); +} + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("publish-qos2-test"); + + mosq->connect("localhost", 1888, 60); + + while(run == -1){ + mosq->loop(); + } + + mosqpp::lib_cleanup(); + + return run; +} + diff --git a/src/libs/mosquitto/test/lib/cpp/03-publish-qos0-no-payload.cpp b/src/libs/mosquitto/test/lib/cpp/03-publish-qos0-no-payload.cpp new file mode 100644 index 0000000..e13e260 --- /dev/null +++ b/src/libs/mosquitto/test/lib/cpp/03-publish-qos0-no-payload.cpp @@ -0,0 +1,56 @@ +#include + +#include + +static int run = -1; +static int sent_mid = -1; + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id); + + void on_connect(int rc); + void on_publish(int mid); +}; + +mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id) +{ +} + +void mosquittopp_test::on_connect(int rc) +{ + if(rc){ + exit(1); + }else{ + publish(&sent_mid, "pub/qos0/no-payload/test", 0, NULL, 0, false); + } +} + +void mosquittopp_test::on_publish(int mid) +{ + if(sent_mid == mid){ + disconnect(); + }else{ + exit(1); + } +} + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("publish-qos0-test-np"); + + mosq->connect("localhost", 1888, 60); + + while(run == -1){ + mosq->loop(); + } + + mosqpp::lib_cleanup(); + + return run; +} diff --git a/src/libs/mosquitto/test/lib/cpp/03-publish-qos0.cpp b/src/libs/mosquitto/test/lib/cpp/03-publish-qos0.cpp new file mode 100644 index 0000000..58ece0a --- /dev/null +++ b/src/libs/mosquitto/test/lib/cpp/03-publish-qos0.cpp @@ -0,0 +1,56 @@ +#include + +#include + +static int run = -1; +static int sent_mid = -1; + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id); + + void on_connect(int rc); + void on_publish(int mid); +}; + +mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id) +{ +} + +void mosquittopp_test::on_connect(int rc) +{ + if(rc){ + exit(1); + }else{ + publish(&sent_mid, "pub/qos0/test", strlen("message"), "message", 0, false); + } +} + +void mosquittopp_test::on_publish(int mid) +{ + if(sent_mid == mid){ + disconnect(); + }else{ + exit(1); + } +} + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("publish-qos0-test"); + + mosq->connect("localhost", 1888, 60); + + while(run == -1){ + mosq->loop(); + } + + mosqpp::lib_cleanup(); + + return run; +} diff --git a/src/libs/mosquitto/test/lib/cpp/04-retain-qos0.cpp b/src/libs/mosquitto/test/lib/cpp/04-retain-qos0.cpp new file mode 100644 index 0000000..beca2bc --- /dev/null +++ b/src/libs/mosquitto/test/lib/cpp/04-retain-qos0.cpp @@ -0,0 +1,45 @@ +#include + +#include + +static int run = -1; + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id); + + void on_connect(int rc); +}; + +mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id) +{ +} + +void mosquittopp_test::on_connect(int rc) +{ + if(rc){ + exit(1); + }else{ + publish(NULL, "retain/qos0/test", strlen("retained message"), "retained message", 0, true); + } +} + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("retain-qos0-test"); + + mosq->connect("localhost", 1888, 60); + + while(run == -1){ + mosq->loop(); + } + + mosqpp::lib_cleanup(); + + return run; +} diff --git a/src/libs/mosquitto/test/lib/cpp/08-ssl-bad-cacert.cpp b/src/libs/mosquitto/test/lib/cpp/08-ssl-bad-cacert.cpp new file mode 100644 index 0000000..b54d4fc --- /dev/null +++ b/src/libs/mosquitto/test/lib/cpp/08-ssl-bad-cacert.cpp @@ -0,0 +1,31 @@ +#include + +static int run = -1; + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id); +}; + +mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id) +{ +} + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + int rc = 1; + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("08-ssl-bad-cacert"); + + mosq->tls_opts_set(1, "tlsv1", NULL); + if(mosq->tls_set("this/file/doesnt/exist") == MOSQ_ERR_INVAL){ + rc = 0; + } + mosqpp::lib_cleanup(); + + return rc; +} diff --git a/src/libs/mosquitto/test/lib/cpp/08-ssl-connect-cert-auth-enc.cpp b/src/libs/mosquitto/test/lib/cpp/08-ssl-connect-cert-auth-enc.cpp new file mode 100644 index 0000000..ed2edba --- /dev/null +++ b/src/libs/mosquitto/test/lib/cpp/08-ssl-connect-cert-auth-enc.cpp @@ -0,0 +1,62 @@ +#include +#include + +static int run = -1; + +static int password_callback(char* buf, int size, int rwflag, void* userdata) +{ + strncpy(buf, "password", size); + buf[size-1] = '\0'; + + return strlen(buf); +} + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id); + + void on_connect(int rc); + void on_disconnect(int rc); +}; + +mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id) +{ +} + +void mosquittopp_test::on_connect(int rc) +{ + if(rc){ + exit(1); + }else{ + disconnect(); + } +} + +void mosquittopp_test::on_disconnect(int rc) +{ + run = rc; +} + + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("08-ssl-connect-crt-auth-enc"); + + mosq->tls_opts_set(1, "tlsv1", NULL); + //mosq->tls_set("../ssl/test-ca.crt", NULL, "../ssl/client.crt", "../ssl/client.key"); + mosq->tls_set("../ssl/all-ca.crt", NULL, "../ssl/client-encrypted.crt", "../ssl/client-encrypted.key", password_callback); + mosq->connect("localhost", 1888, 60); + + while(run == -1){ + mosq->loop(); + } + + mosqpp::lib_cleanup(); + + return run; +} diff --git a/src/libs/mosquitto/test/lib/cpp/08-ssl-connect-cert-auth.cpp b/src/libs/mosquitto/test/lib/cpp/08-ssl-connect-cert-auth.cpp new file mode 100644 index 0000000..d47f4e5 --- /dev/null +++ b/src/libs/mosquitto/test/lib/cpp/08-ssl-connect-cert-auth.cpp @@ -0,0 +1,53 @@ +#include + +static int run = -1; + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id); + + void on_connect(int rc); + void on_disconnect(int rc); +}; + +mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id) +{ +} + +void mosquittopp_test::on_connect(int rc) +{ + if(rc){ + exit(1); + }else{ + disconnect(); + } +} + +void mosquittopp_test::on_disconnect(int rc) +{ + run = rc; +} + + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("08-ssl-connect-crt-auth"); + + mosq->tls_opts_set(1, "tlsv1", NULL); + //mosq->tls_set("../ssl/test-ca.crt", NULL, "../ssl/client.crt", "../ssl/client.key"); + mosq->tls_set("../ssl/all-ca.crt", NULL, "../ssl/client.crt", "../ssl/client.key"); + mosq->connect("localhost", 1888, 60); + + while(run == -1){ + mosq->loop(); + } + + mosqpp::lib_cleanup(); + + return run; +} diff --git a/src/libs/mosquitto/test/lib/cpp/08-ssl-connect-no-auth.cpp b/src/libs/mosquitto/test/lib/cpp/08-ssl-connect-no-auth.cpp new file mode 100644 index 0000000..79b86f8 --- /dev/null +++ b/src/libs/mosquitto/test/lib/cpp/08-ssl-connect-no-auth.cpp @@ -0,0 +1,53 @@ +#include + +static int run = -1; + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id); + + void on_connect(int rc); + void on_disconnect(int rc); +}; + +mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id) +{ +} + +void mosquittopp_test::on_connect(int rc) +{ + if(rc){ + exit(1); + }else{ + disconnect(); + } +} + +void mosquittopp_test::on_disconnect(int rc) +{ + run = rc; +} + + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("08-ssl-connect-no-auth"); + + mosq->tls_opts_set(1, "tlsv1", NULL); + //mosq->tls_set("../ssl/test-root-ca.crt"); + mosq->tls_set("../ssl/all-ca.crt"); + mosq->connect("localhost", 1888, 60); + + while(run == -1){ + mosq->loop(); + } + + mosqpp::lib_cleanup(); + + return run; +} diff --git a/src/libs/mosquitto/test/lib/cpp/08-ssl-fake-cacert.cpp b/src/libs/mosquitto/test/lib/cpp/08-ssl-fake-cacert.cpp new file mode 100644 index 0000000..615ea7c --- /dev/null +++ b/src/libs/mosquitto/test/lib/cpp/08-ssl-fake-cacert.cpp @@ -0,0 +1,42 @@ +#include +#include + +static int run = -1; + +class mosquittopp_test : public mosqpp::mosquittopp +{ + public: + mosquittopp_test(const char *id); + + void on_connect(int rc); +}; + +mosquittopp_test::mosquittopp_test(const char *id) : mosqpp::mosquittopp(id) +{ +} + +void mosquittopp_test::on_connect(int rc) +{ + exit(1); +} + +int main(int argc, char *argv[]) +{ + struct mosquittopp_test *mosq; + int rc; + + mosqpp::lib_init(); + + mosq = new mosquittopp_test("08-ssl-fake-cacert"); + + mosq->tls_opts_set(1, "tlsv1", NULL); + mosq->tls_set("../ssl/test-fake-root-ca.crt", NULL, "../ssl/client.crt", "../ssl/client.key"); + mosq->connect("localhost", 1888, 60); + + rc = mosq->loop_forever(); + if(rc == MOSQ_ERR_ERRNO && errno == EPROTO){ + return 0; + }else{ + return 1; + } +} diff --git a/src/libs/mosquitto/test/lib/cpp/09-util-topic-matching.cpp b/src/libs/mosquitto/test/lib/cpp/09-util-topic-matching.cpp new file mode 100644 index 0000000..4b1776a --- /dev/null +++ b/src/libs/mosquitto/test/lib/cpp/09-util-topic-matching.cpp @@ -0,0 +1,47 @@ +#include +#include + +void do_check(const char *sub, const char *topic, bool bad_res) +{ + bool match; + + mosqpp::topic_matches_sub(sub, topic, &match); + + if(match == bad_res){ + printf("s: %s t: %s\n", sub, topic); + exit(1); + } +} + +int main(int argc, char *argv[]) +{ + do_check("foo/bar", "foo/bar", false); + do_check("foo/+", "foo/bar", false); + do_check("foo/+/baz", "foo/bar/baz", false); + + do_check("foo/+/#", "foo/bar/baz", false); + do_check("#", "foo/bar/baz", false); + + do_check("foo/bar", "foo", true); + do_check("foo/+", "foo/bar/baz", true); + do_check("foo/+/baz", "foo/bar/bar", true); + + do_check("foo/+/#", "fo2/bar/baz", true); + + do_check("#", "/foo/bar", false); + do_check("/#", "/foo/bar", false); + do_check("/#", "foo/bar", true); + + + do_check("foo//bar", "foo//bar", false); + do_check("foo//+", "foo//bar", false); + do_check("foo/+/+/baz", "foo///baz", false); + do_check("foo/bar/+", "foo/bar/", false); + + do_check("$SYS/bar", "$SYS/bar", false); + do_check("#", "$SYS/bar", true); + do_check("$BOB/bar", "$SYS/bar", true); + + return 0; +} + diff --git a/src/libs/mosquitto/test/lib/cpp/09-util-topic-tokenise.cpp b/src/libs/mosquitto/test/lib/cpp/09-util-topic-tokenise.cpp new file mode 100644 index 0000000..3094d29 --- /dev/null +++ b/src/libs/mosquitto/test/lib/cpp/09-util-topic-tokenise.cpp @@ -0,0 +1,129 @@ +#include +#include +#include + +void print_error(const char *topic, char **topics, int topic_count) +{ + int i; + printf("TOPIC: %s\n", topic); + printf("TOKENS: "); + for(i=0; i 0: + rlen = len(expected) + else: + rlen = 1 + + packet_recvd = sock.recv(rlen) + return packet_matches(name, packet_recvd, expected) + +def packet_matches(name, recvd, expected): + if recvd != expected: + print("FAIL: Received incorrect "+name+".") + try: + print("Received: "+to_string(recvd)) + except struct.error: + print("Received (not decoded): "+recvd) + try: + print("Expected: "+to_string(expected)) + except struct.error: + print("Expected (not decoded): "+expected) + + return 0 + else: + return 1 + +def do_client_connect(connect_packet, connack_packet, hostname="localhost", port=1888, timeout=60, connack_error="connack"): + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + sock.settimeout(timeout) + sock.connect((hostname, port)) + sock.send(connect_packet) + + if expect_packet(sock, connack_error, connack_packet): + return sock + else: + sock.close() + raise ValueError + +def remaining_length(packet): + l = min(5, len(packet)) + all_bytes = struct.unpack("!"+"B"*l, packet[:l]) + mult = 1 + rl = 0 + for i in range(1,l-1): + byte = all_bytes[i] + + rl += (byte & 127) * mult + mult *= 128 + if byte & 128 == 0: + packet = packet[i+1:] + break + + return (packet, rl) + + +def to_hex_string(packet): + if len(packet) == 0: + return "" + + s = "" + while len(packet) > 0: + packet0 = struct.unpack("!B", packet[0]) + s = s+hex(packet0[0]) + " " + packet = packet[1:] + + return s + + +def to_string(packet): + if len(packet) == 0: + return "" + + packet0 = struct.unpack("!B", packet[0]) + packet0 = packet0[0] + cmd = packet0 & 0xF0 + if cmd == 0x00: + # Reserved + return "0x00" + elif cmd == 0x10: + # CONNECT + (packet, rl) = remaining_length(packet) + pack_format = "!H" + str(len(packet)-2) + 's' + (slen, packet) = struct.unpack(pack_format, packet) + pack_format = "!" + str(slen)+'sBBH' + str(len(packet)-slen-4) + 's' + (protocol, proto_ver, flags, keepalive, packet) = struct.unpack(pack_format, packet) + s = "CONNECT, proto="+protocol+str(proto_ver)+", keepalive="+str(keepalive) + if flags&2: + s = s+", clean-session" + else: + s = s+", durable" + + pack_format = "!H" + str(len(packet)-2) + 's' + (slen, packet) = struct.unpack(pack_format, packet) + pack_format = "!" + str(slen)+'s' + str(len(packet)-slen) + 's' + (client_id, packet) = struct.unpack(pack_format, packet) + s = s+", id="+client_id + + if flags&4: + pack_format = "!H" + str(len(packet)-2) + 's' + (slen, packet) = struct.unpack(pack_format, packet) + pack_format = "!" + str(slen)+'s' + str(len(packet)-slen) + 's' + (will_topic, packet) = struct.unpack(pack_format, packet) + s = s+", will-topic="+will_topic + + pack_format = "!H" + str(len(packet)-2) + 's' + (slen, packet) = struct.unpack(pack_format, packet) + pack_format = "!" + str(slen)+'s' + str(len(packet)-slen) + 's' + (will_message, packet) = struct.unpack(pack_format, packet) + s = s+", will-message="+will_message + + s = s+", will-qos="+str((flags&24)>>3) + s = s+", will-retain="+str((flags&32)>>5) + + if flags&128: + pack_format = "!H" + str(len(packet)-2) + 's' + (slen, packet) = struct.unpack(pack_format, packet) + pack_format = "!" + str(slen)+'s' + str(len(packet)-slen) + 's' + (username, packet) = struct.unpack(pack_format, packet) + s = s+", username="+username + + if flags&64: + pack_format = "!H" + str(len(packet)-2) + 's' + (slen, packet) = struct.unpack(pack_format, packet) + pack_format = "!" + str(slen)+'s' + str(len(packet)-slen) + 's' + (password, packet) = struct.unpack(pack_format, packet) + s = s+", password="+password + + if flags&1: + s = s+", reserved=1" + + return s + elif cmd == 0x20: + # CONNACK + (cmd, rl, resv, rc) = struct.unpack('!BBBB', packet) + return "CONNACK, rl="+str(rl)+", res="+str(resv)+", rc="+str(rc) + elif cmd == 0x30: + # PUBLISH + dup = (packet0 & 0x08)>>3 + qos = (packet0 & 0x06)>>1 + retain = (packet0 & 0x01) + (packet, rl) = remaining_length(packet) + pack_format = "!H" + str(len(packet)-2) + 's' + (tlen, packet) = struct.unpack(pack_format, packet) + pack_format = "!" + str(tlen)+'s' + str(len(packet)-tlen) + 's' + (topic, packet) = struct.unpack(pack_format, packet) + s = "PUBLISH, rl="+str(rl)+", topic="+topic+", qos="+str(qos)+", retain="+str(retain)+", dup="+str(dup) + if qos > 0: + pack_format = "!H" + str(len(packet)-2) + 's' + (mid, packet) = struct.unpack(pack_format, packet) + s = s + ", mid="+str(mid) + + s = s + ", payload="+packet + return s + elif cmd == 0x40: + # PUBACK + (cmd, rl, mid) = struct.unpack('!BBH', packet) + return "PUBACK, rl="+str(rl)+", mid="+str(mid) + elif cmd == 0x50: + # PUBREC + (cmd, rl, mid) = struct.unpack('!BBH', packet) + return "PUBREC, rl="+str(rl)+", mid="+str(mid) + elif cmd == 0x60: + # PUBREL + dup = (packet0 & 0x08)>>3 + (cmd, rl, mid) = struct.unpack('!BBH', packet) + return "PUBREL, rl="+str(rl)+", mid="+str(mid)+", dup="+str(dup) + elif cmd == 0x70: + # PUBCOMP + (cmd, rl, mid) = struct.unpack('!BBH', packet) + return "PUBCOMP, rl="+str(rl)+", mid="+str(mid) + elif cmd == 0x80: + # SUBSCRIBE + (packet, rl) = remaining_length(packet) + pack_format = "!H" + str(len(packet)-2) + 's' + (mid, packet) = struct.unpack(pack_format, packet) + s = "SUBSCRIBE, rl="+str(rl)+", mid="+str(mid) + topic_index = 0 + while len(packet) > 0: + pack_format = "!H" + str(len(packet)-2) + 's' + (tlen, packet) = struct.unpack(pack_format, packet) + pack_format = "!" + str(tlen)+'sB' + str(len(packet)-tlen-1) + 's' + (topic, qos, packet) = struct.unpack(pack_format, packet) + s = s + ", topic"+str(topic_index)+"="+topic+","+str(qos) + return s + elif cmd == 0x90: + # SUBACK + (packet, rl) = remaining_length(packet) + pack_format = "!H" + str(len(packet)-2) + 's' + (mid, packet) = struct.unpack(pack_format, packet) + pack_format = "!" + "B"*len(packet) + granted_qos = struct.unpack(pack_format, packet) + + s = "SUBACK, rl="+str(rl)+", mid="+str(mid)+", granted_qos="+str(granted_qos[0]) + for i in range(1, len(granted_qos)-1): + s = s+", "+str(granted_qos[i]) + return s + elif cmd == 0xA0: + # UNSUBSCRIBE + (packet, rl) = remaining_length(packet) + pack_format = "!H" + str(len(packet)-2) + 's' + (mid, packet) = struct.unpack(pack_format, packet) + s = "UNSUBSCRIBE, rl="+str(rl)+", mid="+str(mid) + topic_index = 0 + while len(packet) > 0: + pack_format = "!H" + str(len(packet)-2) + 's' + (tlen, packet) = struct.unpack(pack_format, packet) + pack_format = "!" + str(tlen)+'s' + str(len(packet)-tlen) + 's' + (topic, packet) = struct.unpack(pack_format, packet) + s = s + ", topic"+str(topic_index)+"="+topic + return s + elif cmd == 0xB0: + # UNSUBACK + (cmd, rl, mid) = struct.unpack('!BBH', packet) + return "UNSUBACK, rl="+str(rl)+", mid="+str(mid) + elif cmd == 0xC0: + # PINGREQ + (cmd, rl) = struct.unpack('!BB', packet) + return "PINGREQ, rl="+str(rl) + elif cmd == 0xD0: + # PINGRESP + (cmd, rl) = struct.unpack('!BB', packet) + return "PINGRESP, rl="+str(rl) + elif cmd == 0xE0: + # DISCONNECT + (cmd, rl) = struct.unpack('!BB', packet) + return "DISCONNECT, rl="+str(rl) + elif cmd == 0xF0: + # Reserved + return "0xF0" + +def gen_connect(client_id, clean_session=True, keepalive=60, username=None, password=None, will_topic=None, will_qos=0, will_retain=False, will_payload="", proto_ver=3, connect_reserved=False): + if (proto_ver&0x7F) == 3 or proto_ver == 0: + remaining_length = 12 + elif (proto_ver&0x7F) == 4: + remaining_length = 10 + else: + raise ValueError + + if client_id != None: + remaining_length = remaining_length + 2+len(client_id) + + connect_flags = 0 + + if connect_reserved: + connect_flags = connect_flags | 0x01 + + if clean_session: + connect_flags = connect_flags | 0x02 + + if will_topic != None: + remaining_length = remaining_length + 2+len(will_topic) + 2+len(will_payload) + connect_flags = connect_flags | 0x04 | ((will_qos&0x03) << 3) + if will_retain: + connect_flags = connect_flags | 32 + + if username != None: + remaining_length = remaining_length + 2+len(username) + connect_flags = connect_flags | 0x80 + if password != None: + connect_flags = connect_flags | 0x40 + remaining_length = remaining_length + 2+len(password) + + rl = pack_remaining_length(remaining_length) + packet = struct.pack("!B"+str(len(rl))+"s", 0x10, rl) + if (proto_ver&0x7F) == 3 or proto_ver == 0: + packet = packet + struct.pack("!H6sBBH", len("MQIsdp"), "MQIsdp", proto_ver, connect_flags, keepalive) + elif (proto_ver&0x7F) == 4: + packet = packet + struct.pack("!H4sBBH", len("MQTT"), "MQTT", proto_ver, connect_flags, keepalive) + + if client_id != None: + packet = packet + struct.pack("!H"+str(len(client_id))+"s", len(client_id), client_id) + + if will_topic != None: + packet = packet + struct.pack("!H"+str(len(will_topic))+"s", len(will_topic), will_topic) + if len(will_payload) > 0: + packet = packet + struct.pack("!H"+str(len(will_payload))+"s", len(will_payload), will_payload) + else: + packet = packet + struct.pack("!H", 0) + + if username != None: + packet = packet + struct.pack("!H"+str(len(username))+"s", len(username), username) + if password != None: + packet = packet + struct.pack("!H"+str(len(password))+"s", len(password), password) + return packet + +def gen_connack(resv=0, rc=0): + return struct.pack('!BBBB', 32, 2, resv, rc); + +def gen_publish(topic, qos, payload=None, retain=False, dup=False, mid=0): + rl = 2+len(topic) + pack_format = "!BBH"+str(len(topic))+"s" + if qos > 0: + rl = rl + 2 + pack_format = pack_format + "H" + if payload != None: + rl = rl + len(payload) + pack_format = pack_format + str(len(payload))+"s" + else: + payload = "" + pack_format = pack_format + "0s" + + cmd = 48 | (qos<<1) + if retain: + cmd = cmd + 1 + if dup: + cmd = cmd + 8 + + if qos > 0: + return struct.pack(pack_format, cmd, rl, len(topic), topic, mid, payload) + else: + return struct.pack(pack_format, cmd, rl, len(topic), topic, payload) + +def gen_puback(mid): + return struct.pack('!BBH', 64, 2, mid) + +def gen_pubrec(mid): + return struct.pack('!BBH', 80, 2, mid) + +def gen_pubrel(mid, dup=False): + if dup: + cmd = 96+8+2 + else: + cmd = 96+2 + return struct.pack('!BBH', cmd, 2, mid) + +def gen_pubcomp(mid): + return struct.pack('!BBH', 112, 2, mid) + +def gen_subscribe(mid, topic, qos): + pack_format = "!BBHH"+str(len(topic))+"sB" + return struct.pack(pack_format, 130, 2+2+len(topic)+1, mid, len(topic), topic, qos) + +def gen_suback(mid, qos): + return struct.pack('!BBHB', 144, 2+1, mid, qos) + +def gen_unsubscribe(mid, topic): + pack_format = "!BBHH"+str(len(topic))+"s" + return struct.pack(pack_format, 162, 2+2+len(topic), mid, len(topic), topic) + +def gen_unsuback(mid): + return struct.pack('!BBH', 176, 2, mid) + +def gen_pingreq(): + return struct.pack('!BB', 192, 0) + +def gen_pingresp(): + return struct.pack('!BB', 208, 0) + +def gen_disconnect(): + return struct.pack('!BB', 224, 0) + +def pack_remaining_length(remaining_length): + s = "" + while True: + byte = remaining_length % 128 + remaining_length = remaining_length // 128 + # If there are more digits to encode, set the top bit of this digit + if remaining_length > 0: + byte = byte | 0x80 + + s = s + struct.pack("!B", byte) + if remaining_length == 0: + return s diff --git a/src/libs/mosquitto/test/msgsps_common.h b/src/libs/mosquitto/test/msgsps_common.h new file mode 100644 index 0000000..8925f88 --- /dev/null +++ b/src/libs/mosquitto/test/msgsps_common.h @@ -0,0 +1,3 @@ +#define MESSAGE_COUNT 100000L +#define MESSAGE_SIZE 1024L + diff --git a/src/libs/mosquitto/test/msgsps_pub.c b/src/libs/mosquitto/test/msgsps_pub.c new file mode 100644 index 0000000..b2ac625 --- /dev/null +++ b/src/libs/mosquitto/test/msgsps_pub.c @@ -0,0 +1,135 @@ +/* This provides a crude manner of testing the performance of a broker in messages/s. */ + +#include +#include +#include +#include +#include +#include + +#include + +static bool run = true; +static int message_count = 0; +static struct timeval start, stop; + +void my_connect_callback(struct mosquitto *mosq, void *obj, int rc) +{ + printf("rc: %d\n", rc); + gettimeofday(&start, NULL); +} + +void my_disconnect_callback(struct mosquitto *mosq, void *obj, int result) +{ + run = false; +} + +void my_publish_callback(struct mosquitto *mosq, void *obj, int mid) +{ + message_count++; + //printf("%d ", message_count); + if(message_count == MESSAGE_COUNT){ + gettimeofday(&stop, NULL); + mosquitto_disconnect((struct mosquitto *)obj); + } +} + +int create_data(void) +{ + int i; + FILE *fptr, *rnd; + int rc = 0; + char buf[MESSAGE_SIZE]; + + fptr = fopen("msgsps_pub.dat", "rb"); + if(fptr){ + fseek(fptr, 0, SEEK_END); + if(ftell(fptr) >= MESSAGE_SIZE*MESSAGE_COUNT){ + fclose(fptr); + return 0; + } + fclose(fptr); + } + + fptr = fopen("msgsps_pub.dat", "wb"); + if(!fptr) return 1; + rnd = fopen("/dev/urandom", "rb"); + if(!rnd){ + fclose(fptr); + return 1; + } + + for(i=0; i +#include +#include +#include +#include +#include + +#include + +static bool run = true; +static int message_count = 0; +static struct timeval start, stop; +FILE *fptr = NULL; + + +void my_connect_callback(struct mosquitto *mosq, void *obj, int rc) +{ + printf("rc: %d\n", rc); +} + +void my_disconnect_callback(struct mosquitto *mosq, void *obj, int result) +{ + run = false; +} + +void my_message_callback(struct mosquitto *mosq, void *obj, const struct mosquitto_message *msg) +{ + if(message_count == 0){ + gettimeofday(&start, NULL); + } + fwrite(msg->payload, sizeof(uint8_t), msg->payloadlen, fptr); + message_count++; + if(message_count == MESSAGE_COUNT){ + gettimeofday(&stop, NULL); + mosquitto_disconnect((struct mosquitto *)obj); + } +} + +int main(int argc, char *argv[]) +{ + struct mosquitto *mosq; + double dstart, dstop, diff; + int mid = 0; + char id[50]; + int rc; + + start.tv_sec = 0; + start.tv_usec = 0; + stop.tv_sec = 0; + stop.tv_usec = 0; + + fptr = fopen("msgsps_sub.dat", "wb"); + if(!fptr){ + printf("Error: Unable to write to msgsps_sub.dat.\n"); + return 1; + } + mosquitto_lib_init(); + + snprintf(id, 50, "msgps_sub_%d", getpid()); + mosq = mosquitto_new(id, true, NULL); + mosquitto_connect_callback_set(mosq, my_connect_callback); + mosquitto_disconnect_callback_set(mosq, my_disconnect_callback); + mosquitto_message_callback_set(mosq, my_message_callback); + + mosquitto_connect(mosq, "127.0.0.1", 1884, 600); + mosquitto_subscribe(mosq, &mid, "perf/test", 0); + + do{ + rc = mosquitto_loop(mosq, 1, 10); + }while(rc == MOSQ_ERR_SUCCESS && run); + printf("rc: %d\n", rc); + + dstart = (double)start.tv_sec*1.0e6 + (double)start.tv_usec; + dstop = (double)stop.tv_sec*1.0e6 + (double)stop.tv_usec; + diff = (dstop-dstart)/1.0e6; + + printf("Start: %g\nStop: %g\nDiff: %g\nMessages/s: %g\n", dstart, dstop, diff, (double)MESSAGE_COUNT/diff); + + mosquitto_destroy(mosq); + mosquitto_lib_cleanup(); + fclose(fptr); + + return 0; +} diff --git a/src/libs/mosquitto/test/packet-gen.c b/src/libs/mosquitto/test/packet-gen.c new file mode 100644 index 0000000..30af357 --- /dev/null +++ b/src/libs/mosquitto/test/packet-gen.c @@ -0,0 +1,53 @@ +/* Fudge a file description into a client instead of a socket connection so + * that we can write out packets to a file. + * See http://answers.launchpad.net/mosquitto/+question/123594 + * also http://answers.launchpad.net/mosquitto/+question/136821 + */ +#include +#include +#include + +#include +#include +#include + +int main(int argc, char *argv[]) +{ + struct mosquitto *mosq; + int fd; + bool clean_session = true; + int keepalive = 60; + + mosq = mosquitto_new("packetgen", NULL); + if(!mosq){ + fprintf(stderr, "Error: Out of memory.\n"); + return 1; + } + + /* CONNECT */ + fd = open("mqtt.connect", O_CREAT|O_WRONLY, 00644); + if(fd<0){ + fprintf(stderr, "Error: Unable to open mqtt.connect for writing.\n"); + return 1; + } + mosq->core.sock = fd; + printf("_mosquitto_send_connect(): %d\n", _mosquitto_send_connect(mosq, keepalive, clean_session)); + printf("loop: %d\n", mosquitto_loop_write(mosq)); + close(fd); + + /* SUBSCRIBE */ + fd = open("mqtt.subscribe", O_CREAT|O_WRONLY, 00644); + if(fd<0){ + fprintf(stderr, "Error: Unable to open mqtt.subscribe for writing.\n"); + return 1; + } + mosq->core.sock = fd; + printf("_mosquitto_send_subscribe(): %d\n", _mosquitto_send_subscribe(mosq, NULL, false, "subscribe/topic", 2)); + printf("loop: %d\n", mosquitto_loop_write(mosq)); + close(fd); + + mosquitto_destroy(mosq); + + return 0; +} + diff --git a/src/libs/mosquitto/test/qos.c b/src/libs/mosquitto/test/qos.c new file mode 100644 index 0000000..d1ca41a --- /dev/null +++ b/src/libs/mosquitto/test/qos.c @@ -0,0 +1,186 @@ +#include +#include +#include +#include +#include +#include + +#include + +struct msg_list{ + struct msg_list *next; + struct mosquitto_message msg; + bool sent; +}; + +struct sub{ + uint16_t mid; + char *topic; + int qos; + bool complete; +}; + +struct sub subs[3]; +struct msg_list *messages_received = NULL; +struct msg_list *messages_sent = NULL; +int sent_count = 0; +int received_count = 0; + +void on_message(void *obj, const struct mosquitto_message *msg) +{ + struct msg_list *tail, *new_list; + + received_count++; + + new_list = malloc(sizeof(struct msg_list)); + if(!new_list){ + fprintf(stderr, "Error allocating list memory.\n"); + return; + } + new_list->next = NULL; + if(!mosquitto_message_copy(&new_list->msg, msg)){ + if(messages_received){ + tail = messages_received; + while(tail->next){ + tail = tail->next; + } + tail->next = new_list; + }else{ + messages_received = new_list; + } + }else{ + free(new_list); + return; + } +} + +void on_publish(void *obj, uint16_t mid) +{ + struct msg_list *tail = messages_sent; + + sent_count++; + + while(tail){ + if(tail->msg.mid == mid){ + tail->sent = true; + return; + } + tail = tail->next; + } + + fprintf(stderr, "ERROR: Invalid on_publish() callback for mid %d\n", mid); +} + +void on_subscribe(void *obj, uint16_t mid, int qos_count, const uint8_t *granted_qos) +{ + int i; + for(i=0; i<3; i++){ + if(subs[i].mid == mid){ + if(subs[i].complete){ + fprintf(stderr, "WARNING: Duplicate on_subscribe() callback for mid %d\n", mid); + } + subs[i].complete = true; + return; + } + } + fprintf(stderr, "ERROR: Invalid on_subscribe() callback for mid %d\n", mid); +} + +void on_disconnect(void *obj) +{ + printf("Disconnected cleanly.\n"); +} + +void rand_publish(struct mosquitto *mosq, const char *topic, int qos) +{ + int fd = open("/dev/urandom", O_RDONLY); + uint8_t buf[100]; + uint16_t mid; + struct msg_list *new_list, *tail; + + if(fd >= 0){ + if(read(fd, buf, 100) == 100){ + if(!mosquitto_publish(mosq, &mid, topic, 100, buf, qos, false)){ + new_list = malloc(sizeof(struct msg_list)); + if(new_list){ + new_list->msg.mid = mid; + new_list->msg.topic = strdup(topic); + new_list->msg.payloadlen = 100; + new_list->msg.payload = malloc(100); + memcpy(new_list->msg.payload, buf, 100); + new_list->msg.retain = false; + new_list->next = NULL; + new_list->sent = false; + + if(messages_sent){ + tail = messages_sent; + while(tail->next){ + tail = tail->next; + } + tail->next = new_list; + }else{ + messages_sent = new_list; + } + } + } + } + close(fd); + } +} + +int main(int argc, char *argv[]) +{ + struct mosquitto *mosq; + int i; + time_t start; + + mosquitto_lib_init(); + + mosq = mosquitto_new("qos-test", NULL); + mosquitto_log_init(mosq, MOSQ_LOG_ALL, MOSQ_LOG_STDOUT); + mosquitto_message_callback_set(mosq, on_message); + mosquitto_publish_callback_set(mosq, on_publish); + mosquitto_subscribe_callback_set(mosq, on_subscribe); + mosquitto_disconnect_callback_set(mosq, on_disconnect); + + mosquitto_connect(mosq, "127.0.0.1", 1883, 60, true); + subs[0].topic = "qos-test/0"; + subs[0].qos = 0; + subs[0].complete = false; + subs[1].topic = "qos-test/1"; + subs[1].qos = 1; + subs[1].complete = false; + subs[2].topic = "qos-test/2"; + subs[2].qos = 2; + subs[2].complete = false; + mosquitto_subscribe(mosq, &subs[0].mid, subs[0].topic, subs[0].qos); + mosquitto_subscribe(mosq, &subs[1].mid, subs[1].topic, subs[1].qos); + mosquitto_subscribe(mosq, &subs[2].mid, subs[2].topic, subs[2].qos); + + for(i=0; i<1; i++){ + rand_publish(mosq, "qos-test/0", 0); + rand_publish(mosq, "qos-test/0", 1); + rand_publish(mosq, "qos-test/0", 2); + rand_publish(mosq, "qos-test/1", 0); + rand_publish(mosq, "qos-test/1", 1); + rand_publish(mosq, "qos-test/1", 2); + rand_publish(mosq, "qos-test/2", 0); + rand_publish(mosq, "qos-test/2", 1); + rand_publish(mosq, "qos-test/2", 2); + } + start = time(NULL); + while(!mosquitto_loop(mosq, -1)){ + if(time(NULL)-start > 20){ + mosquitto_disconnect(mosq); + } + } + + mosquitto_destroy(mosq); + + mosquitto_lib_cleanup(); + + printf("Sent messages: %d\n", sent_count); + printf("Received messages: %d\n", received_count); + return 0; +} + diff --git a/src/libs/mosquitto/test/random_client.c b/src/libs/mosquitto/test/random_client.c new file mode 100644 index 0000000..f56060c --- /dev/null +++ b/src/libs/mosquitto/test/random_client.c @@ -0,0 +1,198 @@ +/* +Copyright (c) 2009, Roger Light +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. Neither the name of mosquitto nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +typedef enum { + stStart, + stSocketOpened, + stConnSent, + stConnAckd, + stSubSent, + stSubAckd, + stPause +} stateType; + +static stateType state = stStart; + +int handle_read(mqtt3_context *context) +{ + uint8_t buf; + int rc; + + rc = read(context->sock, &buf, 1); + printf("rc: %d\n", rc); + if(rc == -1){ + printf("Error: %s\n", strerror(errno)); + return 1; + }else if(rc == 0){ + return 2; + } + + switch(buf&0xF0){ + case CONNACK: + if(mqtt3_handle_connack(context)) return 3; + state = stConnAckd; + break; + case SUBACK: + if(mqtt3_handle_suback(context)) return 3; + state = stSubAckd; + break; + case PINGREQ: + if(mqtt3_handle_pingreq(context)) return 3; + break; + case PINGRESP: + if(mqtt3_handle_pingresp(context)) return 3; + break; + case PUBACK: + if(mqtt3_handle_puback(context)) return 3; + break; + case PUBCOMP: + if(mqtt3_handle_pubcomp(context)) return 3; + break; + case PUBLISH: + if(mqtt3_handle_publish(context)) return 0; + break; + case PUBREC: + if(mqtt3_handle_pubrec(context)) return 3; + break; + case UNSUBACK: + if(mqtt3_handle_unsuback(context)) return 3; + break; + default: + printf("Unknown command: %s (%d)\n", mqtt3_command_to_string(buf&0xF0), buf&0xF0); + break; + } + return 0; +} + +void send_random(mqtt3_context *context, int length) +{ + int fd = open("/dev/urandom", O_RDONLY); + uint8_t buf[length]; + + if(fd >= 0){ + if(read(fd, buf, length) == length){ + mqtt3_write_bytes(context, buf, length); + } + close(fd); + } +} + +/* pselect loop test */ +int main(int argc, char *argv[]) +{ + struct timespec timeout; + fd_set readfds, writefds; + int fdcount; + int run = 1; + mqtt3_context context; + char id[30]; + + if(argc == 2){ + sprintf(id, "test%s", argv[1]); + }else{ + sprintf(id, "test"); + } + context.sock = mqtt3_socket_connect("127.0.0.1", 1883); + if(context.sock == -1){ + return 1; + } + state = stSocketOpened; + + while(run){ + FD_ZERO(&readfds); + FD_SET(context.sock, &readfds); + FD_ZERO(&writefds); + //FD_SET(0, &writefds); + timeout.tv_sec = 1; + timeout.tv_nsec = 0; + + fdcount = pselect(context.sock+1, &readfds, &writefds, NULL, &timeout, NULL); + if(fdcount == -1){ + fprintf(stderr, "Error in pselect: %s\n", strerror(errno)); + run = 0; + }else if(fdcount == 0){ + switch(state){ + case stSocketOpened: + mqtt3_raw_connect(&context, id, true, 2, true, "will", "aargh", 60, true); + state = stConnSent; + break; + case stConnSent: + printf("Waiting for CONNACK\n"); + break; + case stConnAckd: + // printf("CONNACK received\n"); + // mqtt3_raw_subscribe(&context, false, "a/b/c", 0); + // state = stSubSent; + send_random(&context, 100); + break; + case stSubSent: + printf("Waiting for SUBACK\n"); + break; + case stSubAckd: + printf("SUBACK received\n"); + mqtt3_raw_publish(&context, 0, 0, 0, 1, "a/b/c", 5, (uint8_t *)"Roger"); + state = stPause; + break; + case stPause: + //mqtt3_raw_disconnect(&context); + printf("Pause\n"); + break; + default: + fprintf(stderr, "Error: Unknown state\n"); + break; + } + }else{ + printf("fdcount=%d\n", fdcount); + + if(FD_ISSET(context.sock, &readfds)){ + if(handle_read(&context)){ + fprintf(stderr, "Socket closed on remote side\n"); + mqtt3_socket_close(&context); + run = 0; + } + } + } + } + return 0; +} + diff --git a/src/libs/mosquitto/test/ssl/all-ca.crt b/src/libs/mosquitto/test/ssl/all-ca.crt new file mode 100644 index 0000000..ba0d2f9 --- /dev/null +++ b/src/libs/mosquitto/test/ssl/all-ca.crt @@ -0,0 +1,75 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 1 (0x1) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=GB, ST=Derbyshire, L=Derby, O=Mosquitto Project, OU=Testing, CN=Root CA + Validity + Not Before: Aug 30 22:03:18 2013 GMT + Not After : Aug 29 22:03:18 2018 GMT + Subject: C=GB, ST=Derbyshire, O=Mosquitto Project, OU=Testing, CN=Signing CA + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + Public-Key: (1024 bit) + Modulus: + 00:a4:b5:b9:31:d8:b4:d6:de:49:c0:cc:15:3f:b8: + 50:8b:be:4a:f4:d3:94:a9:dd:53:2a:e9:df:aa:0d: + 3c:08:7b:a7:51:6d:b9:44:98:b7:8d:03:ab:67:9e: + e1:c4:23:4d:33:8d:0a:90:9f:c6:de:82:14:4c:f6: + 75:5d:a4:e1:a3:ea:fc:9b:79:dd:cb:36:20:87:a3: + 9d:eb:e6:5b:0c:53:34:73:cb:dd:a8:e4:0e:7f:f0: + 5f:8a:3c:d8:8f:01:ff:66:31:16:41:1b:e3:7a:61: + 2c:3d:44:a5:a9:dd:1d:42:e5:5a:a1:df:29:35:dc: + 91:5e:9d:82:60:0d:7a:08:db + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Subject Key Identifier: + 40:43:50:14:D1:63:7E:0B:7C:97:14:20:63:E5:8A:95:96:9F:D4:AB + X509v3 Authority Key Identifier: + keyid:28:8D:BF:F8:DE:D1:F5:BB:26:37:A4:4D:27:FD:37:91:EC:6B:0C:DD + + X509v3 Basic Constraints: + CA:TRUE + Signature Algorithm: sha1WithRSAEncryption + 8a:b1:49:b4:53:eb:bb:9d:5e:20:f4:d7:8d:b8:24:a1:28:95: + 56:72:03:ed:15:ef:f0:ff:65:b5:6e:34:cf:27:83:7b:57:40: + a7:93:61:f0:93:ff:02:b4:74:e0:43:dc:65:0c:e8:a6:20:f9: + 8c:88:82:8f:0e:8d:33:4d:ba:bb:28:ff:29:5f:a8:96:60:31: + f5:13:15:19:60:a4:00:0e:fc:a7:79:b6:10:95:0b:7b:88:75: + 03:ec:7d:94:63:9e:67:2e:2e:9c:fe:79:89:61:93:75:52:f2: + 36:48:a6:2d:c0:b2:a7:36:c2:36:50:53:b3:cd:e7:07:1d:e5: + 6a:1d +-----BEGIN CERTIFICATE----- +MIICnTCCAgagAwIBAgIBATANBgkqhkiG9w0BAQUFADByMQswCQYDVQQGEwJHQjET +MBEGA1UECAwKRGVyYnlzaGlyZTEOMAwGA1UEBwwFRGVyYnkxGjAYBgNVBAoMEU1v +c3F1aXR0byBQcm9qZWN0MRAwDgYDVQQLDAdUZXN0aW5nMRAwDgYDVQQDDAdSb290 +IENBMB4XDTEzMDgzMDIyMDMxOFoXDTE4MDgyOTIyMDMxOFowZTELMAkGA1UEBhMC +R0IxEzARBgNVBAgMCkRlcmJ5c2hpcmUxGjAYBgNVBAoMEU1vc3F1aXR0byBQcm9q +ZWN0MRAwDgYDVQQLDAdUZXN0aW5nMRMwEQYDVQQDDApTaWduaW5nIENBMIGfMA0G +CSqGSIb3DQEBAQUAA4GNADCBiQKBgQCktbkx2LTW3knAzBU/uFCLvkr005Sp3VMq +6d+qDTwIe6dRbblEmLeNA6tnnuHEI00zjQqQn8beghRM9nVdpOGj6vybed3LNiCH +o53r5lsMUzRzy92o5A5/8F+KPNiPAf9mMRZBG+N6YSw9RKWp3R1C5Vqh3yk13JFe +nYJgDXoI2wIDAQABo1AwTjAdBgNVHQ4EFgQUQENQFNFjfgt8lxQgY+WKlZaf1Ksw +HwYDVR0jBBgwFoAUKI2/+N7R9bsmN6RNJ/03kexrDN0wDAYDVR0TBAUwAwEB/zAN +BgkqhkiG9w0BAQUFAAOBgQCKsUm0U+u7nV4g9NeNuCShKJVWcgPtFe/w/2W1bjTP +J4N7V0Cnk2Hwk/8CtHTgQ9xlDOimIPmMiIKPDo0zTbq7KP8pX6iWYDH1ExUZYKQA +DvynebYQlQt7iHUD7H2UY55nLi6c/nmJYZN1UvI2SKYtwLKnNsI2UFOzzecHHeVq +HQ== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIICsjCCAhugAwIBAgIJAPTHt3psLAUTMA0GCSqGSIb3DQEBBQUAMHIxCzAJBgNV +BAYTAkdCMRMwEQYDVQQIDApEZXJieXNoaXJlMQ4wDAYDVQQHDAVEZXJieTEaMBgG +A1UECgwRTW9zcXVpdHRvIFByb2plY3QxEDAOBgNVBAsMB1Rlc3RpbmcxEDAOBgNV +BAMMB1Jvb3QgQ0EwHhcNMTMwODMwMjIwMzE2WhcNMjMwODI4MjIwMzE2WjByMQsw +CQYDVQQGEwJHQjETMBEGA1UECAwKRGVyYnlzaGlyZTEOMAwGA1UEBwwFRGVyYnkx +GjAYBgNVBAoMEU1vc3F1aXR0byBQcm9qZWN0MRAwDgYDVQQLDAdUZXN0aW5nMRAw +DgYDVQQDDAdSb290IENBMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDB3KGu +pkiSYbDAaH0ewiCb44CLsAdV5PdYgZHH0jlH8oXkNH0MU3qs7Se2UWrnPQb1VbdI +K2DpSTk+3XuWO0BOqQ+/JuRFN/omwrucyKcRNm4MQP1aY2Tm04zsP0Muy4aSyMIk +F6jxQzAmIgj8VgkQ/y/knS5tbQ2kkoWKRn1RCQIDAQABo1AwTjAdBgNVHQ4EFgQU +KI2/+N7R9bsmN6RNJ/03kexrDN0wHwYDVR0jBBgwFoAUKI2/+N7R9bsmN6RNJ/03 +kexrDN0wDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQCn2WxbxDd5ar2U +UvttJW4I+/V1h3iAQCXVDAegOGzsYp3cfIdd2oZY++Q9FhzHh8nP18D+CeC9MMu2 +H2iLULUV08cGSaDLlpo1eq2oJc5ygLOEt/XK7/aIMRwrlP/CoSrI2GPkeA8rka96 +G0WtyGRkzqBKHpt6CnseA2evP5NVcQ== +-----END CERTIFICATE----- diff --git a/src/libs/mosquitto/test/ssl/client-encrypted.crt b/src/libs/mosquitto/test/ssl/client-encrypted.crt new file mode 100644 index 0000000..8e79a7b --- /dev/null +++ b/src/libs/mosquitto/test/ssl/client-encrypted.crt @@ -0,0 +1,59 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 5 (0x5) + Signature Algorithm: sha256WithRSAEncryption + Issuer: C=GB, ST=Derbyshire, O=Mosquitto Project, OU=Testing, CN=Signing CA + Validity + Not Before: May 26 12:50:49 2014 GMT + Not After : May 25 12:50:49 2019 GMT + Subject: CN=test client encrypted + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + Public-Key: (1024 bit) + Modulus: + 00:b5:a1:d6:a3:c8:4d:a1:e8:6a:4e:cc:ae:c0:42: + 2b:4a:37:38:8e:60:2f:0d:b0:c7:30:b9:d7:f2:01: + 2a:ce:5c:1e:c1:5e:e5:d8:a3:99:03:55:9f:62:ee: + 9a:2f:5a:04:26:5a:88:79:86:cf:0c:fb:d1:7e:4e: + 41:91:0f:07:27:14:bc:0e:bd:e1:4a:b8:9d:68:52: + 42:91:d7:70:f1:94:64:3c:ad:35:5e:00:41:7d:65: + cb:a5:6d:7f:c0:92:e8:bd:8f:06:20:c3:1e:ca:dd: + a6:80:1a:53:78:3f:5a:27:6d:62:63:7a:2b:3d:15: + 24:3e:1e:ee:6d:ad:ef:32:3d + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Basic Constraints: + CA:FALSE + Netscape Comment: + OpenSSL Generated Certificate + X509v3 Subject Key Identifier: + 9D:E6:CA:2F:54:0A:F5:E4:D0:A1:44:C7:EE:D4:78:FB:75:23:C2:BF + X509v3 Authority Key Identifier: + keyid:40:43:50:14:D1:63:7E:0B:7C:97:14:20:63:E5:8A:95:96:9F:D4:AB + + Signature Algorithm: sha256WithRSAEncryption + 1e:6e:24:24:4f:ae:5d:8a:82:8f:ea:77:76:2d:2a:96:b8:f0: + b0:f1:16:b7:fc:35:ff:96:98:c6:08:aa:8f:93:2f:6a:5f:09: + e7:f2:9b:30:53:01:e1:04:8e:55:4e:fe:8e:2f:d8:14:80:35: + d0:29:03:6d:b4:bd:05:c9:fb:71:c5:7f:25:3c:4d:67:d4:7b: + 33:f5:a3:ec:cd:2e:dd:4b:a9:60:80:d2:e3:74:37:ee:b7:4c: + 22:eb:b2:e2:47:d0:42:9c:e6:74:7d:8a:d4:a9:22:5c:08:20: + 2b:97:68:3f:de:3d:6a:37:57:9e:2c:af:84:b3:74:e9:0d:36: + 40:e1 +-----BEGIN CERTIFICATE----- +MIICdjCCAd+gAwIBAgIBBTANBgkqhkiG9w0BAQsFADBlMQswCQYDVQQGEwJHQjET +MBEGA1UECAwKRGVyYnlzaGlyZTEaMBgGA1UECgwRTW9zcXVpdHRvIFByb2plY3Qx +EDAOBgNVBAsMB1Rlc3RpbmcxEzARBgNVBAMMClNpZ25pbmcgQ0EwHhcNMTQwNTI2 +MTI1MDQ5WhcNMTkwNTI1MTI1MDQ5WjAgMR4wHAYDVQQDDBV0ZXN0IGNsaWVudCBl +bmNyeXB0ZWQwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALWh1qPITaHoak7M +rsBCK0o3OI5gLw2wxzC51/IBKs5cHsFe5dijmQNVn2Lumi9aBCZaiHmGzwz70X5O +QZEPBycUvA694Uq4nWhSQpHXcPGUZDytNV4AQX1ly6Vtf8CS6L2PBiDDHsrdpoAa +U3g/WidtYmN6Kz0VJD4e7m2t7zI9AgMBAAGjezB5MAkGA1UdEwQCMAAwLAYJYIZI +AYb4QgENBB8WHU9wZW5TU0wgR2VuZXJhdGVkIENlcnRpZmljYXRlMB0GA1UdDgQW +BBSd5sovVAr15NChRMfu1Hj7dSPCvzAfBgNVHSMEGDAWgBRAQ1AU0WN+C3yXFCBj +5YqVlp/UqzANBgkqhkiG9w0BAQsFAAOBgQAebiQkT65dioKP6nd2LSqWuPCw8Ra3 +/DX/lpjGCKqPky9qXwnn8pswUwHhBI5VTv6OL9gUgDXQKQNttL0FyftxxX8lPE1n +1Hsz9aPszS7dS6lggNLjdDfut0wi67LiR9BCnOZ0fYrUqSJcCCArl2g/3j1qN1ee +LK+Es3TpDTZA4Q== +-----END CERTIFICATE----- diff --git a/src/libs/mosquitto/test/ssl/client-encrypted.key b/src/libs/mosquitto/test/ssl/client-encrypted.key new file mode 100644 index 0000000..0947ae1 --- /dev/null +++ b/src/libs/mosquitto/test/ssl/client-encrypted.key @@ -0,0 +1,18 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,A17B16521713FB61 + +B/x474t6DV07g7r7Le3Ekh/ggZ7ZM8EdwdzqiXom4ZR8eSCk4gIDpQrfn7bqzVY2 +25CG1qc4xadk4gFV8GKQeXn3/bVdqfOsTnawq6X9RylwA1HV1st2fVows2DSqskg +tHS+tAYW1ZEu1qGEM5g1zmAuE4odtMD7jzZR2JMEHHFi5O1XY31EHY25jifDjIml +370zKyPV5VxjrvJRFJq+aY7gn+jnEeVUnF6RtG11RPb101a+vyax4C5z9xO+JfNQ +JkEDdFTEejHWabz43gSju8lwgrrzlhR5Yo/AbItk5XduG9VkJX27Jezr87Cn7IqX +Xqja+DCUSFGX++nUCDWLs46Pw9VCp6kZsZt/yUa2cA/JGnmZv06aEf1tn6WsGY5/ +Fnq7K5RJTwbkpPdUckXK6OQZdRwb4uRqbj7F2OaWLYwr/jfj2innk+TQXmcxs4xz +d6greZqyKmx0LcXlI3mpcY3CqKXFazl1pVqiIDdYNMWrNucvMnWX1D5YlCCoyICl +xMtOjk3I2nVba1bdOPtHSXb+BiGkf2Y67ffNCtg2Z7YMCF2yVLVXFuuf4hoRwbOU +fTwdPcdNZeAMF86stw71hMVq0SDagPV4kTO2IuzbJAWts8sUI0xpZnqZ5AxbQF0v +uuE5Q259K+dneI7NaLpSidWW6+wslMABwuKEhGRlO6vZcpN7bqtGbRKKvHoj2ii3 +ebVhk44meh74aWYDoVbtY5HeKFqMSOo6gz6vyZ4udXKM9YpMX4xPx66BBI+8SGez +vouO1xEE1mTtxcQcSHdDFSE8aKdOX1sVwaq/S++dXBFklbwZzj0bAw== +-----END RSA PRIVATE KEY----- diff --git a/src/libs/mosquitto/test/ssl/client-expired.crt b/src/libs/mosquitto/test/ssl/client-expired.crt new file mode 100644 index 0000000..7ba84c6 --- /dev/null +++ b/src/libs/mosquitto/test/ssl/client-expired.crt @@ -0,0 +1,61 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 3 (0x3) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=GB, ST=Derbyshire, O=Mosquitto Project, OU=Testing, CN=Signing CA + Validity + Not Before: Aug 20 00:00:00 2012 GMT + Not After : Aug 21 00:00:00 2012 GMT + Subject: C=GB, ST=Nottinghamshire, L=Nottingham, O=Server, OU=Production, CN=test client expired + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + Public-Key: (1024 bit) + Modulus: + 00:9a:f0:be:71:57:51:38:4e:1a:de:35:1d:3c:37: + 66:6a:d6:5a:77:17:7d:f9:66:55:2f:c5:b8:17:04: + 3c:59:e6:8f:aa:ae:16:b9:c1:64:a1:a0:3b:ca:0c: + ed:35:e9:2a:85:e9:b6:36:65:d6:ae:62:71:d1:89: + 14:e6:3a:18:c1:0b:28:c8:77:c8:26:e2:fc:f9:51: + 76:6e:21:70:42:28:4e:32:80:9c:5e:a6:58:26:b2: + 6c:40:b9:af:97:23:c1:fe:4b:c1:7f:b6:05:d2:8e: + f5:90:34:cc:0a:28:ed:31:d7:71:5b:dc:6d:2f:ff: + 43:6b:78:1a:c5:6f:42:03:1f + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Basic Constraints: + CA:FALSE + Netscape Comment: + OpenSSL Generated Certificate + X509v3 Subject Key Identifier: + CC:E1:DD:22:B5:A1:24:98:8F:47:1E:FF:4F:AE:88:7E:E5:40:56:DB + X509v3 Authority Key Identifier: + keyid:40:43:50:14:D1:63:7E:0B:7C:97:14:20:63:E5:8A:95:96:9F:D4:AB + + Signature Algorithm: sha1WithRSAEncryption + 05:13:6e:9f:27:8b:1e:7b:3c:83:d4:be:d7:d9:3d:95:85:3e: + 3f:d2:56:05:01:fa:3c:1f:4d:f5:b1:39:2e:af:cb:fe:39:4d: + 3b:11:54:68:3e:c1:a9:e2:8b:6f:40:78:65:f5:d3:ec:04:de: + 53:a9:c1:44:64:24:46:69:66:5e:33:41:02:d1:b5:d6:77:de: + 8f:cb:cd:46:97:4a:d2:8c:af:b4:7d:fe:72:48:38:40:d9:75: + 93:2c:a1:4c:70:e3:7d:cb:92:30:93:96:0e:92:9f:05:21:6e: + 39:2d:cb:ec:83:fc:a4:34:ee:d3:ef:89:a7:11:ff:48:fa:1b: + 12:e5 +-----BEGIN CERTIFICATE----- +MIIC1zCCAkCgAwIBAgIBAzANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQGEwJHQjET +MBEGA1UECAwKRGVyYnlzaGlyZTEaMBgGA1UECgwRTW9zcXVpdHRvIFByb2plY3Qx +EDAOBgNVBAsMB1Rlc3RpbmcxEzARBgNVBAMMClNpZ25pbmcgQ0EwHhcNMTIwODIw +MDAwMDAwWhcNMTIwODIxMDAwMDAwWjCBgDELMAkGA1UEBhMCR0IxGDAWBgNVBAgM +D05vdHRpbmdoYW1zaGlyZTETMBEGA1UEBwwKTm90dGluZ2hhbTEPMA0GA1UECgwG +U2VydmVyMRMwEQYDVQQLDApQcm9kdWN0aW9uMRwwGgYDVQQDDBN0ZXN0IGNsaWVu +dCBleHBpcmVkMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCa8L5xV1E4Thre +NR08N2Zq1lp3F335ZlUvxbgXBDxZ5o+qrha5wWShoDvKDO016SqF6bY2ZdauYnHR +iRTmOhjBCyjId8gm4vz5UXZuIXBCKE4ygJxeplgmsmxAua+XI8H+S8F/tgXSjvWQ +NMwKKO0x13Fb3G0v/0NreBrFb0IDHwIDAQABo3sweTAJBgNVHRMEAjAAMCwGCWCG +SAGG+EIBDQQfFh1PcGVuU1NMIEdlbmVyYXRlZCBDZXJ0aWZpY2F0ZTAdBgNVHQ4E +FgQUzOHdIrWhJJiPRx7/T66IfuVAVtswHwYDVR0jBBgwFoAUQENQFNFjfgt8lxQg +Y+WKlZaf1KswDQYJKoZIhvcNAQEFBQADgYEABRNunyeLHns8g9S+19k9lYU+P9JW +BQH6PB9N9bE5Lq/L/jlNOxFUaD7BqeKLb0B4ZfXT7ATeU6nBRGQkRmlmXjNBAtG1 +1nfej8vNRpdK0oyvtH3+ckg4QNl1kyyhTHDjfcuSMJOWDpKfBSFuOS3L7IP8pDTu +0++JpxH/SPobEuU= +-----END CERTIFICATE----- diff --git a/src/libs/mosquitto/test/ssl/client-revoked.crt b/src/libs/mosquitto/test/ssl/client-revoked.crt new file mode 100644 index 0000000..31f2764 --- /dev/null +++ b/src/libs/mosquitto/test/ssl/client-revoked.crt @@ -0,0 +1,61 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4 (0x4) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=GB, ST=Derbyshire, O=Mosquitto Project, OU=Testing, CN=Signing CA + Validity + Not Before: Aug 30 22:03:34 2013 GMT + Not After : Aug 29 22:03:34 2018 GMT + Subject: C=GB, ST=Nottinghamshire, L=Nottingham, O=Server, OU=Production, CN=test client revoked + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + Public-Key: (1024 bit) + Modulus: + 00:ce:19:b3:0b:d1:87:97:06:48:44:84:77:65:bc: + a7:25:fd:ec:49:16:0b:73:c9:2f:7a:9c:14:16:af: + cd:d3:3e:9a:2a:18:1c:90:f1:1a:5b:6d:31:d5:fd: + 6c:04:2b:87:e2:fe:2b:a8:01:ad:00:64:50:c7:ec: + d1:4f:ec:76:7f:4c:a3:f4:98:82:bf:53:af:06:e3: + 26:87:3e:44:e3:6b:bb:b8:9c:9d:ef:a2:fe:59:3e: + bd:9a:31:c0:3c:77:a9:69:4c:3a:1a:aa:c4:3f:68: + 4c:7f:e2:05:ea:38:98:d6:be:93:27:26:fc:ac:a3: + d0:b4:9c:65:a9:10:e6:5d:b7 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Basic Constraints: + CA:FALSE + Netscape Comment: + OpenSSL Generated Certificate + X509v3 Subject Key Identifier: + 96:E5:2B:FD:A2:61:F5:32:36:92:3F:CC:BA:28:A7:E2:4C:6C:A5:91 + X509v3 Authority Key Identifier: + keyid:40:43:50:14:D1:63:7E:0B:7C:97:14:20:63:E5:8A:95:96:9F:D4:AB + + Signature Algorithm: sha1WithRSAEncryption + 22:82:2d:16:57:95:84:10:a5:5b:5b:0f:20:1a:5b:db:59:f5: + 5c:d8:42:24:72:42:80:a8:30:77:82:b2:9c:ee:3e:61:3e:af: + d0:4d:75:32:ee:cc:04:fc:d6:96:57:46:35:34:d6:7e:42:51: + 41:fa:a3:2a:a5:02:3a:50:39:a6:5c:16:a3:8f:dc:2b:45:93: + d6:a0:fd:cf:5c:db:fc:5d:ae:f7:5c:e1:2e:36:de:ee:82:38: + de:db:76:af:fa:04:f2:a6:bc:14:56:2a:66:b9:9c:dc:88:41: + 2d:e7:4e:2c:4d:a9:ae:22:ba:7c:29:65:15:48:85:e4:45:c5: + 32:21 +-----BEGIN CERTIFICATE----- +MIIC1zCCAkCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQGEwJHQjET +MBEGA1UECAwKRGVyYnlzaGlyZTEaMBgGA1UECgwRTW9zcXVpdHRvIFByb2plY3Qx +EDAOBgNVBAsMB1Rlc3RpbmcxEzARBgNVBAMMClNpZ25pbmcgQ0EwHhcNMTMwODMw +MjIwMzM0WhcNMTgwODI5MjIwMzM0WjCBgDELMAkGA1UEBhMCR0IxGDAWBgNVBAgM +D05vdHRpbmdoYW1zaGlyZTETMBEGA1UEBwwKTm90dGluZ2hhbTEPMA0GA1UECgwG +U2VydmVyMRMwEQYDVQQLDApQcm9kdWN0aW9uMRwwGgYDVQQDDBN0ZXN0IGNsaWVu +dCByZXZva2VkMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDOGbML0YeXBkhE +hHdlvKcl/exJFgtzyS96nBQWr83TPpoqGByQ8RpbbTHV/WwEK4fi/iuoAa0AZFDH +7NFP7HZ/TKP0mIK/U68G4yaHPkTja7u4nJ3vov5ZPr2aMcA8d6lpTDoaqsQ/aEx/ +4gXqOJjWvpMnJvyso9C0nGWpEOZdtwIDAQABo3sweTAJBgNVHRMEAjAAMCwGCWCG +SAGG+EIBDQQfFh1PcGVuU1NMIEdlbmVyYXRlZCBDZXJ0aWZpY2F0ZTAdBgNVHQ4E +FgQUluUr/aJh9TI2kj/Muiin4kxspZEwHwYDVR0jBBgwFoAUQENQFNFjfgt8lxQg +Y+WKlZaf1KswDQYJKoZIhvcNAQEFBQADgYEAIoItFleVhBClW1sPIBpb21n1XNhC +JHJCgKgwd4KynO4+YT6v0E11Mu7MBPzWlldGNTTWfkJRQfqjKqUCOlA5plwWo4/c +K0WT1qD9z1zb/F2u91zhLjbe7oI43tt2r/oE8qa8FFYqZrmc3IhBLedOLE2priK6 +fCllFUiF5EXFMiE= +-----END CERTIFICATE----- diff --git a/src/libs/mosquitto/test/ssl/client-revoked.csr b/src/libs/mosquitto/test/ssl/client-revoked.csr new file mode 100644 index 0000000..9c897d5 --- /dev/null +++ b/src/libs/mosquitto/test/ssl/client-revoked.csr @@ -0,0 +1,12 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIBwTCCASoCAQAwgYAxCzAJBgNVBAYTAkdCMRgwFgYDVQQIDA9Ob3R0aW5naGFt +c2hpcmUxEzARBgNVBAcMCk5vdHRpbmdoYW0xDzANBgNVBAoMBlNlcnZlcjETMBEG +A1UECwwKUHJvZHVjdGlvbjEcMBoGA1UEAwwTdGVzdCBjbGllbnQgcmV2b2tlZDCB +nzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAzhmzC9GHlwZIRIR3ZbynJf3sSRYL +c8kvepwUFq/N0z6aKhgckPEaW20x1f1sBCuH4v4rqAGtAGRQx+zRT+x2f0yj9JiC +v1OvBuMmhz5E42u7uJyd76L+WT69mjHAPHepaUw6GqrEP2hMf+IF6jiY1r6TJyb8 +rKPQtJxlqRDmXbcCAwEAAaAAMA0GCSqGSIb3DQEBBQUAA4GBABqc8X/e5amA7jA3 +cBEICNfQmwXl7KHkLN3vkoa6bm+gGkYWRQYKVk2lQ1zoWuuVSSRcHZhFAJEayQFq +xLF+lr72707ncc+yUAwnw4/TTmsDizmDcYj3GwjF+u20CSxnbSgLQfpp5xgSNluc +07XSxkm6Zeolt9GyKliqTJ1kojLY +-----END CERTIFICATE REQUEST----- diff --git a/src/libs/mosquitto/test/ssl/client-revoked.key b/src/libs/mosquitto/test/ssl/client-revoked.key new file mode 100644 index 0000000..d7cdcc7 --- /dev/null +++ b/src/libs/mosquitto/test/ssl/client-revoked.key @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICWwIBAAKBgQDOGbML0YeXBkhEhHdlvKcl/exJFgtzyS96nBQWr83TPpoqGByQ +8RpbbTHV/WwEK4fi/iuoAa0AZFDH7NFP7HZ/TKP0mIK/U68G4yaHPkTja7u4nJ3v +ov5ZPr2aMcA8d6lpTDoaqsQ/aEx/4gXqOJjWvpMnJvyso9C0nGWpEOZdtwIDAQAB +AoGAWOgPK6b8dbK5FA2Mr+98r0/lUPXYhN8hwyN3Kv41rM3RlR0HnaLUOuJU4DnN +EdNxcAMy8+udJJEho8zN0ktwJd3Mi/LHVRAZx5EwuZ1m5kSbM/n4iD5TMpDIoFD4 +hkq/sxl6EcPBjwDAoykWiYYMcatAyjlxQzs4/FxP9VsgM3kCQQDnUz0K+3zSgE12 +MNx5+mynN6Ugt9wp731sNNirkPrLkp7AG6VF5nX5j4SMqROMOfGSPZ2sKwXnyFUz +/Aj4KXWbAkEA5BWm8VB1hI1vklGdkCfEcE6lIrND62mQ1hmoF3oaxL8XwnLgzv2U +9r3jWUJWZE9AFx0VHj457oN5GpbU/xaoFQJAEr02e7ZFtVO5crKgma0EskMauFzM +lAUXlvVs+/EBsA4PmCZlLBVwRyguJ6rmr3xeKmedZz4Q+2bKKCzpmRjaswJAEJuT +AFc/d1tlGF5g/rIml5biZ1huRaH2LeDIYI0/jbvsWvhKbkgApMbG2yT9bWhn3kb7 +1qvpQ/jGxKze7YQU0QJALPCnF5/cvmnvOgsCbtLvD4yobKpeYTOUz8BESqDWzKKA +L9WyvcvAGneKR55UzIGNeo3c51WWGovlh66TMrXfmA== +-----END RSA PRIVATE KEY----- diff --git a/src/libs/mosquitto/test/ssl/client.crt b/src/libs/mosquitto/test/ssl/client.crt new file mode 100644 index 0000000..d29c516 --- /dev/null +++ b/src/libs/mosquitto/test/ssl/client.crt @@ -0,0 +1,61 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 2 (0x2) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=GB, ST=Derbyshire, O=Mosquitto Project, OU=Testing, CN=Signing CA + Validity + Not Before: Aug 30 22:03:31 2013 GMT + Not After : Aug 29 22:03:31 2018 GMT + Subject: C=GB, ST=Nottinghamshire, L=Nottingham, O=Server, OU=Production, CN=test client + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + Public-Key: (1024 bit) + Modulus: + 00:9a:f0:be:71:57:51:38:4e:1a:de:35:1d:3c:37: + 66:6a:d6:5a:77:17:7d:f9:66:55:2f:c5:b8:17:04: + 3c:59:e6:8f:aa:ae:16:b9:c1:64:a1:a0:3b:ca:0c: + ed:35:e9:2a:85:e9:b6:36:65:d6:ae:62:71:d1:89: + 14:e6:3a:18:c1:0b:28:c8:77:c8:26:e2:fc:f9:51: + 76:6e:21:70:42:28:4e:32:80:9c:5e:a6:58:26:b2: + 6c:40:b9:af:97:23:c1:fe:4b:c1:7f:b6:05:d2:8e: + f5:90:34:cc:0a:28:ed:31:d7:71:5b:dc:6d:2f:ff: + 43:6b:78:1a:c5:6f:42:03:1f + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Basic Constraints: + CA:FALSE + Netscape Comment: + OpenSSL Generated Certificate + X509v3 Subject Key Identifier: + CC:E1:DD:22:B5:A1:24:98:8F:47:1E:FF:4F:AE:88:7E:E5:40:56:DB + X509v3 Authority Key Identifier: + keyid:40:43:50:14:D1:63:7E:0B:7C:97:14:20:63:E5:8A:95:96:9F:D4:AB + + Signature Algorithm: sha1WithRSAEncryption + 0f:0c:fa:e2:7d:c6:64:58:70:0b:f1:22:1b:bc:ef:ba:60:17: + d8:29:9b:51:bf:a7:6f:cd:89:7c:bd:b7:02:b8:3c:4e:f2:22: + 24:31:3d:4a:54:4d:14:98:ce:37:14:3a:74:23:31:bd:50:53: + b2:aa:d1:9e:d0:b0:a8:1d:e2:b5:be:7e:6f:26:20:d8:b2:5b: + 5c:c4:9d:5d:f1:c3:6f:e1:3b:c1:ea:eb:18:39:79:d9:78:96: + 44:c7:88:65:68:41:05:58:40:83:99:8e:fc:11:64:1b:cf:96: + fe:62:df:68:a8:a7:cb:fe:f1:cc:bf:a6:cb:8a:74:94:14:dd: + 69:12 +-----BEGIN CERTIFICATE----- +MIICzjCCAjegAwIBAgIBAjANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQGEwJHQjET +MBEGA1UECAwKRGVyYnlzaGlyZTEaMBgGA1UECgwRTW9zcXVpdHRvIFByb2plY3Qx +EDAOBgNVBAsMB1Rlc3RpbmcxEzARBgNVBAMMClNpZ25pbmcgQ0EwHhcNMTMwODMw +MjIwMzMxWhcNMTgwODI5MjIwMzMxWjB4MQswCQYDVQQGEwJHQjEYMBYGA1UECAwP +Tm90dGluZ2hhbXNoaXJlMRMwEQYDVQQHDApOb3R0aW5naGFtMQ8wDQYDVQQKDAZT +ZXJ2ZXIxEzARBgNVBAsMClByb2R1Y3Rpb24xFDASBgNVBAMMC3Rlc3QgY2xpZW50 +MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCa8L5xV1E4ThreNR08N2Zq1lp3 +F335ZlUvxbgXBDxZ5o+qrha5wWShoDvKDO016SqF6bY2ZdauYnHRiRTmOhjBCyjI +d8gm4vz5UXZuIXBCKE4ygJxeplgmsmxAua+XI8H+S8F/tgXSjvWQNMwKKO0x13Fb +3G0v/0NreBrFb0IDHwIDAQABo3sweTAJBgNVHRMEAjAAMCwGCWCGSAGG+EIBDQQf +Fh1PcGVuU1NMIEdlbmVyYXRlZCBDZXJ0aWZpY2F0ZTAdBgNVHQ4EFgQUzOHdIrWh +JJiPRx7/T66IfuVAVtswHwYDVR0jBBgwFoAUQENQFNFjfgt8lxQgY+WKlZaf1Ksw +DQYJKoZIhvcNAQEFBQADgYEADwz64n3GZFhwC/EiG7zvumAX2CmbUb+nb82JfL23 +Arg8TvIiJDE9SlRNFJjONxQ6dCMxvVBTsqrRntCwqB3itb5+byYg2LJbXMSdXfHD +b+E7werrGDl52XiWRMeIZWhBBVhAg5mO/BFkG8+W/mLfaKiny/7xzL+my4p0lBTd +aRI= +-----END CERTIFICATE----- diff --git a/src/libs/mosquitto/test/ssl/client.csr b/src/libs/mosquitto/test/ssl/client.csr new file mode 100644 index 0000000..f3e8c62 --- /dev/null +++ b/src/libs/mosquitto/test/ssl/client.csr @@ -0,0 +1,12 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIBuDCCASECAQAweDELMAkGA1UEBhMCR0IxGDAWBgNVBAgMD05vdHRpbmdoYW1z +aGlyZTETMBEGA1UEBwwKTm90dGluZ2hhbTEPMA0GA1UECgwGU2VydmVyMRMwEQYD +VQQLDApQcm9kdWN0aW9uMRQwEgYDVQQDDAt0ZXN0IGNsaWVudDCBnzANBgkqhkiG +9w0BAQEFAAOBjQAwgYkCgYEAmvC+cVdROE4a3jUdPDdmatZadxd9+WZVL8W4FwQ8 +WeaPqq4WucFkoaA7ygztNekqhem2NmXWrmJx0YkU5joYwQsoyHfIJuL8+VF2biFw +QihOMoCcXqZYJrJsQLmvlyPB/kvBf7YF0o71kDTMCijtMddxW9xtL/9Da3gaxW9C +Ax8CAwEAAaAAMA0GCSqGSIb3DQEBBQUAA4GBAH5l2eVGP+//MBFAT+ne3/KQvoRQ +yF4xlDjvKUlK3LHjT+js/fxGQJWmXqea5jRmEZjAxNnjDcjf828jaFkaQGsoajym +ebNL5RvrPykwaXjdhHgavDiM/LCRR6bDCUYzS5akjZx2ENQ1TM7BVThOJQ2W+KPn +xdxeRH8KxKGJ3wp0 +-----END CERTIFICATE REQUEST----- diff --git a/src/libs/mosquitto/test/ssl/client.key b/src/libs/mosquitto/test/ssl/client.key new file mode 100644 index 0000000..f94f069 --- /dev/null +++ b/src/libs/mosquitto/test/ssl/client.key @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICWwIBAAKBgQCa8L5xV1E4ThreNR08N2Zq1lp3F335ZlUvxbgXBDxZ5o+qrha5 +wWShoDvKDO016SqF6bY2ZdauYnHRiRTmOhjBCyjId8gm4vz5UXZuIXBCKE4ygJxe +plgmsmxAua+XI8H+S8F/tgXSjvWQNMwKKO0x13Fb3G0v/0NreBrFb0IDHwIDAQAB +AoGAH3DpBHD2n1liJGNc2mJXmyiCVRZkTt7QPJB/ydPnN0sNLlKDdBBljlLIrziu +TjlRkrkZa7KAvQRnGmEZ55o0eW8bMRkY7vrje+dr3btPet7driZbmkOJDmzPZucV +5IObA5j4sUAd7MOkvLfrK2wtn14PEwEznzZQeZO5NiSp9fECQQDOiCUEjg4/xwG4 +OBKcT7G0zZnYlaqgus8JffC7NBp4nUi4Ol42Zkf3I6j83cUU7RwvhmpmX2IWzmjX +jGDN8EV5AkEAwA0uz7hy6+Nj+boST35r8oUF/j/wgFzqNZwuGv6zIp2EAkjG+LMZ +6hU7MRR+L1V3FYkYr7uZyAv8mSYyn0bfVwJAagcw4ea/3/QdqOJ4g3DSbVzD55Hm +d/+PfHMAXEsCb/tnMtUcOtdFiNXw0mhT3ktgFfHuu8GqDMVIw6fYpsD8GQJAVYTJ +RogM7ItqFmbMBof2C50+iPPx5Ub6p/qu8Shfnldj1BySNWaTcJAZtoY4ll1JVNai +noY8OT9VMOE4g4JsqwJAdZhegiH2/UGh2+81xQZNh8R0dBuK8SVu+FvMvK7np36Q +OEuaW2NZMujP+j/GnNJ2OfzIWIv1LNAP8JhApyCCDg== +-----END RSA PRIVATE KEY----- diff --git a/src/libs/mosquitto/test/ssl/crl.pem b/src/libs/mosquitto/test/ssl/crl.pem new file mode 100644 index 0000000..8028340 --- /dev/null +++ b/src/libs/mosquitto/test/ssl/crl.pem @@ -0,0 +1,10 @@ +-----BEGIN X509 CRL----- +MIIBVTCBvwIBATANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQGEwJHQjETMBEGA1UE +CAwKRGVyYnlzaGlyZTEaMBgGA1UECgwRTW9zcXVpdHRvIFByb2plY3QxEDAOBgNV +BAsMB1Rlc3RpbmcxEzARBgNVBAMMClNpZ25pbmcgQ0EXDTEzMDgzMDIyMDMzNVoY +DzIwOTUxMDE5MjIwMzM1WjAUMBICAQQXDTEzMDgzMDIyMDMzNVqgDjAMMAoGA1Ud +FAQDAgEBMA0GCSqGSIb3DQEBBQUAA4GBAHq0ebJDiawBBbMDohyfoFlmtCvJDUuS +79x239ublxRGg8vB9eALiru16YGL2/x3AUYDjr9Xh4cm4BvA5+F6vdebzVcSH/Xe +qxa1YZTvmuZko2Fp7kHMs1bn5diFoGCSXD4OqGFJJwtIOHLXXwtcGaAaGSLtWT8M +2+/Fn+oFhax/ +-----END X509 CRL----- diff --git a/src/libs/mosquitto/test/ssl/demoCA/crlnumber b/src/libs/mosquitto/test/ssl/demoCA/crlnumber new file mode 100644 index 0000000..eeee65e --- /dev/null +++ b/src/libs/mosquitto/test/ssl/demoCA/crlnumber @@ -0,0 +1 @@ +05 diff --git a/src/libs/mosquitto/test/ssl/demoCA/index.txt b/src/libs/mosquitto/test/ssl/demoCA/index.txt new file mode 100644 index 0000000..ced7051 --- /dev/null +++ b/src/libs/mosquitto/test/ssl/demoCA/index.txt @@ -0,0 +1 @@ +R 391118144000Z 120703155846Z CDAE0E564A2891A7 unknown /C=GB/ST=United Kingdom/L=Derby/O=Mosquitto Test Suite/OU=Broker Test/CN=localhost-client-test diff --git a/src/libs/mosquitto/test/ssl/demoCA/index.txt.attr b/src/libs/mosquitto/test/ssl/demoCA/index.txt.attr new file mode 100644 index 0000000..3a7e39e --- /dev/null +++ b/src/libs/mosquitto/test/ssl/demoCA/index.txt.attr @@ -0,0 +1 @@ +unique_subject = no diff --git a/src/libs/mosquitto/test/ssl/demoCA/serial b/src/libs/mosquitto/test/ssl/demoCA/serial new file mode 100644 index 0000000..8a0f05e --- /dev/null +++ b/src/libs/mosquitto/test/ssl/demoCA/serial @@ -0,0 +1 @@ +01 diff --git a/src/libs/mosquitto/test/ssl/gen.sh b/src/libs/mosquitto/test/ssl/gen.sh new file mode 100755 index 0000000..0d6ec45 --- /dev/null +++ b/src/libs/mosquitto/test/ssl/gen.sh @@ -0,0 +1,75 @@ +# This file generates the keys and certificates used for testing mosquitto. +# None of the keys are encrypted, so do not just use this script to generate +# files for your own use. + +rm -f *.crt *.key *.csr +for a in root signing; do + rm -rf ${a}CA/ + mkdir -p ${a}CA/newcerts + touch ${a}CA/index.txt + echo 01 > ${a}CA/serial + echo 01 > ${a}CA/crlnumber +done +rm -rf certs + +BASESUBJ="/C=GB/ST=Derbyshire/L=Derby/O=Mosquitto Project/OU=Testing" +SBASESUBJ="/C=GB/ST=Nottinghamshire/L=Nottingham/O=Server/OU=Production" +BBASESUBJ="/C=GB/ST=Nottinghamshire/L=Nottingham/O=Server/OU=Bridge" + +# The root CA +openssl genrsa -out test-root-ca.key 1024 +openssl req -new -x509 -days 3650 -key test-root-ca.key -out test-root-ca.crt -config openssl.cnf -subj "${BASESUBJ}/CN=Root CA/" + +# Another root CA that doesn't sign anything +openssl genrsa -out test-bad-root-ca.key 1024 +openssl req -new -x509 -days 3650 -key test-bad-root-ca.key -out test-bad-root-ca.crt -config openssl.cnf -subj "${BASESUBJ}/CN=Bad Root CA/" + +# This is a root CA that has the exact same details as the real root CA, but is a different key and certificate. Effectively a "fake" CA. +openssl genrsa -out test-fake-root-ca.key 1024 +openssl req -new -x509 -days 3650 -key test-fake-root-ca.key -out test-fake-root-ca.crt -config openssl.cnf -subj "${BASESUBJ}/CN=Root CA/" + +# An intermediate CA, signed by the root CA, used to sign server/client csrs. +openssl genrsa -out test-signing-ca.key 1024 +openssl req -out test-signing-ca.csr -key test-signing-ca.key -new -config openssl.cnf -subj "${BASESUBJ}/CN=Signing CA/" +openssl ca -config openssl.cnf -name CA_root -extensions v3_ca -out test-signing-ca.crt -infiles test-signing-ca.csr + +# An alternative intermediate CA, signed by the root CA, not used to sign anything. +openssl genrsa -out test-alt-ca.key 1024 +openssl req -out test-alt-ca.csr -key test-alt-ca.key -new -config openssl.cnf -subj "${BASESUBJ}/CN=Alternative Signing CA/" +openssl ca -config openssl.cnf -name CA_root -extensions v3_ca -out test-alt-ca.crt -infiles test-alt-ca.csr + +# Valid server key and certificate. +openssl genrsa -out server.key 1024 +openssl req -new -key server.key -out server.csr -config openssl.cnf -subj "${SBASESUBJ}/CN=localhost/" +openssl ca -config openssl.cnf -name CA_signing -out server.crt -infiles server.csr + +# Expired server certificate, based on the above server key. +openssl req -new -days 1 -key server.key -out server-expired.csr -config openssl.cnf -subj "${SBASESUBJ}/CN=localhost/" +openssl ca -config openssl.cnf -name CA_signing -days 1 -startdate 120820000000Z -enddate 120821000000Z -out server-expired.crt -infiles server-expired.csr + +# Valid client key and certificate. +openssl genrsa -out client.key 1024 +openssl req -new -key client.key -out client.csr -config openssl.cnf -subj "${SBASESUBJ}/CN=test client/" +openssl ca -config openssl.cnf -name CA_signing -out client.crt -infiles client.csr + +# Expired client certificate, based on the above client key. +openssl req -new -days 1 -key client.key -out client-expired.csr -config openssl.cnf -subj "${SBASESUBJ}/CN=test client expired/" +openssl ca -config openssl.cnf -name CA_signing -days 1 -startdate 120820000000Z -enddate 120821000000Z -out client-expired.crt -infiles client-expired.csr + +# Revoked client certificate, based on a new client key. +openssl genrsa -out client-revoked.key 1024 +openssl req -new -days 1 -key client-revoked.key -out client-revoked.csr -config openssl.cnf -subj "${SBASESUBJ}/CN=test client revoked/" +openssl ca -config openssl.cnf -name CA_signing -out client-revoked.crt -infiles client-revoked.csr +openssl ca -config openssl.cnf -name CA_signing -revoke client-revoked.crt +openssl ca -config openssl.cnf -name CA_signing -gencrl -out crl.pem + +# Valid client key and certificate, encrypted (use "password" as password) +openssl genrsa -des3 -out client-encrypted.key 1024 +openssl req -new -key client-encrypted.key -out client-encrypted.csr -config openssl.cnf -subj "${SBASESUBJ}/CN=test client encrypted/" +openssl ca -config openssl.cnf -name CA_signing -out client-encrypted.crt -infiles client-encrypted.csr + +cat test-signing-ca.crt test-root-ca.crt > all-ca.crt +#mkdir certs +#cp test-signing-ca.crt certs/test-signing-ca.pem +#cp test-root-ca.crt certs/test-root.ca.pem +c_rehash certs diff --git a/src/libs/mosquitto/test/ssl/openssl.cnf b/src/libs/mosquitto/test/ssl/openssl.cnf new file mode 100644 index 0000000..0612f44 --- /dev/null +++ b/src/libs/mosquitto/test/ssl/openssl.cnf @@ -0,0 +1,406 @@ +# +# OpenSSL example configuration file. +# This is mostly being used for generation of certificate requests. +# + +# This definition stops the following lines choking if HOME isn't +# defined. +HOME = . +RANDFILE = $ENV::HOME/.rnd + +# Extra OBJECT IDENTIFIER info: +#oid_file = $ENV::HOME/.oid +oid_section = new_oids + +# To use this configuration file with the "-extfile" option of the +# "openssl x509" utility, name here the section containing the +# X.509v3 extensions to use: +# extensions = +# (Alternatively, use a configuration file that has only +# X.509v3 extensions in its main [= default] section.) + +[ new_oids ] + +# We can add new OIDs in here for use by 'ca', 'req' and 'ts'. +# Add a simple OID like this: +# testoid1=1.2.3.4 +# Or use config file substitution like this: +# testoid2=${testoid1}.5.6 + +# Policies used by the TSA examples. +tsa_policy1 = 1.2.3.4.1 +tsa_policy2 = 1.2.3.4.5.6 +tsa_policy3 = 1.2.3.4.5.7 + +#################################################################### +[ ca ] +default_ca = CA_default # The default ca section + +#################################################################### +[ CA_signing ] + +dir = ./signingCA # Where everything is kept +certs = $dir/certs # Where the issued certs are kept +crl_dir = $dir/crl # Where the issued crl are kept +database = $dir/index.txt # database index file. +#unique_subject = no # Set to 'no' to allow creation of + # several ctificates with same subject. +new_certs_dir = $dir/newcerts # default place for new certs. + +certificate = test-signing-ca.crt # The CA certificate +serial = $dir/serial # The current serial number +crlnumber = $dir/crlnumber # the current crl number + # must be commented out to leave a V1 CRL +crl = $dir/crl.pem # The current CRL +private_key = test-signing-ca.key # The private key +RANDFILE = $dir/.rand # private random number file + +x509_extensions = usr_cert # The extentions to add to the cert + +# Comment out the following two lines for the "traditional" +# (and highly broken) format. +name_opt = ca_default # Subject Name options +cert_opt = ca_default # Certificate field options + +# Extension copying option: use with caution. +# copy_extensions = copy + +# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs +# so this is commented out by default to leave a V1 CRL. +# crlnumber must also be commented out to leave a V1 CRL. +# crl_extensions = crl_ext + +default_days = 1825 # how long to certify for +default_crl_days= 30000 # how long before next CRL +default_md = default # use public key default MD +preserve = no # keep passed DN ordering + +# A few difference way of specifying how similar the request should look +# For type CA, the listed attributes must be the same, and the optional +# and supplied fields are just that :-) +policy = policy_anything + +[ CA_inter ] +dir = ./interCA +certs = $dir/certs +crl_dir = $dir/crl +database = $dir/index.txt +new_certs_dir = $dir/newcerts + +certificate = test-inter-ca.crt +serial = $dir/serial +crlnumber = $dir/crlnumber +crl = $dir/crl.pem +private_key = test-inter-ca.key +RANDFILE = $dir/.rand + +#x509_extensions = v3_ca +x509_extensions = usr_cert + +name_opt = ca_default +cert_opt = ca_default + +default_days = 1825 +default_crl_days = 30 +default_md = default +preserve = no + +policy = policy_match +unique_subject = yes + +[ CA_root ] +dir = ./rootCA +certs = $dir/certs +crl_dir = $dir/crl +database = $dir/index.txt +new_certs_dir = $dir/newcerts + +certificate = test-root-ca.crt +serial = $dir/serial +crlnumber = $dir/crlnumber +crl = $dir/crl.pem +private_key = test-root-ca.key +RANDFILE = $dir/.rand + +x509_extensions = v3_ca + +name_opt = ca_default +cert_opt = ca_default + +default_days = 1825 +default_crl_days = 30 +default_md = default +preserve = no + +policy = policy_match +unique_subject = yes + +# For the CA policy +[ policy_match ] +countryName = match +stateOrProvinceName = match +organizationName = match +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +# For the 'anything' policy +# At this point in time, you must list all acceptable 'object' +# types. +[ policy_anything ] +countryName = optional +stateOrProvinceName = optional +localityName = optional +organizationName = optional +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +#################################################################### +[ req ] +default_bits = 2048 +default_keyfile = privkey.pem +distinguished_name = req_distinguished_name +attributes = req_attributes +x509_extensions = v3_ca # The extentions to add to the self signed cert + +# Passwords for private keys if not present they will be prompted for +# input_password = secret +# output_password = secret + +# This sets a mask for permitted string types. There are several options. +# default: PrintableString, T61String, BMPString. +# pkix : PrintableString, BMPString (PKIX recommendation before 2004) +# utf8only: only UTF8Strings (PKIX recommendation after 2004). +# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings). +# MASK:XXXX a literal mask value. +# WARNING: ancient versions of Netscape crash on BMPStrings or UTF8Strings. +string_mask = utf8only + +# req_extensions = v3_req # The extensions to add to a certificate request + +[ req_distinguished_name ] +countryName = Country Name (2 letter code) +countryName_default = GB +countryName_min = 2 +countryName_max = 2 + +stateOrProvinceName = State or Province Name (full name) +stateOrProvinceName_default = Derbyshire + +localityName = Locality Name (eg, city) +localityName_default = Derby + +0.organizationName = Organization Name (eg, company) +0.organizationName_default = Mosquitto Project + +# we can do this but it is not needed normally :-) +#1.organizationName = Second Organization Name (eg, company) +#1.organizationName_default = World Wide Web Pty Ltd + +organizationalUnitName = Organizational Unit Name (eg, section) +organizationalUnitName_default = Testing + +commonName = Common Name (e.g. server FQDN or YOUR name) +commonName_max = 64 + +emailAddress = Email Address +emailAddress_max = 64 + +# SET-ex3 = SET extension number 3 + +[ req_attributes ] +challengePassword = A challenge password +challengePassword_min = 4 +challengePassword_max = 20 + +unstructuredName = An optional company name + +[ usr_cert ] + +# These extensions are added when 'ca' signs a request. + +# This goes against PKIX guidelines but some CAs do it and some software +# requires this to avoid interpreting an end user certificate as a CA. + +basicConstraints=CA:FALSE + +# Here are some examples of the usage of nsCertType. If it is omitted +# the certificate can be used for anything *except* object signing. + +# This is OK for an SSL server. +# nsCertType = server + +# For an object signing certificate this would be used. +# nsCertType = objsign + +# For normal client use this is typical +# nsCertType = client, email + +# and for everything including object signing: +# nsCertType = client, email, objsign + +# This is typical in keyUsage for a client certificate. +# keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + +#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem +#nsBaseUrl +#nsRevocationUrl +#nsRenewalUrl +#nsCaPolicyUrl +#nsSslServerName + +# This is required for TSA certificates. +# extendedKeyUsage = critical,timeStamping + +[ v3_req ] + +# Extensions to add to a certificate request + +basicConstraints = CA:FALSE +keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +[ v3_ca ] + + +# Extensions for a typical CA + + +# PKIX recommendation. + +subjectKeyIdentifier=hash + +authorityKeyIdentifier=keyid:always,issuer + +# This is what PKIX recommends but some broken software chokes on critical +# extensions. +#basicConstraints = critical,CA:true +# So we do this instead. +basicConstraints = CA:true + +# Key usage: this is typical for a CA certificate. However since it will +# prevent it being used as an test self-signed certificate it is best +# left out by default. +# keyUsage = cRLSign, keyCertSign + +# Some might want this also +# nsCertType = sslCA, emailCA + +# Include email address in subject alt name: another PKIX recommendation +# subjectAltName=email:copy +# Copy issuer details +# issuerAltName=issuer:copy + +# DER hex encoding of an extension: beware experts only! +# obj=DER:02:03 +# Where 'obj' is a standard or added object +# You can even override a supported extension: +# basicConstraints= critical, DER:30:03:01:01:FF + +[ crl_ext ] + +# CRL extensions. +# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL. + +# issuerAltName=issuer:copy +authorityKeyIdentifier=keyid:always + +[ proxy_cert_ext ] +# These extensions should be added when creating a proxy certificate + +# This goes against PKIX guidelines but some CAs do it and some software +# requires this to avoid interpreting an end user certificate as a CA. + +basicConstraints=CA:FALSE + +# Here are some examples of the usage of nsCertType. If it is omitted +# the certificate can be used for anything *except* object signing. + +# This is OK for an SSL server. +# nsCertType = server + +# For an object signing certificate this would be used. +# nsCertType = objsign + +# For normal client use this is typical +# nsCertType = client, email + +# and for everything including object signing: +# nsCertType = client, email, objsign + +# This is typical in keyUsage for a client certificate. +# keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + +#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem +#nsBaseUrl +#nsRevocationUrl +#nsRenewalUrl +#nsCaPolicyUrl +#nsSslServerName + +# This really needs to be in place for it to be a proxy certificate. +proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo + +#################################################################### +[ tsa ] + +default_tsa = tsa_config1 # the default TSA section + +[ tsa_config1 ] + +# These are used by the TSA reply generation only. +dir = ./demoCA # TSA root directory +serial = $dir/tsaserial # The current serial number (mandatory) +crypto_device = builtin # OpenSSL engine to use for signing +signer_cert = $dir/tsacert.pem # The TSA signing certificate + # (optional) +certs = $dir/cacert.pem # Certificate chain to include in reply + # (optional) +signer_key = $dir/private/tsakey.pem # The TSA private key (optional) + +default_policy = tsa_policy1 # Policy if request did not specify it + # (optional) +other_policies = tsa_policy2, tsa_policy3 # acceptable policies (optional) +digests = md5, sha1 # Acceptable message digests (mandatory) +accuracy = secs:1, millisecs:500, microsecs:100 # (optional) +clock_precision_digits = 0 # number of digits after dot. (optional) +ordering = yes # Is ordering defined for timestamps? + # (optional, default: no) +tsa_name = yes # Must the TSA name be included in the reply? + # (optional, default: no) +ess_cert_id_chain = no # Must the ESS cert id chain be included? + # (optional, default: no) diff --git a/src/libs/mosquitto/test/ssl/readme.txt b/src/libs/mosquitto/test/ssl/readme.txt new file mode 100644 index 0000000..bbb6ad3 --- /dev/null +++ b/src/libs/mosquitto/test/ssl/readme.txt @@ -0,0 +1,2 @@ +This directory contains certificates and keys required for SSL testing. +The CA key has password "password". diff --git a/src/libs/mosquitto/test/ssl/rootCA/crlnumber b/src/libs/mosquitto/test/ssl/rootCA/crlnumber new file mode 100644 index 0000000..8a0f05e --- /dev/null +++ b/src/libs/mosquitto/test/ssl/rootCA/crlnumber @@ -0,0 +1 @@ +01 diff --git a/src/libs/mosquitto/test/ssl/rootCA/index.txt b/src/libs/mosquitto/test/ssl/rootCA/index.txt new file mode 100644 index 0000000..faf7b4b --- /dev/null +++ b/src/libs/mosquitto/test/ssl/rootCA/index.txt @@ -0,0 +1,2 @@ +V 180829220318Z 01 unknown /C=GB/ST=Derbyshire/O=Mosquitto Project/OU=Testing/CN=Signing CA +V 180829220327Z 02 unknown /C=GB/ST=Derbyshire/O=Mosquitto Project/OU=Testing/CN=Alternative Signing CA diff --git a/src/libs/mosquitto/test/ssl/rootCA/index.txt.attr b/src/libs/mosquitto/test/ssl/rootCA/index.txt.attr new file mode 100644 index 0000000..8f7e63a --- /dev/null +++ b/src/libs/mosquitto/test/ssl/rootCA/index.txt.attr @@ -0,0 +1 @@ +unique_subject = yes diff --git a/src/libs/mosquitto/test/ssl/rootCA/serial b/src/libs/mosquitto/test/ssl/rootCA/serial new file mode 100644 index 0000000..75016ea --- /dev/null +++ b/src/libs/mosquitto/test/ssl/rootCA/serial @@ -0,0 +1 @@ +03 diff --git a/src/libs/mosquitto/test/ssl/server-expired.crt b/src/libs/mosquitto/test/ssl/server-expired.crt new file mode 100644 index 0000000..e69de29 diff --git a/src/libs/mosquitto/test/ssl/server.crt b/src/libs/mosquitto/test/ssl/server.crt new file mode 100644 index 0000000..e4b1bd1 --- /dev/null +++ b/src/libs/mosquitto/test/ssl/server.crt @@ -0,0 +1,60 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 1 (0x1) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=GB, ST=Derbyshire, O=Mosquitto Project, OU=Testing, CN=Signing CA + Validity + Not Before: Aug 30 22:03:29 2013 GMT + Not After : Aug 29 22:03:29 2018 GMT + Subject: C=GB, ST=Nottinghamshire, L=Nottingham, O=Server, OU=Production, CN=localhost + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + Public-Key: (1024 bit) + Modulus: + 00:ab:8d:98:97:5f:97:fa:82:fa:56:01:6d:f1:6e: + ab:ef:47:a6:24:6c:1f:f1:9a:e5:80:0d:58:71:2f: + be:08:25:87:81:12:0b:a2:aa:ea:19:ee:75:8c:66: + 88:5b:35:ac:79:a6:ff:e4:e0:1b:97:19:da:8d:28: + 50:57:71:c1:ff:44:bb:be:4f:e7:e8:e7:54:bf:14: + cf:12:91:b1:0d:24:9b:24:1c:84:36:a8:99:9e:1e: + 87:18:19:f1:83:c8:ae:fd:a2:af:5e:29:ba:ac:ac: + 5b:56:1c:1c:0d:64:c3:80:d1:4c:c5:21:a8:6e:b8: + b2:f3:03:7a:1b:35:e3:9f:0f + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Basic Constraints: + CA:FALSE + Netscape Comment: + OpenSSL Generated Certificate + X509v3 Subject Key Identifier: + 07:C5:AF:95:28:37:45:F4:2C:F5:BA:6A:60:79:DC:0F:A2:46:99:72 + X509v3 Authority Key Identifier: + keyid:40:43:50:14:D1:63:7E:0B:7C:97:14:20:63:E5:8A:95:96:9F:D4:AB + + Signature Algorithm: sha1WithRSAEncryption + 90:dd:85:cb:9f:4a:89:78:2b:26:c4:82:b9:34:ea:39:5a:8b: + d9:3b:56:5c:78:df:69:ab:4a:f7:c6:10:8a:a3:9a:1a:5d:c5: + be:55:a1:36:df:36:d6:ea:3a:ec:be:99:38:9f:34:19:50:c4: + 30:6a:18:2a:42:9f:45:a0:d2:57:bf:37:47:b7:2c:b0:1e:f4: + 2e:95:1a:9a:90:2d:41:95:00:e8:23:3c:c1:99:ea:39:56:b1: + ea:8f:2d:db:e9:2c:ea:c8:5b:e7:90:8e:98:2e:ff:13:aa:73: + c2:da:fa:af:ee:aa:86:b6:1d:dc:91:4e:24:df:19:4d:aa:3f: + 1b:d7 +-----BEGIN CERTIFICATE----- +MIICzDCCAjWgAwIBAgIBATANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQGEwJHQjET +MBEGA1UECAwKRGVyYnlzaGlyZTEaMBgGA1UECgwRTW9zcXVpdHRvIFByb2plY3Qx +EDAOBgNVBAsMB1Rlc3RpbmcxEzARBgNVBAMMClNpZ25pbmcgQ0EwHhcNMTMwODMw +MjIwMzI5WhcNMTgwODI5MjIwMzI5WjB2MQswCQYDVQQGEwJHQjEYMBYGA1UECAwP +Tm90dGluZ2hhbXNoaXJlMRMwEQYDVQQHDApOb3R0aW5naGFtMQ8wDQYDVQQKDAZT +ZXJ2ZXIxEzARBgNVBAsMClByb2R1Y3Rpb24xEjAQBgNVBAMMCWxvY2FsaG9zdDCB +nzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAq42Yl1+X+oL6VgFt8W6r70emJGwf +8ZrlgA1YcS++CCWHgRILoqrqGe51jGaIWzWseab/5OAblxnajShQV3HB/0S7vk/n +6OdUvxTPEpGxDSSbJByENqiZnh6HGBnxg8iu/aKvXim6rKxbVhwcDWTDgNFMxSGo +briy8wN6GzXjnw8CAwEAAaN7MHkwCQYDVR0TBAIwADAsBglghkgBhvhCAQ0EHxYd +T3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFAfFr5UoN0X0 +LPW6amB53A+iRplyMB8GA1UdIwQYMBaAFEBDUBTRY34LfJcUIGPlipWWn9SrMA0G +CSqGSIb3DQEBBQUAA4GBAJDdhcufSol4KybEgrk06jlai9k7Vlx432mrSvfGEIqj +mhpdxb5VoTbfNtbqOuy+mTifNBlQxDBqGCpCn0Wg0le/N0e3LLAe9C6VGpqQLUGV +AOgjPMGZ6jlWseqPLdvpLOrIW+eQjpgu/xOqc8La+q/uqoa2HdyRTiTfGU2qPxvX +-----END CERTIFICATE----- diff --git a/src/libs/mosquitto/test/ssl/server.csr b/src/libs/mosquitto/test/ssl/server.csr new file mode 100644 index 0000000..d8d36b2 --- /dev/null +++ b/src/libs/mosquitto/test/ssl/server.csr @@ -0,0 +1,12 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIBtjCCAR8CAQAwdjELMAkGA1UEBhMCR0IxGDAWBgNVBAgMD05vdHRpbmdoYW1z +aGlyZTETMBEGA1UEBwwKTm90dGluZ2hhbTEPMA0GA1UECgwGU2VydmVyMRMwEQYD +VQQLDApQcm9kdWN0aW9uMRIwEAYDVQQDDAlsb2NhbGhvc3QwgZ8wDQYJKoZIhvcN +AQEBBQADgY0AMIGJAoGBAKuNmJdfl/qC+lYBbfFuq+9HpiRsH/Ga5YANWHEvvggl +h4ESC6Kq6hnudYxmiFs1rHmm/+TgG5cZ2o0oUFdxwf9Eu75P5+jnVL8UzxKRsQ0k +myQchDaomZ4ehxgZ8YPIrv2ir14puqysW1YcHA1kw4DRTMUhqG64svMDehs1458P +AgMBAAGgADANBgkqhkiG9w0BAQUFAAOBgQBKfRvwCj6N1SlwGLwJ7NWrasIYE4qP +L1+K5l0xnchICmB4r2kGMN7uoYZGf+rbufQXV6R4DrnsNQVLZGB0OIs0qH1dOIr4 +dr9+VZwSKkig+EGSkefKCsqaS9IzlosT+tsOc2AAl4xpradpVbt7Ln6GlpNfNP+x +ry3A9QBKB3zdMw== +-----END CERTIFICATE REQUEST----- diff --git a/src/libs/mosquitto/test/ssl/server.key b/src/libs/mosquitto/test/ssl/server.key new file mode 100644 index 0000000..e2d0097 --- /dev/null +++ b/src/libs/mosquitto/test/ssl/server.key @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXAIBAAKBgQCrjZiXX5f6gvpWAW3xbqvvR6YkbB/xmuWADVhxL74IJYeBEgui +quoZ7nWMZohbNax5pv/k4BuXGdqNKFBXccH/RLu+T+fo51S/FM8SkbENJJskHIQ2 +qJmeHocYGfGDyK79oq9eKbqsrFtWHBwNZMOA0UzFIahuuLLzA3obNeOfDwIDAQAB +AoGAIbMdCI9kwXc9SevZ9xVwfP6sKnd7BvEQqEj22LUyNVN5/ObYlknQ1us6+Cuk +GZa/nN4rYoCLqvEPN691qNfV7cbiIJcGEMXkBnjaM/ISh6Iv0eGNsX+D7PZOchLK +dlVg7wdzRsuOlbGkWAOPpCLL8JazHKp89+RjiPajB1IEQaECQQDaI/ZZVbiDvTBY +ZI57XJR7eSrn5WcN+LGhOv8G+3HXNDh7hcTAlvfQkZxXHIcc/SgWnkfKBEaC7P5W +T4ImQHqZAkEAyVO+tq/w6rcCK8x0LHjyQ2lmMCKCL/oJ/oWjQCEeZPyII1anZKhk +9Lkbzf432FZn8s2aOS9D5x6TjfJxgkNX5wJAK2CLVChfkJLGUk1sp8s5G3R0u7g6 +TeTuLYl1vQWzFYAk2ys2fLWIgcjytb/Ofk0484Z18A35l39Y9ADLeJ/JwQJAZf02 +r/WRZlYvk2CPubfLgrryOZBBw2w3g+jPOr2MWDxV+xD629My0Ya0vzX5tG6RWj8t +0apQC9VBirc3KXZUIQJBAJ+y07xmUN5a2wpDu3UzmeZn3HdzJO7fBAPi4h8xnLZQ +N5Qu629DQq+X/TzVv2GjBWQHePjezL0NPfch9VzKrMM= +-----END RSA PRIVATE KEY----- diff --git a/src/libs/mosquitto/test/ssl/signingCA/crlnumber b/src/libs/mosquitto/test/ssl/signingCA/crlnumber new file mode 100644 index 0000000..9e22bcb --- /dev/null +++ b/src/libs/mosquitto/test/ssl/signingCA/crlnumber @@ -0,0 +1 @@ +02 diff --git a/src/libs/mosquitto/test/ssl/signingCA/index.txt b/src/libs/mosquitto/test/ssl/signingCA/index.txt new file mode 100644 index 0000000..b122468 --- /dev/null +++ b/src/libs/mosquitto/test/ssl/signingCA/index.txt @@ -0,0 +1,5 @@ +V 180829220329Z 01 unknown /C=GB/ST=Nottinghamshire/L=Nottingham/O=Server/OU=Production/CN=localhost +V 180829220331Z 02 unknown /C=GB/ST=Nottinghamshire/L=Nottingham/O=Server/OU=Production/CN=test client +V 120821000000Z 03 unknown /C=GB/ST=Nottinghamshire/L=Nottingham/O=Server/OU=Production/CN=test client expired +R 180829220334Z 130830220335Z 04 unknown /C=GB/ST=Nottinghamshire/L=Nottingham/O=Server/OU=Production/CN=test client revoked +V 190525125049Z 05 unknown /CN=test client encrypted diff --git a/src/libs/mosquitto/test/ssl/signingCA/index.txt.attr b/src/libs/mosquitto/test/ssl/signingCA/index.txt.attr new file mode 100644 index 0000000..8f7e63a --- /dev/null +++ b/src/libs/mosquitto/test/ssl/signingCA/index.txt.attr @@ -0,0 +1 @@ +unique_subject = yes diff --git a/src/libs/mosquitto/test/ssl/signingCA/serial b/src/libs/mosquitto/test/ssl/signingCA/serial new file mode 100644 index 0000000..cd672a5 --- /dev/null +++ b/src/libs/mosquitto/test/ssl/signingCA/serial @@ -0,0 +1 @@ +06 diff --git a/src/libs/mosquitto/test/ssl/test-alt-ca.crt b/src/libs/mosquitto/test/ssl/test-alt-ca.crt new file mode 100644 index 0000000..902b3ff --- /dev/null +++ b/src/libs/mosquitto/test/ssl/test-alt-ca.crt @@ -0,0 +1,58 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 2 (0x2) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=GB, ST=Derbyshire, L=Derby, O=Mosquitto Project, OU=Testing, CN=Root CA + Validity + Not Before: Aug 30 22:03:27 2013 GMT + Not After : Aug 29 22:03:27 2018 GMT + Subject: C=GB, ST=Derbyshire, O=Mosquitto Project, OU=Testing, CN=Alternative Signing CA + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + Public-Key: (1024 bit) + Modulus: + 00:d4:04:e6:69:13:5c:2d:56:c5:0e:10:f3:5b:34: + b8:f0:db:00:4f:e4:c4:e3:2d:a4:32:0b:d6:ab:53: + a1:a8:31:e9:e8:3d:6f:fb:8d:d4:f7:09:ad:54:5c: + 47:b3:27:4a:c8:d1:95:1e:43:2a:c9:4b:b6:c2:81: + 8a:4b:84:56:f2:88:43:b9:53:5a:e2:f8:91:6b:2f: + 26:1e:87:62:73:eb:c1:45:9e:7a:97:3f:f8:db:d2: + bf:d6:44:20:a7:84:fb:11:eb:e9:cb:83:5f:74:39: + a7:95:85:4c:0f:07:c0:01:50:01:ff:34:b4:2c:8f: + 50:d8:ee:61:cd:35:40:2c:05 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Subject Key Identifier: + 9A:86:EB:20:AE:18:31:4F:8D:E2:0D:B9:FA:63:31:EA:DF:A4:8C:35 + X509v3 Authority Key Identifier: + keyid:28:8D:BF:F8:DE:D1:F5:BB:26:37:A4:4D:27:FD:37:91:EC:6B:0C:DD + + X509v3 Basic Constraints: + CA:TRUE + Signature Algorithm: sha1WithRSAEncryption + af:8e:86:a9:b0:74:70:1b:46:4f:85:3c:7d:4e:6d:a0:de:f4: + 45:e2:34:d8:3f:a1:c6:18:35:ed:1b:f2:19:88:79:b5:da:a5: + df:e8:82:a1:e8:72:c0:da:68:3c:3b:83:fa:23:2d:85:d6:97: + b0:70:02:22:39:10:40:de:e6:45:86:a8:ee:85:a9:04:f2:51: + 99:82:a2:e3:8f:b6:fd:8a:29:e8:3a:47:92:56:a6:98:cf:b7: + 39:5c:4f:83:80:a9:9f:89:f6:a6:33:95:d1:f3:5d:65:30:aa: + ad:89:40:c0:fd:d1:24:6a:f5:b2:c8:50:71:9b:01:c6:cc:8c: + af:35 +-----BEGIN CERTIFICATE----- +MIICqTCCAhKgAwIBAgIBAjANBgkqhkiG9w0BAQUFADByMQswCQYDVQQGEwJHQjET +MBEGA1UECAwKRGVyYnlzaGlyZTEOMAwGA1UEBwwFRGVyYnkxGjAYBgNVBAoMEU1v +c3F1aXR0byBQcm9qZWN0MRAwDgYDVQQLDAdUZXN0aW5nMRAwDgYDVQQDDAdSb290 +IENBMB4XDTEzMDgzMDIyMDMyN1oXDTE4MDgyOTIyMDMyN1owcTELMAkGA1UEBhMC +R0IxEzARBgNVBAgMCkRlcmJ5c2hpcmUxGjAYBgNVBAoMEU1vc3F1aXR0byBQcm9q +ZWN0MRAwDgYDVQQLDAdUZXN0aW5nMR8wHQYDVQQDDBZBbHRlcm5hdGl2ZSBTaWdu +aW5nIENBMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDUBOZpE1wtVsUOEPNb +NLjw2wBP5MTjLaQyC9arU6GoMenoPW/7jdT3Ca1UXEezJ0rI0ZUeQyrJS7bCgYpL +hFbyiEO5U1ri+JFrLyYeh2Jz68FFnnqXP/jb0r/WRCCnhPsR6+nLg190OaeVhUwP +B8ABUAH/NLQsj1DY7mHNNUAsBQIDAQABo1AwTjAdBgNVHQ4EFgQUmobrIK4YMU+N +4g25+mMx6t+kjDUwHwYDVR0jBBgwFoAUKI2/+N7R9bsmN6RNJ/03kexrDN0wDAYD +VR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQCvjoapsHRwG0ZPhTx9Tm2g3vRF +4jTYP6HGGDXtG/IZiHm12qXf6IKh6HLA2mg8O4P6Iy2F1pewcAIiORBA3uZFhqju +hakE8lGZgqLjj7b9iinoOkeSVqaYz7c5XE+DgKmfifamM5XR811lMKqtiUDA/dEk +avWyyFBxmwHGzIyvNQ== +-----END CERTIFICATE----- diff --git a/src/libs/mosquitto/test/ssl/test-alt-ca.key b/src/libs/mosquitto/test/ssl/test-alt-ca.key new file mode 100644 index 0000000..a9f2716 --- /dev/null +++ b/src/libs/mosquitto/test/ssl/test-alt-ca.key @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXQIBAAKBgQDUBOZpE1wtVsUOEPNbNLjw2wBP5MTjLaQyC9arU6GoMenoPW/7 +jdT3Ca1UXEezJ0rI0ZUeQyrJS7bCgYpLhFbyiEO5U1ri+JFrLyYeh2Jz68FFnnqX +P/jb0r/WRCCnhPsR6+nLg190OaeVhUwPB8ABUAH/NLQsj1DY7mHNNUAsBQIDAQAB +AoGACeLwm5W7hqG1LqK7tlUPCqwrp44TYESQk4TZzcNoll89eQbkYeaLN7nLy1NC +RKhgZFzhhze6lwhgzVEdEchqBW9qtznz/D2rxKfuRrlKylG7WzOIPHjIWFpkuRcm +7rTJnqMTBndH8zfGd8c+q7YVRxgA4r4UG8NMq9Mqrp0LmgECQQD7eisZIbsbgVpW +cM3zusTYcud+eky0TJhHuZWRFoIrvNk9iHEcI47J+0t4bTlXxuU9oarL3bvMmNBb +HMceWwnpAkEA19UP2MgM6yKioYJ+2pCYlNdWLR3HHAX4QY1VJk4C2+V5Sw7Ld3NP +WBOH5XYK5tfWmmt+C8g2ga1iY9BEb9cjvQJAIAGDfLZbTvvemIPQ4oVRyk6Ngf5k +xsm809wd2hJoTNLDP16fLrqj0Lcn+tLD6pUI1hg+WaYF4dtNIVt/SDDECQJBAIpi +TbrM6ZuJpYSwyu0QcQRd3R8oTJWnLjm5iLL6qdKcG10Iq2R3RpROUX/KY8sG8M4p +xbOAN5KFvOQKkRa0dnECQQDkz6bXTDHQlerNZ5B0MFFL5VrOC/n4qyVvtJ4jasK9 +3GF3X27zr4XyMfKgL+WPLJMG5nmv62MV1vhUtbvM+GqN +-----END RSA PRIVATE KEY----- diff --git a/src/libs/mosquitto/test/ssl/test-bad-root-ca.crt b/src/libs/mosquitto/test/ssl/test-bad-root-ca.crt new file mode 100644 index 0000000..e8abde9 --- /dev/null +++ b/src/libs/mosquitto/test/ssl/test-bad-root-ca.crt @@ -0,0 +1,17 @@ +-----BEGIN CERTIFICATE----- +MIICujCCAiOgAwIBAgIJANMI717jaH+OMA0GCSqGSIb3DQEBBQUAMHYxCzAJBgNV +BAYTAkdCMRMwEQYDVQQIDApEZXJieXNoaXJlMQ4wDAYDVQQHDAVEZXJieTEaMBgG +A1UECgwRTW9zcXVpdHRvIFByb2plY3QxEDAOBgNVBAsMB1Rlc3RpbmcxFDASBgNV +BAMMC0JhZCBSb290IENBMB4XDTEzMDgzMDIyMDMxN1oXDTIzMDgyODIyMDMxN1ow +djELMAkGA1UEBhMCR0IxEzARBgNVBAgMCkRlcmJ5c2hpcmUxDjAMBgNVBAcMBURl +cmJ5MRowGAYDVQQKDBFNb3NxdWl0dG8gUHJvamVjdDEQMA4GA1UECwwHVGVzdGlu +ZzEUMBIGA1UEAwwLQmFkIFJvb3QgQ0EwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJ +AoGBANgcLofeUGl23VLK8ZMgoc8/shrVQFRgBAk4/0S6+HHNZg15Nm3ECl9voC4q +fZY0g0ZCGvWA9QPim1lR7RjzWk4GCjyyJrGAPaQ96Dr1t6xq9eO3l0QyAgyuV3UX +IYhWhuf3q+HtHmZJfof1RSLjNf5JFRCxWoYKGmOP+nDVchCnAgMBAAGjUDBOMB0G +A1UdDgQWBBTeznI4RKjkyJl7N+BvRGCBZAIO2jAfBgNVHSMEGDAWgBTeznI4RKjk +yJl7N+BvRGCBZAIO2jAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4GBAKnY +Fco0xDWuqeJsGJzMiHqWVy6NAfZyMt1UJAojry+jDQXgW+zPscpwAd+24xQLPPOR +R+Cp666oAr1oksaU93Lo5hUmc+1dkaFQZspZ4H29ItZ701OptgSABNTmj2nvdQEG +t8HBAF1tzN8Vxrvy4Mtzs51E6M0oVIV+TegQgXSJ +-----END CERTIFICATE----- diff --git a/src/libs/mosquitto/test/ssl/test-bad-root-ca.key b/src/libs/mosquitto/test/ssl/test-bad-root-ca.key new file mode 100644 index 0000000..37d6483 --- /dev/null +++ b/src/libs/mosquitto/test/ssl/test-bad-root-ca.key @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICWwIBAAKBgQDYHC6H3lBpdt1SyvGTIKHPP7Ia1UBUYAQJOP9EuvhxzWYNeTZt +xApfb6AuKn2WNINGQhr1gPUD4ptZUe0Y81pOBgo8siaxgD2kPeg69besavXjt5dE +MgIMrld1FyGIVobn96vh7R5mSX6H9UUi4zX+SRUQsVqGChpjj/pw1XIQpwIDAQAB +AoGAMo+dX1JnE9WogGdUz6xRzzBC1j5QV61DJHk+V/E6kT2SA9L5JgM4vg1at5Jf +YZYVpIlwz0GFkYwh9mrRgwXkeXB4LfA31VTOw5l3NzRGyHERiFlhnf5W5pEJOaWm +gaOm7/5M5MBrQqgdNHGNhr1hgggXnSXbrhoOu8LmItcGxrECQQD5HBsQSlE+AJg7 +ayAfugbmRD+P9OyCDPx19GHL3D0FWc9xGLn5XQ9qFyGgY8vKkRUUsAn4TyDLjyBa +zWsX0chvAkEA3hZpfDtZuEtdhA2H5xq8WCH3DU4a2Qf/isB+r1PMV1xZ+FfmqmBE +d6g83NpjyWreZG9bafERCLO8mAjhQdknSQJAVref/DXCvlC6rcSG9ERv7mzHq7dZ +NZSLtgwSl0LdwyUWf4paAyKQISBYRls3MBb9PaxibBwvkG0MmE91/l665QJAfwGk +K6apZYq8HTO7v797bI9oAJTlJ666RjhVeqDaoC8xSKPERzUskp2EyOyf2mUib597 +ULfK/QYE2ZFieMzd+QJAIYYxEYBb1LJ4PPDsV5JQRmaMb6r5ElOMl0sJs878o0L+ +oOOeyn/8cbKHTtJLfm21YfNUO1TsRJZ3bOlhAPrT/g== +-----END RSA PRIVATE KEY----- diff --git a/src/libs/mosquitto/test/ssl/test-ca.srl b/src/libs/mosquitto/test/ssl/test-ca.srl new file mode 100644 index 0000000..53b5530 --- /dev/null +++ b/src/libs/mosquitto/test/ssl/test-ca.srl @@ -0,0 +1 @@ +CDAE0E564A2891AA diff --git a/src/libs/mosquitto/test/ssl/test-fake-root-ca.crt b/src/libs/mosquitto/test/ssl/test-fake-root-ca.crt new file mode 100644 index 0000000..ac128d7 --- /dev/null +++ b/src/libs/mosquitto/test/ssl/test-fake-root-ca.crt @@ -0,0 +1,17 @@ +-----BEGIN CERTIFICATE----- +MIICsjCCAhugAwIBAgIJAOOjGsO7TBrTMA0GCSqGSIb3DQEBBQUAMHIxCzAJBgNV +BAYTAkdCMRMwEQYDVQQIDApEZXJieXNoaXJlMQ4wDAYDVQQHDAVEZXJieTEaMBgG +A1UECgwRTW9zcXVpdHRvIFByb2plY3QxEDAOBgNVBAsMB1Rlc3RpbmcxEDAOBgNV +BAMMB1Jvb3QgQ0EwHhcNMTMwODMwMjIwMzE3WhcNMjMwODI4MjIwMzE3WjByMQsw +CQYDVQQGEwJHQjETMBEGA1UECAwKRGVyYnlzaGlyZTEOMAwGA1UEBwwFRGVyYnkx +GjAYBgNVBAoMEU1vc3F1aXR0byBQcm9qZWN0MRAwDgYDVQQLDAdUZXN0aW5nMRAw +DgYDVQQDDAdSb290IENBMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCih0Ux +pn7wdxufnDagJtW/mf4at3n1TKGVNirCIh8hoU+EdIqLarNt9ayWnJc3h8cHvG9F +21ic2zbM+I5L9Iavqkpb9hChLm3Ft+HIxKliXnB48Fr5r1J/rt3jIHHwE02HcPm1 +TqLKejHpjngZuMjRV/A5CVJ/iAQZy9ABRjEnRQIDAQABo1AwTjAdBgNVHQ4EFgQU +8YIrNiwFO8c97RWwfMUGokdbxU0wHwYDVR0jBBgwFoAU8YIrNiwFO8c97RWwfMUG +okdbxU0wDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQCI9QpvF3fdWO1g +W+zOZzBPspqIXqoRou8P135lNTLWHTixFAscWNdPOZn19zzmPGRKMMmtzOqoRMAx +XDORn9n7ZhyIn2kjw5nTfwrO21TsgYaUOGQSCay5GPFryAEX+1kWkqOoVbJ3F99Q +wU8uq/pogwQ/VTSQJqgUCEvN1aiyLw== +-----END CERTIFICATE----- diff --git a/src/libs/mosquitto/test/ssl/test-fake-root-ca.key b/src/libs/mosquitto/test/ssl/test-fake-root-ca.key new file mode 100644 index 0000000..f95f558 --- /dev/null +++ b/src/libs/mosquitto/test/ssl/test-fake-root-ca.key @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXgIBAAKBgQCih0Uxpn7wdxufnDagJtW/mf4at3n1TKGVNirCIh8hoU+EdIqL +arNt9ayWnJc3h8cHvG9F21ic2zbM+I5L9Iavqkpb9hChLm3Ft+HIxKliXnB48Fr5 +r1J/rt3jIHHwE02HcPm1TqLKejHpjngZuMjRV/A5CVJ/iAQZy9ABRjEnRQIDAQAB +AoGBAJiL7l4Tr8FzifHdZUgcKzOTDfV1kHq0WlT6alecPywJg+EGoaMJmy/yDvOu +NiBgyGZybt5aammPN3hbMvQHpwFqswU6H09YjNYGHgA1sqvZhgczLL6l0PM8dwTl +LDL72SQL5sxM8podBaKVqbXgbGHugvV4cG3l/YzqIednfk0BAkEA1f9L3Fx9nN6B +jUeS9QY80wk7CjAuARHxvlarmTMX08UZgmo4DgwFK0yP5mLiz+X+2xyyClOHOnU+ +8Gcw/pBAeQJBAMJt0o0VOBQW2L8lFnc6mJedTwpohAVJAb957UO4VcR+RmyARd5G +gIYQzQp7pXikOBb97X7BSFDW/dnIbbCD4i0CQQC9MAWOHIrEq4XXNCa8zjXp0KhM +eonBUm7o+lCckSoIg6DoxiUmbgQH4pj5cgTZDZmBdt4D+RJ9YPgyqtgKxdbpAkEA +hOJ6nWJ7SX+z9DBtAmBSGo2xj/OPB+21/CBhQX+jXwDPMSkal6in/vlMqnWHysSy +cURsJc4ElvvZ1BdgoNwCoQJAFceaHLS/G6PKZ+ASdjSUthYIPfXXh8eg4K082uUp +TLN1/csizBLn5Z74T0gGBDD/w1K9/xZ2cUNO+wLkNT9JJg== +-----END RSA PRIVATE KEY----- diff --git a/src/libs/mosquitto/test/ssl/test-root-ca.crt b/src/libs/mosquitto/test/ssl/test-root-ca.crt new file mode 100644 index 0000000..2050feb --- /dev/null +++ b/src/libs/mosquitto/test/ssl/test-root-ca.crt @@ -0,0 +1,17 @@ +-----BEGIN CERTIFICATE----- +MIICsjCCAhugAwIBAgIJAPTHt3psLAUTMA0GCSqGSIb3DQEBBQUAMHIxCzAJBgNV +BAYTAkdCMRMwEQYDVQQIDApEZXJieXNoaXJlMQ4wDAYDVQQHDAVEZXJieTEaMBgG +A1UECgwRTW9zcXVpdHRvIFByb2plY3QxEDAOBgNVBAsMB1Rlc3RpbmcxEDAOBgNV +BAMMB1Jvb3QgQ0EwHhcNMTMwODMwMjIwMzE2WhcNMjMwODI4MjIwMzE2WjByMQsw +CQYDVQQGEwJHQjETMBEGA1UECAwKRGVyYnlzaGlyZTEOMAwGA1UEBwwFRGVyYnkx +GjAYBgNVBAoMEU1vc3F1aXR0byBQcm9qZWN0MRAwDgYDVQQLDAdUZXN0aW5nMRAw +DgYDVQQDDAdSb290IENBMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDB3KGu +pkiSYbDAaH0ewiCb44CLsAdV5PdYgZHH0jlH8oXkNH0MU3qs7Se2UWrnPQb1VbdI +K2DpSTk+3XuWO0BOqQ+/JuRFN/omwrucyKcRNm4MQP1aY2Tm04zsP0Muy4aSyMIk +F6jxQzAmIgj8VgkQ/y/knS5tbQ2kkoWKRn1RCQIDAQABo1AwTjAdBgNVHQ4EFgQU +KI2/+N7R9bsmN6RNJ/03kexrDN0wHwYDVR0jBBgwFoAUKI2/+N7R9bsmN6RNJ/03 +kexrDN0wDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQCn2WxbxDd5ar2U +UvttJW4I+/V1h3iAQCXVDAegOGzsYp3cfIdd2oZY++Q9FhzHh8nP18D+CeC9MMu2 +H2iLULUV08cGSaDLlpo1eq2oJc5ygLOEt/XK7/aIMRwrlP/CoSrI2GPkeA8rka96 +G0WtyGRkzqBKHpt6CnseA2evP5NVcQ== +-----END CERTIFICATE----- diff --git a/src/libs/mosquitto/test/ssl/test-root-ca.key b/src/libs/mosquitto/test/ssl/test-root-ca.key new file mode 100644 index 0000000..f11dca8 --- /dev/null +++ b/src/libs/mosquitto/test/ssl/test-root-ca.key @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXAIBAAKBgQDB3KGupkiSYbDAaH0ewiCb44CLsAdV5PdYgZHH0jlH8oXkNH0M +U3qs7Se2UWrnPQb1VbdIK2DpSTk+3XuWO0BOqQ+/JuRFN/omwrucyKcRNm4MQP1a +Y2Tm04zsP0Muy4aSyMIkF6jxQzAmIgj8VgkQ/y/knS5tbQ2kkoWKRn1RCQIDAQAB +AoGAJJUM0ZdBVJYos3ZEPhyl6KTaqgFysOu/HS1+I/XwpzoFuBWLj1rlaGJsPwRI +JxCmEn+1UWIWLI+LxOgonSXbMWg+G+un/UxgsPGIPeskDuqPXe97tdnd5c1HDwNf +Sy6fzzd0PyyFHrUnxCDl5Y6oJ3O9ZJ1vfELIVyXDoXyCKi0CQQD3U1SM7YhgczaO +9EwHJI8DBeab09DZ3gUT/4zeNVeHGjRtYhZuxJWeINsj0gUJtG/yY6+CaHm3TGPj +WOToqq0/AkEAyKlD6uIJ0YuBozmSTkBUJpEaQ1xkDszgUPlxS+73IGz+LZjstbML +l1irYV5OyWMDdg/JUmnXl+8gOV+1UtFHtwJAfmDGQ3zcwuwcZM/QSZYUvaa2P8ns +XmdkkON0R9dZ8l8hiwMkE1XAXhzL3XHjwSHCUkk91ZUtHMyb/f/eeEU+YQJBAJxD +3QVlBFpwNwPDCOHxjNb/9yDwKWexOxs0Nnv42/EfkA44YlbZ2TQCtGw+QkLo3cAq +aRDKJkBG06R6mT2mhx8CQEhJ5VEhTuM88SQ9mEUup4XDc9wSPK5VK7HLR0Ip22fU +Lh1L/oAsWDIFo3zBQ9aSpiTWzAS/D7gyZPZz17dsJZk= +-----END RSA PRIVATE KEY----- diff --git a/src/libs/mosquitto/test/ssl/test-signing-ca.crt b/src/libs/mosquitto/test/ssl/test-signing-ca.crt new file mode 100644 index 0000000..43a0da0 --- /dev/null +++ b/src/libs/mosquitto/test/ssl/test-signing-ca.crt @@ -0,0 +1,58 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 1 (0x1) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=GB, ST=Derbyshire, L=Derby, O=Mosquitto Project, OU=Testing, CN=Root CA + Validity + Not Before: Aug 30 22:03:18 2013 GMT + Not After : Aug 29 22:03:18 2018 GMT + Subject: C=GB, ST=Derbyshire, O=Mosquitto Project, OU=Testing, CN=Signing CA + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + Public-Key: (1024 bit) + Modulus: + 00:a4:b5:b9:31:d8:b4:d6:de:49:c0:cc:15:3f:b8: + 50:8b:be:4a:f4:d3:94:a9:dd:53:2a:e9:df:aa:0d: + 3c:08:7b:a7:51:6d:b9:44:98:b7:8d:03:ab:67:9e: + e1:c4:23:4d:33:8d:0a:90:9f:c6:de:82:14:4c:f6: + 75:5d:a4:e1:a3:ea:fc:9b:79:dd:cb:36:20:87:a3: + 9d:eb:e6:5b:0c:53:34:73:cb:dd:a8:e4:0e:7f:f0: + 5f:8a:3c:d8:8f:01:ff:66:31:16:41:1b:e3:7a:61: + 2c:3d:44:a5:a9:dd:1d:42:e5:5a:a1:df:29:35:dc: + 91:5e:9d:82:60:0d:7a:08:db + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Subject Key Identifier: + 40:43:50:14:D1:63:7E:0B:7C:97:14:20:63:E5:8A:95:96:9F:D4:AB + X509v3 Authority Key Identifier: + keyid:28:8D:BF:F8:DE:D1:F5:BB:26:37:A4:4D:27:FD:37:91:EC:6B:0C:DD + + X509v3 Basic Constraints: + CA:TRUE + Signature Algorithm: sha1WithRSAEncryption + 8a:b1:49:b4:53:eb:bb:9d:5e:20:f4:d7:8d:b8:24:a1:28:95: + 56:72:03:ed:15:ef:f0:ff:65:b5:6e:34:cf:27:83:7b:57:40: + a7:93:61:f0:93:ff:02:b4:74:e0:43:dc:65:0c:e8:a6:20:f9: + 8c:88:82:8f:0e:8d:33:4d:ba:bb:28:ff:29:5f:a8:96:60:31: + f5:13:15:19:60:a4:00:0e:fc:a7:79:b6:10:95:0b:7b:88:75: + 03:ec:7d:94:63:9e:67:2e:2e:9c:fe:79:89:61:93:75:52:f2: + 36:48:a6:2d:c0:b2:a7:36:c2:36:50:53:b3:cd:e7:07:1d:e5: + 6a:1d +-----BEGIN CERTIFICATE----- +MIICnTCCAgagAwIBAgIBATANBgkqhkiG9w0BAQUFADByMQswCQYDVQQGEwJHQjET +MBEGA1UECAwKRGVyYnlzaGlyZTEOMAwGA1UEBwwFRGVyYnkxGjAYBgNVBAoMEU1v +c3F1aXR0byBQcm9qZWN0MRAwDgYDVQQLDAdUZXN0aW5nMRAwDgYDVQQDDAdSb290 +IENBMB4XDTEzMDgzMDIyMDMxOFoXDTE4MDgyOTIyMDMxOFowZTELMAkGA1UEBhMC +R0IxEzARBgNVBAgMCkRlcmJ5c2hpcmUxGjAYBgNVBAoMEU1vc3F1aXR0byBQcm9q +ZWN0MRAwDgYDVQQLDAdUZXN0aW5nMRMwEQYDVQQDDApTaWduaW5nIENBMIGfMA0G +CSqGSIb3DQEBAQUAA4GNADCBiQKBgQCktbkx2LTW3knAzBU/uFCLvkr005Sp3VMq +6d+qDTwIe6dRbblEmLeNA6tnnuHEI00zjQqQn8beghRM9nVdpOGj6vybed3LNiCH +o53r5lsMUzRzy92o5A5/8F+KPNiPAf9mMRZBG+N6YSw9RKWp3R1C5Vqh3yk13JFe +nYJgDXoI2wIDAQABo1AwTjAdBgNVHQ4EFgQUQENQFNFjfgt8lxQgY+WKlZaf1Ksw +HwYDVR0jBBgwFoAUKI2/+N7R9bsmN6RNJ/03kexrDN0wDAYDVR0TBAUwAwEB/zAN +BgkqhkiG9w0BAQUFAAOBgQCKsUm0U+u7nV4g9NeNuCShKJVWcgPtFe/w/2W1bjTP +J4N7V0Cnk2Hwk/8CtHTgQ9xlDOimIPmMiIKPDo0zTbq7KP8pX6iWYDH1ExUZYKQA +DvynebYQlQt7iHUD7H2UY55nLi6c/nmJYZN1UvI2SKYtwLKnNsI2UFOzzecHHeVq +HQ== +-----END CERTIFICATE----- diff --git a/src/libs/mosquitto/test/ssl/test-signing-ca.key b/src/libs/mosquitto/test/ssl/test-signing-ca.key new file mode 100644 index 0000000..7b0b0af --- /dev/null +++ b/src/libs/mosquitto/test/ssl/test-signing-ca.key @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXAIBAAKBgQCktbkx2LTW3knAzBU/uFCLvkr005Sp3VMq6d+qDTwIe6dRbblE +mLeNA6tnnuHEI00zjQqQn8beghRM9nVdpOGj6vybed3LNiCHo53r5lsMUzRzy92o +5A5/8F+KPNiPAf9mMRZBG+N6YSw9RKWp3R1C5Vqh3yk13JFenYJgDXoI2wIDAQAB +AoGAHx3Jn9Ydy93wtwCXHxOV++B2TqxOEI0kch3+yCR56+xYXrTI5GGpg3VnA0tr +wV8d7Zg+n7XfnxeZ+DQzVf6ZNc24mf7J7gM881GA1zmrUOyolpo5sgc9PW4mbyC1 +rvMsLyEGP+fP93MDJ0CYhQjxa4eGNsiLTXtHOsg9y4a1cgkCQQDXgy5ajpo4vzvK +2zMPINIk2QdRQ6jIKwnKUtBmoNsCPcwIW1yhJUc6g1C3qGpi0p7edeLlOaAfugbm +5m1M70L3AkEAw6dAg6fWTDNxt6IO6GtdJWoEJbzV7fWvRUuT6Zh/m14OwGMJvOQN +vz4U0FFZK2EbUBL+Za5enzJRyj2AUOiMPQJBAMo3pukF4aPZnIstvu01CLnWgs03 +xUl9SMR1jGKgEKA7yBUXVQVH61v2F2kdOCXeJ3/p8arQtXTPouZJ1MlZv+UCQA80 +XzIcB+5SDSNNJ8VuGoX+0CWyoBlm/2DuN6dun3QOgiz3RVl1i4/yHiH2QGy7lijJ +4RU70MSkX3DNCLzA5a0CQEb3xQSj+YJW7AHAQI8/9vSO5f2yYuyrtMy5aU8k7hKB +Sopu/XLwoWt27pl596Gur0adYnBAZMYYueY8oCN5DNU= +-----END RSA PRIVATE KEY----- diff --git a/src/libs/mosquitto/test/to-test b/src/libs/mosquitto/test/to-test new file mode 100644 index 0000000..0edb848 --- /dev/null +++ b/src/libs/mosquitto/test/to-test @@ -0,0 +1,7 @@ +message delivery 0, 1, 2 +retained message delivery +queued message delivery for 1, 2 +wills +bridge connections +password authentication +ACLs diff --git a/src/orchestra/CMakeLists.txt b/src/orchestra/CMakeLists.txt index 25574d3..4a045da 100644 --- a/src/orchestra/CMakeLists.txt +++ b/src/orchestra/CMakeLists.txt @@ -2,8 +2,9 @@ cmake_minimum_required(VERSION 3.8) set(CMAKE_CXX_STANDARD 11) -set(SOURCE_FILES main.cpp component/OrchAdderComponent.cpp component/OrchAdderComponent.h component/OrchSumComponent.cpp component/OrchSumComponent.h component/OrchStreamReaderComponent.cpp component/OrchStreamReaderComponent.h component/OrchStreamWriterComponent.cpp component/OrchStreamWriterComponent.h) +set(SOURCE_FILES main.cpp component/OrchAdderComponent.cpp component/OrchAdderComponent.h component/OrchSumComponent.cpp component/OrchSumComponent.h component/OrchStreamReaderComponent.cpp component/OrchStreamReaderComponent.h component/OrchStreamWriterComponent.cpp component/OrchStreamWriterComponent.h component/OrchMqttSourceComponent.cpp component/OrchMqttSourceComponent.h) add_executable(orchestra ${SOURCE_FILES}) -target_link_libraries(orchestra DSPatch) \ No newline at end of file +target_link_libraries(orchestra DSPatch) +target_link_libraries(orchestra mosquittopp) \ No newline at end of file diff --git a/src/orchestra/component/OrchMqttSourceComponent.cpp b/src/orchestra/component/OrchMqttSourceComponent.cpp new file mode 100644 index 0000000..327faa1 --- /dev/null +++ b/src/orchestra/component/OrchMqttSourceComponent.cpp @@ -0,0 +1,65 @@ +// +// Created by Benjamin Rozière on 23/01/2018. +// + +#include +#include "OrchMqttSourceComponent.h" + + +OrchMqttSourceComponent::OrchMqttSourceComponent(const char* host, const char* topic) : _host(host), _topic(topic) { + AddOutput_(); + + mosqpp::lib_init(); + this->connect_async(_host.c_str()); +} + +void OrchMqttSourceComponent::Process_(DspSignalBus &, DspSignalBus &out) { + if (!_started) { + this->loop_start(); + _started = true; + } + + if (!_msgQueue.empty()) { + out.SetValue(0, _msgQueue.front()); + _msgQueue.pop(); + } +} + +OrchMqttSourceComponent::~OrchMqttSourceComponent() { + this->disconnect(); + this->loop_stop(); +} + +void OrchMqttSourceComponent::on_connect(int i) { + std::cout << "[MQTT]Connected !" << std::endl; + this->subscribe(nullptr, "/#"); +} + +void OrchMqttSourceComponent::on_disconnect(int i) { + std::cout << "[MQTT]Disconected !" << std::endl; +} + +void OrchMqttSourceComponent::on_publish(int i) { + std::cout << "[MQTT]Published !" << std::endl; +} + +void OrchMqttSourceComponent::on_message(const struct mosquitto_message *message) { + std::cout << "[MQTT]Got msg !" << std::endl; + _msgQueue.push(std::string(static_cast(message->payload), static_cast(message->payloadlen))); +} + +void OrchMqttSourceComponent::on_subscribe(int i, int i1, const int *pInt) { + std::cout << "[MQTT]Subscribed !" << std::endl; +} + +void OrchMqttSourceComponent::on_unsubscribe(int i) { + std::cout << "[MQTT]Unsubscribed !" << std::endl; +} + +void OrchMqttSourceComponent::on_log(int i, const char *string) { + std::cout << "[MQTT]#" << i << ":" << string << std::endl; +} + +void OrchMqttSourceComponent::on_error() { + std::cerr << "Error in mqtt" << std::endl; +} diff --git a/src/orchestra/component/OrchMqttSourceComponent.h b/src/orchestra/component/OrchMqttSourceComponent.h new file mode 100644 index 0000000..28468a5 --- /dev/null +++ b/src/orchestra/component/OrchMqttSourceComponent.h @@ -0,0 +1,51 @@ +// +// Created by Benjamin Rozière on 23/01/2018. +// + +#ifndef ORCHESTRA_ORCHMQTTSOURCECOMPONENT_H +#define ORCHESTRA_ORCHMQTTSOURCECOMPONENT_H + + +#include +#include +#include + +class OrchMqttSourceComponent : public DspComponent, public mosqpp::mosquittopp { + + +public: + OrchMqttSourceComponent(const char* host, const char* topic); + + virtual ~OrchMqttSourceComponent(); + + /* API from mosquitto lib */ + void on_connect(int i) override; + + void on_disconnect(int i) override; + + void on_publish(int i) override; + + void on_message(const struct mosquitto_message *message) override; + + void on_subscribe(int i, int i1, const int *pInt) override; + + void on_unsubscribe(int i) override; + + void on_log(int i, const char *string) override; + + void on_error() override; + +protected: + void Process_(DspSignalBus &bus, DspSignalBus &signalBus) override; + +private: + bool _started = false; + + std::string _topic; + std::string _host; + + std::queue _msgQueue; +}; + + +#endif //ORCHESTRA_ORCHMQTTSOURCECOMPONENT_H diff --git a/src/orchestra/main.cpp b/src/orchestra/main.cpp index 4795fe5..2a94bde 100644 --- a/src/orchestra/main.cpp +++ b/src/orchestra/main.cpp @@ -9,29 +9,32 @@ #include "component/OrchSumComponent.h" #include "component/OrchStreamReaderComponent.h" #include "component/OrchStreamWriterComponent.h" +#include "component/OrchMqttSourceComponent.h" int main() { DspCircuit circuit; - OrchStreamReaderComponent reader(std::cin); + //OrchStreamReaderComponent reader(std::cin); - OrchSumComponent sum; + //OrchSumComponent sum; OrchStreamWriterComponent writer(std::cout); - circuit.AddComponent(reader, "Reader"); - circuit.AddComponent(sum, "Sum"); - circuit.AddComponent(writer, "Writer"); + OrchMqttSourceComponent mqttCmp("localhost", "/test"); + + circuit.AddComponent(mqttCmp, "mqtt"); - circuit.ConnectOutToIn(reader, 0, sum, 0); - circuit.ConnectOutToIn(sum, 0, writer, 0); + //circuit.AddComponent(reader, "Reader"); + //circuit.AddComponent(sum, "Sum"); + circuit.AddComponent(writer, "Writer"); - for (int i = 0; i < 10; i++) { - circuit.Tick(); - } + circuit.ConnectOutToIn(mqttCmp, 0, writer, 0); + //circuit.ConnectOutToIn(sum, 0, writer, 0); + circuit.StartAutoTick(); getchar(); + circuit.StopAutoTick(); DSPatch::Finalize(); From d62caf691571213f2405105bb08b6f0e69dcb01f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Rozie=CC=80re?= Date: Tue, 23 Jan 2018 14:53:32 +0100 Subject: [PATCH 04/12] Add params to MqttComponent --- src/orchestra/component/OrchMqttSourceComponent.cpp | 7 ++++--- src/orchestra/component/OrchMqttSourceComponent.h | 5 ++++- src/orchestra/main.cpp | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/orchestra/component/OrchMqttSourceComponent.cpp b/src/orchestra/component/OrchMqttSourceComponent.cpp index 327faa1..2048677 100644 --- a/src/orchestra/component/OrchMqttSourceComponent.cpp +++ b/src/orchestra/component/OrchMqttSourceComponent.cpp @@ -6,11 +6,12 @@ #include "OrchMqttSourceComponent.h" -OrchMqttSourceComponent::OrchMqttSourceComponent(const char* host, const char* topic) : _host(host), _topic(topic) { +OrchMqttSourceComponent::OrchMqttSourceComponent(const char *topic, const char *host, int port) + : _host(host), _topic(topic), _port(port) { AddOutput_(); mosqpp::lib_init(); - this->connect_async(_host.c_str()); + this->connect_async(_host.c_str(), _port); } void OrchMqttSourceComponent::Process_(DspSignalBus &, DspSignalBus &out) { @@ -32,7 +33,7 @@ OrchMqttSourceComponent::~OrchMqttSourceComponent() { void OrchMqttSourceComponent::on_connect(int i) { std::cout << "[MQTT]Connected !" << std::endl; - this->subscribe(nullptr, "/#"); + this->subscribe(nullptr, _topic.c_str()); } void OrchMqttSourceComponent::on_disconnect(int i) { diff --git a/src/orchestra/component/OrchMqttSourceComponent.h b/src/orchestra/component/OrchMqttSourceComponent.h index 28468a5..3c50af5 100644 --- a/src/orchestra/component/OrchMqttSourceComponent.h +++ b/src/orchestra/component/OrchMqttSourceComponent.h @@ -14,7 +14,9 @@ class OrchMqttSourceComponent : public DspComponent, public mosqpp::mosquittopp public: - OrchMqttSourceComponent(const char* host, const char* topic); + static const int mqttDefaultPort = 1883; + + explicit OrchMqttSourceComponent(const char *topic, const char *host="localhost", int port=mqttDefaultPort); virtual ~OrchMqttSourceComponent(); @@ -43,6 +45,7 @@ class OrchMqttSourceComponent : public DspComponent, public mosqpp::mosquittopp std::string _topic; std::string _host; + int _port; std::queue _msgQueue; }; diff --git a/src/orchestra/main.cpp b/src/orchestra/main.cpp index 2a94bde..664a713 100644 --- a/src/orchestra/main.cpp +++ b/src/orchestra/main.cpp @@ -21,7 +21,7 @@ int main() { OrchStreamWriterComponent writer(std::cout); - OrchMqttSourceComponent mqttCmp("localhost", "/test"); + OrchMqttSourceComponent mqttCmp("/test"); circuit.AddComponent(mqttCmp, "mqtt"); From 672bfd8de9b58ad879d9993264db2e83a3dbb5fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Rozie=CC=80re?= Date: Sun, 4 Mar 2018 17:38:28 +0100 Subject: [PATCH 05/12] Add midi output generation --- CMakeLists.txt | 2 +- src/orchestra/CMakeLists.txt | 12 +- .../component/OrchMidiKeyProducer.cpp | 24 + src/orchestra/component/OrchMidiKeyProducer.h | 23 + .../component/OrchMidiOutputComponent.cpp | 38 + .../component/OrchMidiOutputComponent.h | 27 + src/orchestra/main.cpp | 19 +- src/orchestra/midi/RtMidi.cpp | 2952 +++++++++++++++++ src/orchestra/midi/RtMidi.h | 794 +++++ src/orchestra/midi/midi.h | 48 + 10 files changed, 3927 insertions(+), 12 deletions(-) create mode 100644 src/orchestra/component/OrchMidiKeyProducer.cpp create mode 100644 src/orchestra/component/OrchMidiKeyProducer.h create mode 100644 src/orchestra/component/OrchMidiOutputComponent.cpp create mode 100644 src/orchestra/component/OrchMidiOutputComponent.h create mode 100644 src/orchestra/midi/RtMidi.cpp create mode 100644 src/orchestra/midi/RtMidi.h create mode 100644 src/orchestra/midi/midi.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 94d6d8a..b0ce9d4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,7 @@ ADD_SUBLIB(DSPatch) set(WITH_SRV OFF) set(WITH_TLS OFF) + add_subdirectory(src/libs/mosquitto) include_directories(src/libs/mosquitto/lib/cpp/) include_directories(src/libs/mosquitto/lib) @@ -21,4 +22,3 @@ include_directories(src/libs/mosquitto/lib) add_subdirectory(src/orchestra) add_subdirectory(src/mockDataSimulator) - diff --git a/src/orchestra/CMakeLists.txt b/src/orchestra/CMakeLists.txt index 4a045da..c43283e 100644 --- a/src/orchestra/CMakeLists.txt +++ b/src/orchestra/CMakeLists.txt @@ -1,10 +1,20 @@ cmake_minimum_required(VERSION 3.8) set(CMAKE_CXX_STANDARD 11) +set(GCC_COMPILE_FLAGS "-D__MACOSX_CORE__") -set(SOURCE_FILES main.cpp component/OrchAdderComponent.cpp component/OrchAdderComponent.h component/OrchSumComponent.cpp component/OrchSumComponent.h component/OrchStreamReaderComponent.cpp component/OrchStreamReaderComponent.h component/OrchStreamWriterComponent.cpp component/OrchStreamWriterComponent.h component/OrchMqttSourceComponent.cpp component/OrchMqttSourceComponent.h) +set(SOURCE_FILES main.cpp component/OrchAdderComponent.cpp component/OrchAdderComponent.h component/OrchSumComponent.cpp component/OrchSumComponent.h component/OrchStreamReaderComponent.cpp component/OrchStreamReaderComponent.h component/OrchStreamWriterComponent.cpp component/OrchStreamWriterComponent.h component/OrchMqttSourceComponent.cpp component/OrchMqttSourceComponent.h component/OrchMidiOutputComponent.cpp component/OrchMidiOutputComponent.h midi/midi.h component/OrchMidiKeyProducer.cpp component/OrchMidiKeyProducer.h midi/RtMidi.h midi/RtMidi.cpp) +find_library(CORE_MIDI CoreMIDI) +find_library(CORE_AUDIO CoreAudio) +find_library(CORE_FOUNDATION CoreFoundation) + +add_definitions(${GCC_COMPILE_FLAGS}) add_executable(orchestra ${SOURCE_FILES}) +target_link_libraries(orchestra ${CORE_MIDI}) +target_link_libraries(orchestra ${CORE_AUDIO}) +target_link_libraries(orchestra ${CORE_FOUNDATION}) + target_link_libraries(orchestra DSPatch) target_link_libraries(orchestra mosquittopp) \ No newline at end of file diff --git a/src/orchestra/component/OrchMidiKeyProducer.cpp b/src/orchestra/component/OrchMidiKeyProducer.cpp new file mode 100644 index 0000000..9f296d6 --- /dev/null +++ b/src/orchestra/component/OrchMidiKeyProducer.cpp @@ -0,0 +1,24 @@ +// +// Created by Benjamin Rozière on 03/03/2018. +// + +#include +#include "OrchMidiKeyProducer.h" + +OrchMidiKeyProducer::OrchMidiKeyProducer(unsigned char key) : key(key) { + AddInput_(); + AddOutput_(); +} + +void OrchMidiKeyProducer::Process_(DspSignalBus &input, DspSignalBus &output) { + + std::string val; + + if (input.GetValue(0, val)) + { + output.SetValue(0, key); + } + +} + + diff --git a/src/orchestra/component/OrchMidiKeyProducer.h b/src/orchestra/component/OrchMidiKeyProducer.h new file mode 100644 index 0000000..cc2ed74 --- /dev/null +++ b/src/orchestra/component/OrchMidiKeyProducer.h @@ -0,0 +1,23 @@ +// +// Created by Benjamin Rozière on 03/03/2018. +// + +#ifndef ORCHESTRA_ORCHMIDIKEYPRODUCER_H +#define ORCHESTRA_ORCHMIDIKEYPRODUCER_H + + +#include + +class OrchMidiKeyProducer: public DspComponent { +public: + OrchMidiKeyProducer(unsigned char key); + +protected: + void Process_(DspSignalBus &bus, DspSignalBus &signalBus) override; + +private: + unsigned char key; +}; + + +#endif //ORCHESTRA_ORCHMIDIKEYPRODUCER_H diff --git a/src/orchestra/component/OrchMidiOutputComponent.cpp b/src/orchestra/component/OrchMidiOutputComponent.cpp new file mode 100644 index 0000000..179544b --- /dev/null +++ b/src/orchestra/component/OrchMidiOutputComponent.cpp @@ -0,0 +1,38 @@ +// +// Created by Benjamin Rozière on 03/03/2018. +// + +#include "OrchMidiOutputComponent.h" +#include "../midi/midi.h" + +OrchMidiOutputKeyComponent::OrchMidiOutputKeyComponent(): midiOut(new RtMidiOut()) { + + AddInput_(); + + midiOut->openVirtualPort(); + + unsigned int nPorts = midiOut->getPortCount(); + + if (nPorts == 0) { + std::cerr << "No ports available\n"; + delete midiOut; + midiOut = nullptr; + } +} + +void OrchMidiOutputKeyComponent::Process_(DspSignalBus &input, DspSignalBus &) { + + unsigned char key; + + std::vector midiMessage; + + if (input.GetValue(0, key)) { + midiMessage.push_back(MidiCommand::NOTE_ON); + midiMessage.push_back(key); + midiMessage.push_back(90); + midiOut->sendMessage(&midiMessage); + } + +} + + diff --git a/src/orchestra/component/OrchMidiOutputComponent.h b/src/orchestra/component/OrchMidiOutputComponent.h new file mode 100644 index 0000000..6fdcd40 --- /dev/null +++ b/src/orchestra/component/OrchMidiOutputComponent.h @@ -0,0 +1,27 @@ +// +// Created by Benjamin Rozière on 03/03/2018. +// + +#ifndef ORCHESTRA_ORCHMIDIOUTPUTCOMPONENT_H +#define ORCHESTRA_ORCHMIDIOUTPUTCOMPONENT_H + +#include +#include "../midi/RtMidi.h" + +class OrchMidiOutputKeyComponent: public DspComponent { +public: + OrchMidiOutputKeyComponent(); + +protected: + void Process_(DspSignalBus &bus, DspSignalBus &signalBus) override; + +private: + RtMidiOut *midiOut; + + + + +}; + + +#endif //ORCHESTRA_ORCHMIDIOUTPUTCOMPONENT_H diff --git a/src/orchestra/main.cpp b/src/orchestra/main.cpp index 664a713..032484e 100644 --- a/src/orchestra/main.cpp +++ b/src/orchestra/main.cpp @@ -10,27 +10,26 @@ #include "component/OrchStreamReaderComponent.h" #include "component/OrchStreamWriterComponent.h" #include "component/OrchMqttSourceComponent.h" +#include "component/OrchMidiOutputComponent.h" +#include "component/OrchMidiKeyProducer.h" int main() { DspCircuit circuit; - //OrchStreamReaderComponent reader(std::cin); - - //OrchSumComponent sum; - OrchStreamWriterComponent writer(std::cout); - OrchMqttSourceComponent mqttCmp("/test"); + OrchMidiKeyProducer producer(0x34); + OrchMidiOutputKeyComponent midiOutput; circuit.AddComponent(mqttCmp, "mqtt"); - - //circuit.AddComponent(reader, "Reader"); - //circuit.AddComponent(sum, "Sum"); circuit.AddComponent(writer, "Writer"); + circuit.AddComponent(producer, "Producer"); + circuit.AddComponent(midiOutput, "Output"); - circuit.ConnectOutToIn(mqttCmp, 0, writer, 0); - //circuit.ConnectOutToIn(sum, 0, writer, 0); + circuit.ConnectOutToIn(mqttCmp, 0, producer, 0); + circuit.ConnectOutToIn(producer, 0, writer, 0); + circuit.ConnectOutToIn(producer, 0, midiOutput, 0); circuit.StartAutoTick(); getchar(); diff --git a/src/orchestra/midi/RtMidi.cpp b/src/orchestra/midi/RtMidi.cpp new file mode 100644 index 0000000..7fe2b81 --- /dev/null +++ b/src/orchestra/midi/RtMidi.cpp @@ -0,0 +1,2952 @@ +/**********************************************************************/ +/*! \class RtMidi + \brief An abstract base class for realtime MIDI input/output. + + This class implements some common functionality for the realtime + MIDI input/output subclasses RtMidiIn and RtMidiOut. + + RtMidi WWW site: http://music.mcgill.ca/~gary/rtmidi/ + + RtMidi: realtime MIDI i/o C++ classes + Copyright (c) 2003-2017 Gary P. Scavone + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + Any person wishing to distribute modifications to the Software is + asked to send the modifications to the original developer so that + they can be incorporated into the canonical version. This is, + however, not a binding provision of this license. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ +/**********************************************************************/ + +#include "RtMidi.h" +#include + +#if defined(__MACOSX_CORE__) + #if TARGET_OS_IPHONE + #define AudioGetCurrentHostTime CAHostTimeBase::GetCurrentTime + #define AudioConvertHostTimeToNanos CAHostTimeBase::ConvertToNanos + #endif +#endif + +// Default for Windows is to add an identifier to the port names; this +// flag can be undefined to disable this behaviour. +#define RTMIDI_ENSURE_UNIQUE_PORTNAMES + +//*********************************************************************// +// RtMidi Definitions +//*********************************************************************// + +RtMidi :: RtMidi() + : rtapi_(0) +{ +} + +RtMidi :: ~RtMidi() +{ + delete rtapi_; + rtapi_ = 0; +} + +std::string RtMidi :: getVersion( void ) throw() +{ + return std::string( RTMIDI_VERSION ); +} + +void RtMidi :: getCompiledApi( std::vector &apis ) throw() +{ + apis.clear(); + + // The order here will control the order of RtMidi's API search in + // the constructor. +#if defined(__MACOSX_CORE__) + apis.push_back( MACOSX_CORE ); +#endif +#if defined(__LINUX_ALSA__) + apis.push_back( LINUX_ALSA ); +#endif +#if defined(__UNIX_JACK__) + apis.push_back( UNIX_JACK ); +#endif +#if defined(__WINDOWS_MM__) + apis.push_back( WINDOWS_MM ); +#endif +#if defined(__RTMIDI_DUMMY__) + apis.push_back( RTMIDI_DUMMY ); +#endif +} + +//*********************************************************************// +// RtMidiIn Definitions +//*********************************************************************// + +void RtMidiIn :: openMidiApi( RtMidi::Api api, const std::string &clientName, unsigned int queueSizeLimit ) +{ + delete rtapi_; + rtapi_ = 0; + +#if defined(__UNIX_JACK__) + if ( api == UNIX_JACK ) + rtapi_ = new MidiInJack( clientName, queueSizeLimit ); +#endif +#if defined(__LINUX_ALSA__) + if ( api == LINUX_ALSA ) + rtapi_ = new MidiInAlsa( clientName, queueSizeLimit ); +#endif +#if defined(__WINDOWS_MM__) + if ( api == WINDOWS_MM ) + rtapi_ = new MidiInWinMM( clientName, queueSizeLimit ); +#endif +#if defined(__MACOSX_CORE__) + if ( api == MACOSX_CORE ) + rtapi_ = new MidiInCore( clientName, queueSizeLimit ); +#endif +#if defined(__RTMIDI_DUMMY__) + if ( api == RTMIDI_DUMMY ) + rtapi_ = new MidiInDummy( clientName, queueSizeLimit ); +#endif +} + +RtMidiIn :: RtMidiIn( RtMidi::Api api, const std::string &clientName, unsigned int queueSizeLimit ) + : RtMidi() +{ + if ( api != UNSPECIFIED ) { + // Attempt to open the specified API. + openMidiApi( api, clientName, queueSizeLimit ); + if ( rtapi_ ) return; + + // No compiled support for specified API value. Issue a warning + // and continue as if no API was specified. + std::cerr << "\nRtMidiIn: no compiled support for specified API argument!\n\n" << std::endl; + } + + // Iterate through the compiled APIs and return as soon as we find + // one with at least one port or we reach the end of the list. + std::vector< RtMidi::Api > apis; + getCompiledApi( apis ); + for ( unsigned int i=0; igetPortCount() ) break; + } + + if ( rtapi_ ) return; + + // It should not be possible to get here because the preprocessor + // definition __RTMIDI_DUMMY__ is automatically defined if no + // API-specific definitions are passed to the compiler. But just in + // case something weird happens, we'll throw an error. + std::string errorText = "RtMidiIn: no compiled API support found ... critical error!!"; + throw( RtMidiError( errorText, RtMidiError::UNSPECIFIED ) ); +} + +RtMidiIn :: ~RtMidiIn() throw() +{ +} + + +//*********************************************************************// +// RtMidiOut Definitions +//*********************************************************************// + +void RtMidiOut :: openMidiApi( RtMidi::Api api, const std::string &clientName ) +{ + delete rtapi_; + rtapi_ = 0; + +#if defined(__UNIX_JACK__) + if ( api == UNIX_JACK ) + rtapi_ = new MidiOutJack( clientName ); +#endif +#if defined(__LINUX_ALSA__) + if ( api == LINUX_ALSA ) + rtapi_ = new MidiOutAlsa( clientName ); +#endif +#if defined(__WINDOWS_MM__) + if ( api == WINDOWS_MM ) + rtapi_ = new MidiOutWinMM( clientName ); +#endif +#if defined(__MACOSX_CORE__) + if ( api == MACOSX_CORE ) + rtapi_ = new MidiOutCore( clientName ); +#endif +#if defined(__RTMIDI_DUMMY__) + if ( api == RTMIDI_DUMMY ) + rtapi_ = new MidiOutDummy( clientName ); +#endif +} + +RtMidiOut :: RtMidiOut( RtMidi::Api api, const std::string &clientName) +{ + if ( api != UNSPECIFIED ) { + // Attempt to open the specified API. + openMidiApi( api, clientName ); + if ( rtapi_ ) return; + + // No compiled support for specified API value. Issue a warning + // and continue as if no API was specified. + std::cerr << "\nRtMidiOut: no compiled support for specified API argument!\n\n" << std::endl; + } + + // Iterate through the compiled APIs and return as soon as we find + // one with at least one port or we reach the end of the list. + std::vector< RtMidi::Api > apis; + getCompiledApi( apis ); + for ( unsigned int i=0; igetPortCount() ) break; + } + + if ( rtapi_ ) return; + + // It should not be possible to get here because the preprocessor + // definition __RTMIDI_DUMMY__ is automatically defined if no + // API-specific definitions are passed to the compiler. But just in + // case something weird happens, we'll thrown an error. + std::string errorText = "RtMidiOut: no compiled API support found ... critical error!!"; + throw( RtMidiError( errorText, RtMidiError::UNSPECIFIED ) ); +} + +RtMidiOut :: ~RtMidiOut() throw() +{ +} + +//*********************************************************************// +// Common MidiApi Definitions +//*********************************************************************// + +MidiApi :: MidiApi( void ) + : apiData_( 0 ), connected_( false ), errorCallback_(0), firstErrorOccurred_(false), errorCallbackUserData_(0) +{ +} + +MidiApi :: ~MidiApi( void ) +{ +} + +void MidiApi :: setErrorCallback( RtMidiErrorCallback errorCallback, void *userData = 0 ) +{ + errorCallback_ = errorCallback; + errorCallbackUserData_ = userData; +} + +void MidiApi :: error( RtMidiError::Type type, std::string errorString ) +{ + if ( errorCallback_ ) { + + if ( firstErrorOccurred_ ) + return; + + firstErrorOccurred_ = true; + const std::string errorMessage = errorString; + + errorCallback_( type, errorMessage, errorCallbackUserData_); + firstErrorOccurred_ = false; + return; + } + + if ( type == RtMidiError::WARNING ) { + std::cerr << '\n' << errorString << "\n\n"; + } + else if ( type == RtMidiError::DEBUG_WARNING ) { +#if defined(__RTMIDI_DEBUG__) + std::cerr << '\n' << errorString << "\n\n"; +#endif + } + else { + std::cerr << '\n' << errorString << "\n\n"; + throw RtMidiError( errorString, type ); + } +} + +//*********************************************************************// +// Common MidiInApi Definitions +//*********************************************************************// + +MidiInApi :: MidiInApi( unsigned int queueSizeLimit ) + : MidiApi() +{ + // Allocate the MIDI queue. + inputData_.queue.ringSize = queueSizeLimit; + if ( inputData_.queue.ringSize > 0 ) + inputData_.queue.ring = new MidiMessage[ inputData_.queue.ringSize ]; +} + +MidiInApi :: ~MidiInApi( void ) +{ + // Delete the MIDI queue. + if ( inputData_.queue.ringSize > 0 ) delete [] inputData_.queue.ring; +} + +void MidiInApi :: setCallback( RtMidiIn::RtMidiCallback callback, void *userData ) +{ + if ( inputData_.usingCallback ) { + errorString_ = "MidiInApi::setCallback: a callback function is already set!"; + error( RtMidiError::WARNING, errorString_ ); + return; + } + + if ( !callback ) { + errorString_ = "RtMidiIn::setCallback: callback function value is invalid!"; + error( RtMidiError::WARNING, errorString_ ); + return; + } + + inputData_.userCallback = callback; + inputData_.userData = userData; + inputData_.usingCallback = true; +} + +void MidiInApi :: cancelCallback() +{ + if ( !inputData_.usingCallback ) { + errorString_ = "RtMidiIn::cancelCallback: no callback function was set!"; + error( RtMidiError::WARNING, errorString_ ); + return; + } + + inputData_.userCallback = 0; + inputData_.userData = 0; + inputData_.usingCallback = false; +} + +void MidiInApi :: ignoreTypes( bool midiSysex, bool midiTime, bool midiSense ) +{ + inputData_.ignoreFlags = 0; + if ( midiSysex ) inputData_.ignoreFlags = 0x01; + if ( midiTime ) inputData_.ignoreFlags |= 0x02; + if ( midiSense ) inputData_.ignoreFlags |= 0x04; +} + +double MidiInApi :: getMessage( std::vector *message ) +{ + message->clear(); + + if ( inputData_.usingCallback ) { + errorString_ = "RtMidiIn::getNextMessage: a user callback is currently set for this port."; + error( RtMidiError::WARNING, errorString_ ); + return 0.0; + } + + double timeStamp; + if (!inputData_.queue.pop(message, &timeStamp)) + return 0.0; + + return timeStamp; +} + +unsigned int MidiInApi::MidiQueue::size(unsigned int *__back, + unsigned int *__front) +{ + // Access back/front members exactly once and make stack copies for + // size calculation + unsigned int _back = back, _front = front, _size; + if (_back >= _front) + _size = _back - _front; + else + _size = ringSize - _front + _back; + + // Return copies of back/front so no new and unsynchronized accesses + // to member variables are needed. + if (__back) *__back = _back; + if (__front) *__front = _front; + return _size; +} + +// As long as we haven't reached our queue size limit, push the message. +bool MidiInApi::MidiQueue::push(const MidiInApi::MidiMessage& msg) +{ + // Local stack copies of front/back + unsigned int _back, _front, _size; + + // Get back/front indexes exactly once and calculate current size + _size = size(&_back, &_front); + + if ( _size < ringSize-1 ) + { + ring[_back] = msg; + back = (back+1)%ringSize; + return true; + } + + return false; +} + +bool MidiInApi::MidiQueue::pop(std::vector *msg, double* timeStamp) +{ + // Local stack copies of front/back + unsigned int _back, _front, _size; + + // Get back/front indexes exactly once and calculate current size + _size = size(&_back, &_front); + + if (_size == 0) + return false; + + // Copy queued message to the vector pointer argument and then "pop" it. + msg->assign( ring[_front].bytes.begin(), ring[_front].bytes.end() ); + *timeStamp = ring[_front].timeStamp; + + // Update front + front = (front+1)%ringSize; + return true; +} + +//*********************************************************************// +// Common MidiOutApi Definitions +//*********************************************************************// + +MidiOutApi :: MidiOutApi( void ) + : MidiApi() +{ +} + +MidiOutApi :: ~MidiOutApi( void ) +{ +} + +// *************************************************** // +// +// OS/API-specific methods. +// +// *************************************************** // + +#if defined(__MACOSX_CORE__) + +// The CoreMIDI API is based on the use of a callback function for +// MIDI input. We convert the system specific time stamps to delta +// time values. + +// OS-X CoreMIDI header files. +#include +#include +#include + +// A structure to hold variables related to the CoreMIDI API +// implementation. +struct CoreMidiData { + MIDIClientRef client; + MIDIPortRef port; + MIDIEndpointRef endpoint; + MIDIEndpointRef destinationId; + unsigned long long lastTime; + MIDISysexSendRequest sysexreq; +}; + +//*********************************************************************// +// API: OS-X +// Class Definitions: MidiInCore +//*********************************************************************// + +static void midiInputCallback( const MIDIPacketList *list, void *procRef, void */*srcRef*/ ) +{ + MidiInApi::RtMidiInData *data = static_cast (procRef); + CoreMidiData *apiData = static_cast (data->apiData); + + unsigned char status; + unsigned short nBytes, iByte, size; + unsigned long long time; + + bool& continueSysex = data->continueSysex; + MidiInApi::MidiMessage& message = data->message; + + const MIDIPacket *packet = &list->packet[0]; + for ( unsigned int i=0; inumPackets; ++i ) { + + // My interpretation of the CoreMIDI documentation: all message + // types, except sysex, are complete within a packet and there may + // be several of them in a single packet. Sysex messages can be + // broken across multiple packets and PacketLists but are bundled + // alone within each packet (these packets do not contain other + // message types). If sysex messages are split across multiple + // MIDIPacketLists, they must be handled by multiple calls to this + // function. + + nBytes = packet->length; + if ( nBytes == 0 ) continue; + + // Calculate time stamp. + + if ( data->firstMessage ) { + message.timeStamp = 0.0; + data->firstMessage = false; + } + else { + time = packet->timeStamp; + if ( time == 0 ) { // this happens when receiving asynchronous sysex messages + time = AudioGetCurrentHostTime(); + } + time -= apiData->lastTime; + time = AudioConvertHostTimeToNanos( time ); + if ( !continueSysex ) + message.timeStamp = time * 0.000000001; + } + apiData->lastTime = packet->timeStamp; + if ( apiData->lastTime == 0 ) { // this happens when receiving asynchronous sysex messages + apiData->lastTime = AudioGetCurrentHostTime(); + } + //std::cout << "TimeStamp = " << packet->timeStamp << std::endl; + + iByte = 0; + if ( continueSysex ) { + // We have a continuing, segmented sysex message. + if ( !( data->ignoreFlags & 0x01 ) ) { + // If we're not ignoring sysex messages, copy the entire packet. + for ( unsigned int j=0; jdata[j] ); + } + continueSysex = packet->data[nBytes-1] != 0xF7; + + if ( !( data->ignoreFlags & 0x01 ) && !continueSysex ) { + // If not a continuing sysex message, invoke the user callback function or queue the message. + if ( data->usingCallback ) { + RtMidiIn::RtMidiCallback callback = (RtMidiIn::RtMidiCallback) data->userCallback; + callback( message.timeStamp, &message.bytes, data->userData ); + } + else { + // As long as we haven't reached our queue size limit, push the message. + if (!data->queue.push(message)) + std::cerr << "\nMidiInCore: message queue limit reached!!\n\n"; + } + message.bytes.clear(); + } + } + else { + while ( iByte < nBytes ) { + size = 0; + // We are expecting that the next byte in the packet is a status byte. + status = packet->data[iByte]; + if ( !(status & 0x80) ) break; + // Determine the number of bytes in the MIDI message. + if ( status < 0xC0 ) size = 3; + else if ( status < 0xE0 ) size = 2; + else if ( status < 0xF0 ) size = 3; + else if ( status == 0xF0 ) { + // A MIDI sysex + if ( data->ignoreFlags & 0x01 ) { + size = 0; + iByte = nBytes; + } + else size = nBytes - iByte; + continueSysex = packet->data[nBytes-1] != 0xF7; + } + else if ( status == 0xF1 ) { + // A MIDI time code message + if ( data->ignoreFlags & 0x02 ) { + size = 0; + iByte += 2; + } + else size = 2; + } + else if ( status == 0xF2 ) size = 3; + else if ( status == 0xF3 ) size = 2; + else if ( status == 0xF8 && ( data->ignoreFlags & 0x02 ) ) { + // A MIDI timing tick message and we're ignoring it. + size = 0; + iByte += 1; + } + else if ( status == 0xFE && ( data->ignoreFlags & 0x04 ) ) { + // A MIDI active sensing message and we're ignoring it. + size = 0; + iByte += 1; + } + else size = 1; + + // Copy the MIDI data to our vector. + if ( size ) { + message.bytes.assign( &packet->data[iByte], &packet->data[iByte+size] ); + if ( !continueSysex ) { + // If not a continuing sysex message, invoke the user callback function or queue the message. + if ( data->usingCallback ) { + RtMidiIn::RtMidiCallback callback = (RtMidiIn::RtMidiCallback) data->userCallback; + callback( message.timeStamp, &message.bytes, data->userData ); + } + else { + // As long as we haven't reached our queue size limit, push the message. + if (!data->queue.push(message)) + std::cerr << "\nMidiInCore: message queue limit reached!!\n\n"; + } + message.bytes.clear(); + } + iByte += size; + } + } + } + packet = MIDIPacketNext(packet); + } +} + +MidiInCore :: MidiInCore( const std::string &clientName, unsigned int queueSizeLimit ) : MidiInApi( queueSizeLimit ) +{ + initialize( clientName ); +} + +MidiInCore :: ~MidiInCore( void ) +{ + // Close a connection if it exists. + closePort(); + + // Cleanup. + CoreMidiData *data = static_cast (apiData_); + MIDIClientDispose( data->client ); + if ( data->endpoint ) MIDIEndpointDispose( data->endpoint ); + delete data; +} + +void MidiInCore :: initialize( const std::string& clientName ) +{ + // Set up our client. + MIDIClientRef client; + CFStringRef name = CFStringCreateWithCString( NULL, clientName.c_str(), kCFStringEncodingASCII ); + OSStatus result = MIDIClientCreate(name, NULL, NULL, &client ); + if ( result != noErr ) { + std::ostringstream ost; + ost << "MidiInCore::initialize: error creating OS-X MIDI client object (" << result << ")."; + errorString_ = ost.str(); + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; + } + + // Save our api-specific connection information. + CoreMidiData *data = (CoreMidiData *) new CoreMidiData; + data->client = client; + data->endpoint = 0; + apiData_ = (void *) data; + inputData_.apiData = (void *) data; + CFRelease(name); +} + +void MidiInCore :: openPort( unsigned int portNumber, const std::string &portName ) +{ + if ( connected_ ) { + errorString_ = "MidiInCore::openPort: a valid connection already exists!"; + error( RtMidiError::WARNING, errorString_ ); + return; + } + + CFRunLoopRunInMode( kCFRunLoopDefaultMode, 0, false ); + unsigned int nSrc = MIDIGetNumberOfSources(); + if (nSrc < 1) { + errorString_ = "MidiInCore::openPort: no MIDI input sources found!"; + error( RtMidiError::NO_DEVICES_FOUND, errorString_ ); + return; + } + + if ( portNumber >= nSrc ) { + std::ostringstream ost; + ost << "MidiInCore::openPort: the 'portNumber' argument (" << portNumber << ") is invalid."; + errorString_ = ost.str(); + error( RtMidiError::INVALID_PARAMETER, errorString_ ); + return; + } + + MIDIPortRef port; + CoreMidiData *data = static_cast (apiData_); + OSStatus result = MIDIInputPortCreate( data->client, + CFStringCreateWithCString( NULL, portName.c_str(), kCFStringEncodingASCII ), + midiInputCallback, (void *)&inputData_, &port ); + if ( result != noErr ) { + MIDIClientDispose( data->client ); + errorString_ = "MidiInCore::openPort: error creating OS-X MIDI input port."; + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; + } + + // Get the desired input source identifier. + MIDIEndpointRef endpoint = MIDIGetSource( portNumber ); + if ( endpoint == 0 ) { + MIDIPortDispose( port ); + MIDIClientDispose( data->client ); + errorString_ = "MidiInCore::openPort: error getting MIDI input source reference."; + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; + } + + // Make the connection. + result = MIDIPortConnectSource( port, endpoint, NULL ); + if ( result != noErr ) { + MIDIPortDispose( port ); + MIDIClientDispose( data->client ); + errorString_ = "MidiInCore::openPort: error connecting OS-X MIDI input port."; + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; + } + + // Save our api-specific port information. + data->port = port; + + connected_ = true; +} + +void MidiInCore :: openVirtualPort( const std::string &portName ) +{ + CoreMidiData *data = static_cast (apiData_); + + // Create a virtual MIDI input destination. + MIDIEndpointRef endpoint; + OSStatus result = MIDIDestinationCreate( data->client, + CFStringCreateWithCString( NULL, portName.c_str(), kCFStringEncodingASCII ), + midiInputCallback, (void *)&inputData_, &endpoint ); + if ( result != noErr ) { + errorString_ = "MidiInCore::openVirtualPort: error creating virtual OS-X MIDI destination."; + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; + } + + // Save our api-specific connection information. + data->endpoint = endpoint; +} + +void MidiInCore :: closePort( void ) +{ + CoreMidiData *data = static_cast (apiData_); + + if ( data->endpoint ) { + MIDIEndpointDispose( data->endpoint ); + data->endpoint = 0; + } + + if ( data->port ) { + MIDIPortDispose( data->port ); + data->port = 0; + } + + connected_ = false; +} + +unsigned int MidiInCore :: getPortCount() +{ + CFRunLoopRunInMode( kCFRunLoopDefaultMode, 0, false ); + return MIDIGetNumberOfSources(); +} + +// This function was submitted by Douglas Casey Tucker and apparently +// derived largely from PortMidi. +CFStringRef EndpointName( MIDIEndpointRef endpoint, bool isExternal ) +{ + CFMutableStringRef result = CFStringCreateMutable( NULL, 0 ); + CFStringRef str; + + // Begin with the endpoint's name. + str = NULL; + MIDIObjectGetStringProperty( endpoint, kMIDIPropertyName, &str ); + if ( str != NULL ) { + CFStringAppend( result, str ); + CFRelease( str ); + } + + MIDIEntityRef entity = 0; + MIDIEndpointGetEntity( endpoint, &entity ); + if ( entity == 0 ) + // probably virtual + return result; + + if ( CFStringGetLength( result ) == 0 ) { + // endpoint name has zero length -- try the entity + str = NULL; + MIDIObjectGetStringProperty( entity, kMIDIPropertyName, &str ); + if ( str != NULL ) { + CFStringAppend( result, str ); + CFRelease( str ); + } + } + // now consider the device's name + MIDIDeviceRef device = 0; + MIDIEntityGetDevice( entity, &device ); + if ( device == 0 ) + return result; + + str = NULL; + MIDIObjectGetStringProperty( device, kMIDIPropertyName, &str ); + if ( CFStringGetLength( result ) == 0 ) { + CFRelease( result ); + return str; + } + if ( str != NULL ) { + // if an external device has only one entity, throw away + // the endpoint name and just use the device name + if ( isExternal && MIDIDeviceGetNumberOfEntities( device ) < 2 ) { + CFRelease( result ); + return str; + } else { + if ( CFStringGetLength( str ) == 0 ) { + CFRelease( str ); + return result; + } + // does the entity name already start with the device name? + // (some drivers do this though they shouldn't) + // if so, do not prepend + if ( CFStringCompareWithOptions( result, /* endpoint name */ + str /* device name */, + CFRangeMake(0, CFStringGetLength( str ) ), 0 ) != kCFCompareEqualTo ) { + // prepend the device name to the entity name + if ( CFStringGetLength( result ) > 0 ) + CFStringInsert( result, 0, CFSTR(" ") ); + CFStringInsert( result, 0, str ); + } + CFRelease( str ); + } + } + return result; +} + +// This function was submitted by Douglas Casey Tucker and apparently +// derived largely from PortMidi. +static CFStringRef ConnectedEndpointName( MIDIEndpointRef endpoint ) +{ + CFMutableStringRef result = CFStringCreateMutable( NULL, 0 ); + CFStringRef str; + OSStatus err; + int i; + + // Does the endpoint have connections? + CFDataRef connections = NULL; + int nConnected = 0; + bool anyStrings = false; + err = MIDIObjectGetDataProperty( endpoint, kMIDIPropertyConnectionUniqueID, &connections ); + if ( connections != NULL ) { + // It has connections, follow them + // Concatenate the names of all connected devices + nConnected = CFDataGetLength( connections ) / sizeof(MIDIUniqueID); + if ( nConnected ) { + const SInt32 *pid = (const SInt32 *)(CFDataGetBytePtr(connections)); + for ( i=0; i= MIDIGetNumberOfSources() ) { + std::ostringstream ost; + ost << "MidiInCore::getPortName: the 'portNumber' argument (" << portNumber << ") is invalid."; + errorString_ = ost.str(); + error( RtMidiError::WARNING, errorString_ ); + return stringName; + } + + portRef = MIDIGetSource( portNumber ); + nameRef = ConnectedEndpointName(portRef); + CFStringGetCString( nameRef, name, sizeof(name), kCFStringEncodingUTF8); + CFRelease( nameRef ); + + return stringName = name; +} + +//*********************************************************************// +// API: OS-X +// Class Definitions: MidiOutCore +//*********************************************************************// + +MidiOutCore :: MidiOutCore( const std::string &clientName ) : MidiOutApi() +{ + initialize( clientName ); +} + +MidiOutCore :: ~MidiOutCore( void ) +{ + // Close a connection if it exists. + closePort(); + + // Cleanup. + CoreMidiData *data = static_cast (apiData_); + MIDIClientDispose( data->client ); + if ( data->endpoint ) MIDIEndpointDispose( data->endpoint ); + delete data; +} + +void MidiOutCore :: initialize( const std::string& clientName ) +{ + // Set up our client. + MIDIClientRef client; + CFStringRef name = CFStringCreateWithCString( NULL, clientName.c_str(), kCFStringEncodingASCII ); + OSStatus result = MIDIClientCreate(name, NULL, NULL, &client ); + if ( result != noErr ) { + std::ostringstream ost; + ost << "MidiInCore::initialize: error creating OS-X MIDI client object (" << result << ")."; + errorString_ = ost.str(); + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; + } + + // Save our api-specific connection information. + CoreMidiData *data = (CoreMidiData *) new CoreMidiData; + data->client = client; + data->endpoint = 0; + apiData_ = (void *) data; + CFRelease( name ); +} + +unsigned int MidiOutCore :: getPortCount() +{ + CFRunLoopRunInMode( kCFRunLoopDefaultMode, 0, false ); + return MIDIGetNumberOfDestinations(); +} + +std::string MidiOutCore :: getPortName( unsigned int portNumber ) +{ + CFStringRef nameRef; + MIDIEndpointRef portRef; + char name[128]; + + std::string stringName; + CFRunLoopRunInMode( kCFRunLoopDefaultMode, 0, false ); + if ( portNumber >= MIDIGetNumberOfDestinations() ) { + std::ostringstream ost; + ost << "MidiOutCore::getPortName: the 'portNumber' argument (" << portNumber << ") is invalid."; + errorString_ = ost.str(); + error( RtMidiError::WARNING, errorString_ ); + return stringName; + } + + portRef = MIDIGetDestination( portNumber ); + nameRef = ConnectedEndpointName(portRef); + CFStringGetCString( nameRef, name, sizeof(name), kCFStringEncodingUTF8 ); + CFRelease( nameRef ); + + return stringName = name; +} + +void MidiOutCore :: openPort( unsigned int portNumber, const std::string &portName ) +{ + if ( connected_ ) { + errorString_ = "MidiOutCore::openPort: a valid connection already exists!"; + error( RtMidiError::WARNING, errorString_ ); + return; + } + + CFRunLoopRunInMode( kCFRunLoopDefaultMode, 0, false ); + unsigned int nDest = MIDIGetNumberOfDestinations(); + if (nDest < 1) { + errorString_ = "MidiOutCore::openPort: no MIDI output destinations found!"; + error( RtMidiError::NO_DEVICES_FOUND, errorString_ ); + return; + } + + if ( portNumber >= nDest ) { + std::ostringstream ost; + ost << "MidiOutCore::openPort: the 'portNumber' argument (" << portNumber << ") is invalid."; + errorString_ = ost.str(); + error( RtMidiError::INVALID_PARAMETER, errorString_ ); + return; + } + + MIDIPortRef port; + CoreMidiData *data = static_cast (apiData_); + CFStringRef portNameRef = CFStringCreateWithCString( NULL, portName.c_str(), kCFStringEncodingASCII ); + OSStatus result = MIDIOutputPortCreate( data->client, + portNameRef, + &port ); + CFRelease( portNameRef ); + if ( result != noErr ) { + MIDIClientDispose( data->client ); + errorString_ = "MidiOutCore::openPort: error creating OS-X MIDI output port."; + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; + } + + // Get the desired output port identifier. + MIDIEndpointRef destination = MIDIGetDestination( portNumber ); + if ( destination == 0 ) { + MIDIPortDispose( port ); + MIDIClientDispose( data->client ); + errorString_ = "MidiOutCore::openPort: error getting MIDI output destination reference."; + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; + } + + // Save our api-specific connection information. + data->port = port; + data->destinationId = destination; + connected_ = true; +} + +void MidiOutCore :: closePort( void ) +{ + CoreMidiData *data = static_cast (apiData_); + + if ( data->endpoint ) { + MIDIEndpointDispose( data->endpoint ); + data->endpoint = 0; + } + + if ( data->port ) { + MIDIPortDispose( data->port ); + data->port = 0; + } + + connected_ = false; +} + +void MidiOutCore :: openVirtualPort( const std::string &portName ) +{ + CoreMidiData *data = static_cast (apiData_); + + if ( data->endpoint ) { + errorString_ = "MidiOutCore::openVirtualPort: a virtual output port already exists!"; + error( RtMidiError::WARNING, errorString_ ); + return; + } + + // Create a virtual MIDI output source. + MIDIEndpointRef endpoint; + OSStatus result = MIDISourceCreate( data->client, + CFStringCreateWithCString( NULL, portName.c_str(), kCFStringEncodingASCII ), + &endpoint ); + if ( result != noErr ) { + errorString_ = "MidiOutCore::initialize: error creating OS-X virtual MIDI source."; + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; + } + + // Save our api-specific connection information. + data->endpoint = endpoint; +} + +void MidiOutCore :: sendMessage( const unsigned char *message, size_t size ) +{ + // We use the MIDISendSysex() function to asynchronously send sysex + // messages. Otherwise, we use a single CoreMidi MIDIPacket. + unsigned int nBytes = static_cast (size); + if ( nBytes == 0 ) { + errorString_ = "MidiOutCore::sendMessage: no data in message argument!"; + error( RtMidiError::WARNING, errorString_ ); + return; + } + + MIDITimeStamp timeStamp = AudioGetCurrentHostTime(); + CoreMidiData *data = static_cast (apiData_); + OSStatus result; + + if ( message[0] != 0xF0 && nBytes > 3 ) { + errorString_ = "MidiOutCore::sendMessage: message format problem ... not sysex but > 3 bytes?"; + error( RtMidiError::WARNING, errorString_ ); + return; + } + + Byte buffer[nBytes+(sizeof(MIDIPacketList))]; + ByteCount listSize = sizeof(buffer); + MIDIPacketList *packetList = (MIDIPacketList*)buffer; + MIDIPacket *packet = MIDIPacketListInit( packetList ); + + ByteCount remainingBytes = nBytes; + while (remainingBytes && packet) { + ByteCount bytesForPacket = remainingBytes > 65535 ? 65535 : remainingBytes; // 65535 = maximum size of a MIDIPacket + const Byte* dataStartPtr = (const Byte *) &message[nBytes - remainingBytes]; + packet = MIDIPacketListAdd( packetList, listSize, packet, timeStamp, bytesForPacket, dataStartPtr); + remainingBytes -= bytesForPacket; + } + + if ( !packet ) { + errorString_ = "MidiOutCore::sendMessage: could not allocate packet list"; + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; + } + + // Send to any destinations that may have connected to us. + if ( data->endpoint ) { + result = MIDIReceived( data->endpoint, packetList ); + if ( result != noErr ) { + errorString_ = "MidiOutCore::sendMessage: error sending MIDI to virtual destinations."; + error( RtMidiError::WARNING, errorString_ ); + } + } + + // And send to an explicit destination port if we're connected. + if ( connected_ ) { + result = MIDISend( data->port, data->destinationId, packetList ); + if ( result != noErr ) { + errorString_ = "MidiOutCore::sendMessage: error sending MIDI message to port."; + error( RtMidiError::WARNING, errorString_ ); + } + } +} + +#endif // __MACOSX_CORE__ + + +//*********************************************************************// +// API: LINUX ALSA SEQUENCER +//*********************************************************************// + +// API information found at: +// - http://www.alsa-project.org/documentation.php#Library + +#if defined(__LINUX_ALSA__) + +// The ALSA Sequencer API is based on the use of a callback function for +// MIDI input. +// +// Thanks to Pedro Lopez-Cabanillas for help with the ALSA sequencer +// time stamps and other assorted fixes!!! + +// If you don't need timestamping for incoming MIDI events, define the +// preprocessor definition AVOID_TIMESTAMPING to save resources +// associated with the ALSA sequencer queues. + +#include +#include + +// ALSA header file. +#include + +// A structure to hold variables related to the ALSA API +// implementation. +struct AlsaMidiData { + snd_seq_t *seq; + unsigned int portNum; + int vport; + snd_seq_port_subscribe_t *subscription; + snd_midi_event_t *coder; + unsigned int bufferSize; + unsigned char *buffer; + pthread_t thread; + pthread_t dummy_thread_id; + snd_seq_real_time_t lastTime; + int queue_id; // an input queue is needed to get timestamped events + int trigger_fds[2]; +}; + +#define PORT_TYPE( pinfo, bits ) ((snd_seq_port_info_get_capability(pinfo) & (bits)) == (bits)) + +//*********************************************************************// +// API: LINUX ALSA +// Class Definitions: MidiInAlsa +//*********************************************************************// + +static void *alsaMidiHandler( void *ptr ) +{ + MidiInApi::RtMidiInData *data = static_cast (ptr); + AlsaMidiData *apiData = static_cast (data->apiData); + + long nBytes; + double time; + bool continueSysex = false; + bool doDecode = false; + MidiInApi::MidiMessage message; + int poll_fd_count; + struct pollfd *poll_fds; + + snd_seq_event_t *ev; + int result; + apiData->bufferSize = 32; + result = snd_midi_event_new( 0, &apiData->coder ); + if ( result < 0 ) { + data->doInput = false; + std::cerr << "\nMidiInAlsa::alsaMidiHandler: error initializing MIDI event parser!\n\n"; + return 0; + } + unsigned char *buffer = (unsigned char *) malloc( apiData->bufferSize ); + if ( buffer == NULL ) { + data->doInput = false; + snd_midi_event_free( apiData->coder ); + apiData->coder = 0; + std::cerr << "\nMidiInAlsa::alsaMidiHandler: error initializing buffer memory!\n\n"; + return 0; + } + snd_midi_event_init( apiData->coder ); + snd_midi_event_no_status( apiData->coder, 1 ); // suppress running status messages + + poll_fd_count = snd_seq_poll_descriptors_count( apiData->seq, POLLIN ) + 1; + poll_fds = (struct pollfd*)alloca( poll_fd_count * sizeof( struct pollfd )); + snd_seq_poll_descriptors( apiData->seq, poll_fds + 1, poll_fd_count - 1, POLLIN ); + poll_fds[0].fd = apiData->trigger_fds[0]; + poll_fds[0].events = POLLIN; + + while ( data->doInput ) { + + if ( snd_seq_event_input_pending( apiData->seq, 1 ) == 0 ) { + // No data pending + if ( poll( poll_fds, poll_fd_count, -1) >= 0 ) { + if ( poll_fds[0].revents & POLLIN ) { + bool dummy; + int res = read( poll_fds[0].fd, &dummy, sizeof(dummy) ); + (void) res; + } + } + continue; + } + + // If here, there should be data. + result = snd_seq_event_input( apiData->seq, &ev ); + if ( result == -ENOSPC ) { + std::cerr << "\nMidiInAlsa::alsaMidiHandler: MIDI input buffer overrun!\n\n"; + continue; + } + else if ( result <= 0 ) { + std::cerr << "\nMidiInAlsa::alsaMidiHandler: unknown MIDI input error!\n"; + perror("System reports"); + continue; + } + + // This is a bit weird, but we now have to decode an ALSA MIDI + // event (back) into MIDI bytes. We'll ignore non-MIDI types. + if ( !continueSysex ) message.bytes.clear(); + + doDecode = false; + switch ( ev->type ) { + + case SND_SEQ_EVENT_PORT_SUBSCRIBED: +#if defined(__RTMIDI_DEBUG__) + std::cout << "MidiInAlsa::alsaMidiHandler: port connection made!\n"; +#endif + break; + + case SND_SEQ_EVENT_PORT_UNSUBSCRIBED: +#if defined(__RTMIDI_DEBUG__) + std::cerr << "MidiInAlsa::alsaMidiHandler: port connection has closed!\n"; + std::cout << "sender = " << (int) ev->data.connect.sender.client << ":" + << (int) ev->data.connect.sender.port + << ", dest = " << (int) ev->data.connect.dest.client << ":" + << (int) ev->data.connect.dest.port + << std::endl; +#endif + break; + + case SND_SEQ_EVENT_QFRAME: // MIDI time code + if ( !( data->ignoreFlags & 0x02 ) ) doDecode = true; + break; + + case SND_SEQ_EVENT_TICK: // 0xF9 ... MIDI timing tick + if ( !( data->ignoreFlags & 0x02 ) ) doDecode = true; + break; + + case SND_SEQ_EVENT_CLOCK: // 0xF8 ... MIDI timing (clock) tick + if ( !( data->ignoreFlags & 0x02 ) ) doDecode = true; + break; + + case SND_SEQ_EVENT_SENSING: // Active sensing + if ( !( data->ignoreFlags & 0x04 ) ) doDecode = true; + break; + + case SND_SEQ_EVENT_SYSEX: + if ( (data->ignoreFlags & 0x01) ) break; + if ( ev->data.ext.len > apiData->bufferSize ) { + apiData->bufferSize = ev->data.ext.len; + free( buffer ); + buffer = (unsigned char *) malloc( apiData->bufferSize ); + if ( buffer == NULL ) { + data->doInput = false; + std::cerr << "\nMidiInAlsa::alsaMidiHandler: error resizing buffer memory!\n\n"; + break; + } + } + + default: + doDecode = true; + } + + if ( doDecode ) { + + nBytes = snd_midi_event_decode( apiData->coder, buffer, apiData->bufferSize, ev ); + if ( nBytes > 0 ) { + // The ALSA sequencer has a maximum buffer size for MIDI sysex + // events of 256 bytes. If a device sends sysex messages larger + // than this, they are segmented into 256 byte chunks. So, + // we'll watch for this and concatenate sysex chunks into a + // single sysex message if necessary. + if ( !continueSysex ) + message.bytes.assign( buffer, &buffer[nBytes] ); + else + message.bytes.insert( message.bytes.end(), buffer, &buffer[nBytes] ); + + continueSysex = ( ( ev->type == SND_SEQ_EVENT_SYSEX ) && ( message.bytes.back() != 0xF7 ) ); + if ( !continueSysex ) { + + // Calculate the time stamp: + message.timeStamp = 0.0; + + // Method 1: Use the system time. + //(void)gettimeofday(&tv, (struct timezone *)NULL); + //time = (tv.tv_sec * 1000000) + tv.tv_usec; + + // Method 2: Use the ALSA sequencer event time data. + // (thanks to Pedro Lopez-Cabanillas!). + + // Using method from: + // https://www.gnu.org/software/libc/manual/html_node/Elapsed-Time.html + + // Perform the carry for the later subtraction by updating y. + snd_seq_real_time_t &x(ev->time.time); + snd_seq_real_time_t &y(apiData->lastTime); + if (x.tv_nsec < y.tv_nsec) { + int nsec = (y.tv_nsec - x.tv_nsec) / 1000000000 + 1; + y.tv_nsec -= 1000000000 * nsec; + y.tv_sec += nsec; + } + if (x.tv_nsec - y.tv_nsec > 1000000000) { + int nsec = (x.tv_nsec - y.tv_nsec) / 1000000000; + y.tv_nsec += 1000000000 * nsec; + y.tv_sec -= nsec; + } + + // Compute the time difference. + time = x.tv_sec - y.tv_sec + (x.tv_nsec - y.tv_nsec)*1e-9; + + apiData->lastTime = ev->time.time; + + if ( data->firstMessage == true ) + data->firstMessage = false; + else + message.timeStamp = time; + } + else { +#if defined(__RTMIDI_DEBUG__) + std::cerr << "\nMidiInAlsa::alsaMidiHandler: event parsing error or not a MIDI event!\n\n"; +#endif + } + } + } + + snd_seq_free_event( ev ); + if ( message.bytes.size() == 0 || continueSysex ) continue; + + if ( data->usingCallback ) { + RtMidiIn::RtMidiCallback callback = (RtMidiIn::RtMidiCallback) data->userCallback; + callback( message.timeStamp, &message.bytes, data->userData ); + } + else { + // As long as we haven't reached our queue size limit, push the message. + if (!data->queue.push(message)) + std::cerr << "\nMidiInAlsa: message queue limit reached!!\n\n"; + } + } + + if ( buffer ) free( buffer ); + snd_midi_event_free( apiData->coder ); + apiData->coder = 0; + apiData->thread = apiData->dummy_thread_id; + return 0; +} + +MidiInAlsa :: MidiInAlsa( const std::string &clientName, unsigned int queueSizeLimit ) : MidiInApi( queueSizeLimit ) +{ + initialize( clientName ); +} + +MidiInAlsa :: ~MidiInAlsa() +{ + // Close a connection if it exists. + closePort(); + + // Shutdown the input thread. + AlsaMidiData *data = static_cast (apiData_); + if ( inputData_.doInput ) { + inputData_.doInput = false; + int res = write( data->trigger_fds[1], &inputData_.doInput, sizeof(inputData_.doInput) ); + (void) res; + if ( !pthread_equal(data->thread, data->dummy_thread_id) ) + pthread_join( data->thread, NULL ); + } + + // Cleanup. + close ( data->trigger_fds[0] ); + close ( data->trigger_fds[1] ); + if ( data->vport >= 0 ) snd_seq_delete_port( data->seq, data->vport ); +#ifndef AVOID_TIMESTAMPING + snd_seq_free_queue( data->seq, data->queue_id ); +#endif + snd_seq_close( data->seq ); + delete data; +} + +void MidiInAlsa :: initialize( const std::string& clientName ) +{ + // Set up the ALSA sequencer client. + snd_seq_t *seq; + int result = snd_seq_open(&seq, "default", SND_SEQ_OPEN_DUPLEX, SND_SEQ_NONBLOCK); + if ( result < 0 ) { + errorString_ = "MidiInAlsa::initialize: error creating ALSA sequencer client object."; + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; + } + + // Set client name. + snd_seq_set_client_name( seq, clientName.c_str() ); + + // Save our api-specific connection information. + AlsaMidiData *data = (AlsaMidiData *) new AlsaMidiData; + data->seq = seq; + data->portNum = -1; + data->vport = -1; + data->subscription = 0; + data->dummy_thread_id = pthread_self(); + data->thread = data->dummy_thread_id; + data->trigger_fds[0] = -1; + data->trigger_fds[1] = -1; + apiData_ = (void *) data; + inputData_.apiData = (void *) data; + + if ( pipe(data->trigger_fds) == -1 ) { + errorString_ = "MidiInAlsa::initialize: error creating pipe objects."; + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; + } + + // Create the input queue +#ifndef AVOID_TIMESTAMPING + data->queue_id = snd_seq_alloc_named_queue(seq, "RtMidi Queue"); + // Set arbitrary tempo (mm=100) and resolution (240) + snd_seq_queue_tempo_t *qtempo; + snd_seq_queue_tempo_alloca(&qtempo); + snd_seq_queue_tempo_set_tempo(qtempo, 600000); + snd_seq_queue_tempo_set_ppq(qtempo, 240); + snd_seq_set_queue_tempo(data->seq, data->queue_id, qtempo); + snd_seq_drain_output(data->seq); +#endif +} + +// This function is used to count or get the pinfo structure for a given port number. +unsigned int portInfo( snd_seq_t *seq, snd_seq_port_info_t *pinfo, unsigned int type, int portNumber ) +{ + snd_seq_client_info_t *cinfo; + int client; + int count = 0; + snd_seq_client_info_alloca( &cinfo ); + + snd_seq_client_info_set_client( cinfo, -1 ); + while ( snd_seq_query_next_client( seq, cinfo ) >= 0 ) { + client = snd_seq_client_info_get_client( cinfo ); + if ( client == 0 ) continue; + // Reset query info + snd_seq_port_info_set_client( pinfo, client ); + snd_seq_port_info_set_port( pinfo, -1 ); + while ( snd_seq_query_next_port( seq, pinfo ) >= 0 ) { + unsigned int atyp = snd_seq_port_info_get_type( pinfo ); + if ( ( ( atyp & SND_SEQ_PORT_TYPE_MIDI_GENERIC ) == 0 ) && + ( ( atyp & SND_SEQ_PORT_TYPE_SYNTH ) == 0 ) && + ( ( atyp & SND_SEQ_PORT_TYPE_APPLICATION ) == 0 ) ) continue; + + unsigned int caps = snd_seq_port_info_get_capability( pinfo ); + if ( ( caps & type ) != type ) continue; + if ( count == portNumber ) return 1; + ++count; + } + } + + // If a negative portNumber was used, return the port count. + if ( portNumber < 0 ) return count; + return 0; +} + +unsigned int MidiInAlsa :: getPortCount() +{ + snd_seq_port_info_t *pinfo; + snd_seq_port_info_alloca( &pinfo ); + + AlsaMidiData *data = static_cast (apiData_); + return portInfo( data->seq, pinfo, SND_SEQ_PORT_CAP_READ|SND_SEQ_PORT_CAP_SUBS_READ, -1 ); +} + +std::string MidiInAlsa :: getPortName( unsigned int portNumber ) +{ + snd_seq_client_info_t *cinfo; + snd_seq_port_info_t *pinfo; + snd_seq_client_info_alloca( &cinfo ); + snd_seq_port_info_alloca( &pinfo ); + + std::string stringName; + AlsaMidiData *data = static_cast (apiData_); + if ( portInfo( data->seq, pinfo, SND_SEQ_PORT_CAP_READ|SND_SEQ_PORT_CAP_SUBS_READ, (int) portNumber ) ) { + int cnum = snd_seq_port_info_get_client( pinfo ); + snd_seq_get_any_client_info( data->seq, cnum, cinfo ); + std::ostringstream os; + os << snd_seq_client_info_get_name( cinfo ); + os << ":"; + os << snd_seq_port_info_get_name( pinfo ); + os << " "; // These lines added to make sure devices are listed + os << snd_seq_port_info_get_client( pinfo ); // with full portnames added to ensure individual device names + os << ":"; + os << snd_seq_port_info_get_port( pinfo ); + stringName = os.str(); + return stringName; + } + + // If we get here, we didn't find a match. + errorString_ = "MidiInAlsa::getPortName: error looking for port name!"; + error( RtMidiError::WARNING, errorString_ ); + return stringName; +} + +void MidiInAlsa :: openPort( unsigned int portNumber, const std::string &portName ) +{ + if ( connected_ ) { + errorString_ = "MidiInAlsa::openPort: a valid connection already exists!"; + error( RtMidiError::WARNING, errorString_ ); + return; + } + + unsigned int nSrc = this->getPortCount(); + if ( nSrc < 1 ) { + errorString_ = "MidiInAlsa::openPort: no MIDI input sources found!"; + error( RtMidiError::NO_DEVICES_FOUND, errorString_ ); + return; + } + + snd_seq_port_info_t *src_pinfo; + snd_seq_port_info_alloca( &src_pinfo ); + AlsaMidiData *data = static_cast (apiData_); + if ( portInfo( data->seq, src_pinfo, SND_SEQ_PORT_CAP_READ|SND_SEQ_PORT_CAP_SUBS_READ, (int) portNumber ) == 0 ) { + std::ostringstream ost; + ost << "MidiInAlsa::openPort: the 'portNumber' argument (" << portNumber << ") is invalid."; + errorString_ = ost.str(); + error( RtMidiError::INVALID_PARAMETER, errorString_ ); + return; + } + + snd_seq_addr_t sender, receiver; + sender.client = snd_seq_port_info_get_client( src_pinfo ); + sender.port = snd_seq_port_info_get_port( src_pinfo ); + receiver.client = snd_seq_client_id( data->seq ); + + snd_seq_port_info_t *pinfo; + snd_seq_port_info_alloca( &pinfo ); + if ( data->vport < 0 ) { + snd_seq_port_info_set_client( pinfo, 0 ); + snd_seq_port_info_set_port( pinfo, 0 ); + snd_seq_port_info_set_capability( pinfo, + SND_SEQ_PORT_CAP_WRITE | + SND_SEQ_PORT_CAP_SUBS_WRITE ); + snd_seq_port_info_set_type( pinfo, + SND_SEQ_PORT_TYPE_MIDI_GENERIC | + SND_SEQ_PORT_TYPE_APPLICATION ); + snd_seq_port_info_set_midi_channels(pinfo, 16); +#ifndef AVOID_TIMESTAMPING + snd_seq_port_info_set_timestamping(pinfo, 1); + snd_seq_port_info_set_timestamp_real(pinfo, 1); + snd_seq_port_info_set_timestamp_queue(pinfo, data->queue_id); +#endif + snd_seq_port_info_set_name(pinfo, portName.c_str() ); + data->vport = snd_seq_create_port(data->seq, pinfo); + + if ( data->vport < 0 ) { + errorString_ = "MidiInAlsa::openPort: ALSA error creating input port."; + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; + } + data->vport = snd_seq_port_info_get_port(pinfo); + } + + receiver.port = data->vport; + + if ( !data->subscription ) { + // Make subscription + if (snd_seq_port_subscribe_malloc( &data->subscription ) < 0) { + errorString_ = "MidiInAlsa::openPort: ALSA error allocation port subscription."; + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; + } + snd_seq_port_subscribe_set_sender(data->subscription, &sender); + snd_seq_port_subscribe_set_dest(data->subscription, &receiver); + if ( snd_seq_subscribe_port(data->seq, data->subscription) ) { + snd_seq_port_subscribe_free( data->subscription ); + data->subscription = 0; + errorString_ = "MidiInAlsa::openPort: ALSA error making port connection."; + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; + } + } + + if ( inputData_.doInput == false ) { + // Start the input queue +#ifndef AVOID_TIMESTAMPING + snd_seq_start_queue( data->seq, data->queue_id, NULL ); + snd_seq_drain_output( data->seq ); +#endif + // Start our MIDI input thread. + pthread_attr_t attr; + pthread_attr_init(&attr); + pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); + pthread_attr_setschedpolicy(&attr, SCHED_OTHER); + + inputData_.doInput = true; + int err = pthread_create(&data->thread, &attr, alsaMidiHandler, &inputData_); + pthread_attr_destroy(&attr); + if ( err ) { + snd_seq_unsubscribe_port( data->seq, data->subscription ); + snd_seq_port_subscribe_free( data->subscription ); + data->subscription = 0; + inputData_.doInput = false; + errorString_ = "MidiInAlsa::openPort: error starting MIDI input thread!"; + error( RtMidiError::THREAD_ERROR, errorString_ ); + return; + } + } + + connected_ = true; +} + +void MidiInAlsa :: openVirtualPort( const std::string &portName ) +{ + AlsaMidiData *data = static_cast (apiData_); + if ( data->vport < 0 ) { + snd_seq_port_info_t *pinfo; + snd_seq_port_info_alloca( &pinfo ); + snd_seq_port_info_set_capability( pinfo, + SND_SEQ_PORT_CAP_WRITE | + SND_SEQ_PORT_CAP_SUBS_WRITE ); + snd_seq_port_info_set_type( pinfo, + SND_SEQ_PORT_TYPE_MIDI_GENERIC | + SND_SEQ_PORT_TYPE_APPLICATION ); + snd_seq_port_info_set_midi_channels(pinfo, 16); +#ifndef AVOID_TIMESTAMPING + snd_seq_port_info_set_timestamping(pinfo, 1); + snd_seq_port_info_set_timestamp_real(pinfo, 1); + snd_seq_port_info_set_timestamp_queue(pinfo, data->queue_id); +#endif + snd_seq_port_info_set_name(pinfo, portName.c_str()); + data->vport = snd_seq_create_port(data->seq, pinfo); + + if ( data->vport < 0 ) { + errorString_ = "MidiInAlsa::openVirtualPort: ALSA error creating virtual port."; + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; + } + data->vport = snd_seq_port_info_get_port(pinfo); + } + + if ( inputData_.doInput == false ) { + // Wait for old thread to stop, if still running + if ( !pthread_equal(data->thread, data->dummy_thread_id) ) + pthread_join( data->thread, NULL ); + + // Start the input queue +#ifndef AVOID_TIMESTAMPING + snd_seq_start_queue( data->seq, data->queue_id, NULL ); + snd_seq_drain_output( data->seq ); +#endif + // Start our MIDI input thread. + pthread_attr_t attr; + pthread_attr_init(&attr); + pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); + pthread_attr_setschedpolicy(&attr, SCHED_OTHER); + + inputData_.doInput = true; + int err = pthread_create(&data->thread, &attr, alsaMidiHandler, &inputData_); + pthread_attr_destroy(&attr); + if ( err ) { + if ( data->subscription ) { + snd_seq_unsubscribe_port( data->seq, data->subscription ); + snd_seq_port_subscribe_free( data->subscription ); + data->subscription = 0; + } + inputData_.doInput = false; + errorString_ = "MidiInAlsa::openPort: error starting MIDI input thread!"; + error( RtMidiError::THREAD_ERROR, errorString_ ); + return; + } + } +} + +void MidiInAlsa :: closePort( void ) +{ + AlsaMidiData *data = static_cast (apiData_); + + if ( connected_ ) { + if ( data->subscription ) { + snd_seq_unsubscribe_port( data->seq, data->subscription ); + snd_seq_port_subscribe_free( data->subscription ); + data->subscription = 0; + } + // Stop the input queue +#ifndef AVOID_TIMESTAMPING + snd_seq_stop_queue( data->seq, data->queue_id, NULL ); + snd_seq_drain_output( data->seq ); +#endif + connected_ = false; + } + + // Stop thread to avoid triggering the callback, while the port is intended to be closed + if ( inputData_.doInput ) { + inputData_.doInput = false; + int res = write( data->trigger_fds[1], &inputData_.doInput, sizeof(inputData_.doInput) ); + (void) res; + if ( !pthread_equal(data->thread, data->dummy_thread_id) ) + pthread_join( data->thread, NULL ); + } +} + +//*********************************************************************// +// API: LINUX ALSA +// Class Definitions: MidiOutAlsa +//*********************************************************************// + +MidiOutAlsa :: MidiOutAlsa( const std::string &clientName ) : MidiOutApi() +{ + initialize( clientName ); +} + +MidiOutAlsa :: ~MidiOutAlsa() +{ + // Close a connection if it exists. + closePort(); + + // Cleanup. + AlsaMidiData *data = static_cast (apiData_); + if ( data->vport >= 0 ) snd_seq_delete_port( data->seq, data->vport ); + if ( data->coder ) snd_midi_event_free( data->coder ); + if ( data->buffer ) free( data->buffer ); + snd_seq_close( data->seq ); + delete data; +} + +void MidiOutAlsa :: initialize( const std::string& clientName ) +{ + // Set up the ALSA sequencer client. + snd_seq_t *seq; + int result1 = snd_seq_open( &seq, "default", SND_SEQ_OPEN_OUTPUT, SND_SEQ_NONBLOCK ); + if ( result1 < 0 ) { + errorString_ = "MidiOutAlsa::initialize: error creating ALSA sequencer client object."; + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; + } + + // Set client name. + snd_seq_set_client_name( seq, clientName.c_str() ); + + // Save our api-specific connection information. + AlsaMidiData *data = (AlsaMidiData *) new AlsaMidiData; + data->seq = seq; + data->portNum = -1; + data->vport = -1; + data->bufferSize = 32; + data->coder = 0; + data->buffer = 0; + int result = snd_midi_event_new( data->bufferSize, &data->coder ); + if ( result < 0 ) { + delete data; + errorString_ = "MidiOutAlsa::initialize: error initializing MIDI event parser!\n\n"; + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; + } + data->buffer = (unsigned char *) malloc( data->bufferSize ); + if ( data->buffer == NULL ) { + delete data; + errorString_ = "MidiOutAlsa::initialize: error allocating buffer memory!\n\n"; + error( RtMidiError::MEMORY_ERROR, errorString_ ); + return; + } + snd_midi_event_init( data->coder ); + apiData_ = (void *) data; +} + +unsigned int MidiOutAlsa :: getPortCount() +{ + snd_seq_port_info_t *pinfo; + snd_seq_port_info_alloca( &pinfo ); + + AlsaMidiData *data = static_cast (apiData_); + return portInfo( data->seq, pinfo, SND_SEQ_PORT_CAP_WRITE|SND_SEQ_PORT_CAP_SUBS_WRITE, -1 ); +} + +std::string MidiOutAlsa :: getPortName( unsigned int portNumber ) +{ + snd_seq_client_info_t *cinfo; + snd_seq_port_info_t *pinfo; + snd_seq_client_info_alloca( &cinfo ); + snd_seq_port_info_alloca( &pinfo ); + + std::string stringName; + AlsaMidiData *data = static_cast (apiData_); + if ( portInfo( data->seq, pinfo, SND_SEQ_PORT_CAP_WRITE|SND_SEQ_PORT_CAP_SUBS_WRITE, (int) portNumber ) ) { + int cnum = snd_seq_port_info_get_client(pinfo); + snd_seq_get_any_client_info( data->seq, cnum, cinfo ); + std::ostringstream os; + os << snd_seq_client_info_get_name(cinfo); + os << ":"; + os << snd_seq_port_info_get_name( pinfo ); + os << " "; // These lines added to make sure devices are listed + os << snd_seq_port_info_get_client( pinfo ); // with full portnames added to ensure individual device names + os << ":"; + os << snd_seq_port_info_get_port(pinfo); + stringName = os.str(); + return stringName; + } + + // If we get here, we didn't find a match. + errorString_ = "MidiOutAlsa::getPortName: error looking for port name!"; + error( RtMidiError::WARNING, errorString_ ); + return stringName; +} + +void MidiOutAlsa :: openPort( unsigned int portNumber, const std::string &portName ) +{ + if ( connected_ ) { + errorString_ = "MidiOutAlsa::openPort: a valid connection already exists!"; + error( RtMidiError::WARNING, errorString_ ); + return; + } + + unsigned int nSrc = this->getPortCount(); + if (nSrc < 1) { + errorString_ = "MidiOutAlsa::openPort: no MIDI output sources found!"; + error( RtMidiError::NO_DEVICES_FOUND, errorString_ ); + return; + } + + snd_seq_port_info_t *pinfo; + snd_seq_port_info_alloca( &pinfo ); + AlsaMidiData *data = static_cast (apiData_); + if ( portInfo( data->seq, pinfo, SND_SEQ_PORT_CAP_WRITE|SND_SEQ_PORT_CAP_SUBS_WRITE, (int) portNumber ) == 0 ) { + std::ostringstream ost; + ost << "MidiOutAlsa::openPort: the 'portNumber' argument (" << portNumber << ") is invalid."; + errorString_ = ost.str(); + error( RtMidiError::INVALID_PARAMETER, errorString_ ); + return; + } + + snd_seq_addr_t sender, receiver; + receiver.client = snd_seq_port_info_get_client( pinfo ); + receiver.port = snd_seq_port_info_get_port( pinfo ); + sender.client = snd_seq_client_id( data->seq ); + + if ( data->vport < 0 ) { + data->vport = snd_seq_create_simple_port( data->seq, portName.c_str(), + SND_SEQ_PORT_CAP_READ|SND_SEQ_PORT_CAP_SUBS_READ, + SND_SEQ_PORT_TYPE_MIDI_GENERIC|SND_SEQ_PORT_TYPE_APPLICATION ); + if ( data->vport < 0 ) { + errorString_ = "MidiOutAlsa::openPort: ALSA error creating output port."; + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; + } + } + + sender.port = data->vport; + + // Make subscription + if (snd_seq_port_subscribe_malloc( &data->subscription ) < 0) { + snd_seq_port_subscribe_free( data->subscription ); + errorString_ = "MidiOutAlsa::openPort: error allocating port subscription."; + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; + } + snd_seq_port_subscribe_set_sender(data->subscription, &sender); + snd_seq_port_subscribe_set_dest(data->subscription, &receiver); + snd_seq_port_subscribe_set_time_update(data->subscription, 1); + snd_seq_port_subscribe_set_time_real(data->subscription, 1); + if ( snd_seq_subscribe_port(data->seq, data->subscription) ) { + snd_seq_port_subscribe_free( data->subscription ); + errorString_ = "MidiOutAlsa::openPort: ALSA error making port connection."; + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; + } + + connected_ = true; +} + +void MidiOutAlsa :: closePort( void ) +{ + if ( connected_ ) { + AlsaMidiData *data = static_cast (apiData_); + snd_seq_unsubscribe_port( data->seq, data->subscription ); + snd_seq_port_subscribe_free( data->subscription ); + data->subscription = 0; + connected_ = false; + } +} + +void MidiOutAlsa :: openVirtualPort( const std::string &portName ) +{ + AlsaMidiData *data = static_cast (apiData_); + if ( data->vport < 0 ) { + data->vport = snd_seq_create_simple_port( data->seq, portName.c_str(), + SND_SEQ_PORT_CAP_READ|SND_SEQ_PORT_CAP_SUBS_READ, + SND_SEQ_PORT_TYPE_MIDI_GENERIC|SND_SEQ_PORT_TYPE_APPLICATION ); + + if ( data->vport < 0 ) { + errorString_ = "MidiOutAlsa::openVirtualPort: ALSA error creating virtual port."; + error( RtMidiError::DRIVER_ERROR, errorString_ ); + } + } +} + +void MidiOutAlsa :: sendMessage( const unsigned char *message, size_t size ) +{ + int result; + AlsaMidiData *data = static_cast (apiData_); + unsigned int nBytes = static_cast (size); + if ( nBytes > data->bufferSize ) { + data->bufferSize = nBytes; + result = snd_midi_event_resize_buffer ( data->coder, nBytes); + if ( result != 0 ) { + errorString_ = "MidiOutAlsa::sendMessage: ALSA error resizing MIDI event buffer."; + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; + } + free (data->buffer); + data->buffer = (unsigned char *) malloc( data->bufferSize ); + if ( data->buffer == NULL ) { + errorString_ = "MidiOutAlsa::initialize: error allocating buffer memory!\n\n"; + error( RtMidiError::MEMORY_ERROR, errorString_ ); + return; + } + } + + snd_seq_event_t ev; + snd_seq_ev_clear(&ev); + snd_seq_ev_set_source(&ev, data->vport); + snd_seq_ev_set_subs(&ev); + snd_seq_ev_set_direct(&ev); + for ( unsigned int i=0; ibuffer[i] = message[i]; + result = snd_midi_event_encode( data->coder, data->buffer, (long)nBytes, &ev ); + if ( result < (int)nBytes ) { + errorString_ = "MidiOutAlsa::sendMessage: event parsing error!"; + error( RtMidiError::WARNING, errorString_ ); + return; + } + + // Send the event. + result = snd_seq_event_output(data->seq, &ev); + if ( result < 0 ) { + errorString_ = "MidiOutAlsa::sendMessage: error sending MIDI message to port."; + error( RtMidiError::WARNING, errorString_ ); + return; + } + snd_seq_drain_output(data->seq); +} + +#endif // __LINUX_ALSA__ + + +//*********************************************************************// +// API: Windows Multimedia Library (MM) +//*********************************************************************// + +// API information deciphered from: +// - http://msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/htm/_win32_midi_reference.asp + +// Thanks to Jean-Baptiste Berruchon for the sysex code. + +#if defined(__WINDOWS_MM__) + +// The Windows MM API is based on the use of a callback function for +// MIDI input. We convert the system specific time stamps to delta +// time values. + +// Windows MM MIDI header files. +#include +#include + +// Convert a null-terminated wide string or ANSI-encoded string to UTF-8. +static std::string ConvertToUTF8(const TCHAR *str) +{ + std::string u8str; + const WCHAR *wstr = L""; +#if defined( UNICODE ) || defined( _UNICODE ) + wstr = str; +#else + // Convert from ANSI encoding to wide string + int wlength = MultiByteToWideChar( CP_ACP, 0, str, -1, NULL, 0 ); + std::wstring wstrtemp; + if ( wlength ) + { + wstrtemp.assign( wlength - 1, 0 ); + MultiByteToWideChar( CP_ACP, 0, str, -1, &wstrtemp[0], wlength ); + wstr = &wstrtemp[0]; + } +#endif + // Convert from wide string to UTF-8 + int length = WideCharToMultiByte( CP_UTF8, 0, wstr, -1, NULL, 0, NULL, NULL ); + if ( length ) + { + u8str.assign( length - 1, 0 ); + length = WideCharToMultiByte( CP_UTF8, 0, wstr, -1, &u8str[0], length, NULL, NULL ); + } + return u8str; +} + +#define RT_SYSEX_BUFFER_SIZE 1024 +#define RT_SYSEX_BUFFER_COUNT 4 + +// A structure to hold variables related to the CoreMIDI API +// implementation. +struct WinMidiData { + HMIDIIN inHandle; // Handle to Midi Input Device + HMIDIOUT outHandle; // Handle to Midi Output Device + DWORD lastTime; + MidiInApi::MidiMessage message; + LPMIDIHDR sysexBuffer[RT_SYSEX_BUFFER_COUNT]; + CRITICAL_SECTION _mutex; // [Patrice] see https://groups.google.com/forum/#!topic/mididev/6OUjHutMpEo +}; + +//*********************************************************************// +// API: Windows MM +// Class Definitions: MidiInWinMM +//*********************************************************************// + +static void CALLBACK midiInputCallback( HMIDIIN /*hmin*/, + UINT inputStatus, + DWORD_PTR instancePtr, + DWORD_PTR midiMessage, + DWORD timestamp ) +{ + if ( inputStatus != MIM_DATA && inputStatus != MIM_LONGDATA && inputStatus != MIM_LONGERROR ) return; + + //MidiInApi::RtMidiInData *data = static_cast (instancePtr); + MidiInApi::RtMidiInData *data = (MidiInApi::RtMidiInData *)instancePtr; + WinMidiData *apiData = static_cast (data->apiData); + + // Calculate time stamp. + if ( data->firstMessage == true ) { + apiData->message.timeStamp = 0.0; + data->firstMessage = false; + } + else apiData->message.timeStamp = (double) ( timestamp - apiData->lastTime ) * 0.001; + apiData->lastTime = timestamp; + + if ( inputStatus == MIM_DATA ) { // Channel or system message + + // Make sure the first byte is a status byte. + unsigned char status = (unsigned char) (midiMessage & 0x000000FF); + if ( !(status & 0x80) ) return; + + // Determine the number of bytes in the MIDI message. + unsigned short nBytes = 1; + if ( status < 0xC0 ) nBytes = 3; + else if ( status < 0xE0 ) nBytes = 2; + else if ( status < 0xF0 ) nBytes = 3; + else if ( status == 0xF1 ) { + if ( data->ignoreFlags & 0x02 ) return; + else nBytes = 2; + } + else if ( status == 0xF2 ) nBytes = 3; + else if ( status == 0xF3 ) nBytes = 2; + else if ( status == 0xF8 && (data->ignoreFlags & 0x02) ) { + // A MIDI timing tick message and we're ignoring it. + return; + } + else if ( status == 0xFE && (data->ignoreFlags & 0x04) ) { + // A MIDI active sensing message and we're ignoring it. + return; + } + + // Copy bytes to our MIDI message. + unsigned char *ptr = (unsigned char *) &midiMessage; + for ( int i=0; imessage.bytes.push_back( *ptr++ ); + } + else { // Sysex message ( MIM_LONGDATA or MIM_LONGERROR ) + MIDIHDR *sysex = ( MIDIHDR *) midiMessage; + if ( !( data->ignoreFlags & 0x01 ) && inputStatus != MIM_LONGERROR ) { + // Sysex message and we're not ignoring it + for ( int i=0; i<(int)sysex->dwBytesRecorded; ++i ) + apiData->message.bytes.push_back( sysex->lpData[i] ); + } + + // The WinMM API requires that the sysex buffer be requeued after + // input of each sysex message. Even if we are ignoring sysex + // messages, we still need to requeue the buffer in case the user + // decides to not ignore sysex messages in the future. However, + // it seems that WinMM calls this function with an empty sysex + // buffer when an application closes and in this case, we should + // avoid requeueing it, else the computer suddenly reboots after + // one or two minutes. + if ( apiData->sysexBuffer[sysex->dwUser]->dwBytesRecorded > 0 ) { + //if ( sysex->dwBytesRecorded > 0 ) { + EnterCriticalSection( &(apiData->_mutex) ); + MMRESULT result = midiInAddBuffer( apiData->inHandle, apiData->sysexBuffer[sysex->dwUser], sizeof(MIDIHDR) ); + LeaveCriticalSection( &(apiData->_mutex) ); + if ( result != MMSYSERR_NOERROR ) + std::cerr << "\nRtMidiIn::midiInputCallback: error sending sysex to Midi device!!\n\n"; + + if ( data->ignoreFlags & 0x01 ) return; + } + else return; + } + + if ( data->usingCallback ) { + RtMidiIn::RtMidiCallback callback = (RtMidiIn::RtMidiCallback) data->userCallback; + callback( apiData->message.timeStamp, &apiData->message.bytes, data->userData ); + } + else { + // As long as we haven't reached our queue size limit, push the message. + if (!data->queue.push(apiData->message)) + std::cerr << "\nMidiInWinMM: message queue limit reached!!\n\n"; + } + + // Clear the vector for the next input message. + apiData->message.bytes.clear(); +} + +MidiInWinMM :: MidiInWinMM( const std::string &clientName, unsigned int queueSizeLimit ) : MidiInApi( queueSizeLimit ) +{ + initialize( clientName ); +} + +MidiInWinMM :: ~MidiInWinMM() +{ + // Close a connection if it exists. + closePort(); + + WinMidiData *data = static_cast (apiData_); + DeleteCriticalSection( &(data->_mutex) ); + + // Cleanup. + delete data; +} + +void MidiInWinMM :: initialize( const std::string& /*clientName*/ ) +{ + // We'll issue a warning here if no devices are available but not + // throw an error since the user can plugin something later. + unsigned int nDevices = midiInGetNumDevs(); + if ( nDevices == 0 ) { + errorString_ = "MidiInWinMM::initialize: no MIDI input devices currently available."; + error( RtMidiError::WARNING, errorString_ ); + } + + // Save our api-specific connection information. + WinMidiData *data = (WinMidiData *) new WinMidiData; + apiData_ = (void *) data; + inputData_.apiData = (void *) data; + data->message.bytes.clear(); // needs to be empty for first input message + + if ( !InitializeCriticalSectionAndSpinCount(&(data->_mutex), 0x00000400) ) { + errorString_ = "MidiInWinMM::initialize: InitializeCriticalSectionAndSpinCount failed."; + error( RtMidiError::WARNING, errorString_ ); + } +} + +void MidiInWinMM :: openPort( unsigned int portNumber, const std::string &/*portName*/ ) +{ + if ( connected_ ) { + errorString_ = "MidiInWinMM::openPort: a valid connection already exists!"; + error( RtMidiError::WARNING, errorString_ ); + return; + } + + unsigned int nDevices = midiInGetNumDevs(); + if (nDevices == 0) { + errorString_ = "MidiInWinMM::openPort: no MIDI input sources found!"; + error( RtMidiError::NO_DEVICES_FOUND, errorString_ ); + return; + } + + if ( portNumber >= nDevices ) { + std::ostringstream ost; + ost << "MidiInWinMM::openPort: the 'portNumber' argument (" << portNumber << ") is invalid."; + errorString_ = ost.str(); + error( RtMidiError::INVALID_PARAMETER, errorString_ ); + return; + } + + WinMidiData *data = static_cast (apiData_); + MMRESULT result = midiInOpen( &data->inHandle, + portNumber, + (DWORD_PTR)&midiInputCallback, + (DWORD_PTR)&inputData_, + CALLBACK_FUNCTION ); + if ( result != MMSYSERR_NOERROR ) { + errorString_ = "MidiInWinMM::openPort: error creating Windows MM MIDI input port."; + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; + } + + // Allocate and init the sysex buffers. + for ( int i=0; isysexBuffer[i] = (MIDIHDR*) new char[ sizeof(MIDIHDR) ]; + data->sysexBuffer[i]->lpData = new char[ RT_SYSEX_BUFFER_SIZE ]; + data->sysexBuffer[i]->dwBufferLength = RT_SYSEX_BUFFER_SIZE; + data->sysexBuffer[i]->dwUser = i; // We use the dwUser parameter as buffer indicator + data->sysexBuffer[i]->dwFlags = 0; + + result = midiInPrepareHeader( data->inHandle, data->sysexBuffer[i], sizeof(MIDIHDR) ); + if ( result != MMSYSERR_NOERROR ) { + midiInClose( data->inHandle ); + data->inHandle = 0; + errorString_ = "MidiInWinMM::openPort: error starting Windows MM MIDI input port (PrepareHeader)."; + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; + } + + // Register the buffer. + result = midiInAddBuffer( data->inHandle, data->sysexBuffer[i], sizeof(MIDIHDR) ); + if ( result != MMSYSERR_NOERROR ) { + midiInClose( data->inHandle ); + data->inHandle = 0; + errorString_ = "MidiInWinMM::openPort: error starting Windows MM MIDI input port (AddBuffer)."; + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; + } + } + + result = midiInStart( data->inHandle ); + if ( result != MMSYSERR_NOERROR ) { + midiInClose( data->inHandle ); + data->inHandle = 0; + errorString_ = "MidiInWinMM::openPort: error starting Windows MM MIDI input port."; + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; + } + + connected_ = true; +} + +void MidiInWinMM :: openVirtualPort( const std::string &/*portName*/ ) +{ + // This function cannot be implemented for the Windows MM MIDI API. + errorString_ = "MidiInWinMM::openVirtualPort: cannot be implemented in Windows MM MIDI API!"; + error( RtMidiError::WARNING, errorString_ ); +} + +void MidiInWinMM :: closePort( void ) +{ + if ( connected_ ) { + WinMidiData *data = static_cast (apiData_); + EnterCriticalSection( &(data->_mutex) ); + midiInReset( data->inHandle ); + midiInStop( data->inHandle ); + + for ( int i=0; iinHandle, data->sysexBuffer[i], sizeof(MIDIHDR)); + delete [] data->sysexBuffer[i]->lpData; + delete [] data->sysexBuffer[i]; + if ( result != MMSYSERR_NOERROR ) { + midiInClose( data->inHandle ); + data->inHandle = 0; + errorString_ = "MidiInWinMM::openPort: error closing Windows MM MIDI input port (midiInUnprepareHeader)."; + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; + } + } + + midiInClose( data->inHandle ); + data->inHandle = 0; + connected_ = false; + LeaveCriticalSection( &(data->_mutex) ); + } +} + +unsigned int MidiInWinMM :: getPortCount() +{ + return midiInGetNumDevs(); +} + +std::string MidiInWinMM :: getPortName( unsigned int portNumber ) +{ + std::string stringName; + unsigned int nDevices = midiInGetNumDevs(); + if ( portNumber >= nDevices ) { + std::ostringstream ost; + ost << "MidiInWinMM::getPortName: the 'portNumber' argument (" << portNumber << ") is invalid."; + errorString_ = ost.str(); + error( RtMidiError::WARNING, errorString_ ); + return stringName; + } + + MIDIINCAPS deviceCaps; + midiInGetDevCaps( portNumber, &deviceCaps, sizeof(MIDIINCAPS)); + stringName = ConvertToUTF8( deviceCaps.szPname ); + + // Next lines added to add the portNumber to the name so that + // the device's names are sure to be listed with individual names + // even when they have the same brand name +#ifdef RTMIDI_ENSURE_UNIQUE_PORTNAMES + std::ostringstream os; + os << " "; + os << portNumber; + stringName += os.str(); +#endif + + return stringName; +} + +//*********************************************************************// +// API: Windows MM +// Class Definitions: MidiOutWinMM +//*********************************************************************// + +MidiOutWinMM :: MidiOutWinMM( const std::string &clientName ) : MidiOutApi() +{ + initialize( clientName ); +} + +MidiOutWinMM :: ~MidiOutWinMM() +{ + // Close a connection if it exists. + closePort(); + + // Cleanup. + WinMidiData *data = static_cast (apiData_); + delete data; +} + +void MidiOutWinMM :: initialize( const std::string& /*clientName*/ ) +{ + // We'll issue a warning here if no devices are available but not + // throw an error since the user can plug something in later. + unsigned int nDevices = midiOutGetNumDevs(); + if ( nDevices == 0 ) { + errorString_ = "MidiOutWinMM::initialize: no MIDI output devices currently available."; + error( RtMidiError::WARNING, errorString_ ); + } + + // Save our api-specific connection information. + WinMidiData *data = (WinMidiData *) new WinMidiData; + apiData_ = (void *) data; +} + +unsigned int MidiOutWinMM :: getPortCount() +{ + return midiOutGetNumDevs(); +} + +std::string MidiOutWinMM :: getPortName( unsigned int portNumber ) +{ + std::string stringName; + unsigned int nDevices = midiOutGetNumDevs(); + if ( portNumber >= nDevices ) { + std::ostringstream ost; + ost << "MidiOutWinMM::getPortName: the 'portNumber' argument (" << portNumber << ") is invalid."; + errorString_ = ost.str(); + error( RtMidiError::WARNING, errorString_ ); + return stringName; + } + + MIDIOUTCAPS deviceCaps; + midiOutGetDevCaps( portNumber, &deviceCaps, sizeof(MIDIOUTCAPS)); + stringName = ConvertToUTF8( deviceCaps.szPname ); + + // Next lines added to add the portNumber to the name so that + // the device's names are sure to be listed with individual names + // even when they have the same brand name + std::ostringstream os; +#ifdef RTMIDI_ENSURE_UNIQUE_PORTNAMES + os << " "; + os << portNumber; + stringName += os.str(); +#endif + + return stringName; +} + +void MidiOutWinMM :: openPort( unsigned int portNumber, const std::string &/*portName*/ ) +{ + if ( connected_ ) { + errorString_ = "MidiOutWinMM::openPort: a valid connection already exists!"; + error( RtMidiError::WARNING, errorString_ ); + return; + } + + unsigned int nDevices = midiOutGetNumDevs(); + if (nDevices < 1) { + errorString_ = "MidiOutWinMM::openPort: no MIDI output destinations found!"; + error( RtMidiError::NO_DEVICES_FOUND, errorString_ ); + return; + } + + if ( portNumber >= nDevices ) { + std::ostringstream ost; + ost << "MidiOutWinMM::openPort: the 'portNumber' argument (" << portNumber << ") is invalid."; + errorString_ = ost.str(); + error( RtMidiError::INVALID_PARAMETER, errorString_ ); + return; + } + + WinMidiData *data = static_cast (apiData_); + MMRESULT result = midiOutOpen( &data->outHandle, + portNumber, + (DWORD)NULL, + (DWORD)NULL, + CALLBACK_NULL ); + if ( result != MMSYSERR_NOERROR ) { + errorString_ = "MidiOutWinMM::openPort: error creating Windows MM MIDI output port."; + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; + } + + connected_ = true; +} + +void MidiOutWinMM :: closePort( void ) +{ + if ( connected_ ) { + WinMidiData *data = static_cast (apiData_); + midiOutReset( data->outHandle ); + midiOutClose( data->outHandle ); + data->outHandle = 0; + connected_ = false; + } +} + +void MidiOutWinMM :: openVirtualPort( const std::string &/*portName*/ ) +{ + // This function cannot be implemented for the Windows MM MIDI API. + errorString_ = "MidiOutWinMM::openVirtualPort: cannot be implemented in Windows MM MIDI API!"; + error( RtMidiError::WARNING, errorString_ ); +} + +void MidiOutWinMM :: sendMessage( const unsigned char *message, size_t size ) +{ + if ( !connected_ ) return; + + unsigned int nBytes = static_cast(size); + if ( nBytes == 0 ) { + errorString_ = "MidiOutWinMM::sendMessage: message argument is empty!"; + error( RtMidiError::WARNING, errorString_ ); + return; + } + + MMRESULT result; + WinMidiData *data = static_cast (apiData_); + if ( message[0] == 0xF0 ) { // Sysex message + + // Allocate buffer for sysex data. + char *buffer = (char *) malloc( nBytes ); + if ( buffer == NULL ) { + errorString_ = "MidiOutWinMM::sendMessage: error allocating sysex message memory!"; + error( RtMidiError::MEMORY_ERROR, errorString_ ); + return; + } + + // Copy data to buffer. + for ( unsigned int i=0; ioutHandle, &sysex, sizeof(MIDIHDR) ); + if ( result != MMSYSERR_NOERROR ) { + free( buffer ); + errorString_ = "MidiOutWinMM::sendMessage: error preparing sysex header."; + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; + } + + // Send the message. + result = midiOutLongMsg( data->outHandle, &sysex, sizeof(MIDIHDR) ); + if ( result != MMSYSERR_NOERROR ) { + free( buffer ); + errorString_ = "MidiOutWinMM::sendMessage: error sending sysex message."; + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; + } + + // Unprepare the buffer and MIDIHDR. + while ( MIDIERR_STILLPLAYING == midiOutUnprepareHeader( data->outHandle, &sysex, sizeof (MIDIHDR) ) ) Sleep( 1 ); + free( buffer ); + } + else { // Channel or system message. + + // Make sure the message size isn't too big. + if ( nBytes > 3 ) { + errorString_ = "MidiOutWinMM::sendMessage: message size is greater than 3 bytes (and not sysex)!"; + error( RtMidiError::WARNING, errorString_ ); + return; + } + + // Pack MIDI bytes into double word. + DWORD packet; + unsigned char *ptr = (unsigned char *) &packet; + for ( unsigned int i=0; ioutHandle, packet ); + if ( result != MMSYSERR_NOERROR ) { + errorString_ = "MidiOutWinMM::sendMessage: error sending MIDI message."; + error( RtMidiError::DRIVER_ERROR, errorString_ ); + } + } +} + +#endif // __WINDOWS_MM__ + + +//*********************************************************************// +// API: UNIX JACK +// +// Written primarily by Alexander Svetalkin, with updates for delta +// time by Gary Scavone, April 2011. +// +// *********************************************************************// + +#if defined(__UNIX_JACK__) + +// JACK header files +#include +#include +#include +#ifdef HAVE_SEMAPHORE + #include +#endif + +#define JACK_RINGBUFFER_SIZE 16384 // Default size for ringbuffer + +struct JackMidiData { + jack_client_t *client; + jack_port_t *port; + jack_ringbuffer_t *buffSize; + jack_ringbuffer_t *buffMessage; + jack_time_t lastTime; +#ifdef HAVE_SEMAPHORE + sem_t sem_cleanup; + sem_t sem_needpost; +#endif + MidiInApi :: RtMidiInData *rtMidiIn; + }; + +//*********************************************************************// +// API: JACK +// Class Definitions: MidiInJack +//*********************************************************************// + +static int jackProcessIn( jack_nframes_t nframes, void *arg ) +{ + JackMidiData *jData = (JackMidiData *) arg; + MidiInApi :: RtMidiInData *rtData = jData->rtMidiIn; + jack_midi_event_t event; + jack_time_t time; + + // Is port created? + if ( jData->port == NULL ) return 0; + void *buff = jack_port_get_buffer( jData->port, nframes ); + + // We have midi events in buffer + int evCount = jack_midi_get_event_count( buff ); + for (int j = 0; j < evCount; j++) { + MidiInApi::MidiMessage message; + message.bytes.clear(); + + jack_midi_event_get( &event, buff, j ); + + for ( unsigned int i = 0; i < event.size; i++ ) + message.bytes.push_back( event.buffer[i] ); + + // Compute the delta time. + time = jack_get_time(); + if ( rtData->firstMessage == true ) + rtData->firstMessage = false; + else + message.timeStamp = ( time - jData->lastTime ) * 0.000001; + + jData->lastTime = time; + + if ( !rtData->continueSysex ) { + if ( rtData->usingCallback ) { + RtMidiIn::RtMidiCallback callback = (RtMidiIn::RtMidiCallback) rtData->userCallback; + callback( message.timeStamp, &message.bytes, rtData->userData ); + } + else { + // As long as we haven't reached our queue size limit, push the message. + if (!rtData->queue.push(message)) + std::cerr << "\nMidiInJack: message queue limit reached!!\n\n"; + } + } + } + + return 0; +} + +MidiInJack :: MidiInJack( const std::string &clientName, unsigned int queueSizeLimit ) : MidiInApi( queueSizeLimit ) +{ + initialize( clientName ); +} + +void MidiInJack :: initialize( const std::string& clientName ) +{ + JackMidiData *data = new JackMidiData; + apiData_ = (void *) data; + + data->rtMidiIn = &inputData_; + data->port = NULL; + data->client = NULL; + this->clientName = clientName; + + connect(); +} + +void MidiInJack :: connect() +{ + JackMidiData *data = static_cast (apiData_); + if ( data->client ) + return; + + // Initialize JACK client + if (( data->client = jack_client_open( clientName.c_str(), JackNoStartServer, NULL )) == 0) { + errorString_ = "MidiInJack::initialize: JACK server not running?"; + error( RtMidiError::WARNING, errorString_ ); + return; + } + + jack_set_process_callback( data->client, jackProcessIn, data ); + jack_activate( data->client ); +} + +MidiInJack :: ~MidiInJack() +{ + JackMidiData *data = static_cast (apiData_); + closePort(); + + if ( data->client ) + jack_client_close( data->client ); + delete data; +} + +void MidiInJack :: openPort( unsigned int portNumber, const std::string &portName ) +{ + JackMidiData *data = static_cast (apiData_); + + connect(); + + // Creating new port + if ( data->port == NULL) + data->port = jack_port_register( data->client, portName.c_str(), + JACK_DEFAULT_MIDI_TYPE, JackPortIsInput, 0 ); + + if ( data->port == NULL) { + errorString_ = "MidiInJack::openPort: JACK error creating port"; + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; + } + + // Connecting to the output + std::string name = getPortName( portNumber ); + jack_connect( data->client, name.c_str(), jack_port_name( data->port ) ); +} + +void MidiInJack :: openVirtualPort( const std::string &portName ) +{ + JackMidiData *data = static_cast (apiData_); + + connect(); + if ( data->port == NULL ) + data->port = jack_port_register( data->client, portName.c_str(), + JACK_DEFAULT_MIDI_TYPE, JackPortIsInput, 0 ); + + if ( data->port == NULL ) { + errorString_ = "MidiInJack::openVirtualPort: JACK error creating virtual port"; + error( RtMidiError::DRIVER_ERROR, errorString_ ); + } +} + +unsigned int MidiInJack :: getPortCount() +{ + int count = 0; + JackMidiData *data = static_cast (apiData_); + connect(); + if ( !data->client ) + return 0; + + // List of available ports + const char **ports = jack_get_ports( data->client, NULL, JACK_DEFAULT_MIDI_TYPE, JackPortIsOutput ); + + if ( ports == NULL ) return 0; + while ( ports[count] != NULL ) + count++; + + free( ports ); + + return count; +} + +std::string MidiInJack :: getPortName( unsigned int portNumber ) +{ + JackMidiData *data = static_cast (apiData_); + std::string retStr(""); + + connect(); + + // List of available ports + const char **ports = jack_get_ports( data->client, NULL, + JACK_DEFAULT_MIDI_TYPE, JackPortIsOutput ); + + // Check port validity + if ( ports == NULL ) { + errorString_ = "MidiInJack::getPortName: no ports available!"; + error( RtMidiError::WARNING, errorString_ ); + return retStr; + } + + if ( ports[portNumber] == NULL ) { + std::ostringstream ost; + ost << "MidiInJack::getPortName: the 'portNumber' argument (" << portNumber << ") is invalid."; + errorString_ = ost.str(); + error( RtMidiError::WARNING, errorString_ ); + } + else retStr.assign( ports[portNumber] ); + + free( ports ); + return retStr; +} + +void MidiInJack :: closePort() +{ + JackMidiData *data = static_cast (apiData_); + + if ( data->port == NULL ) return; + jack_port_unregister( data->client, data->port ); + data->port = NULL; +} + +//*********************************************************************// +// API: JACK +// Class Definitions: MidiOutJack +//*********************************************************************// + +// Jack process callback +static int jackProcessOut( jack_nframes_t nframes, void *arg ) +{ + JackMidiData *data = (JackMidiData *) arg; + jack_midi_data_t *midiData; + int space; + + // Is port created? + if ( data->port == NULL ) return 0; + + void *buff = jack_port_get_buffer( data->port, nframes ); + jack_midi_clear_buffer( buff ); + + while ( jack_ringbuffer_read_space( data->buffSize ) > 0 ) { + jack_ringbuffer_read( data->buffSize, (char *) &space, (size_t) sizeof(space) ); + midiData = jack_midi_event_reserve( buff, 0, space ); + + jack_ringbuffer_read( data->buffMessage, (char *) midiData, (size_t) space ); + } + +#ifdef HAVE_SEMAPHORE + if (!sem_trywait(&data->sem_needpost)) + sem_post(&data->sem_cleanup); +#endif + + return 0; +} + +MidiOutJack :: MidiOutJack( const std::string &clientName ) : MidiOutApi() +{ + initialize( clientName ); +} + +void MidiOutJack :: initialize( const std::string& clientName ) +{ + JackMidiData *data = new JackMidiData; + apiData_ = (void *) data; + + data->port = NULL; + data->client = NULL; +#ifdef HAVE_SEMAPHORE + sem_init(&data->sem_cleanup, 0, 0); + sem_init(&data->sem_needpost, 0, 0); +#endif + this->clientName = clientName; + + connect(); +} + +void MidiOutJack :: connect() +{ + JackMidiData *data = static_cast (apiData_); + if ( data->client ) + return; + + // Initialize output ringbuffers + data->buffSize = jack_ringbuffer_create( JACK_RINGBUFFER_SIZE ); + data->buffMessage = jack_ringbuffer_create( JACK_RINGBUFFER_SIZE ); + + // Initialize JACK client + if (( data->client = jack_client_open( clientName.c_str(), JackNoStartServer, NULL )) == 0) { + errorString_ = "MidiOutJack::initialize: JACK server not running?"; + error( RtMidiError::WARNING, errorString_ ); + return; + } + + jack_set_process_callback( data->client, jackProcessOut, data ); + jack_activate( data->client ); +} + +MidiOutJack :: ~MidiOutJack() +{ + JackMidiData *data = static_cast (apiData_); + closePort(); + + // Cleanup + jack_ringbuffer_free( data->buffSize ); + jack_ringbuffer_free( data->buffMessage ); + if ( data->client ) { + jack_client_close( data->client ); + } + +#ifdef HAVE_SEMAPHORE + sem_destroy(&data->sem_cleanup); + sem_destroy(&data->sem_needpost); +#endif + + delete data; +} + +void MidiOutJack :: openPort( unsigned int portNumber, const std::string &portName ) +{ + JackMidiData *data = static_cast (apiData_); + + connect(); + + // Creating new port + if ( data->port == NULL ) + data->port = jack_port_register( data->client, portName.c_str(), + JACK_DEFAULT_MIDI_TYPE, JackPortIsOutput, 0 ); + + if ( data->port == NULL ) { + errorString_ = "MidiOutJack::openPort: JACK error creating port"; + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; + } + + // Connecting to the output + std::string name = getPortName( portNumber ); + jack_connect( data->client, jack_port_name( data->port ), name.c_str() ); +} + +void MidiOutJack :: openVirtualPort( const std::string &portName ) +{ + JackMidiData *data = static_cast (apiData_); + + connect(); + if ( data->port == NULL ) + data->port = jack_port_register( data->client, portName.c_str(), + JACK_DEFAULT_MIDI_TYPE, JackPortIsOutput, 0 ); + + if ( data->port == NULL ) { + errorString_ = "MidiOutJack::openVirtualPort: JACK error creating virtual port"; + error( RtMidiError::DRIVER_ERROR, errorString_ ); + } +} + +unsigned int MidiOutJack :: getPortCount() +{ + int count = 0; + JackMidiData *data = static_cast (apiData_); + connect(); + if ( !data->client ) + return 0; + + // List of available ports + const char **ports = jack_get_ports( data->client, NULL, + JACK_DEFAULT_MIDI_TYPE, JackPortIsInput ); + + if ( ports == NULL ) return 0; + while ( ports[count] != NULL ) + count++; + + free( ports ); + + return count; +} + +std::string MidiOutJack :: getPortName( unsigned int portNumber ) +{ + JackMidiData *data = static_cast (apiData_); + std::string retStr(""); + + connect(); + + // List of available ports + const char **ports = jack_get_ports( data->client, NULL, + JACK_DEFAULT_MIDI_TYPE, JackPortIsInput ); + + // Check port validity + if ( ports == NULL) { + errorString_ = "MidiOutJack::getPortName: no ports available!"; + error( RtMidiError::WARNING, errorString_ ); + return retStr; + } + + if ( ports[portNumber] == NULL) { + std::ostringstream ost; + ost << "MidiOutJack::getPortName: the 'portNumber' argument (" << portNumber << ") is invalid."; + errorString_ = ost.str(); + error( RtMidiError::WARNING, errorString_ ); + } + else retStr.assign( ports[portNumber] ); + + free( ports ); + return retStr; +} + +void MidiOutJack :: closePort() +{ + JackMidiData *data = static_cast (apiData_); + + if ( data->port == NULL ) return; + +#ifdef HAVE_SEMAPHORE + struct timespec ts; + if (clock_gettime(CLOCK_REALTIME, &ts) != -1) + { + ts.tv_sec += 1; // wait max one second + sem_post(&data->sem_needpost); + sem_timedwait(&data->sem_cleanup, &ts); + } +#endif + + jack_port_unregister( data->client, data->port ); + data->port = NULL; +} + +void MidiOutJack :: sendMessage( const unsigned char *message, size_t size ) +{ + int nBytes = static_cast(size); + JackMidiData *data = static_cast (apiData_); + + // Write full message to buffer + jack_ringbuffer_write( data->buffMessage, ( const char * ) message, + nBytes ); + jack_ringbuffer_write( data->buffSize, ( char * ) &nBytes, sizeof( nBytes ) ); +} + +#endif // __UNIX_JACK__ diff --git a/src/orchestra/midi/RtMidi.h b/src/orchestra/midi/RtMidi.h new file mode 100644 index 0000000..7ab50a9 --- /dev/null +++ b/src/orchestra/midi/RtMidi.h @@ -0,0 +1,794 @@ +/**********************************************************************/ +/*! \class RtMidi + \brief An abstract base class for realtime MIDI input/output. + + This class implements some common functionality for the realtime + MIDI input/output subclasses RtMidiIn and RtMidiOut. + + RtMidi WWW site: http://music.mcgill.ca/~gary/rtmidi/ + + RtMidi: realtime MIDI i/o C++ classes + Copyright (c) 2003-2017 Gary P. Scavone + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + Any person wishing to distribute modifications to the Software is + asked to send the modifications to the original developer so that + they can be incorporated into the canonical version. This is, + however, not a binding provision of this license. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ +/**********************************************************************/ + +/*! + \file RtMidi.h + */ + +#ifndef RTMIDI_H +#define RTMIDI_H + +#define RTMIDI_VERSION "3.0.0" + +#include +#include +#include +#include + +/************************************************************************/ +/*! \class RtMidiError + \brief Exception handling class for RtMidi. + + The RtMidiError class is quite simple but it does allow errors to be + "caught" by RtMidiError::Type. See the RtMidi documentation to know + which methods can throw an RtMidiError. +*/ +/************************************************************************/ + +class RtMidiError : public std::exception +{ + public: + //! Defined RtMidiError types. + enum Type { + WARNING, /*!< A non-critical error. */ + DEBUG_WARNING, /*!< A non-critical error which might be useful for debugging. */ + UNSPECIFIED, /*!< The default, unspecified error type. */ + NO_DEVICES_FOUND, /*!< No devices found on system. */ + INVALID_DEVICE, /*!< An invalid device ID was specified. */ + MEMORY_ERROR, /*!< An error occured during memory allocation. */ + INVALID_PARAMETER, /*!< An invalid parameter was specified to a function. */ + INVALID_USE, /*!< The function was called incorrectly. */ + DRIVER_ERROR, /*!< A system driver error occured. */ + SYSTEM_ERROR, /*!< A system error occured. */ + THREAD_ERROR /*!< A thread error occured. */ + }; + + //! The constructor. + RtMidiError( const std::string& message, Type type = RtMidiError::UNSPECIFIED ) throw() : message_(message), type_(type) {} + + //! The destructor. + virtual ~RtMidiError( void ) throw() {} + + //! Prints thrown error message to stderr. + virtual void printMessage( void ) const throw() { std::cerr << '\n' << message_ << "\n\n"; } + + //! Returns the thrown error message type. + virtual const Type& getType(void) const throw() { return type_; } + + //! Returns the thrown error message string. + virtual const std::string& getMessage(void) const throw() { return message_; } + + //! Returns the thrown error message as a c-style string. + virtual const char* what( void ) const throw() { return message_.c_str(); } + + protected: + std::string message_; + Type type_; +}; + +//! RtMidi error callback function prototype. +/*! + \param type Type of error. + \param errorText Error description. + + Note that class behaviour is undefined after a critical error (not + a warning) is reported. + */ +typedef void (*RtMidiErrorCallback)( RtMidiError::Type type, const std::string &errorText, void *userData ); + +class MidiApi; + +class RtMidi +{ + public: + + //! MIDI API specifier arguments. + enum Api { + UNSPECIFIED, /*!< Search for a working compiled API. */ + MACOSX_CORE, /*!< Macintosh OS-X Core Midi API. */ + LINUX_ALSA, /*!< The Advanced Linux Sound Architecture API. */ + UNIX_JACK, /*!< The JACK Low-Latency MIDI Server API. */ + WINDOWS_MM, /*!< The Microsoft Multimedia MIDI API. */ + RTMIDI_DUMMY /*!< A compilable but non-functional API. */ + }; + + //! A static function to determine the current RtMidi version. + static std::string getVersion( void ) throw(); + + //! A static function to determine the available compiled MIDI APIs. + /*! + The values returned in the std::vector can be compared against + the enumerated list values. Note that there can be more than one + API compiled for certain operating systems. + */ + static void getCompiledApi( std::vector &apis ) throw(); + + //! Pure virtual openPort() function. + virtual void openPort( unsigned int portNumber = 0, const std::string &portName = std::string( "RtMidi" ) ) = 0; + + //! Pure virtual openVirtualPort() function. + virtual void openVirtualPort( const std::string &portName = std::string( "RtMidi" ) ) = 0; + + //! Pure virtual getPortCount() function. + virtual unsigned int getPortCount() = 0; + + //! Pure virtual getPortName() function. + virtual std::string getPortName( unsigned int portNumber = 0 ) = 0; + + //! Pure virtual closePort() function. + virtual void closePort( void ) = 0; + + //! Returns true if a port is open and false if not. + /*! + Note that this only applies to connections made with the openPort() + function, not to virtual ports. + */ + virtual bool isPortOpen( void ) const = 0; + + //! Set an error callback function to be invoked when an error has occured. + /*! + The callback function will be called whenever an error has occured. It is best + to set the error callback function before opening a port. + */ + virtual void setErrorCallback( RtMidiErrorCallback errorCallback = NULL, void *userData = 0 ) = 0; + + protected: + + RtMidi(); + virtual ~RtMidi(); + + MidiApi *rtapi_; +}; + +/**********************************************************************/ +/*! \class RtMidiIn + \brief A realtime MIDI input class. + + This class provides a common, platform-independent API for + realtime MIDI input. It allows access to a single MIDI input + port. Incoming MIDI messages are either saved to a queue for + retrieval using the getMessage() function or immediately passed to + a user-specified callback function. Create multiple instances of + this class to connect to more than one MIDI device at the same + time. With the OS-X, Linux ALSA, and JACK MIDI APIs, it is also + possible to open a virtual input port to which other MIDI software + clients can connect. + + by Gary P. Scavone, 2003-2017. +*/ +/**********************************************************************/ + +// **************************************************************** // +// +// RtMidiIn and RtMidiOut class declarations. +// +// RtMidiIn / RtMidiOut are "controllers" used to select an available +// MIDI input or output interface. They present common APIs for the +// user to call but all functionality is implemented by the classes +// MidiInApi, MidiOutApi and their subclasses. RtMidiIn and RtMidiOut +// each create an instance of a MidiInApi or MidiOutApi subclass based +// on the user's API choice. If no choice is made, they attempt to +// make a "logical" API selection. +// +// **************************************************************** // + +class RtMidiIn : public RtMidi +{ + public: + + //! User callback function type definition. + typedef void (*RtMidiCallback)( double timeStamp, std::vector *message, void *userData); + + //! Default constructor that allows an optional api, client name and queue size. + /*! + An exception will be thrown if a MIDI system initialization + error occurs. The queue size defines the maximum number of + messages that can be held in the MIDI queue (when not using a + callback function). If the queue size limit is reached, + incoming messages will be ignored. + + If no API argument is specified and multiple API support has been + compiled, the default order of use is ALSA, JACK (Linux) and CORE, + JACK (OS-X). + + \param api An optional API id can be specified. + \param clientName An optional client name can be specified. This + will be used to group the ports that are created + by the application. + \param queueSizeLimit An optional size of the MIDI input queue can be specified. + */ + RtMidiIn( RtMidi::Api api=UNSPECIFIED, + const std::string& clientName = "RtMidi Input Client", + unsigned int queueSizeLimit = 100 ); + + //! If a MIDI connection is still open, it will be closed by the destructor. + ~RtMidiIn ( void ) throw(); + + //! Returns the MIDI API specifier for the current instance of RtMidiIn. + RtMidi::Api getCurrentApi( void ) throw(); + + //! Open a MIDI input connection given by enumeration number. + /*! + \param portNumber An optional port number greater than 0 can be specified. + Otherwise, the default or first port found is opened. + \param portName An optional name for the application port that is used to connect to portId can be specified. + */ + void openPort( unsigned int portNumber = 0, const std::string &portName = std::string( "RtMidi Input" ) ); + + //! Create a virtual input port, with optional name, to allow software connections (OS X, JACK and ALSA only). + /*! + This function creates a virtual MIDI input port to which other + software applications can connect. This type of functionality + is currently only supported by the Macintosh OS-X, any JACK, + and Linux ALSA APIs (the function returns an error for the other APIs). + + \param portName An optional name for the application port that is + used to connect to portId can be specified. + */ + void openVirtualPort( const std::string &portName = std::string( "RtMidi Input" ) ); + + //! Set a callback function to be invoked for incoming MIDI messages. + /*! + The callback function will be called whenever an incoming MIDI + message is received. While not absolutely necessary, it is best + to set the callback function before opening a MIDI port to avoid + leaving some messages in the queue. + + \param callback A callback function must be given. + \param userData Optionally, a pointer to additional data can be + passed to the callback function whenever it is called. + */ + void setCallback( RtMidiCallback callback, void *userData = 0 ); + + //! Cancel use of the current callback function (if one exists). + /*! + Subsequent incoming MIDI messages will be written to the queue + and can be retrieved with the \e getMessage function. + */ + void cancelCallback(); + + //! Close an open MIDI connection (if one exists). + void closePort( void ); + + //! Returns true if a port is open and false if not. + /*! + Note that this only applies to connections made with the openPort() + function, not to virtual ports. + */ + virtual bool isPortOpen() const; + + //! Return the number of available MIDI input ports. + /*! + \return This function returns the number of MIDI ports of the selected API. + */ + unsigned int getPortCount(); + + //! Return a string identifier for the specified MIDI input port number. + /*! + \return The name of the port with the given Id is returned. + \retval An empty string is returned if an invalid port specifier + is provided. User code should assume a UTF-8 encoding. + */ + std::string getPortName( unsigned int portNumber = 0 ); + + //! Specify whether certain MIDI message types should be queued or ignored during input. + /*! + By default, MIDI timing and active sensing messages are ignored + during message input because of their relative high data rates. + MIDI sysex messages are ignored by default as well. Variable + values of "true" imply that the respective message type will be + ignored. + */ + void ignoreTypes( bool midiSysex = true, bool midiTime = true, bool midiSense = true ); + + //! Fill the user-provided vector with the data bytes for the next available MIDI message in the input queue and return the event delta-time in seconds. + /*! + This function returns immediately whether a new message is + available or not. A valid message is indicated by a non-zero + vector size. An exception is thrown if an error occurs during + message retrieval or an input connection was not previously + established. + */ + double getMessage( std::vector *message ); + + //! Set an error callback function to be invoked when an error has occured. + /*! + The callback function will be called whenever an error has occured. It is best + to set the error callback function before opening a port. + */ + virtual void setErrorCallback( RtMidiErrorCallback errorCallback = NULL, void *userData = 0 ); + + protected: + void openMidiApi( RtMidi::Api api, const std::string &clientName, unsigned int queueSizeLimit ); + +}; + +/**********************************************************************/ +/*! \class RtMidiOut + \brief A realtime MIDI output class. + + This class provides a common, platform-independent API for MIDI + output. It allows one to probe available MIDI output ports, to + connect to one such port, and to send MIDI bytes immediately over + the connection. Create multiple instances of this class to + connect to more than one MIDI device at the same time. With the + OS-X, Linux ALSA and JACK MIDI APIs, it is also possible to open a + virtual port to which other MIDI software clients can connect. + + by Gary P. Scavone, 2003-2017. +*/ +/**********************************************************************/ + +class RtMidiOut : public RtMidi +{ + public: + + //! Default constructor that allows an optional client name. + /*! + An exception will be thrown if a MIDI system initialization error occurs. + + If no API argument is specified and multiple API support has been + compiled, the default order of use is ALSA, JACK (Linux) and CORE, + JACK (OS-X). + */ + RtMidiOut( RtMidi::Api api=UNSPECIFIED, + const std::string& clientName = "RtMidi Output Client" ); + + //! The destructor closes any open MIDI connections. + ~RtMidiOut( void ) throw(); + + //! Returns the MIDI API specifier for the current instance of RtMidiOut. + RtMidi::Api getCurrentApi( void ) throw(); + + //! Open a MIDI output connection. + /*! + An optional port number greater than 0 can be specified. + Otherwise, the default or first port found is opened. An + exception is thrown if an error occurs while attempting to make + the port connection. + */ + void openPort( unsigned int portNumber = 0, const std::string &portName = std::string( "RtMidi Output" ) ); + + //! Close an open MIDI connection (if one exists). + void closePort( void ); + + //! Returns true if a port is open and false if not. + /*! + Note that this only applies to connections made with the openPort() + function, not to virtual ports. + */ + virtual bool isPortOpen() const; + + //! Create a virtual output port, with optional name, to allow software connections (OS X, JACK and ALSA only). + /*! + This function creates a virtual MIDI output port to which other + software applications can connect. This type of functionality + is currently only supported by the Macintosh OS-X, Linux ALSA + and JACK APIs (the function does nothing with the other APIs). + An exception is thrown if an error occurs while attempting to + create the virtual port. + */ + void openVirtualPort( const std::string &portName = std::string( "RtMidi Output" ) ); + + //! Return the number of available MIDI output ports. + unsigned int getPortCount( void ); + + //! Return a string identifier for the specified MIDI port type and number. + /*! + \return The name of the port with the given Id is returned. + \retval An empty string is returned if an invalid port specifier + is provided. User code should assume a UTF-8 encoding. + */ + std::string getPortName( unsigned int portNumber = 0 ); + + //! Immediately send a single message out an open MIDI output port. + /*! + An exception is thrown if an error occurs during output or an + output connection was not previously established. + */ + void sendMessage( const std::vector *message ); + + //! Immediately send a single message out an open MIDI output port. + /*! + An exception is thrown if an error occurs during output or an + output connection was not previously established. + + \param message A pointer to the MIDI message as raw bytes + \param size Length of the MIDI message in bytes + */ + void sendMessage( const unsigned char *message, size_t size ); + + //! Set an error callback function to be invoked when an error has occured. + /*! + The callback function will be called whenever an error has occured. It is best + to set the error callback function before opening a port. + */ + virtual void setErrorCallback( RtMidiErrorCallback errorCallback = NULL, void *userData = 0 ); + + protected: + void openMidiApi( RtMidi::Api api, const std::string &clientName ); +}; + + +// **************************************************************** // +// +// MidiInApi / MidiOutApi class declarations. +// +// Subclasses of MidiInApi and MidiOutApi contain all API- and +// OS-specific code necessary to fully implement the RtMidi API. +// +// Note that MidiInApi and MidiOutApi are abstract base classes and +// cannot be explicitly instantiated. RtMidiIn and RtMidiOut will +// create instances of a MidiInApi or MidiOutApi subclass. +// +// **************************************************************** // + +class MidiApi +{ + public: + + MidiApi(); + virtual ~MidiApi(); + virtual RtMidi::Api getCurrentApi( void ) = 0; + virtual void openPort( unsigned int portNumber, const std::string &portName ) = 0; + virtual void openVirtualPort( const std::string &portName ) = 0; + virtual void closePort( void ) = 0; + + virtual unsigned int getPortCount( void ) = 0; + virtual std::string getPortName( unsigned int portNumber ) = 0; + + inline bool isPortOpen() const { return connected_; } + void setErrorCallback( RtMidiErrorCallback errorCallback, void *userData ); + + //! A basic error reporting function for RtMidi classes. + void error( RtMidiError::Type type, std::string errorString ); + +protected: + virtual void initialize( const std::string& clientName ) = 0; + + void *apiData_; + bool connected_; + std::string errorString_; + RtMidiErrorCallback errorCallback_; + bool firstErrorOccurred_; + void *errorCallbackUserData_; +}; + +class MidiInApi : public MidiApi +{ + public: + + MidiInApi( unsigned int queueSizeLimit ); + virtual ~MidiInApi( void ); + void setCallback( RtMidiIn::RtMidiCallback callback, void *userData ); + void cancelCallback( void ); + virtual void ignoreTypes( bool midiSysex, bool midiTime, bool midiSense ); + double getMessage( std::vector *message ); + + // A MIDI structure used internally by the class to store incoming + // messages. Each message represents one and only one MIDI message. + struct MidiMessage { + std::vector bytes; + + //! Time in seconds elapsed since the previous message + double timeStamp; + + // Default constructor. + MidiMessage() + :bytes(0), timeStamp(0.0) {} + }; + + struct MidiQueue { + unsigned int front; + unsigned int back; + unsigned int ringSize; + MidiMessage *ring; + + // Default constructor. + MidiQueue() + :front(0), back(0), ringSize(0), ring(0) {} + bool push(const MidiMessage&); + bool pop(std::vector*, double*); + unsigned int size(unsigned int *back=0, + unsigned int *front=0); + }; + + // The RtMidiInData structure is used to pass private class data to + // the MIDI input handling function or thread. + struct RtMidiInData { + MidiQueue queue; + MidiMessage message; + unsigned char ignoreFlags; + bool doInput; + bool firstMessage; + void *apiData; + bool usingCallback; + RtMidiIn::RtMidiCallback userCallback; + void *userData; + bool continueSysex; + + // Default constructor. + RtMidiInData() + : ignoreFlags(7), doInput(false), firstMessage(true), + apiData(0), usingCallback(false), userCallback(0), userData(0), + continueSysex(false) {} + }; + + protected: + RtMidiInData inputData_; +}; + +class MidiOutApi : public MidiApi +{ + public: + + MidiOutApi( void ); + virtual ~MidiOutApi( void ); + virtual void sendMessage( const unsigned char *message, size_t size ) = 0; +}; + +// **************************************************************** // +// +// Inline RtMidiIn and RtMidiOut definitions. +// +// **************************************************************** // + +inline RtMidi::Api RtMidiIn :: getCurrentApi( void ) throw() { return rtapi_->getCurrentApi(); } +inline void RtMidiIn :: openPort( unsigned int portNumber, const std::string &portName ) { rtapi_->openPort( portNumber, portName ); } +inline void RtMidiIn :: openVirtualPort( const std::string &portName ) { rtapi_->openVirtualPort( portName ); } +inline void RtMidiIn :: closePort( void ) { rtapi_->closePort(); } +inline bool RtMidiIn :: isPortOpen() const { return rtapi_->isPortOpen(); } +inline void RtMidiIn :: setCallback( RtMidiCallback callback, void *userData ) { ((MidiInApi *)rtapi_)->setCallback( callback, userData ); } +inline void RtMidiIn :: cancelCallback( void ) { ((MidiInApi *)rtapi_)->cancelCallback(); } +inline unsigned int RtMidiIn :: getPortCount( void ) { return rtapi_->getPortCount(); } +inline std::string RtMidiIn :: getPortName( unsigned int portNumber ) { return rtapi_->getPortName( portNumber ); } +inline void RtMidiIn :: ignoreTypes( bool midiSysex, bool midiTime, bool midiSense ) { ((MidiInApi *)rtapi_)->ignoreTypes( midiSysex, midiTime, midiSense ); } +inline double RtMidiIn :: getMessage( std::vector *message ) { return ((MidiInApi *)rtapi_)->getMessage( message ); } +inline void RtMidiIn :: setErrorCallback( RtMidiErrorCallback errorCallback, void *userData ) { rtapi_->setErrorCallback(errorCallback, userData); } + +inline RtMidi::Api RtMidiOut :: getCurrentApi( void ) throw() { return rtapi_->getCurrentApi(); } +inline void RtMidiOut :: openPort( unsigned int portNumber, const std::string &portName ) { rtapi_->openPort( portNumber, portName ); } +inline void RtMidiOut :: openVirtualPort( const std::string &portName ) { rtapi_->openVirtualPort( portName ); } +inline void RtMidiOut :: closePort( void ) { rtapi_->closePort(); } +inline bool RtMidiOut :: isPortOpen() const { return rtapi_->isPortOpen(); } +inline unsigned int RtMidiOut :: getPortCount( void ) { return rtapi_->getPortCount(); } +inline std::string RtMidiOut :: getPortName( unsigned int portNumber ) { return rtapi_->getPortName( portNumber ); } +inline void RtMidiOut :: sendMessage( const std::vector *message ) { ((MidiOutApi *)rtapi_)->sendMessage( &message->at(0), message->size() ); } +inline void RtMidiOut :: sendMessage( const unsigned char *message, size_t size ) { ((MidiOutApi *)rtapi_)->sendMessage( message, size ); } +inline void RtMidiOut :: setErrorCallback( RtMidiErrorCallback errorCallback, void *userData ) { rtapi_->setErrorCallback(errorCallback, userData); } + +// **************************************************************** // +// +// MidiInApi and MidiOutApi subclass prototypes. +// +// **************************************************************** // + +#if !defined(__LINUX_ALSA__) && !defined(__UNIX_JACK__) && !defined(__MACOSX_CORE__) && !defined(__WINDOWS_MM__) + #define __RTMIDI_DUMMY__ +#endif + +#if defined(__MACOSX_CORE__) + +class MidiInCore: public MidiInApi +{ + public: + MidiInCore( const std::string &clientName, unsigned int queueSizeLimit ); + ~MidiInCore( void ); + RtMidi::Api getCurrentApi( void ) { return RtMidi::MACOSX_CORE; }; + void openPort( unsigned int portNumber, const std::string &portName ); + void openVirtualPort( const std::string &portName ); + void closePort( void ); + unsigned int getPortCount( void ); + std::string getPortName( unsigned int portNumber ); + + protected: + void initialize( const std::string& clientName ); +}; + +class MidiOutCore: public MidiOutApi +{ + public: + MidiOutCore( const std::string &clientName ); + ~MidiOutCore( void ); + RtMidi::Api getCurrentApi( void ) { return RtMidi::MACOSX_CORE; }; + void openPort( unsigned int portNumber, const std::string &portName ); + void openVirtualPort( const std::string &portName ); + void closePort( void ); + unsigned int getPortCount( void ); + std::string getPortName( unsigned int portNumber ); + void sendMessage( const unsigned char *message, size_t size ); + + protected: + void initialize( const std::string& clientName ); +}; + +#endif + +#if defined(__UNIX_JACK__) + +class MidiInJack: public MidiInApi +{ + public: + MidiInJack( const std::string &clientName, unsigned int queueSizeLimit ); + ~MidiInJack( void ); + RtMidi::Api getCurrentApi( void ) { return RtMidi::UNIX_JACK; }; + void openPort( unsigned int portNumber, const std::string &portName ); + void openVirtualPort( const std::string &portName ); + void closePort( void ); + unsigned int getPortCount( void ); + std::string getPortName( unsigned int portNumber ); + + protected: + std::string clientName; + + void connect( void ); + void initialize( const std::string& clientName ); +}; + +class MidiOutJack: public MidiOutApi +{ + public: + MidiOutJack( const std::string &clientName ); + ~MidiOutJack( void ); + RtMidi::Api getCurrentApi( void ) { return RtMidi::UNIX_JACK; }; + void openPort( unsigned int portNumber, const std::string &portName ); + void openVirtualPort( const std::string &portName ); + void closePort( void ); + unsigned int getPortCount( void ); + std::string getPortName( unsigned int portNumber ); + void sendMessage( const unsigned char *message, size_t size ); + + protected: + std::string clientName; + + void connect( void ); + void initialize( const std::string& clientName ); +}; + +#endif + +#if defined(__LINUX_ALSA__) + +class MidiInAlsa: public MidiInApi +{ + public: + MidiInAlsa( const std::string &clientName, unsigned int queueSizeLimit ); + ~MidiInAlsa( void ); + RtMidi::Api getCurrentApi( void ) { return RtMidi::LINUX_ALSA; }; + void openPort( unsigned int portNumber, const std::string &portName ); + void openVirtualPort( const std::string &portName ); + void closePort( void ); + unsigned int getPortCount( void ); + std::string getPortName( unsigned int portNumber ); + + protected: + void initialize( const std::string& clientName ); +}; + +class MidiOutAlsa: public MidiOutApi +{ + public: + MidiOutAlsa( const std::string &clientName ); + ~MidiOutAlsa( void ); + RtMidi::Api getCurrentApi( void ) { return RtMidi::LINUX_ALSA; }; + void openPort( unsigned int portNumber, const std::string &portName ); + void openVirtualPort( const std::string &portName ); + void closePort( void ); + unsigned int getPortCount( void ); + std::string getPortName( unsigned int portNumber ); + void sendMessage( const unsigned char *message, size_t size ); + + protected: + void initialize( const std::string& clientName ); +}; + +#endif + +#if defined(__WINDOWS_MM__) + +class MidiInWinMM: public MidiInApi +{ + public: + MidiInWinMM( const std::string &clientName, unsigned int queueSizeLimit ); + ~MidiInWinMM( void ); + RtMidi::Api getCurrentApi( void ) { return RtMidi::WINDOWS_MM; }; + void openPort( unsigned int portNumber, const std::string &portName ); + void openVirtualPort( const std::string &portName ); + void closePort( void ); + unsigned int getPortCount( void ); + std::string getPortName( unsigned int portNumber ); + + protected: + void initialize( const std::string& clientName ); +}; + +class MidiOutWinMM: public MidiOutApi +{ + public: + MidiOutWinMM( const std::string &clientName ); + ~MidiOutWinMM( void ); + RtMidi::Api getCurrentApi( void ) { return RtMidi::WINDOWS_MM; }; + void openPort( unsigned int portNumber, const std::string &portName ); + void openVirtualPort( const std::string &portName ); + void closePort( void ); + unsigned int getPortCount( void ); + std::string getPortName( unsigned int portNumber ); + void sendMessage( const unsigned char *message, size_t size ); + + protected: + void initialize( const std::string& clientName ); +}; + +#endif + +#if defined(__RTMIDI_DUMMY__) + +class MidiInDummy: public MidiInApi +{ + public: + MidiInDummy( const std::string &/*clientName*/, unsigned int queueSizeLimit ) : MidiInApi( queueSizeLimit ) { errorString_ = "MidiInDummy: This class provides no functionality."; error( RtMidiError::WARNING, errorString_ ); } + RtMidi::Api getCurrentApi( void ) { return RtMidi::RTMIDI_DUMMY; } + void openPort( unsigned int /*portNumber*/, const std::string &/*portName*/ ) {} + void openVirtualPort( const std::string &/*portName*/ ) {} + void closePort( void ) {} + unsigned int getPortCount( void ) { return 0; } + std::string getPortName( unsigned int /*portNumber*/ ) { return ""; } + + protected: + void initialize( const std::string& /*clientName*/ ) {} +}; + +class MidiOutDummy: public MidiOutApi +{ + public: + MidiOutDummy( const std::string &/*clientName*/ ) { errorString_ = "MidiOutDummy: This class provides no functionality."; error( RtMidiError::WARNING, errorString_ ); } + RtMidi::Api getCurrentApi( void ) { return RtMidi::RTMIDI_DUMMY; } + void openPort( unsigned int /*portNumber*/, const std::string &/*portName*/ ) {} + void openVirtualPort( const std::string &/*portName*/ ) {} + void closePort( void ) {} + unsigned int getPortCount( void ) { return 0; } + std::string getPortName( unsigned int /*portNumber*/ ) { return ""; } + void sendMessage( const unsigned char * /*message*/, size_t /*size*/ ) {} + + protected: + void initialize( const std::string& /*clientName*/ ) {} +}; + +#endif + +#endif diff --git a/src/orchestra/midi/midi.h b/src/orchestra/midi/midi.h new file mode 100644 index 0000000..14b6f6a --- /dev/null +++ b/src/orchestra/midi/midi.h @@ -0,0 +1,48 @@ +// +// Created by Benjamin Rozière on 03/03/2018. +// + +#ifndef ORCHESTRA_MIDI_H +#define ORCHESTRA_MIDI_H + +//Midimessages are (in bits) [4: Cmd][4: Chan/Sys_msg cmd]...[8: data]... +//To assign a command to a channel use MidiCommand | MidiChannel (eg. NOTE_ON | CHAN_3) + + +enum MidiCommand { + NOTE_OFF = 0x80, + NOTE_ON = 0x90, + AFTERTOUCH = 0xA0, + CONT_CTRL = 0xB0, + PATCH_CHANGE = 0xC0, + CHAN_PRESSURE = 0xD0, + PITCH_BEND = 0xE0, + SYS_MSG = 0xF0 +}; + +enum MidiChannel { + CHAN_1 = 0x00, + CHAN_2 = 0x01, + CHAN_3 = 0x02, + CHAN_4 = 0x03, + CHAN_5 = 0x04, + CHAN_6 = 0x05, + CHAN_7 = 0x06, + CHAN_8 = 0x07, + CHAN_9 = 0x08, + CHAN_10 = 0x09, + CHAN_11 = 0x0A, + CHAN_12 = 0x0B, + CHAN_13 = 0x0C, + CHAN_14 = 0x0D, + CHAN_15 = 0x0E, + CHAN_16 = 0x0F +}; + +enum MidiKey { + +}; + + + +#endif //ORCHESTRA_MIDI_H From 8bc683eadb600ae2fcbf7f8270bd34392be596da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Rozie=CC=80re?= Date: Sun, 4 Mar 2018 19:01:42 +0100 Subject: [PATCH 06/12] Add TextToKey component --- src/orchestra/CMakeLists.txt | 2 +- .../component/OrchMidiOutputComponent.cpp | 4 +- .../component/OrchMidiOutputComponent.h | 4 - .../component/OrchMidiTextToKeyComponent.cpp | 118 ++++++++++++++++++ .../component/OrchMidiTextToKeyComponent.h | 26 ++++ src/orchestra/main.cpp | 3 +- src/orchestra/midi/midi.h | 92 +++++++++++++- 7 files changed, 238 insertions(+), 11 deletions(-) create mode 100644 src/orchestra/component/OrchMidiTextToKeyComponent.cpp create mode 100644 src/orchestra/component/OrchMidiTextToKeyComponent.h diff --git a/src/orchestra/CMakeLists.txt b/src/orchestra/CMakeLists.txt index c43283e..f2e34a5 100644 --- a/src/orchestra/CMakeLists.txt +++ b/src/orchestra/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.8) set(CMAKE_CXX_STANDARD 11) set(GCC_COMPILE_FLAGS "-D__MACOSX_CORE__") -set(SOURCE_FILES main.cpp component/OrchAdderComponent.cpp component/OrchAdderComponent.h component/OrchSumComponent.cpp component/OrchSumComponent.h component/OrchStreamReaderComponent.cpp component/OrchStreamReaderComponent.h component/OrchStreamWriterComponent.cpp component/OrchStreamWriterComponent.h component/OrchMqttSourceComponent.cpp component/OrchMqttSourceComponent.h component/OrchMidiOutputComponent.cpp component/OrchMidiOutputComponent.h midi/midi.h component/OrchMidiKeyProducer.cpp component/OrchMidiKeyProducer.h midi/RtMidi.h midi/RtMidi.cpp) +set(SOURCE_FILES main.cpp component/OrchAdderComponent.cpp component/OrchAdderComponent.h component/OrchSumComponent.cpp component/OrchSumComponent.h component/OrchStreamReaderComponent.cpp component/OrchStreamReaderComponent.h component/OrchStreamWriterComponent.cpp component/OrchStreamWriterComponent.h component/OrchMqttSourceComponent.cpp component/OrchMqttSourceComponent.h component/OrchMidiOutputComponent.cpp component/OrchMidiOutputComponent.h midi/midi.h component/OrchMidiKeyProducer.cpp component/OrchMidiKeyProducer.h midi/RtMidi.h midi/RtMidi.cpp component/OrchMidiTextToKeyComponent.cpp component/OrchMidiTextToKeyComponent.h) find_library(CORE_MIDI CoreMIDI) find_library(CORE_AUDIO CoreAudio) diff --git a/src/orchestra/component/OrchMidiOutputComponent.cpp b/src/orchestra/component/OrchMidiOutputComponent.cpp index 179544b..6651c5f 100644 --- a/src/orchestra/component/OrchMidiOutputComponent.cpp +++ b/src/orchestra/component/OrchMidiOutputComponent.cpp @@ -22,14 +22,14 @@ OrchMidiOutputKeyComponent::OrchMidiOutputKeyComponent(): midiOut(new RtMidiOut( void OrchMidiOutputKeyComponent::Process_(DspSignalBus &input, DspSignalBus &) { - unsigned char key; + MidiKey key; std::vector midiMessage; if (input.GetValue(0, key)) { midiMessage.push_back(MidiCommand::NOTE_ON); midiMessage.push_back(key); - midiMessage.push_back(90); + midiMessage.push_back(MidiKey::C1); midiOut->sendMessage(&midiMessage); } diff --git a/src/orchestra/component/OrchMidiOutputComponent.h b/src/orchestra/component/OrchMidiOutputComponent.h index 6fdcd40..c323617 100644 --- a/src/orchestra/component/OrchMidiOutputComponent.h +++ b/src/orchestra/component/OrchMidiOutputComponent.h @@ -17,10 +17,6 @@ class OrchMidiOutputKeyComponent: public DspComponent { private: RtMidiOut *midiOut; - - - - }; diff --git a/src/orchestra/component/OrchMidiTextToKeyComponent.cpp b/src/orchestra/component/OrchMidiTextToKeyComponent.cpp new file mode 100644 index 0000000..b654e6f --- /dev/null +++ b/src/orchestra/component/OrchMidiTextToKeyComponent.cpp @@ -0,0 +1,118 @@ +// +// Created by Benjamin Rozière on 04/03/2018. +// + +#include +#include "OrchMidiTextToKeyComponent.h" + +OrchMidiTextToKeyComponent::OrchMidiTextToKeyComponent() { + AddInput_(); + AddOutput_(); +} + +void OrchMidiTextToKeyComponent::Process_(DspSignalBus &input, DspSignalBus &output) { + + std::string keyName; + MidiKey key; + + if (input.GetValue(0, keyName)) { + try { + key = keyMap.at(keyName); + output.SetValue(0, key); + } + catch (std::exception const &e) { + std::cerr << "[Circuit]Key " << keyName << " is not playable!\n"; + } + } +} + +std::unordered_map OrchMidiTextToKeyComponent::keyMap{ + {"A0", MidiKey::A0}, + {"Bb0", MidiKey::Bb0}, + {"B0", MidiKey::B0}, + {"C1", MidiKey::C1}, + {"Db1", MidiKey::Db1}, + {"D1", MidiKey::D1}, + {"Eb1", MidiKey::Eb1}, + {"E1", MidiKey::E1}, + {"F1", MidiKey::F1}, + {"Gb1", MidiKey::Gb1}, + {"G1", MidiKey::G1}, + {"Ab1", MidiKey::Ab1}, + {"A1", MidiKey::A1}, + {"Bb1", MidiKey::Bb1}, + {"B1", MidiKey::B1}, + {"C2", MidiKey::C2}, + {"Db2", MidiKey::Db2}, + {"D2", MidiKey::D2}, + {"Eb2", MidiKey::Eb2}, + {"E2", MidiKey::E2}, + {"F2", MidiKey::F2}, + {"Gb2", MidiKey::Gb2}, + {"G2", MidiKey::G2}, + {"Ab2", MidiKey::Ab2}, + {"A2", MidiKey::A2}, + {"Bb2", MidiKey::Bb2}, + {"B2", MidiKey::B2}, + {"C3", MidiKey::C3}, + {"Db3", MidiKey::Db3}, + {"D3", MidiKey::D3}, + {"Eb3", MidiKey::Eb3}, + {"E3", MidiKey::E3}, + {"F3", MidiKey::F3}, + {"Gb3", MidiKey::Gb3}, + {"G3", MidiKey::G3}, + {"Ab3", MidiKey::Ab3}, + {"A3", MidiKey::A3}, + {"Bb3", MidiKey::Bb3}, + {"B3", MidiKey::B3}, + {"C4", MidiKey::C4}, + {"Db4", MidiKey::Db4}, + {"D4", MidiKey::D4}, + {"Eb4", MidiKey::Eb4}, + {"E4", MidiKey::E4}, + {"F4", MidiKey::F4}, + {"Gb4", MidiKey::Gb4}, + {"G4", MidiKey::G4}, + {"Ab4", MidiKey::Ab4}, + {"A4", MidiKey::A4}, + {"Bb4", MidiKey::Bb4}, + {"B4", MidiKey::B4}, + {"C5", MidiKey::C5}, + {"Db5", MidiKey::Db5}, + {"D5", MidiKey::D5}, + {"Eb5", MidiKey::Eb5}, + {"E5", MidiKey::E5}, + {"F5", MidiKey::F5}, + {"Gb5", MidiKey::Gb5}, + {"G5", MidiKey::G5}, + {"Ab5", MidiKey::Ab5}, + {"A5", MidiKey::A5}, + {"Bb5", MidiKey::Bb5}, + {"B5", MidiKey::B5}, + {"C6", MidiKey::C6}, + {"Db6", MidiKey::Db6}, + {"D6", MidiKey::D6}, + {"Eb6", MidiKey::Eb6}, + {"E6", MidiKey::E6}, + {"F6", MidiKey::F6}, + {"Gb6", MidiKey::Gb6}, + {"G6", MidiKey::G6}, + {"Ab6", MidiKey::Ab6}, + {"A6", MidiKey::A6}, + {"Bb6", MidiKey::Bb6}, + {"B6", MidiKey::B6}, + {"C7", MidiKey::C7}, + {"Db7", MidiKey::Db7}, + {"D7", MidiKey::D7}, + {"Eb7", MidiKey::Eb7}, + {"E7", MidiKey::E7}, + {"F7", MidiKey::F7}, + {"Gb7", MidiKey::Gb7}, + {"G7", MidiKey::G7}, + {"Ab7", MidiKey::Ab7}, + {"A7", MidiKey::A7}, + {"Bb7", MidiKey::Bb7}, + {"B7", MidiKey::B7}, + {"C8", MidiKey::C8} +}; \ No newline at end of file diff --git a/src/orchestra/component/OrchMidiTextToKeyComponent.h b/src/orchestra/component/OrchMidiTextToKeyComponent.h new file mode 100644 index 0000000..b0d911a --- /dev/null +++ b/src/orchestra/component/OrchMidiTextToKeyComponent.h @@ -0,0 +1,26 @@ +// +// Created by Benjamin Rozière on 04/03/2018. +// + +#ifndef ORCHESTRA_ORCHMIDITEXTTOKEYCOMPONENT_H +#define ORCHESTRA_ORCHMIDITEXTTOKEYCOMPONENT_H + + +#include +#include +#include "../midi/midi.h" + +class OrchMidiTextToKeyComponent: public DspComponent { + +private: + static std::unordered_map keyMap; + +public: + OrchMidiTextToKeyComponent(); + +protected: + void Process_(DspSignalBus &bus, DspSignalBus &signalBus) override; +}; + + +#endif //ORCHESTRA_ORCHMIDITEXTTOKEYCOMPONENT_H diff --git a/src/orchestra/main.cpp b/src/orchestra/main.cpp index 032484e..06cd432 100644 --- a/src/orchestra/main.cpp +++ b/src/orchestra/main.cpp @@ -12,6 +12,7 @@ #include "component/OrchMqttSourceComponent.h" #include "component/OrchMidiOutputComponent.h" #include "component/OrchMidiKeyProducer.h" +#include "component/OrchMidiTextToKeyComponent.h" int main() { @@ -19,7 +20,7 @@ int main() { OrchStreamWriterComponent writer(std::cout); OrchMqttSourceComponent mqttCmp("/test"); - OrchMidiKeyProducer producer(0x34); + OrchMidiTextToKeyComponent producer; OrchMidiOutputKeyComponent midiOutput; circuit.AddComponent(mqttCmp, "mqtt"); diff --git a/src/orchestra/midi/midi.h b/src/orchestra/midi/midi.h index 14b6f6a..8bc1d1a 100644 --- a/src/orchestra/midi/midi.h +++ b/src/orchestra/midi/midi.h @@ -40,9 +40,95 @@ enum MidiChannel { }; enum MidiKey { - + A0 = 21, + Bb0 = 22, + B0 = 23, + C1 = 24, + Db1 = 25, + D1 = 26, + Eb1 = 27, + E1 = 28, + F1 = 29, + Gb1 = 30, + G1 = 31, + Ab1 = 32, + A1 = 33, + Bb1 = 34, + B1 = 35, + C2 = 36, + Db2 = 37, + D2 = 38, + Eb2 = 39, + E2 = 40, + F2 = 41, + Gb2 = 42, + G2 = 43, + Ab2 = 44, + A2 = 45, + Bb2 = 46, + B2 = 47, + C3 = 48, + Db3 = 49, + D3 = 50, + Eb3 = 51, + E3 = 52, + F3 = 53, + Gb3 = 54, + G3 = 55, + Ab3 = 56, + A3 = 57, + Bb3 = 58, + B3 = 59, + C4 = 60, + Db4 = 61, + D4 = 62, + Eb4 = 63, + E4 = 64, + F4 = 65, + Gb4 = 66, + G4 = 67, + Ab4 = 68, + A4 = 69, + Bb4 = 70, + B4 = 71, + C5 = 72, + Db5 = 73, + D5 = 74, + Eb5 = 75, + E5 = 76, + F5 = 77, + Gb5 = 78, + G5 = 79, + Ab5 = 80, + A5 = 81, + Bb5 = 82, + B5 = 83, + C6 = 84, + Db6 = 85, + D6 = 86, + Eb6 = 87, + E6 = 88, + F6 = 89, + Gb6 = 90, + G6 = 91, + Ab6 = 92, + A6 = 93, + Bb6 = 94, + B6 = 95, + C7 = 96, + Db7 = 97, + D7 = 98, + Eb7 = 99, + E7 = 100, + F7 = 101, + Gb7 = 102, + G7 = 103, + Ab7 = 104, + A7 = 105, + Bb7 = 106, + B7 = 107, + C8 = 108, + NOK = 0 }; - - #endif //ORCHESTRA_MIDI_H From c71d392b12f0d08c8942a98782d5aebf50dd7f8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Rozie=CC=80re?= Date: Sun, 4 Mar 2018 22:49:02 +0100 Subject: [PATCH 07/12] Refactored folders --- CMakeLists.txt | 24 ++++------ {src/libs/DSPatch => DSPatch}/CMakeCache.txt | 0 .../CMakeFiles/3.10.1/CMakeCCompiler.cmake | 0 .../CMakeFiles/3.10.1/CMakeCXXCompiler.cmake | 0 .../3.10.1/CMakeDetermineCompilerABI_C.bin | Bin .../3.10.1/CMakeDetermineCompilerABI_CXX.bin | Bin .../CMakeFiles/3.10.1/CMakeSystem.cmake | 0 .../3.10.1/CompilerIdC/CMakeCCompilerId.c | 0 .../CompilerIdCXX/CMakeCXXCompilerId.cpp | 0 .../CMakeDirectoryInformation.cmake | 0 .../CMakeFiles/CMakeOutput.log | 0 .../CMakeFiles/DSPatch.dir/CXX.includecache | 0 .../CMakeFiles/DSPatch.dir/DependInfo.cmake | 0 .../CMakeFiles/DSPatch.dir/build.make | 0 .../CMakeFiles/DSPatch.dir/cmake_clean.cmake | 0 .../CMakeFiles/DSPatch.dir/depend.internal | 0 .../CMakeFiles/DSPatch.dir/depend.make | 0 .../CMakeFiles/DSPatch.dir/flags.make | 0 .../CMakeFiles/DSPatch.dir/link.txt | 0 .../CMakeFiles/DSPatch.dir/progress.make | 0 .../CMakeFiles/Makefile.cmake | 0 .../DSPatch => DSPatch}/CMakeFiles/Makefile2 | 0 .../CMakeFiles/TargetDirectories.txt | 0 .../CMakeFiles/cmake.check_cache | 0 .../CMakeFiles/feature_tests.bin | Bin .../CMakeFiles/feature_tests.c | 0 .../CMakeFiles/feature_tests.cxx | 0 .../CMakeFiles/progress.marks | 0 {src/libs/DSPatch => DSPatch}/CMakeLists.txt | 0 {src/libs/DSPatch => DSPatch}/LGPLv3.txt | 0 {src/libs/DSPatch => DSPatch}/Makefile | 0 {src/libs/DSPatch => DSPatch}/build.sh | 0 .../DSPatch => DSPatch}/cmake_install.cmake | 0 .../DSPatch => DSPatch}/doc/CMakeLists.txt | 0 {src/libs/DSPatch => DSPatch}/doc/Doxyfile | 0 .../DSPatch => DSPatch}/doc/heartbeat.png | Bin .../DSPatch => DSPatch}/include/DSPatch.h | 0 .../include/dspatch/DspCircuit.h | 0 .../include/dspatch/DspCircuitThread.h | 0 .../include/dspatch/DspComponent.h | 0 .../include/dspatch/DspComponentThread.h | 0 .../include/dspatch/DspParameter.h | 0 .../include/dspatch/DspPlugin.h | 0 .../include/dspatch/DspPluginLoader.h | 0 .../include/dspatch/DspRunType.h | 0 .../include/dspatch/DspSignal.h | 0 .../include/dspatch/DspSignalBus.h | 0 .../include/dspatch/DspThread.h | 0 .../include/dspatch/DspThreadNull.h | 0 .../include/dspatch/DspThreadUnix.h | 0 .../include/dspatch/DspThreadWin.h | 0 .../include/dspatch/DspWire.h | 0 .../include/dspatch/DspWireBus.h | 0 {src/libs/DSPatch => DSPatch}/index.html | 0 {src/libs/DSPatch => DSPatch}/install.sh | 0 .../DSPatch => DSPatch}/install_manifest.txt | 0 {src/libs/DSPatch => DSPatch}/src/DSPatch.cpp | 0 .../DSPatch => DSPatch}/src/DspCircuit.cpp | 0 .../src/DspCircuitThread.cpp | 0 .../DSPatch => DSPatch}/src/DspComponent.cpp | 0 .../src/DspComponentThread.cpp | 0 .../DSPatch => DSPatch}/src/DspParameter.cpp | 0 .../DSPatch => DSPatch}/src/DspPlugin.cpp | 0 .../src/DspPluginLoader.cpp | 0 .../DSPatch => DSPatch}/src/DspSignal.cpp | 0 .../DSPatch => DSPatch}/src/DspSignalBus.cpp | 0 .../DSPatch => DSPatch}/src/DspWireBus.cpp | 0 OrchestraComponents/Adder/CMakeLists.txt | 17 +++++++ .../Adder}/OrchAdderComponent.cpp | 0 .../Adder}/OrchAdderComponent.h | 0 OrchestraComponents/CMakeLists.txt | 7 +++ OrchestraComponents/MqttSource/CMakeLists.txt | 18 ++++++++ .../MqttSource}/OrchMqttSourceComponent.cpp | 0 .../MqttSource}/OrchMqttSourceComponent.h | 3 +- .../StreamReader/CMakeLists.txt | 17 +++++++ .../OrchStreamReaderComponent.cpp | 0 .../StreamReader}/OrchStreamReaderComponent.h | 0 .../StreamWriter/CMakeLists.txt | 17 +++++++ .../OrchStreamWriterComponent.cpp | 0 .../StreamWriter}/OrchStreamWriterComponent.h | 0 OrchestraComponents/Sum/CMakeLists.txt | 17 +++++++ .../Sum}/OrchSumComponent.cpp | 0 .../Sum}/OrchSumComponent.h | 0 OrchestraCore/CMakeLists.txt | 22 +++++++++ OrchestraCore/include/Orchestrator.h | 24 ++++++++++ OrchestraCore/src/Orchestrator.cpp | 43 ++++++++++++++++++ OrchestraGUI/CMakeLists.txt | 19 ++++++++ OrchestraGUI/src/main.cpp | 17 +++++++ OrchestraSimulator/CMakeLists.txt | 7 +++ .../include}/MockSensor.h | 0 .../src}/MockSensor.cpp | 2 +- .../src}/main.cpp | 4 +- .../mosquitto => mosquitto}/CMakeCache.txt | 0 .../CMakeFiles/3.10.1/CMakeCCompiler.cmake | 0 .../CMakeFiles/3.10.1/CMakeCXXCompiler.cmake | 0 .../3.10.1/CMakeDetermineCompilerABI_C.bin | Bin .../3.10.1/CMakeDetermineCompilerABI_CXX.bin | Bin .../CMakeFiles/3.10.1/CMakeSystem.cmake | 0 .../3.10.1/CompilerIdC/CMakeCCompilerId.c | 0 .../CompilerIdCXX/CMakeCXXCompilerId.cpp | 0 .../CMakeDirectoryInformation.cmake | 0 .../CMakeFiles/CMakeError.log | 0 .../CMakeFiles/CMakeOutput.log | 0 .../CMakeFiles/Makefile.cmake | 0 .../CMakeFiles/Makefile2 | 0 .../CMakeFiles/TargetDirectories.txt | 0 .../CMakeFiles/cmake.check_cache | 0 .../CMakeFiles/feature_tests.bin | Bin .../CMakeFiles/feature_tests.c | 0 .../CMakeFiles/feature_tests.cxx | 0 .../CMakeFiles/progress.marks | 0 .../mosquitto => mosquitto}/CMakeLists.txt | 0 .../mosquitto => mosquitto}/CONTRIBUTING.md | 0 .../mosquitto => mosquitto}/ChangeLog.txt | 0 {src/libs/mosquitto => mosquitto}/LICENSE.txt | 0 {src/libs/mosquitto => mosquitto}/Makefile | 0 {src/libs/mosquitto => mosquitto}/about.html | 0 .../mosquitto => mosquitto}/aclfile.example | 0 .../CMakeDirectoryInformation.cmake | 0 .../mosquitto_pub.dir/C.includecache | 0 .../mosquitto_pub.dir/DependInfo.cmake | 0 .../CMakeFiles/mosquitto_pub.dir/build.make | 0 .../mosquitto_pub.dir/cmake_clean.cmake | 0 .../mosquitto_pub.dir/depend.internal | 0 .../CMakeFiles/mosquitto_pub.dir/depend.make | 0 .../CMakeFiles/mosquitto_pub.dir/flags.make | 0 .../CMakeFiles/mosquitto_pub.dir/link.txt | 0 .../mosquitto_pub.dir/progress.make | 0 .../mosquitto_sub.dir/C.includecache | 0 .../mosquitto_sub.dir/DependInfo.cmake | 0 .../CMakeFiles/mosquitto_sub.dir/build.make | 0 .../mosquitto_sub.dir/cmake_clean.cmake | 0 .../mosquitto_sub.dir/depend.internal | 0 .../CMakeFiles/mosquitto_sub.dir/depend.make | 0 .../CMakeFiles/mosquitto_sub.dir/flags.make | 0 .../CMakeFiles/mosquitto_sub.dir/link.txt | 0 .../mosquitto_sub.dir/progress.make | 0 .../client/CMakeFiles/progress.marks | 0 .../client/CMakeLists.txt | 0 .../mosquitto => mosquitto}/client/Makefile | 0 .../client/client_shared.c | 0 .../client/client_shared.h | 0 .../client/cmake_install.cmake | 0 .../client/mosquitto_pub | Bin .../client/mosquitto_sub | Bin .../client/pub_client.c | 0 .../client/sub_client.c | 0 .../cmake_install.cmake | 0 .../mosquitto => mosquitto}/compiling.txt | 0 {src/libs/mosquitto => mosquitto}/config.h | 0 {src/libs/mosquitto => mosquitto}/config.mk | 0 {src/libs/mosquitto => mosquitto}/edl-v10 | 0 {src/libs/mosquitto => mosquitto}/epl-v10 | 0 .../examples/mysql_log/Makefile | 0 .../examples/mysql_log/mysql_log.c | 0 .../examples/temperature_conversion/Makefile | 0 .../examples/temperature_conversion/main.cpp | 0 .../temperature_conversion/readme.txt | 0 .../temperature_conversion.cpp | 0 .../temperature_conversion.h | 0 .../install_manifest.txt | 0 .../installer/mosquitto-cygwin.nsi | 0 .../installer/mosquitto.nsi | 0 .../CMakeDirectoryInformation.cmake | 0 .../libmosquitto.dir/C.includecache | 0 .../libmosquitto.dir/DependInfo.cmake | 0 .../CMakeFiles/libmosquitto.dir/build.make | 0 .../libmosquitto.dir/cmake_clean.cmake | 0 .../libmosquitto.dir/depend.internal | 0 .../CMakeFiles/libmosquitto.dir/depend.make | 0 .../CMakeFiles/libmosquitto.dir/flags.make | 0 .../lib/CMakeFiles/libmosquitto.dir/link.txt | 0 .../CMakeFiles/libmosquitto.dir/progress.make | 0 .../lib/CMakeFiles/progress.marks | 0 .../lib/CMakeLists.txt | 0 .../libs/mosquitto => mosquitto}/lib/Makefile | 0 .../lib/cmake_install.cmake | 0 .../CMakeDirectoryInformation.cmake | 0 .../mosquittopp.dir/CXX.includecache | 0 .../mosquittopp.dir/DependInfo.cmake | 0 .../cpp/CMakeFiles/mosquittopp.dir/build.make | 0 .../mosquittopp.dir/cmake_clean.cmake | 0 .../mosquittopp.dir/depend.internal | 0 .../CMakeFiles/mosquittopp.dir/depend.make | 0 .../cpp/CMakeFiles/mosquittopp.dir/flags.make | 0 .../cpp/CMakeFiles/mosquittopp.dir/link.txt | 0 .../CMakeFiles/mosquittopp.dir/progress.make | 0 .../lib/cpp/CMakeFiles/progress.marks | 0 .../lib/cpp/CMakeLists.txt | 0 .../mosquitto => mosquitto}/lib/cpp/Makefile | 0 .../lib/cpp/cmake_install.cmake | 0 .../lib/cpp/mosquittopp.cpp | 0 .../lib/cpp/mosquittopp.h | 0 .../lib/dummypthread.h | 0 .../lib/linker.version | 0 .../lib/logging_mosq.c | 0 .../lib/logging_mosq.h | 0 .../mosquitto => mosquitto}/lib/memory_mosq.c | 0 .../mosquitto => mosquitto}/lib/memory_mosq.h | 0 .../lib/messages_mosq.c | 0 .../lib/messages_mosq.h | 0 .../mosquitto => mosquitto}/lib/mosquitto.c | 0 .../mosquitto => mosquitto}/lib/mosquitto.h | 0 .../lib/mosquitto_internal.h | 0 .../lib/mqtt3_protocol.h | 0 .../mosquitto => mosquitto}/lib/net_mosq.c | 0 .../mosquitto => mosquitto}/lib/net_mosq.h | 0 .../mosquitto => mosquitto}/lib/read_handle.c | 0 .../mosquitto => mosquitto}/lib/read_handle.h | 0 .../lib/read_handle_client.c | 0 .../lib/read_handle_shared.c | 0 .../lib/send_client_mosq.c | 0 .../mosquitto => mosquitto}/lib/send_mosq.c | 0 .../mosquitto => mosquitto}/lib/send_mosq.h | 0 .../mosquitto => mosquitto}/lib/socks_mosq.c | 0 .../mosquitto => mosquitto}/lib/socks_mosq.h | 0 .../mosquitto => mosquitto}/lib/srv_mosq.c | 0 .../mosquitto => mosquitto}/lib/thread_mosq.c | 0 .../mosquitto => mosquitto}/lib/time_mosq.c | 0 .../mosquitto => mosquitto}/lib/time_mosq.h | 0 .../mosquitto => mosquitto}/lib/tls_mosq.c | 0 .../mosquitto => mosquitto}/lib/tls_mosq.h | 0 .../mosquitto => mosquitto}/lib/util_mosq.c | 0 .../mosquitto => mosquitto}/lib/util_mosq.h | 0 .../mosquitto => mosquitto}/lib/will_mosq.c | 0 .../mosquitto => mosquitto}/lib/will_mosq.h | 0 .../logo/legacy/mosquitto-14x14.png | Bin .../logo/legacy/mosquitto-16x16.png | Bin .../logo/legacy/mosquitto.svg | 0 .../logo/mosquitto-logo-min.svg | 0 .../logo/mosquitto-logo-only.svg | 0 .../logo/mosquitto-text-below.svg | 0 .../logo/mosquitto-text-side.svg | 0 .../logo/mosquitto.ico | Bin .../CMakeDirectoryInformation.cmake | 0 .../man/CMakeFiles/progress.marks | 0 .../man/CMakeLists.txt | 0 .../libs/mosquitto => mosquitto}/man/Makefile | 0 .../man/cmake_install.cmake | 0 .../libs/mosquitto => mosquitto}/man/html.xsl | 0 .../man/libmosquitto.3 | 0 .../man/libmosquitto.3.xml | 0 .../mosquitto => mosquitto}/man/manpage.xsl | 0 .../man/mosquitto-tls.7 | 0 .../man/mosquitto-tls.7.xml | 0 .../mosquitto => mosquitto}/man/mosquitto.8 | 0 .../man/mosquitto.8.xml | 0 .../man/mosquitto.conf.5 | 0 .../man/mosquitto.conf.5.xml | 0 .../man/mosquitto_passwd.1 | 0 .../man/mosquitto_passwd.1.xml | 0 .../man/mosquitto_pub.1 | 0 .../man/mosquitto_pub.1.xml | 0 .../man/mosquitto_sub.1 | 0 .../man/mosquitto_sub.1.xml | 0 {src/libs/mosquitto => mosquitto}/man/mqtt.7 | 0 .../mosquitto => mosquitto}/man/mqtt.7.xml | 0 .../misc/currentcost/__init__.py | 0 .../misc/currentcost/cc128_log_mysql.pl | 0 .../misc/currentcost/cc128_parse.pl | 0 .../misc/currentcost/cc128_read.pl | 0 .../misc/currentcost/cc128_read.py | 0 .../gnome-panel/CurrentCostMQTT.py | 0 .../gnome-panel/CurrentCostMQTT.server | 0 .../misc/currentcost/gnome-panel/__init__.py | 0 .../currentcost/gnome-panel/currentcost.png | Bin .../mosquitto => mosquitto}/mosquitto.conf | 0 {src/libs/mosquitto => mosquitto}/notice.html | 0 .../mosquitto => mosquitto}/pskfile.example | 0 .../mosquitto => mosquitto}/pwfile.example | 0 .../readme-windows.txt | 0 {src/libs/mosquitto => mosquitto}/readme.md | 0 .../security/mosquitto.apparmor | 0 .../service/monit/mosquitto.monit | 0 .../service/svscan/run | 0 .../service/upstart/mosquitto.conf | 0 .../CMakeDirectoryInformation.cmake | 0 .../CMakeFiles/mosquitto.dir/C.includecache | 0 .../CMakeFiles/mosquitto.dir/DependInfo.cmake | 0 .../src/CMakeFiles/mosquitto.dir/build.make | 0 .../mosquitto.dir/cmake_clean.cmake | 0 .../CMakeFiles/mosquitto.dir/depend.internal | 0 .../src/CMakeFiles/mosquitto.dir/depend.make | 0 .../src/CMakeFiles/mosquitto.dir/flags.make | 0 .../src/CMakeFiles/mosquitto.dir/link.txt | 0 .../CMakeFiles/mosquitto.dir/progress.make | 0 .../mosquitto_passwd.dir/DependInfo.cmake | 0 .../mosquitto_passwd.dir/build.make | 0 .../mosquitto_passwd.dir/cmake_clean.cmake | 0 .../mosquitto_passwd.dir/depend.make | 0 .../mosquitto_passwd.dir/flags.make | 0 .../CMakeFiles/mosquitto_passwd.dir/link.txt | 0 .../mosquitto_passwd.dir/progress.make | 0 .../src/CMakeFiles/progress.marks | 0 .../src/CMakeLists.txt | 0 .../libs/mosquitto => mosquitto}/src/Makefile | 0 .../libs/mosquitto => mosquitto}/src/bridge.c | 0 .../src/cmake_install.cmake | 0 {src/libs/mosquitto => mosquitto}/src/conf.c | 0 .../mosquitto => mosquitto}/src/context.c | 0 .../mosquitto => mosquitto}/src/database.c | 0 .../src/db_dump/Makefile | 0 .../src/db_dump/db_dump.c | 0 .../mosquitto => mosquitto}/src/lib_load.h | 0 .../src/linker-macosx.syms | 0 .../mosquitto => mosquitto}/src/linker.syms | 0 .../mosquitto => mosquitto}/src/logging.c | 0 {src/libs/mosquitto => mosquitto}/src/loop.c | 0 .../mosquitto => mosquitto}/src/mosquitto | Bin .../mosquitto => mosquitto}/src/mosquitto.c | 0 .../src/mosquitto_broker.h | 0 .../src/mosquitto_passwd.c | 0 .../src/mosquitto_plugin.h | 0 {src/libs/mosquitto => mosquitto}/src/net.c | 0 .../mosquitto => mosquitto}/src/persist.c | 0 .../mosquitto => mosquitto}/src/persist.h | 0 .../mosquitto => mosquitto}/src/read_handle.c | 0 .../src/read_handle_client.c | 0 .../src/read_handle_server.c | 0 .../mosquitto => mosquitto}/src/security.c | 0 .../src/security_default.c | 0 .../mosquitto => mosquitto}/src/send_server.c | 0 .../mosquitto => mosquitto}/src/service.c | 0 {src/libs/mosquitto => mosquitto}/src/subs.c | 0 .../mosquitto => mosquitto}/src/sys_tree.c | 0 .../libs/mosquitto => mosquitto}/src/uthash.h | 0 .../mosquitto => mosquitto}/src/websockets.c | 0 .../mosquitto => mosquitto}/test/Makefile | 0 mosquitto/test/__init__.py | 0 .../test/broker/01-connect-anon-denied.conf | 0 .../test/broker/01-connect-anon-denied.pwfile | 0 .../test/broker/01-connect-anon-denied.py | 0 .../broker/01-connect-invalid-id-0-311.py | 0 .../test/broker/01-connect-invalid-id-0.py | 0 .../broker/01-connect-invalid-id-missing.py | 0 .../broker/01-connect-invalid-protonum.py | 0 .../broker/01-connect-invalid-reserved.py | 0 .../test/broker/01-connect-success.py | 0 .../01-connect-uname-no-password-denied.conf | 0 ...01-connect-uname-no-password-denied.pwfile | 0 .../01-connect-uname-no-password-denied.py | 0 .../01-connect-uname-password-denied.conf | 0 .../01-connect-uname-password-denied.pwfile | 0 .../01-connect-uname-password-denied.py | 0 ...connect-uname-password-success-no-tls.conf | 0 ...nnect-uname-password-success-no-tls.pwfile | 0 ...1-connect-uname-password-success-no-tls.py | 0 .../01-connect-uname-password-success.conf | 0 .../01-connect-uname-password-success.pwfile | 0 .../01-connect-uname-password-success.py | 0 .../test/broker/02-subpub-qos0.py | 0 .../test/broker/02-subpub-qos1.py | 0 .../test/broker/02-subpub-qos2.py | 0 .../test/broker/02-subscribe-qos0.py | 0 .../test/broker/02-subscribe-qos1.py | 0 .../test/broker/02-subscribe-qos2.py | 0 .../test/broker/02-unsubscribe-qos0.py | 0 .../test/broker/02-unsubscribe-qos1.py | 0 .../test/broker/02-unsubscribe-qos2.py | 0 .../test/broker/03-pattern-matching-helper.py | 0 .../test/broker/03-pattern-matching.py | 0 .../03-publish-b2c-disconnect-qos1-helper.py | 0 .../03-publish-b2c-disconnect-qos1.conf | 0 .../broker/03-publish-b2c-disconnect-qos1.py | 0 .../03-publish-b2c-disconnect-qos2-helper.py | 0 .../03-publish-b2c-disconnect-qos2.conf | 0 .../broker/03-publish-b2c-disconnect-qos2.py | 0 .../03-publish-b2c-timeout-qos1-helper.py | 0 .../broker/03-publish-b2c-timeout-qos1.conf | 0 .../broker/03-publish-b2c-timeout-qos1.py | 0 .../03-publish-b2c-timeout-qos2-helper.py | 0 .../broker/03-publish-b2c-timeout-qos2.conf | 0 .../broker/03-publish-b2c-timeout-qos2.py | 0 .../03-publish-c2b-disconnect-qos2.conf | 0 .../broker/03-publish-c2b-disconnect-qos2.py | 0 .../broker/03-publish-c2b-timeout-qos2.conf | 0 .../broker/03-publish-c2b-timeout-qos2.py | 0 .../test/broker/03-publish-qos1.py | 0 .../test/broker/03-publish-qos2.py | 0 .../test/broker/04-retain-qos0-clear.py | 0 .../test/broker/04-retain-qos0-fresh.py | 0 .../test/broker/04-retain-qos0-repeated.py | 0 .../test/broker/04-retain-qos0.py | 0 .../test/broker/04-retain-qos1-qos0.py | 0 .../broker/05-clean-session-qos1-helper.py | 0 .../test/broker/05-clean-session-qos1.py | 0 .../06-bridge-b2br-disconnect-qos1.conf | 0 .../broker/06-bridge-b2br-disconnect-qos1.py | 0 .../06-bridge-b2br-disconnect-qos2.conf | 0 .../broker/06-bridge-b2br-disconnect-qos2.py | 0 .../06-bridge-br2b-disconnect-qos1-helper.py | 0 .../06-bridge-br2b-disconnect-qos1.conf | 0 .../broker/06-bridge-br2b-disconnect-qos1.py | 0 .../06-bridge-br2b-disconnect-qos2-helper.py | 0 .../06-bridge-br2b-disconnect-qos2.conf | 0 .../broker/06-bridge-br2b-disconnect-qos2.py | 0 .../06-bridge-fail-persist-resend-qos1.conf | 0 .../06-bridge-fail-persist-resend-qos1.py | 0 .../06-bridge-fail-persist-resend-qos2.conf | 0 .../06-bridge-fail-persist-resend-qos2.py | 0 .../06-bridge-reconnect-local-out-helper.py | 0 .../broker/06-bridge-reconnect-local-out.conf | 0 .../broker/06-bridge-reconnect-local-out.py | 0 .../test/broker/07-will-null-helper.py | 0 .../test/broker/07-will-null-topic.py | 0 .../test/broker/07-will-null.py | 0 .../test/broker/07-will-qos0-helper.py | 0 .../test/broker/07-will-qos0.py | 0 .../test/broker/08-ssl-bridge-helper.py | 0 .../test/broker/08-ssl-bridge.conf | 0 .../test/broker/08-ssl-bridge.py | 0 .../broker/08-ssl-connect-cert-auth-crl.conf | 0 .../broker/08-ssl-connect-cert-auth-crl.py | 0 .../08-ssl-connect-cert-auth-expired.conf | 0 .../08-ssl-connect-cert-auth-expired.py | 0 .../08-ssl-connect-cert-auth-revoked.conf | 0 .../08-ssl-connect-cert-auth-revoked.py | 0 .../08-ssl-connect-cert-auth-without.conf | 0 .../08-ssl-connect-cert-auth-without.py | 0 .../test/broker/08-ssl-connect-cert-auth.conf | 0 .../test/broker/08-ssl-connect-cert-auth.py | 0 .../test/broker/08-ssl-connect-identity.conf | 0 .../test/broker/08-ssl-connect-identity.py | 0 .../08-ssl-connect-no-auth-wrong-ca.conf | 0 .../broker/08-ssl-connect-no-auth-wrong-ca.py | 0 .../test/broker/08-ssl-connect-no-auth.conf | 0 .../test/broker/08-ssl-connect-no-auth.py | 0 .../broker/08-ssl-connect-no-identity.conf | 0 .../test/broker/08-ssl-connect-no-identity.py | 0 .../test/broker/08-tls-psk-bridge.conf | 0 .../test/broker/08-tls-psk-bridge.conf2 | 0 .../test/broker/08-tls-psk-bridge.psk | 0 .../test/broker/08-tls-psk-bridge.py | 0 .../test/broker/08-tls-psk-pub.conf | 0 .../test/broker/08-tls-psk-pub.psk | 0 .../test/broker/08-tls-psk-pub.py | 0 .../broker/09-plugin-auth-unpwd-fail.conf | 0 .../test/broker/09-plugin-auth-unpwd-fail.py | 0 .../broker/09-plugin-auth-unpwd-success.conf | 0 .../broker/09-plugin-auth-unpwd-success.py | 0 .../broker/10-listener-mount-point-helper.py | 0 .../test/broker/10-listener-mount-point.conf | 0 .../test/broker/10-listener-mount-point.py | 0 .../test/broker/Makefile | 0 mosquitto/test/broker/__init__.py | 0 .../test/broker/c/08-tls-psk-bridge.c | 0 .../test/broker/c/08-tls-psk-pub.c | 0 .../test/broker/c/Makefile | 0 .../test/broker/c/auth_plugin.c | 0 .../test/broker/readme.txt | 0 .../mosquitto => mosquitto}/test/fake_user.c | 0 .../test/lib/01-con-discon-success.py | 0 .../test/lib/01-keepalive-pingreq.py | 0 .../test/lib/01-no-clean-session.py | 0 .../test/lib/01-unpwd-set.py | 0 .../test/lib/01-will-set.py | 0 .../test/lib/01-will-unpwd-set.py | 0 .../test/lib/02-subscribe-qos0.py | 0 .../test/lib/02-subscribe-qos1.py | 0 .../test/lib/02-subscribe-qos2.py | 0 .../test/lib/02-unsubscribe.py | 0 .../test/lib/03-publish-b2c-qos1.py | 0 .../test/lib/03-publish-b2c-qos2.py | 0 .../lib/03-publish-c2b-qos1-disconnect.py | 0 .../test/lib/03-publish-c2b-qos1-timeout.py | 0 .../lib/03-publish-c2b-qos2-disconnect.py | 0 .../test/lib/03-publish-c2b-qos2-timeout.py | 0 .../test/lib/03-publish-c2b-qos2.py | 0 .../test/lib/03-publish-qos0-no-payload.py | 0 .../test/lib/03-publish-qos0.py | 0 .../test/lib/04-retain-qos0.py | 0 .../test/lib/08-ssl-bad-cacert.py | 0 .../test/lib/08-ssl-connect-cert-auth-enc.py | 0 .../test/lib/08-ssl-connect-cert-auth.py | 0 .../test/lib/08-ssl-connect-no-auth.py | 0 .../test/lib/08-ssl-fake-cacert.py | 0 .../test/lib/09-util-topic-matching.py | 0 .../test/lib/09-util-topic-tokenise.py | 0 .../mosquitto => mosquitto}/test/lib/Makefile | 0 mosquitto/test/lib/__init__.py | 0 .../test/lib/c/01-con-discon-success.c | 0 .../test/lib/c/01-keepalive-pingreq.c | 0 .../test/lib/c/01-no-clean-session.c | 0 .../test/lib/c/01-unpwd-set.c | 0 .../test/lib/c/01-will-set.c | 0 .../test/lib/c/01-will-unpwd-set.c | 0 .../test/lib/c/02-subscribe-qos0.c | 0 .../test/lib/c/02-subscribe-qos1.c | 0 .../test/lib/c/02-subscribe-qos2.c | 0 .../test/lib/c/02-unsubscribe.c | 0 .../test/lib/c/03-publish-b2c-qos1.c | 0 .../test/lib/c/03-publish-b2c-qos2.c | 0 .../lib/c/03-publish-c2b-qos1-disconnect.c | 0 .../test/lib/c/03-publish-c2b-qos1-timeout.c | 0 .../lib/c/03-publish-c2b-qos2-disconnect.c | 0 .../test/lib/c/03-publish-c2b-qos2-timeout.c | 0 .../test/lib/c/03-publish-c2b-qos2.c | 0 .../test/lib/c/03-publish-qos0-no-payload.c | 0 .../test/lib/c/03-publish-qos0.c | 0 .../test/lib/c/04-retain-qos0.c | 0 .../test/lib/c/08-ssl-bad-cacert.c | 0 .../test/lib/c/08-ssl-connect-cert-auth-enc.c | 0 .../test/lib/c/08-ssl-connect-cert-auth.c | 0 .../test/lib/c/08-ssl-connect-no-auth.c | 0 .../test/lib/c/08-ssl-fake-cacert.c | 0 .../test/lib/c/09-util-topic-matching.c | 0 .../test/lib/c/09-util-topic-tokenise.c | 0 .../test/lib/c/Makefile | 0 .../test/lib/cpp/01-con-discon-success.cpp | 0 .../test/lib/cpp/01-keepalive-pingreq.cpp | 0 .../test/lib/cpp/01-no-clean-session.cpp | 0 .../test/lib/cpp/01-unpwd-set.cpp | 0 .../test/lib/cpp/01-will-set.cpp | 0 .../test/lib/cpp/01-will-unpwd-set.cpp | 0 .../test/lib/cpp/02-subscribe-qos0.cpp | 0 .../test/lib/cpp/02-subscribe-qos1.cpp | 0 .../test/lib/cpp/02-subscribe-qos2.cpp | 0 .../test/lib/cpp/02-unsubscribe.cpp | 0 .../test/lib/cpp/03-publish-b2c-qos1.cpp | 0 .../test/lib/cpp/03-publish-b2c-qos2.cpp | 0 .../cpp/03-publish-c2b-qos1-disconnect.cpp | 0 .../lib/cpp/03-publish-c2b-qos1-timeout.cpp | 0 .../cpp/03-publish-c2b-qos2-disconnect.cpp | 0 .../lib/cpp/03-publish-c2b-qos2-timeout.cpp | 0 .../test/lib/cpp/03-publish-c2b-qos2.cpp | 0 .../lib/cpp/03-publish-qos0-no-payload.cpp | 0 .../test/lib/cpp/03-publish-qos0.cpp | 0 .../test/lib/cpp/04-retain-qos0.cpp | 0 .../test/lib/cpp/08-ssl-bad-cacert.cpp | 0 .../lib/cpp/08-ssl-connect-cert-auth-enc.cpp | 0 .../test/lib/cpp/08-ssl-connect-cert-auth.cpp | 0 .../test/lib/cpp/08-ssl-connect-no-auth.cpp | 0 .../test/lib/cpp/08-ssl-fake-cacert.cpp | 0 .../test/lib/cpp/09-util-topic-matching.cpp | 0 .../test/lib/cpp/09-util-topic-tokenise.cpp | 0 .../test/lib/cpp/Makefile | 0 .../mosquitto => mosquitto}/test/mosq_test.py | 0 .../test/msgsps_common.h | 0 .../mosquitto => mosquitto}/test/msgsps_pub.c | 0 .../mosquitto => mosquitto}/test/msgsps_sub.c | 0 .../mosquitto => mosquitto}/test/packet-gen.c | 0 {src/libs/mosquitto => mosquitto}/test/qos.c | 0 .../test/random_client.c | 0 .../test/ssl/all-ca.crt | 0 .../test/ssl/client-encrypted.crt | 0 .../test/ssl/client-encrypted.key | 0 .../test/ssl/client-expired.crt | 0 .../test/ssl/client-revoked.crt | 0 .../test/ssl/client-revoked.csr | 0 .../test/ssl/client-revoked.key | 0 .../test/ssl/client.crt | 0 .../test/ssl/client.csr | 0 .../test/ssl/client.key | 0 .../mosquitto => mosquitto}/test/ssl/crl.pem | 0 .../test/ssl/demoCA/crlnumber | 0 .../test/ssl/demoCA/index.txt | 0 .../test/ssl/demoCA/index.txt.attr | 0 .../test/ssl/demoCA/serial | 0 .../mosquitto => mosquitto}/test/ssl/gen.sh | 0 .../test/ssl/openssl.cnf | 0 .../test/ssl/readme.txt | 0 .../test/ssl/rootCA/crlnumber | 0 .../test/ssl/rootCA/index.txt | 0 .../test/ssl/rootCA/index.txt.attr | 0 .../test/ssl/rootCA/serial | 0 mosquitto/test/ssl/server-expired.crt | 0 .../test/ssl/server.crt | 0 .../test/ssl/server.csr | 0 .../test/ssl/server.key | 0 .../test/ssl/signingCA/crlnumber | 0 .../test/ssl/signingCA/index.txt | 0 .../test/ssl/signingCA/index.txt.attr | 0 .../test/ssl/signingCA/serial | 0 .../test/ssl/test-alt-ca.crt | 0 .../test/ssl/test-alt-ca.key | 0 .../test/ssl/test-bad-root-ca.crt | 0 .../test/ssl/test-bad-root-ca.key | 0 .../test/ssl/test-ca.srl | 0 .../test/ssl/test-fake-root-ca.crt | 0 .../test/ssl/test-fake-root-ca.key | 0 .../test/ssl/test-root-ca.crt | 0 .../test/ssl/test-root-ca.key | 0 .../test/ssl/test-signing-ca.crt | 0 .../test/ssl/test-signing-ca.key | 0 .../libs/mosquitto => mosquitto}/test/to-test | 0 src/mockDataSimulator/CMakeLists.txt | 2 - src/orchestra/CMakeLists.txt | 10 ---- src/orchestra/main.cpp | 42 ----------------- 588 files changed, 239 insertions(+), 73 deletions(-) rename {src/libs/DSPatch => DSPatch}/CMakeCache.txt (100%) rename {src/libs/DSPatch => DSPatch}/CMakeFiles/3.10.1/CMakeCCompiler.cmake (100%) rename {src/libs/DSPatch => DSPatch}/CMakeFiles/3.10.1/CMakeCXXCompiler.cmake (100%) rename {src/libs/DSPatch => DSPatch}/CMakeFiles/3.10.1/CMakeDetermineCompilerABI_C.bin (100%) rename {src/libs/DSPatch => DSPatch}/CMakeFiles/3.10.1/CMakeDetermineCompilerABI_CXX.bin (100%) rename {src/libs/DSPatch => DSPatch}/CMakeFiles/3.10.1/CMakeSystem.cmake (100%) rename {src/libs/DSPatch => DSPatch}/CMakeFiles/3.10.1/CompilerIdC/CMakeCCompilerId.c (100%) rename {src/libs/DSPatch => DSPatch}/CMakeFiles/3.10.1/CompilerIdCXX/CMakeCXXCompilerId.cpp (100%) rename {src/libs/DSPatch => DSPatch}/CMakeFiles/CMakeDirectoryInformation.cmake (100%) rename {src/libs/DSPatch => DSPatch}/CMakeFiles/CMakeOutput.log (100%) rename {src/libs/DSPatch => DSPatch}/CMakeFiles/DSPatch.dir/CXX.includecache (100%) rename {src/libs/DSPatch => DSPatch}/CMakeFiles/DSPatch.dir/DependInfo.cmake (100%) rename {src/libs/DSPatch => DSPatch}/CMakeFiles/DSPatch.dir/build.make (100%) rename {src/libs/DSPatch => DSPatch}/CMakeFiles/DSPatch.dir/cmake_clean.cmake (100%) rename {src/libs/DSPatch => DSPatch}/CMakeFiles/DSPatch.dir/depend.internal (100%) rename {src/libs/DSPatch => DSPatch}/CMakeFiles/DSPatch.dir/depend.make (100%) rename {src/libs/DSPatch => DSPatch}/CMakeFiles/DSPatch.dir/flags.make (100%) rename {src/libs/DSPatch => DSPatch}/CMakeFiles/DSPatch.dir/link.txt (100%) rename {src/libs/DSPatch => DSPatch}/CMakeFiles/DSPatch.dir/progress.make (100%) rename {src/libs/DSPatch => DSPatch}/CMakeFiles/Makefile.cmake (100%) rename {src/libs/DSPatch => DSPatch}/CMakeFiles/Makefile2 (100%) rename {src/libs/DSPatch => DSPatch}/CMakeFiles/TargetDirectories.txt (100%) rename {src/libs/DSPatch => DSPatch}/CMakeFiles/cmake.check_cache (100%) rename {src/libs/DSPatch => DSPatch}/CMakeFiles/feature_tests.bin (100%) rename {src/libs/DSPatch => DSPatch}/CMakeFiles/feature_tests.c (100%) rename {src/libs/DSPatch => DSPatch}/CMakeFiles/feature_tests.cxx (100%) rename {src/libs/DSPatch => DSPatch}/CMakeFiles/progress.marks (100%) rename {src/libs/DSPatch => DSPatch}/CMakeLists.txt (100%) rename {src/libs/DSPatch => DSPatch}/LGPLv3.txt (100%) rename {src/libs/DSPatch => DSPatch}/Makefile (100%) rename {src/libs/DSPatch => DSPatch}/build.sh (100%) rename {src/libs/DSPatch => DSPatch}/cmake_install.cmake (100%) rename {src/libs/DSPatch => DSPatch}/doc/CMakeLists.txt (100%) rename {src/libs/DSPatch => DSPatch}/doc/Doxyfile (100%) rename {src/libs/DSPatch => DSPatch}/doc/heartbeat.png (100%) rename {src/libs/DSPatch => DSPatch}/include/DSPatch.h (100%) rename {src/libs/DSPatch => DSPatch}/include/dspatch/DspCircuit.h (100%) rename {src/libs/DSPatch => DSPatch}/include/dspatch/DspCircuitThread.h (100%) rename {src/libs/DSPatch => DSPatch}/include/dspatch/DspComponent.h (100%) rename {src/libs/DSPatch => DSPatch}/include/dspatch/DspComponentThread.h (100%) rename {src/libs/DSPatch => DSPatch}/include/dspatch/DspParameter.h (100%) rename {src/libs/DSPatch => DSPatch}/include/dspatch/DspPlugin.h (100%) rename {src/libs/DSPatch => DSPatch}/include/dspatch/DspPluginLoader.h (100%) rename {src/libs/DSPatch => DSPatch}/include/dspatch/DspRunType.h (100%) rename {src/libs/DSPatch => DSPatch}/include/dspatch/DspSignal.h (100%) rename {src/libs/DSPatch => DSPatch}/include/dspatch/DspSignalBus.h (100%) rename {src/libs/DSPatch => DSPatch}/include/dspatch/DspThread.h (100%) rename {src/libs/DSPatch => DSPatch}/include/dspatch/DspThreadNull.h (100%) rename {src/libs/DSPatch => DSPatch}/include/dspatch/DspThreadUnix.h (100%) rename {src/libs/DSPatch => DSPatch}/include/dspatch/DspThreadWin.h (100%) rename {src/libs/DSPatch => DSPatch}/include/dspatch/DspWire.h (100%) rename {src/libs/DSPatch => DSPatch}/include/dspatch/DspWireBus.h (100%) rename {src/libs/DSPatch => DSPatch}/index.html (100%) rename {src/libs/DSPatch => DSPatch}/install.sh (100%) rename {src/libs/DSPatch => DSPatch}/install_manifest.txt (100%) rename {src/libs/DSPatch => DSPatch}/src/DSPatch.cpp (100%) rename {src/libs/DSPatch => DSPatch}/src/DspCircuit.cpp (100%) rename {src/libs/DSPatch => DSPatch}/src/DspCircuitThread.cpp (100%) rename {src/libs/DSPatch => DSPatch}/src/DspComponent.cpp (100%) rename {src/libs/DSPatch => DSPatch}/src/DspComponentThread.cpp (100%) rename {src/libs/DSPatch => DSPatch}/src/DspParameter.cpp (100%) rename {src/libs/DSPatch => DSPatch}/src/DspPlugin.cpp (100%) rename {src/libs/DSPatch => DSPatch}/src/DspPluginLoader.cpp (100%) rename {src/libs/DSPatch => DSPatch}/src/DspSignal.cpp (100%) rename {src/libs/DSPatch => DSPatch}/src/DspSignalBus.cpp (100%) rename {src/libs/DSPatch => DSPatch}/src/DspWireBus.cpp (100%) create mode 100644 OrchestraComponents/Adder/CMakeLists.txt rename {src/orchestra/component => OrchestraComponents/Adder}/OrchAdderComponent.cpp (100%) rename {src/orchestra/component => OrchestraComponents/Adder}/OrchAdderComponent.h (100%) create mode 100644 OrchestraComponents/CMakeLists.txt create mode 100644 OrchestraComponents/MqttSource/CMakeLists.txt rename {src/orchestra/component => OrchestraComponents/MqttSource}/OrchMqttSourceComponent.cpp (100%) rename {src/orchestra/component => OrchestraComponents/MqttSource}/OrchMqttSourceComponent.h (97%) create mode 100644 OrchestraComponents/StreamReader/CMakeLists.txt rename {src/orchestra/component => OrchestraComponents/StreamReader}/OrchStreamReaderComponent.cpp (100%) rename {src/orchestra/component => OrchestraComponents/StreamReader}/OrchStreamReaderComponent.h (100%) create mode 100644 OrchestraComponents/StreamWriter/CMakeLists.txt rename {src/orchestra/component => OrchestraComponents/StreamWriter}/OrchStreamWriterComponent.cpp (100%) rename {src/orchestra/component => OrchestraComponents/StreamWriter}/OrchStreamWriterComponent.h (100%) create mode 100644 OrchestraComponents/Sum/CMakeLists.txt rename {src/orchestra/component => OrchestraComponents/Sum}/OrchSumComponent.cpp (100%) rename {src/orchestra/component => OrchestraComponents/Sum}/OrchSumComponent.h (100%) create mode 100644 OrchestraCore/CMakeLists.txt create mode 100644 OrchestraCore/include/Orchestrator.h create mode 100644 OrchestraCore/src/Orchestrator.cpp create mode 100644 OrchestraGUI/CMakeLists.txt create mode 100644 OrchestraGUI/src/main.cpp create mode 100644 OrchestraSimulator/CMakeLists.txt rename {src/mockDataSimulator => OrchestraSimulator/include}/MockSensor.h (100%) rename {src/mockDataSimulator => OrchestraSimulator/src}/MockSensor.cpp (96%) rename {src/mockDataSimulator => OrchestraSimulator/src}/main.cpp (96%) rename {src/libs/mosquitto => mosquitto}/CMakeCache.txt (100%) rename {src/libs/mosquitto => mosquitto}/CMakeFiles/3.10.1/CMakeCCompiler.cmake (100%) rename {src/libs/mosquitto => mosquitto}/CMakeFiles/3.10.1/CMakeCXXCompiler.cmake (100%) rename {src/libs/mosquitto => mosquitto}/CMakeFiles/3.10.1/CMakeDetermineCompilerABI_C.bin (100%) rename {src/libs/mosquitto => mosquitto}/CMakeFiles/3.10.1/CMakeDetermineCompilerABI_CXX.bin (100%) rename {src/libs/mosquitto => mosquitto}/CMakeFiles/3.10.1/CMakeSystem.cmake (100%) rename {src/libs/mosquitto => mosquitto}/CMakeFiles/3.10.1/CompilerIdC/CMakeCCompilerId.c (100%) rename {src/libs/mosquitto => mosquitto}/CMakeFiles/3.10.1/CompilerIdCXX/CMakeCXXCompilerId.cpp (100%) rename {src/libs/mosquitto => mosquitto}/CMakeFiles/CMakeDirectoryInformation.cmake (100%) rename {src/libs/mosquitto => mosquitto}/CMakeFiles/CMakeError.log (100%) rename {src/libs/mosquitto => mosquitto}/CMakeFiles/CMakeOutput.log (100%) rename {src/libs/mosquitto => mosquitto}/CMakeFiles/Makefile.cmake (100%) rename {src/libs/mosquitto => mosquitto}/CMakeFiles/Makefile2 (100%) rename {src/libs/mosquitto => mosquitto}/CMakeFiles/TargetDirectories.txt (100%) rename {src/libs/mosquitto => mosquitto}/CMakeFiles/cmake.check_cache (100%) rename {src/libs/mosquitto => mosquitto}/CMakeFiles/feature_tests.bin (100%) rename {src/libs/mosquitto => mosquitto}/CMakeFiles/feature_tests.c (100%) rename {src/libs/mosquitto => mosquitto}/CMakeFiles/feature_tests.cxx (100%) rename {src/libs/mosquitto => mosquitto}/CMakeFiles/progress.marks (100%) rename {src/libs/mosquitto => mosquitto}/CMakeLists.txt (100%) rename {src/libs/mosquitto => mosquitto}/CONTRIBUTING.md (100%) rename {src/libs/mosquitto => mosquitto}/ChangeLog.txt (100%) rename {src/libs/mosquitto => mosquitto}/LICENSE.txt (100%) rename {src/libs/mosquitto => mosquitto}/Makefile (100%) rename {src/libs/mosquitto => mosquitto}/about.html (100%) rename {src/libs/mosquitto => mosquitto}/aclfile.example (100%) rename {src/libs/mosquitto => mosquitto}/client/CMakeFiles/CMakeDirectoryInformation.cmake (100%) rename {src/libs/mosquitto => mosquitto}/client/CMakeFiles/mosquitto_pub.dir/C.includecache (100%) rename {src/libs/mosquitto => mosquitto}/client/CMakeFiles/mosquitto_pub.dir/DependInfo.cmake (100%) rename {src/libs/mosquitto => mosquitto}/client/CMakeFiles/mosquitto_pub.dir/build.make (100%) rename {src/libs/mosquitto => mosquitto}/client/CMakeFiles/mosquitto_pub.dir/cmake_clean.cmake (100%) rename {src/libs/mosquitto => mosquitto}/client/CMakeFiles/mosquitto_pub.dir/depend.internal (100%) rename {src/libs/mosquitto => mosquitto}/client/CMakeFiles/mosquitto_pub.dir/depend.make (100%) rename {src/libs/mosquitto => mosquitto}/client/CMakeFiles/mosquitto_pub.dir/flags.make (100%) rename {src/libs/mosquitto => mosquitto}/client/CMakeFiles/mosquitto_pub.dir/link.txt (100%) rename {src/libs/mosquitto => mosquitto}/client/CMakeFiles/mosquitto_pub.dir/progress.make (100%) rename {src/libs/mosquitto => mosquitto}/client/CMakeFiles/mosquitto_sub.dir/C.includecache (100%) rename {src/libs/mosquitto => mosquitto}/client/CMakeFiles/mosquitto_sub.dir/DependInfo.cmake (100%) rename {src/libs/mosquitto => mosquitto}/client/CMakeFiles/mosquitto_sub.dir/build.make (100%) rename {src/libs/mosquitto => mosquitto}/client/CMakeFiles/mosquitto_sub.dir/cmake_clean.cmake (100%) rename {src/libs/mosquitto => mosquitto}/client/CMakeFiles/mosquitto_sub.dir/depend.internal (100%) rename {src/libs/mosquitto => mosquitto}/client/CMakeFiles/mosquitto_sub.dir/depend.make (100%) rename {src/libs/mosquitto => mosquitto}/client/CMakeFiles/mosquitto_sub.dir/flags.make (100%) rename {src/libs/mosquitto => mosquitto}/client/CMakeFiles/mosquitto_sub.dir/link.txt (100%) rename {src/libs/mosquitto => mosquitto}/client/CMakeFiles/mosquitto_sub.dir/progress.make (100%) rename {src/libs/mosquitto => mosquitto}/client/CMakeFiles/progress.marks (100%) rename {src/libs/mosquitto => mosquitto}/client/CMakeLists.txt (100%) rename {src/libs/mosquitto => mosquitto}/client/Makefile (100%) rename {src/libs/mosquitto => mosquitto}/client/client_shared.c (100%) rename {src/libs/mosquitto => mosquitto}/client/client_shared.h (100%) rename {src/libs/mosquitto => mosquitto}/client/cmake_install.cmake (100%) rename {src/libs/mosquitto => mosquitto}/client/mosquitto_pub (100%) rename {src/libs/mosquitto => mosquitto}/client/mosquitto_sub (100%) rename {src/libs/mosquitto => mosquitto}/client/pub_client.c (100%) rename {src/libs/mosquitto => mosquitto}/client/sub_client.c (100%) rename {src/libs/mosquitto => mosquitto}/cmake_install.cmake (100%) rename {src/libs/mosquitto => mosquitto}/compiling.txt (100%) rename {src/libs/mosquitto => mosquitto}/config.h (100%) rename {src/libs/mosquitto => mosquitto}/config.mk (100%) rename {src/libs/mosquitto => mosquitto}/edl-v10 (100%) rename {src/libs/mosquitto => mosquitto}/epl-v10 (100%) rename {src/libs/mosquitto => mosquitto}/examples/mysql_log/Makefile (100%) rename {src/libs/mosquitto => mosquitto}/examples/mysql_log/mysql_log.c (100%) rename {src/libs/mosquitto => mosquitto}/examples/temperature_conversion/Makefile (100%) rename {src/libs/mosquitto => mosquitto}/examples/temperature_conversion/main.cpp (100%) rename {src/libs/mosquitto => mosquitto}/examples/temperature_conversion/readme.txt (100%) rename {src/libs/mosquitto => mosquitto}/examples/temperature_conversion/temperature_conversion.cpp (100%) rename {src/libs/mosquitto => mosquitto}/examples/temperature_conversion/temperature_conversion.h (100%) rename {src/libs/mosquitto => mosquitto}/install_manifest.txt (100%) rename {src/libs/mosquitto => mosquitto}/installer/mosquitto-cygwin.nsi (100%) rename {src/libs/mosquitto => mosquitto}/installer/mosquitto.nsi (100%) rename {src/libs/mosquitto => mosquitto}/lib/CMakeFiles/CMakeDirectoryInformation.cmake (100%) rename {src/libs/mosquitto => mosquitto}/lib/CMakeFiles/libmosquitto.dir/C.includecache (100%) rename {src/libs/mosquitto => mosquitto}/lib/CMakeFiles/libmosquitto.dir/DependInfo.cmake (100%) rename {src/libs/mosquitto => mosquitto}/lib/CMakeFiles/libmosquitto.dir/build.make (100%) rename {src/libs/mosquitto => mosquitto}/lib/CMakeFiles/libmosquitto.dir/cmake_clean.cmake (100%) rename {src/libs/mosquitto => mosquitto}/lib/CMakeFiles/libmosquitto.dir/depend.internal (100%) rename {src/libs/mosquitto => mosquitto}/lib/CMakeFiles/libmosquitto.dir/depend.make (100%) rename {src/libs/mosquitto => mosquitto}/lib/CMakeFiles/libmosquitto.dir/flags.make (100%) rename {src/libs/mosquitto => mosquitto}/lib/CMakeFiles/libmosquitto.dir/link.txt (100%) rename {src/libs/mosquitto => mosquitto}/lib/CMakeFiles/libmosquitto.dir/progress.make (100%) rename {src/libs/mosquitto => mosquitto}/lib/CMakeFiles/progress.marks (100%) rename {src/libs/mosquitto => mosquitto}/lib/CMakeLists.txt (100%) rename {src/libs/mosquitto => mosquitto}/lib/Makefile (100%) rename {src/libs/mosquitto => mosquitto}/lib/cmake_install.cmake (100%) rename {src/libs/mosquitto => mosquitto}/lib/cpp/CMakeFiles/CMakeDirectoryInformation.cmake (100%) rename {src/libs/mosquitto => mosquitto}/lib/cpp/CMakeFiles/mosquittopp.dir/CXX.includecache (100%) rename {src/libs/mosquitto => mosquitto}/lib/cpp/CMakeFiles/mosquittopp.dir/DependInfo.cmake (100%) rename {src/libs/mosquitto => mosquitto}/lib/cpp/CMakeFiles/mosquittopp.dir/build.make (100%) rename {src/libs/mosquitto => mosquitto}/lib/cpp/CMakeFiles/mosquittopp.dir/cmake_clean.cmake (100%) rename {src/libs/mosquitto => mosquitto}/lib/cpp/CMakeFiles/mosquittopp.dir/depend.internal (100%) rename {src/libs/mosquitto => mosquitto}/lib/cpp/CMakeFiles/mosquittopp.dir/depend.make (100%) rename {src/libs/mosquitto => mosquitto}/lib/cpp/CMakeFiles/mosquittopp.dir/flags.make (100%) rename {src/libs/mosquitto => mosquitto}/lib/cpp/CMakeFiles/mosquittopp.dir/link.txt (100%) rename {src/libs/mosquitto => mosquitto}/lib/cpp/CMakeFiles/mosquittopp.dir/progress.make (100%) rename {src/libs/mosquitto => mosquitto}/lib/cpp/CMakeFiles/progress.marks (100%) rename {src/libs/mosquitto => mosquitto}/lib/cpp/CMakeLists.txt (100%) rename {src/libs/mosquitto => mosquitto}/lib/cpp/Makefile (100%) rename {src/libs/mosquitto => mosquitto}/lib/cpp/cmake_install.cmake (100%) rename {src/libs/mosquitto => mosquitto}/lib/cpp/mosquittopp.cpp (100%) rename {src/libs/mosquitto => mosquitto}/lib/cpp/mosquittopp.h (100%) rename {src/libs/mosquitto => mosquitto}/lib/dummypthread.h (100%) rename {src/libs/mosquitto => mosquitto}/lib/linker.version (100%) rename {src/libs/mosquitto => mosquitto}/lib/logging_mosq.c (100%) rename {src/libs/mosquitto => mosquitto}/lib/logging_mosq.h (100%) rename {src/libs/mosquitto => mosquitto}/lib/memory_mosq.c (100%) rename {src/libs/mosquitto => mosquitto}/lib/memory_mosq.h (100%) rename {src/libs/mosquitto => mosquitto}/lib/messages_mosq.c (100%) rename {src/libs/mosquitto => mosquitto}/lib/messages_mosq.h (100%) rename {src/libs/mosquitto => mosquitto}/lib/mosquitto.c (100%) rename {src/libs/mosquitto => mosquitto}/lib/mosquitto.h (100%) rename {src/libs/mosquitto => mosquitto}/lib/mosquitto_internal.h (100%) rename {src/libs/mosquitto => mosquitto}/lib/mqtt3_protocol.h (100%) rename {src/libs/mosquitto => mosquitto}/lib/net_mosq.c (100%) rename {src/libs/mosquitto => mosquitto}/lib/net_mosq.h (100%) rename {src/libs/mosquitto => mosquitto}/lib/read_handle.c (100%) rename {src/libs/mosquitto => mosquitto}/lib/read_handle.h (100%) rename {src/libs/mosquitto => mosquitto}/lib/read_handle_client.c (100%) rename {src/libs/mosquitto => mosquitto}/lib/read_handle_shared.c (100%) rename {src/libs/mosquitto => mosquitto}/lib/send_client_mosq.c (100%) rename {src/libs/mosquitto => mosquitto}/lib/send_mosq.c (100%) rename {src/libs/mosquitto => mosquitto}/lib/send_mosq.h (100%) rename {src/libs/mosquitto => mosquitto}/lib/socks_mosq.c (100%) rename {src/libs/mosquitto => mosquitto}/lib/socks_mosq.h (100%) rename {src/libs/mosquitto => mosquitto}/lib/srv_mosq.c (100%) rename {src/libs/mosquitto => mosquitto}/lib/thread_mosq.c (100%) rename {src/libs/mosquitto => mosquitto}/lib/time_mosq.c (100%) rename {src/libs/mosquitto => mosquitto}/lib/time_mosq.h (100%) rename {src/libs/mosquitto => mosquitto}/lib/tls_mosq.c (100%) rename {src/libs/mosquitto => mosquitto}/lib/tls_mosq.h (100%) rename {src/libs/mosquitto => mosquitto}/lib/util_mosq.c (100%) rename {src/libs/mosquitto => mosquitto}/lib/util_mosq.h (100%) rename {src/libs/mosquitto => mosquitto}/lib/will_mosq.c (100%) rename {src/libs/mosquitto => mosquitto}/lib/will_mosq.h (100%) rename {src/libs/mosquitto => mosquitto}/logo/legacy/mosquitto-14x14.png (100%) rename {src/libs/mosquitto => mosquitto}/logo/legacy/mosquitto-16x16.png (100%) rename {src/libs/mosquitto => mosquitto}/logo/legacy/mosquitto.svg (100%) rename {src/libs/mosquitto => mosquitto}/logo/mosquitto-logo-min.svg (100%) rename {src/libs/mosquitto => mosquitto}/logo/mosquitto-logo-only.svg (100%) rename {src/libs/mosquitto => mosquitto}/logo/mosquitto-text-below.svg (100%) rename {src/libs/mosquitto => mosquitto}/logo/mosquitto-text-side.svg (100%) rename {src/libs/mosquitto => mosquitto}/logo/mosquitto.ico (100%) rename {src/libs/mosquitto => mosquitto}/man/CMakeFiles/CMakeDirectoryInformation.cmake (100%) rename {src/libs/mosquitto => mosquitto}/man/CMakeFiles/progress.marks (100%) rename {src/libs/mosquitto => mosquitto}/man/CMakeLists.txt (100%) rename {src/libs/mosquitto => mosquitto}/man/Makefile (100%) rename {src/libs/mosquitto => mosquitto}/man/cmake_install.cmake (100%) rename {src/libs/mosquitto => mosquitto}/man/html.xsl (100%) rename {src/libs/mosquitto => mosquitto}/man/libmosquitto.3 (100%) rename {src/libs/mosquitto => mosquitto}/man/libmosquitto.3.xml (100%) rename {src/libs/mosquitto => mosquitto}/man/manpage.xsl (100%) rename {src/libs/mosquitto => mosquitto}/man/mosquitto-tls.7 (100%) rename {src/libs/mosquitto => mosquitto}/man/mosquitto-tls.7.xml (100%) rename {src/libs/mosquitto => mosquitto}/man/mosquitto.8 (100%) rename {src/libs/mosquitto => mosquitto}/man/mosquitto.8.xml (100%) rename {src/libs/mosquitto => mosquitto}/man/mosquitto.conf.5 (100%) rename {src/libs/mosquitto => mosquitto}/man/mosquitto.conf.5.xml (100%) rename {src/libs/mosquitto => mosquitto}/man/mosquitto_passwd.1 (100%) rename {src/libs/mosquitto => mosquitto}/man/mosquitto_passwd.1.xml (100%) rename {src/libs/mosquitto => mosquitto}/man/mosquitto_pub.1 (100%) rename {src/libs/mosquitto => mosquitto}/man/mosquitto_pub.1.xml (100%) rename {src/libs/mosquitto => mosquitto}/man/mosquitto_sub.1 (100%) rename {src/libs/mosquitto => mosquitto}/man/mosquitto_sub.1.xml (100%) rename {src/libs/mosquitto => mosquitto}/man/mqtt.7 (100%) rename {src/libs/mosquitto => mosquitto}/man/mqtt.7.xml (100%) rename src/libs/mosquitto/test/ssl/server-expired.crt => mosquitto/misc/currentcost/__init__.py (100%) rename {src/libs/mosquitto => mosquitto}/misc/currentcost/cc128_log_mysql.pl (100%) rename {src/libs/mosquitto => mosquitto}/misc/currentcost/cc128_parse.pl (100%) rename {src/libs/mosquitto => mosquitto}/misc/currentcost/cc128_read.pl (100%) rename {src/libs/mosquitto => mosquitto}/misc/currentcost/cc128_read.py (100%) rename {src/libs/mosquitto => mosquitto}/misc/currentcost/gnome-panel/CurrentCostMQTT.py (100%) rename {src/libs/mosquitto => mosquitto}/misc/currentcost/gnome-panel/CurrentCostMQTT.server (100%) create mode 100644 mosquitto/misc/currentcost/gnome-panel/__init__.py rename {src/libs/mosquitto => mosquitto}/misc/currentcost/gnome-panel/currentcost.png (100%) rename {src/libs/mosquitto => mosquitto}/mosquitto.conf (100%) rename {src/libs/mosquitto => mosquitto}/notice.html (100%) rename {src/libs/mosquitto => mosquitto}/pskfile.example (100%) rename {src/libs/mosquitto => mosquitto}/pwfile.example (100%) rename {src/libs/mosquitto => mosquitto}/readme-windows.txt (100%) rename {src/libs/mosquitto => mosquitto}/readme.md (100%) rename {src/libs/mosquitto => mosquitto}/security/mosquitto.apparmor (100%) rename {src/libs/mosquitto => mosquitto}/service/monit/mosquitto.monit (100%) rename {src/libs/mosquitto => mosquitto}/service/svscan/run (100%) rename {src/libs/mosquitto => mosquitto}/service/upstart/mosquitto.conf (100%) rename {src/libs/mosquitto => mosquitto}/src/CMakeFiles/CMakeDirectoryInformation.cmake (100%) rename {src/libs/mosquitto => mosquitto}/src/CMakeFiles/mosquitto.dir/C.includecache (100%) rename {src/libs/mosquitto => mosquitto}/src/CMakeFiles/mosquitto.dir/DependInfo.cmake (100%) rename {src/libs/mosquitto => mosquitto}/src/CMakeFiles/mosquitto.dir/build.make (100%) rename {src/libs/mosquitto => mosquitto}/src/CMakeFiles/mosquitto.dir/cmake_clean.cmake (100%) rename {src/libs/mosquitto => mosquitto}/src/CMakeFiles/mosquitto.dir/depend.internal (100%) rename {src/libs/mosquitto => mosquitto}/src/CMakeFiles/mosquitto.dir/depend.make (100%) rename {src/libs/mosquitto => mosquitto}/src/CMakeFiles/mosquitto.dir/flags.make (100%) rename {src/libs/mosquitto => mosquitto}/src/CMakeFiles/mosquitto.dir/link.txt (100%) rename {src/libs/mosquitto => mosquitto}/src/CMakeFiles/mosquitto.dir/progress.make (100%) rename {src/libs/mosquitto => mosquitto}/src/CMakeFiles/mosquitto_passwd.dir/DependInfo.cmake (100%) rename {src/libs/mosquitto => mosquitto}/src/CMakeFiles/mosquitto_passwd.dir/build.make (100%) rename {src/libs/mosquitto => mosquitto}/src/CMakeFiles/mosquitto_passwd.dir/cmake_clean.cmake (100%) rename {src/libs/mosquitto => mosquitto}/src/CMakeFiles/mosquitto_passwd.dir/depend.make (100%) rename {src/libs/mosquitto => mosquitto}/src/CMakeFiles/mosquitto_passwd.dir/flags.make (100%) rename {src/libs/mosquitto => mosquitto}/src/CMakeFiles/mosquitto_passwd.dir/link.txt (100%) rename {src/libs/mosquitto => mosquitto}/src/CMakeFiles/mosquitto_passwd.dir/progress.make (100%) rename {src/libs/mosquitto => mosquitto}/src/CMakeFiles/progress.marks (100%) rename {src/libs/mosquitto => mosquitto}/src/CMakeLists.txt (100%) rename {src/libs/mosquitto => mosquitto}/src/Makefile (100%) rename {src/libs/mosquitto => mosquitto}/src/bridge.c (100%) rename {src/libs/mosquitto => mosquitto}/src/cmake_install.cmake (100%) rename {src/libs/mosquitto => mosquitto}/src/conf.c (100%) rename {src/libs/mosquitto => mosquitto}/src/context.c (100%) rename {src/libs/mosquitto => mosquitto}/src/database.c (100%) rename {src/libs/mosquitto => mosquitto}/src/db_dump/Makefile (100%) rename {src/libs/mosquitto => mosquitto}/src/db_dump/db_dump.c (100%) rename {src/libs/mosquitto => mosquitto}/src/lib_load.h (100%) rename {src/libs/mosquitto => mosquitto}/src/linker-macosx.syms (100%) rename {src/libs/mosquitto => mosquitto}/src/linker.syms (100%) rename {src/libs/mosquitto => mosquitto}/src/logging.c (100%) rename {src/libs/mosquitto => mosquitto}/src/loop.c (100%) rename {src/libs/mosquitto => mosquitto}/src/mosquitto (100%) rename {src/libs/mosquitto => mosquitto}/src/mosquitto.c (100%) rename {src/libs/mosquitto => mosquitto}/src/mosquitto_broker.h (100%) rename {src/libs/mosquitto => mosquitto}/src/mosquitto_passwd.c (100%) rename {src/libs/mosquitto => mosquitto}/src/mosquitto_plugin.h (100%) rename {src/libs/mosquitto => mosquitto}/src/net.c (100%) rename {src/libs/mosquitto => mosquitto}/src/persist.c (100%) rename {src/libs/mosquitto => mosquitto}/src/persist.h (100%) rename {src/libs/mosquitto => mosquitto}/src/read_handle.c (100%) rename {src/libs/mosquitto => mosquitto}/src/read_handle_client.c (100%) rename {src/libs/mosquitto => mosquitto}/src/read_handle_server.c (100%) rename {src/libs/mosquitto => mosquitto}/src/security.c (100%) rename {src/libs/mosquitto => mosquitto}/src/security_default.c (100%) rename {src/libs/mosquitto => mosquitto}/src/send_server.c (100%) rename {src/libs/mosquitto => mosquitto}/src/service.c (100%) rename {src/libs/mosquitto => mosquitto}/src/subs.c (100%) rename {src/libs/mosquitto => mosquitto}/src/sys_tree.c (100%) rename {src/libs/mosquitto => mosquitto}/src/uthash.h (100%) rename {src/libs/mosquitto => mosquitto}/src/websockets.c (100%) rename {src/libs/mosquitto => mosquitto}/test/Makefile (100%) create mode 100644 mosquitto/test/__init__.py rename {src/libs/mosquitto => mosquitto}/test/broker/01-connect-anon-denied.conf (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/01-connect-anon-denied.pwfile (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/01-connect-anon-denied.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/01-connect-invalid-id-0-311.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/01-connect-invalid-id-0.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/01-connect-invalid-id-missing.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/01-connect-invalid-protonum.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/01-connect-invalid-reserved.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/01-connect-success.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/01-connect-uname-no-password-denied.conf (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/01-connect-uname-no-password-denied.pwfile (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/01-connect-uname-no-password-denied.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/01-connect-uname-password-denied.conf (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/01-connect-uname-password-denied.pwfile (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/01-connect-uname-password-denied.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/01-connect-uname-password-success-no-tls.conf (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/01-connect-uname-password-success-no-tls.pwfile (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/01-connect-uname-password-success-no-tls.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/01-connect-uname-password-success.conf (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/01-connect-uname-password-success.pwfile (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/01-connect-uname-password-success.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/02-subpub-qos0.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/02-subpub-qos1.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/02-subpub-qos2.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/02-subscribe-qos0.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/02-subscribe-qos1.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/02-subscribe-qos2.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/02-unsubscribe-qos0.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/02-unsubscribe-qos1.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/02-unsubscribe-qos2.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/03-pattern-matching-helper.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/03-pattern-matching.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/03-publish-b2c-disconnect-qos1-helper.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/03-publish-b2c-disconnect-qos1.conf (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/03-publish-b2c-disconnect-qos1.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/03-publish-b2c-disconnect-qos2-helper.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/03-publish-b2c-disconnect-qos2.conf (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/03-publish-b2c-disconnect-qos2.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/03-publish-b2c-timeout-qos1-helper.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/03-publish-b2c-timeout-qos1.conf (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/03-publish-b2c-timeout-qos1.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/03-publish-b2c-timeout-qos2-helper.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/03-publish-b2c-timeout-qos2.conf (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/03-publish-b2c-timeout-qos2.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/03-publish-c2b-disconnect-qos2.conf (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/03-publish-c2b-disconnect-qos2.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/03-publish-c2b-timeout-qos2.conf (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/03-publish-c2b-timeout-qos2.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/03-publish-qos1.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/03-publish-qos2.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/04-retain-qos0-clear.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/04-retain-qos0-fresh.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/04-retain-qos0-repeated.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/04-retain-qos0.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/04-retain-qos1-qos0.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/05-clean-session-qos1-helper.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/05-clean-session-qos1.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/06-bridge-b2br-disconnect-qos1.conf (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/06-bridge-b2br-disconnect-qos1.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/06-bridge-b2br-disconnect-qos2.conf (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/06-bridge-b2br-disconnect-qos2.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/06-bridge-br2b-disconnect-qos1-helper.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/06-bridge-br2b-disconnect-qos1.conf (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/06-bridge-br2b-disconnect-qos1.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/06-bridge-br2b-disconnect-qos2-helper.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/06-bridge-br2b-disconnect-qos2.conf (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/06-bridge-br2b-disconnect-qos2.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/06-bridge-fail-persist-resend-qos1.conf (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/06-bridge-fail-persist-resend-qos1.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/06-bridge-fail-persist-resend-qos2.conf (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/06-bridge-fail-persist-resend-qos2.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/06-bridge-reconnect-local-out-helper.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/06-bridge-reconnect-local-out.conf (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/06-bridge-reconnect-local-out.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/07-will-null-helper.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/07-will-null-topic.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/07-will-null.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/07-will-qos0-helper.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/07-will-qos0.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/08-ssl-bridge-helper.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/08-ssl-bridge.conf (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/08-ssl-bridge.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/08-ssl-connect-cert-auth-crl.conf (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/08-ssl-connect-cert-auth-crl.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/08-ssl-connect-cert-auth-expired.conf (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/08-ssl-connect-cert-auth-expired.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/08-ssl-connect-cert-auth-revoked.conf (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/08-ssl-connect-cert-auth-revoked.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/08-ssl-connect-cert-auth-without.conf (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/08-ssl-connect-cert-auth-without.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/08-ssl-connect-cert-auth.conf (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/08-ssl-connect-cert-auth.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/08-ssl-connect-identity.conf (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/08-ssl-connect-identity.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/08-ssl-connect-no-auth-wrong-ca.conf (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/08-ssl-connect-no-auth-wrong-ca.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/08-ssl-connect-no-auth.conf (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/08-ssl-connect-no-auth.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/08-ssl-connect-no-identity.conf (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/08-ssl-connect-no-identity.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/08-tls-psk-bridge.conf (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/08-tls-psk-bridge.conf2 (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/08-tls-psk-bridge.psk (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/08-tls-psk-bridge.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/08-tls-psk-pub.conf (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/08-tls-psk-pub.psk (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/08-tls-psk-pub.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/09-plugin-auth-unpwd-fail.conf (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/09-plugin-auth-unpwd-fail.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/09-plugin-auth-unpwd-success.conf (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/09-plugin-auth-unpwd-success.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/10-listener-mount-point-helper.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/10-listener-mount-point.conf (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/10-listener-mount-point.py (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/Makefile (100%) create mode 100644 mosquitto/test/broker/__init__.py rename {src/libs/mosquitto => mosquitto}/test/broker/c/08-tls-psk-bridge.c (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/c/08-tls-psk-pub.c (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/c/Makefile (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/c/auth_plugin.c (100%) rename {src/libs/mosquitto => mosquitto}/test/broker/readme.txt (100%) rename {src/libs/mosquitto => mosquitto}/test/fake_user.c (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/01-con-discon-success.py (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/01-keepalive-pingreq.py (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/01-no-clean-session.py (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/01-unpwd-set.py (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/01-will-set.py (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/01-will-unpwd-set.py (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/02-subscribe-qos0.py (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/02-subscribe-qos1.py (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/02-subscribe-qos2.py (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/02-unsubscribe.py (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/03-publish-b2c-qos1.py (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/03-publish-b2c-qos2.py (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/03-publish-c2b-qos1-disconnect.py (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/03-publish-c2b-qos1-timeout.py (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/03-publish-c2b-qos2-disconnect.py (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/03-publish-c2b-qos2-timeout.py (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/03-publish-c2b-qos2.py (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/03-publish-qos0-no-payload.py (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/03-publish-qos0.py (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/04-retain-qos0.py (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/08-ssl-bad-cacert.py (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/08-ssl-connect-cert-auth-enc.py (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/08-ssl-connect-cert-auth.py (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/08-ssl-connect-no-auth.py (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/08-ssl-fake-cacert.py (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/09-util-topic-matching.py (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/09-util-topic-tokenise.py (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/Makefile (100%) create mode 100644 mosquitto/test/lib/__init__.py rename {src/libs/mosquitto => mosquitto}/test/lib/c/01-con-discon-success.c (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/c/01-keepalive-pingreq.c (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/c/01-no-clean-session.c (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/c/01-unpwd-set.c (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/c/01-will-set.c (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/c/01-will-unpwd-set.c (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/c/02-subscribe-qos0.c (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/c/02-subscribe-qos1.c (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/c/02-subscribe-qos2.c (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/c/02-unsubscribe.c (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/c/03-publish-b2c-qos1.c (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/c/03-publish-b2c-qos2.c (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/c/03-publish-c2b-qos1-disconnect.c (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/c/03-publish-c2b-qos1-timeout.c (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/c/03-publish-c2b-qos2-disconnect.c (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/c/03-publish-c2b-qos2-timeout.c (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/c/03-publish-c2b-qos2.c (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/c/03-publish-qos0-no-payload.c (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/c/03-publish-qos0.c (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/c/04-retain-qos0.c (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/c/08-ssl-bad-cacert.c (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/c/08-ssl-connect-cert-auth-enc.c (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/c/08-ssl-connect-cert-auth.c (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/c/08-ssl-connect-no-auth.c (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/c/08-ssl-fake-cacert.c (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/c/09-util-topic-matching.c (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/c/09-util-topic-tokenise.c (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/c/Makefile (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/cpp/01-con-discon-success.cpp (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/cpp/01-keepalive-pingreq.cpp (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/cpp/01-no-clean-session.cpp (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/cpp/01-unpwd-set.cpp (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/cpp/01-will-set.cpp (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/cpp/01-will-unpwd-set.cpp (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/cpp/02-subscribe-qos0.cpp (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/cpp/02-subscribe-qos1.cpp (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/cpp/02-subscribe-qos2.cpp (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/cpp/02-unsubscribe.cpp (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/cpp/03-publish-b2c-qos1.cpp (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/cpp/03-publish-b2c-qos2.cpp (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/cpp/03-publish-c2b-qos1-disconnect.cpp (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/cpp/03-publish-c2b-qos1-timeout.cpp (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/cpp/03-publish-c2b-qos2-disconnect.cpp (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/cpp/03-publish-c2b-qos2-timeout.cpp (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/cpp/03-publish-c2b-qos2.cpp (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/cpp/03-publish-qos0-no-payload.cpp (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/cpp/03-publish-qos0.cpp (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/cpp/04-retain-qos0.cpp (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/cpp/08-ssl-bad-cacert.cpp (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/cpp/08-ssl-connect-cert-auth-enc.cpp (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/cpp/08-ssl-connect-cert-auth.cpp (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/cpp/08-ssl-connect-no-auth.cpp (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/cpp/08-ssl-fake-cacert.cpp (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/cpp/09-util-topic-matching.cpp (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/cpp/09-util-topic-tokenise.cpp (100%) rename {src/libs/mosquitto => mosquitto}/test/lib/cpp/Makefile (100%) rename {src/libs/mosquitto => mosquitto}/test/mosq_test.py (100%) rename {src/libs/mosquitto => mosquitto}/test/msgsps_common.h (100%) rename {src/libs/mosquitto => mosquitto}/test/msgsps_pub.c (100%) rename {src/libs/mosquitto => mosquitto}/test/msgsps_sub.c (100%) rename {src/libs/mosquitto => mosquitto}/test/packet-gen.c (100%) rename {src/libs/mosquitto => mosquitto}/test/qos.c (100%) rename {src/libs/mosquitto => mosquitto}/test/random_client.c (100%) rename {src/libs/mosquitto => mosquitto}/test/ssl/all-ca.crt (100%) rename {src/libs/mosquitto => mosquitto}/test/ssl/client-encrypted.crt (100%) rename {src/libs/mosquitto => mosquitto}/test/ssl/client-encrypted.key (100%) rename {src/libs/mosquitto => mosquitto}/test/ssl/client-expired.crt (100%) rename {src/libs/mosquitto => mosquitto}/test/ssl/client-revoked.crt (100%) rename {src/libs/mosquitto => mosquitto}/test/ssl/client-revoked.csr (100%) rename {src/libs/mosquitto => mosquitto}/test/ssl/client-revoked.key (100%) rename {src/libs/mosquitto => mosquitto}/test/ssl/client.crt (100%) rename {src/libs/mosquitto => mosquitto}/test/ssl/client.csr (100%) rename {src/libs/mosquitto => mosquitto}/test/ssl/client.key (100%) rename {src/libs/mosquitto => mosquitto}/test/ssl/crl.pem (100%) rename {src/libs/mosquitto => mosquitto}/test/ssl/demoCA/crlnumber (100%) rename {src/libs/mosquitto => mosquitto}/test/ssl/demoCA/index.txt (100%) rename {src/libs/mosquitto => mosquitto}/test/ssl/demoCA/index.txt.attr (100%) rename {src/libs/mosquitto => mosquitto}/test/ssl/demoCA/serial (100%) rename {src/libs/mosquitto => mosquitto}/test/ssl/gen.sh (100%) rename {src/libs/mosquitto => mosquitto}/test/ssl/openssl.cnf (100%) rename {src/libs/mosquitto => mosquitto}/test/ssl/readme.txt (100%) rename {src/libs/mosquitto => mosquitto}/test/ssl/rootCA/crlnumber (100%) rename {src/libs/mosquitto => mosquitto}/test/ssl/rootCA/index.txt (100%) rename {src/libs/mosquitto => mosquitto}/test/ssl/rootCA/index.txt.attr (100%) rename {src/libs/mosquitto => mosquitto}/test/ssl/rootCA/serial (100%) create mode 100644 mosquitto/test/ssl/server-expired.crt rename {src/libs/mosquitto => mosquitto}/test/ssl/server.crt (100%) rename {src/libs/mosquitto => mosquitto}/test/ssl/server.csr (100%) rename {src/libs/mosquitto => mosquitto}/test/ssl/server.key (100%) rename {src/libs/mosquitto => mosquitto}/test/ssl/signingCA/crlnumber (100%) rename {src/libs/mosquitto => mosquitto}/test/ssl/signingCA/index.txt (100%) rename {src/libs/mosquitto => mosquitto}/test/ssl/signingCA/index.txt.attr (100%) rename {src/libs/mosquitto => mosquitto}/test/ssl/signingCA/serial (100%) rename {src/libs/mosquitto => mosquitto}/test/ssl/test-alt-ca.crt (100%) rename {src/libs/mosquitto => mosquitto}/test/ssl/test-alt-ca.key (100%) rename {src/libs/mosquitto => mosquitto}/test/ssl/test-bad-root-ca.crt (100%) rename {src/libs/mosquitto => mosquitto}/test/ssl/test-bad-root-ca.key (100%) rename {src/libs/mosquitto => mosquitto}/test/ssl/test-ca.srl (100%) rename {src/libs/mosquitto => mosquitto}/test/ssl/test-fake-root-ca.crt (100%) rename {src/libs/mosquitto => mosquitto}/test/ssl/test-fake-root-ca.key (100%) rename {src/libs/mosquitto => mosquitto}/test/ssl/test-root-ca.crt (100%) rename {src/libs/mosquitto => mosquitto}/test/ssl/test-root-ca.key (100%) rename {src/libs/mosquitto => mosquitto}/test/ssl/test-signing-ca.crt (100%) rename {src/libs/mosquitto => mosquitto}/test/ssl/test-signing-ca.key (100%) rename {src/libs/mosquitto => mosquitto}/test/to-test (100%) delete mode 100644 src/mockDataSimulator/CMakeLists.txt delete mode 100644 src/orchestra/CMakeLists.txt delete mode 100644 src/orchestra/main.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 94d6d8a..eb6298e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,24 +1,18 @@ cmake_minimum_required(VERSION 3.8) -project(orchestra VERSION 0.1 LANGUAGES CXX) set(CMAKE_CXX_STANDARD 11) -macro(ADD_SUBLIB libname) - file(GLOB sublib_sources "src/libs/${libname}/src/*.cpp") - add_library(${libname} SHARED ${sublib_sources}) - include_directories("src/libs/${libname}/include") -endmacro(ADD_SUBLIB) +project(Orchestra VERSION 0.1 LANGUAGES CXX) -ADD_SUBLIB(DSPatch) +include_directories(DSPatch/include) +include_directories(mosquitto/lib) set(WITH_SRV OFF) set(WITH_TLS OFF) -add_subdirectory(src/libs/mosquitto) -include_directories(src/libs/mosquitto/lib/cpp/) -include_directories(src/libs/mosquitto/lib) - - -add_subdirectory(src/orchestra) - -add_subdirectory(src/mockDataSimulator) +add_subdirectory(OrchestraCore) +add_subdirectory(OrchestraComponents) +add_subdirectory(OrchestraGUI) +add_subdirectory(OrchestraSimulator) +add_subdirectory(DSPatch) +add_subdirectory(mosquitto) \ No newline at end of file diff --git a/src/libs/DSPatch/CMakeCache.txt b/DSPatch/CMakeCache.txt similarity index 100% rename from src/libs/DSPatch/CMakeCache.txt rename to DSPatch/CMakeCache.txt diff --git a/src/libs/DSPatch/CMakeFiles/3.10.1/CMakeCCompiler.cmake b/DSPatch/CMakeFiles/3.10.1/CMakeCCompiler.cmake similarity index 100% rename from src/libs/DSPatch/CMakeFiles/3.10.1/CMakeCCompiler.cmake rename to DSPatch/CMakeFiles/3.10.1/CMakeCCompiler.cmake diff --git a/src/libs/DSPatch/CMakeFiles/3.10.1/CMakeCXXCompiler.cmake b/DSPatch/CMakeFiles/3.10.1/CMakeCXXCompiler.cmake similarity index 100% rename from src/libs/DSPatch/CMakeFiles/3.10.1/CMakeCXXCompiler.cmake rename to DSPatch/CMakeFiles/3.10.1/CMakeCXXCompiler.cmake diff --git a/src/libs/DSPatch/CMakeFiles/3.10.1/CMakeDetermineCompilerABI_C.bin b/DSPatch/CMakeFiles/3.10.1/CMakeDetermineCompilerABI_C.bin similarity index 100% rename from src/libs/DSPatch/CMakeFiles/3.10.1/CMakeDetermineCompilerABI_C.bin rename to DSPatch/CMakeFiles/3.10.1/CMakeDetermineCompilerABI_C.bin diff --git a/src/libs/DSPatch/CMakeFiles/3.10.1/CMakeDetermineCompilerABI_CXX.bin b/DSPatch/CMakeFiles/3.10.1/CMakeDetermineCompilerABI_CXX.bin similarity index 100% rename from src/libs/DSPatch/CMakeFiles/3.10.1/CMakeDetermineCompilerABI_CXX.bin rename to DSPatch/CMakeFiles/3.10.1/CMakeDetermineCompilerABI_CXX.bin diff --git a/src/libs/DSPatch/CMakeFiles/3.10.1/CMakeSystem.cmake b/DSPatch/CMakeFiles/3.10.1/CMakeSystem.cmake similarity index 100% rename from src/libs/DSPatch/CMakeFiles/3.10.1/CMakeSystem.cmake rename to DSPatch/CMakeFiles/3.10.1/CMakeSystem.cmake diff --git a/src/libs/DSPatch/CMakeFiles/3.10.1/CompilerIdC/CMakeCCompilerId.c b/DSPatch/CMakeFiles/3.10.1/CompilerIdC/CMakeCCompilerId.c similarity index 100% rename from src/libs/DSPatch/CMakeFiles/3.10.1/CompilerIdC/CMakeCCompilerId.c rename to DSPatch/CMakeFiles/3.10.1/CompilerIdC/CMakeCCompilerId.c diff --git a/src/libs/DSPatch/CMakeFiles/3.10.1/CompilerIdCXX/CMakeCXXCompilerId.cpp b/DSPatch/CMakeFiles/3.10.1/CompilerIdCXX/CMakeCXXCompilerId.cpp similarity index 100% rename from src/libs/DSPatch/CMakeFiles/3.10.1/CompilerIdCXX/CMakeCXXCompilerId.cpp rename to DSPatch/CMakeFiles/3.10.1/CompilerIdCXX/CMakeCXXCompilerId.cpp diff --git a/src/libs/DSPatch/CMakeFiles/CMakeDirectoryInformation.cmake b/DSPatch/CMakeFiles/CMakeDirectoryInformation.cmake similarity index 100% rename from src/libs/DSPatch/CMakeFiles/CMakeDirectoryInformation.cmake rename to DSPatch/CMakeFiles/CMakeDirectoryInformation.cmake diff --git a/src/libs/DSPatch/CMakeFiles/CMakeOutput.log b/DSPatch/CMakeFiles/CMakeOutput.log similarity index 100% rename from src/libs/DSPatch/CMakeFiles/CMakeOutput.log rename to DSPatch/CMakeFiles/CMakeOutput.log diff --git a/src/libs/DSPatch/CMakeFiles/DSPatch.dir/CXX.includecache b/DSPatch/CMakeFiles/DSPatch.dir/CXX.includecache similarity index 100% rename from src/libs/DSPatch/CMakeFiles/DSPatch.dir/CXX.includecache rename to DSPatch/CMakeFiles/DSPatch.dir/CXX.includecache diff --git a/src/libs/DSPatch/CMakeFiles/DSPatch.dir/DependInfo.cmake b/DSPatch/CMakeFiles/DSPatch.dir/DependInfo.cmake similarity index 100% rename from src/libs/DSPatch/CMakeFiles/DSPatch.dir/DependInfo.cmake rename to DSPatch/CMakeFiles/DSPatch.dir/DependInfo.cmake diff --git a/src/libs/DSPatch/CMakeFiles/DSPatch.dir/build.make b/DSPatch/CMakeFiles/DSPatch.dir/build.make similarity index 100% rename from src/libs/DSPatch/CMakeFiles/DSPatch.dir/build.make rename to DSPatch/CMakeFiles/DSPatch.dir/build.make diff --git a/src/libs/DSPatch/CMakeFiles/DSPatch.dir/cmake_clean.cmake b/DSPatch/CMakeFiles/DSPatch.dir/cmake_clean.cmake similarity index 100% rename from src/libs/DSPatch/CMakeFiles/DSPatch.dir/cmake_clean.cmake rename to DSPatch/CMakeFiles/DSPatch.dir/cmake_clean.cmake diff --git a/src/libs/DSPatch/CMakeFiles/DSPatch.dir/depend.internal b/DSPatch/CMakeFiles/DSPatch.dir/depend.internal similarity index 100% rename from src/libs/DSPatch/CMakeFiles/DSPatch.dir/depend.internal rename to DSPatch/CMakeFiles/DSPatch.dir/depend.internal diff --git a/src/libs/DSPatch/CMakeFiles/DSPatch.dir/depend.make b/DSPatch/CMakeFiles/DSPatch.dir/depend.make similarity index 100% rename from src/libs/DSPatch/CMakeFiles/DSPatch.dir/depend.make rename to DSPatch/CMakeFiles/DSPatch.dir/depend.make diff --git a/src/libs/DSPatch/CMakeFiles/DSPatch.dir/flags.make b/DSPatch/CMakeFiles/DSPatch.dir/flags.make similarity index 100% rename from src/libs/DSPatch/CMakeFiles/DSPatch.dir/flags.make rename to DSPatch/CMakeFiles/DSPatch.dir/flags.make diff --git a/src/libs/DSPatch/CMakeFiles/DSPatch.dir/link.txt b/DSPatch/CMakeFiles/DSPatch.dir/link.txt similarity index 100% rename from src/libs/DSPatch/CMakeFiles/DSPatch.dir/link.txt rename to DSPatch/CMakeFiles/DSPatch.dir/link.txt diff --git a/src/libs/DSPatch/CMakeFiles/DSPatch.dir/progress.make b/DSPatch/CMakeFiles/DSPatch.dir/progress.make similarity index 100% rename from src/libs/DSPatch/CMakeFiles/DSPatch.dir/progress.make rename to DSPatch/CMakeFiles/DSPatch.dir/progress.make diff --git a/src/libs/DSPatch/CMakeFiles/Makefile.cmake b/DSPatch/CMakeFiles/Makefile.cmake similarity index 100% rename from src/libs/DSPatch/CMakeFiles/Makefile.cmake rename to DSPatch/CMakeFiles/Makefile.cmake diff --git a/src/libs/DSPatch/CMakeFiles/Makefile2 b/DSPatch/CMakeFiles/Makefile2 similarity index 100% rename from src/libs/DSPatch/CMakeFiles/Makefile2 rename to DSPatch/CMakeFiles/Makefile2 diff --git a/src/libs/DSPatch/CMakeFiles/TargetDirectories.txt b/DSPatch/CMakeFiles/TargetDirectories.txt similarity index 100% rename from src/libs/DSPatch/CMakeFiles/TargetDirectories.txt rename to DSPatch/CMakeFiles/TargetDirectories.txt diff --git a/src/libs/DSPatch/CMakeFiles/cmake.check_cache b/DSPatch/CMakeFiles/cmake.check_cache similarity index 100% rename from src/libs/DSPatch/CMakeFiles/cmake.check_cache rename to DSPatch/CMakeFiles/cmake.check_cache diff --git a/src/libs/DSPatch/CMakeFiles/feature_tests.bin b/DSPatch/CMakeFiles/feature_tests.bin similarity index 100% rename from src/libs/DSPatch/CMakeFiles/feature_tests.bin rename to DSPatch/CMakeFiles/feature_tests.bin diff --git a/src/libs/DSPatch/CMakeFiles/feature_tests.c b/DSPatch/CMakeFiles/feature_tests.c similarity index 100% rename from src/libs/DSPatch/CMakeFiles/feature_tests.c rename to DSPatch/CMakeFiles/feature_tests.c diff --git a/src/libs/DSPatch/CMakeFiles/feature_tests.cxx b/DSPatch/CMakeFiles/feature_tests.cxx similarity index 100% rename from src/libs/DSPatch/CMakeFiles/feature_tests.cxx rename to DSPatch/CMakeFiles/feature_tests.cxx diff --git a/src/libs/DSPatch/CMakeFiles/progress.marks b/DSPatch/CMakeFiles/progress.marks similarity index 100% rename from src/libs/DSPatch/CMakeFiles/progress.marks rename to DSPatch/CMakeFiles/progress.marks diff --git a/src/libs/DSPatch/CMakeLists.txt b/DSPatch/CMakeLists.txt similarity index 100% rename from src/libs/DSPatch/CMakeLists.txt rename to DSPatch/CMakeLists.txt diff --git a/src/libs/DSPatch/LGPLv3.txt b/DSPatch/LGPLv3.txt similarity index 100% rename from src/libs/DSPatch/LGPLv3.txt rename to DSPatch/LGPLv3.txt diff --git a/src/libs/DSPatch/Makefile b/DSPatch/Makefile similarity index 100% rename from src/libs/DSPatch/Makefile rename to DSPatch/Makefile diff --git a/src/libs/DSPatch/build.sh b/DSPatch/build.sh similarity index 100% rename from src/libs/DSPatch/build.sh rename to DSPatch/build.sh diff --git a/src/libs/DSPatch/cmake_install.cmake b/DSPatch/cmake_install.cmake similarity index 100% rename from src/libs/DSPatch/cmake_install.cmake rename to DSPatch/cmake_install.cmake diff --git a/src/libs/DSPatch/doc/CMakeLists.txt b/DSPatch/doc/CMakeLists.txt similarity index 100% rename from src/libs/DSPatch/doc/CMakeLists.txt rename to DSPatch/doc/CMakeLists.txt diff --git a/src/libs/DSPatch/doc/Doxyfile b/DSPatch/doc/Doxyfile similarity index 100% rename from src/libs/DSPatch/doc/Doxyfile rename to DSPatch/doc/Doxyfile diff --git a/src/libs/DSPatch/doc/heartbeat.png b/DSPatch/doc/heartbeat.png similarity index 100% rename from src/libs/DSPatch/doc/heartbeat.png rename to DSPatch/doc/heartbeat.png diff --git a/src/libs/DSPatch/include/DSPatch.h b/DSPatch/include/DSPatch.h similarity index 100% rename from src/libs/DSPatch/include/DSPatch.h rename to DSPatch/include/DSPatch.h diff --git a/src/libs/DSPatch/include/dspatch/DspCircuit.h b/DSPatch/include/dspatch/DspCircuit.h similarity index 100% rename from src/libs/DSPatch/include/dspatch/DspCircuit.h rename to DSPatch/include/dspatch/DspCircuit.h diff --git a/src/libs/DSPatch/include/dspatch/DspCircuitThread.h b/DSPatch/include/dspatch/DspCircuitThread.h similarity index 100% rename from src/libs/DSPatch/include/dspatch/DspCircuitThread.h rename to DSPatch/include/dspatch/DspCircuitThread.h diff --git a/src/libs/DSPatch/include/dspatch/DspComponent.h b/DSPatch/include/dspatch/DspComponent.h similarity index 100% rename from src/libs/DSPatch/include/dspatch/DspComponent.h rename to DSPatch/include/dspatch/DspComponent.h diff --git a/src/libs/DSPatch/include/dspatch/DspComponentThread.h b/DSPatch/include/dspatch/DspComponentThread.h similarity index 100% rename from src/libs/DSPatch/include/dspatch/DspComponentThread.h rename to DSPatch/include/dspatch/DspComponentThread.h diff --git a/src/libs/DSPatch/include/dspatch/DspParameter.h b/DSPatch/include/dspatch/DspParameter.h similarity index 100% rename from src/libs/DSPatch/include/dspatch/DspParameter.h rename to DSPatch/include/dspatch/DspParameter.h diff --git a/src/libs/DSPatch/include/dspatch/DspPlugin.h b/DSPatch/include/dspatch/DspPlugin.h similarity index 100% rename from src/libs/DSPatch/include/dspatch/DspPlugin.h rename to DSPatch/include/dspatch/DspPlugin.h diff --git a/src/libs/DSPatch/include/dspatch/DspPluginLoader.h b/DSPatch/include/dspatch/DspPluginLoader.h similarity index 100% rename from src/libs/DSPatch/include/dspatch/DspPluginLoader.h rename to DSPatch/include/dspatch/DspPluginLoader.h diff --git a/src/libs/DSPatch/include/dspatch/DspRunType.h b/DSPatch/include/dspatch/DspRunType.h similarity index 100% rename from src/libs/DSPatch/include/dspatch/DspRunType.h rename to DSPatch/include/dspatch/DspRunType.h diff --git a/src/libs/DSPatch/include/dspatch/DspSignal.h b/DSPatch/include/dspatch/DspSignal.h similarity index 100% rename from src/libs/DSPatch/include/dspatch/DspSignal.h rename to DSPatch/include/dspatch/DspSignal.h diff --git a/src/libs/DSPatch/include/dspatch/DspSignalBus.h b/DSPatch/include/dspatch/DspSignalBus.h similarity index 100% rename from src/libs/DSPatch/include/dspatch/DspSignalBus.h rename to DSPatch/include/dspatch/DspSignalBus.h diff --git a/src/libs/DSPatch/include/dspatch/DspThread.h b/DSPatch/include/dspatch/DspThread.h similarity index 100% rename from src/libs/DSPatch/include/dspatch/DspThread.h rename to DSPatch/include/dspatch/DspThread.h diff --git a/src/libs/DSPatch/include/dspatch/DspThreadNull.h b/DSPatch/include/dspatch/DspThreadNull.h similarity index 100% rename from src/libs/DSPatch/include/dspatch/DspThreadNull.h rename to DSPatch/include/dspatch/DspThreadNull.h diff --git a/src/libs/DSPatch/include/dspatch/DspThreadUnix.h b/DSPatch/include/dspatch/DspThreadUnix.h similarity index 100% rename from src/libs/DSPatch/include/dspatch/DspThreadUnix.h rename to DSPatch/include/dspatch/DspThreadUnix.h diff --git a/src/libs/DSPatch/include/dspatch/DspThreadWin.h b/DSPatch/include/dspatch/DspThreadWin.h similarity index 100% rename from src/libs/DSPatch/include/dspatch/DspThreadWin.h rename to DSPatch/include/dspatch/DspThreadWin.h diff --git a/src/libs/DSPatch/include/dspatch/DspWire.h b/DSPatch/include/dspatch/DspWire.h similarity index 100% rename from src/libs/DSPatch/include/dspatch/DspWire.h rename to DSPatch/include/dspatch/DspWire.h diff --git a/src/libs/DSPatch/include/dspatch/DspWireBus.h b/DSPatch/include/dspatch/DspWireBus.h similarity index 100% rename from src/libs/DSPatch/include/dspatch/DspWireBus.h rename to DSPatch/include/dspatch/DspWireBus.h diff --git a/src/libs/DSPatch/index.html b/DSPatch/index.html similarity index 100% rename from src/libs/DSPatch/index.html rename to DSPatch/index.html diff --git a/src/libs/DSPatch/install.sh b/DSPatch/install.sh similarity index 100% rename from src/libs/DSPatch/install.sh rename to DSPatch/install.sh diff --git a/src/libs/DSPatch/install_manifest.txt b/DSPatch/install_manifest.txt similarity index 100% rename from src/libs/DSPatch/install_manifest.txt rename to DSPatch/install_manifest.txt diff --git a/src/libs/DSPatch/src/DSPatch.cpp b/DSPatch/src/DSPatch.cpp similarity index 100% rename from src/libs/DSPatch/src/DSPatch.cpp rename to DSPatch/src/DSPatch.cpp diff --git a/src/libs/DSPatch/src/DspCircuit.cpp b/DSPatch/src/DspCircuit.cpp similarity index 100% rename from src/libs/DSPatch/src/DspCircuit.cpp rename to DSPatch/src/DspCircuit.cpp diff --git a/src/libs/DSPatch/src/DspCircuitThread.cpp b/DSPatch/src/DspCircuitThread.cpp similarity index 100% rename from src/libs/DSPatch/src/DspCircuitThread.cpp rename to DSPatch/src/DspCircuitThread.cpp diff --git a/src/libs/DSPatch/src/DspComponent.cpp b/DSPatch/src/DspComponent.cpp similarity index 100% rename from src/libs/DSPatch/src/DspComponent.cpp rename to DSPatch/src/DspComponent.cpp diff --git a/src/libs/DSPatch/src/DspComponentThread.cpp b/DSPatch/src/DspComponentThread.cpp similarity index 100% rename from src/libs/DSPatch/src/DspComponentThread.cpp rename to DSPatch/src/DspComponentThread.cpp diff --git a/src/libs/DSPatch/src/DspParameter.cpp b/DSPatch/src/DspParameter.cpp similarity index 100% rename from src/libs/DSPatch/src/DspParameter.cpp rename to DSPatch/src/DspParameter.cpp diff --git a/src/libs/DSPatch/src/DspPlugin.cpp b/DSPatch/src/DspPlugin.cpp similarity index 100% rename from src/libs/DSPatch/src/DspPlugin.cpp rename to DSPatch/src/DspPlugin.cpp diff --git a/src/libs/DSPatch/src/DspPluginLoader.cpp b/DSPatch/src/DspPluginLoader.cpp similarity index 100% rename from src/libs/DSPatch/src/DspPluginLoader.cpp rename to DSPatch/src/DspPluginLoader.cpp diff --git a/src/libs/DSPatch/src/DspSignal.cpp b/DSPatch/src/DspSignal.cpp similarity index 100% rename from src/libs/DSPatch/src/DspSignal.cpp rename to DSPatch/src/DspSignal.cpp diff --git a/src/libs/DSPatch/src/DspSignalBus.cpp b/DSPatch/src/DspSignalBus.cpp similarity index 100% rename from src/libs/DSPatch/src/DspSignalBus.cpp rename to DSPatch/src/DspSignalBus.cpp diff --git a/src/libs/DSPatch/src/DspWireBus.cpp b/DSPatch/src/DspWireBus.cpp similarity index 100% rename from src/libs/DSPatch/src/DspWireBus.cpp rename to DSPatch/src/DspWireBus.cpp diff --git a/OrchestraComponents/Adder/CMakeLists.txt b/OrchestraComponents/Adder/CMakeLists.txt new file mode 100644 index 0000000..1addcd9 --- /dev/null +++ b/OrchestraComponents/Adder/CMakeLists.txt @@ -0,0 +1,17 @@ +project(Adder) + +file(GLOB srcs *.cpp) +file(GLOB hdrs *.h) + +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) + +add_library( + ${PROJECT_NAME} SHARED + ${srcs} + ${hdrs} +) + +target_link_libraries( + ${PROJECT_NAME} + DSPatch +) \ No newline at end of file diff --git a/src/orchestra/component/OrchAdderComponent.cpp b/OrchestraComponents/Adder/OrchAdderComponent.cpp similarity index 100% rename from src/orchestra/component/OrchAdderComponent.cpp rename to OrchestraComponents/Adder/OrchAdderComponent.cpp diff --git a/src/orchestra/component/OrchAdderComponent.h b/OrchestraComponents/Adder/OrchAdderComponent.h similarity index 100% rename from src/orchestra/component/OrchAdderComponent.h rename to OrchestraComponents/Adder/OrchAdderComponent.h diff --git a/OrchestraComponents/CMakeLists.txt b/OrchestraComponents/CMakeLists.txt new file mode 100644 index 0000000..ef83d38 --- /dev/null +++ b/OrchestraComponents/CMakeLists.txt @@ -0,0 +1,7 @@ +project(OrchestraComponents) + +add_subdirectory(Adder) +add_subdirectory(MqttSource) +add_subdirectory(StreamReader) +add_subdirectory(StreamWriter) +add_subdirectory(Sum) \ No newline at end of file diff --git a/OrchestraComponents/MqttSource/CMakeLists.txt b/OrchestraComponents/MqttSource/CMakeLists.txt new file mode 100644 index 0000000..a81bd9b --- /dev/null +++ b/OrchestraComponents/MqttSource/CMakeLists.txt @@ -0,0 +1,18 @@ +project(MqttSource) + +file(GLOB srcs *.cpp) +file(GLOB hdrs *.h) + +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) + +add_library( + ${PROJECT_NAME} SHARED + ${srcs} + ${hdrs} +) + +target_link_libraries( + ${PROJECT_NAME} + DSPatch + mosquittopp +) \ No newline at end of file diff --git a/src/orchestra/component/OrchMqttSourceComponent.cpp b/OrchestraComponents/MqttSource/OrchMqttSourceComponent.cpp similarity index 100% rename from src/orchestra/component/OrchMqttSourceComponent.cpp rename to OrchestraComponents/MqttSource/OrchMqttSourceComponent.cpp diff --git a/src/orchestra/component/OrchMqttSourceComponent.h b/OrchestraComponents/MqttSource/OrchMqttSourceComponent.h similarity index 97% rename from src/orchestra/component/OrchMqttSourceComponent.h rename to OrchestraComponents/MqttSource/OrchMqttSourceComponent.h index 3c50af5..48c9825 100644 --- a/src/orchestra/component/OrchMqttSourceComponent.h +++ b/OrchestraComponents/MqttSource/OrchMqttSourceComponent.h @@ -7,8 +7,9 @@ #include -#include + #include +#include class OrchMqttSourceComponent : public DspComponent, public mosqpp::mosquittopp { diff --git a/OrchestraComponents/StreamReader/CMakeLists.txt b/OrchestraComponents/StreamReader/CMakeLists.txt new file mode 100644 index 0000000..fb20153 --- /dev/null +++ b/OrchestraComponents/StreamReader/CMakeLists.txt @@ -0,0 +1,17 @@ +project(StreamReader) + +file(GLOB srcs *.cpp) +file(GLOB hdrs *.h) + +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) + +add_library( + ${PROJECT_NAME} SHARED + ${srcs} + ${hdrs} +) + +target_link_libraries( + ${PROJECT_NAME} + DSPatch +) \ No newline at end of file diff --git a/src/orchestra/component/OrchStreamReaderComponent.cpp b/OrchestraComponents/StreamReader/OrchStreamReaderComponent.cpp similarity index 100% rename from src/orchestra/component/OrchStreamReaderComponent.cpp rename to OrchestraComponents/StreamReader/OrchStreamReaderComponent.cpp diff --git a/src/orchestra/component/OrchStreamReaderComponent.h b/OrchestraComponents/StreamReader/OrchStreamReaderComponent.h similarity index 100% rename from src/orchestra/component/OrchStreamReaderComponent.h rename to OrchestraComponents/StreamReader/OrchStreamReaderComponent.h diff --git a/OrchestraComponents/StreamWriter/CMakeLists.txt b/OrchestraComponents/StreamWriter/CMakeLists.txt new file mode 100644 index 0000000..15f0619 --- /dev/null +++ b/OrchestraComponents/StreamWriter/CMakeLists.txt @@ -0,0 +1,17 @@ +project(StreamWriter) + +file(GLOB srcs *.cpp) +file(GLOB hdrs *.h) + +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) + +add_library( + ${PROJECT_NAME} SHARED + ${srcs} + ${hdrs} +) + +target_link_libraries( + ${PROJECT_NAME} + DSPatch +) \ No newline at end of file diff --git a/src/orchestra/component/OrchStreamWriterComponent.cpp b/OrchestraComponents/StreamWriter/OrchStreamWriterComponent.cpp similarity index 100% rename from src/orchestra/component/OrchStreamWriterComponent.cpp rename to OrchestraComponents/StreamWriter/OrchStreamWriterComponent.cpp diff --git a/src/orchestra/component/OrchStreamWriterComponent.h b/OrchestraComponents/StreamWriter/OrchStreamWriterComponent.h similarity index 100% rename from src/orchestra/component/OrchStreamWriterComponent.h rename to OrchestraComponents/StreamWriter/OrchStreamWriterComponent.h diff --git a/OrchestraComponents/Sum/CMakeLists.txt b/OrchestraComponents/Sum/CMakeLists.txt new file mode 100644 index 0000000..e24695c --- /dev/null +++ b/OrchestraComponents/Sum/CMakeLists.txt @@ -0,0 +1,17 @@ +project(Sum) + +file(GLOB srcs *.cpp) +file(GLOB hdrs *.h) + +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) + +add_library( + ${PROJECT_NAME} SHARED + ${srcs} + ${hdrs} +) + +target_link_libraries( + ${PROJECT_NAME} + DSPatch +) \ No newline at end of file diff --git a/src/orchestra/component/OrchSumComponent.cpp b/OrchestraComponents/Sum/OrchSumComponent.cpp similarity index 100% rename from src/orchestra/component/OrchSumComponent.cpp rename to OrchestraComponents/Sum/OrchSumComponent.cpp diff --git a/src/orchestra/component/OrchSumComponent.h b/OrchestraComponents/Sum/OrchSumComponent.h similarity index 100% rename from src/orchestra/component/OrchSumComponent.h rename to OrchestraComponents/Sum/OrchSumComponent.h diff --git a/OrchestraCore/CMakeLists.txt b/OrchestraCore/CMakeLists.txt new file mode 100644 index 0000000..b7bf05b --- /dev/null +++ b/OrchestraCore/CMakeLists.txt @@ -0,0 +1,22 @@ +cmake_minimum_required(VERSION 3.8) + +project(OrchestraCore) + +include_directories(include) + +include_directories(../OrchestraComponents) + +file(GLOB srcs src/*.cpp) +file(GLOB hdrs include/*.h) + +add_library( + ${PROJECT_NAME} SHARED + ${srcs} + ${hdrs} +) + +target_link_libraries( + ${PROJECT_NAME} + MqttSource + StreamWriter +) \ No newline at end of file diff --git a/OrchestraCore/include/Orchestrator.h b/OrchestraCore/include/Orchestrator.h new file mode 100644 index 0000000..96df8bd --- /dev/null +++ b/OrchestraCore/include/Orchestrator.h @@ -0,0 +1,24 @@ +// +// Created by Benjamin Rozière on 04/03/2018. +// + +#ifndef ORCHESTRA_ORCHESTRATOR_H +#define ORCHESTRA_ORCHESTRATOR_H + + +#include + +class Orchestrator { +private: + DspCircuit *_circuit; +public: + Orchestrator(); + + void start(void); + void stop(void); + + virtual ~Orchestrator(); +}; + + +#endif //ORCHESTRA_ORCHESTRATOR_H diff --git a/OrchestraCore/src/Orchestrator.cpp b/OrchestraCore/src/Orchestrator.cpp new file mode 100644 index 0000000..faeb882 --- /dev/null +++ b/OrchestraCore/src/Orchestrator.cpp @@ -0,0 +1,43 @@ +// +// Created by Benjamin Rozière on 04/03/2018. +// + +#include +#include + +#include + +#include "Orchestrator.h" + +Orchestrator::Orchestrator(): _circuit(new DspCircuit()) { + + auto writer = new OrchStreamWriterComponent(std::cout); + + auto mqttCmp = new OrchMqttSourceComponent("/test"); + + _circuit->AddComponent(mqttCmp, "mqtt"); + + _circuit->AddComponent(writer, "Writer"); + + _circuit->ConnectOutToIn(mqttCmp, 0, writer, 0); +} + +void Orchestrator::start(void) { + _circuit->StartAutoTick(); +} + +void Orchestrator::stop(void) { + _circuit->StopAutoTick(); +} + +Orchestrator::~Orchestrator() { + stop(); + + DSPatch::Finalize(); + + delete _circuit; + _circuit = nullptr; +} + + + diff --git a/OrchestraGUI/CMakeLists.txt b/OrchestraGUI/CMakeLists.txt new file mode 100644 index 0000000..83cbb18 --- /dev/null +++ b/OrchestraGUI/CMakeLists.txt @@ -0,0 +1,19 @@ +project(OrchestraGUI) + +include_directories(../OrchestraCore/include) + +file(GLOB srcs src/*.cpp) +file(GLOB hdrs include/*.h) + +add_executable( + ${PROJECT_NAME} + ${srcs} + ${hdrs} +) + +target_link_libraries( + ${PROJECT_NAME} + OrchestraCore + mosquittopp + DSPatch +) \ No newline at end of file diff --git a/OrchestraGUI/src/main.cpp b/OrchestraGUI/src/main.cpp new file mode 100644 index 0000000..0161fe3 --- /dev/null +++ b/OrchestraGUI/src/main.cpp @@ -0,0 +1,17 @@ +// +// Created by Benjamin Rozière on 09/01/2018. +// + +#include +#include + +int main() { + + Orchestrator orchestrator; + + orchestrator.start(); + getchar(); + orchestrator.stop(); + + return EXIT_SUCCESS; +} diff --git a/OrchestraSimulator/CMakeLists.txt b/OrchestraSimulator/CMakeLists.txt new file mode 100644 index 0000000..98e465c --- /dev/null +++ b/OrchestraSimulator/CMakeLists.txt @@ -0,0 +1,7 @@ +project(OrchestraSimulator) + +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) + +file(GLOB srcs src/*.cpp) + +add_executable(simulator ${srcs}) \ No newline at end of file diff --git a/src/mockDataSimulator/MockSensor.h b/OrchestraSimulator/include/MockSensor.h similarity index 100% rename from src/mockDataSimulator/MockSensor.h rename to OrchestraSimulator/include/MockSensor.h diff --git a/src/mockDataSimulator/MockSensor.cpp b/OrchestraSimulator/src/MockSensor.cpp similarity index 96% rename from src/mockDataSimulator/MockSensor.cpp rename to OrchestraSimulator/src/MockSensor.cpp index 28d3f9c..6867d06 100644 --- a/src/mockDataSimulator/MockSensor.cpp +++ b/OrchestraSimulator/src/MockSensor.cpp @@ -7,7 +7,7 @@ #include #include -#include "MockSensor.h" +#include "../include/MockSensor.h" std::mutex cout_mu; diff --git a/src/mockDataSimulator/main.cpp b/OrchestraSimulator/src/main.cpp similarity index 96% rename from src/mockDataSimulator/main.cpp rename to OrchestraSimulator/src/main.cpp index ede572f..c210bf1 100644 --- a/src/mockDataSimulator/main.cpp +++ b/OrchestraSimulator/src/main.cpp @@ -4,10 +4,10 @@ #include #include - -#include "MockSensor.h" +#include #define DEFAULT_SENSOR 2 + #define MAX_MOCK_SENSOR 50 int main(int argc, char **argv) { diff --git a/src/libs/mosquitto/CMakeCache.txt b/mosquitto/CMakeCache.txt similarity index 100% rename from src/libs/mosquitto/CMakeCache.txt rename to mosquitto/CMakeCache.txt diff --git a/src/libs/mosquitto/CMakeFiles/3.10.1/CMakeCCompiler.cmake b/mosquitto/CMakeFiles/3.10.1/CMakeCCompiler.cmake similarity index 100% rename from src/libs/mosquitto/CMakeFiles/3.10.1/CMakeCCompiler.cmake rename to mosquitto/CMakeFiles/3.10.1/CMakeCCompiler.cmake diff --git a/src/libs/mosquitto/CMakeFiles/3.10.1/CMakeCXXCompiler.cmake b/mosquitto/CMakeFiles/3.10.1/CMakeCXXCompiler.cmake similarity index 100% rename from src/libs/mosquitto/CMakeFiles/3.10.1/CMakeCXXCompiler.cmake rename to mosquitto/CMakeFiles/3.10.1/CMakeCXXCompiler.cmake diff --git a/src/libs/mosquitto/CMakeFiles/3.10.1/CMakeDetermineCompilerABI_C.bin b/mosquitto/CMakeFiles/3.10.1/CMakeDetermineCompilerABI_C.bin similarity index 100% rename from src/libs/mosquitto/CMakeFiles/3.10.1/CMakeDetermineCompilerABI_C.bin rename to mosquitto/CMakeFiles/3.10.1/CMakeDetermineCompilerABI_C.bin diff --git a/src/libs/mosquitto/CMakeFiles/3.10.1/CMakeDetermineCompilerABI_CXX.bin b/mosquitto/CMakeFiles/3.10.1/CMakeDetermineCompilerABI_CXX.bin similarity index 100% rename from src/libs/mosquitto/CMakeFiles/3.10.1/CMakeDetermineCompilerABI_CXX.bin rename to mosquitto/CMakeFiles/3.10.1/CMakeDetermineCompilerABI_CXX.bin diff --git a/src/libs/mosquitto/CMakeFiles/3.10.1/CMakeSystem.cmake b/mosquitto/CMakeFiles/3.10.1/CMakeSystem.cmake similarity index 100% rename from src/libs/mosquitto/CMakeFiles/3.10.1/CMakeSystem.cmake rename to mosquitto/CMakeFiles/3.10.1/CMakeSystem.cmake diff --git a/src/libs/mosquitto/CMakeFiles/3.10.1/CompilerIdC/CMakeCCompilerId.c b/mosquitto/CMakeFiles/3.10.1/CompilerIdC/CMakeCCompilerId.c similarity index 100% rename from src/libs/mosquitto/CMakeFiles/3.10.1/CompilerIdC/CMakeCCompilerId.c rename to mosquitto/CMakeFiles/3.10.1/CompilerIdC/CMakeCCompilerId.c diff --git a/src/libs/mosquitto/CMakeFiles/3.10.1/CompilerIdCXX/CMakeCXXCompilerId.cpp b/mosquitto/CMakeFiles/3.10.1/CompilerIdCXX/CMakeCXXCompilerId.cpp similarity index 100% rename from src/libs/mosquitto/CMakeFiles/3.10.1/CompilerIdCXX/CMakeCXXCompilerId.cpp rename to mosquitto/CMakeFiles/3.10.1/CompilerIdCXX/CMakeCXXCompilerId.cpp diff --git a/src/libs/mosquitto/CMakeFiles/CMakeDirectoryInformation.cmake b/mosquitto/CMakeFiles/CMakeDirectoryInformation.cmake similarity index 100% rename from src/libs/mosquitto/CMakeFiles/CMakeDirectoryInformation.cmake rename to mosquitto/CMakeFiles/CMakeDirectoryInformation.cmake diff --git a/src/libs/mosquitto/CMakeFiles/CMakeError.log b/mosquitto/CMakeFiles/CMakeError.log similarity index 100% rename from src/libs/mosquitto/CMakeFiles/CMakeError.log rename to mosquitto/CMakeFiles/CMakeError.log diff --git a/src/libs/mosquitto/CMakeFiles/CMakeOutput.log b/mosquitto/CMakeFiles/CMakeOutput.log similarity index 100% rename from src/libs/mosquitto/CMakeFiles/CMakeOutput.log rename to mosquitto/CMakeFiles/CMakeOutput.log diff --git a/src/libs/mosquitto/CMakeFiles/Makefile.cmake b/mosquitto/CMakeFiles/Makefile.cmake similarity index 100% rename from src/libs/mosquitto/CMakeFiles/Makefile.cmake rename to mosquitto/CMakeFiles/Makefile.cmake diff --git a/src/libs/mosquitto/CMakeFiles/Makefile2 b/mosquitto/CMakeFiles/Makefile2 similarity index 100% rename from src/libs/mosquitto/CMakeFiles/Makefile2 rename to mosquitto/CMakeFiles/Makefile2 diff --git a/src/libs/mosquitto/CMakeFiles/TargetDirectories.txt b/mosquitto/CMakeFiles/TargetDirectories.txt similarity index 100% rename from src/libs/mosquitto/CMakeFiles/TargetDirectories.txt rename to mosquitto/CMakeFiles/TargetDirectories.txt diff --git a/src/libs/mosquitto/CMakeFiles/cmake.check_cache b/mosquitto/CMakeFiles/cmake.check_cache similarity index 100% rename from src/libs/mosquitto/CMakeFiles/cmake.check_cache rename to mosquitto/CMakeFiles/cmake.check_cache diff --git a/src/libs/mosquitto/CMakeFiles/feature_tests.bin b/mosquitto/CMakeFiles/feature_tests.bin similarity index 100% rename from src/libs/mosquitto/CMakeFiles/feature_tests.bin rename to mosquitto/CMakeFiles/feature_tests.bin diff --git a/src/libs/mosquitto/CMakeFiles/feature_tests.c b/mosquitto/CMakeFiles/feature_tests.c similarity index 100% rename from src/libs/mosquitto/CMakeFiles/feature_tests.c rename to mosquitto/CMakeFiles/feature_tests.c diff --git a/src/libs/mosquitto/CMakeFiles/feature_tests.cxx b/mosquitto/CMakeFiles/feature_tests.cxx similarity index 100% rename from src/libs/mosquitto/CMakeFiles/feature_tests.cxx rename to mosquitto/CMakeFiles/feature_tests.cxx diff --git a/src/libs/mosquitto/CMakeFiles/progress.marks b/mosquitto/CMakeFiles/progress.marks similarity index 100% rename from src/libs/mosquitto/CMakeFiles/progress.marks rename to mosquitto/CMakeFiles/progress.marks diff --git a/src/libs/mosquitto/CMakeLists.txt b/mosquitto/CMakeLists.txt similarity index 100% rename from src/libs/mosquitto/CMakeLists.txt rename to mosquitto/CMakeLists.txt diff --git a/src/libs/mosquitto/CONTRIBUTING.md b/mosquitto/CONTRIBUTING.md similarity index 100% rename from src/libs/mosquitto/CONTRIBUTING.md rename to mosquitto/CONTRIBUTING.md diff --git a/src/libs/mosquitto/ChangeLog.txt b/mosquitto/ChangeLog.txt similarity index 100% rename from src/libs/mosquitto/ChangeLog.txt rename to mosquitto/ChangeLog.txt diff --git a/src/libs/mosquitto/LICENSE.txt b/mosquitto/LICENSE.txt similarity index 100% rename from src/libs/mosquitto/LICENSE.txt rename to mosquitto/LICENSE.txt diff --git a/src/libs/mosquitto/Makefile b/mosquitto/Makefile similarity index 100% rename from src/libs/mosquitto/Makefile rename to mosquitto/Makefile diff --git a/src/libs/mosquitto/about.html b/mosquitto/about.html similarity index 100% rename from src/libs/mosquitto/about.html rename to mosquitto/about.html diff --git a/src/libs/mosquitto/aclfile.example b/mosquitto/aclfile.example similarity index 100% rename from src/libs/mosquitto/aclfile.example rename to mosquitto/aclfile.example diff --git a/src/libs/mosquitto/client/CMakeFiles/CMakeDirectoryInformation.cmake b/mosquitto/client/CMakeFiles/CMakeDirectoryInformation.cmake similarity index 100% rename from src/libs/mosquitto/client/CMakeFiles/CMakeDirectoryInformation.cmake rename to mosquitto/client/CMakeFiles/CMakeDirectoryInformation.cmake diff --git a/src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/C.includecache b/mosquitto/client/CMakeFiles/mosquitto_pub.dir/C.includecache similarity index 100% rename from src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/C.includecache rename to mosquitto/client/CMakeFiles/mosquitto_pub.dir/C.includecache diff --git a/src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/DependInfo.cmake b/mosquitto/client/CMakeFiles/mosquitto_pub.dir/DependInfo.cmake similarity index 100% rename from src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/DependInfo.cmake rename to mosquitto/client/CMakeFiles/mosquitto_pub.dir/DependInfo.cmake diff --git a/src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/build.make b/mosquitto/client/CMakeFiles/mosquitto_pub.dir/build.make similarity index 100% rename from src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/build.make rename to mosquitto/client/CMakeFiles/mosquitto_pub.dir/build.make diff --git a/src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/cmake_clean.cmake b/mosquitto/client/CMakeFiles/mosquitto_pub.dir/cmake_clean.cmake similarity index 100% rename from src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/cmake_clean.cmake rename to mosquitto/client/CMakeFiles/mosquitto_pub.dir/cmake_clean.cmake diff --git a/src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/depend.internal b/mosquitto/client/CMakeFiles/mosquitto_pub.dir/depend.internal similarity index 100% rename from src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/depend.internal rename to mosquitto/client/CMakeFiles/mosquitto_pub.dir/depend.internal diff --git a/src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/depend.make b/mosquitto/client/CMakeFiles/mosquitto_pub.dir/depend.make similarity index 100% rename from src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/depend.make rename to mosquitto/client/CMakeFiles/mosquitto_pub.dir/depend.make diff --git a/src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/flags.make b/mosquitto/client/CMakeFiles/mosquitto_pub.dir/flags.make similarity index 100% rename from src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/flags.make rename to mosquitto/client/CMakeFiles/mosquitto_pub.dir/flags.make diff --git a/src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/link.txt b/mosquitto/client/CMakeFiles/mosquitto_pub.dir/link.txt similarity index 100% rename from src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/link.txt rename to mosquitto/client/CMakeFiles/mosquitto_pub.dir/link.txt diff --git a/src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/progress.make b/mosquitto/client/CMakeFiles/mosquitto_pub.dir/progress.make similarity index 100% rename from src/libs/mosquitto/client/CMakeFiles/mosquitto_pub.dir/progress.make rename to mosquitto/client/CMakeFiles/mosquitto_pub.dir/progress.make diff --git a/src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/C.includecache b/mosquitto/client/CMakeFiles/mosquitto_sub.dir/C.includecache similarity index 100% rename from src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/C.includecache rename to mosquitto/client/CMakeFiles/mosquitto_sub.dir/C.includecache diff --git a/src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/DependInfo.cmake b/mosquitto/client/CMakeFiles/mosquitto_sub.dir/DependInfo.cmake similarity index 100% rename from src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/DependInfo.cmake rename to mosquitto/client/CMakeFiles/mosquitto_sub.dir/DependInfo.cmake diff --git a/src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/build.make b/mosquitto/client/CMakeFiles/mosquitto_sub.dir/build.make similarity index 100% rename from src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/build.make rename to mosquitto/client/CMakeFiles/mosquitto_sub.dir/build.make diff --git a/src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/cmake_clean.cmake b/mosquitto/client/CMakeFiles/mosquitto_sub.dir/cmake_clean.cmake similarity index 100% rename from src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/cmake_clean.cmake rename to mosquitto/client/CMakeFiles/mosquitto_sub.dir/cmake_clean.cmake diff --git a/src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/depend.internal b/mosquitto/client/CMakeFiles/mosquitto_sub.dir/depend.internal similarity index 100% rename from src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/depend.internal rename to mosquitto/client/CMakeFiles/mosquitto_sub.dir/depend.internal diff --git a/src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/depend.make b/mosquitto/client/CMakeFiles/mosquitto_sub.dir/depend.make similarity index 100% rename from src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/depend.make rename to mosquitto/client/CMakeFiles/mosquitto_sub.dir/depend.make diff --git a/src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/flags.make b/mosquitto/client/CMakeFiles/mosquitto_sub.dir/flags.make similarity index 100% rename from src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/flags.make rename to mosquitto/client/CMakeFiles/mosquitto_sub.dir/flags.make diff --git a/src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/link.txt b/mosquitto/client/CMakeFiles/mosquitto_sub.dir/link.txt similarity index 100% rename from src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/link.txt rename to mosquitto/client/CMakeFiles/mosquitto_sub.dir/link.txt diff --git a/src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/progress.make b/mosquitto/client/CMakeFiles/mosquitto_sub.dir/progress.make similarity index 100% rename from src/libs/mosquitto/client/CMakeFiles/mosquitto_sub.dir/progress.make rename to mosquitto/client/CMakeFiles/mosquitto_sub.dir/progress.make diff --git a/src/libs/mosquitto/client/CMakeFiles/progress.marks b/mosquitto/client/CMakeFiles/progress.marks similarity index 100% rename from src/libs/mosquitto/client/CMakeFiles/progress.marks rename to mosquitto/client/CMakeFiles/progress.marks diff --git a/src/libs/mosquitto/client/CMakeLists.txt b/mosquitto/client/CMakeLists.txt similarity index 100% rename from src/libs/mosquitto/client/CMakeLists.txt rename to mosquitto/client/CMakeLists.txt diff --git a/src/libs/mosquitto/client/Makefile b/mosquitto/client/Makefile similarity index 100% rename from src/libs/mosquitto/client/Makefile rename to mosquitto/client/Makefile diff --git a/src/libs/mosquitto/client/client_shared.c b/mosquitto/client/client_shared.c similarity index 100% rename from src/libs/mosquitto/client/client_shared.c rename to mosquitto/client/client_shared.c diff --git a/src/libs/mosquitto/client/client_shared.h b/mosquitto/client/client_shared.h similarity index 100% rename from src/libs/mosquitto/client/client_shared.h rename to mosquitto/client/client_shared.h diff --git a/src/libs/mosquitto/client/cmake_install.cmake b/mosquitto/client/cmake_install.cmake similarity index 100% rename from src/libs/mosquitto/client/cmake_install.cmake rename to mosquitto/client/cmake_install.cmake diff --git a/src/libs/mosquitto/client/mosquitto_pub b/mosquitto/client/mosquitto_pub similarity index 100% rename from src/libs/mosquitto/client/mosquitto_pub rename to mosquitto/client/mosquitto_pub diff --git a/src/libs/mosquitto/client/mosquitto_sub b/mosquitto/client/mosquitto_sub similarity index 100% rename from src/libs/mosquitto/client/mosquitto_sub rename to mosquitto/client/mosquitto_sub diff --git a/src/libs/mosquitto/client/pub_client.c b/mosquitto/client/pub_client.c similarity index 100% rename from src/libs/mosquitto/client/pub_client.c rename to mosquitto/client/pub_client.c diff --git a/src/libs/mosquitto/client/sub_client.c b/mosquitto/client/sub_client.c similarity index 100% rename from src/libs/mosquitto/client/sub_client.c rename to mosquitto/client/sub_client.c diff --git a/src/libs/mosquitto/cmake_install.cmake b/mosquitto/cmake_install.cmake similarity index 100% rename from src/libs/mosquitto/cmake_install.cmake rename to mosquitto/cmake_install.cmake diff --git a/src/libs/mosquitto/compiling.txt b/mosquitto/compiling.txt similarity index 100% rename from src/libs/mosquitto/compiling.txt rename to mosquitto/compiling.txt diff --git a/src/libs/mosquitto/config.h b/mosquitto/config.h similarity index 100% rename from src/libs/mosquitto/config.h rename to mosquitto/config.h diff --git a/src/libs/mosquitto/config.mk b/mosquitto/config.mk similarity index 100% rename from src/libs/mosquitto/config.mk rename to mosquitto/config.mk diff --git a/src/libs/mosquitto/edl-v10 b/mosquitto/edl-v10 similarity index 100% rename from src/libs/mosquitto/edl-v10 rename to mosquitto/edl-v10 diff --git a/src/libs/mosquitto/epl-v10 b/mosquitto/epl-v10 similarity index 100% rename from src/libs/mosquitto/epl-v10 rename to mosquitto/epl-v10 diff --git a/src/libs/mosquitto/examples/mysql_log/Makefile b/mosquitto/examples/mysql_log/Makefile similarity index 100% rename from src/libs/mosquitto/examples/mysql_log/Makefile rename to mosquitto/examples/mysql_log/Makefile diff --git a/src/libs/mosquitto/examples/mysql_log/mysql_log.c b/mosquitto/examples/mysql_log/mysql_log.c similarity index 100% rename from src/libs/mosquitto/examples/mysql_log/mysql_log.c rename to mosquitto/examples/mysql_log/mysql_log.c diff --git a/src/libs/mosquitto/examples/temperature_conversion/Makefile b/mosquitto/examples/temperature_conversion/Makefile similarity index 100% rename from src/libs/mosquitto/examples/temperature_conversion/Makefile rename to mosquitto/examples/temperature_conversion/Makefile diff --git a/src/libs/mosquitto/examples/temperature_conversion/main.cpp b/mosquitto/examples/temperature_conversion/main.cpp similarity index 100% rename from src/libs/mosquitto/examples/temperature_conversion/main.cpp rename to mosquitto/examples/temperature_conversion/main.cpp diff --git a/src/libs/mosquitto/examples/temperature_conversion/readme.txt b/mosquitto/examples/temperature_conversion/readme.txt similarity index 100% rename from src/libs/mosquitto/examples/temperature_conversion/readme.txt rename to mosquitto/examples/temperature_conversion/readme.txt diff --git a/src/libs/mosquitto/examples/temperature_conversion/temperature_conversion.cpp b/mosquitto/examples/temperature_conversion/temperature_conversion.cpp similarity index 100% rename from src/libs/mosquitto/examples/temperature_conversion/temperature_conversion.cpp rename to mosquitto/examples/temperature_conversion/temperature_conversion.cpp diff --git a/src/libs/mosquitto/examples/temperature_conversion/temperature_conversion.h b/mosquitto/examples/temperature_conversion/temperature_conversion.h similarity index 100% rename from src/libs/mosquitto/examples/temperature_conversion/temperature_conversion.h rename to mosquitto/examples/temperature_conversion/temperature_conversion.h diff --git a/src/libs/mosquitto/install_manifest.txt b/mosquitto/install_manifest.txt similarity index 100% rename from src/libs/mosquitto/install_manifest.txt rename to mosquitto/install_manifest.txt diff --git a/src/libs/mosquitto/installer/mosquitto-cygwin.nsi b/mosquitto/installer/mosquitto-cygwin.nsi similarity index 100% rename from src/libs/mosquitto/installer/mosquitto-cygwin.nsi rename to mosquitto/installer/mosquitto-cygwin.nsi diff --git a/src/libs/mosquitto/installer/mosquitto.nsi b/mosquitto/installer/mosquitto.nsi similarity index 100% rename from src/libs/mosquitto/installer/mosquitto.nsi rename to mosquitto/installer/mosquitto.nsi diff --git a/src/libs/mosquitto/lib/CMakeFiles/CMakeDirectoryInformation.cmake b/mosquitto/lib/CMakeFiles/CMakeDirectoryInformation.cmake similarity index 100% rename from src/libs/mosquitto/lib/CMakeFiles/CMakeDirectoryInformation.cmake rename to mosquitto/lib/CMakeFiles/CMakeDirectoryInformation.cmake diff --git a/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/C.includecache b/mosquitto/lib/CMakeFiles/libmosquitto.dir/C.includecache similarity index 100% rename from src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/C.includecache rename to mosquitto/lib/CMakeFiles/libmosquitto.dir/C.includecache diff --git a/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/DependInfo.cmake b/mosquitto/lib/CMakeFiles/libmosquitto.dir/DependInfo.cmake similarity index 100% rename from src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/DependInfo.cmake rename to mosquitto/lib/CMakeFiles/libmosquitto.dir/DependInfo.cmake diff --git a/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/build.make b/mosquitto/lib/CMakeFiles/libmosquitto.dir/build.make similarity index 100% rename from src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/build.make rename to mosquitto/lib/CMakeFiles/libmosquitto.dir/build.make diff --git a/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/cmake_clean.cmake b/mosquitto/lib/CMakeFiles/libmosquitto.dir/cmake_clean.cmake similarity index 100% rename from src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/cmake_clean.cmake rename to mosquitto/lib/CMakeFiles/libmosquitto.dir/cmake_clean.cmake diff --git a/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/depend.internal b/mosquitto/lib/CMakeFiles/libmosquitto.dir/depend.internal similarity index 100% rename from src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/depend.internal rename to mosquitto/lib/CMakeFiles/libmosquitto.dir/depend.internal diff --git a/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/depend.make b/mosquitto/lib/CMakeFiles/libmosquitto.dir/depend.make similarity index 100% rename from src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/depend.make rename to mosquitto/lib/CMakeFiles/libmosquitto.dir/depend.make diff --git a/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/flags.make b/mosquitto/lib/CMakeFiles/libmosquitto.dir/flags.make similarity index 100% rename from src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/flags.make rename to mosquitto/lib/CMakeFiles/libmosquitto.dir/flags.make diff --git a/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/link.txt b/mosquitto/lib/CMakeFiles/libmosquitto.dir/link.txt similarity index 100% rename from src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/link.txt rename to mosquitto/lib/CMakeFiles/libmosquitto.dir/link.txt diff --git a/src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/progress.make b/mosquitto/lib/CMakeFiles/libmosquitto.dir/progress.make similarity index 100% rename from src/libs/mosquitto/lib/CMakeFiles/libmosquitto.dir/progress.make rename to mosquitto/lib/CMakeFiles/libmosquitto.dir/progress.make diff --git a/src/libs/mosquitto/lib/CMakeFiles/progress.marks b/mosquitto/lib/CMakeFiles/progress.marks similarity index 100% rename from src/libs/mosquitto/lib/CMakeFiles/progress.marks rename to mosquitto/lib/CMakeFiles/progress.marks diff --git a/src/libs/mosquitto/lib/CMakeLists.txt b/mosquitto/lib/CMakeLists.txt similarity index 100% rename from src/libs/mosquitto/lib/CMakeLists.txt rename to mosquitto/lib/CMakeLists.txt diff --git a/src/libs/mosquitto/lib/Makefile b/mosquitto/lib/Makefile similarity index 100% rename from src/libs/mosquitto/lib/Makefile rename to mosquitto/lib/Makefile diff --git a/src/libs/mosquitto/lib/cmake_install.cmake b/mosquitto/lib/cmake_install.cmake similarity index 100% rename from src/libs/mosquitto/lib/cmake_install.cmake rename to mosquitto/lib/cmake_install.cmake diff --git a/src/libs/mosquitto/lib/cpp/CMakeFiles/CMakeDirectoryInformation.cmake b/mosquitto/lib/cpp/CMakeFiles/CMakeDirectoryInformation.cmake similarity index 100% rename from src/libs/mosquitto/lib/cpp/CMakeFiles/CMakeDirectoryInformation.cmake rename to mosquitto/lib/cpp/CMakeFiles/CMakeDirectoryInformation.cmake diff --git a/src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/CXX.includecache b/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/CXX.includecache similarity index 100% rename from src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/CXX.includecache rename to mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/CXX.includecache diff --git a/src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/DependInfo.cmake b/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/DependInfo.cmake similarity index 100% rename from src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/DependInfo.cmake rename to mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/DependInfo.cmake diff --git a/src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/build.make b/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/build.make similarity index 100% rename from src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/build.make rename to mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/build.make diff --git a/src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/cmake_clean.cmake b/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/cmake_clean.cmake similarity index 100% rename from src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/cmake_clean.cmake rename to mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/cmake_clean.cmake diff --git a/src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/depend.internal b/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/depend.internal similarity index 100% rename from src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/depend.internal rename to mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/depend.internal diff --git a/src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/depend.make b/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/depend.make similarity index 100% rename from src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/depend.make rename to mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/depend.make diff --git a/src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/flags.make b/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/flags.make similarity index 100% rename from src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/flags.make rename to mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/flags.make diff --git a/src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/link.txt b/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/link.txt similarity index 100% rename from src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/link.txt rename to mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/link.txt diff --git a/src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/progress.make b/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/progress.make similarity index 100% rename from src/libs/mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/progress.make rename to mosquitto/lib/cpp/CMakeFiles/mosquittopp.dir/progress.make diff --git a/src/libs/mosquitto/lib/cpp/CMakeFiles/progress.marks b/mosquitto/lib/cpp/CMakeFiles/progress.marks similarity index 100% rename from src/libs/mosquitto/lib/cpp/CMakeFiles/progress.marks rename to mosquitto/lib/cpp/CMakeFiles/progress.marks diff --git a/src/libs/mosquitto/lib/cpp/CMakeLists.txt b/mosquitto/lib/cpp/CMakeLists.txt similarity index 100% rename from src/libs/mosquitto/lib/cpp/CMakeLists.txt rename to mosquitto/lib/cpp/CMakeLists.txt diff --git a/src/libs/mosquitto/lib/cpp/Makefile b/mosquitto/lib/cpp/Makefile similarity index 100% rename from src/libs/mosquitto/lib/cpp/Makefile rename to mosquitto/lib/cpp/Makefile diff --git a/src/libs/mosquitto/lib/cpp/cmake_install.cmake b/mosquitto/lib/cpp/cmake_install.cmake similarity index 100% rename from src/libs/mosquitto/lib/cpp/cmake_install.cmake rename to mosquitto/lib/cpp/cmake_install.cmake diff --git a/src/libs/mosquitto/lib/cpp/mosquittopp.cpp b/mosquitto/lib/cpp/mosquittopp.cpp similarity index 100% rename from src/libs/mosquitto/lib/cpp/mosquittopp.cpp rename to mosquitto/lib/cpp/mosquittopp.cpp diff --git a/src/libs/mosquitto/lib/cpp/mosquittopp.h b/mosquitto/lib/cpp/mosquittopp.h similarity index 100% rename from src/libs/mosquitto/lib/cpp/mosquittopp.h rename to mosquitto/lib/cpp/mosquittopp.h diff --git a/src/libs/mosquitto/lib/dummypthread.h b/mosquitto/lib/dummypthread.h similarity index 100% rename from src/libs/mosquitto/lib/dummypthread.h rename to mosquitto/lib/dummypthread.h diff --git a/src/libs/mosquitto/lib/linker.version b/mosquitto/lib/linker.version similarity index 100% rename from src/libs/mosquitto/lib/linker.version rename to mosquitto/lib/linker.version diff --git a/src/libs/mosquitto/lib/logging_mosq.c b/mosquitto/lib/logging_mosq.c similarity index 100% rename from src/libs/mosquitto/lib/logging_mosq.c rename to mosquitto/lib/logging_mosq.c diff --git a/src/libs/mosquitto/lib/logging_mosq.h b/mosquitto/lib/logging_mosq.h similarity index 100% rename from src/libs/mosquitto/lib/logging_mosq.h rename to mosquitto/lib/logging_mosq.h diff --git a/src/libs/mosquitto/lib/memory_mosq.c b/mosquitto/lib/memory_mosq.c similarity index 100% rename from src/libs/mosquitto/lib/memory_mosq.c rename to mosquitto/lib/memory_mosq.c diff --git a/src/libs/mosquitto/lib/memory_mosq.h b/mosquitto/lib/memory_mosq.h similarity index 100% rename from src/libs/mosquitto/lib/memory_mosq.h rename to mosquitto/lib/memory_mosq.h diff --git a/src/libs/mosquitto/lib/messages_mosq.c b/mosquitto/lib/messages_mosq.c similarity index 100% rename from src/libs/mosquitto/lib/messages_mosq.c rename to mosquitto/lib/messages_mosq.c diff --git a/src/libs/mosquitto/lib/messages_mosq.h b/mosquitto/lib/messages_mosq.h similarity index 100% rename from src/libs/mosquitto/lib/messages_mosq.h rename to mosquitto/lib/messages_mosq.h diff --git a/src/libs/mosquitto/lib/mosquitto.c b/mosquitto/lib/mosquitto.c similarity index 100% rename from src/libs/mosquitto/lib/mosquitto.c rename to mosquitto/lib/mosquitto.c diff --git a/src/libs/mosquitto/lib/mosquitto.h b/mosquitto/lib/mosquitto.h similarity index 100% rename from src/libs/mosquitto/lib/mosquitto.h rename to mosquitto/lib/mosquitto.h diff --git a/src/libs/mosquitto/lib/mosquitto_internal.h b/mosquitto/lib/mosquitto_internal.h similarity index 100% rename from src/libs/mosquitto/lib/mosquitto_internal.h rename to mosquitto/lib/mosquitto_internal.h diff --git a/src/libs/mosquitto/lib/mqtt3_protocol.h b/mosquitto/lib/mqtt3_protocol.h similarity index 100% rename from src/libs/mosquitto/lib/mqtt3_protocol.h rename to mosquitto/lib/mqtt3_protocol.h diff --git a/src/libs/mosquitto/lib/net_mosq.c b/mosquitto/lib/net_mosq.c similarity index 100% rename from src/libs/mosquitto/lib/net_mosq.c rename to mosquitto/lib/net_mosq.c diff --git a/src/libs/mosquitto/lib/net_mosq.h b/mosquitto/lib/net_mosq.h similarity index 100% rename from src/libs/mosquitto/lib/net_mosq.h rename to mosquitto/lib/net_mosq.h diff --git a/src/libs/mosquitto/lib/read_handle.c b/mosquitto/lib/read_handle.c similarity index 100% rename from src/libs/mosquitto/lib/read_handle.c rename to mosquitto/lib/read_handle.c diff --git a/src/libs/mosquitto/lib/read_handle.h b/mosquitto/lib/read_handle.h similarity index 100% rename from src/libs/mosquitto/lib/read_handle.h rename to mosquitto/lib/read_handle.h diff --git a/src/libs/mosquitto/lib/read_handle_client.c b/mosquitto/lib/read_handle_client.c similarity index 100% rename from src/libs/mosquitto/lib/read_handle_client.c rename to mosquitto/lib/read_handle_client.c diff --git a/src/libs/mosquitto/lib/read_handle_shared.c b/mosquitto/lib/read_handle_shared.c similarity index 100% rename from src/libs/mosquitto/lib/read_handle_shared.c rename to mosquitto/lib/read_handle_shared.c diff --git a/src/libs/mosquitto/lib/send_client_mosq.c b/mosquitto/lib/send_client_mosq.c similarity index 100% rename from src/libs/mosquitto/lib/send_client_mosq.c rename to mosquitto/lib/send_client_mosq.c diff --git a/src/libs/mosquitto/lib/send_mosq.c b/mosquitto/lib/send_mosq.c similarity index 100% rename from src/libs/mosquitto/lib/send_mosq.c rename to mosquitto/lib/send_mosq.c diff --git a/src/libs/mosquitto/lib/send_mosq.h b/mosquitto/lib/send_mosq.h similarity index 100% rename from src/libs/mosquitto/lib/send_mosq.h rename to mosquitto/lib/send_mosq.h diff --git a/src/libs/mosquitto/lib/socks_mosq.c b/mosquitto/lib/socks_mosq.c similarity index 100% rename from src/libs/mosquitto/lib/socks_mosq.c rename to mosquitto/lib/socks_mosq.c diff --git a/src/libs/mosquitto/lib/socks_mosq.h b/mosquitto/lib/socks_mosq.h similarity index 100% rename from src/libs/mosquitto/lib/socks_mosq.h rename to mosquitto/lib/socks_mosq.h diff --git a/src/libs/mosquitto/lib/srv_mosq.c b/mosquitto/lib/srv_mosq.c similarity index 100% rename from src/libs/mosquitto/lib/srv_mosq.c rename to mosquitto/lib/srv_mosq.c diff --git a/src/libs/mosquitto/lib/thread_mosq.c b/mosquitto/lib/thread_mosq.c similarity index 100% rename from src/libs/mosquitto/lib/thread_mosq.c rename to mosquitto/lib/thread_mosq.c diff --git a/src/libs/mosquitto/lib/time_mosq.c b/mosquitto/lib/time_mosq.c similarity index 100% rename from src/libs/mosquitto/lib/time_mosq.c rename to mosquitto/lib/time_mosq.c diff --git a/src/libs/mosquitto/lib/time_mosq.h b/mosquitto/lib/time_mosq.h similarity index 100% rename from src/libs/mosquitto/lib/time_mosq.h rename to mosquitto/lib/time_mosq.h diff --git a/src/libs/mosquitto/lib/tls_mosq.c b/mosquitto/lib/tls_mosq.c similarity index 100% rename from src/libs/mosquitto/lib/tls_mosq.c rename to mosquitto/lib/tls_mosq.c diff --git a/src/libs/mosquitto/lib/tls_mosq.h b/mosquitto/lib/tls_mosq.h similarity index 100% rename from src/libs/mosquitto/lib/tls_mosq.h rename to mosquitto/lib/tls_mosq.h diff --git a/src/libs/mosquitto/lib/util_mosq.c b/mosquitto/lib/util_mosq.c similarity index 100% rename from src/libs/mosquitto/lib/util_mosq.c rename to mosquitto/lib/util_mosq.c diff --git a/src/libs/mosquitto/lib/util_mosq.h b/mosquitto/lib/util_mosq.h similarity index 100% rename from src/libs/mosquitto/lib/util_mosq.h rename to mosquitto/lib/util_mosq.h diff --git a/src/libs/mosquitto/lib/will_mosq.c b/mosquitto/lib/will_mosq.c similarity index 100% rename from src/libs/mosquitto/lib/will_mosq.c rename to mosquitto/lib/will_mosq.c diff --git a/src/libs/mosquitto/lib/will_mosq.h b/mosquitto/lib/will_mosq.h similarity index 100% rename from src/libs/mosquitto/lib/will_mosq.h rename to mosquitto/lib/will_mosq.h diff --git a/src/libs/mosquitto/logo/legacy/mosquitto-14x14.png b/mosquitto/logo/legacy/mosquitto-14x14.png similarity index 100% rename from src/libs/mosquitto/logo/legacy/mosquitto-14x14.png rename to mosquitto/logo/legacy/mosquitto-14x14.png diff --git a/src/libs/mosquitto/logo/legacy/mosquitto-16x16.png b/mosquitto/logo/legacy/mosquitto-16x16.png similarity index 100% rename from src/libs/mosquitto/logo/legacy/mosquitto-16x16.png rename to mosquitto/logo/legacy/mosquitto-16x16.png diff --git a/src/libs/mosquitto/logo/legacy/mosquitto.svg b/mosquitto/logo/legacy/mosquitto.svg similarity index 100% rename from src/libs/mosquitto/logo/legacy/mosquitto.svg rename to mosquitto/logo/legacy/mosquitto.svg diff --git a/src/libs/mosquitto/logo/mosquitto-logo-min.svg b/mosquitto/logo/mosquitto-logo-min.svg similarity index 100% rename from src/libs/mosquitto/logo/mosquitto-logo-min.svg rename to mosquitto/logo/mosquitto-logo-min.svg diff --git a/src/libs/mosquitto/logo/mosquitto-logo-only.svg b/mosquitto/logo/mosquitto-logo-only.svg similarity index 100% rename from src/libs/mosquitto/logo/mosquitto-logo-only.svg rename to mosquitto/logo/mosquitto-logo-only.svg diff --git a/src/libs/mosquitto/logo/mosquitto-text-below.svg b/mosquitto/logo/mosquitto-text-below.svg similarity index 100% rename from src/libs/mosquitto/logo/mosquitto-text-below.svg rename to mosquitto/logo/mosquitto-text-below.svg diff --git a/src/libs/mosquitto/logo/mosquitto-text-side.svg b/mosquitto/logo/mosquitto-text-side.svg similarity index 100% rename from src/libs/mosquitto/logo/mosquitto-text-side.svg rename to mosquitto/logo/mosquitto-text-side.svg diff --git a/src/libs/mosquitto/logo/mosquitto.ico b/mosquitto/logo/mosquitto.ico similarity index 100% rename from src/libs/mosquitto/logo/mosquitto.ico rename to mosquitto/logo/mosquitto.ico diff --git a/src/libs/mosquitto/man/CMakeFiles/CMakeDirectoryInformation.cmake b/mosquitto/man/CMakeFiles/CMakeDirectoryInformation.cmake similarity index 100% rename from src/libs/mosquitto/man/CMakeFiles/CMakeDirectoryInformation.cmake rename to mosquitto/man/CMakeFiles/CMakeDirectoryInformation.cmake diff --git a/src/libs/mosquitto/man/CMakeFiles/progress.marks b/mosquitto/man/CMakeFiles/progress.marks similarity index 100% rename from src/libs/mosquitto/man/CMakeFiles/progress.marks rename to mosquitto/man/CMakeFiles/progress.marks diff --git a/src/libs/mosquitto/man/CMakeLists.txt b/mosquitto/man/CMakeLists.txt similarity index 100% rename from src/libs/mosquitto/man/CMakeLists.txt rename to mosquitto/man/CMakeLists.txt diff --git a/src/libs/mosquitto/man/Makefile b/mosquitto/man/Makefile similarity index 100% rename from src/libs/mosquitto/man/Makefile rename to mosquitto/man/Makefile diff --git a/src/libs/mosquitto/man/cmake_install.cmake b/mosquitto/man/cmake_install.cmake similarity index 100% rename from src/libs/mosquitto/man/cmake_install.cmake rename to mosquitto/man/cmake_install.cmake diff --git a/src/libs/mosquitto/man/html.xsl b/mosquitto/man/html.xsl similarity index 100% rename from src/libs/mosquitto/man/html.xsl rename to mosquitto/man/html.xsl diff --git a/src/libs/mosquitto/man/libmosquitto.3 b/mosquitto/man/libmosquitto.3 similarity index 100% rename from src/libs/mosquitto/man/libmosquitto.3 rename to mosquitto/man/libmosquitto.3 diff --git a/src/libs/mosquitto/man/libmosquitto.3.xml b/mosquitto/man/libmosquitto.3.xml similarity index 100% rename from src/libs/mosquitto/man/libmosquitto.3.xml rename to mosquitto/man/libmosquitto.3.xml diff --git a/src/libs/mosquitto/man/manpage.xsl b/mosquitto/man/manpage.xsl similarity index 100% rename from src/libs/mosquitto/man/manpage.xsl rename to mosquitto/man/manpage.xsl diff --git a/src/libs/mosquitto/man/mosquitto-tls.7 b/mosquitto/man/mosquitto-tls.7 similarity index 100% rename from src/libs/mosquitto/man/mosquitto-tls.7 rename to mosquitto/man/mosquitto-tls.7 diff --git a/src/libs/mosquitto/man/mosquitto-tls.7.xml b/mosquitto/man/mosquitto-tls.7.xml similarity index 100% rename from src/libs/mosquitto/man/mosquitto-tls.7.xml rename to mosquitto/man/mosquitto-tls.7.xml diff --git a/src/libs/mosquitto/man/mosquitto.8 b/mosquitto/man/mosquitto.8 similarity index 100% rename from src/libs/mosquitto/man/mosquitto.8 rename to mosquitto/man/mosquitto.8 diff --git a/src/libs/mosquitto/man/mosquitto.8.xml b/mosquitto/man/mosquitto.8.xml similarity index 100% rename from src/libs/mosquitto/man/mosquitto.8.xml rename to mosquitto/man/mosquitto.8.xml diff --git a/src/libs/mosquitto/man/mosquitto.conf.5 b/mosquitto/man/mosquitto.conf.5 similarity index 100% rename from src/libs/mosquitto/man/mosquitto.conf.5 rename to mosquitto/man/mosquitto.conf.5 diff --git a/src/libs/mosquitto/man/mosquitto.conf.5.xml b/mosquitto/man/mosquitto.conf.5.xml similarity index 100% rename from src/libs/mosquitto/man/mosquitto.conf.5.xml rename to mosquitto/man/mosquitto.conf.5.xml diff --git a/src/libs/mosquitto/man/mosquitto_passwd.1 b/mosquitto/man/mosquitto_passwd.1 similarity index 100% rename from src/libs/mosquitto/man/mosquitto_passwd.1 rename to mosquitto/man/mosquitto_passwd.1 diff --git a/src/libs/mosquitto/man/mosquitto_passwd.1.xml b/mosquitto/man/mosquitto_passwd.1.xml similarity index 100% rename from src/libs/mosquitto/man/mosquitto_passwd.1.xml rename to mosquitto/man/mosquitto_passwd.1.xml diff --git a/src/libs/mosquitto/man/mosquitto_pub.1 b/mosquitto/man/mosquitto_pub.1 similarity index 100% rename from src/libs/mosquitto/man/mosquitto_pub.1 rename to mosquitto/man/mosquitto_pub.1 diff --git a/src/libs/mosquitto/man/mosquitto_pub.1.xml b/mosquitto/man/mosquitto_pub.1.xml similarity index 100% rename from src/libs/mosquitto/man/mosquitto_pub.1.xml rename to mosquitto/man/mosquitto_pub.1.xml diff --git a/src/libs/mosquitto/man/mosquitto_sub.1 b/mosquitto/man/mosquitto_sub.1 similarity index 100% rename from src/libs/mosquitto/man/mosquitto_sub.1 rename to mosquitto/man/mosquitto_sub.1 diff --git a/src/libs/mosquitto/man/mosquitto_sub.1.xml b/mosquitto/man/mosquitto_sub.1.xml similarity index 100% rename from src/libs/mosquitto/man/mosquitto_sub.1.xml rename to mosquitto/man/mosquitto_sub.1.xml diff --git a/src/libs/mosquitto/man/mqtt.7 b/mosquitto/man/mqtt.7 similarity index 100% rename from src/libs/mosquitto/man/mqtt.7 rename to mosquitto/man/mqtt.7 diff --git a/src/libs/mosquitto/man/mqtt.7.xml b/mosquitto/man/mqtt.7.xml similarity index 100% rename from src/libs/mosquitto/man/mqtt.7.xml rename to mosquitto/man/mqtt.7.xml diff --git a/src/libs/mosquitto/test/ssl/server-expired.crt b/mosquitto/misc/currentcost/__init__.py similarity index 100% rename from src/libs/mosquitto/test/ssl/server-expired.crt rename to mosquitto/misc/currentcost/__init__.py diff --git a/src/libs/mosquitto/misc/currentcost/cc128_log_mysql.pl b/mosquitto/misc/currentcost/cc128_log_mysql.pl similarity index 100% rename from src/libs/mosquitto/misc/currentcost/cc128_log_mysql.pl rename to mosquitto/misc/currentcost/cc128_log_mysql.pl diff --git a/src/libs/mosquitto/misc/currentcost/cc128_parse.pl b/mosquitto/misc/currentcost/cc128_parse.pl similarity index 100% rename from src/libs/mosquitto/misc/currentcost/cc128_parse.pl rename to mosquitto/misc/currentcost/cc128_parse.pl diff --git a/src/libs/mosquitto/misc/currentcost/cc128_read.pl b/mosquitto/misc/currentcost/cc128_read.pl similarity index 100% rename from src/libs/mosquitto/misc/currentcost/cc128_read.pl rename to mosquitto/misc/currentcost/cc128_read.pl diff --git a/src/libs/mosquitto/misc/currentcost/cc128_read.py b/mosquitto/misc/currentcost/cc128_read.py similarity index 100% rename from src/libs/mosquitto/misc/currentcost/cc128_read.py rename to mosquitto/misc/currentcost/cc128_read.py diff --git a/src/libs/mosquitto/misc/currentcost/gnome-panel/CurrentCostMQTT.py b/mosquitto/misc/currentcost/gnome-panel/CurrentCostMQTT.py similarity index 100% rename from src/libs/mosquitto/misc/currentcost/gnome-panel/CurrentCostMQTT.py rename to mosquitto/misc/currentcost/gnome-panel/CurrentCostMQTT.py diff --git a/src/libs/mosquitto/misc/currentcost/gnome-panel/CurrentCostMQTT.server b/mosquitto/misc/currentcost/gnome-panel/CurrentCostMQTT.server similarity index 100% rename from src/libs/mosquitto/misc/currentcost/gnome-panel/CurrentCostMQTT.server rename to mosquitto/misc/currentcost/gnome-panel/CurrentCostMQTT.server diff --git a/mosquitto/misc/currentcost/gnome-panel/__init__.py b/mosquitto/misc/currentcost/gnome-panel/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/libs/mosquitto/misc/currentcost/gnome-panel/currentcost.png b/mosquitto/misc/currentcost/gnome-panel/currentcost.png similarity index 100% rename from src/libs/mosquitto/misc/currentcost/gnome-panel/currentcost.png rename to mosquitto/misc/currentcost/gnome-panel/currentcost.png diff --git a/src/libs/mosquitto/mosquitto.conf b/mosquitto/mosquitto.conf similarity index 100% rename from src/libs/mosquitto/mosquitto.conf rename to mosquitto/mosquitto.conf diff --git a/src/libs/mosquitto/notice.html b/mosquitto/notice.html similarity index 100% rename from src/libs/mosquitto/notice.html rename to mosquitto/notice.html diff --git a/src/libs/mosquitto/pskfile.example b/mosquitto/pskfile.example similarity index 100% rename from src/libs/mosquitto/pskfile.example rename to mosquitto/pskfile.example diff --git a/src/libs/mosquitto/pwfile.example b/mosquitto/pwfile.example similarity index 100% rename from src/libs/mosquitto/pwfile.example rename to mosquitto/pwfile.example diff --git a/src/libs/mosquitto/readme-windows.txt b/mosquitto/readme-windows.txt similarity index 100% rename from src/libs/mosquitto/readme-windows.txt rename to mosquitto/readme-windows.txt diff --git a/src/libs/mosquitto/readme.md b/mosquitto/readme.md similarity index 100% rename from src/libs/mosquitto/readme.md rename to mosquitto/readme.md diff --git a/src/libs/mosquitto/security/mosquitto.apparmor b/mosquitto/security/mosquitto.apparmor similarity index 100% rename from src/libs/mosquitto/security/mosquitto.apparmor rename to mosquitto/security/mosquitto.apparmor diff --git a/src/libs/mosquitto/service/monit/mosquitto.monit b/mosquitto/service/monit/mosquitto.monit similarity index 100% rename from src/libs/mosquitto/service/monit/mosquitto.monit rename to mosquitto/service/monit/mosquitto.monit diff --git a/src/libs/mosquitto/service/svscan/run b/mosquitto/service/svscan/run similarity index 100% rename from src/libs/mosquitto/service/svscan/run rename to mosquitto/service/svscan/run diff --git a/src/libs/mosquitto/service/upstart/mosquitto.conf b/mosquitto/service/upstart/mosquitto.conf similarity index 100% rename from src/libs/mosquitto/service/upstart/mosquitto.conf rename to mosquitto/service/upstart/mosquitto.conf diff --git a/src/libs/mosquitto/src/CMakeFiles/CMakeDirectoryInformation.cmake b/mosquitto/src/CMakeFiles/CMakeDirectoryInformation.cmake similarity index 100% rename from src/libs/mosquitto/src/CMakeFiles/CMakeDirectoryInformation.cmake rename to mosquitto/src/CMakeFiles/CMakeDirectoryInformation.cmake diff --git a/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/C.includecache b/mosquitto/src/CMakeFiles/mosquitto.dir/C.includecache similarity index 100% rename from src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/C.includecache rename to mosquitto/src/CMakeFiles/mosquitto.dir/C.includecache diff --git a/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/DependInfo.cmake b/mosquitto/src/CMakeFiles/mosquitto.dir/DependInfo.cmake similarity index 100% rename from src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/DependInfo.cmake rename to mosquitto/src/CMakeFiles/mosquitto.dir/DependInfo.cmake diff --git a/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/build.make b/mosquitto/src/CMakeFiles/mosquitto.dir/build.make similarity index 100% rename from src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/build.make rename to mosquitto/src/CMakeFiles/mosquitto.dir/build.make diff --git a/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/cmake_clean.cmake b/mosquitto/src/CMakeFiles/mosquitto.dir/cmake_clean.cmake similarity index 100% rename from src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/cmake_clean.cmake rename to mosquitto/src/CMakeFiles/mosquitto.dir/cmake_clean.cmake diff --git a/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/depend.internal b/mosquitto/src/CMakeFiles/mosquitto.dir/depend.internal similarity index 100% rename from src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/depend.internal rename to mosquitto/src/CMakeFiles/mosquitto.dir/depend.internal diff --git a/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/depend.make b/mosquitto/src/CMakeFiles/mosquitto.dir/depend.make similarity index 100% rename from src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/depend.make rename to mosquitto/src/CMakeFiles/mosquitto.dir/depend.make diff --git a/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/flags.make b/mosquitto/src/CMakeFiles/mosquitto.dir/flags.make similarity index 100% rename from src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/flags.make rename to mosquitto/src/CMakeFiles/mosquitto.dir/flags.make diff --git a/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/link.txt b/mosquitto/src/CMakeFiles/mosquitto.dir/link.txt similarity index 100% rename from src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/link.txt rename to mosquitto/src/CMakeFiles/mosquitto.dir/link.txt diff --git a/src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/progress.make b/mosquitto/src/CMakeFiles/mosquitto.dir/progress.make similarity index 100% rename from src/libs/mosquitto/src/CMakeFiles/mosquitto.dir/progress.make rename to mosquitto/src/CMakeFiles/mosquitto.dir/progress.make diff --git a/src/libs/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/DependInfo.cmake b/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/DependInfo.cmake similarity index 100% rename from src/libs/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/DependInfo.cmake rename to mosquitto/src/CMakeFiles/mosquitto_passwd.dir/DependInfo.cmake diff --git a/src/libs/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/build.make b/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/build.make similarity index 100% rename from src/libs/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/build.make rename to mosquitto/src/CMakeFiles/mosquitto_passwd.dir/build.make diff --git a/src/libs/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/cmake_clean.cmake b/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/cmake_clean.cmake similarity index 100% rename from src/libs/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/cmake_clean.cmake rename to mosquitto/src/CMakeFiles/mosquitto_passwd.dir/cmake_clean.cmake diff --git a/src/libs/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/depend.make b/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/depend.make similarity index 100% rename from src/libs/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/depend.make rename to mosquitto/src/CMakeFiles/mosquitto_passwd.dir/depend.make diff --git a/src/libs/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/flags.make b/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/flags.make similarity index 100% rename from src/libs/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/flags.make rename to mosquitto/src/CMakeFiles/mosquitto_passwd.dir/flags.make diff --git a/src/libs/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/link.txt b/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/link.txt similarity index 100% rename from src/libs/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/link.txt rename to mosquitto/src/CMakeFiles/mosquitto_passwd.dir/link.txt diff --git a/src/libs/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/progress.make b/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/progress.make similarity index 100% rename from src/libs/mosquitto/src/CMakeFiles/mosquitto_passwd.dir/progress.make rename to mosquitto/src/CMakeFiles/mosquitto_passwd.dir/progress.make diff --git a/src/libs/mosquitto/src/CMakeFiles/progress.marks b/mosquitto/src/CMakeFiles/progress.marks similarity index 100% rename from src/libs/mosquitto/src/CMakeFiles/progress.marks rename to mosquitto/src/CMakeFiles/progress.marks diff --git a/src/libs/mosquitto/src/CMakeLists.txt b/mosquitto/src/CMakeLists.txt similarity index 100% rename from src/libs/mosquitto/src/CMakeLists.txt rename to mosquitto/src/CMakeLists.txt diff --git a/src/libs/mosquitto/src/Makefile b/mosquitto/src/Makefile similarity index 100% rename from src/libs/mosquitto/src/Makefile rename to mosquitto/src/Makefile diff --git a/src/libs/mosquitto/src/bridge.c b/mosquitto/src/bridge.c similarity index 100% rename from src/libs/mosquitto/src/bridge.c rename to mosquitto/src/bridge.c diff --git a/src/libs/mosquitto/src/cmake_install.cmake b/mosquitto/src/cmake_install.cmake similarity index 100% rename from src/libs/mosquitto/src/cmake_install.cmake rename to mosquitto/src/cmake_install.cmake diff --git a/src/libs/mosquitto/src/conf.c b/mosquitto/src/conf.c similarity index 100% rename from src/libs/mosquitto/src/conf.c rename to mosquitto/src/conf.c diff --git a/src/libs/mosquitto/src/context.c b/mosquitto/src/context.c similarity index 100% rename from src/libs/mosquitto/src/context.c rename to mosquitto/src/context.c diff --git a/src/libs/mosquitto/src/database.c b/mosquitto/src/database.c similarity index 100% rename from src/libs/mosquitto/src/database.c rename to mosquitto/src/database.c diff --git a/src/libs/mosquitto/src/db_dump/Makefile b/mosquitto/src/db_dump/Makefile similarity index 100% rename from src/libs/mosquitto/src/db_dump/Makefile rename to mosquitto/src/db_dump/Makefile diff --git a/src/libs/mosquitto/src/db_dump/db_dump.c b/mosquitto/src/db_dump/db_dump.c similarity index 100% rename from src/libs/mosquitto/src/db_dump/db_dump.c rename to mosquitto/src/db_dump/db_dump.c diff --git a/src/libs/mosquitto/src/lib_load.h b/mosquitto/src/lib_load.h similarity index 100% rename from src/libs/mosquitto/src/lib_load.h rename to mosquitto/src/lib_load.h diff --git a/src/libs/mosquitto/src/linker-macosx.syms b/mosquitto/src/linker-macosx.syms similarity index 100% rename from src/libs/mosquitto/src/linker-macosx.syms rename to mosquitto/src/linker-macosx.syms diff --git a/src/libs/mosquitto/src/linker.syms b/mosquitto/src/linker.syms similarity index 100% rename from src/libs/mosquitto/src/linker.syms rename to mosquitto/src/linker.syms diff --git a/src/libs/mosquitto/src/logging.c b/mosquitto/src/logging.c similarity index 100% rename from src/libs/mosquitto/src/logging.c rename to mosquitto/src/logging.c diff --git a/src/libs/mosquitto/src/loop.c b/mosquitto/src/loop.c similarity index 100% rename from src/libs/mosquitto/src/loop.c rename to mosquitto/src/loop.c diff --git a/src/libs/mosquitto/src/mosquitto b/mosquitto/src/mosquitto similarity index 100% rename from src/libs/mosquitto/src/mosquitto rename to mosquitto/src/mosquitto diff --git a/src/libs/mosquitto/src/mosquitto.c b/mosquitto/src/mosquitto.c similarity index 100% rename from src/libs/mosquitto/src/mosquitto.c rename to mosquitto/src/mosquitto.c diff --git a/src/libs/mosquitto/src/mosquitto_broker.h b/mosquitto/src/mosquitto_broker.h similarity index 100% rename from src/libs/mosquitto/src/mosquitto_broker.h rename to mosquitto/src/mosquitto_broker.h diff --git a/src/libs/mosquitto/src/mosquitto_passwd.c b/mosquitto/src/mosquitto_passwd.c similarity index 100% rename from src/libs/mosquitto/src/mosquitto_passwd.c rename to mosquitto/src/mosquitto_passwd.c diff --git a/src/libs/mosquitto/src/mosquitto_plugin.h b/mosquitto/src/mosquitto_plugin.h similarity index 100% rename from src/libs/mosquitto/src/mosquitto_plugin.h rename to mosquitto/src/mosquitto_plugin.h diff --git a/src/libs/mosquitto/src/net.c b/mosquitto/src/net.c similarity index 100% rename from src/libs/mosquitto/src/net.c rename to mosquitto/src/net.c diff --git a/src/libs/mosquitto/src/persist.c b/mosquitto/src/persist.c similarity index 100% rename from src/libs/mosquitto/src/persist.c rename to mosquitto/src/persist.c diff --git a/src/libs/mosquitto/src/persist.h b/mosquitto/src/persist.h similarity index 100% rename from src/libs/mosquitto/src/persist.h rename to mosquitto/src/persist.h diff --git a/src/libs/mosquitto/src/read_handle.c b/mosquitto/src/read_handle.c similarity index 100% rename from src/libs/mosquitto/src/read_handle.c rename to mosquitto/src/read_handle.c diff --git a/src/libs/mosquitto/src/read_handle_client.c b/mosquitto/src/read_handle_client.c similarity index 100% rename from src/libs/mosquitto/src/read_handle_client.c rename to mosquitto/src/read_handle_client.c diff --git a/src/libs/mosquitto/src/read_handle_server.c b/mosquitto/src/read_handle_server.c similarity index 100% rename from src/libs/mosquitto/src/read_handle_server.c rename to mosquitto/src/read_handle_server.c diff --git a/src/libs/mosquitto/src/security.c b/mosquitto/src/security.c similarity index 100% rename from src/libs/mosquitto/src/security.c rename to mosquitto/src/security.c diff --git a/src/libs/mosquitto/src/security_default.c b/mosquitto/src/security_default.c similarity index 100% rename from src/libs/mosquitto/src/security_default.c rename to mosquitto/src/security_default.c diff --git a/src/libs/mosquitto/src/send_server.c b/mosquitto/src/send_server.c similarity index 100% rename from src/libs/mosquitto/src/send_server.c rename to mosquitto/src/send_server.c diff --git a/src/libs/mosquitto/src/service.c b/mosquitto/src/service.c similarity index 100% rename from src/libs/mosquitto/src/service.c rename to mosquitto/src/service.c diff --git a/src/libs/mosquitto/src/subs.c b/mosquitto/src/subs.c similarity index 100% rename from src/libs/mosquitto/src/subs.c rename to mosquitto/src/subs.c diff --git a/src/libs/mosquitto/src/sys_tree.c b/mosquitto/src/sys_tree.c similarity index 100% rename from src/libs/mosquitto/src/sys_tree.c rename to mosquitto/src/sys_tree.c diff --git a/src/libs/mosquitto/src/uthash.h b/mosquitto/src/uthash.h similarity index 100% rename from src/libs/mosquitto/src/uthash.h rename to mosquitto/src/uthash.h diff --git a/src/libs/mosquitto/src/websockets.c b/mosquitto/src/websockets.c similarity index 100% rename from src/libs/mosquitto/src/websockets.c rename to mosquitto/src/websockets.c diff --git a/src/libs/mosquitto/test/Makefile b/mosquitto/test/Makefile similarity index 100% rename from src/libs/mosquitto/test/Makefile rename to mosquitto/test/Makefile diff --git a/mosquitto/test/__init__.py b/mosquitto/test/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/libs/mosquitto/test/broker/01-connect-anon-denied.conf b/mosquitto/test/broker/01-connect-anon-denied.conf similarity index 100% rename from src/libs/mosquitto/test/broker/01-connect-anon-denied.conf rename to mosquitto/test/broker/01-connect-anon-denied.conf diff --git a/src/libs/mosquitto/test/broker/01-connect-anon-denied.pwfile b/mosquitto/test/broker/01-connect-anon-denied.pwfile similarity index 100% rename from src/libs/mosquitto/test/broker/01-connect-anon-denied.pwfile rename to mosquitto/test/broker/01-connect-anon-denied.pwfile diff --git a/src/libs/mosquitto/test/broker/01-connect-anon-denied.py b/mosquitto/test/broker/01-connect-anon-denied.py similarity index 100% rename from src/libs/mosquitto/test/broker/01-connect-anon-denied.py rename to mosquitto/test/broker/01-connect-anon-denied.py diff --git a/src/libs/mosquitto/test/broker/01-connect-invalid-id-0-311.py b/mosquitto/test/broker/01-connect-invalid-id-0-311.py similarity index 100% rename from src/libs/mosquitto/test/broker/01-connect-invalid-id-0-311.py rename to mosquitto/test/broker/01-connect-invalid-id-0-311.py diff --git a/src/libs/mosquitto/test/broker/01-connect-invalid-id-0.py b/mosquitto/test/broker/01-connect-invalid-id-0.py similarity index 100% rename from src/libs/mosquitto/test/broker/01-connect-invalid-id-0.py rename to mosquitto/test/broker/01-connect-invalid-id-0.py diff --git a/src/libs/mosquitto/test/broker/01-connect-invalid-id-missing.py b/mosquitto/test/broker/01-connect-invalid-id-missing.py similarity index 100% rename from src/libs/mosquitto/test/broker/01-connect-invalid-id-missing.py rename to mosquitto/test/broker/01-connect-invalid-id-missing.py diff --git a/src/libs/mosquitto/test/broker/01-connect-invalid-protonum.py b/mosquitto/test/broker/01-connect-invalid-protonum.py similarity index 100% rename from src/libs/mosquitto/test/broker/01-connect-invalid-protonum.py rename to mosquitto/test/broker/01-connect-invalid-protonum.py diff --git a/src/libs/mosquitto/test/broker/01-connect-invalid-reserved.py b/mosquitto/test/broker/01-connect-invalid-reserved.py similarity index 100% rename from src/libs/mosquitto/test/broker/01-connect-invalid-reserved.py rename to mosquitto/test/broker/01-connect-invalid-reserved.py diff --git a/src/libs/mosquitto/test/broker/01-connect-success.py b/mosquitto/test/broker/01-connect-success.py similarity index 100% rename from src/libs/mosquitto/test/broker/01-connect-success.py rename to mosquitto/test/broker/01-connect-success.py diff --git a/src/libs/mosquitto/test/broker/01-connect-uname-no-password-denied.conf b/mosquitto/test/broker/01-connect-uname-no-password-denied.conf similarity index 100% rename from src/libs/mosquitto/test/broker/01-connect-uname-no-password-denied.conf rename to mosquitto/test/broker/01-connect-uname-no-password-denied.conf diff --git a/src/libs/mosquitto/test/broker/01-connect-uname-no-password-denied.pwfile b/mosquitto/test/broker/01-connect-uname-no-password-denied.pwfile similarity index 100% rename from src/libs/mosquitto/test/broker/01-connect-uname-no-password-denied.pwfile rename to mosquitto/test/broker/01-connect-uname-no-password-denied.pwfile diff --git a/src/libs/mosquitto/test/broker/01-connect-uname-no-password-denied.py b/mosquitto/test/broker/01-connect-uname-no-password-denied.py similarity index 100% rename from src/libs/mosquitto/test/broker/01-connect-uname-no-password-denied.py rename to mosquitto/test/broker/01-connect-uname-no-password-denied.py diff --git a/src/libs/mosquitto/test/broker/01-connect-uname-password-denied.conf b/mosquitto/test/broker/01-connect-uname-password-denied.conf similarity index 100% rename from src/libs/mosquitto/test/broker/01-connect-uname-password-denied.conf rename to mosquitto/test/broker/01-connect-uname-password-denied.conf diff --git a/src/libs/mosquitto/test/broker/01-connect-uname-password-denied.pwfile b/mosquitto/test/broker/01-connect-uname-password-denied.pwfile similarity index 100% rename from src/libs/mosquitto/test/broker/01-connect-uname-password-denied.pwfile rename to mosquitto/test/broker/01-connect-uname-password-denied.pwfile diff --git a/src/libs/mosquitto/test/broker/01-connect-uname-password-denied.py b/mosquitto/test/broker/01-connect-uname-password-denied.py similarity index 100% rename from src/libs/mosquitto/test/broker/01-connect-uname-password-denied.py rename to mosquitto/test/broker/01-connect-uname-password-denied.py diff --git a/src/libs/mosquitto/test/broker/01-connect-uname-password-success-no-tls.conf b/mosquitto/test/broker/01-connect-uname-password-success-no-tls.conf similarity index 100% rename from src/libs/mosquitto/test/broker/01-connect-uname-password-success-no-tls.conf rename to mosquitto/test/broker/01-connect-uname-password-success-no-tls.conf diff --git a/src/libs/mosquitto/test/broker/01-connect-uname-password-success-no-tls.pwfile b/mosquitto/test/broker/01-connect-uname-password-success-no-tls.pwfile similarity index 100% rename from src/libs/mosquitto/test/broker/01-connect-uname-password-success-no-tls.pwfile rename to mosquitto/test/broker/01-connect-uname-password-success-no-tls.pwfile diff --git a/src/libs/mosquitto/test/broker/01-connect-uname-password-success-no-tls.py b/mosquitto/test/broker/01-connect-uname-password-success-no-tls.py similarity index 100% rename from src/libs/mosquitto/test/broker/01-connect-uname-password-success-no-tls.py rename to mosquitto/test/broker/01-connect-uname-password-success-no-tls.py diff --git a/src/libs/mosquitto/test/broker/01-connect-uname-password-success.conf b/mosquitto/test/broker/01-connect-uname-password-success.conf similarity index 100% rename from src/libs/mosquitto/test/broker/01-connect-uname-password-success.conf rename to mosquitto/test/broker/01-connect-uname-password-success.conf diff --git a/src/libs/mosquitto/test/broker/01-connect-uname-password-success.pwfile b/mosquitto/test/broker/01-connect-uname-password-success.pwfile similarity index 100% rename from src/libs/mosquitto/test/broker/01-connect-uname-password-success.pwfile rename to mosquitto/test/broker/01-connect-uname-password-success.pwfile diff --git a/src/libs/mosquitto/test/broker/01-connect-uname-password-success.py b/mosquitto/test/broker/01-connect-uname-password-success.py similarity index 100% rename from src/libs/mosquitto/test/broker/01-connect-uname-password-success.py rename to mosquitto/test/broker/01-connect-uname-password-success.py diff --git a/src/libs/mosquitto/test/broker/02-subpub-qos0.py b/mosquitto/test/broker/02-subpub-qos0.py similarity index 100% rename from src/libs/mosquitto/test/broker/02-subpub-qos0.py rename to mosquitto/test/broker/02-subpub-qos0.py diff --git a/src/libs/mosquitto/test/broker/02-subpub-qos1.py b/mosquitto/test/broker/02-subpub-qos1.py similarity index 100% rename from src/libs/mosquitto/test/broker/02-subpub-qos1.py rename to mosquitto/test/broker/02-subpub-qos1.py diff --git a/src/libs/mosquitto/test/broker/02-subpub-qos2.py b/mosquitto/test/broker/02-subpub-qos2.py similarity index 100% rename from src/libs/mosquitto/test/broker/02-subpub-qos2.py rename to mosquitto/test/broker/02-subpub-qos2.py diff --git a/src/libs/mosquitto/test/broker/02-subscribe-qos0.py b/mosquitto/test/broker/02-subscribe-qos0.py similarity index 100% rename from src/libs/mosquitto/test/broker/02-subscribe-qos0.py rename to mosquitto/test/broker/02-subscribe-qos0.py diff --git a/src/libs/mosquitto/test/broker/02-subscribe-qos1.py b/mosquitto/test/broker/02-subscribe-qos1.py similarity index 100% rename from src/libs/mosquitto/test/broker/02-subscribe-qos1.py rename to mosquitto/test/broker/02-subscribe-qos1.py diff --git a/src/libs/mosquitto/test/broker/02-subscribe-qos2.py b/mosquitto/test/broker/02-subscribe-qos2.py similarity index 100% rename from src/libs/mosquitto/test/broker/02-subscribe-qos2.py rename to mosquitto/test/broker/02-subscribe-qos2.py diff --git a/src/libs/mosquitto/test/broker/02-unsubscribe-qos0.py b/mosquitto/test/broker/02-unsubscribe-qos0.py similarity index 100% rename from src/libs/mosquitto/test/broker/02-unsubscribe-qos0.py rename to mosquitto/test/broker/02-unsubscribe-qos0.py diff --git a/src/libs/mosquitto/test/broker/02-unsubscribe-qos1.py b/mosquitto/test/broker/02-unsubscribe-qos1.py similarity index 100% rename from src/libs/mosquitto/test/broker/02-unsubscribe-qos1.py rename to mosquitto/test/broker/02-unsubscribe-qos1.py diff --git a/src/libs/mosquitto/test/broker/02-unsubscribe-qos2.py b/mosquitto/test/broker/02-unsubscribe-qos2.py similarity index 100% rename from src/libs/mosquitto/test/broker/02-unsubscribe-qos2.py rename to mosquitto/test/broker/02-unsubscribe-qos2.py diff --git a/src/libs/mosquitto/test/broker/03-pattern-matching-helper.py b/mosquitto/test/broker/03-pattern-matching-helper.py similarity index 100% rename from src/libs/mosquitto/test/broker/03-pattern-matching-helper.py rename to mosquitto/test/broker/03-pattern-matching-helper.py diff --git a/src/libs/mosquitto/test/broker/03-pattern-matching.py b/mosquitto/test/broker/03-pattern-matching.py similarity index 100% rename from src/libs/mosquitto/test/broker/03-pattern-matching.py rename to mosquitto/test/broker/03-pattern-matching.py diff --git a/src/libs/mosquitto/test/broker/03-publish-b2c-disconnect-qos1-helper.py b/mosquitto/test/broker/03-publish-b2c-disconnect-qos1-helper.py similarity index 100% rename from src/libs/mosquitto/test/broker/03-publish-b2c-disconnect-qos1-helper.py rename to mosquitto/test/broker/03-publish-b2c-disconnect-qos1-helper.py diff --git a/src/libs/mosquitto/test/broker/03-publish-b2c-disconnect-qos1.conf b/mosquitto/test/broker/03-publish-b2c-disconnect-qos1.conf similarity index 100% rename from src/libs/mosquitto/test/broker/03-publish-b2c-disconnect-qos1.conf rename to mosquitto/test/broker/03-publish-b2c-disconnect-qos1.conf diff --git a/src/libs/mosquitto/test/broker/03-publish-b2c-disconnect-qos1.py b/mosquitto/test/broker/03-publish-b2c-disconnect-qos1.py similarity index 100% rename from src/libs/mosquitto/test/broker/03-publish-b2c-disconnect-qos1.py rename to mosquitto/test/broker/03-publish-b2c-disconnect-qos1.py diff --git a/src/libs/mosquitto/test/broker/03-publish-b2c-disconnect-qos2-helper.py b/mosquitto/test/broker/03-publish-b2c-disconnect-qos2-helper.py similarity index 100% rename from src/libs/mosquitto/test/broker/03-publish-b2c-disconnect-qos2-helper.py rename to mosquitto/test/broker/03-publish-b2c-disconnect-qos2-helper.py diff --git a/src/libs/mosquitto/test/broker/03-publish-b2c-disconnect-qos2.conf b/mosquitto/test/broker/03-publish-b2c-disconnect-qos2.conf similarity index 100% rename from src/libs/mosquitto/test/broker/03-publish-b2c-disconnect-qos2.conf rename to mosquitto/test/broker/03-publish-b2c-disconnect-qos2.conf diff --git a/src/libs/mosquitto/test/broker/03-publish-b2c-disconnect-qos2.py b/mosquitto/test/broker/03-publish-b2c-disconnect-qos2.py similarity index 100% rename from src/libs/mosquitto/test/broker/03-publish-b2c-disconnect-qos2.py rename to mosquitto/test/broker/03-publish-b2c-disconnect-qos2.py diff --git a/src/libs/mosquitto/test/broker/03-publish-b2c-timeout-qos1-helper.py b/mosquitto/test/broker/03-publish-b2c-timeout-qos1-helper.py similarity index 100% rename from src/libs/mosquitto/test/broker/03-publish-b2c-timeout-qos1-helper.py rename to mosquitto/test/broker/03-publish-b2c-timeout-qos1-helper.py diff --git a/src/libs/mosquitto/test/broker/03-publish-b2c-timeout-qos1.conf b/mosquitto/test/broker/03-publish-b2c-timeout-qos1.conf similarity index 100% rename from src/libs/mosquitto/test/broker/03-publish-b2c-timeout-qos1.conf rename to mosquitto/test/broker/03-publish-b2c-timeout-qos1.conf diff --git a/src/libs/mosquitto/test/broker/03-publish-b2c-timeout-qos1.py b/mosquitto/test/broker/03-publish-b2c-timeout-qos1.py similarity index 100% rename from src/libs/mosquitto/test/broker/03-publish-b2c-timeout-qos1.py rename to mosquitto/test/broker/03-publish-b2c-timeout-qos1.py diff --git a/src/libs/mosquitto/test/broker/03-publish-b2c-timeout-qos2-helper.py b/mosquitto/test/broker/03-publish-b2c-timeout-qos2-helper.py similarity index 100% rename from src/libs/mosquitto/test/broker/03-publish-b2c-timeout-qos2-helper.py rename to mosquitto/test/broker/03-publish-b2c-timeout-qos2-helper.py diff --git a/src/libs/mosquitto/test/broker/03-publish-b2c-timeout-qos2.conf b/mosquitto/test/broker/03-publish-b2c-timeout-qos2.conf similarity index 100% rename from src/libs/mosquitto/test/broker/03-publish-b2c-timeout-qos2.conf rename to mosquitto/test/broker/03-publish-b2c-timeout-qos2.conf diff --git a/src/libs/mosquitto/test/broker/03-publish-b2c-timeout-qos2.py b/mosquitto/test/broker/03-publish-b2c-timeout-qos2.py similarity index 100% rename from src/libs/mosquitto/test/broker/03-publish-b2c-timeout-qos2.py rename to mosquitto/test/broker/03-publish-b2c-timeout-qos2.py diff --git a/src/libs/mosquitto/test/broker/03-publish-c2b-disconnect-qos2.conf b/mosquitto/test/broker/03-publish-c2b-disconnect-qos2.conf similarity index 100% rename from src/libs/mosquitto/test/broker/03-publish-c2b-disconnect-qos2.conf rename to mosquitto/test/broker/03-publish-c2b-disconnect-qos2.conf diff --git a/src/libs/mosquitto/test/broker/03-publish-c2b-disconnect-qos2.py b/mosquitto/test/broker/03-publish-c2b-disconnect-qos2.py similarity index 100% rename from src/libs/mosquitto/test/broker/03-publish-c2b-disconnect-qos2.py rename to mosquitto/test/broker/03-publish-c2b-disconnect-qos2.py diff --git a/src/libs/mosquitto/test/broker/03-publish-c2b-timeout-qos2.conf b/mosquitto/test/broker/03-publish-c2b-timeout-qos2.conf similarity index 100% rename from src/libs/mosquitto/test/broker/03-publish-c2b-timeout-qos2.conf rename to mosquitto/test/broker/03-publish-c2b-timeout-qos2.conf diff --git a/src/libs/mosquitto/test/broker/03-publish-c2b-timeout-qos2.py b/mosquitto/test/broker/03-publish-c2b-timeout-qos2.py similarity index 100% rename from src/libs/mosquitto/test/broker/03-publish-c2b-timeout-qos2.py rename to mosquitto/test/broker/03-publish-c2b-timeout-qos2.py diff --git a/src/libs/mosquitto/test/broker/03-publish-qos1.py b/mosquitto/test/broker/03-publish-qos1.py similarity index 100% rename from src/libs/mosquitto/test/broker/03-publish-qos1.py rename to mosquitto/test/broker/03-publish-qos1.py diff --git a/src/libs/mosquitto/test/broker/03-publish-qos2.py b/mosquitto/test/broker/03-publish-qos2.py similarity index 100% rename from src/libs/mosquitto/test/broker/03-publish-qos2.py rename to mosquitto/test/broker/03-publish-qos2.py diff --git a/src/libs/mosquitto/test/broker/04-retain-qos0-clear.py b/mosquitto/test/broker/04-retain-qos0-clear.py similarity index 100% rename from src/libs/mosquitto/test/broker/04-retain-qos0-clear.py rename to mosquitto/test/broker/04-retain-qos0-clear.py diff --git a/src/libs/mosquitto/test/broker/04-retain-qos0-fresh.py b/mosquitto/test/broker/04-retain-qos0-fresh.py similarity index 100% rename from src/libs/mosquitto/test/broker/04-retain-qos0-fresh.py rename to mosquitto/test/broker/04-retain-qos0-fresh.py diff --git a/src/libs/mosquitto/test/broker/04-retain-qos0-repeated.py b/mosquitto/test/broker/04-retain-qos0-repeated.py similarity index 100% rename from src/libs/mosquitto/test/broker/04-retain-qos0-repeated.py rename to mosquitto/test/broker/04-retain-qos0-repeated.py diff --git a/src/libs/mosquitto/test/broker/04-retain-qos0.py b/mosquitto/test/broker/04-retain-qos0.py similarity index 100% rename from src/libs/mosquitto/test/broker/04-retain-qos0.py rename to mosquitto/test/broker/04-retain-qos0.py diff --git a/src/libs/mosquitto/test/broker/04-retain-qos1-qos0.py b/mosquitto/test/broker/04-retain-qos1-qos0.py similarity index 100% rename from src/libs/mosquitto/test/broker/04-retain-qos1-qos0.py rename to mosquitto/test/broker/04-retain-qos1-qos0.py diff --git a/src/libs/mosquitto/test/broker/05-clean-session-qos1-helper.py b/mosquitto/test/broker/05-clean-session-qos1-helper.py similarity index 100% rename from src/libs/mosquitto/test/broker/05-clean-session-qos1-helper.py rename to mosquitto/test/broker/05-clean-session-qos1-helper.py diff --git a/src/libs/mosquitto/test/broker/05-clean-session-qos1.py b/mosquitto/test/broker/05-clean-session-qos1.py similarity index 100% rename from src/libs/mosquitto/test/broker/05-clean-session-qos1.py rename to mosquitto/test/broker/05-clean-session-qos1.py diff --git a/src/libs/mosquitto/test/broker/06-bridge-b2br-disconnect-qos1.conf b/mosquitto/test/broker/06-bridge-b2br-disconnect-qos1.conf similarity index 100% rename from src/libs/mosquitto/test/broker/06-bridge-b2br-disconnect-qos1.conf rename to mosquitto/test/broker/06-bridge-b2br-disconnect-qos1.conf diff --git a/src/libs/mosquitto/test/broker/06-bridge-b2br-disconnect-qos1.py b/mosquitto/test/broker/06-bridge-b2br-disconnect-qos1.py similarity index 100% rename from src/libs/mosquitto/test/broker/06-bridge-b2br-disconnect-qos1.py rename to mosquitto/test/broker/06-bridge-b2br-disconnect-qos1.py diff --git a/src/libs/mosquitto/test/broker/06-bridge-b2br-disconnect-qos2.conf b/mosquitto/test/broker/06-bridge-b2br-disconnect-qos2.conf similarity index 100% rename from src/libs/mosquitto/test/broker/06-bridge-b2br-disconnect-qos2.conf rename to mosquitto/test/broker/06-bridge-b2br-disconnect-qos2.conf diff --git a/src/libs/mosquitto/test/broker/06-bridge-b2br-disconnect-qos2.py b/mosquitto/test/broker/06-bridge-b2br-disconnect-qos2.py similarity index 100% rename from src/libs/mosquitto/test/broker/06-bridge-b2br-disconnect-qos2.py rename to mosquitto/test/broker/06-bridge-b2br-disconnect-qos2.py diff --git a/src/libs/mosquitto/test/broker/06-bridge-br2b-disconnect-qos1-helper.py b/mosquitto/test/broker/06-bridge-br2b-disconnect-qos1-helper.py similarity index 100% rename from src/libs/mosquitto/test/broker/06-bridge-br2b-disconnect-qos1-helper.py rename to mosquitto/test/broker/06-bridge-br2b-disconnect-qos1-helper.py diff --git a/src/libs/mosquitto/test/broker/06-bridge-br2b-disconnect-qos1.conf b/mosquitto/test/broker/06-bridge-br2b-disconnect-qos1.conf similarity index 100% rename from src/libs/mosquitto/test/broker/06-bridge-br2b-disconnect-qos1.conf rename to mosquitto/test/broker/06-bridge-br2b-disconnect-qos1.conf diff --git a/src/libs/mosquitto/test/broker/06-bridge-br2b-disconnect-qos1.py b/mosquitto/test/broker/06-bridge-br2b-disconnect-qos1.py similarity index 100% rename from src/libs/mosquitto/test/broker/06-bridge-br2b-disconnect-qos1.py rename to mosquitto/test/broker/06-bridge-br2b-disconnect-qos1.py diff --git a/src/libs/mosquitto/test/broker/06-bridge-br2b-disconnect-qos2-helper.py b/mosquitto/test/broker/06-bridge-br2b-disconnect-qos2-helper.py similarity index 100% rename from src/libs/mosquitto/test/broker/06-bridge-br2b-disconnect-qos2-helper.py rename to mosquitto/test/broker/06-bridge-br2b-disconnect-qos2-helper.py diff --git a/src/libs/mosquitto/test/broker/06-bridge-br2b-disconnect-qos2.conf b/mosquitto/test/broker/06-bridge-br2b-disconnect-qos2.conf similarity index 100% rename from src/libs/mosquitto/test/broker/06-bridge-br2b-disconnect-qos2.conf rename to mosquitto/test/broker/06-bridge-br2b-disconnect-qos2.conf diff --git a/src/libs/mosquitto/test/broker/06-bridge-br2b-disconnect-qos2.py b/mosquitto/test/broker/06-bridge-br2b-disconnect-qos2.py similarity index 100% rename from src/libs/mosquitto/test/broker/06-bridge-br2b-disconnect-qos2.py rename to mosquitto/test/broker/06-bridge-br2b-disconnect-qos2.py diff --git a/src/libs/mosquitto/test/broker/06-bridge-fail-persist-resend-qos1.conf b/mosquitto/test/broker/06-bridge-fail-persist-resend-qos1.conf similarity index 100% rename from src/libs/mosquitto/test/broker/06-bridge-fail-persist-resend-qos1.conf rename to mosquitto/test/broker/06-bridge-fail-persist-resend-qos1.conf diff --git a/src/libs/mosquitto/test/broker/06-bridge-fail-persist-resend-qos1.py b/mosquitto/test/broker/06-bridge-fail-persist-resend-qos1.py similarity index 100% rename from src/libs/mosquitto/test/broker/06-bridge-fail-persist-resend-qos1.py rename to mosquitto/test/broker/06-bridge-fail-persist-resend-qos1.py diff --git a/src/libs/mosquitto/test/broker/06-bridge-fail-persist-resend-qos2.conf b/mosquitto/test/broker/06-bridge-fail-persist-resend-qos2.conf similarity index 100% rename from src/libs/mosquitto/test/broker/06-bridge-fail-persist-resend-qos2.conf rename to mosquitto/test/broker/06-bridge-fail-persist-resend-qos2.conf diff --git a/src/libs/mosquitto/test/broker/06-bridge-fail-persist-resend-qos2.py b/mosquitto/test/broker/06-bridge-fail-persist-resend-qos2.py similarity index 100% rename from src/libs/mosquitto/test/broker/06-bridge-fail-persist-resend-qos2.py rename to mosquitto/test/broker/06-bridge-fail-persist-resend-qos2.py diff --git a/src/libs/mosquitto/test/broker/06-bridge-reconnect-local-out-helper.py b/mosquitto/test/broker/06-bridge-reconnect-local-out-helper.py similarity index 100% rename from src/libs/mosquitto/test/broker/06-bridge-reconnect-local-out-helper.py rename to mosquitto/test/broker/06-bridge-reconnect-local-out-helper.py diff --git a/src/libs/mosquitto/test/broker/06-bridge-reconnect-local-out.conf b/mosquitto/test/broker/06-bridge-reconnect-local-out.conf similarity index 100% rename from src/libs/mosquitto/test/broker/06-bridge-reconnect-local-out.conf rename to mosquitto/test/broker/06-bridge-reconnect-local-out.conf diff --git a/src/libs/mosquitto/test/broker/06-bridge-reconnect-local-out.py b/mosquitto/test/broker/06-bridge-reconnect-local-out.py similarity index 100% rename from src/libs/mosquitto/test/broker/06-bridge-reconnect-local-out.py rename to mosquitto/test/broker/06-bridge-reconnect-local-out.py diff --git a/src/libs/mosquitto/test/broker/07-will-null-helper.py b/mosquitto/test/broker/07-will-null-helper.py similarity index 100% rename from src/libs/mosquitto/test/broker/07-will-null-helper.py rename to mosquitto/test/broker/07-will-null-helper.py diff --git a/src/libs/mosquitto/test/broker/07-will-null-topic.py b/mosquitto/test/broker/07-will-null-topic.py similarity index 100% rename from src/libs/mosquitto/test/broker/07-will-null-topic.py rename to mosquitto/test/broker/07-will-null-topic.py diff --git a/src/libs/mosquitto/test/broker/07-will-null.py b/mosquitto/test/broker/07-will-null.py similarity index 100% rename from src/libs/mosquitto/test/broker/07-will-null.py rename to mosquitto/test/broker/07-will-null.py diff --git a/src/libs/mosquitto/test/broker/07-will-qos0-helper.py b/mosquitto/test/broker/07-will-qos0-helper.py similarity index 100% rename from src/libs/mosquitto/test/broker/07-will-qos0-helper.py rename to mosquitto/test/broker/07-will-qos0-helper.py diff --git a/src/libs/mosquitto/test/broker/07-will-qos0.py b/mosquitto/test/broker/07-will-qos0.py similarity index 100% rename from src/libs/mosquitto/test/broker/07-will-qos0.py rename to mosquitto/test/broker/07-will-qos0.py diff --git a/src/libs/mosquitto/test/broker/08-ssl-bridge-helper.py b/mosquitto/test/broker/08-ssl-bridge-helper.py similarity index 100% rename from src/libs/mosquitto/test/broker/08-ssl-bridge-helper.py rename to mosquitto/test/broker/08-ssl-bridge-helper.py diff --git a/src/libs/mosquitto/test/broker/08-ssl-bridge.conf b/mosquitto/test/broker/08-ssl-bridge.conf similarity index 100% rename from src/libs/mosquitto/test/broker/08-ssl-bridge.conf rename to mosquitto/test/broker/08-ssl-bridge.conf diff --git a/src/libs/mosquitto/test/broker/08-ssl-bridge.py b/mosquitto/test/broker/08-ssl-bridge.py similarity index 100% rename from src/libs/mosquitto/test/broker/08-ssl-bridge.py rename to mosquitto/test/broker/08-ssl-bridge.py diff --git a/src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-crl.conf b/mosquitto/test/broker/08-ssl-connect-cert-auth-crl.conf similarity index 100% rename from src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-crl.conf rename to mosquitto/test/broker/08-ssl-connect-cert-auth-crl.conf diff --git a/src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-crl.py b/mosquitto/test/broker/08-ssl-connect-cert-auth-crl.py similarity index 100% rename from src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-crl.py rename to mosquitto/test/broker/08-ssl-connect-cert-auth-crl.py diff --git a/src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-expired.conf b/mosquitto/test/broker/08-ssl-connect-cert-auth-expired.conf similarity index 100% rename from src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-expired.conf rename to mosquitto/test/broker/08-ssl-connect-cert-auth-expired.conf diff --git a/src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-expired.py b/mosquitto/test/broker/08-ssl-connect-cert-auth-expired.py similarity index 100% rename from src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-expired.py rename to mosquitto/test/broker/08-ssl-connect-cert-auth-expired.py diff --git a/src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-revoked.conf b/mosquitto/test/broker/08-ssl-connect-cert-auth-revoked.conf similarity index 100% rename from src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-revoked.conf rename to mosquitto/test/broker/08-ssl-connect-cert-auth-revoked.conf diff --git a/src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-revoked.py b/mosquitto/test/broker/08-ssl-connect-cert-auth-revoked.py similarity index 100% rename from src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-revoked.py rename to mosquitto/test/broker/08-ssl-connect-cert-auth-revoked.py diff --git a/src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-without.conf b/mosquitto/test/broker/08-ssl-connect-cert-auth-without.conf similarity index 100% rename from src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-without.conf rename to mosquitto/test/broker/08-ssl-connect-cert-auth-without.conf diff --git a/src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-without.py b/mosquitto/test/broker/08-ssl-connect-cert-auth-without.py similarity index 100% rename from src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth-without.py rename to mosquitto/test/broker/08-ssl-connect-cert-auth-without.py diff --git a/src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth.conf b/mosquitto/test/broker/08-ssl-connect-cert-auth.conf similarity index 100% rename from src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth.conf rename to mosquitto/test/broker/08-ssl-connect-cert-auth.conf diff --git a/src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth.py b/mosquitto/test/broker/08-ssl-connect-cert-auth.py similarity index 100% rename from src/libs/mosquitto/test/broker/08-ssl-connect-cert-auth.py rename to mosquitto/test/broker/08-ssl-connect-cert-auth.py diff --git a/src/libs/mosquitto/test/broker/08-ssl-connect-identity.conf b/mosquitto/test/broker/08-ssl-connect-identity.conf similarity index 100% rename from src/libs/mosquitto/test/broker/08-ssl-connect-identity.conf rename to mosquitto/test/broker/08-ssl-connect-identity.conf diff --git a/src/libs/mosquitto/test/broker/08-ssl-connect-identity.py b/mosquitto/test/broker/08-ssl-connect-identity.py similarity index 100% rename from src/libs/mosquitto/test/broker/08-ssl-connect-identity.py rename to mosquitto/test/broker/08-ssl-connect-identity.py diff --git a/src/libs/mosquitto/test/broker/08-ssl-connect-no-auth-wrong-ca.conf b/mosquitto/test/broker/08-ssl-connect-no-auth-wrong-ca.conf similarity index 100% rename from src/libs/mosquitto/test/broker/08-ssl-connect-no-auth-wrong-ca.conf rename to mosquitto/test/broker/08-ssl-connect-no-auth-wrong-ca.conf diff --git a/src/libs/mosquitto/test/broker/08-ssl-connect-no-auth-wrong-ca.py b/mosquitto/test/broker/08-ssl-connect-no-auth-wrong-ca.py similarity index 100% rename from src/libs/mosquitto/test/broker/08-ssl-connect-no-auth-wrong-ca.py rename to mosquitto/test/broker/08-ssl-connect-no-auth-wrong-ca.py diff --git a/src/libs/mosquitto/test/broker/08-ssl-connect-no-auth.conf b/mosquitto/test/broker/08-ssl-connect-no-auth.conf similarity index 100% rename from src/libs/mosquitto/test/broker/08-ssl-connect-no-auth.conf rename to mosquitto/test/broker/08-ssl-connect-no-auth.conf diff --git a/src/libs/mosquitto/test/broker/08-ssl-connect-no-auth.py b/mosquitto/test/broker/08-ssl-connect-no-auth.py similarity index 100% rename from src/libs/mosquitto/test/broker/08-ssl-connect-no-auth.py rename to mosquitto/test/broker/08-ssl-connect-no-auth.py diff --git a/src/libs/mosquitto/test/broker/08-ssl-connect-no-identity.conf b/mosquitto/test/broker/08-ssl-connect-no-identity.conf similarity index 100% rename from src/libs/mosquitto/test/broker/08-ssl-connect-no-identity.conf rename to mosquitto/test/broker/08-ssl-connect-no-identity.conf diff --git a/src/libs/mosquitto/test/broker/08-ssl-connect-no-identity.py b/mosquitto/test/broker/08-ssl-connect-no-identity.py similarity index 100% rename from src/libs/mosquitto/test/broker/08-ssl-connect-no-identity.py rename to mosquitto/test/broker/08-ssl-connect-no-identity.py diff --git a/src/libs/mosquitto/test/broker/08-tls-psk-bridge.conf b/mosquitto/test/broker/08-tls-psk-bridge.conf similarity index 100% rename from src/libs/mosquitto/test/broker/08-tls-psk-bridge.conf rename to mosquitto/test/broker/08-tls-psk-bridge.conf diff --git a/src/libs/mosquitto/test/broker/08-tls-psk-bridge.conf2 b/mosquitto/test/broker/08-tls-psk-bridge.conf2 similarity index 100% rename from src/libs/mosquitto/test/broker/08-tls-psk-bridge.conf2 rename to mosquitto/test/broker/08-tls-psk-bridge.conf2 diff --git a/src/libs/mosquitto/test/broker/08-tls-psk-bridge.psk b/mosquitto/test/broker/08-tls-psk-bridge.psk similarity index 100% rename from src/libs/mosquitto/test/broker/08-tls-psk-bridge.psk rename to mosquitto/test/broker/08-tls-psk-bridge.psk diff --git a/src/libs/mosquitto/test/broker/08-tls-psk-bridge.py b/mosquitto/test/broker/08-tls-psk-bridge.py similarity index 100% rename from src/libs/mosquitto/test/broker/08-tls-psk-bridge.py rename to mosquitto/test/broker/08-tls-psk-bridge.py diff --git a/src/libs/mosquitto/test/broker/08-tls-psk-pub.conf b/mosquitto/test/broker/08-tls-psk-pub.conf similarity index 100% rename from src/libs/mosquitto/test/broker/08-tls-psk-pub.conf rename to mosquitto/test/broker/08-tls-psk-pub.conf diff --git a/src/libs/mosquitto/test/broker/08-tls-psk-pub.psk b/mosquitto/test/broker/08-tls-psk-pub.psk similarity index 100% rename from src/libs/mosquitto/test/broker/08-tls-psk-pub.psk rename to mosquitto/test/broker/08-tls-psk-pub.psk diff --git a/src/libs/mosquitto/test/broker/08-tls-psk-pub.py b/mosquitto/test/broker/08-tls-psk-pub.py similarity index 100% rename from src/libs/mosquitto/test/broker/08-tls-psk-pub.py rename to mosquitto/test/broker/08-tls-psk-pub.py diff --git a/src/libs/mosquitto/test/broker/09-plugin-auth-unpwd-fail.conf b/mosquitto/test/broker/09-plugin-auth-unpwd-fail.conf similarity index 100% rename from src/libs/mosquitto/test/broker/09-plugin-auth-unpwd-fail.conf rename to mosquitto/test/broker/09-plugin-auth-unpwd-fail.conf diff --git a/src/libs/mosquitto/test/broker/09-plugin-auth-unpwd-fail.py b/mosquitto/test/broker/09-plugin-auth-unpwd-fail.py similarity index 100% rename from src/libs/mosquitto/test/broker/09-plugin-auth-unpwd-fail.py rename to mosquitto/test/broker/09-plugin-auth-unpwd-fail.py diff --git a/src/libs/mosquitto/test/broker/09-plugin-auth-unpwd-success.conf b/mosquitto/test/broker/09-plugin-auth-unpwd-success.conf similarity index 100% rename from src/libs/mosquitto/test/broker/09-plugin-auth-unpwd-success.conf rename to mosquitto/test/broker/09-plugin-auth-unpwd-success.conf diff --git a/src/libs/mosquitto/test/broker/09-plugin-auth-unpwd-success.py b/mosquitto/test/broker/09-plugin-auth-unpwd-success.py similarity index 100% rename from src/libs/mosquitto/test/broker/09-plugin-auth-unpwd-success.py rename to mosquitto/test/broker/09-plugin-auth-unpwd-success.py diff --git a/src/libs/mosquitto/test/broker/10-listener-mount-point-helper.py b/mosquitto/test/broker/10-listener-mount-point-helper.py similarity index 100% rename from src/libs/mosquitto/test/broker/10-listener-mount-point-helper.py rename to mosquitto/test/broker/10-listener-mount-point-helper.py diff --git a/src/libs/mosquitto/test/broker/10-listener-mount-point.conf b/mosquitto/test/broker/10-listener-mount-point.conf similarity index 100% rename from src/libs/mosquitto/test/broker/10-listener-mount-point.conf rename to mosquitto/test/broker/10-listener-mount-point.conf diff --git a/src/libs/mosquitto/test/broker/10-listener-mount-point.py b/mosquitto/test/broker/10-listener-mount-point.py similarity index 100% rename from src/libs/mosquitto/test/broker/10-listener-mount-point.py rename to mosquitto/test/broker/10-listener-mount-point.py diff --git a/src/libs/mosquitto/test/broker/Makefile b/mosquitto/test/broker/Makefile similarity index 100% rename from src/libs/mosquitto/test/broker/Makefile rename to mosquitto/test/broker/Makefile diff --git a/mosquitto/test/broker/__init__.py b/mosquitto/test/broker/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/libs/mosquitto/test/broker/c/08-tls-psk-bridge.c b/mosquitto/test/broker/c/08-tls-psk-bridge.c similarity index 100% rename from src/libs/mosquitto/test/broker/c/08-tls-psk-bridge.c rename to mosquitto/test/broker/c/08-tls-psk-bridge.c diff --git a/src/libs/mosquitto/test/broker/c/08-tls-psk-pub.c b/mosquitto/test/broker/c/08-tls-psk-pub.c similarity index 100% rename from src/libs/mosquitto/test/broker/c/08-tls-psk-pub.c rename to mosquitto/test/broker/c/08-tls-psk-pub.c diff --git a/src/libs/mosquitto/test/broker/c/Makefile b/mosquitto/test/broker/c/Makefile similarity index 100% rename from src/libs/mosquitto/test/broker/c/Makefile rename to mosquitto/test/broker/c/Makefile diff --git a/src/libs/mosquitto/test/broker/c/auth_plugin.c b/mosquitto/test/broker/c/auth_plugin.c similarity index 100% rename from src/libs/mosquitto/test/broker/c/auth_plugin.c rename to mosquitto/test/broker/c/auth_plugin.c diff --git a/src/libs/mosquitto/test/broker/readme.txt b/mosquitto/test/broker/readme.txt similarity index 100% rename from src/libs/mosquitto/test/broker/readme.txt rename to mosquitto/test/broker/readme.txt diff --git a/src/libs/mosquitto/test/fake_user.c b/mosquitto/test/fake_user.c similarity index 100% rename from src/libs/mosquitto/test/fake_user.c rename to mosquitto/test/fake_user.c diff --git a/src/libs/mosquitto/test/lib/01-con-discon-success.py b/mosquitto/test/lib/01-con-discon-success.py similarity index 100% rename from src/libs/mosquitto/test/lib/01-con-discon-success.py rename to mosquitto/test/lib/01-con-discon-success.py diff --git a/src/libs/mosquitto/test/lib/01-keepalive-pingreq.py b/mosquitto/test/lib/01-keepalive-pingreq.py similarity index 100% rename from src/libs/mosquitto/test/lib/01-keepalive-pingreq.py rename to mosquitto/test/lib/01-keepalive-pingreq.py diff --git a/src/libs/mosquitto/test/lib/01-no-clean-session.py b/mosquitto/test/lib/01-no-clean-session.py similarity index 100% rename from src/libs/mosquitto/test/lib/01-no-clean-session.py rename to mosquitto/test/lib/01-no-clean-session.py diff --git a/src/libs/mosquitto/test/lib/01-unpwd-set.py b/mosquitto/test/lib/01-unpwd-set.py similarity index 100% rename from src/libs/mosquitto/test/lib/01-unpwd-set.py rename to mosquitto/test/lib/01-unpwd-set.py diff --git a/src/libs/mosquitto/test/lib/01-will-set.py b/mosquitto/test/lib/01-will-set.py similarity index 100% rename from src/libs/mosquitto/test/lib/01-will-set.py rename to mosquitto/test/lib/01-will-set.py diff --git a/src/libs/mosquitto/test/lib/01-will-unpwd-set.py b/mosquitto/test/lib/01-will-unpwd-set.py similarity index 100% rename from src/libs/mosquitto/test/lib/01-will-unpwd-set.py rename to mosquitto/test/lib/01-will-unpwd-set.py diff --git a/src/libs/mosquitto/test/lib/02-subscribe-qos0.py b/mosquitto/test/lib/02-subscribe-qos0.py similarity index 100% rename from src/libs/mosquitto/test/lib/02-subscribe-qos0.py rename to mosquitto/test/lib/02-subscribe-qos0.py diff --git a/src/libs/mosquitto/test/lib/02-subscribe-qos1.py b/mosquitto/test/lib/02-subscribe-qos1.py similarity index 100% rename from src/libs/mosquitto/test/lib/02-subscribe-qos1.py rename to mosquitto/test/lib/02-subscribe-qos1.py diff --git a/src/libs/mosquitto/test/lib/02-subscribe-qos2.py b/mosquitto/test/lib/02-subscribe-qos2.py similarity index 100% rename from src/libs/mosquitto/test/lib/02-subscribe-qos2.py rename to mosquitto/test/lib/02-subscribe-qos2.py diff --git a/src/libs/mosquitto/test/lib/02-unsubscribe.py b/mosquitto/test/lib/02-unsubscribe.py similarity index 100% rename from src/libs/mosquitto/test/lib/02-unsubscribe.py rename to mosquitto/test/lib/02-unsubscribe.py diff --git a/src/libs/mosquitto/test/lib/03-publish-b2c-qos1.py b/mosquitto/test/lib/03-publish-b2c-qos1.py similarity index 100% rename from src/libs/mosquitto/test/lib/03-publish-b2c-qos1.py rename to mosquitto/test/lib/03-publish-b2c-qos1.py diff --git a/src/libs/mosquitto/test/lib/03-publish-b2c-qos2.py b/mosquitto/test/lib/03-publish-b2c-qos2.py similarity index 100% rename from src/libs/mosquitto/test/lib/03-publish-b2c-qos2.py rename to mosquitto/test/lib/03-publish-b2c-qos2.py diff --git a/src/libs/mosquitto/test/lib/03-publish-c2b-qos1-disconnect.py b/mosquitto/test/lib/03-publish-c2b-qos1-disconnect.py similarity index 100% rename from src/libs/mosquitto/test/lib/03-publish-c2b-qos1-disconnect.py rename to mosquitto/test/lib/03-publish-c2b-qos1-disconnect.py diff --git a/src/libs/mosquitto/test/lib/03-publish-c2b-qos1-timeout.py b/mosquitto/test/lib/03-publish-c2b-qos1-timeout.py similarity index 100% rename from src/libs/mosquitto/test/lib/03-publish-c2b-qos1-timeout.py rename to mosquitto/test/lib/03-publish-c2b-qos1-timeout.py diff --git a/src/libs/mosquitto/test/lib/03-publish-c2b-qos2-disconnect.py b/mosquitto/test/lib/03-publish-c2b-qos2-disconnect.py similarity index 100% rename from src/libs/mosquitto/test/lib/03-publish-c2b-qos2-disconnect.py rename to mosquitto/test/lib/03-publish-c2b-qos2-disconnect.py diff --git a/src/libs/mosquitto/test/lib/03-publish-c2b-qos2-timeout.py b/mosquitto/test/lib/03-publish-c2b-qos2-timeout.py similarity index 100% rename from src/libs/mosquitto/test/lib/03-publish-c2b-qos2-timeout.py rename to mosquitto/test/lib/03-publish-c2b-qos2-timeout.py diff --git a/src/libs/mosquitto/test/lib/03-publish-c2b-qos2.py b/mosquitto/test/lib/03-publish-c2b-qos2.py similarity index 100% rename from src/libs/mosquitto/test/lib/03-publish-c2b-qos2.py rename to mosquitto/test/lib/03-publish-c2b-qos2.py diff --git a/src/libs/mosquitto/test/lib/03-publish-qos0-no-payload.py b/mosquitto/test/lib/03-publish-qos0-no-payload.py similarity index 100% rename from src/libs/mosquitto/test/lib/03-publish-qos0-no-payload.py rename to mosquitto/test/lib/03-publish-qos0-no-payload.py diff --git a/src/libs/mosquitto/test/lib/03-publish-qos0.py b/mosquitto/test/lib/03-publish-qos0.py similarity index 100% rename from src/libs/mosquitto/test/lib/03-publish-qos0.py rename to mosquitto/test/lib/03-publish-qos0.py diff --git a/src/libs/mosquitto/test/lib/04-retain-qos0.py b/mosquitto/test/lib/04-retain-qos0.py similarity index 100% rename from src/libs/mosquitto/test/lib/04-retain-qos0.py rename to mosquitto/test/lib/04-retain-qos0.py diff --git a/src/libs/mosquitto/test/lib/08-ssl-bad-cacert.py b/mosquitto/test/lib/08-ssl-bad-cacert.py similarity index 100% rename from src/libs/mosquitto/test/lib/08-ssl-bad-cacert.py rename to mosquitto/test/lib/08-ssl-bad-cacert.py diff --git a/src/libs/mosquitto/test/lib/08-ssl-connect-cert-auth-enc.py b/mosquitto/test/lib/08-ssl-connect-cert-auth-enc.py similarity index 100% rename from src/libs/mosquitto/test/lib/08-ssl-connect-cert-auth-enc.py rename to mosquitto/test/lib/08-ssl-connect-cert-auth-enc.py diff --git a/src/libs/mosquitto/test/lib/08-ssl-connect-cert-auth.py b/mosquitto/test/lib/08-ssl-connect-cert-auth.py similarity index 100% rename from src/libs/mosquitto/test/lib/08-ssl-connect-cert-auth.py rename to mosquitto/test/lib/08-ssl-connect-cert-auth.py diff --git a/src/libs/mosquitto/test/lib/08-ssl-connect-no-auth.py b/mosquitto/test/lib/08-ssl-connect-no-auth.py similarity index 100% rename from src/libs/mosquitto/test/lib/08-ssl-connect-no-auth.py rename to mosquitto/test/lib/08-ssl-connect-no-auth.py diff --git a/src/libs/mosquitto/test/lib/08-ssl-fake-cacert.py b/mosquitto/test/lib/08-ssl-fake-cacert.py similarity index 100% rename from src/libs/mosquitto/test/lib/08-ssl-fake-cacert.py rename to mosquitto/test/lib/08-ssl-fake-cacert.py diff --git a/src/libs/mosquitto/test/lib/09-util-topic-matching.py b/mosquitto/test/lib/09-util-topic-matching.py similarity index 100% rename from src/libs/mosquitto/test/lib/09-util-topic-matching.py rename to mosquitto/test/lib/09-util-topic-matching.py diff --git a/src/libs/mosquitto/test/lib/09-util-topic-tokenise.py b/mosquitto/test/lib/09-util-topic-tokenise.py similarity index 100% rename from src/libs/mosquitto/test/lib/09-util-topic-tokenise.py rename to mosquitto/test/lib/09-util-topic-tokenise.py diff --git a/src/libs/mosquitto/test/lib/Makefile b/mosquitto/test/lib/Makefile similarity index 100% rename from src/libs/mosquitto/test/lib/Makefile rename to mosquitto/test/lib/Makefile diff --git a/mosquitto/test/lib/__init__.py b/mosquitto/test/lib/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/libs/mosquitto/test/lib/c/01-con-discon-success.c b/mosquitto/test/lib/c/01-con-discon-success.c similarity index 100% rename from src/libs/mosquitto/test/lib/c/01-con-discon-success.c rename to mosquitto/test/lib/c/01-con-discon-success.c diff --git a/src/libs/mosquitto/test/lib/c/01-keepalive-pingreq.c b/mosquitto/test/lib/c/01-keepalive-pingreq.c similarity index 100% rename from src/libs/mosquitto/test/lib/c/01-keepalive-pingreq.c rename to mosquitto/test/lib/c/01-keepalive-pingreq.c diff --git a/src/libs/mosquitto/test/lib/c/01-no-clean-session.c b/mosquitto/test/lib/c/01-no-clean-session.c similarity index 100% rename from src/libs/mosquitto/test/lib/c/01-no-clean-session.c rename to mosquitto/test/lib/c/01-no-clean-session.c diff --git a/src/libs/mosquitto/test/lib/c/01-unpwd-set.c b/mosquitto/test/lib/c/01-unpwd-set.c similarity index 100% rename from src/libs/mosquitto/test/lib/c/01-unpwd-set.c rename to mosquitto/test/lib/c/01-unpwd-set.c diff --git a/src/libs/mosquitto/test/lib/c/01-will-set.c b/mosquitto/test/lib/c/01-will-set.c similarity index 100% rename from src/libs/mosquitto/test/lib/c/01-will-set.c rename to mosquitto/test/lib/c/01-will-set.c diff --git a/src/libs/mosquitto/test/lib/c/01-will-unpwd-set.c b/mosquitto/test/lib/c/01-will-unpwd-set.c similarity index 100% rename from src/libs/mosquitto/test/lib/c/01-will-unpwd-set.c rename to mosquitto/test/lib/c/01-will-unpwd-set.c diff --git a/src/libs/mosquitto/test/lib/c/02-subscribe-qos0.c b/mosquitto/test/lib/c/02-subscribe-qos0.c similarity index 100% rename from src/libs/mosquitto/test/lib/c/02-subscribe-qos0.c rename to mosquitto/test/lib/c/02-subscribe-qos0.c diff --git a/src/libs/mosquitto/test/lib/c/02-subscribe-qos1.c b/mosquitto/test/lib/c/02-subscribe-qos1.c similarity index 100% rename from src/libs/mosquitto/test/lib/c/02-subscribe-qos1.c rename to mosquitto/test/lib/c/02-subscribe-qos1.c diff --git a/src/libs/mosquitto/test/lib/c/02-subscribe-qos2.c b/mosquitto/test/lib/c/02-subscribe-qos2.c similarity index 100% rename from src/libs/mosquitto/test/lib/c/02-subscribe-qos2.c rename to mosquitto/test/lib/c/02-subscribe-qos2.c diff --git a/src/libs/mosquitto/test/lib/c/02-unsubscribe.c b/mosquitto/test/lib/c/02-unsubscribe.c similarity index 100% rename from src/libs/mosquitto/test/lib/c/02-unsubscribe.c rename to mosquitto/test/lib/c/02-unsubscribe.c diff --git a/src/libs/mosquitto/test/lib/c/03-publish-b2c-qos1.c b/mosquitto/test/lib/c/03-publish-b2c-qos1.c similarity index 100% rename from src/libs/mosquitto/test/lib/c/03-publish-b2c-qos1.c rename to mosquitto/test/lib/c/03-publish-b2c-qos1.c diff --git a/src/libs/mosquitto/test/lib/c/03-publish-b2c-qos2.c b/mosquitto/test/lib/c/03-publish-b2c-qos2.c similarity index 100% rename from src/libs/mosquitto/test/lib/c/03-publish-b2c-qos2.c rename to mosquitto/test/lib/c/03-publish-b2c-qos2.c diff --git a/src/libs/mosquitto/test/lib/c/03-publish-c2b-qos1-disconnect.c b/mosquitto/test/lib/c/03-publish-c2b-qos1-disconnect.c similarity index 100% rename from src/libs/mosquitto/test/lib/c/03-publish-c2b-qos1-disconnect.c rename to mosquitto/test/lib/c/03-publish-c2b-qos1-disconnect.c diff --git a/src/libs/mosquitto/test/lib/c/03-publish-c2b-qos1-timeout.c b/mosquitto/test/lib/c/03-publish-c2b-qos1-timeout.c similarity index 100% rename from src/libs/mosquitto/test/lib/c/03-publish-c2b-qos1-timeout.c rename to mosquitto/test/lib/c/03-publish-c2b-qos1-timeout.c diff --git a/src/libs/mosquitto/test/lib/c/03-publish-c2b-qos2-disconnect.c b/mosquitto/test/lib/c/03-publish-c2b-qos2-disconnect.c similarity index 100% rename from src/libs/mosquitto/test/lib/c/03-publish-c2b-qos2-disconnect.c rename to mosquitto/test/lib/c/03-publish-c2b-qos2-disconnect.c diff --git a/src/libs/mosquitto/test/lib/c/03-publish-c2b-qos2-timeout.c b/mosquitto/test/lib/c/03-publish-c2b-qos2-timeout.c similarity index 100% rename from src/libs/mosquitto/test/lib/c/03-publish-c2b-qos2-timeout.c rename to mosquitto/test/lib/c/03-publish-c2b-qos2-timeout.c diff --git a/src/libs/mosquitto/test/lib/c/03-publish-c2b-qos2.c b/mosquitto/test/lib/c/03-publish-c2b-qos2.c similarity index 100% rename from src/libs/mosquitto/test/lib/c/03-publish-c2b-qos2.c rename to mosquitto/test/lib/c/03-publish-c2b-qos2.c diff --git a/src/libs/mosquitto/test/lib/c/03-publish-qos0-no-payload.c b/mosquitto/test/lib/c/03-publish-qos0-no-payload.c similarity index 100% rename from src/libs/mosquitto/test/lib/c/03-publish-qos0-no-payload.c rename to mosquitto/test/lib/c/03-publish-qos0-no-payload.c diff --git a/src/libs/mosquitto/test/lib/c/03-publish-qos0.c b/mosquitto/test/lib/c/03-publish-qos0.c similarity index 100% rename from src/libs/mosquitto/test/lib/c/03-publish-qos0.c rename to mosquitto/test/lib/c/03-publish-qos0.c diff --git a/src/libs/mosquitto/test/lib/c/04-retain-qos0.c b/mosquitto/test/lib/c/04-retain-qos0.c similarity index 100% rename from src/libs/mosquitto/test/lib/c/04-retain-qos0.c rename to mosquitto/test/lib/c/04-retain-qos0.c diff --git a/src/libs/mosquitto/test/lib/c/08-ssl-bad-cacert.c b/mosquitto/test/lib/c/08-ssl-bad-cacert.c similarity index 100% rename from src/libs/mosquitto/test/lib/c/08-ssl-bad-cacert.c rename to mosquitto/test/lib/c/08-ssl-bad-cacert.c diff --git a/src/libs/mosquitto/test/lib/c/08-ssl-connect-cert-auth-enc.c b/mosquitto/test/lib/c/08-ssl-connect-cert-auth-enc.c similarity index 100% rename from src/libs/mosquitto/test/lib/c/08-ssl-connect-cert-auth-enc.c rename to mosquitto/test/lib/c/08-ssl-connect-cert-auth-enc.c diff --git a/src/libs/mosquitto/test/lib/c/08-ssl-connect-cert-auth.c b/mosquitto/test/lib/c/08-ssl-connect-cert-auth.c similarity index 100% rename from src/libs/mosquitto/test/lib/c/08-ssl-connect-cert-auth.c rename to mosquitto/test/lib/c/08-ssl-connect-cert-auth.c diff --git a/src/libs/mosquitto/test/lib/c/08-ssl-connect-no-auth.c b/mosquitto/test/lib/c/08-ssl-connect-no-auth.c similarity index 100% rename from src/libs/mosquitto/test/lib/c/08-ssl-connect-no-auth.c rename to mosquitto/test/lib/c/08-ssl-connect-no-auth.c diff --git a/src/libs/mosquitto/test/lib/c/08-ssl-fake-cacert.c b/mosquitto/test/lib/c/08-ssl-fake-cacert.c similarity index 100% rename from src/libs/mosquitto/test/lib/c/08-ssl-fake-cacert.c rename to mosquitto/test/lib/c/08-ssl-fake-cacert.c diff --git a/src/libs/mosquitto/test/lib/c/09-util-topic-matching.c b/mosquitto/test/lib/c/09-util-topic-matching.c similarity index 100% rename from src/libs/mosquitto/test/lib/c/09-util-topic-matching.c rename to mosquitto/test/lib/c/09-util-topic-matching.c diff --git a/src/libs/mosquitto/test/lib/c/09-util-topic-tokenise.c b/mosquitto/test/lib/c/09-util-topic-tokenise.c similarity index 100% rename from src/libs/mosquitto/test/lib/c/09-util-topic-tokenise.c rename to mosquitto/test/lib/c/09-util-topic-tokenise.c diff --git a/src/libs/mosquitto/test/lib/c/Makefile b/mosquitto/test/lib/c/Makefile similarity index 100% rename from src/libs/mosquitto/test/lib/c/Makefile rename to mosquitto/test/lib/c/Makefile diff --git a/src/libs/mosquitto/test/lib/cpp/01-con-discon-success.cpp b/mosquitto/test/lib/cpp/01-con-discon-success.cpp similarity index 100% rename from src/libs/mosquitto/test/lib/cpp/01-con-discon-success.cpp rename to mosquitto/test/lib/cpp/01-con-discon-success.cpp diff --git a/src/libs/mosquitto/test/lib/cpp/01-keepalive-pingreq.cpp b/mosquitto/test/lib/cpp/01-keepalive-pingreq.cpp similarity index 100% rename from src/libs/mosquitto/test/lib/cpp/01-keepalive-pingreq.cpp rename to mosquitto/test/lib/cpp/01-keepalive-pingreq.cpp diff --git a/src/libs/mosquitto/test/lib/cpp/01-no-clean-session.cpp b/mosquitto/test/lib/cpp/01-no-clean-session.cpp similarity index 100% rename from src/libs/mosquitto/test/lib/cpp/01-no-clean-session.cpp rename to mosquitto/test/lib/cpp/01-no-clean-session.cpp diff --git a/src/libs/mosquitto/test/lib/cpp/01-unpwd-set.cpp b/mosquitto/test/lib/cpp/01-unpwd-set.cpp similarity index 100% rename from src/libs/mosquitto/test/lib/cpp/01-unpwd-set.cpp rename to mosquitto/test/lib/cpp/01-unpwd-set.cpp diff --git a/src/libs/mosquitto/test/lib/cpp/01-will-set.cpp b/mosquitto/test/lib/cpp/01-will-set.cpp similarity index 100% rename from src/libs/mosquitto/test/lib/cpp/01-will-set.cpp rename to mosquitto/test/lib/cpp/01-will-set.cpp diff --git a/src/libs/mosquitto/test/lib/cpp/01-will-unpwd-set.cpp b/mosquitto/test/lib/cpp/01-will-unpwd-set.cpp similarity index 100% rename from src/libs/mosquitto/test/lib/cpp/01-will-unpwd-set.cpp rename to mosquitto/test/lib/cpp/01-will-unpwd-set.cpp diff --git a/src/libs/mosquitto/test/lib/cpp/02-subscribe-qos0.cpp b/mosquitto/test/lib/cpp/02-subscribe-qos0.cpp similarity index 100% rename from src/libs/mosquitto/test/lib/cpp/02-subscribe-qos0.cpp rename to mosquitto/test/lib/cpp/02-subscribe-qos0.cpp diff --git a/src/libs/mosquitto/test/lib/cpp/02-subscribe-qos1.cpp b/mosquitto/test/lib/cpp/02-subscribe-qos1.cpp similarity index 100% rename from src/libs/mosquitto/test/lib/cpp/02-subscribe-qos1.cpp rename to mosquitto/test/lib/cpp/02-subscribe-qos1.cpp diff --git a/src/libs/mosquitto/test/lib/cpp/02-subscribe-qos2.cpp b/mosquitto/test/lib/cpp/02-subscribe-qos2.cpp similarity index 100% rename from src/libs/mosquitto/test/lib/cpp/02-subscribe-qos2.cpp rename to mosquitto/test/lib/cpp/02-subscribe-qos2.cpp diff --git a/src/libs/mosquitto/test/lib/cpp/02-unsubscribe.cpp b/mosquitto/test/lib/cpp/02-unsubscribe.cpp similarity index 100% rename from src/libs/mosquitto/test/lib/cpp/02-unsubscribe.cpp rename to mosquitto/test/lib/cpp/02-unsubscribe.cpp diff --git a/src/libs/mosquitto/test/lib/cpp/03-publish-b2c-qos1.cpp b/mosquitto/test/lib/cpp/03-publish-b2c-qos1.cpp similarity index 100% rename from src/libs/mosquitto/test/lib/cpp/03-publish-b2c-qos1.cpp rename to mosquitto/test/lib/cpp/03-publish-b2c-qos1.cpp diff --git a/src/libs/mosquitto/test/lib/cpp/03-publish-b2c-qos2.cpp b/mosquitto/test/lib/cpp/03-publish-b2c-qos2.cpp similarity index 100% rename from src/libs/mosquitto/test/lib/cpp/03-publish-b2c-qos2.cpp rename to mosquitto/test/lib/cpp/03-publish-b2c-qos2.cpp diff --git a/src/libs/mosquitto/test/lib/cpp/03-publish-c2b-qos1-disconnect.cpp b/mosquitto/test/lib/cpp/03-publish-c2b-qos1-disconnect.cpp similarity index 100% rename from src/libs/mosquitto/test/lib/cpp/03-publish-c2b-qos1-disconnect.cpp rename to mosquitto/test/lib/cpp/03-publish-c2b-qos1-disconnect.cpp diff --git a/src/libs/mosquitto/test/lib/cpp/03-publish-c2b-qos1-timeout.cpp b/mosquitto/test/lib/cpp/03-publish-c2b-qos1-timeout.cpp similarity index 100% rename from src/libs/mosquitto/test/lib/cpp/03-publish-c2b-qos1-timeout.cpp rename to mosquitto/test/lib/cpp/03-publish-c2b-qos1-timeout.cpp diff --git a/src/libs/mosquitto/test/lib/cpp/03-publish-c2b-qos2-disconnect.cpp b/mosquitto/test/lib/cpp/03-publish-c2b-qos2-disconnect.cpp similarity index 100% rename from src/libs/mosquitto/test/lib/cpp/03-publish-c2b-qos2-disconnect.cpp rename to mosquitto/test/lib/cpp/03-publish-c2b-qos2-disconnect.cpp diff --git a/src/libs/mosquitto/test/lib/cpp/03-publish-c2b-qos2-timeout.cpp b/mosquitto/test/lib/cpp/03-publish-c2b-qos2-timeout.cpp similarity index 100% rename from src/libs/mosquitto/test/lib/cpp/03-publish-c2b-qos2-timeout.cpp rename to mosquitto/test/lib/cpp/03-publish-c2b-qos2-timeout.cpp diff --git a/src/libs/mosquitto/test/lib/cpp/03-publish-c2b-qos2.cpp b/mosquitto/test/lib/cpp/03-publish-c2b-qos2.cpp similarity index 100% rename from src/libs/mosquitto/test/lib/cpp/03-publish-c2b-qos2.cpp rename to mosquitto/test/lib/cpp/03-publish-c2b-qos2.cpp diff --git a/src/libs/mosquitto/test/lib/cpp/03-publish-qos0-no-payload.cpp b/mosquitto/test/lib/cpp/03-publish-qos0-no-payload.cpp similarity index 100% rename from src/libs/mosquitto/test/lib/cpp/03-publish-qos0-no-payload.cpp rename to mosquitto/test/lib/cpp/03-publish-qos0-no-payload.cpp diff --git a/src/libs/mosquitto/test/lib/cpp/03-publish-qos0.cpp b/mosquitto/test/lib/cpp/03-publish-qos0.cpp similarity index 100% rename from src/libs/mosquitto/test/lib/cpp/03-publish-qos0.cpp rename to mosquitto/test/lib/cpp/03-publish-qos0.cpp diff --git a/src/libs/mosquitto/test/lib/cpp/04-retain-qos0.cpp b/mosquitto/test/lib/cpp/04-retain-qos0.cpp similarity index 100% rename from src/libs/mosquitto/test/lib/cpp/04-retain-qos0.cpp rename to mosquitto/test/lib/cpp/04-retain-qos0.cpp diff --git a/src/libs/mosquitto/test/lib/cpp/08-ssl-bad-cacert.cpp b/mosquitto/test/lib/cpp/08-ssl-bad-cacert.cpp similarity index 100% rename from src/libs/mosquitto/test/lib/cpp/08-ssl-bad-cacert.cpp rename to mosquitto/test/lib/cpp/08-ssl-bad-cacert.cpp diff --git a/src/libs/mosquitto/test/lib/cpp/08-ssl-connect-cert-auth-enc.cpp b/mosquitto/test/lib/cpp/08-ssl-connect-cert-auth-enc.cpp similarity index 100% rename from src/libs/mosquitto/test/lib/cpp/08-ssl-connect-cert-auth-enc.cpp rename to mosquitto/test/lib/cpp/08-ssl-connect-cert-auth-enc.cpp diff --git a/src/libs/mosquitto/test/lib/cpp/08-ssl-connect-cert-auth.cpp b/mosquitto/test/lib/cpp/08-ssl-connect-cert-auth.cpp similarity index 100% rename from src/libs/mosquitto/test/lib/cpp/08-ssl-connect-cert-auth.cpp rename to mosquitto/test/lib/cpp/08-ssl-connect-cert-auth.cpp diff --git a/src/libs/mosquitto/test/lib/cpp/08-ssl-connect-no-auth.cpp b/mosquitto/test/lib/cpp/08-ssl-connect-no-auth.cpp similarity index 100% rename from src/libs/mosquitto/test/lib/cpp/08-ssl-connect-no-auth.cpp rename to mosquitto/test/lib/cpp/08-ssl-connect-no-auth.cpp diff --git a/src/libs/mosquitto/test/lib/cpp/08-ssl-fake-cacert.cpp b/mosquitto/test/lib/cpp/08-ssl-fake-cacert.cpp similarity index 100% rename from src/libs/mosquitto/test/lib/cpp/08-ssl-fake-cacert.cpp rename to mosquitto/test/lib/cpp/08-ssl-fake-cacert.cpp diff --git a/src/libs/mosquitto/test/lib/cpp/09-util-topic-matching.cpp b/mosquitto/test/lib/cpp/09-util-topic-matching.cpp similarity index 100% rename from src/libs/mosquitto/test/lib/cpp/09-util-topic-matching.cpp rename to mosquitto/test/lib/cpp/09-util-topic-matching.cpp diff --git a/src/libs/mosquitto/test/lib/cpp/09-util-topic-tokenise.cpp b/mosquitto/test/lib/cpp/09-util-topic-tokenise.cpp similarity index 100% rename from src/libs/mosquitto/test/lib/cpp/09-util-topic-tokenise.cpp rename to mosquitto/test/lib/cpp/09-util-topic-tokenise.cpp diff --git a/src/libs/mosquitto/test/lib/cpp/Makefile b/mosquitto/test/lib/cpp/Makefile similarity index 100% rename from src/libs/mosquitto/test/lib/cpp/Makefile rename to mosquitto/test/lib/cpp/Makefile diff --git a/src/libs/mosquitto/test/mosq_test.py b/mosquitto/test/mosq_test.py similarity index 100% rename from src/libs/mosquitto/test/mosq_test.py rename to mosquitto/test/mosq_test.py diff --git a/src/libs/mosquitto/test/msgsps_common.h b/mosquitto/test/msgsps_common.h similarity index 100% rename from src/libs/mosquitto/test/msgsps_common.h rename to mosquitto/test/msgsps_common.h diff --git a/src/libs/mosquitto/test/msgsps_pub.c b/mosquitto/test/msgsps_pub.c similarity index 100% rename from src/libs/mosquitto/test/msgsps_pub.c rename to mosquitto/test/msgsps_pub.c diff --git a/src/libs/mosquitto/test/msgsps_sub.c b/mosquitto/test/msgsps_sub.c similarity index 100% rename from src/libs/mosquitto/test/msgsps_sub.c rename to mosquitto/test/msgsps_sub.c diff --git a/src/libs/mosquitto/test/packet-gen.c b/mosquitto/test/packet-gen.c similarity index 100% rename from src/libs/mosquitto/test/packet-gen.c rename to mosquitto/test/packet-gen.c diff --git a/src/libs/mosquitto/test/qos.c b/mosquitto/test/qos.c similarity index 100% rename from src/libs/mosquitto/test/qos.c rename to mosquitto/test/qos.c diff --git a/src/libs/mosquitto/test/random_client.c b/mosquitto/test/random_client.c similarity index 100% rename from src/libs/mosquitto/test/random_client.c rename to mosquitto/test/random_client.c diff --git a/src/libs/mosquitto/test/ssl/all-ca.crt b/mosquitto/test/ssl/all-ca.crt similarity index 100% rename from src/libs/mosquitto/test/ssl/all-ca.crt rename to mosquitto/test/ssl/all-ca.crt diff --git a/src/libs/mosquitto/test/ssl/client-encrypted.crt b/mosquitto/test/ssl/client-encrypted.crt similarity index 100% rename from src/libs/mosquitto/test/ssl/client-encrypted.crt rename to mosquitto/test/ssl/client-encrypted.crt diff --git a/src/libs/mosquitto/test/ssl/client-encrypted.key b/mosquitto/test/ssl/client-encrypted.key similarity index 100% rename from src/libs/mosquitto/test/ssl/client-encrypted.key rename to mosquitto/test/ssl/client-encrypted.key diff --git a/src/libs/mosquitto/test/ssl/client-expired.crt b/mosquitto/test/ssl/client-expired.crt similarity index 100% rename from src/libs/mosquitto/test/ssl/client-expired.crt rename to mosquitto/test/ssl/client-expired.crt diff --git a/src/libs/mosquitto/test/ssl/client-revoked.crt b/mosquitto/test/ssl/client-revoked.crt similarity index 100% rename from src/libs/mosquitto/test/ssl/client-revoked.crt rename to mosquitto/test/ssl/client-revoked.crt diff --git a/src/libs/mosquitto/test/ssl/client-revoked.csr b/mosquitto/test/ssl/client-revoked.csr similarity index 100% rename from src/libs/mosquitto/test/ssl/client-revoked.csr rename to mosquitto/test/ssl/client-revoked.csr diff --git a/src/libs/mosquitto/test/ssl/client-revoked.key b/mosquitto/test/ssl/client-revoked.key similarity index 100% rename from src/libs/mosquitto/test/ssl/client-revoked.key rename to mosquitto/test/ssl/client-revoked.key diff --git a/src/libs/mosquitto/test/ssl/client.crt b/mosquitto/test/ssl/client.crt similarity index 100% rename from src/libs/mosquitto/test/ssl/client.crt rename to mosquitto/test/ssl/client.crt diff --git a/src/libs/mosquitto/test/ssl/client.csr b/mosquitto/test/ssl/client.csr similarity index 100% rename from src/libs/mosquitto/test/ssl/client.csr rename to mosquitto/test/ssl/client.csr diff --git a/src/libs/mosquitto/test/ssl/client.key b/mosquitto/test/ssl/client.key similarity index 100% rename from src/libs/mosquitto/test/ssl/client.key rename to mosquitto/test/ssl/client.key diff --git a/src/libs/mosquitto/test/ssl/crl.pem b/mosquitto/test/ssl/crl.pem similarity index 100% rename from src/libs/mosquitto/test/ssl/crl.pem rename to mosquitto/test/ssl/crl.pem diff --git a/src/libs/mosquitto/test/ssl/demoCA/crlnumber b/mosquitto/test/ssl/demoCA/crlnumber similarity index 100% rename from src/libs/mosquitto/test/ssl/demoCA/crlnumber rename to mosquitto/test/ssl/demoCA/crlnumber diff --git a/src/libs/mosquitto/test/ssl/demoCA/index.txt b/mosquitto/test/ssl/demoCA/index.txt similarity index 100% rename from src/libs/mosquitto/test/ssl/demoCA/index.txt rename to mosquitto/test/ssl/demoCA/index.txt diff --git a/src/libs/mosquitto/test/ssl/demoCA/index.txt.attr b/mosquitto/test/ssl/demoCA/index.txt.attr similarity index 100% rename from src/libs/mosquitto/test/ssl/demoCA/index.txt.attr rename to mosquitto/test/ssl/demoCA/index.txt.attr diff --git a/src/libs/mosquitto/test/ssl/demoCA/serial b/mosquitto/test/ssl/demoCA/serial similarity index 100% rename from src/libs/mosquitto/test/ssl/demoCA/serial rename to mosquitto/test/ssl/demoCA/serial diff --git a/src/libs/mosquitto/test/ssl/gen.sh b/mosquitto/test/ssl/gen.sh similarity index 100% rename from src/libs/mosquitto/test/ssl/gen.sh rename to mosquitto/test/ssl/gen.sh diff --git a/src/libs/mosquitto/test/ssl/openssl.cnf b/mosquitto/test/ssl/openssl.cnf similarity index 100% rename from src/libs/mosquitto/test/ssl/openssl.cnf rename to mosquitto/test/ssl/openssl.cnf diff --git a/src/libs/mosquitto/test/ssl/readme.txt b/mosquitto/test/ssl/readme.txt similarity index 100% rename from src/libs/mosquitto/test/ssl/readme.txt rename to mosquitto/test/ssl/readme.txt diff --git a/src/libs/mosquitto/test/ssl/rootCA/crlnumber b/mosquitto/test/ssl/rootCA/crlnumber similarity index 100% rename from src/libs/mosquitto/test/ssl/rootCA/crlnumber rename to mosquitto/test/ssl/rootCA/crlnumber diff --git a/src/libs/mosquitto/test/ssl/rootCA/index.txt b/mosquitto/test/ssl/rootCA/index.txt similarity index 100% rename from src/libs/mosquitto/test/ssl/rootCA/index.txt rename to mosquitto/test/ssl/rootCA/index.txt diff --git a/src/libs/mosquitto/test/ssl/rootCA/index.txt.attr b/mosquitto/test/ssl/rootCA/index.txt.attr similarity index 100% rename from src/libs/mosquitto/test/ssl/rootCA/index.txt.attr rename to mosquitto/test/ssl/rootCA/index.txt.attr diff --git a/src/libs/mosquitto/test/ssl/rootCA/serial b/mosquitto/test/ssl/rootCA/serial similarity index 100% rename from src/libs/mosquitto/test/ssl/rootCA/serial rename to mosquitto/test/ssl/rootCA/serial diff --git a/mosquitto/test/ssl/server-expired.crt b/mosquitto/test/ssl/server-expired.crt new file mode 100644 index 0000000..e69de29 diff --git a/src/libs/mosquitto/test/ssl/server.crt b/mosquitto/test/ssl/server.crt similarity index 100% rename from src/libs/mosquitto/test/ssl/server.crt rename to mosquitto/test/ssl/server.crt diff --git a/src/libs/mosquitto/test/ssl/server.csr b/mosquitto/test/ssl/server.csr similarity index 100% rename from src/libs/mosquitto/test/ssl/server.csr rename to mosquitto/test/ssl/server.csr diff --git a/src/libs/mosquitto/test/ssl/server.key b/mosquitto/test/ssl/server.key similarity index 100% rename from src/libs/mosquitto/test/ssl/server.key rename to mosquitto/test/ssl/server.key diff --git a/src/libs/mosquitto/test/ssl/signingCA/crlnumber b/mosquitto/test/ssl/signingCA/crlnumber similarity index 100% rename from src/libs/mosquitto/test/ssl/signingCA/crlnumber rename to mosquitto/test/ssl/signingCA/crlnumber diff --git a/src/libs/mosquitto/test/ssl/signingCA/index.txt b/mosquitto/test/ssl/signingCA/index.txt similarity index 100% rename from src/libs/mosquitto/test/ssl/signingCA/index.txt rename to mosquitto/test/ssl/signingCA/index.txt diff --git a/src/libs/mosquitto/test/ssl/signingCA/index.txt.attr b/mosquitto/test/ssl/signingCA/index.txt.attr similarity index 100% rename from src/libs/mosquitto/test/ssl/signingCA/index.txt.attr rename to mosquitto/test/ssl/signingCA/index.txt.attr diff --git a/src/libs/mosquitto/test/ssl/signingCA/serial b/mosquitto/test/ssl/signingCA/serial similarity index 100% rename from src/libs/mosquitto/test/ssl/signingCA/serial rename to mosquitto/test/ssl/signingCA/serial diff --git a/src/libs/mosquitto/test/ssl/test-alt-ca.crt b/mosquitto/test/ssl/test-alt-ca.crt similarity index 100% rename from src/libs/mosquitto/test/ssl/test-alt-ca.crt rename to mosquitto/test/ssl/test-alt-ca.crt diff --git a/src/libs/mosquitto/test/ssl/test-alt-ca.key b/mosquitto/test/ssl/test-alt-ca.key similarity index 100% rename from src/libs/mosquitto/test/ssl/test-alt-ca.key rename to mosquitto/test/ssl/test-alt-ca.key diff --git a/src/libs/mosquitto/test/ssl/test-bad-root-ca.crt b/mosquitto/test/ssl/test-bad-root-ca.crt similarity index 100% rename from src/libs/mosquitto/test/ssl/test-bad-root-ca.crt rename to mosquitto/test/ssl/test-bad-root-ca.crt diff --git a/src/libs/mosquitto/test/ssl/test-bad-root-ca.key b/mosquitto/test/ssl/test-bad-root-ca.key similarity index 100% rename from src/libs/mosquitto/test/ssl/test-bad-root-ca.key rename to mosquitto/test/ssl/test-bad-root-ca.key diff --git a/src/libs/mosquitto/test/ssl/test-ca.srl b/mosquitto/test/ssl/test-ca.srl similarity index 100% rename from src/libs/mosquitto/test/ssl/test-ca.srl rename to mosquitto/test/ssl/test-ca.srl diff --git a/src/libs/mosquitto/test/ssl/test-fake-root-ca.crt b/mosquitto/test/ssl/test-fake-root-ca.crt similarity index 100% rename from src/libs/mosquitto/test/ssl/test-fake-root-ca.crt rename to mosquitto/test/ssl/test-fake-root-ca.crt diff --git a/src/libs/mosquitto/test/ssl/test-fake-root-ca.key b/mosquitto/test/ssl/test-fake-root-ca.key similarity index 100% rename from src/libs/mosquitto/test/ssl/test-fake-root-ca.key rename to mosquitto/test/ssl/test-fake-root-ca.key diff --git a/src/libs/mosquitto/test/ssl/test-root-ca.crt b/mosquitto/test/ssl/test-root-ca.crt similarity index 100% rename from src/libs/mosquitto/test/ssl/test-root-ca.crt rename to mosquitto/test/ssl/test-root-ca.crt diff --git a/src/libs/mosquitto/test/ssl/test-root-ca.key b/mosquitto/test/ssl/test-root-ca.key similarity index 100% rename from src/libs/mosquitto/test/ssl/test-root-ca.key rename to mosquitto/test/ssl/test-root-ca.key diff --git a/src/libs/mosquitto/test/ssl/test-signing-ca.crt b/mosquitto/test/ssl/test-signing-ca.crt similarity index 100% rename from src/libs/mosquitto/test/ssl/test-signing-ca.crt rename to mosquitto/test/ssl/test-signing-ca.crt diff --git a/src/libs/mosquitto/test/ssl/test-signing-ca.key b/mosquitto/test/ssl/test-signing-ca.key similarity index 100% rename from src/libs/mosquitto/test/ssl/test-signing-ca.key rename to mosquitto/test/ssl/test-signing-ca.key diff --git a/src/libs/mosquitto/test/to-test b/mosquitto/test/to-test similarity index 100% rename from src/libs/mosquitto/test/to-test rename to mosquitto/test/to-test diff --git a/src/mockDataSimulator/CMakeLists.txt b/src/mockDataSimulator/CMakeLists.txt deleted file mode 100644 index af4e01a..0000000 --- a/src/mockDataSimulator/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -set(SIMUL_SOURCE_FILES main.cpp main.cpp MockSensor.cpp MockSensor.h) -add_executable(simulator ${SIMUL_SOURCE_FILES}) \ No newline at end of file diff --git a/src/orchestra/CMakeLists.txt b/src/orchestra/CMakeLists.txt deleted file mode 100644 index 4a045da..0000000 --- a/src/orchestra/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.8) - -set(CMAKE_CXX_STANDARD 11) - -set(SOURCE_FILES main.cpp component/OrchAdderComponent.cpp component/OrchAdderComponent.h component/OrchSumComponent.cpp component/OrchSumComponent.h component/OrchStreamReaderComponent.cpp component/OrchStreamReaderComponent.h component/OrchStreamWriterComponent.cpp component/OrchStreamWriterComponent.h component/OrchMqttSourceComponent.cpp component/OrchMqttSourceComponent.h) - -add_executable(orchestra ${SOURCE_FILES}) - -target_link_libraries(orchestra DSPatch) -target_link_libraries(orchestra mosquittopp) \ No newline at end of file diff --git a/src/orchestra/main.cpp b/src/orchestra/main.cpp deleted file mode 100644 index 664a713..0000000 --- a/src/orchestra/main.cpp +++ /dev/null @@ -1,42 +0,0 @@ -// -// Created by Benjamin Rozière on 09/01/2018. -// - -#include - -#include - -#include "component/OrchSumComponent.h" -#include "component/OrchStreamReaderComponent.h" -#include "component/OrchStreamWriterComponent.h" -#include "component/OrchMqttSourceComponent.h" - -int main() { - - DspCircuit circuit; - - //OrchStreamReaderComponent reader(std::cin); - - //OrchSumComponent sum; - - OrchStreamWriterComponent writer(std::cout); - - OrchMqttSourceComponent mqttCmp("/test"); - - circuit.AddComponent(mqttCmp, "mqtt"); - - //circuit.AddComponent(reader, "Reader"); - //circuit.AddComponent(sum, "Sum"); - circuit.AddComponent(writer, "Writer"); - - circuit.ConnectOutToIn(mqttCmp, 0, writer, 0); - //circuit.ConnectOutToIn(sum, 0, writer, 0); - - circuit.StartAutoTick(); - getchar(); - circuit.StopAutoTick(); - - DSPatch::Finalize(); - - return EXIT_SUCCESS; -} From 7bf64f030dc50846db2ad10b44eea88730d7a07f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Rozie=CC=80re?= Date: Mon, 5 Mar 2018 19:05:24 +0100 Subject: [PATCH 08/12] Add Qt and QtPatcher --- CMakeLists.txt | 10 +- OrchestraCore/include/AppKernel.h | 26 ++ OrchestraCore/include/Orchestrator.h | 5 + OrchestraCore/src/AppKernel.cpp | 5 + OrchestraCore/src/Orchestrator.cpp | 8 + OrchestraGUI/CMakeLists.txt | 4 + OrchestraGUI/include/DsprController.h | 71 ++++ OrchestraGUI/include/DsprParam.h | 80 +++++ OrchestraGUI/src/DsprController.cpp | 402 +++++++++++++++++++++++ OrchestraGUI/src/DsprParam.cpp | 456 ++++++++++++++++++++++++++ OrchestraGUI/src/main.cpp | 24 +- qtpatcher/CMakeLists.txt | 21 ++ qtpatcher/data/QtpRes.qrc | 7 + qtpatcher/data/bringtofront.png | Bin 0 -> 293 bytes qtpatcher/data/delete.png | Bin 0 -> 831 bytes qtpatcher/data/sendtoback.png | Bin 0 -> 318 bytes qtpatcher/include/QtpComp.h | 87 +++++ qtpatcher/include/QtpDiag.h | 87 +++++ qtpatcher/include/QtpMain.h | 89 +++++ qtpatcher/include/QtpPin.h | 79 +++++ qtpatcher/include/QtpWire.h | 62 ++++ qtpatcher/src/QtpComp.cpp | 223 +++++++++++++ qtpatcher/src/QtpDiag.cpp | 303 +++++++++++++++++ qtpatcher/src/QtpMain.cpp | 255 ++++++++++++++ qtpatcher/src/QtpPin.cpp | 155 +++++++++ qtpatcher/src/QtpWire.cpp | 150 +++++++++ 26 files changed, 2600 insertions(+), 9 deletions(-) create mode 100644 OrchestraCore/include/AppKernel.h create mode 100644 OrchestraCore/src/AppKernel.cpp create mode 100644 OrchestraGUI/include/DsprController.h create mode 100644 OrchestraGUI/include/DsprParam.h create mode 100644 OrchestraGUI/src/DsprController.cpp create mode 100644 OrchestraGUI/src/DsprParam.cpp create mode 100644 qtpatcher/CMakeLists.txt create mode 100644 qtpatcher/data/QtpRes.qrc create mode 100644 qtpatcher/data/bringtofront.png create mode 100644 qtpatcher/data/delete.png create mode 100644 qtpatcher/data/sendtoback.png create mode 100644 qtpatcher/include/QtpComp.h create mode 100644 qtpatcher/include/QtpDiag.h create mode 100644 qtpatcher/include/QtpMain.h create mode 100644 qtpatcher/include/QtpPin.h create mode 100644 qtpatcher/include/QtpWire.h create mode 100644 qtpatcher/src/QtpComp.cpp create mode 100644 qtpatcher/src/QtpDiag.cpp create mode 100644 qtpatcher/src/QtpMain.cpp create mode 100644 qtpatcher/src/QtpPin.cpp create mode 100644 qtpatcher/src/QtpWire.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index eb6298e..98158ea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,9 @@ cmake_minimum_required(VERSION 3.8) set(CMAKE_CXX_STANDARD 11) +set(CMAKE_AUTOMOC ON) + + project(Orchestra VERSION 0.1 LANGUAGES CXX) include_directories(DSPatch/include) @@ -10,9 +13,14 @@ include_directories(mosquitto/lib) set(WITH_SRV OFF) set(WITH_TLS OFF) +set(CMAKE_PREFIX_PATH ~/Qt/5.10.1/clang_64) + +find_package(Qt5Widgets REQUIRED) + add_subdirectory(OrchestraCore) add_subdirectory(OrchestraComponents) add_subdirectory(OrchestraGUI) add_subdirectory(OrchestraSimulator) add_subdirectory(DSPatch) -add_subdirectory(mosquitto) \ No newline at end of file +add_subdirectory(mosquitto) +add_subdirectory(qtpatcher) \ No newline at end of file diff --git a/OrchestraCore/include/AppKernel.h b/OrchestraCore/include/AppKernel.h new file mode 100644 index 0000000..b295498 --- /dev/null +++ b/OrchestraCore/include/AppKernel.h @@ -0,0 +1,26 @@ +// +// Created by Benjamin Rozière on 04/03/2018. +// + +#ifndef ORCHESTRA_APPKERNEL_H +#define ORCHESTRA_APPKERNEL_H + + +#include +#include + +class AppKernel { + +private: + std::vector _loaders; + bool _booted; + std::string _pluginsDir; + std::string _configDir; + +public: + void boot(void); + void shutdown(); +}; + + +#endif //ORCHESTRA_APPKERNEL_H diff --git a/OrchestraCore/include/Orchestrator.h b/OrchestraCore/include/Orchestrator.h index 96df8bd..58dac0c 100644 --- a/OrchestraCore/include/Orchestrator.h +++ b/OrchestraCore/include/Orchestrator.h @@ -11,12 +11,17 @@ class Orchestrator { private: DspCircuit *_circuit; + bool _running; + public: Orchestrator(); void start(void); void stop(void); + bool is_running() const; + DspCircuit *get_circuit() const; + virtual ~Orchestrator(); }; diff --git a/OrchestraCore/src/AppKernel.cpp b/OrchestraCore/src/AppKernel.cpp new file mode 100644 index 0000000..a66c961 --- /dev/null +++ b/OrchestraCore/src/AppKernel.cpp @@ -0,0 +1,5 @@ +// +// Created by Benjamin Rozière on 04/03/2018. +// + +#include "../include/AppKernel.h" diff --git a/OrchestraCore/src/Orchestrator.cpp b/OrchestraCore/src/Orchestrator.cpp index faeb882..7dc453c 100644 --- a/OrchestraCore/src/Orchestrator.cpp +++ b/OrchestraCore/src/Orchestrator.cpp @@ -39,5 +39,13 @@ Orchestrator::~Orchestrator() { _circuit = nullptr; } +bool Orchestrator::is_running() const { + return _running; +} + +DspCircuit *Orchestrator::get_circuit() const { + return _circuit; +} + diff --git a/OrchestraGUI/CMakeLists.txt b/OrchestraGUI/CMakeLists.txt index 83cbb18..5b8ccf1 100644 --- a/OrchestraGUI/CMakeLists.txt +++ b/OrchestraGUI/CMakeLists.txt @@ -1,10 +1,13 @@ project(OrchestraGUI) include_directories(../OrchestraCore/include) +include_directories(../qtpatcher/include) file(GLOB srcs src/*.cpp) file(GLOB hdrs include/*.h) +add_definitions(-DPLUGIN_DIR="${CMAKE_CURRENT_SOURCE_DIR}/components") + add_executable( ${PROJECT_NAME} ${srcs} @@ -16,4 +19,5 @@ target_link_libraries( OrchestraCore mosquittopp DSPatch + QtPatcher ) \ No newline at end of file diff --git a/OrchestraGUI/include/DsprController.h b/OrchestraGUI/include/DsprController.h new file mode 100644 index 0000000..f2e88b2 --- /dev/null +++ b/OrchestraGUI/include/DsprController.h @@ -0,0 +1,71 @@ +// +// Created by Benjamin Rozière on 05/03/2018. +// + +#ifndef ORCHESTRA_DSPRCONTROLLER_H +#define ORCHESTRA_DSPRCONTROLLER_H + + +#include +#include "../include/DsprParam.h" +#include + +#include +#include + +#include + +class DsprController : public QObject +{ + Q_OBJECT + +public: + DsprController(QtpMain& mainWindow); + ~DsprController(); + + signals: + void inputAdded(DspComponent* component, int index); + void inputRemoved(DspComponent* component, int index); + void outputAdded(DspComponent* component, int index); + void outputRemoved(DspComponent* component, int index); + void parameterAdded(DspComponent* component, int index); + void parameterRemoved(DspComponent* component, int index); + void parameterUpdated(DspComponent* component, int index); + +public slots: + void compInserted(QtpComp* qtpComp); + void compRemoved(int compId); + void wireConnected(int fromComp, int fromPin, int toComp, int toPin); + void wireDisconnected(int fromComp, int fromPin, int toComp, int toPin); + + void boolUpdated(bool value); + void intUpdated(int value); + void floatUpdated(float value); + void stringUpdated(std::string const& value); + void triggerUpdated(); + +private slots: + void _loadPlugins(); + + void _inputAdded(DspComponent* component, int index); + void _inputRemoved(DspComponent* component, int index); + void _outputAdded(DspComponent* component, int index); + void _outputRemoved(DspComponent* component, int index); + void _parameterAdded(DspComponent* component, int index); + void _parameterRemoved(DspComponent* component, int index); + void _parameterUpdated(DspComponent* component, int index); + +private: + QFileSystemWatcher _fileWatcher; + QtpMain& _mainWindow; + std::set _settingParams; + std::vector _pluginLoaders; + + std::map _qtpComps; + std::map _components; + std::map< int, std::vector > _params; + DspCircuit _circuit; +}; + + +#endif //ORCHESTRA_DSPRCONTROLLER_H diff --git a/OrchestraGUI/include/DsprParam.h b/OrchestraGUI/include/DsprParam.h new file mode 100644 index 0000000..7650803 --- /dev/null +++ b/OrchestraGUI/include/DsprParam.h @@ -0,0 +1,80 @@ +// +// Created by Benjamin Rozière on 05/03/2018. +// + +#ifndef ORCHESTRA_DSPRPARAM_H +#define ORCHESTRA_DSPRPARAM_H + + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class QtpWire; + +class DsprParam : public QObject +{ + Q_OBJECT + +public: + DsprParam(int compId, int paramId, std::string const& name, DspParameter const& param, QMenu* contextMenu); + QWidgetAction* action(); + DspParameter const& param(); + + int compId() const; + int paramId() const; + std::string name() const; + + bool SetBool(bool const& value); + bool SetInt(int const& value); + bool SetIntRange(std::pair const& intRange); + bool SetFloat(float const& value); + bool SetFloatRange(std::pair const& floatRange); + bool SetString(std::string const& value); + bool SetList(std::vector const& value); + + signals: + void boolUpdated(bool value); + void intUpdated(int value); + void floatUpdated(float value); + void stringUpdated(std::string const& value); + void triggerUpdated(); + +private slots: + void paramChanged(bool value); + void paramChanged(int value); + void paramChanged(QString const&); + void paramChanged(); + + void updateSlider(int value); + void browseForFile(); + +private: + bool _settingParam; + int _compId; + int _paramId; + std::string _name; + DspParameter _param; + QMenu* _contextMenu; + QWidgetAction* _action; + + QCheckBox* _checkbox; + QSlider* _slider; + QLineEdit* _textBox; + QComboBox* _listBox; + QPushButton* _button; +}; + + +#endif //ORCHESTRA_DSPRPARAM_H diff --git a/OrchestraGUI/src/DsprController.cpp b/OrchestraGUI/src/DsprController.cpp new file mode 100644 index 0000000..2a46fc6 --- /dev/null +++ b/OrchestraGUI/src/DsprController.cpp @@ -0,0 +1,402 @@ +// +// Created by Benjamin Rozière on 05/03/2018. +// + +#include "../include/DsprController.h" +#include "../include/DsprParam.h" + +#include +#include + +#include + +DsprController::DsprController(QtpMain& mainWindow) + : _mainWindow(mainWindow) +{ + _fileWatcher.addPath(PLUGIN_DIR); + ///!connect(&_fileWatcher, SIGNAL(directoryChanged(QString const&)), this, SLOT(_loadPlugins())); + + _loadPlugins(); + + _circuit.SetThreadCount(2); + _circuit.StartAutoTick(); + + connect(_mainWindow.diagram(), &QtpDiag::compInserted, this, &DsprController::compInserted); + connect(_mainWindow.diagram(), &QtpDiag::compRemoved, this, &DsprController::compRemoved); + connect(_mainWindow.diagram(), &QtpDiag::wireConnected, this, &DsprController::wireConnected); + connect(_mainWindow.diagram(), &QtpDiag::wireDisconnected, this, &DsprController::wireDisconnected); + + connect(this, &DsprController::inputAdded, this, &DsprController::_inputAdded); + connect(this, &DsprController::inputRemoved, this, &DsprController::_inputRemoved); + connect(this, &DsprController::outputAdded, this, &DsprController::_outputAdded); + connect(this, &DsprController::outputRemoved, this, &DsprController::_outputRemoved); + connect(this, &DsprController::parameterAdded, this, &DsprController::_parameterAdded); + connect(this, &DsprController::parameterRemoved, this, &DsprController::_parameterRemoved); + connect(this, &DsprController::parameterUpdated, this, &DsprController::_parameterUpdated); +} + +DsprController::~DsprController() +{ + _circuit.StopAutoTick(); + + typedef std::pair ComponentPair; + foreach(ComponentPair comp, _components) + { + _circuit.RemoveComponent(comp.second); + delete comp.second; + } + _components.clear(); + + typedef std::pair< int, std::vector > ParamPair; + foreach(ParamPair paramList, _params) + { + foreach (DsprParam* param, paramList.second) + { + delete param; + } + } + _params.clear(); + + _qtpComps.clear(); + + DSPatch::Finalize(); +} + +void callback(DspComponent* component, DspComponent::CallbackType const& callbackType, + int index, void* userData) +{ + DsprController* controller = static_cast(userData); + switch (callbackType) + { + case DspComponent::InputAdded: + emit controller->inputAdded(component, index); + break; + case DspComponent::InputRemoved: + emit controller->inputRemoved(component, index); + break; + case DspComponent::OutputAdded: + emit controller->outputAdded(component, index); + break; + case DspComponent::OutputRemoved: + emit controller->outputRemoved(component, index); + break; + case DspComponent::ParameterAdded: + emit controller->parameterAdded(component, index); + break; + case DspComponent::ParameterRemoved: + emit controller->parameterRemoved(component, index); + break; + case DspComponent::ParameterUpdated: + emit controller->parameterUpdated(component, index); + break; + } +} + +void DsprController::compInserted(QtpComp* qtpComp) +{ + DspPluginLoader loader = _pluginLoaders[qtpComp->compInfo().typeId]; + std::map params = loader.GetCreateParams(); + + // Show construction menu + std::vector dsprParams; + typedef std::map::iterator it_type; + for (it_type iterator = params.begin(); iterator != params.end(); iterator++) + { + DsprParam* param = new DsprParam(qtpComp->id(), 0, iterator->first, + iterator->second, qtpComp->contextMenu()); + qtpComp->contextMenu()->addAction(param->action()); + dsprParams.push_back(param); + } + if (params.size() > 0) + { + qtpComp->contextMenu()->exec(QCursor::pos()); + } + + // Construct component with values from menu + foreach (DsprParam* dsprParam, dsprParams) + { + params[dsprParam->name()] = dsprParam->param(); + delete dsprParam; + } + qtpComp->contextMenu()->clear(); + + DspComponent* component = loader.Create(params); + if (component == NULL) + { + return; + } + + qtpComp->removeInPins(); + qtpComp->removeOutPins(); + for (int i = 0; i < component->GetInputCount(); ++i) + { + qtpComp->addInPin(component->GetInputName(i).c_str()); + } + for (int i = 0; i < component->GetOutputCount(); ++i) + { + qtpComp->addOutPin(component->GetOutputName(i).c_str()); + } + + component->SetCallback(callback, this); + _circuit.AddComponent(component); + + _components[qtpComp->id()] = component; + + _params[qtpComp->id()] = std::vector(); + for (int i = 0; i < component->GetParameterCount(); ++i) + { + DsprParam* param = new DsprParam(qtpComp->id(), i, component->GetParameterName(i), + *component->GetParameter(i), qtpComp->contextMenu()); + qtpComp->contextMenu()->addAction(param->action()); + + connect(param, &DsprParam::boolUpdated, this, &DsprController::boolUpdated); + connect(param, &DsprParam::intUpdated, this, &DsprController::intUpdated); + connect(param, &DsprParam::floatUpdated, this, &DsprController::floatUpdated); + connect(param, &DsprParam::stringUpdated, this, &DsprController::stringUpdated); + connect(param, &DsprParam::triggerUpdated, this, &DsprController::triggerUpdated); + + _params[qtpComp->id()].push_back(param); + } + + _qtpComps[component] = qtpComp; +} + +void DsprController::compRemoved(int compId) +{ + _circuit.RemoveComponent(_components[compId]); + + delete _components[compId]; + _components.erase(compId); + + foreach (DsprParam* param, _params[compId]) + { + delete param; + } + _params.erase(compId); + + _qtpComps.erase(_components[compId]); +} + +void DsprController::wireConnected(int fromComp, int fromPin, int toComp, int toPin) +{ + _circuit.ConnectOutToIn(_components[fromComp], fromPin, _components[toComp], toPin); +} + +void DsprController::wireDisconnected(int fromComp, int fromPin, int toComp, int toPin) +{ + _circuit.DisconnectOutToIn(_components[fromComp], fromPin, _components[toComp], toPin); +} + +void DsprController::boolUpdated(bool value) +{ + DsprParam* param = dynamic_cast(sender()); + _settingParams.insert(param->paramId()); + if (!_components[param->compId()]->SetParameter(param->paramId(), DspParameter(DspParameter::Bool, value))) + { + param->SetBool(*(_components[param->compId()]->GetParameter(param->paramId())->GetBool())); + } + _settingParams.erase(param->paramId()); +} + +void DsprController::intUpdated(int value) +{ + DsprParam* param = dynamic_cast(sender()); + _settingParams.insert(param->paramId()); + if (!_components[param->compId()]->SetParameter(param->paramId(), DspParameter(DspParameter::Int, value))) + { + param->SetInt(*(_components[param->compId()]->GetParameter(param->paramId())->GetInt())); + } + _settingParams.erase(param->paramId()); +} + +void DsprController::floatUpdated(float value) +{ + DsprParam* param = dynamic_cast(sender()); + _settingParams.insert(param->paramId()); + if (!_components[param->compId()]->SetParameter(param->paramId(), DspParameter(DspParameter::Float, value))) + { + param->SetFloat(*(_components[param->compId()]->GetParameter(param->paramId())->GetFloat())); + } + _settingParams.erase(param->paramId()); +} + +void DsprController::stringUpdated(std::string const& value) +{ + DsprParam* param = dynamic_cast(sender()); + _settingParams.insert(param->paramId()); + if (!_components[param->compId()]->SetParameter(param->paramId(), DspParameter(DspParameter::String, value))) + { + param->SetString(*(_components[param->compId()]->GetParameter(param->paramId())->GetString())); + } + _settingParams.erase(param->paramId()); +} + +void DsprController::triggerUpdated() +{ + DsprParam* param = dynamic_cast(sender()); + _settingParams.insert(param->paramId()); + _components[param->compId()]->SetParameter(param->paramId(), DspParameter(DspParameter::Trigger)); + _settingParams.erase(param->paramId()); +} + +void DsprController::_inputAdded(DspComponent* component, int index) +{ + _qtpComps[component]->addInPin(component->GetInputName(index).c_str()); +} + +void DsprController::_inputRemoved(DspComponent* component, int index) +{ + if (index == -1) + { + _qtpComps[component]->removeInPins(); + } + else + { + _qtpComps[component]->removeInPin(); + } +} + +void DsprController::_outputAdded(DspComponent* component, int index) +{ + _qtpComps[component]->addOutPin(component->GetOutputName(index).c_str()); +} + +void DsprController::_outputRemoved(DspComponent* component, int index) +{ + if (index == -1) + { + _qtpComps[component]->removeOutPins(); + } + else + { + _qtpComps[component]->removeOutPin(); + } +} + +void DsprController::_parameterAdded(DspComponent* component, int index) +{ + QtpComp* comp = _qtpComps[component]; + + DsprParam* param = new DsprParam(comp->id(), index, component->GetParameterName(index), + *component->GetParameter(index), comp->contextMenu()); + comp->contextMenu()->addAction(param->action()); + + connect(param, &DsprParam::boolUpdated, this, &DsprController::boolUpdated); + connect(param, &DsprParam::intUpdated, this, &DsprController::intUpdated); + connect(param, &DsprParam::floatUpdated, this, &DsprController::floatUpdated); + connect(param, &DsprParam::stringUpdated, this, &DsprController::stringUpdated); + connect(param, &DsprParam::triggerUpdated, this, &DsprController::triggerUpdated); + + _params[comp->id()].push_back(param); +} + +void DsprController::_parameterRemoved(DspComponent* component, int index) +{ + if (index == -1) + { + typedef std::pair< int, std::vector > ParamPair; + foreach(ParamPair paramList, _params) + { + foreach (DsprParam* param, paramList.second) + { + delete param; + } + } + _params.clear(); + } + else + { + QtpComp* comp = _qtpComps[component]; + delete _params[comp->id()].back(); + _params[comp->id()].pop_back(); + } +} + +void DsprController::_parameterUpdated(DspComponent* component, int index) +{ + // don't react if we are the one setting the parameter + if (_settingParams.find(index) != _settingParams.end()) + { + return; + } + QtpComp* qtpComp = _qtpComps[component]; + switch (_params[qtpComp->id()][index]->param().Type()) + { + case DspParameter::Null: + break; + case DspParameter::Bool: + _params[qtpComp->id()][index]->SetBool(*component->GetParameter(index)->GetBool()); + break; + case DspParameter::Int: + if (component->GetParameter(index)->GetIntRange()) + { + _params[qtpComp->id()][index]->SetIntRange(*component->GetParameter(index)->GetIntRange()); + } + _params[qtpComp->id()][index]->SetInt(*component->GetParameter(index)->GetInt()); + break; + case DspParameter::Float: + if (component->GetParameter(index)->GetFloatRange()) + { + _params[qtpComp->id()][index]->SetFloatRange(*component->GetParameter(index)->GetFloatRange()); + } + _params[qtpComp->id()][index]->SetFloat(*component->GetParameter(index)->GetFloat()); + break; + case DspParameter::String: + _params[qtpComp->id()][index]->SetString(*component->GetParameter(index)->GetString()); + break; + case DspParameter::FilePath: + _params[qtpComp->id()][index]->SetString(*component->GetParameter(index)->GetString()); + break; + case DspParameter::List: + _params[qtpComp->id()][index]->SetList(*component->GetParameter(index)->GetList()); + break; + case DspParameter::Trigger: + break; + } +} + +void DsprController::_loadPlugins() +{ + _mainWindow.unregisterComponents(); + + // Load DSPatch plugins from "dspatchables" folder + QDir dir(PLUGIN_DIR); + QFileInfoList files = dir.entryInfoList(); + foreach(QFileInfo const& file, files) + { +#ifdef _WIN32 + if (file.isFile() && file.fileName().endsWith(".dll")) +#else + if (file.isFile()) +#endif + { + QString path = file.absoluteFilePath(); + DspPluginLoader loader(path.toUtf8().constData()); + if (loader.IsLoaded()) + { + _pluginLoaders.push_back(loader); + std::map params = loader.GetCreateParams(); + DspComponent* comp = loader.Create(params); + + QtpComp::CompInfo compInfo; + compInfo.typeId = _pluginLoaders.size() - 1; + compInfo.typeName = file.baseName().mid(0, 3) == "lib" ? file.baseName().mid(3) : file.baseName(); + + if (comp) + { + for (int i = 0; i < comp->GetInputCount(); ++i) + { + compInfo.inPins.append(comp->GetInputName(i).c_str()); + } + for (int i = 0; i < comp->GetOutputCount(); ++i) + { + compInfo.outPins.append(comp->GetOutputName(i).c_str()); + } + } + + _mainWindow.registerComponent(compInfo); + delete comp; + } + } + } +} diff --git a/OrchestraGUI/src/DsprParam.cpp b/OrchestraGUI/src/DsprParam.cpp new file mode 100644 index 0000000..af2aeef --- /dev/null +++ b/OrchestraGUI/src/DsprParam.cpp @@ -0,0 +1,456 @@ +// +// Created by Benjamin Rozière on 05/03/2018. +// + +#include "../include/DsprParam.h" + + +DsprParam::DsprParam(int compId, int paramId, std::string const& name, DspParameter const& param, QMenu* contextMenu) + : _settingParam(false) + , _compId(compId) + , _paramId(paramId) + , _name(name) + , _param(param) + , _contextMenu(contextMenu) +{ + if (_param.Type() == DspParameter::Bool) + { + _checkbox = new QCheckBox(_contextMenu); + + if (_param.GetBool()) + { + _checkbox->setChecked(*_param.GetBool()); + } + + _checkbox->setText(name.c_str()); + QWidgetAction* customAction = new QWidgetAction(_contextMenu); + customAction->setDefaultWidget(_checkbox); + _action = customAction; + + connect(_checkbox, SIGNAL(toggled(bool)), this, SLOT(paramChanged(bool))); + } + else if (_param.Type() == DspParameter::Int) + { + QWidget* intSlider = new QWidget(_contextMenu); + + _slider = new QSlider(Qt::Horizontal, intSlider); + if (_param.GetIntRange()) + { + _slider->setRange(_param.GetIntRange()->first, _param.GetIntRange()->second); + } + else if (_param.GetInt()) + { + _slider->setRange(0, *_param.GetInt() * 2); + } + else + { + _slider->setRange(0, 10000); + } + + if (_param.GetInt()) + { + _slider->setValue(*_param.GetInt()); + } + else + { + _slider->setValue(5000); + } + + QLabel* label = new QLabel(intSlider); + label->setText(name.c_str()); + + _textBox = new QLineEdit(intSlider); + _textBox->setText(QString::number(_slider->sliderPosition())); + _textBox->setFixedWidth(65); + + connect(_slider, SIGNAL(valueChanged(int)), this, SLOT(updateSlider(int))); + + QHBoxLayout* layout = new QHBoxLayout(intSlider); + layout->addWidget(label); + layout->addWidget(_slider); + layout->addWidget(_textBox); + + QWidgetAction* intSliderAction = new QWidgetAction(_contextMenu); + intSliderAction->setDefaultWidget(intSlider); + _action = intSliderAction; + + connect(_textBox, SIGNAL(textChanged(QString const&)), this, SLOT(paramChanged(QString const&))); + } + else if (_param.Type() == DspParameter::Float) + { + QWidget* floatSlider = new QWidget(_contextMenu); + + _slider = new QSlider(Qt::Horizontal, floatSlider); + if (_param.GetFloatRange()) + { + _slider->setRange(_param.GetFloatRange()->first * 100, _param.GetFloatRange()->second * 100); + } + else if (_param.GetFloat()) + { + _slider->setRange(0, *_param.GetFloat() * 200); + } + else + { + _slider->setRange(0, 10000 * 100); + } + + if (_param.GetFloat()) + { + _slider->setValue(*_param.GetFloat() * 100); + } + else + { + _slider->setValue(5000 * 100); + } + + QLabel* label = new QLabel(floatSlider); + label->setText(name.c_str()); + + _textBox = new QLineEdit(floatSlider); + _textBox->setText(QString::number((float)_slider->sliderPosition() / 100)); + _textBox->setFixedWidth(65); + + connect(_slider, SIGNAL(valueChanged(int)), this, SLOT(updateSlider(int))); + + QHBoxLayout* layout = new QHBoxLayout(floatSlider); + layout->addWidget(label); + layout->addWidget(_slider); + layout->addWidget(_textBox); + + QWidgetAction* intSliderAction = new QWidgetAction(_contextMenu); + intSliderAction->setDefaultWidget(floatSlider); + _action = intSliderAction; + + connect(_textBox, SIGNAL(textChanged(QString const&)), this, SLOT(paramChanged(QString const&))); + } + else if (_param.Type() == DspParameter::String) + { + QWidget* textBox = new QWidget(_contextMenu); + + QLabel* label = new QLabel(textBox); + label->setText(name.c_str()); + + _textBox = new QLineEdit(textBox); + + if (_param.GetString()) + { + _textBox->setText(_param.GetString()->c_str()); + } + + QHBoxLayout* layout = new QHBoxLayout(textBox); + layout->addWidget(label); + layout->addWidget(_textBox); + + QWidgetAction* customAction = new QWidgetAction(_contextMenu); + customAction->setDefaultWidget(textBox); + _action = customAction; + + connect(_textBox, SIGNAL(textChanged(QString const&)), this, SLOT(paramChanged(QString const&))); + } + else if (_param.Type() == DspParameter::FilePath) + { + QWidget* fileBrowser = new QWidget(_contextMenu); + + QLabel* label = new QLabel(fileBrowser); + label->setText(name.c_str()); + + _textBox = new QLineEdit(fileBrowser); + + if (_param.GetString()) + { + _textBox->setText(_param.GetString()->c_str()); + } + + QPushButton* btnBrowse = new QPushButton(fileBrowser); + btnBrowse->setText("Browse"); + + QHBoxLayout* layout = new QHBoxLayout(fileBrowser); + layout->addWidget(label); + layout->addWidget(_textBox); + layout->addWidget(btnBrowse); + + QWidgetAction* fileBrowserAction = new QWidgetAction(_contextMenu); + fileBrowserAction->setDefaultWidget(fileBrowser); + _action = fileBrowserAction; + + connect(btnBrowse, SIGNAL(released()), this, SLOT(browseForFile())); + connect(_textBox, SIGNAL(textChanged(QString const&)), this, SLOT(paramChanged(QString const&))); + } + else if (_param.Type() == DspParameter::List) + { + QWidget* listBox = new QWidget(_contextMenu); + + QLabel* label = new QLabel(listBox); + label->setText(name.c_str()); + + _listBox = new QComboBox(listBox); + + if (_param.GetList()) + { + for (size_t i = 0; i < _param.GetList()->size(); ++i) + { + _listBox->addItem((*_param.GetList())[i].c_str()); + } + } + + QHBoxLayout* layout = new QHBoxLayout(listBox); + layout->addWidget(label); + layout->addWidget(_listBox); + + QWidgetAction* customAction = new QWidgetAction(_contextMenu); + customAction->setDefaultWidget(listBox); + _action = customAction; + + connect(_listBox, SIGNAL(currentIndexChanged(int)), this, SLOT(paramChanged(int))); + } + else if (_param.Type() == DspParameter::Trigger) + { + _button = new QPushButton(_contextMenu); + _button->setText(name.c_str()); + + QWidgetAction* customAction = new QWidgetAction(_contextMenu); + customAction->setDefaultWidget(_button); + _action = customAction; + + connect(_button, SIGNAL(released()), this, SLOT(paramChanged())); + } +} + +QWidgetAction* DsprParam::action() +{ + return _action; +} + +DspParameter const& DsprParam::param() +{ + return _param; +} + +int DsprParam::compId() const +{ + return _compId; +} + +int DsprParam::paramId() const +{ + return _paramId; +} + +std::string DsprParam::name() const +{ + return _name; +} + +bool DsprParam::SetBool(bool const& value) +{ + _settingParam = true; + bool result = _param.SetBool(value); + if (result && _param.Type() == DspParameter::Bool) + { + _checkbox->setChecked(value); + } + _settingParam = false; + return result; +} + +bool DsprParam::SetInt(int const& value) +{ + _settingParam = true; + bool result = _param.SetInt(value); + if (result && _param.Type() == DspParameter::Int) + { + _slider->setValue(value); + } + else if (result && _param.Type() == DspParameter::List) + { + _listBox->setCurrentIndex(value); + } + _settingParam = false; + return result; +} + +bool DsprParam::SetIntRange(std::pair const& intRange) +{ + _settingParam = true; + bool result = _param.SetIntRange(intRange); + if (result && _param.Type() == DspParameter::Int) + { + _slider->setRange(intRange.first, intRange.second); + } + _settingParam = false; + return result; +} + +bool DsprParam::SetFloat(float const& value) +{ + _settingParam = true; + bool result = _param.SetFloat(value); + if (result && _param.Type() == DspParameter::Float) + { + _slider->setValue(value * 100); + } + _settingParam = false; + return result; +} + +bool DsprParam::SetFloatRange(std::pair const& floatRange) +{ + _settingParam = true; + bool result = _param.SetFloatRange(floatRange); + if (result && _param.Type() == DspParameter::Float) + { + _slider->setRange(floatRange.first * 100, floatRange.second * 100); + } + _settingParam = false; + return result; +} + +bool DsprParam::SetString(std::string const& value) +{ + _settingParam = true; + bool result = _param.SetString(value); + if (result && _param.Type() == DspParameter::String) + { + _textBox->setText(value.c_str()); + } + else if (result && _param.Type() == DspParameter::FilePath) + { + _textBox->setText(value.c_str()); + } + else if (result && _param.Type() == DspParameter::List) + { + for (int i = 0; i < _listBox->children().size(); ++i) + { + if (_listBox->itemText(i) == value.c_str()) + { + _listBox->setCurrentIndex(i); + break; + } + } + } + _settingParam = false; + return result; +} + +bool DsprParam::SetList(std::vector const& value) +{ + _settingParam = true; + bool result = _param.SetList(value); + if (result && _param.Type() == DspParameter::List) + { + _listBox->clear(); + for (size_t i = 0; i < value.size(); ++i) + { + _listBox->addItem(value[i].c_str()); + } + } + _settingParam = false; + return result; +} + +void DsprParam::paramChanged(bool value) +{ + if (_settingParam) + { + return; + } + if (_param.Type() == DspParameter::Bool) + { + _param.SetBool(value != 0); + emit boolUpdated(value != 0); + } +} + +void DsprParam::paramChanged(int value) +{ + if (_settingParam) + { + return; + } + if (_param.Type() == DspParameter::List) + { + _param.SetInt(value); + emit intUpdated(value); + } +} + +void DsprParam::paramChanged(QString const& newString) +{ + if (_settingParam) + { + return; + } + if (_param.Type() == DspParameter::Int) + { + int value = newString.toInt(); + + _settingParam = true; + _slider->setValue(value); + if (value < _slider->minimum() || value > _slider->maximum()) + { + value = _slider->sliderPosition(); + _textBox->setText(QString::number(value)); + } + _settingParam = false; + + _param.SetInt(value); + emit intUpdated(value); + } + else if (_param.Type() == DspParameter::Float) + { + float value = newString.toFloat(); + + _settingParam = true; + _slider->setValue(value * 100); + if (value * 100 < _slider->minimum() || value * 100 > _slider->maximum()) + { + value = (float)_slider->sliderPosition() / 100; + _textBox->setText(QString::number(value)); + } + _settingParam = false; + + _param.SetFloat(value); + emit floatUpdated(value); + } + else if (_param.Type() == DspParameter::String) + { + _param.SetString(newString.toUtf8().constData()); + emit stringUpdated(newString.toUtf8().constData()); + } + else if (_param.Type() == DspParameter::FilePath) + { + _param.SetString(newString.toUtf8().constData()); + emit stringUpdated(newString.toUtf8().constData()); + } +} + +void DsprParam::paramChanged() +{ + if (_settingParam) + { + return; + } + if (_param.Type() == DspParameter::Trigger) + { + emit triggerUpdated(); + } +} + +void DsprParam::updateSlider(int value) +{ + if (_param.Type() == DspParameter::Int) + { + _textBox->setText(QString::number(value)); + } + else if (_param.Type() == DspParameter::Float) + { + _textBox->setText(QString::number((float)value / 100)); + } +} + +void DsprParam::browseForFile() +{ + QFileDialog* custom = new QFileDialog(); + _textBox->setText(custom->getOpenFileName()); + delete custom; +} \ No newline at end of file diff --git a/OrchestraGUI/src/main.cpp b/OrchestraGUI/src/main.cpp index 0161fe3..06f8140 100644 --- a/OrchestraGUI/src/main.cpp +++ b/OrchestraGUI/src/main.cpp @@ -2,16 +2,24 @@ // Created by Benjamin Rozière on 09/01/2018. // -#include -#include +#include +#include +#include "../include/DsprController.h" -int main() { +int main(int argc, char** argv) { - Orchestrator orchestrator; + //Orchestrator orchestrator; - orchestrator.start(); - getchar(); - orchestrator.stop(); + //orchestrator.start(); + //getchar(); + //orchestrator.stop(); - return EXIT_SUCCESS; + QApplication app(argc, argv); + QtpMain mainWindow; + + mainWindow.show(); + + DsprController controller(mainWindow); + + return app.exec(); } diff --git a/qtpatcher/CMakeLists.txt b/qtpatcher/CMakeLists.txt new file mode 100644 index 0000000..974c49e --- /dev/null +++ b/qtpatcher/CMakeLists.txt @@ -0,0 +1,21 @@ +project(QtPatcher) + +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) + +file(GLOB srcs src/*.cpp) +file(GLOB hdrs include/*.h) +file(GLOB qrcs data/*.qrc) + +qt5_add_resources(rcs ${qrcs}) + +add_library( + ${PROJECT_NAME} + ${srcs} + ${hdrs} + ${rcs} +) + +qt5_use_modules( + ${PROJECT_NAME} + Widgets +) diff --git a/qtpatcher/data/QtpRes.qrc b/qtpatcher/data/QtpRes.qrc new file mode 100644 index 0000000..2e8adab --- /dev/null +++ b/qtpatcher/data/QtpRes.qrc @@ -0,0 +1,7 @@ + + + bringtofront.png + delete.png + sendtoback.png + + diff --git a/qtpatcher/data/bringtofront.png b/qtpatcher/data/bringtofront.png new file mode 100644 index 0000000000000000000000000000000000000000..bda27578a2dfb80bc9a72965002f8c757cf35cc7 GIT binary patch literal 293 zcmV+=0owkFP)dm4?Fu&!p#^mymSVTh zU>sb6HlP;7W{N`X0QDB+k_jxAXelOsn#*51@U_g5OYIsl5L%VuiskzuK3zz?-u00000NkvXXu0mjfg_VD% literal 0 HcmV?d00001 diff --git a/qtpatcher/data/delete.png b/qtpatcher/data/delete.png new file mode 100644 index 0000000000000000000000000000000000000000..df2a147d246ef62d628d73db36b0b24af98a2ab9 GIT binary patch literal 831 zcmV-F1Hk-=P)R5;6h zl}l(-K@^6Q=FtdACA#^NDs^{Lp)6)L zgDB5eX;UdG_4H6F7*yIgXmIAu0!5NyOCtSU7G=!;6%|3j{gliox-!pOK?G(o&X({YLK$5)lC7F{VZbo703UCXA=&? zO>Nu>w#%A8Rp;5oKacEBBT*BGX+{#I_yE%2i8f!~SeeejbP6SvLH5VQ-~o6A-hwe1 z-+)oOG3-#N-p|7H3rxph%DcJ`E`ihFDtIo2X&L#)9#wa!-__Ey=>18UreVqnx(m*O z14e_~1JA$~|`2HhU^Ra!WRl)GgiU zYU$BXh#q3R4$gpm?mF#|Br$YH!gK>%1c$VCx82fBJaI+hxwpFb)g=^Dbv{zQc<7+k z9t8>W67osVx3S=)K2n#oseNr$I`ov*vgsc2h}xyrpv>h+JHeJUF8ZjWkj` zH1UE>PMpf&iLCQ!iioCJ)~Hi?YjvJaK8_pg59Au!plIt&?SDO~mzDzYD;xj-002ov JPDHLkV1h`%ho%4k literal 0 HcmV?d00001 diff --git a/qtpatcher/data/sendtoback.png b/qtpatcher/data/sendtoback.png new file mode 100644 index 0000000000000000000000000000000000000000..5aa3b0a24382610f1dc25d6708a02a90e3d6c340 GIT binary patch literal 318 zcmV-E0m1%>P)1A0e687B!#Lm%BmfS zjSWxldj>ac+a?Z_s+z6!20%orpk3GP?lruq{=t6%Y>e64N{5Y8+F*&ZZV(4{GllSW;AhrI>C^Mf7m%p9hk07*qoM6N<$f)Wjg@&Et; literal 0 HcmV?d00001 diff --git a/qtpatcher/include/QtpComp.h b/qtpatcher/include/QtpComp.h new file mode 100644 index 0000000..b700988 --- /dev/null +++ b/qtpatcher/include/QtpComp.h @@ -0,0 +1,87 @@ +/************************************************************************ +QtPatcher - Cross-Platform Circuit Drawing Library +Copyright (c) 2014-2015 Marcus Tomlinson + +This file is part of QtPatcher. + +GNU Lesser General Public License Usage +This file may be used under the terms of the GNU Lesser General Public +License version 3.0 as published by the Free Software Foundation and +appearing in the file LGPLv3.txt included in the packaging of this +file. Please review the following information to ensure the GNU Lesser +General Public License version 3.0 requirements will be met: +http://www.gnu.org/copyleft/lgpl.html. + +Other Usage +Alternatively, this file may be used in accordance with the terms and +conditions contained in a signed written agreement between you and +Marcus Tomlinson. + +DSPatch is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +************************************************************************/ + +#ifndef QTPCOMP_H +#define QTPCOMP_H + +#include +#include + +class QtpPin; + +class QtpComp : public QGraphicsPolygonItem +{ +public: + enum + { + Type = UserType + 1 + }; + + struct CompInfo + { + int typeId; + QString typeName; + QList inPins; + QList outPins; + }; + + QtpComp(CompInfo const& compInfo, int id, QPointF const& position, QGraphicsItem* parent = 0); + ~QtpComp(); + + int id(); + int type() const; + + void setColor(const QColor& color); + + void addInPin(QString pinName); + void addOutPin(QString pinName); + void removeInPin(); + void removeOutPin(); + void removeInPins(); + void removeOutPins(); + + QMenu* contextMenu(); + + QPixmap image() const; + CompInfo compInfo() const; + +protected: + void contextMenuEvent(QGraphicsSceneContextMenuEvent* event); + +private: + void setName(QString name); + void updatePolygon(); + +private: + int _id; + QColor _color; + CompInfo _compInfo; + QPolygonF _polygon; + QMenu* _contextMenu; + QList _inPins; + QList _outPins; + QGraphicsTextItem* _nameText; +}; + +#endif // QTPCOMP_H diff --git a/qtpatcher/include/QtpDiag.h b/qtpatcher/include/QtpDiag.h new file mode 100644 index 0000000..d99cbe0 --- /dev/null +++ b/qtpatcher/include/QtpDiag.h @@ -0,0 +1,87 @@ +/************************************************************************ +QtPatcher - Cross-Platform Circuit Drawing Library +Copyright (c) 2014-2015 Marcus Tomlinson + +This file is part of QtPatcher. + +GNU Lesser General Public License Usage +This file may be used under the terms of the GNU Lesser General Public +License version 3.0 as published by the Free Software Foundation and +appearing in the file LGPLv3.txt included in the packaging of this +file. Please review the following information to ensure the GNU Lesser +General Public License version 3.0 requirements will be met: +http://www.gnu.org/copyleft/lgpl.html. + +Other Usage +Alternatively, this file may be used in accordance with the terms and +conditions contained in a signed written agreement between you and +Marcus Tomlinson. + +DSPatch is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +************************************************************************/ + +#ifndef QTPDIAG_H +#define QTPDIAG_H + +#include + +#include + +class QtpPin; + +class QtpDiag : public QGraphicsScene +{ + Q_OBJECT + +public: + enum Mode + { + InsertComp, + InsertLine, + MoveComp + }; + + explicit QtpDiag(QObject* parent = 0); + + void setLineColor(const QColor& color); + void setCompColor(const QColor& color); + + QColor compColor() const; + QColor lineColor() const; + +signals: + void compInserted(QtpComp* comp); + void compRemoved(int compId); + void wireConnected(int fromComp, int fromPin, int toComp, int toPin); + void wireDisconnected(int fromComp, int fromPin, int toComp, int toPin); + +public slots: + void setMode(Mode mode); + void setNextComp(QtpComp::CompInfo const& compInfo); + + void bringToFront(); + void sendToBack(); + void deleteItem(); + +protected: + void mousePressEvent(QGraphicsSceneMouseEvent* mouseEvent); + void mouseMoveEvent(QGraphicsSceneMouseEvent* mouseEvent); + void mouseReleaseEvent(QGraphicsSceneMouseEvent* mouseEvent); + +private: + bool isItemChange(int type); + + int _compId; + QtpComp::CompInfo _nextComp; + Mode _mode; + bool _leftButtonDown; + QPointF _startPoint; + QGraphicsLineItem* _line; + QColor _compColor; + QColor _lineColor; + QtpPin* _pinHovered; +}; + +#endif // QTPDIAG_H diff --git a/qtpatcher/include/QtpMain.h b/qtpatcher/include/QtpMain.h new file mode 100644 index 0000000..69311ab --- /dev/null +++ b/qtpatcher/include/QtpMain.h @@ -0,0 +1,89 @@ +/************************************************************************ +QtPatcher - Cross-Platform Circuit Drawing Library +Copyright (c) 2014-2015 Marcus Tomlinson + +This file is part of QtPatcher. + +GNU Lesser General Public License Usage +This file may be used under the terms of the GNU Lesser General Public +License version 3.0 as published by the Free Software Foundation and +appearing in the file LGPLv3.txt included in the packaging of this +file. Please review the following information to ensure the GNU Lesser +General Public License version 3.0 requirements will be met: +http://www.gnu.org/copyleft/lgpl.html. + +Other Usage +Alternatively, this file may be used in accordance with the terms and +conditions contained in a signed written agreement between you and +Marcus Tomlinson. + +DSPatch is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +************************************************************************/ + +#ifndef QTPMAIN_H +#define QTPMAIN_H + +#include + +#include + +class QtpDiag; + +class QButtonGroup; +class QGraphicsView; +class QGridLayout; +class QToolBox; + +class QtpMain : public QMainWindow +{ + Q_OBJECT + +public: + QtpMain(); + + QtpDiag* diagram(); + + void registerComponent(QtpComp::CompInfo const& compInfo); + void unregisterComponents(); + +private slots: + void buttonGroupClicked(int id); + void compInserted(QtpComp* comp); + void about(); + +private: + void createToolBox(); + void createActions(); + void createMenus(); + + QWidget* createCellWidget(QtpComp::CompInfo compInfo); + + bool eventFilter(QObject* object, QEvent* event); + + QtpDiag* _diagram; + QGraphicsView* _view; + + QAction* _exitAction; + QAction* _deleteAction; + + QAction* _toFrontAction; + QAction* _sendBackAction; + QAction* _aboutAction; + + QMenu* _fileMenu; + QMenu* _compMenu; + QMenu* _aboutMenu; + + QToolBox* _toolBox; + QButtonGroup* _buttonGroup; + + QPointF _zoomDiagPos; + QPointF _zoomViewportPos; + + QWidget* _compWidget; + QList _comps; +}; + +#endif // QTPMAIN_H diff --git a/qtpatcher/include/QtpPin.h b/qtpatcher/include/QtpPin.h new file mode 100644 index 0000000..5588319 --- /dev/null +++ b/qtpatcher/include/QtpPin.h @@ -0,0 +1,79 @@ +/************************************************************************ +QtPatcher - Cross-Platform Circuit Drawing Library +Copyright (c) 2014-2015 Marcus Tomlinson + +This file is part of QtPatcher. + +GNU Lesser General Public License Usage +This file may be used under the terms of the GNU Lesser General Public +License version 3.0 as published by the Free Software Foundation and +appearing in the file LGPLv3.txt included in the packaging of this +file. Please review the following information to ensure the GNU Lesser +General Public License version 3.0 requirements will be met: +http://www.gnu.org/copyleft/lgpl.html. + +Other Usage +Alternatively, this file may be used in accordance with the terms and +conditions contained in a signed written agreement between you and +Marcus Tomlinson. + +DSPatch is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +************************************************************************/ + +#ifndef QTPPIN_H +#define QTPPIN_H + +#include +#include + +class QtpWire; + +class QtpPin : public QGraphicsPolygonItem +{ +public: + enum + { + Type = UserType + 2 + }; + + enum PinType + { + InPin, + OutPin + }; + + QtpPin(PinType pinType, QString pinName, int pinIndex, QGraphicsItem* parent = 0); + ~QtpPin(); + + std::string name(); + int index(); + int type() const; + + bool addWire(QtpWire* newWire); + void removeWire(QtpWire* wire); + void removeWires(); + + QList wires(); + + PinType pinType() const; + QPolygonF polygon() const; + + void hover(bool hover); + +protected: + QVariant itemChange(GraphicsItemChange change, const QVariant& value); + +private: + void setName(QString name); + +private: + PinType _pinType; + QPolygonF _polygon; + QList _wires; + QGraphicsTextItem* _nameText; + int _pinIndex; +}; + +#endif // QTPPIN_H diff --git a/qtpatcher/include/QtpWire.h b/qtpatcher/include/QtpWire.h new file mode 100644 index 0000000..58811ae --- /dev/null +++ b/qtpatcher/include/QtpWire.h @@ -0,0 +1,62 @@ +/************************************************************************ +QtPatcher - Cross-Platform Circuit Drawing Library +Copyright (c) 2014-2015 Marcus Tomlinson + +This file is part of QtPatcher. + +GNU Lesser General Public License Usage +This file may be used under the terms of the GNU Lesser General Public +License version 3.0 as published by the Free Software Foundation and +appearing in the file LGPLv3.txt included in the packaging of this +file. Please review the following information to ensure the GNU Lesser +General Public License version 3.0 requirements will be met: +http://www.gnu.org/copyleft/lgpl.html. + +Other Usage +Alternatively, this file may be used in accordance with the terms and +conditions contained in a signed written agreement between you and +Marcus Tomlinson. + +DSPatch is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +************************************************************************/ + +#ifndef QTPWIRE_H +#define QTPWIRE_H + +#include + +class QtpPin; + +class QtpWire : public QGraphicsLineItem +{ +public: + enum + { + Type = UserType + 3 + }; + + QtpWire(QtpPin* startPin, QtpPin* endPin, QGraphicsItem* parent = 0); + ~QtpWire(); + + int type() const; + + void setColor(const QColor& color); + + QtpPin* startPin() const; + QtpPin* endPin() const; + + void updatePosition(); + +protected: + void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0); + +private: + QtpPin* _startPin; + QtpPin* _endPin; + QColor _color; + QPolygonF _wireHead; +}; + +#endif // QTPWIRE_H diff --git a/qtpatcher/src/QtpComp.cpp b/qtpatcher/src/QtpComp.cpp new file mode 100644 index 0000000..c149bdd --- /dev/null +++ b/qtpatcher/src/QtpComp.cpp @@ -0,0 +1,223 @@ +/************************************************************************ +QtPatcher - Cross-Platform Circuit Drawing Library +Copyright (c) 2014-2015 Marcus Tomlinson + +This file is part of QtPatcher. + +GNU Lesser General Public License Usage +This file may be used under the terms of the GNU Lesser General Public +License version 3.0 as published by the Free Software Foundation and +appearing in the file LGPLv3.txt included in the packaging of this +file. Please review the following information to ensure the GNU Lesser +General Public License version 3.0 requirements will be met: +http://www.gnu.org/copyleft/lgpl.html. + +Other Usage +Alternatively, this file may be used in accordance with the terms and +conditions contained in a signed written agreement between you and +Marcus Tomlinson. + +DSPatch is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +************************************************************************/ + +#include +#include + +#include +#include +#include +#include +#include + +QtpComp::QtpComp(CompInfo const& compInfo, int id, QPointF const& position, QGraphicsItem* parent) + : QGraphicsPolygonItem(parent) +{ + setPos(position); + + _id = id; + _color = Qt::black; + _compInfo = compInfo; + _contextMenu = new QMenu(); + + _polygon << QPointF(-15, -15) << QPointF(15, -15) << QPointF(15, 15) << QPointF(-15, 15) << QPointF(-15, -15); + + _nameText = new QGraphicsTextItem(this); + + setName(compInfo.typeName); + foreach (QString const& pin, compInfo.inPins) + { + addInPin(pin); + } + foreach (QString const& pin, compInfo.outPins) + { + addOutPin(pin); + } + + setPolygon(_polygon); + + setFlag(QGraphicsItem::ItemIsMovable, true); + setFlag(QGraphicsItem::ItemIsSelectable, true); +} + +QtpComp::~QtpComp() +{ + delete _contextMenu; + removeInPins(); + removeOutPins(); +} + +int QtpComp::id() +{ + return _id; +} + +int QtpComp::type() const +{ + return Type; +} + +void QtpComp::setColor(const QColor& color) +{ + _color = color; + setBrush(_color); + + foreach (QtpPin* pin, _inPins) + { + pin->setBrush(_color); + } + + foreach (QtpPin* pin, _outPins) + { + pin->setBrush(_color); + } +} + +void QtpComp::addInPin(QString pinName) +{ + QtpPin* pin = new QtpPin(QtpPin::InPin, pinName, _inPins.size(), this); + pin->setPos(-21, 20 * _inPins.size()); + pin->setBrush(_color); + _inPins.push_back(pin); + + updatePolygon(); +} + +void QtpComp::addOutPin(QString pinName) +{ + QtpPin* pin = new QtpPin(QtpPin::OutPin, pinName, _outPins.size(), this); + pin->setPos(21, 20 * _outPins.size()); + pin->setBrush(_color); + _outPins.push_back(pin); + + updatePolygon(); +} + +void QtpComp::removeInPin() +{ + delete _inPins.back(); + _inPins.pop_back(); + + updatePolygon(); +} + +void QtpComp::removeOutPin() +{ + delete _outPins.back(); + _outPins.pop_back(); + + updatePolygon(); +} + +void QtpComp::removeInPins() +{ + foreach (QtpPin* pin, _inPins) + { + delete pin; + } + + _inPins.clear(); + + updatePolygon(); +} + +void QtpComp::removeOutPins() +{ + foreach (QtpPin* pin, _outPins) + { + delete pin; + } + + _outPins.clear(); + + updatePolygon(); +} + +QMenu* QtpComp::contextMenu() +{ + return _contextMenu; +} + +QPixmap QtpComp::image() const +{ + QPixmap pixmap(250, 250); + pixmap.fill(Qt::transparent); + QPainter painter(&pixmap); + painter.setPen(QPen(Qt::black, 1)); + + int pinsAfterFirst = std::max(_inPins.size(), _outPins.size()); + pinsAfterFirst = --pinsAfterFirst < 0 ? 0 : pinsAfterFirst; + + painter.translate(125, 125 - (10 * pinsAfterFirst)); + painter.drawPolyline(_polygon); + + painter.translate(-20, 0); + foreach (QtpPin* pin, _inPins) + { + painter.drawPolyline(pin->polygon()); + painter.translate(0, 20); + } + + painter.resetTransform(); + painter.translate(150, 125 - (10 * pinsAfterFirst)); + foreach (QtpPin* pin, _outPins) + { + painter.drawPolyline(pin->polygon()); + painter.translate(0, 20); + } + + return pixmap; +} + +QtpComp::CompInfo QtpComp::compInfo() const +{ + return _compInfo; +} + +void QtpComp::contextMenuEvent(QGraphicsSceneContextMenuEvent* event) +{ + if (_contextMenu->actions().size() != 0) + { + scene()->clearSelection(); + setSelected(true); + _contextMenu->exec(event->screenPos()); + } +} + +void QtpComp::setName(QString name) +{ + _nameText->setPlainText(name); + _nameText->setPos(-_nameText->boundingRect().width() / 2, -39); +} + +void QtpComp::updatePolygon() +{ + int pinsAfterFirst = std::max(_inPins.size(), _outPins.size()); + pinsAfterFirst = --pinsAfterFirst < 0 ? 0 : pinsAfterFirst; + + _polygon.replace(2, QPointF(15, 15 + (20 * pinsAfterFirst))); + _polygon.replace(3, QPointF(-15, 15 + (20 * pinsAfterFirst))); + + setPolygon(_polygon); +} diff --git a/qtpatcher/src/QtpDiag.cpp b/qtpatcher/src/QtpDiag.cpp new file mode 100644 index 0000000..b62c582 --- /dev/null +++ b/qtpatcher/src/QtpDiag.cpp @@ -0,0 +1,303 @@ +/************************************************************************ +QtPatcher - Cross-Platform Circuit Drawing Library +Copyright (c) 2014-2015 Marcus Tomlinson + +This file is part of QtPatcher. + +GNU Lesser General Public License Usage +This file may be used under the terms of the GNU Lesser General Public +License version 3.0 as published by the Free Software Foundation and +appearing in the file LGPLv3.txt included in the packaging of this +file. Please review the following information to ensure the GNU Lesser +General Public License version 3.0 requirements will be met: +http://www.gnu.org/copyleft/lgpl.html. + +Other Usage +Alternatively, this file may be used in accordance with the terms and +conditions contained in a signed written agreement between you and +Marcus Tomlinson. + +DSPatch is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +************************************************************************/ + +#include +#include +#include + +#include +#include + +QtpDiag::QtpDiag(QObject* parent) + : QGraphicsScene(parent) +{ + _compId = 0; + _mode = MoveComp; + _nextComp = QtpComp::CompInfo(); + _line = 0; + _compColor = Qt::white; + _lineColor = Qt::black; + _pinHovered = 0; +} + +void QtpDiag::setLineColor(const QColor& color) +{ + _lineColor = color; + if (isItemChange(QtpWire::Type)) + { + QtpWire* wire = qgraphicsitem_cast(selectedItems().first()); + wire->setColor(_lineColor); + update(); + } +} + +void QtpDiag::setCompColor(const QColor& color) +{ + _compColor = color; + if (isItemChange(QtpComp::Type)) + { + QtpComp* comp = qgraphicsitem_cast(selectedItems().first()); + comp->setBrush(_compColor); + } +} + +QColor QtpDiag::compColor() const +{ + return _compColor; +} + +QColor QtpDiag::lineColor() const +{ + return _lineColor; +} + +void QtpDiag::setMode(Mode mode) +{ + _mode = mode; +} + +void QtpDiag::setNextComp(QtpComp::CompInfo const& compInfo) +{ + _nextComp = compInfo; +} + +void QtpDiag::bringToFront() +{ + if (selectedItems().isEmpty()) + { + return; + } + + QGraphicsItem* selectedItem = selectedItems().first(); + QList overlapItems = selectedItem->collidingItems(); + + qreal zValue = 0; + foreach (QGraphicsItem* item, overlapItems) + { + if (item->zValue() >= zValue) + { + zValue = item->zValue() + 0.1; + } + } + + selectedItem->setZValue(zValue); +} + +void QtpDiag::sendToBack() +{ + if (selectedItems().isEmpty()) + { + return; + } + + QGraphicsItem* selectedItem = selectedItems().first(); + QList overlapItems = selectedItem->collidingItems(); + + qreal zValue = 0; + foreach (QGraphicsItem* item, overlapItems) + { + if (item->zValue() <= zValue) + { + zValue = item->zValue() - 0.1; + } + } + + selectedItem->setZValue(zValue); +} + +void QtpDiag::deleteItem() +{ + // remove wires first as they can be deleted with pins, + // hence leaving invalid wire pointers behind + foreach (QGraphicsItem* item, selectedItems()) + { + if (item->type() == QtpWire::Type) + { + QtpWire* wire = qgraphicsitem_cast(item); + emit wireDisconnected(qgraphicsitem_cast(wire->startPin()->parentItem())->id(), + wire->startPin()->index(), + qgraphicsitem_cast(wire->endPin()->parentItem())->id(), + wire->endPin()->index()); + delete item; + } + } + + foreach (QGraphicsItem* item, selectedItems()) + { + emit compRemoved(qgraphicsitem_cast(item)->id()); + delete item; + } +} + +void QtpDiag::mousePressEvent(QGraphicsSceneMouseEvent* mouseEvent) +{ + if (mouseEvent->button() != Qt::LeftButton) + { + return; + } + + QList startItems = items(mouseEvent->scenePos()); + + if (_mode == InsertComp) + { + QtpComp* comp = new QtpComp(_nextComp, _compId++, mouseEvent->scenePos()); + + comp->setColor(_compColor); + addItem(comp); + + emit compInserted(comp); + } + else if (startItems.count() && startItems.first()->type() == QtpPin::Type) + { + _mode = InsertLine; + _line = new QGraphicsLineItem(QLineF(mouseEvent->scenePos(), mouseEvent->scenePos())); + _line->setPen(QPen(_lineColor, 2)); + addItem(_line); + } + else if (startItems.count() == 0) + { + views()[0]->setDragMode(QGraphicsView::ScrollHandDrag); + } + else + { + _mode = MoveComp; + } + + QGraphicsScene::mousePressEvent(mouseEvent); +} + +void QtpDiag::mouseMoveEvent(QGraphicsSceneMouseEvent* mouseEvent) +{ + if (_mode == InsertLine && _line != 0) + { + QLineF newLine(_line->line().p1(), mouseEvent->scenePos()); + _line->setLine(newLine); + } + + // clear _pinHovered + if (_pinHovered) + { + _pinHovered->hover(false); + _pinHovered = 0; + } + + // update _pinHovered + QList hoverItems = items(mouseEvent->scenePos()); + if (hoverItems.count() && hoverItems.first() == _line) + { + hoverItems.removeFirst(); + } + if (hoverItems.count() && hoverItems.first()->type() == QtpPin::Type) + { + QtpPin* pin = qgraphicsitem_cast(hoverItems.first()); + pin->hover(true); + _pinHovered = pin; + } + + QGraphicsScene::mouseMoveEvent(mouseEvent); +} + +void QtpDiag::mouseReleaseEvent(QGraphicsSceneMouseEvent* mouseEvent) +{ + views()[0]->setDragMode(QGraphicsView::NoDrag); + + if (_line != 0 && _mode == InsertLine) + { + QList startItems = items(_line->line().p1()); + if (startItems.count() && startItems.first() == _line) + { + startItems.removeFirst(); + } + QList endItems = items(_line->line().p2()); + if (endItems.count() && endItems.first() == _line) + { + endItems.removeFirst(); + } + + removeItem(_line); + delete _line; + + if (startItems.count() && endItems.count() && startItems.first()->type() == QtpPin::Type && + endItems.first()->type() == QtpPin::Type && startItems.first() != endItems.first()) + { + QtpPin* startPin = qgraphicsitem_cast(startItems.first()); + QtpPin* endPin = qgraphicsitem_cast(endItems.first()); + + if (startPin->pinType() != endPin->pinType()) + { + if (startPin->pinType() == QtpPin::InPin && endPin->pinType() == QtpPin::OutPin) + { + std::swap(startPin, endPin); + } + + QtpWire* newWire = new QtpWire(startPin, endPin); + if (startPin->addWire(newWire)) + { + foreach (QtpWire* wire, endPin->wires()) + { + emit wireDisconnected(qgraphicsitem_cast(wire->startPin()->parentItem())->id(), + wire->startPin()->index(), + qgraphicsitem_cast(wire->endPin()->parentItem())->id(), + wire->endPin()->index()); + delete wire; + } + endPin->removeWires(); + + endPin->addWire(newWire); + + newWire->setColor(_lineColor); + newWire->setZValue(1000.0); + newWire->updatePosition(); + + addItem(newWire); + + emit wireConnected(qgraphicsitem_cast(startPin->parentItem())->id(), + startPin->index(), + qgraphicsitem_cast(endPin->parentItem())->id(), + endPin->index()); + } + else + { + delete newWire; + } + } + } + } + _line = 0; + _mode = MoveComp; + QGraphicsScene::mouseReleaseEvent(mouseEvent); +} + +bool QtpDiag::isItemChange(int type) +{ + foreach (QGraphicsItem* item, selectedItems()) + { + if (item->type() == type) + { + return true; + } + } + + return false; +} diff --git a/qtpatcher/src/QtpMain.cpp b/qtpatcher/src/QtpMain.cpp new file mode 100644 index 0000000..2389485 --- /dev/null +++ b/qtpatcher/src/QtpMain.cpp @@ -0,0 +1,255 @@ +/************************************************************************ +QtPatcher - Cross-Platform Circuit Drawing Library +Copyright (c) 2014-2015 Marcus Tomlinson + +This file is part of QtPatcher. + +GNU Lesser General Public License Usage +This file may be used under the terms of the GNU Lesser General Public +License version 3.0 as published by the Free Software Foundation and +appearing in the file LGPLv3.txt included in the packaging of this +file. Please review the following information to ensure the GNU Lesser +General Public License version 3.0 requirements will be met: +http://www.gnu.org/copyleft/lgpl.html. + +Other Usage +Alternatively, this file may be used in accordance with the terms and +conditions contained in a signed written agreement between you and +Marcus Tomlinson. + +DSPatch is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +************************************************************************/ + +#include +#include + +#include + +QtpMain::QtpMain() +{ + Q_INIT_RESOURCE(QtpRes); + + createActions(); + createToolBox(); + createMenus(); + + _diagram = new QtpDiag(this); + _diagram->setSceneRect(QRectF(0, 0, 5000, 5000)); + connect(_diagram, &QtpDiag::compInserted, this, &QtpMain::compInserted); + + connect(_toFrontAction, SIGNAL(triggered()), _diagram, SLOT(bringToFront())); + connect(_sendBackAction, SIGNAL(triggered()), _diagram, SLOT(sendToBack())); + connect(_deleteAction, SIGNAL(triggered()), _diagram, SLOT(deleteItem())); + + _view = new QGraphicsView(_diagram); + _view->viewport()->installEventFilter(this); + _view->setMouseTracking(true); + + QHBoxLayout* layout = new QHBoxLayout; + layout->addWidget(_toolBox); + layout->addWidget(_view); + + QWidget* widget = new QWidget; + widget->setLayout(layout); + + setGeometry(100, 100, 800, 500); + setCentralWidget(widget); + setWindowTitle(tr("DSPatcher")); + setUnifiedTitleAndToolBarOnMac(true); +} + +QtpDiag* QtpMain::diagram() +{ + return _diagram; +} + +void QtpMain::registerComponent(QtpComp::CompInfo const& compInfo) +{ + _compWidget->layout()->addWidget(createCellWidget(compInfo)); + + _toolBox->deleteLater(); + _toolBox = new QToolBox; + _toolBox->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Ignored); + _toolBox->addItem(_compWidget, tr("Components")); + + centralWidget()->layout()->removeWidget(_view); + centralWidget()->layout()->addWidget(_toolBox); + centralWidget()->layout()->addWidget(_view); +} + +void QtpMain::unregisterComponents() +{ + _buttonGroup->deleteLater(); + _compWidget->deleteLater(); + _toolBox->deleteLater(); + + createToolBox(); + + centralWidget()->layout()->removeWidget(_view); + centralWidget()->layout()->addWidget(_toolBox); + centralWidget()->layout()->addWidget(_view); +} + +void QtpMain::buttonGroupClicked(int id) +{ + QList buttons = _buttonGroup->buttons(); + foreach (QAbstractButton* button, buttons) + { + if (_buttonGroup->button(id) != button) + { + button->setChecked(false); + } + } + + _diagram->setNextComp(_comps[id]); + _diagram->setMode(QtpDiag::InsertComp); +} + +void QtpMain::compInserted(QtpComp*) +{ + _diagram->setMode(QtpDiag::MoveComp); + + QList buttons = _buttonGroup->buttons(); + foreach (QAbstractButton* button, buttons) + { + button->setChecked(false); + } +} + +void QtpMain::about() +{ + QMessageBox::about(this, + tr("About DSPatcher"), + tr("DSPatcher is a graphical patching " + "tool for creating DSPatch circuits.")); +} + +void QtpMain::createToolBox() +{ + _buttonGroup = new QButtonGroup(this); + _buttonGroup->setExclusive(false); + connect(_buttonGroup, SIGNAL(buttonClicked(int)), this, SLOT(buttonGroupClicked(int))); + + QGridLayout* compLayout = new QGridLayout; + compLayout->setColumnStretch(1, 1); + compLayout->setRowStretch(1000, 1); + + _compWidget = new QWidget; + _compWidget->setLayout(compLayout); + + _toolBox = new QToolBox; + _toolBox->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Ignored); + _toolBox->addItem(_compWidget, tr("Components")); +} + +void QtpMain::createActions() +{ + _toFrontAction = new QAction(QIcon(":/bringtofront.png"), tr("Bring to &Front"), this); + _toFrontAction->setShortcut(tr("Ctrl+F")); + _toFrontAction->setStatusTip(tr("Bring component to front")); + addAction(_toFrontAction); + + _sendBackAction = new QAction(QIcon(":/sendtoback.png"), tr("Send to &Back"), this); + _sendBackAction->setShortcut(tr("Ctrl+B")); + _sendBackAction->setStatusTip(tr("Send component to back")); + addAction(_sendBackAction); + + _deleteAction = new QAction(QIcon(":/delete.png"), tr("&Delete"), this); + QList deleteKeys; + deleteKeys.append(tr("Delete")); + deleteKeys.append(tr("Backspace")); + _deleteAction->setShortcuts(deleteKeys); + _deleteAction->setStatusTip(tr("Delete component from diagram")); + addAction(_deleteAction); + + _exitAction = new QAction(tr("E&xit"), this); + _exitAction->setShortcuts(QKeySequence::Quit); + _exitAction->setStatusTip(tr("Quit DSPatcher")); + addAction(_exitAction); + connect(_exitAction, SIGNAL(triggered()), this, SLOT(close())); + + _aboutAction = new QAction(tr("Ab&out"), this); + _aboutAction->setShortcut(tr("Ctrl+O")); + addAction(_aboutAction); + connect(_aboutAction, SIGNAL(triggered()), this, SLOT(about())); +} + +void QtpMain::createMenus() +{ + _fileMenu = menuBar()->addMenu(tr("&File")); + _fileMenu->addAction(_exitAction); + + _compMenu = menuBar()->addMenu(tr("&Component")); + _compMenu->addAction(_deleteAction); + _compMenu->addSeparator(); + _compMenu->addAction(_toFrontAction); + _compMenu->addAction(_sendBackAction); + + _aboutMenu = menuBar()->addMenu(tr("&Help")); + _aboutMenu->addAction(_aboutAction); +} + +QWidget* QtpMain::createCellWidget(QtpComp::CompInfo compInfo) +{ + QtpComp comp(compInfo, 0, QPointF()); + QIcon icon(comp.image()); + + QToolButton* button = new QToolButton; + button->setIcon(icon); + button->setIconSize(QSize(50, 50)); + button->setCheckable(true); + _comps.append(compInfo); + _buttonGroup->addButton(button, _comps.size() - 1); + + QGridLayout* layout = new QGridLayout; + layout->addWidget(button, 0, 0, Qt::AlignHCenter); + layout->addWidget(new QLabel(compInfo.typeName), 1, 0, Qt::AlignCenter); + + QWidget* widget = new QWidget; + widget->setLayout(layout); + + return widget; +} + +bool QtpMain::eventFilter(QObject*, QEvent* event) +{ + if (event->type() == QEvent::Wheel && QApplication::keyboardModifiers() == Qt::ControlModifier) + { + QWheelEvent* wheelEvent = static_cast(event); + if (wheelEvent->orientation() == Qt::Vertical) + { + double angle = wheelEvent->angleDelta().y(); + double factor = qPow(1.0015, angle); + + _view->scale(factor, factor); + _view->centerOn(_zoomDiagPos); + + QPointF deltaViewportPos = + _zoomViewportPos - QPointF(_view->viewport()->width() / 2.0, _view->viewport()->height() / 2.0); + QPointF viewportCenter = _view->mapFromScene(_zoomDiagPos) - deltaViewportPos; + + _view->centerOn(_view->mapToScene(viewportCenter.toPoint())); + } + + return true; + } + else if (event->type() == QEvent::MouseMove || event->type() == QEvent::Wheel) + { + QPoint mousePos; + if (event->type() == QEvent::MouseMove) + { + mousePos = static_cast(event)->pos(); + } + else if (event->type() == QEvent::Wheel) + { + mousePos = static_cast(event)->pos(); + } + + _zoomViewportPos = mousePos; + _zoomDiagPos = _view->mapToScene(mousePos); + } + + return false; +} diff --git a/qtpatcher/src/QtpPin.cpp b/qtpatcher/src/QtpPin.cpp new file mode 100644 index 0000000..825d407 --- /dev/null +++ b/qtpatcher/src/QtpPin.cpp @@ -0,0 +1,155 @@ +/************************************************************************ +QtPatcher - Cross-Platform Circuit Drawing Library +Copyright (c) 2014-2015 Marcus Tomlinson + +This file is part of QtPatcher. + +GNU Lesser General Public License Usage +This file may be used under the terms of the GNU Lesser General Public +License version 3.0 as published by the Free Software Foundation and +appearing in the file LGPLv3.txt included in the packaging of this +file. Please review the following information to ensure the GNU Lesser +General Public License version 3.0 requirements will be met: +http://www.gnu.org/copyleft/lgpl.html. + +Other Usage +Alternatively, this file may be used in accordance with the terms and +conditions contained in a signed written agreement between you and +Marcus Tomlinson. + +DSPatch is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +************************************************************************/ + +#include +#include + +#include +#include + +QtpPin::QtpPin(PinType pinType, QString pinName, int pinIndex, QGraphicsItem* parent) + : QGraphicsPolygonItem(parent) + , _pinIndex(pinIndex) +{ + _pinType = pinType; + + _polygon << QPointF(-6, 5) << QPointF(6, 5) << QPointF(6, -5) << QPointF(-6, -5) << QPointF(-6, 5); + + _nameText = new QGraphicsTextItem(this); + _nameText->setOpacity(0.08); + + setName(pinName); + setPolygon(_polygon); +} + +QtpPin::~QtpPin() +{ + // delete wires attached to pin when pin is deleted + foreach (QtpWire* wire, _wires) + { + delete wire; + } + + removeWires(); +} + +std::string QtpPin::name() +{ + return _nameText->toPlainText().toUtf8().constData(); +} + +int QtpPin::index() +{ + return _pinIndex; +} + +int QtpPin::type() const +{ + return Type; +} + +bool QtpPin::addWire(QtpWire* newWire) +{ + foreach (QtpWire* wire, _wires) + { + if ((_pinType == InPin && wire->startPin() == newWire->startPin()) || + (_pinType == OutPin && wire->endPin() == newWire->endPin())) + { + // wire already exists + return false; + } + } + + _wires.append(newWire); + return true; +} + +void QtpPin::removeWire(QtpWire* wire) +{ + int index = _wires.indexOf(wire); + + if (index != -1) + { + _wires.removeAt(index); + } +} + +void QtpPin::removeWires() +{ + _wires.clear(); +} + +QList QtpPin::wires() +{ + return _wires; +} + +QtpPin::PinType QtpPin::pinType() const +{ + return _pinType; +} + +QPolygonF QtpPin::polygon() const +{ + return _polygon; +} + +void QtpPin::hover(bool hover) +{ + if (hover) + { + _nameText->setOpacity(1.0); + } + else + { + _nameText->setOpacity(0.08); + } +} + +QVariant QtpPin::itemChange(GraphicsItemChange change, const QVariant& value) +{ + if (change == QGraphicsItem::ItemPositionChange) + { + foreach (QtpWire* wire, _wires) + { + wire->updatePosition(); + } + } + + return value; +} + +void QtpPin::setName(QString name) +{ + _nameText->setPlainText(name); + + if (_pinType == InPin) + { + _nameText->setPos(-_nameText->boundingRect().width() - 7, -13); + } + else + { + _nameText->setPos(7, -13); + } +} diff --git a/qtpatcher/src/QtpWire.cpp b/qtpatcher/src/QtpWire.cpp new file mode 100644 index 0000000..e0b9d3d --- /dev/null +++ b/qtpatcher/src/QtpWire.cpp @@ -0,0 +1,150 @@ +/************************************************************************ +QtPatcher - Cross-Platform Circuit Drawing Library +Copyright (c) 2014-2015 Marcus Tomlinson + +This file is part of QtPatcher. + +GNU Lesser General Public License Usage +This file may be used under the terms of the GNU Lesser General Public +License version 3.0 as published by the Free Software Foundation and +appearing in the file LGPLv3.txt included in the packaging of this +file. Please review the following information to ensure the GNU Lesser +General Public License version 3.0 requirements will be met: +http://www.gnu.org/copyleft/lgpl.html. + +Other Usage +Alternatively, this file may be used in accordance with the terms and +conditions contained in a signed written agreement between you and +Marcus Tomlinson. + +DSPatch is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +************************************************************************/ + +#include +#include + +#include +#include + +#include + +const qreal Pi = 3.14; + +QtpWire::QtpWire(QtpPin* startPin, QtpPin* endPin, QGraphicsItem* parent) + : QGraphicsLineItem(parent) +{ + _startPin = startPin; + _endPin = endPin; + setFlag(QGraphicsItem::ItemIsSelectable, true); + _color = Qt::black; + setPen(QPen(_color, 2, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)); +} + +QtpWire::~QtpWire() +{ + _startPin->removeWire(this); + _endPin->removeWire(this); +} + +int QtpWire::type() const +{ + return Type; +} + +void QtpWire::setColor(const QColor& color) +{ + _color = color; +} + +QtpPin* QtpWire::startPin() const +{ + return _startPin; +} + +QtpPin* QtpWire::endPin() const +{ + return _endPin; +} + +void QtpWire::updatePosition() +{ + QLineF line(mapFromItem(_startPin, 0, 0), mapFromItem(_endPin, 0, 0)); + setLine(line); +} + +void QtpWire::paint(QPainter* painter, const QStyleOptionGraphicsItem*, QWidget*) +{ + if (_startPin->collidesWithItem(_endPin)) + { + return; + } + + QPen wirePen = pen(); + wirePen.setColor(_color); + qreal wireHeadSize = 7; + painter->setPen(wirePen); + painter->setBrush(_color); + + QLineF centerLine(mapFromItem(_startPin, 0, 0), mapFromItem(_endPin, 0, 0)); + + QLineF polyLine; + QPointF p2; + + QPointF startIntersect; + QPolygonF startPolygon = _startPin->polygon(); + QPointF p1 = startPolygon.first() + mapFromItem(_startPin, 0, 0); + for (int i = 1; i < startPolygon.count(); ++i) + { + p2 = startPolygon.at(i) + mapFromItem(_startPin, 0, 0); + polyLine = QLineF(p1, p2); + QLineF::IntersectType intersectType = polyLine.intersect(centerLine, &startIntersect); + if (intersectType == QLineF::BoundedIntersection) + { + break; + } + p1 = p2; + } + + QPointF endIntersect; + QPolygonF endPolygon = _endPin->polygon(); + p1 = endPolygon.first() + mapFromItem(_endPin, 0, 0); + for (int i = 1; i < endPolygon.count(); ++i) + { + p2 = endPolygon.at(i) + mapFromItem(_endPin, 0, 0); + polyLine = QLineF(p1, p2); + QLineF::IntersectType intersectType = polyLine.intersect(centerLine, &endIntersect); + if (intersectType == QLineF::BoundedIntersection) + { + break; + } + p1 = p2; + } + + setLine(QLineF(endIntersect, startIntersect)); + + double angle = acos(line().dx() / line().length()); + if (line().dy() >= 0) + { + angle = (Pi * 2) - angle; + } + + QPointF wireP1 = line().p1() + QPointF(sin(angle + Pi / 3) * wireHeadSize, cos(angle + Pi / 3) * wireHeadSize); + QPointF wireP2 = + line().p1() + QPointF(sin(angle + Pi - Pi / 3) * wireHeadSize, cos(angle + Pi - Pi / 3) * wireHeadSize); + + _wireHead.clear(); + _wireHead << line().p1() << wireP1 << wireP2; + painter->drawLine(line()); + painter->drawPolygon(_wireHead); + if (isSelected()) + { + painter->setPen(QPen(_color, 1, Qt::DashLine)); + QLineF wireLine = line(); + wireLine.translate(0, 4.0); + painter->drawLine(wireLine); + wireLine.translate(0, -8.0); + painter->drawLine(wireLine); + } +} From 30ee075c9e0b6a761a4ade6924ec912fc167cb35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Rozie=CC=80re?= Date: Mon, 5 Mar 2018 23:49:36 +0100 Subject: [PATCH 09/12] Add qt UI --- CMakeLists.txt.user | 652 ++++++++++++++++++ .../Adder/OrchAdderComponent.cpp | 2 +- .../Adder/OrchAdderComponent.h | 12 + OrchestraComponents/CMakeLists.txt | 3 +- OrchestraComponents/Gain/CMakeLists.txt | 17 + .../Gain/OrchGainComponent.cpp | 42 ++ OrchestraComponents/Gain/OrchGainComponent.h | 56 ++ .../MqttSource/OrchMqttSourceComponent.cpp | 68 +- .../MqttSource/OrchMqttSourceComponent.h | 48 +- .../OrchStreamReaderComponent.cpp | 2 - .../StreamReader/OrchStreamReaderComponent.h | 12 + .../OrchStreamWriterComponent.cpp | 1 - .../StreamWriter/OrchStreamWriterComponent.h | 13 + OrchestraCore/src/Orchestrator.cpp | 9 +- OrchestraGUI/CMakeLists.txt | 2 +- 15 files changed, 915 insertions(+), 24 deletions(-) create mode 100644 CMakeLists.txt.user create mode 100644 OrchestraComponents/Gain/CMakeLists.txt create mode 100644 OrchestraComponents/Gain/OrchGainComponent.cpp create mode 100644 OrchestraComponents/Gain/OrchGainComponent.h diff --git a/CMakeLists.txt.user b/CMakeLists.txt.user new file mode 100644 index 0000000..24fb81a --- /dev/null +++ b/CMakeLists.txt.user @@ -0,0 +1,652 @@ + + + + + + EnvironmentId + {3a4100af-7080-4fa0-a06a-90e52f26359c} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + true + false + 0 + true + true + 0 + 8 + true + 1 + true + true + true + false + + + + ProjectExplorer.Project.PluginSettings + + + + ProjectExplorer.Project.Target.0 + + Desktop Qt 5.10.1 clang 64bit + Desktop Qt 5.10.1 clang 64bit + qt.qt5.5101.clang_64_kit + 1 + 0 + 0 + + + /Users/benjamin/build-orchestra-Desktop_Qt_5_10_1_clang_64bit-Du00e9faut + + + + + all + + true + CMake Build + + CMakeProjectManager.MakeStep + + 1 + Compiler + + ProjectExplorer.BuildSteps.Build + + + + + + clean + + true + CMake Build + + CMakeProjectManager.MakeStep + + 1 + Nettoyer + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Défaut + Défaut + CMakeProjectManager.CMakeBuildConfiguration + + + + CMAKE_BUILD_TYPE:STRING=Debug + + /Users/benjamin/build-orchestra-Desktop_Qt_5_10_1_clang_64bit-Debug + + + + + all + + true + CMake Build + + CMakeProjectManager.MakeStep + + 1 + Compiler + + ProjectExplorer.BuildSteps.Build + + + + + + clean + + true + CMake Build + + CMakeProjectManager.MakeStep + + 1 + Nettoyer + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Debug + CMakeProjectManager.CMakeBuildConfiguration + + + + CMAKE_BUILD_TYPE:STRING=Release + + /Users/benjamin/build-orchestra-Desktop_Qt_5_10_1_clang_64bit-Release + + + + + all + + true + CMake Build + + CMakeProjectManager.MakeStep + + 1 + Compiler + + ProjectExplorer.BuildSteps.Build + + + + + + clean + + true + CMake Build + + CMakeProjectManager.MakeStep + + 1 + Nettoyer + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Release + CMakeProjectManager.CMakeBuildConfiguration + + + + CMAKE_BUILD_TYPE:STRING=RelWithDebInfo + + /Users/benjamin/build-orchestra-Desktop_Qt_5_10_1_clang_64bit-Release with Debug Information + + + + + all + + true + CMake Build + + CMakeProjectManager.MakeStep + + 1 + Compiler + + ProjectExplorer.BuildSteps.Build + + + + + + clean + + true + CMake Build + + CMakeProjectManager.MakeStep + + 1 + Nettoyer + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release with Debug Information + Release with Debug Information + CMakeProjectManager.CMakeBuildConfiguration + + + + CMAKE_BUILD_TYPE:STRING=MinSizeRel + + /Users/benjamin/build-orchestra-Desktop_Qt_5_10_1_clang_64bit-Minimum Size Release + + + + + all + + true + CMake Build + + CMakeProjectManager.MakeStep + + 1 + Compiler + + ProjectExplorer.BuildSteps.Build + + + + + + clean + + true + CMake Build + + CMakeProjectManager.MakeStep + + 1 + Nettoyer + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Minimum Size Release + Minimum Size Release + CMakeProjectManager.CMakeBuildConfiguration + + 5 + + + 0 + Déploiement + + ProjectExplorer.BuildSteps.Deploy + + 1 + Déployer localement + + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + OrchestraGUI + + + /Users/benjamin/build-orchestra-Desktop_Qt_5_10_1_clang_64bit-Debug/OrchestraGUI + 2 + + OrchestraGUI + + CMakeProjectManager.CMakeRunConfiguration.OrchestraGUI + 3768 + false + true + false + false + true + + + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + simulator + + + /Users/benjamin/build-orchestra-Desktop_Qt_5_10_1_clang_64bit-Debug/OrchestraSimulator + 2 + + simulator + + CMakeProjectManager.CMakeRunConfiguration.simulator + 3768 + false + true + false + false + true + + + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + mosquitto_sub + + + /Users/benjamin/build-orchestra-Desktop_Qt_5_10_1_clang_64bit-Debug/mosquitto/client + 2 + + mosquitto_sub + + CMakeProjectManager.CMakeRunConfiguration.mosquitto_sub + 3768 + false + true + false + false + true + + + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + mosquitto_pub + + + /Users/benjamin/build-orchestra-Desktop_Qt_5_10_1_clang_64bit-Debug/mosquitto/client + 2 + + mosquitto_pub + + CMakeProjectManager.CMakeRunConfiguration.mosquitto_pub + 3768 + false + true + false + false + true + + + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + mosquitto_passwd + + + /Users/benjamin/build-orchestra-Desktop_Qt_5_10_1_clang_64bit-Debug/mosquitto/src + 2 + + mosquitto_passwd + + CMakeProjectManager.CMakeRunConfiguration.mosquitto_passwd + 3768 + false + true + false + false + true + + + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + mosquitto + + + /Users/benjamin/build-orchestra-Desktop_Qt_5_10_1_clang_64bit-Debug/mosquitto/src + 2 + + mosquitto + + CMakeProjectManager.CMakeRunConfiguration.mosquitto + 3768 + false + true + false + false + true + + 6 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 18 + + + Version + 18 + + diff --git a/OrchestraComponents/Adder/OrchAdderComponent.cpp b/OrchestraComponents/Adder/OrchAdderComponent.cpp index a991c47..5baee89 100644 --- a/OrchestraComponents/Adder/OrchAdderComponent.cpp +++ b/OrchestraComponents/Adder/OrchAdderComponent.cpp @@ -20,4 +20,4 @@ void OrchAdderComponent::Process_(DspSignalBus &inputs, DspSignalBus &outputs) { outputs.SetValue("Output1", input1 + input2); } -} +} \ No newline at end of file diff --git a/OrchestraComponents/Adder/OrchAdderComponent.h b/OrchestraComponents/Adder/OrchAdderComponent.h index a3b011f..a1c1acb 100644 --- a/OrchestraComponents/Adder/OrchAdderComponent.h +++ b/OrchestraComponents/Adder/OrchAdderComponent.h @@ -18,5 +18,17 @@ class OrchAdderComponent : public DspComponent { void Process_(DspSignalBus &, DspSignalBus &) override; }; +class OrchAdderPlugin : public DspPlugin { + + std::map GetCreateParams() const { + return std::map(); + } + + DspComponent *Create(std::map ¶ms) const { + return new OrchAdderComponent(); + } +}; + +EXPORT_DSPPLUGIN(OrchAdderPlugin) #endif //ORCHESTRA_ORCHADDERCOMPONENT_H diff --git a/OrchestraComponents/CMakeLists.txt b/OrchestraComponents/CMakeLists.txt index ef83d38..2da2ad4 100644 --- a/OrchestraComponents/CMakeLists.txt +++ b/OrchestraComponents/CMakeLists.txt @@ -4,4 +4,5 @@ add_subdirectory(Adder) add_subdirectory(MqttSource) add_subdirectory(StreamReader) add_subdirectory(StreamWriter) -add_subdirectory(Sum) \ No newline at end of file +add_subdirectory(Sum) +add_subdirectory(Gain) \ No newline at end of file diff --git a/OrchestraComponents/Gain/CMakeLists.txt b/OrchestraComponents/Gain/CMakeLists.txt new file mode 100644 index 0000000..b179ccb --- /dev/null +++ b/OrchestraComponents/Gain/CMakeLists.txt @@ -0,0 +1,17 @@ +project(Gain) + +file(GLOB srcs *.cpp) +file(GLOB hdrs *.h) + +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) + +add_library( + ${PROJECT_NAME} SHARED + ${srcs} + ${hdrs} +) + +target_link_libraries( + ${PROJECT_NAME} + DSPatch +) \ No newline at end of file diff --git a/OrchestraComponents/Gain/OrchGainComponent.cpp b/OrchestraComponents/Gain/OrchGainComponent.cpp new file mode 100644 index 0000000..0d51205 --- /dev/null +++ b/OrchestraComponents/Gain/OrchGainComponent.cpp @@ -0,0 +1,42 @@ +// +// Created by Benjamin Rozière on 05/03/2018. +// + +#include "OrchGainComponent.h" + +OrchGainComponent::OrchGainComponent(float _gain) { + AddInput_(); + AddOutput_(); + + _gain = AddParameter_("gain", DspParameter(DspParameter::Float, 1, std::make_pair(0, 10))); +} + +float OrchGainComponent::get_gain() const { + return *GetParameter_(_gain)->GetFloat(); +} + +void OrchGainComponent::set_gain(float gain) { + SetParameter_(_gain, DspParameter(DspParameter::Float, gain)); +} + +void OrchGainComponent::Process_(DspSignalBus &input, DspSignalBus &output) { + + if(!input.GetValue(0, _stream)) { + _stream.assign(_stream.size(), 0); + } + + for (size_t i = 0; i < _stream.size(); i++) { + _stream[i] *= get_gain(); + } + + output.SetValue(0, _stream); +} + +bool OrchGainComponent::ParameterUpdating_(int index, DspParameter const ¶meter) { + if (index == _gain) { + set_gain(*parameter.GetFloat()); + return true; + } + + return false; +} diff --git a/OrchestraComponents/Gain/OrchGainComponent.h b/OrchestraComponents/Gain/OrchGainComponent.h new file mode 100644 index 0000000..92f4d21 --- /dev/null +++ b/OrchestraComponents/Gain/OrchGainComponent.h @@ -0,0 +1,56 @@ +// +// Created by Benjamin Rozière on 05/03/2018. +// + +#ifndef ORCHESTRA_ORCHGAINCOMPONENT_H +#define ORCHESTRA_ORCHGAINCOMPONENT_H + + +#include +#include + +class OrchGainComponent : public DspComponent { +private: + int _gain; //Float container + std::vector _stream; + +public: + + OrchGainComponent(float _gain = 1); + + void set_gain(float _gain); + float get_gain() const; + +protected: + void Process_(DspSignalBus &bus, DspSignalBus &signalBus) override; + + bool ParameterUpdating_(int i, DspParameter const ¶meter) override; + +}; + +class OrchGainPlugin : public DspPlugin { + + std::map GetCreateParams() const { + std::map params; + + params["gain"] = DspParameter(DspParameter::Float, 1, std::make_pair(0, 10)); + return params; + + } + + DspComponent *Create(std::map ¶ms) const { + + float const* gain = params["gain"].GetFloat(); + + if (gain) { + return new OrchGainComponent(*gain); + } else { + return new OrchGainComponent(); + } + } +}; + + +EXPORT_DSPPLUGIN(OrchGainPlugin) + +#endif //ORCHESTRA_ORCHGAINCOMPONENT_H diff --git a/OrchestraComponents/MqttSource/OrchMqttSourceComponent.cpp b/OrchestraComponents/MqttSource/OrchMqttSourceComponent.cpp index 2048677..690b0c8 100644 --- a/OrchestraComponents/MqttSource/OrchMqttSourceComponent.cpp +++ b/OrchestraComponents/MqttSource/OrchMqttSourceComponent.cpp @@ -5,16 +5,21 @@ #include #include "OrchMqttSourceComponent.h" - -OrchMqttSourceComponent::OrchMqttSourceComponent(const char *topic, const char *host, int port) - : _host(host), _topic(topic), _port(port) { +OrchMqttSourceComponent::OrchMqttSourceComponent(const std::string topic, const std::string host, int port) { AddOutput_(); + _host = AddParameter_("host", DspParameter(DspParameter::String, host)); + _topic = AddParameter_("topic", DspParameter(DspParameter::String, topic)); + _port = AddParameter_("port", DspParameter(DspParameter::Int, port)); + mosqpp::lib_init(); - this->connect_async(_host.c_str(), _port); + this->connect_async(get_host().c_str(), get_port()); } +OrchMqttSourceComponent::OrchMqttSourceComponent(const std::string topic) : OrchMqttSourceComponent(topic, "localhost", mqttDefaultPort) {} + void OrchMqttSourceComponent::Process_(DspSignalBus &, DspSignalBus &out) { + if (!_started) { this->loop_start(); _started = true; @@ -26,14 +31,65 @@ void OrchMqttSourceComponent::Process_(DspSignalBus &, DspSignalBus &out) { } } +bool OrchMqttSourceComponent::ParameterUpdating_(int index, DspParameter const ¶m) { + if (index == _topic) { + set_topic(*param.GetString()); + return true; + } else if (index == _host) { + set_host(*param.GetString()); + return true; + } else if (index == _port) { + set_port(*param.GetInt()); + return true; + } + + return false; +} + OrchMqttSourceComponent::~OrchMqttSourceComponent() { this->disconnect(); this->loop_stop(); } +int OrchMqttSourceComponent::get_port() const { + return *GetParameter_(_port)->GetInt(); +} + +void OrchMqttSourceComponent::set_port(int port) { + SetParameter_(_port, DspParameter(DspParameter::Int, port)); + + this->disconnect(); + this->connect_async(get_host().c_str(), get_port()); +} + +const std::string OrchMqttSourceComponent::get_topic() const { + return *GetParameter_(_topic)->GetString(); +} + +void OrchMqttSourceComponent::set_topic(const std::string topic) { + std::string oldTopic = get_topic(); + + SetParameter_(_topic, DspParameter(DspParameter::String, topic)); + + this->unsubscribe(nullptr, oldTopic.c_str()); + this->subscribe(nullptr, get_topic().c_str()); +} + +const std::string OrchMqttSourceComponent::get_host() const { + return *GetParameter_(_host)->GetString(); +} + +void OrchMqttSourceComponent::set_host(const std::string host) { + SetParameter_(_host, DspParameter(DspParameter::String, host)); + + this->disconnect(); + this->connect_async(get_host().c_str(), get_port()); +} + +/* ========== MQTT Callbacks ===================================== */ void OrchMqttSourceComponent::on_connect(int i) { std::cout << "[MQTT]Connected !" << std::endl; - this->subscribe(nullptr, _topic.c_str()); + this->subscribe(nullptr, get_topic().c_str()); } void OrchMqttSourceComponent::on_disconnect(int i) { @@ -63,4 +119,4 @@ void OrchMqttSourceComponent::on_log(int i, const char *string) { void OrchMqttSourceComponent::on_error() { std::cerr << "Error in mqtt" << std::endl; -} +} \ No newline at end of file diff --git a/OrchestraComponents/MqttSource/OrchMqttSourceComponent.h b/OrchestraComponents/MqttSource/OrchMqttSourceComponent.h index 48c9825..451eb5f 100644 --- a/OrchestraComponents/MqttSource/OrchMqttSourceComponent.h +++ b/OrchestraComponents/MqttSource/OrchMqttSourceComponent.h @@ -10,6 +10,7 @@ #include #include +#include class OrchMqttSourceComponent : public DspComponent, public mosqpp::mosquittopp { @@ -17,10 +18,21 @@ class OrchMqttSourceComponent : public DspComponent, public mosqpp::mosquittopp public: static const int mqttDefaultPort = 1883; - explicit OrchMqttSourceComponent(const char *topic, const char *host="localhost", int port=mqttDefaultPort); + explicit OrchMqttSourceComponent(std::string topic); + + OrchMqttSourceComponent(std::string topic, std::string host, int port); virtual ~OrchMqttSourceComponent(); + int get_port() const; + void set_port(int port); + + const std::string get_topic() const; + void set_topic(std::string topic); + + const std::string get_host() const; + void set_host(std::string host); + /* API from mosquitto lib */ void on_connect(int i) override; @@ -41,15 +53,41 @@ class OrchMqttSourceComponent : public DspComponent, public mosqpp::mosquittopp protected: void Process_(DspSignalBus &bus, DspSignalBus &signalBus) override; + bool ParameterUpdating_(int i, DspParameter const ¶meter) override; + private: + int _topic; //std::string + int _host; //std::string + int _port; //int + bool _started = false; + std::queue _msgQueue; +}; - std::string _topic; - std::string _host; - int _port; +class OrchMqttSourcePlugin : public DspPlugin { - std::queue _msgQueue; + std::map GetCreateParams() const { + std::map params; + params["topic"] = DspParameter(DspParameter::String, "/topic"); + params["host"] = DspParameter(DspParameter::String, "localhost"); + params["port"] = DspParameter(DspParameter::Int, 1883); + + return params; + } + + DspComponent *Create(std::map ¶ms) const { + std::string const* topic = params["topic"].GetString(); + std::string const* host = params["host"].GetString(); + int const* port = params["port"].GetInt(); + + if(host || port) { + return new OrchMqttSourceComponent(*topic, *host, *port); + } else { + return new OrchMqttSourceComponent(*topic); + } + } }; +EXPORT_DSPPLUGIN(OrchMqttSourcePlugin) #endif //ORCHESTRA_ORCHMQTTSOURCECOMPONENT_H diff --git a/OrchestraComponents/StreamReader/OrchStreamReaderComponent.cpp b/OrchestraComponents/StreamReader/OrchStreamReaderComponent.cpp index 4514fd6..65e7374 100644 --- a/OrchestraComponents/StreamReader/OrchStreamReaderComponent.cpp +++ b/OrchestraComponents/StreamReader/OrchStreamReaderComponent.cpp @@ -17,5 +17,3 @@ void OrchStreamReaderComponent::Process_(DspSignalBus &, DspSignalBus &outputs) outputs.SetValue(0, std::stoi(token)); } - - diff --git a/OrchestraComponents/StreamReader/OrchStreamReaderComponent.h b/OrchestraComponents/StreamReader/OrchStreamReaderComponent.h index 13174ba..cb6de4f 100644 --- a/OrchestraComponents/StreamReader/OrchStreamReaderComponent.h +++ b/OrchestraComponents/StreamReader/OrchStreamReaderComponent.h @@ -20,5 +20,17 @@ class OrchStreamReaderComponent : public DspComponent { std::istream& inputStream; }; +class OrchStreamReaderPlugin : public DspPlugin { +public: + std::map GetCreateParams() const { + return std::map(); + } + + DspComponent *Create(std::map ¶ms) const { + return new OrchStreamReaderComponent(std::cin); + } +}; + +EXPORT_DSPPLUGIN(OrchStreamReaderPlugin) #endif //ORCHESTRA_ORCHSTREAMREADERCOMPONENT_H diff --git a/OrchestraComponents/StreamWriter/OrchStreamWriterComponent.cpp b/OrchestraComponents/StreamWriter/OrchStreamWriterComponent.cpp index da4b6f9..3b122ae 100644 --- a/OrchestraComponents/StreamWriter/OrchStreamWriterComponent.cpp +++ b/OrchestraComponents/StreamWriter/OrchStreamWriterComponent.cpp @@ -16,4 +16,3 @@ void OrchStreamWriterComponent::Process_(DspSignalBus &inputs, DspSignalBus &) { this->outputStream << val << std::endl; } } - diff --git a/OrchestraComponents/StreamWriter/OrchStreamWriterComponent.h b/OrchestraComponents/StreamWriter/OrchStreamWriterComponent.h index 0bb1df9..4f79aab 100644 --- a/OrchestraComponents/StreamWriter/OrchStreamWriterComponent.h +++ b/OrchestraComponents/StreamWriter/OrchStreamWriterComponent.h @@ -9,6 +9,7 @@ #include #include #include +#include class OrchStreamWriterComponent : public DspComponent { @@ -22,5 +23,17 @@ class OrchStreamWriterComponent : public DspComponent { std::ostream& outputStream; }; +class OrchStreamWriterPlugin : public DspPlugin { +public: + std::map GetCreateParams() const { + return std::map(); + } + + DspComponent *Create(std::map ¶ms) const { + return new OrchStreamWriterComponent(std::cout); + } +}; + +EXPORT_DSPPLUGIN(OrchStreamWriterPlugin) #endif //ORCHESTRA_ORCHSTREAMWRITERCOMPONENT_H diff --git a/OrchestraCore/src/Orchestrator.cpp b/OrchestraCore/src/Orchestrator.cpp index 7dc453c..4487e84 100644 --- a/OrchestraCore/src/Orchestrator.cpp +++ b/OrchestraCore/src/Orchestrator.cpp @@ -2,16 +2,13 @@ // Created by Benjamin Rozière on 04/03/2018. // -#include -#include - #include #include "Orchestrator.h" Orchestrator::Orchestrator(): _circuit(new DspCircuit()) { - auto writer = new OrchStreamWriterComponent(std::cout); + /*auto writer = new OrchStreamWriterComponent(std::cout); auto mqttCmp = new OrchMqttSourceComponent("/test"); @@ -19,7 +16,7 @@ Orchestrator::Orchestrator(): _circuit(new DspCircuit()) { _circuit->AddComponent(writer, "Writer"); - _circuit->ConnectOutToIn(mqttCmp, 0, writer, 0); + _circuit->ConnectOutToIn(mqttCmp, 0, writer, 0);*/ } void Orchestrator::start(void) { @@ -33,8 +30,6 @@ void Orchestrator::stop(void) { Orchestrator::~Orchestrator() { stop(); - DSPatch::Finalize(); - delete _circuit; _circuit = nullptr; } diff --git a/OrchestraGUI/CMakeLists.txt b/OrchestraGUI/CMakeLists.txt index 5b8ccf1..51f7127 100644 --- a/OrchestraGUI/CMakeLists.txt +++ b/OrchestraGUI/CMakeLists.txt @@ -6,7 +6,7 @@ include_directories(../qtpatcher/include) file(GLOB srcs src/*.cpp) file(GLOB hdrs include/*.h) -add_definitions(-DPLUGIN_DIR="${CMAKE_CURRENT_SOURCE_DIR}/components") +add_definitions(-DPLUGIN_DIR="components") add_executable( ${PROJECT_NAME} From 19a17dcf630bbe3a4a669eaa4c4721b5aa44ca42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Rozie=CC=80re?= Date: Tue, 6 Mar 2018 11:56:12 +0100 Subject: [PATCH 10/12] Add MIDI output as a plugin --- CMakeLists.txt.user | 652 ------------------ .../MidiOutput/OrchMidiOutputComponent.cpp | 6 +- .../MidiOutput/OrchMidiOutputComponent.h | 18 + .../OrchMidiTextToKeyComponent.h | 13 + 4 files changed, 36 insertions(+), 653 deletions(-) delete mode 100644 CMakeLists.txt.user diff --git a/CMakeLists.txt.user b/CMakeLists.txt.user deleted file mode 100644 index 24fb81a..0000000 --- a/CMakeLists.txt.user +++ /dev/null @@ -1,652 +0,0 @@ - - - - - - EnvironmentId - {3a4100af-7080-4fa0-a06a-90e52f26359c} - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - true - false - true - - Cpp - - CppGlobal - - - - QmlJS - - QmlJSGlobal - - - 2 - UTF-8 - false - 4 - false - 80 - true - true - 1 - true - false - 0 - true - true - 0 - 8 - true - 1 - true - true - true - false - - - - ProjectExplorer.Project.PluginSettings - - - - ProjectExplorer.Project.Target.0 - - Desktop Qt 5.10.1 clang 64bit - Desktop Qt 5.10.1 clang 64bit - qt.qt5.5101.clang_64_kit - 1 - 0 - 0 - - - /Users/benjamin/build-orchestra-Desktop_Qt_5_10_1_clang_64bit-Du00e9faut - - - - - all - - true - CMake Build - - CMakeProjectManager.MakeStep - - 1 - Compiler - - ProjectExplorer.BuildSteps.Build - - - - - - clean - - true - CMake Build - - CMakeProjectManager.MakeStep - - 1 - Nettoyer - - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Défaut - Défaut - CMakeProjectManager.CMakeBuildConfiguration - - - - CMAKE_BUILD_TYPE:STRING=Debug - - /Users/benjamin/build-orchestra-Desktop_Qt_5_10_1_clang_64bit-Debug - - - - - all - - true - CMake Build - - CMakeProjectManager.MakeStep - - 1 - Compiler - - ProjectExplorer.BuildSteps.Build - - - - - - clean - - true - CMake Build - - CMakeProjectManager.MakeStep - - 1 - Nettoyer - - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Debug - CMakeProjectManager.CMakeBuildConfiguration - - - - CMAKE_BUILD_TYPE:STRING=Release - - /Users/benjamin/build-orchestra-Desktop_Qt_5_10_1_clang_64bit-Release - - - - - all - - true - CMake Build - - CMakeProjectManager.MakeStep - - 1 - Compiler - - ProjectExplorer.BuildSteps.Build - - - - - - clean - - true - CMake Build - - CMakeProjectManager.MakeStep - - 1 - Nettoyer - - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Release - CMakeProjectManager.CMakeBuildConfiguration - - - - CMAKE_BUILD_TYPE:STRING=RelWithDebInfo - - /Users/benjamin/build-orchestra-Desktop_Qt_5_10_1_clang_64bit-Release with Debug Information - - - - - all - - true - CMake Build - - CMakeProjectManager.MakeStep - - 1 - Compiler - - ProjectExplorer.BuildSteps.Build - - - - - - clean - - true - CMake Build - - CMakeProjectManager.MakeStep - - 1 - Nettoyer - - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release with Debug Information - Release with Debug Information - CMakeProjectManager.CMakeBuildConfiguration - - - - CMAKE_BUILD_TYPE:STRING=MinSizeRel - - /Users/benjamin/build-orchestra-Desktop_Qt_5_10_1_clang_64bit-Minimum Size Release - - - - - all - - true - CMake Build - - CMakeProjectManager.MakeStep - - 1 - Compiler - - ProjectExplorer.BuildSteps.Build - - - - - - clean - - true - CMake Build - - CMakeProjectManager.MakeStep - - 1 - Nettoyer - - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Minimum Size Release - Minimum Size Release - CMakeProjectManager.CMakeBuildConfiguration - - 5 - - - 0 - Déploiement - - ProjectExplorer.BuildSteps.Deploy - - 1 - Déployer localement - - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - OrchestraGUI - - - /Users/benjamin/build-orchestra-Desktop_Qt_5_10_1_clang_64bit-Debug/OrchestraGUI - 2 - - OrchestraGUI - - CMakeProjectManager.CMakeRunConfiguration.OrchestraGUI - 3768 - false - true - false - false - true - - - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - simulator - - - /Users/benjamin/build-orchestra-Desktop_Qt_5_10_1_clang_64bit-Debug/OrchestraSimulator - 2 - - simulator - - CMakeProjectManager.CMakeRunConfiguration.simulator - 3768 - false - true - false - false - true - - - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - mosquitto_sub - - - /Users/benjamin/build-orchestra-Desktop_Qt_5_10_1_clang_64bit-Debug/mosquitto/client - 2 - - mosquitto_sub - - CMakeProjectManager.CMakeRunConfiguration.mosquitto_sub - 3768 - false - true - false - false - true - - - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - mosquitto_pub - - - /Users/benjamin/build-orchestra-Desktop_Qt_5_10_1_clang_64bit-Debug/mosquitto/client - 2 - - mosquitto_pub - - CMakeProjectManager.CMakeRunConfiguration.mosquitto_pub - 3768 - false - true - false - false - true - - - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - mosquitto_passwd - - - /Users/benjamin/build-orchestra-Desktop_Qt_5_10_1_clang_64bit-Debug/mosquitto/src - 2 - - mosquitto_passwd - - CMakeProjectManager.CMakeRunConfiguration.mosquitto_passwd - 3768 - false - true - false - false - true - - - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - mosquitto - - - /Users/benjamin/build-orchestra-Desktop_Qt_5_10_1_clang_64bit-Debug/mosquitto/src - 2 - - mosquitto - - CMakeProjectManager.CMakeRunConfiguration.mosquitto - 3768 - false - true - false - false - true - - 6 - - - - ProjectExplorer.Project.TargetCount - 1 - - - ProjectExplorer.Project.Updater.FileVersion - 18 - - - Version - 18 - - diff --git a/OrchestraComponents/MidiOutput/OrchMidiOutputComponent.cpp b/OrchestraComponents/MidiOutput/OrchMidiOutputComponent.cpp index 23d1b36..c3bd3fc 100644 --- a/OrchestraComponents/MidiOutput/OrchMidiOutputComponent.cpp +++ b/OrchestraComponents/MidiOutput/OrchMidiOutputComponent.cpp @@ -29,10 +29,14 @@ void OrchMidiOutputKeyComponent::Process_(DspSignalBus &input, DspSignalBus &) { if (input.GetValue(0, key)) { midiMessage.push_back(MidiCommand::NOTE_ON); midiMessage.push_back(key); - midiMessage.push_back(MidiKey::C1); + midiMessage.push_back(60); midiOut->sendMessage(&midiMessage); } } +OrchMidiOutputKeyComponent::~OrchMidiOutputKeyComponent() { + midiOut->closePort(); +} + diff --git a/OrchestraComponents/MidiOutput/OrchMidiOutputComponent.h b/OrchestraComponents/MidiOutput/OrchMidiOutputComponent.h index 0cf4a1a..7fefa81 100644 --- a/OrchestraComponents/MidiOutput/OrchMidiOutputComponent.h +++ b/OrchestraComponents/MidiOutput/OrchMidiOutputComponent.h @@ -7,17 +7,35 @@ #include #include +#include class OrchMidiOutputKeyComponent: public DspComponent { public: OrchMidiOutputKeyComponent(); + virtual ~OrchMidiOutputKeyComponent(); + protected: void Process_(DspSignalBus &bus, DspSignalBus &signalBus) override; private: RtMidiOut *midiOut; + + int _channel; + int _velocity; +}; + +class OrchMidiOutputKeyPlugin : public DspPlugin { +public: + std::map GetCreateParams() const { + return std::map(); + } + + DspComponent *Create(std::map ¶ms) const { + return new OrchMidiOutputKeyComponent(); + } }; +EXPORT_DSPPLUGIN(OrchMidiOutputKeyPlugin) #endif //ORCHESTRA_ORCHMIDIOUTPUTCOMPONENT_H diff --git a/OrchestraComponents/MidiTextToKey/OrchMidiTextToKeyComponent.h b/OrchestraComponents/MidiTextToKey/OrchMidiTextToKeyComponent.h index 743319f..a8f7612 100644 --- a/OrchestraComponents/MidiTextToKey/OrchMidiTextToKeyComponent.h +++ b/OrchestraComponents/MidiTextToKey/OrchMidiTextToKeyComponent.h @@ -9,6 +9,7 @@ #include #include #include +#include class OrchMidiTextToKeyComponent: public DspComponent { @@ -22,5 +23,17 @@ class OrchMidiTextToKeyComponent: public DspComponent { void Process_(DspSignalBus &bus, DspSignalBus &signalBus) override; }; +class OrchMidiTextToKeyPlugin : public DspPlugin { +public: + virtual std::map GetCreateParams() const { + return std::map(); + } + + virtual DspComponent *Create(std::map ¶ms) const { + return new OrchMidiTextToKeyComponent(); + } +}; + +EXPORT_DSPPLUGIN(OrchMidiTextToKeyPlugin) #endif //ORCHESTRA_ORCHMIDITEXTTOKEYCOMPONENT_H From 613e0be970d02a47bc2188536bbe53617af6cea0 Mon Sep 17 00:00:00 2001 From: Benjamin ROZIERE Date: Fri, 9 Mar 2018 08:36:07 +0100 Subject: [PATCH 11/12] Create README.md --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..d43e2ca --- /dev/null +++ b/README.md @@ -0,0 +1,8 @@ +# orchestrator +This file is part of the public2midi project. An academic project aiming to capture data from the public (in a live concert) +and transform it to music data. + +The orchestrator let you create a processing chain to transform data from sensors to MIDI data. + +This project is an early stage prototype. + From 74668d4c6dc1618d062c449b8333441b9d003ba8 Mon Sep 17 00:00:00 2001 From: Benjamin ROZIERE Date: Fri, 9 Mar 2018 08:40:16 +0100 Subject: [PATCH 12/12] Create LICENSE.txt --- LICENSE.txt | 674 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 674 insertions(+) create mode 100644 LICENSE.txt diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..f288702 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +.