Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework of the Python Filter (Depends on PR Support UDP TCP #224) #232

Draft
wants to merge 17 commits into
base: support_tcp_udp
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.7.2)
cmake_minimum_required(VERSION 3.12)

project(darwin)

Expand Down Expand Up @@ -29,6 +29,7 @@ if (NOT DEFINED FILTER)
CONTENT_INSPECTION
BUFFER
YARA
PYTHON
TEST
)
else (NOT DEFINED FILTER)
Expand Down Expand Up @@ -185,3 +186,7 @@ endif()
if("VAML" IN_LIST FILTERS)
include(fvaml)
endif()

if("PYTHON" IN_LIST FILTERS)
include(fpython)
endif()
32 changes: 32 additions & 0 deletions cmake/fpython.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
set(PYTHON_NAME darwin_python)

#######################
# FILTER DEPENDENCIES #
#######################

find_package(Python3 REQUIRED COMPONENTS Development)

include_directories(SYSTEM ${Python3_INCLUDE_DIRS})
link_directories(${Python3_LIBRARY_DIRS})

###################
# EXECUTABLE #
###################


add_executable(
${PYTHON_NAME}
${DARWIN_SOURCES}
samples/fpython/PythonTask.cpp samples/fpython/PythonTask.hpp
samples/fpython/Generator.cpp samples/fpython/Generator.hpp
)

target_link_libraries(
${PYTHON_NAME}
${DARWIN_LIBRARIES}
${Python3_LIBRARIES}
# DL libs are used for loading shared objects
${CMAKE_DL_LIBS}
)

target_include_directories(${PYTHON_NAME} PUBLIC samples/fpython/)
4 changes: 4 additions & 0 deletions samples/base/Logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ namespace darwin {
return false;
}

log_type Logger::getLevel() const {
return this->_logLevel;
}

void Logger::setName(std::string const& name) {
_name = name;
}
Expand Down
7 changes: 7 additions & 0 deletions samples/base/Logger.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ namespace darwin {
/// \return true if success, false otherwise.
bool setLevel(std::string level);

///
/// \brief Get the Log Level
///
/// \return log_type
///
log_type getLevel() const;

/// Set the name of the module in the logger.
///
/// \param name The name to set as the module name.
Expand Down
Loading