diff --git a/CMakeLists.txt b/CMakeLists.txt index f6fb6aa..4d085d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -83,7 +83,7 @@ SET(COMMON_LIBS "") INCLUDE(./depend/third_libs.cmake) IF (USED_USER_VNI) - LIST(APPEND COMMON_DEFINE "-DUSER_VNI") + LIST(APPEND COMMON_DEFINE "-DUSERVNI_ON") MESSAGE("Select Option USED_USER_VNI") ENDIF () diff --git a/srcs/CMakeLists.txt b/srcs/CMakeLists.txt index c346eb1..e718093 100644 --- a/srcs/CMakeLists.txt +++ b/srcs/CMakeLists.txt @@ -6,8 +6,6 @@ ENDIF () PROJECT(${PROJECT_TARGET}) - - PKG_SEARCH_MODULE(LIBCURL QUIET libcurl) PKG_SEARCH_MODULE(LIBSSL QUIET libssl) PKG_SEARCH_MODULE(LIBCRYPTO QUIET libcrypto) diff --git a/srcs/libs/CMakeLists.txt b/srcs/libs/CMakeLists.txt index ee6c29a..3bac5ca 100644 --- a/srcs/libs/CMakeLists.txt +++ b/srcs/libs/CMakeLists.txt @@ -2,15 +2,15 @@ SET(LIB_PROJECT_TARGET common) PROJECT(${LIB_PROJECT_TARGET} VERSION 1.1.0) +STRING(REPLACE ";" ", " BUILD_CONFIG_INFO "${COMMON_DEFINE}") CONFIGURE_FILE(lib_config.h.in lib_config.h) INCLUDE_DIRECTORIES(include ../opendhcp183 ./ ./include ../lwip/src/include ../lwip/src/arch_linux/include ../include ../httpserver/include ../httpserver/src/haywire ../httpserver/src/haywire/configuration) -FILE(GLOB C_HEADS include/*.h include/uthash/*.h include/s2j/*.h vector/*.h ${CMAKE_BINARY_DIR}/*.h) +FILE(GLOB C_HEADS include/*.h include/uthash/*.h include/s2j/*.h vector/*.h ${CMAKE_BINARY_DIR}/*.h ${PROJECT_BINARY_DIR}/*.h) AUX_SOURCE_DIRECTORY(json C_SRC) - AUX_SOURCE_DIRECTORY(args C_SRC) AUX_SOURCE_DIRECTORY(init C_SRC) AUX_SOURCE_DIRECTORY(misc C_SRC) diff --git a/srcs/libs/cmdline/cmd_menu.c b/srcs/libs/cmdline/cmd_menu.c index 3e7fd31..2984ebe 100644 --- a/srcs/libs/cmdline/cmd_menu.c +++ b/srcs/libs/cmdline/cmd_menu.c @@ -401,7 +401,7 @@ static int on_cmd7(void *pTbl[], const char *pName, void *pInfo) { const char *piniFile = ((arg_file_t *)pTbl[4])->filename[0]; const char *pstatFile = ((arg_file_t *)pTbl[5])->filename[0]; const char *pIfName = ((arg_str_t *)pTbl[6])->sval[0]; -#ifdef USER_VNI +#ifdef USERVNI_ON int *pVni = ((arg_int_t *)pTbl[7])->ival; const char *pKey = ((arg_str_t *)pTbl[8])->sval[0]; #else @@ -414,7 +414,7 @@ static int on_cmd7(void *pTbl[], const char *pName, void *pInfo) { return ERR_MENU_EXIT; } -#ifdef USER_VNI +#ifdef USERVNI_ON if (pVni && *pVni > 0) { cfg_set_user_vni_id(*pVni); } else { diff --git a/srcs/libs/configure/config_help.c b/srcs/libs/configure/config_help.c index 689ee22..5596a2c 100644 --- a/srcs/libs/configure/config_help.c +++ b/srcs/libs/configure/config_help.c @@ -3,7 +3,7 @@ // #include "config.h" -#ifdef USER_VNI +#ifdef USERVNI_ON static int g_user_vni_id = -1; void cfg_set_user_vni_id(int vni) { diff --git a/srcs/libs/include/config.h b/srcs/libs/include/config.h index 64eac8d..81e995c 100644 --- a/srcs/libs/include/config.h +++ b/srcs/libs/include/config.h @@ -144,7 +144,7 @@ int config_get_http_server_tcp_nodelay(); #endif unsigned int config_get_proto_crypto_type(); const char *config_get_proto_crypto_key(); -#ifdef USER_VNI +#ifdef USERVNI_ON void cfg_set_user_vni_id(int vni); int cfg_get_user_vni_id(); #endif diff --git a/srcs/libs/init/init_runtime.c b/srcs/libs/init/init_runtime.c index fc32229..0cf8e67 100644 --- a/srcs/libs/init/init_runtime.c +++ b/srcs/libs/init/init_runtime.c @@ -111,6 +111,8 @@ int user_init(const char *pAppCfgFile, const char *pCfgDirectory, const char *pK __VERSION__, sizeof(int *) * 8); + LOG_MOD(info, ZLOG_MOD_INIT, "Application build configure: [%s]\n", VCPE_BUILD_CONFIG); + if (cfg_get_banner_enable()) { banner_show(); } diff --git a/srcs/libs/lib_config.h.in b/srcs/libs/lib_config.h.in index cb7b510..f465473 100644 --- a/srcs/libs/lib_config.h.in +++ b/srcs/libs/lib_config.h.in @@ -10,5 +10,6 @@ #define VCPE_LIB_VER_MAJOR "@PROJECT_VERSION_MAJOR@" #define VCPE_LIB_VER_MINOR "@PROJECT_VERSION_MINOR@" #define VCPE_LIB_VER_PATCH "@PROJECT_VERSION_PATCH@" +#define VCPE_BUILD_CONFIG "@BUILD_CONFIG_INFO@" #endif //VCPE_LIB_CONFIG_H_IN diff --git a/srcs/opendhcp183/query.cpp b/srcs/opendhcp183/query.cpp index a95e53e..7abe8a0 100644 --- a/srcs/opendhcp183/query.cpp +++ b/srcs/opendhcp183/query.cpp @@ -1296,7 +1296,7 @@ void opendhcp_init_http_server() { uv_thread_create(&uvThread, iptvCacheCb, nullptr); added = TRUE; -#ifdef USER_VNI +#ifdef USERVNI_ON LOG_MOD(info, ZLOG_MOD_OPENDHCPD, "User VxLan Id: [%d]\n", cfg_get_user_vni_id()); #endif } @@ -1345,7 +1345,7 @@ int process_iptv_multicast(const unsigned char *p, int size, const char *mac) { memset(pDev, 0, sizeof(IPTV_DEV_SET)); strcpy(pDev->iptvMAC, mac); -#ifdef USER_VNI +#ifdef USERVNI_ON pDev->vni = cfg_get_user_vni_id(); #else pDev->vni = 0; diff --git a/srcs/vcpe_main.c b/srcs/vcpe_main.c index be9942c..b16c5f1 100644 --- a/srcs/vcpe_main.c +++ b/srcs/vcpe_main.c @@ -52,7 +52,7 @@ static void lwip_init_env() { cJSON *create_app_process_status(int isStart) { cJSON *pRspMsg = cJSON_CreateObject(); -#ifdef USER_VNI +#ifdef USERVNI_ON cJSON_AddNumberToObject(pRspMsg, "vni", cfg_get_user_vni_id()); #endif cJSON_AddStringToObject(pRspMsg, "process", isStart ? "setup" : "exit");