diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2e0eee6..a80972c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -7,4 +7,4 @@ add_subdirectory(ip_reassembly) add_subdirectory(tcp_reassembly) add_subdirectory(session) add_subdirectory(plugin) -add_subdirectory(stellar) \ No newline at end of file +add_subdirectory(core) \ No newline at end of file diff --git a/src/stellar/CMakeLists.txt b/src/core/CMakeLists.txt similarity index 75% rename from src/stellar/CMakeLists.txt rename to src/core/CMakeLists.txt index f7b3826..02d6c83 100644 --- a/src/stellar/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -1,9 +1,9 @@ set(SOURCE stellar_config.cpp stellar_stat.cpp stellar_core.cpp) set(LIBRARY session_manager plugin_manager ip_reassembly packet_io packet pthread fieldstat4 toml) -add_library(stellar_core STATIC ${SOURCE}) -target_link_libraries(stellar_core PUBLIC ${LIBRARY}) -target_include_directories(stellar_core PUBLIC ${CMAKE_SOURCE_DIR}/src/utils) +add_library(core STATIC ${SOURCE}) +target_link_libraries(core PUBLIC ${LIBRARY}) +target_include_directories(core PUBLIC ${CMAKE_SOURCE_DIR}/src/utils) add_library(stellar_devel SHARED ${SOURCE}) set_target_properties(stellar_devel PROPERTIES LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_LIST_DIR}/version.map") @@ -11,7 +11,7 @@ target_link_libraries(stellar_devel PRIVATE -Wl,--whole-archive ${LIBRARY} -Wl,- target_include_directories(stellar_devel PUBLIC ${CMAKE_SOURCE_DIR}/src/utils) add_executable(stellar main.cpp) -target_link_libraries(stellar PRIVATE -Wl,--whole-archive stellar_core ${LIBRARY} -Wl,--no-whole-archive) +target_link_libraries(stellar PRIVATE -Wl,--whole-archive core ${LIBRARY} -Wl,--no-whole-archive) target_link_libraries(stellar PRIVATE "-rdynamic") set_target_properties(stellar PROPERTIES LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_LIST_DIR}/version.map") diff --git a/src/stellar/main.cpp b/src/core/main.cpp similarity index 100% rename from src/stellar/main.cpp rename to src/core/main.cpp diff --git a/src/stellar/stellar_config.cpp b/src/core/stellar_config.cpp similarity index 100% rename from src/stellar/stellar_config.cpp rename to src/core/stellar_config.cpp diff --git a/src/stellar/stellar_config.h b/src/core/stellar_config.h similarity index 100% rename from src/stellar/stellar_config.h rename to src/core/stellar_config.h diff --git a/src/stellar/stellar_core.cpp b/src/core/stellar_core.cpp similarity index 98% rename from src/stellar/stellar_core.cpp rename to src/core/stellar_core.cpp index 99c2c54..7d033d9 100644 --- a/src/stellar/stellar_core.cpp +++ b/src/core/stellar_core.cpp @@ -9,7 +9,6 @@ #include #include "log.h" -#include "logo.h" #include "utils.h" #include "packet_io.h" #include "packet_private.h" @@ -31,6 +30,13 @@ static __attribute__((__used__)) const char *version = STELLAR_GIT_VERSION; static __attribute__((__used__)) const char *version = "Unknown"; #endif +static const char logo_str[] = + " _ _ _\n" + " ___ | |_ ___ | | | | __ _ _ __\n" + " / __| | __| / _ \\ | | | | / _` | | '__|\n" + " \\__ \\ | |_ | __/ | | | | | (_| | | |\n" + " |___/ \\__| \\___| |_| |_| \\__,_| |_|\n"; + struct schedule_data { uint64_t last_free_expired_session_timestamp; diff --git a/src/stellar/stellar_core.h b/src/core/stellar_core.h similarity index 100% rename from src/stellar/stellar_core.h rename to src/core/stellar_core.h diff --git a/src/stellar/stellar_stat.cpp b/src/core/stellar_stat.cpp similarity index 100% rename from src/stellar/stellar_stat.cpp rename to src/core/stellar_stat.cpp diff --git a/src/stellar/stellar_stat.h b/src/core/stellar_stat.h similarity index 100% rename from src/stellar/stellar_stat.h rename to src/core/stellar_stat.h diff --git a/src/stellar/version.map b/src/core/version.map similarity index 100% rename from src/stellar/version.map rename to src/core/version.map diff --git a/src/packet/packet_builder.cpp b/src/packet/packet_builder.cpp index 2df0aee..3342a23 100644 --- a/src/packet/packet_builder.cpp +++ b/src/packet/packet_builder.cpp @@ -5,7 +5,6 @@ #include "packet_private.h" #include "packet_helper.h" #include "packet_parser.h" -#include "packet_builder.h" #define PACKET_CRAFT_LOG_DEBUG(format, ...) LOG_DEBUG("packet craft", format, ##__VA_ARGS__) #define PACKET_CRAFT_LOG_ERROR(format, ...) LOG_ERROR("packet craft", format, ##__VA_ARGS__) diff --git a/src/packet/test/gtest_packet_builder.cpp b/src/packet/test/gtest_packet_builder.cpp index ad780b6..0b9a8e7 100644 --- a/src/packet/test/gtest_packet_builder.cpp +++ b/src/packet/test/gtest_packet_builder.cpp @@ -6,7 +6,6 @@ #include "packet_private.h" #include "packet_dump.h" #include "packet_parser.h" -#include "packet_builder.h" #define PRINT_GREEN(fmt, ...) printf("\033[0;32m" fmt "\033[0m\n", ##__VA_ARGS__) #define PRINT_RED(fmt, ...) printf("\033[0;31m" fmt "\033[0m\n", ##__VA_ARGS__) diff --git a/src/plugin/plugin_manager.cpp b/src/plugin/plugin_manager.cpp index c1dd859..42d1cc9 100644 --- a/src/plugin/plugin_manager.cpp +++ b/src/plugin/plugin_manager.cpp @@ -4,7 +4,7 @@ #include "toml/toml.h" #include "uthash/utlist.h" -#include "stellar/stellar_core.h" +#include "core/stellar_core.h" #include "session/session_utils.h" #include "tuple/tuple.h" #include "packet/packet_private.h" diff --git a/src/snowflake/CMakeLists.txt b/src/snowflake/CMakeLists.txt index 10da58d..e68faa6 100644 --- a/src/snowflake/CMakeLists.txt +++ b/src/snowflake/CMakeLists.txt @@ -2,4 +2,4 @@ add_library(snowflake snowflake.cpp) target_include_directories(snowflake PUBLIC ${CMAKE_CURRENT_LIST_DIR}) target_include_directories(snowflake PUBLIC ${CMAKE_SOURCE_DIR}/src/utils) target_include_directories(snowflake PUBLIC ${CMAKE_SOURCE_DIR}/include/stellar) -target_link_libraries(snowflake stellar_core) \ No newline at end of file +target_link_libraries(snowflake core) \ No newline at end of file diff --git a/src/stellar/logo.h b/src/stellar/logo.h deleted file mode 100644 index 2bd85b9..0000000 --- a/src/stellar/logo.h +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* _ _ _ - * ___ | |_ ___ | | | | __ _ _ __ - * / __| | __| / _ \ | | | | / _` | | '__| - * \__ \ | |_ | __/ | | | | | (_| | | | - * |___/ \__| \___| |_| |_| \__,_| |_| - */ - -static const char logo_str[] = - " _ _ _\n" - " ___ | |_ ___ | | | | __ _ _ __\n" - " / __| | __| / _ \\ | | | | / _` | | '__|\n" - " \\__ \\ | |_ | __/ | | | | | (_| | | |\n" - " |___/ \\__| \\___| |_| |_| \\__,_| |_|\n"; - -#ifdef __cplusplus -} -#endif