OCT 1. 更新用户VNI编译开关名称

2. 代码增加编译配置信息日志
This commit is contained in:
huangxin 2023-02-16 19:31:19 +08:00
parent b7b886bd4a
commit d33629bc24
10 changed files with 13 additions and 12 deletions

View File

@ -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 ()

View File

@ -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)

View File

@ -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)

View File

@ -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 {

View File

@ -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) {

View File

@ -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

View File

@ -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();
}

View File

@ -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

View File

@ -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;

View File

@ -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");