1
0
Fork 0
mirror of https://github.com/pavel-odintsov/fastnetmon synced 2024-05-10 16:56:15 +02:00

Extracted all platform specific variables to cmake file itself

This commit is contained in:
Pavel Odintsov 2024-02-10 11:47:57 +00:00
parent 3e093b8d7c
commit 1da33bb50e
2 changed files with 17 additions and 7 deletions

View File

@ -181,6 +181,16 @@ execute_process(COMMAND git rev-list HEAD COMMAND head -n 1 COMMAND cut -c1-8 OU
message(STATUS "Commit hash: ${GIT_LAST_COMMIT_HASH_SHORT}")
set(FASTNETMON_APPLICATION_VERSION "${FASTNETMON_VERSION_MAJOR}.${FASTNETMON_VERSION_MINOR}.${FASTNETMON_VERSION_PATCH} ${GIT_LAST_COMMIT_HASH_SHORT}")
# Set standard values which work for majority of platforms
set(FASTNETMON_PID_PATH "/var/run/fastnetmon.pid")
set(FASTNETMON_CONFIGURATION_PATH "/etc/fastnetmon.conf")
set(FASTNETMON_LOG_FILE_PATH "/var/log/fastnetmon.log")
set(FASTNETMON_ATTACK_DETAILS_FOLDER "/var/log/fastnetmon_attacks")
set(FASTNETMON_NOTIFY_SCRIPT_PATH_DEFAULT "/usr/local/bin/notify_about_attack.sh")
set(FASTNETMON_NETWORK_WHITELIST_PATH "/etc/networks_whitelist")
set(FASTNETMON_NETWORKS_LIST_PATH "/etc/networks_list")
configure_file(fast_platform.h.template "${PROJECT_SOURCE_DIR}/fast_platform.hpp")
# Use new Memory Model Aware Atomic Operations

View File

@ -8,20 +8,20 @@ class FastnetmonPlatformConfigurtion {
/* Platform specific paths */
std::string fastnetmon_version = "${FASTNETMON_APPLICATION_VERSION}";
std::string pid_path = "/var/run/fastnetmon.pid";
std::string global_config_path = "/etc/fastnetmon.conf";
std::string pid_path = "${FASTNETMON_PID_PATH}";
std::string global_config_path = "${FASTNETMON_CONFIGURATION_PATH}";
std::string log_file_path = "/var/log/fastnetmon.log";
std::string attack_details_folder = "/var/log/fastnetmon_attacks";
std::string log_file_path = "${FASTNETMON_LOG_FILE_PATH}";
std::string attack_details_folder = "${FASTNETMON_ATTACK_DETAILS_FOLDER}";
// Default path to notify script
std::string notify_script_path = "/usr/local/bin/notify_about_attack.sh";
std::string notify_script_path = "${FASTNETMON_NOTIFY_SCRIPT_PATH_DEFAULT}";
// Default path to file with networks for whitelising
std::string white_list_path = "/etc/networks_whitelist";
std::string white_list_path = "${FASTNETMON_NETWORK_WHITELIST_PATH}";
// Default path to file with all networks listing
std::string networks_list_path = "/etc/networks_list";
std::string networks_list_path = "${FASTNETMON_NETWORKS_LIST_PATH}";
/* Platform specific paths end */
};