WIP: add cmake and ndpi patch [skip ci]
This commit is contained in:
parent
e7e8bb1b86
commit
2394d7ea43
350
src/patches/cmake-ndpi.patch
Normal file
350
src/patches/cmake-ndpi.patch
Normal file
@ -0,0 +1,350 @@
|
||||
.gitignore | 73 +++++++++++++++++++++++++++++++++++++++++
|
||||
src/CMakeLists.txt | 96 ++++++++++++++++++++++++++++--------------------------
|
||||
src/fast_dpi.h | 5 ++-
|
||||
3 files changed, 126 insertions(+), 48 deletions(-)
|
||||
|
||||
diff --git a/.gitignore b/.gitignore
|
||||
index 7ea5909..e3d7fc8 100644
|
||||
--- a/.gitignore
|
||||
+++ b/.gitignore
|
||||
@@ -2,3 +2,76 @@
|
||||
__pycache__
|
||||
*.DS_Store
|
||||
src/build/
|
||||
+*.swp
|
||||
+
|
||||
+### CMake ###
|
||||
+CMakeLists.txt.user
|
||||
+CMakeCache.txt
|
||||
+CMakeFiles
|
||||
+CMakeScripts
|
||||
+Testing
|
||||
+Makefile
|
||||
+cmake_install.cmake
|
||||
+install_manifest.txt
|
||||
+compile_commands.json
|
||||
+CTestTestfile.cmake
|
||||
+_deps
|
||||
+CMakeUserPresets.json
|
||||
+
|
||||
+### CMake Patch ###
|
||||
+# External projects
|
||||
+*-prefix/
|
||||
+
|
||||
+### C ###
|
||||
+# Prerequisites
|
||||
+*.d
|
||||
+
|
||||
+# Object files
|
||||
+*.o
|
||||
+*.ko
|
||||
+*.obj
|
||||
+*.elf
|
||||
+
|
||||
+# Linker output
|
||||
+*.ilk
|
||||
+*.map
|
||||
+*.exp
|
||||
+
|
||||
+# Precompiled Headers
|
||||
+*.gch
|
||||
+*.pch
|
||||
+
|
||||
+# Libraries
|
||||
+*.lib
|
||||
+*.a
|
||||
+*.la
|
||||
+*.lo
|
||||
+
|
||||
+# Shared objects (inc. Windows DLLs)
|
||||
+*.dll
|
||||
+*.so
|
||||
+*.so.*
|
||||
+*.dylib
|
||||
+
|
||||
+# Executables
|
||||
+*.exe
|
||||
+*.out
|
||||
+*.app
|
||||
+*.i*86
|
||||
+*.x86_64
|
||||
+*.hex
|
||||
+
|
||||
+# Debug files
|
||||
+*.dSYM/
|
||||
+*.su
|
||||
+*.idb
|
||||
+*.pdb
|
||||
+
|
||||
+# Kernel Module Compile Results
|
||||
+*.mod*
|
||||
+*.cmd
|
||||
+.tmp_versions/
|
||||
+modules.order
|
||||
+Module.symvers
|
||||
+Mkfile.old
|
||||
+dkms.conf
|
||||
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
|
||||
index 03e5315..d936536 100644
|
||||
--- a/src/CMakeLists.txt
|
||||
+++ b/src/CMakeLists.txt
|
||||
@@ -34,8 +34,8 @@ set(CAPNP_CUSTOM_INSTALL_PATH "${FASTNETMON_LIBRARIES_GLOBAL_PATH}/capnproto_0_8
|
||||
set(OPENSSL_CUSTOM_INSTALL_PATH "${FASTNETMON_LIBRARIES_GLOBAL_PATH}/openssl_1_0_2d")
|
||||
set(GRPC_CUSTOM_INSTALL_PATH "${FASTNETMON_LIBRARIES_GLOBAL_PATH}/grpc_1_30_2")
|
||||
|
||||
-set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} --std=c++14")
|
||||
-set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} --std=c++14")
|
||||
+set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} --std=c++17")
|
||||
+set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} --std=c++17")
|
||||
|
||||
set(CMAKE_INSTALL_SYSTEMD_SERVICEDIR "/lib/systemd/system"
|
||||
CACHE PATH "Location for systemd service files")
|
||||
@@ -44,8 +44,8 @@ set(CMAKE_INSTALL_SYSTEMD_SERVICEDIR "/lib/systemd/system"
|
||||
option(ENABLE_GOBGP_SUPPORT "Enable GoBGP support build" ON)
|
||||
|
||||
if (ENABLE_GOBGP_SUPPORT)
|
||||
- set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -std=c++14")
|
||||
- set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -std=c++14")
|
||||
+ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -std=c++17")
|
||||
+ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -std=c++17")
|
||||
endif()
|
||||
|
||||
option(ENABLE_CUSTOM_BOOST_BUILD "Enable build with custom Boost" ON)
|
||||
@@ -54,13 +54,13 @@ if (ENABLE_CUSTOM_BOOST_BUILD)
|
||||
|
||||
set(Boost_NO_SYSTEM_PATHS ON)
|
||||
|
||||
- set(BOOST_INCLUDEDIR "${FASTNETMON_LIBRARIES_GLOBAL_PATH}/boost_1_74_0")
|
||||
- set(BOOST_LIBRARYDIR "${FASTNETMON_LIBRARIES_GLOBAL_PATH}/boost_1_74_0/stage/lib/")
|
||||
+ set(BOOST_INCLUDEDIR "${FASTNETMON_LIBRARIES_GLOBAL_PATH}/boost_1_74_0" "/usr/include" )
|
||||
+ set(BOOST_LIBRARYDIR "${FASTNETMON_LIBRARIES_GLOBAL_PATH}/boost_1_74_0/stage/lib/" "/usr/lib")
|
||||
|
||||
SET(Boost_DIR "${FASTNETMON_LIBRARIES_GLOBAL_PATH}/boost_1_74_0/stage/lib/cmake/Boost-1.74.0/")
|
||||
|
||||
- set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -std=c++14")
|
||||
- set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -std=c++14")
|
||||
+ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -std=c++17")
|
||||
+ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -std=c++17")
|
||||
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wno-deprecated-declarations")
|
||||
|
||||
@@ -73,11 +73,11 @@ if (ENABLE_CUSTOM_BOOST_BUILD)
|
||||
find_library(ICU_LIBRARY_DATA_PATH NAMES icudata PATHS "${ICU_CUSTOM_INSTALL_PATH}/lib" NO_DEFAULT_PATH)
|
||||
find_library(ICU_LIBRARY_I18N_PATH NAMES icui18n PATHS "${ICU_CUSTOM_INSTALL_PATH}/lib" NO_DEFAULT_PATH)
|
||||
|
||||
- if (ICU_LIBRARY_UC_PATH AND ICU_LIBRARY_DATA_PATH AND ICU_LIBRARY_I18N_PATH)
|
||||
- message(STATUS "Found libicu")
|
||||
- else()
|
||||
- message(FATAL_ERROR "Could not find icu libraries ${ICU_LIBRARY_UC_PATH} ${ICU_LIBRARY_DATA_PATH} ${ICU_LIBRARY_I18N_PATH}")
|
||||
- endif()
|
||||
+ # if (ICU_LIBRARY_UC_PATH AND ICU_LIBRARY_DATA_PATH AND ICU_LIBRARY_I18N_PATH)
|
||||
+ # message(STATUS "Found libicu")
|
||||
+ # else()
|
||||
+ # message(FATAL_ERROR "Could not find icu libraries ${ICU_LIBRARY_UC_PATH} ${ICU_LIBRARY_DATA_PATH} ${ICU_LIBRARY_I18N_PATH}")
|
||||
+ # endif()
|
||||
|
||||
endif()
|
||||
|
||||
@@ -283,16 +283,16 @@ if (ENABLE_DPI_SUPPORT)
|
||||
|
||||
add_library(fast_dpi STATIC fast_dpi.cpp)
|
||||
|
||||
- set(NDPI_INCLUDE_DIRS "${FASTNETMON_LIBRARIES_GLOBAL_PATH}/ndpi/include/libndpi-1.7.1")
|
||||
+ set(NDPI_INCLUDE_DIRS "${FASTNETMON_LIBRARIES_GLOBAL_PATH}/ndpi/include/libndpi-1.7.1" "/usr/include/ndpi")
|
||||
|
||||
- find_library(NDPI_LIBRARIES NAMES ndpi PATHS "${FASTNETMON_LIBRARIES_GLOBAL_PATH}/ndpi/lib" NO_DEFAULT_PATH)
|
||||
+ find_library(NDPI_LIBRARIES NAMES ndpi PATHS "${FASTNETMON_LIBRARIES_GLOBAL_PATH}/ndpi/lib" "/usr/local/lib" NO_DEFAULT_PATH)
|
||||
|
||||
if (NOT NDPI_LIBRARIES)
|
||||
message(FATAL_ERROR "Could not find nDPI library")
|
||||
endif()
|
||||
|
||||
- link_directories("${FASTNETMON_LIBRARIES_GLOBAL_PATH}/ndpi/lib")
|
||||
- include_directories(${NDPI_INCLUDE_DIRS})
|
||||
+ link_directories("/usr/local/lib" "${FASTNETMON_LIBRARIES_GLOBAL_PATH}/ndpi/lib")
|
||||
+ include_directories("/usr/include/ndpi" ${NDPI_INCLUDE_DIRS})
|
||||
|
||||
add_definitions(-DENABLE_DPI)
|
||||
|
||||
@@ -320,10 +320,10 @@ if (ENABLE_GOBGP_SUPPORT)
|
||||
add_definitions(-DENABLE_GOBGP)
|
||||
add_library(gobgp_action STATIC actions/gobgp_action.cpp)
|
||||
|
||||
- find_path(GRPC_INCLUDES_FOLDER NAMES grpc/grpc.h PATHS "${GRPC_CUSTOM_INSTALL_PATH}/include" NO_DEFAULT_PATH)
|
||||
- find_library(GRPC_LIBRARY_GRPC_PATH NAMES grpc PATHS "${GRPC_CUSTOM_INSTALL_PATH}/lib" NO_DEFAULT_PATH)
|
||||
- find_library(GRPC_LIBRARY_GPR_PATH NAMES gpr PATHS "${GRPC_CUSTOM_INSTALL_PATH}/lib" NO_DEFAULT_PATH)
|
||||
- find_library(GRPC_LIBRARY_GRPC_CPP_PATH NAMES grpc++ PATHS "${GRPC_CUSTOM_INSTALL_PATH}/lib" NO_DEFAULT_PATH)
|
||||
+ find_path(GRPC_INCLUDES_FOLDER NAMES grpc/grpc.h PATHS "${GRPC_CUSTOM_INSTALL_PATH}/include" "/usr/lib" "/usr/include" NO_DEFAULT_PATH)
|
||||
+ find_library(GRPC_LIBRARY_GRPC_PATH NAMES grpc PATHS "${GRPC_CUSTOM_INSTALL_PATH}/lib" "/usr/lib" "/usr/include" NO_DEFAULT_PATH)
|
||||
+ find_library(GRPC_LIBRARY_GPR_PATH NAMES gpr PATHS "${GRPC_CUSTOM_INSTALL_PATH}/lib" "/usr/include" "/usr/lib" NO_DEFAULT_PATH)
|
||||
+ find_library(GRPC_LIBRARY_GRPC_CPP_PATH NAMES grpc++ PATHS "${GRPC_CUSTOM_INSTALL_PATH}/lib" "/usr/lib" "/usr/include" NO_DEFAULT_PATH)
|
||||
|
||||
if (GRPC_INCLUDES_FOLDER AND GRPC_LIBRARY_GRPC_PATH AND GRPC_LIBRARY_GPR_PATH AND GRPC_LIBRARY_GRPC_CPP_PATH)
|
||||
include_directories(${GRPC_INCLUDES_FOLDER})
|
||||
@@ -352,7 +352,7 @@ if (ENABLE_GOBGP_SUPPORT)
|
||||
# message(STATUS "grpc: ${GRPC_INCLUDES_FOLDER} ${GRPC_LIBRARY_GRPC_PATH} ${GRPC_LIBRARY_GPR_PATH}")
|
||||
# message(STATUS ${PROJECT_BINARY_DIR})
|
||||
|
||||
- find_program(PROTOC_BINARY protoc PATHS "${PROTOCOL_BUFFERS_CUSTOM_INSTALL_PATH}/bin" NO_DEFAULT_PATH)
|
||||
+ find_program(PROTOC_BINARY protoc PATHS "${PROTOCOL_BUFFERS_CUSTOM_INSTALL_PATH}/bin" "/usr/local/bin" NO_DEFAULT_PATH)
|
||||
|
||||
if (PROTOC_BINARY)
|
||||
message(STATUS "Found protoc protobuf compiler: ${PROTOC_BINARY}")
|
||||
@@ -362,13 +362,14 @@ if (ENABLE_GOBGP_SUPPORT)
|
||||
|
||||
message(STATUS "Building protobuf and gRPC mappings for C++")
|
||||
|
||||
- set(GRPC_CPP_PLUGIN "${GRPC_CUSTOM_INSTALL_PATH}/bin/grpc_cpp_plugin")
|
||||
+ # set(GRPC_CPP_PLUGIN "${GRPC_CUSTOM_INSTALL_PATH}/bin/grpc_cpp_plugin")
|
||||
+ set(GRPC_CPP_PLUGIN "/usr/bin/grpc_cpp_plugin")
|
||||
|
||||
- execute_process(COMMAND ${PROTOC_BINARY} -I ${PROJECT_BINARY_DIR}/../actions --grpc_out=${PROJECT_BINARY_DIR}/../actions --plugin=protoc-gen-grpc=${GRPC_CPP_PLUGIN} ${PROJECT_BINARY_DIR}/../actions/gobgp.proto ERROR_VARIABLE PROTOC_STDERR RESULT_VARIABLE PROTOC_RETURN_CODE OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
+ execute_process(COMMAND ${PROTOC_BINARY} -I ${PROJECT_BINARY_DIR}/actions --grpc_out=${PROJECT_BINARY_DIR}/actions --plugin=protoc-gen-grpc=${GRPC_CPP_PLUGIN} ${PROJECT_BINARY_DIR}/actions/gobgp.proto ERROR_VARIABLE PROTOC_STDERR RESULT_VARIABLE PROTOC_RETURN_CODE OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
message(STATUS "Protoc return code for gobgp.proto gRPC: ${PROTOC_RETURN_CODE} std err: ${PROTOC_STDERR}")
|
||||
|
||||
- execute_process(COMMAND ${PROTOC_BINARY} -I ${PROJECT_BINARY_DIR}/../actions --cpp_out=${PROJECT_BINARY_DIR}/../actions ${PROJECT_BINARY_DIR}/../actions/gobgp.proto ${PROJECT_BINARY_DIR}/../actions/attribute.proto ERROR_VARIABLE PROTOC_STDERR RESULT_VARIABLE PROTOC_RETURN_CODE OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
+ execute_process(COMMAND ${PROTOC_BINARY} -I ${PROJECT_BINARY_DIR}/actions --cpp_out=${PROJECT_BINARY_DIR}/actions ${PROJECT_BINARY_DIR}/actions/gobgp.proto ${PROJECT_BINARY_DIR}/actions/attribute.proto ERROR_VARIABLE PROTOC_STDERR RESULT_VARIABLE PROTOC_RETURN_CODE OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
message(STATUS "Protoc return code for gobgp.proto and attribute.proto Protobuf: ${PROTOC_RETURN_CODE} std err: ${PROTOC_STDERR}")
|
||||
|
||||
@@ -393,11 +394,11 @@ if (ENABLE_GOBGP_SUPPORT)
|
||||
# FastNetMon API
|
||||
add_definitions(-DFASTNETMON_API)
|
||||
|
||||
- execute_process(COMMAND ${PROTOC_BINARY} -I ${PROJECT_BINARY_DIR}/.. --grpc_out=${PROJECT_BINARY_DIR}/.. --plugin=protoc-gen-grpc=${GRPC_CPP_PLUGIN} ${PROJECT_BINARY_DIR}/../fastnetmon.proto ERROR_VARIABLE PROTOC_STDERR RESULT_VARIABLE PROTOC_RETURN_CODE OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
+ execute_process(COMMAND ${PROTOC_BINARY} -I ${PROJECT_BINARY_DIR} --grpc_out=${PROJECT_BINARY_DIR}/.. --plugin=protoc-gen-grpc=${GRPC_CPP_PLUGIN} ${PROJECT_BINARY_DIR}/fastnetmon.proto ERROR_VARIABLE PROTOC_STDERR RESULT_VARIABLE PROTOC_RETURN_CODE OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
message(STATUS "Protoc return code for gRPC fastnetmon.proto: ${PROTOC_RETURN_CODE} std err: ${PROTOC_STDERR}")
|
||||
|
||||
- execute_process(COMMAND ${PROTOC_BINARY} -I ${PROJECT_BINARY_DIR}/.. --cpp_out=${PROJECT_BINARY_DIR}/.. ${PROJECT_BINARY_DIR}/../fastnetmon.proto ERROR_VARIABLE PROTOC_STDERR RESULT_VARIABLE PROTOC_RETURN_CODE OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
+ execute_process(COMMAND ${PROTOC_BINARY} -I ${PROJECT_BINARY_DIR} --cpp_out=${PROJECT_BINARY_DIR}/.. ${PROJECT_BINARY_DIR}/fastnetmon.proto ERROR_VARIABLE PROTOC_STDERR RESULT_VARIABLE PROTOC_RETURN_CODE OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
message(STATUS "Protoc return code for protobuf fastnetmon.proto: ${PROTOC_RETURN_CODE} std err: ${PROTOC_STDERR}")
|
||||
|
||||
@@ -407,8 +408,8 @@ if (ENABLE_GOBGP_SUPPORT)
|
||||
set_source_files_properties(fastnetmon.grpc.pb.h PROPERTIES COMPILE_FLAGS -Wno-deprecated-declarations)
|
||||
set_source_files_properties(fastnetmon.pb.h PROPERTIES COMPILE_FLAGS -Wno-deprecated-declarations)
|
||||
|
||||
- add_library(fastnetmon_grpc_pb_cc STATIC fastnetmon.grpc.pb.cc)
|
||||
- add_library(fastnetmon_pb_cc STATIC fastnetmon.pb.cc)
|
||||
+ add_library(fastnetmon_grpc_pb_cc STATIC ../fastnetmon.grpc.pb.cc)
|
||||
+ add_library(fastnetmon_pb_cc STATIC ../fastnetmon.pb.cc)
|
||||
|
||||
add_executable(fastnetmon_api_client fastnetmon_api_client.cpp)
|
||||
|
||||
@@ -428,9 +429,9 @@ if (ENABLE_GOBGP_SUPPORT)
|
||||
endif()
|
||||
|
||||
if (ENABLE_CUSTOM_BOOST_BUILD)
|
||||
- target_link_libraries(fastnetmon ${ICU_LIBRARY_UC_PATH})
|
||||
- target_link_libraries(fastnetmon ${ICU_LIBRARY_DATA_PATH})
|
||||
- target_link_libraries(fastnetmon ${ICU_LIBRARY_I18N_PATH})
|
||||
+ # target_link_libraries(fastnetmon ${ICU_LIBRARY_UC_PATH})
|
||||
+ # target_link_libraries(fastnetmon ${ICU_LIBRARY_DATA_PATH})
|
||||
+ # target_link_libraries(fastnetmon ${ICU_LIBRARY_I18N_PATH})
|
||||
endif()
|
||||
|
||||
# example plugin
|
||||
@@ -459,6 +460,7 @@ find_package(Boost COMPONENTS thread regex program_options system REQUIRED)
|
||||
if(Boost_FOUND)
|
||||
message(STATUS "Found Boost: ${Boost_LIBRARIES} ${Boost_INCLUDE_DIRS}")
|
||||
|
||||
+ # include_directories("/usr/include/boost/system" "/usr/include/boost/thread" "/usr/include" "/usr/include/boost" ${Boost_INCLUDE_DIRS})
|
||||
include_directories(${Boost_INCLUDE_DIRS})
|
||||
target_link_libraries(fastnetmon ${Boost_LIBRARIES})
|
||||
target_link_libraries(fast_library ${Boost_LIBRARIES})
|
||||
@@ -479,10 +481,10 @@ endif()
|
||||
### Move this code to cmake module
|
||||
|
||||
# Try to find hiredis in a specific folder
|
||||
-find_path(HIREDIS_INCLUDES_FOLDER NAMES hiredis/hiredis.h PATHS "${HIREDIS_CUSTOM_INSTALL_PATH}/include" NO_DEFAULT_PATH)
|
||||
+find_path(HIREDIS_INCLUDES_FOLDER NAMES hiredis/hiredis.h PATHS "${HIREDIS_CUSTOM_INSTALL_PATH}/include" "/usr/include" NO_DEFAULT_PATH)
|
||||
|
||||
# Try to find hiredis library path
|
||||
-find_library(HIREDIS_LIBRARY_PATH NAMES hiredis PATHS "${HIREDIS_CUSTOM_INSTALL_PATH}/lib" NO_DEFAULT_PATH)
|
||||
+find_library(HIREDIS_LIBRARY_PATH NAMES hiredis PATHS "${HIREDIS_CUSTOM_INSTALL_PATH}/lib" "/usr/lib" NO_DEFAULT_PATH)
|
||||
|
||||
if (HIREDIS_INCLUDES_FOLDER AND HIREDIS_LIBRARY_PATH)
|
||||
message(STATUS "We found hiredis library ${HIREDIS_INCLUDES_FOLDER} ${HIREDIS_LIBRARY_PATH}")
|
||||
@@ -497,9 +499,9 @@ endif()
|
||||
|
||||
set(ENABLE_OPENSSL_SUPPORT TRUE)
|
||||
if (ENABLE_OPENSSL_SUPPORT)
|
||||
- find_path(OPENSSL_INCLUDES_FOLDER NAMES "openssl/rsa.h" PATHS "${OPENSSL_CUSTOM_INSTALL_PATH}/include" NO_DEFAULT_PATH)
|
||||
- find_library(OPENSSL_LIBRARY_PATH NAMES ssl PATHS "${OPENSSL_CUSTOM_INSTALL_PATH}/lib" NO_DEFAULT_PATH)
|
||||
- find_library(OPENSSL_CRYPTO_LIBRARY_PATH NAMES crypto PATHS "${OPENSSL_CUSTOM_INSTALL_PATH}/lib" NO_DEFAULT_PATH)
|
||||
+ find_path(OPENSSL_INCLUDES_FOLDER NAMES "openssl/rsa.h" PATHS "${OPENSSL_CUSTOM_INSTALL_PATH}/include" "/usr/include" NO_DEFAULT_PATH)
|
||||
+ find_library(OPENSSL_LIBRARY_PATH NAMES ssl PATHS "${OPENSSL_CUSTOM_INSTALL_PATH}/lib" "/usr/lib" NO_DEFAULT_PATH)
|
||||
+ find_library(OPENSSL_CRYPTO_LIBRARY_PATH NAMES crypto PATHS "${OPENSSL_CUSTOM_INSTALL_PATH}/lib" "/usr/lib" NO_DEFAULT_PATH)
|
||||
|
||||
if (OPENSSL_INCLUDES_FOLDER AND OPENSSL_LIBRARY_PATH AND OPENSSL_CRYPTO_LIBRARY_PATH)
|
||||
message(STATUS "We found OpenSSL library: ${OPENSSL_LIBRARY_PATH} ${OPENSSL_CRYPTO_LIBRARY_PATH}")
|
||||
@@ -512,8 +514,8 @@ endif()
|
||||
SET(CAPNP_SUPPORT TRUE)
|
||||
|
||||
if (CAPNP_SUPPORT)
|
||||
- find_library(CAPNP_LIBRARY_PATH NAMES capnp PATHS "${CAPNP_CUSTOM_INSTALL_PATH}/lib" NO_DEFAULT_PATH)
|
||||
- find_library(CAPNP_KJ_LIBRARY_PATH NAMES kj PATHS "${CAPNP_CUSTOM_INSTALL_PATH}/lib" NO_DEFAULT_PATH)
|
||||
+ find_library(CAPNP_LIBRARY_PATH NAMES capnp PATHS "${CAPNP_CUSTOM_INSTALL_PATH}/lib" "/usr/lib" NO_DEFAULT_PATH)
|
||||
+ find_library(CAPNP_KJ_LIBRARY_PATH NAMES kj PATHS "${CAPNP_CUSTOM_INSTALL_PATH}/lib" "/usr/lib" NO_DEFAULT_PATH)
|
||||
|
||||
if (CAPNP_LIBRARY_PATH AND CAPNP_KJ_LIBRARY_PATH)
|
||||
message(STATUS "We found capnp and kj libraries: ${CAPNP_LIBRARY_PATH} ${CAPNP_KJ_LIBRARY_PATH}")
|
||||
@@ -530,12 +532,12 @@ target_link_libraries(simple_packet_capnp ${CAPNP_LIBRARY_PATH} ${CAPNP_KJ_LIBRA
|
||||
target_link_libraries(fast_library simple_packet_capnp)
|
||||
|
||||
### Find mongo-c
|
||||
-find_path(MONGOC_INCLUDES_FOLDER NAMES libmongoc-1.0/mongoc.h PATHS "${MONGO_C_CUSTOM_INSTALL_PATH}/include" NO_DEFAULT_PATH)
|
||||
-find_library(MONGOC_LIBRARY_PATH NAMES mongoc-1.0 PATHS "${MONGO_C_CUSTOM_INSTALL_PATH}/lib" NO_DEFAULT_PATH)
|
||||
+find_path(MONGOC_INCLUDES_FOLDER NAMES libmongoc-1.0/mongoc.h PATHS "${MONGO_C_CUSTOM_INSTALL_PATH}/include" "/usr/include" NO_DEFAULT_PATH)
|
||||
+find_library(MONGOC_LIBRARY_PATH NAMES mongoc-1.0 PATHS "${MONGO_C_CUSTOM_INSTALL_PATH}/lib" "/usr/lib" NO_DEFAULT_PATH)
|
||||
|
||||
### find bson
|
||||
-find_path(BSON_INCLUDES_FOLDER NAMES libbson-1.0/bson.h PATHS "${MONGO_C_CUSTOM_INSTALL_PATH}/include" NO_DEFAULT_PATH)
|
||||
-find_library(BSON_LIBRARY_PATH NAMES bson-1.0 PATHS "${MONGO_C_CUSTOM_INSTALL_PATH}/lib" NO_DEFAULT_PATH)
|
||||
+find_path(BSON_INCLUDES_FOLDER NAMES libbson-1.0/bson.h PATHS "${MONGO_C_CUSTOM_INSTALL_PATH}/include" "/usr/include" NO_DEFAULT_PATH)
|
||||
+find_library(BSON_LIBRARY_PATH NAMES bson-1.0 PATHS "${MONGO_C_CUSTOM_INSTALL_PATH}/lib" "/usr/lib" NO_DEFAULT_PATH)
|
||||
|
||||
if (MONGOC_INCLUDES_FOLDER AND MONGOC_LIBRARY_PATH AND BSON_INCLUDES_FOLDER AND BSON_LIBRARY_PATH)
|
||||
message(STATUS "We found mongo-c library ${MONGOC_INCLUDES_FOLDER} ${MONGOC_LIBRARY_PATH} ${BSON_INCLUDES_FOLDER} ${BSON_LIBRARY_PATH}")
|
||||
@@ -568,10 +570,10 @@ endif()
|
||||
### Look for log4cpp
|
||||
|
||||
# Try to find log4cpp includes path
|
||||
-find_path(LOG4CPP_INCLUDES_FOLDER NAMES log4cpp/Appender.hh PATHS "${LOG4CPP_CUSTOM_INSTALL_PATH}/include" NO_DEFAULT_PATH)
|
||||
+find_path(LOG4CPP_INCLUDES_FOLDER NAMES log4cpp/Appender.hh PATHS "${LOG4CPP_CUSTOM_INSTALL_PATH}/include" "/usr/include" NO_DEFAULT_PATH)
|
||||
|
||||
# Try to find log4cpp library path
|
||||
-find_library(LOG4CPP_LIBRARY_PATH NAMES log4cpp PATHS "${LOG4CPP_CUSTOM_INSTALL_PATH}/lib" NO_DEFAULT_PATH)
|
||||
+find_library(LOG4CPP_LIBRARY_PATH NAMES log4cpp PATHS "${LOG4CPP_CUSTOM_INSTALL_PATH}/lib" "/usr/lib" NO_DEFAULT_PATH)
|
||||
|
||||
if (LOG4CPP_INCLUDES_FOLDER AND LOG4CPP_LIBRARY_PATH)
|
||||
include_directories(${LOG4CPP_INCLUDES_FOLDER})
|
||||
@@ -582,8 +584,8 @@ endif()
|
||||
|
||||
### Look for jsonc
|
||||
|
||||
-find_path(JSONC_INCLUDES_FOLDER NAMES json-c/json.h PATHS "${JSONC_CUSTOM_INSTALL_PATH}/include" NO_DEFAULT_PATH)
|
||||
-find_library(JSONC_LIBRARY_PATH NAMES json-c PATHS "${JSONC_CUSTOM_INSTALL_PATH}/lib" NO_DEFAULT_PATH)
|
||||
+find_path(JSONC_INCLUDES_FOLDER NAMES json-c/json.h PATHS "${JSONC_CUSTOM_INSTALL_PATH}/include" "/usr/include" NO_DEFAULT_PATH)
|
||||
+find_library(JSONC_LIBRARY_PATH NAMES json-c PATHS "${JSONC_CUSTOM_INSTALL_PATH}/lib" "/usr/lib" NO_DEFAULT_PATH)
|
||||
|
||||
if (JSONC_INCLUDES_FOLDER AND JSONC_LIBRARY_PATH)
|
||||
include_directories(${JSONC_INCLUDES_FOLDER})
|
||||
diff --git a/src/fast_dpi.h b/src/fast_dpi.h
|
||||
index a502643..831c7be 100644
|
||||
--- a/src/fast_dpi.h
|
||||
+++ b/src/fast_dpi.h
|
||||
@@ -1,7 +1,10 @@
|
||||
#ifndef FAST_DPI_H
|
||||
#define FAST_DPI_H
|
||||
|
||||
-#include "libndpi/ndpi_api.h"
|
||||
+// #include "libndpi/ndpi_api.h"
|
||||
+// #include "/home/vis/utils/nDPI/src/include/ndpi_api.h"
|
||||
+#include "ndpi_api.h"
|
||||
+// #include "/usr/include/ndpi/ndpi_api.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
struct ndpi_detection_module_struct* init_ndpi();
|
Loading…
Reference in New Issue
Block a user