parent
b7b886bd4a
commit
d33629bc24
|
@ -83,7 +83,7 @@ SET(COMMON_LIBS "")
|
||||||
INCLUDE(./depend/third_libs.cmake)
|
INCLUDE(./depend/third_libs.cmake)
|
||||||
|
|
||||||
IF (USED_USER_VNI)
|
IF (USED_USER_VNI)
|
||||||
LIST(APPEND COMMON_DEFINE "-DUSER_VNI")
|
LIST(APPEND COMMON_DEFINE "-DUSERVNI_ON")
|
||||||
MESSAGE("Select Option USED_USER_VNI")
|
MESSAGE("Select Option USED_USER_VNI")
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,6 @@ ENDIF ()
|
||||||
|
|
||||||
PROJECT(${PROJECT_TARGET})
|
PROJECT(${PROJECT_TARGET})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
PKG_SEARCH_MODULE(LIBCURL QUIET libcurl)
|
PKG_SEARCH_MODULE(LIBCURL QUIET libcurl)
|
||||||
PKG_SEARCH_MODULE(LIBSSL QUIET libssl)
|
PKG_SEARCH_MODULE(LIBSSL QUIET libssl)
|
||||||
PKG_SEARCH_MODULE(LIBCRYPTO QUIET libcrypto)
|
PKG_SEARCH_MODULE(LIBCRYPTO QUIET libcrypto)
|
||||||
|
|
|
@ -2,15 +2,15 @@ SET(LIB_PROJECT_TARGET common)
|
||||||
|
|
||||||
PROJECT(${LIB_PROJECT_TARGET} VERSION 1.1.0)
|
PROJECT(${LIB_PROJECT_TARGET} VERSION 1.1.0)
|
||||||
|
|
||||||
|
STRING(REPLACE ";" ", " BUILD_CONFIG_INFO "${COMMON_DEFINE}")
|
||||||
CONFIGURE_FILE(lib_config.h.in lib_config.h)
|
CONFIGURE_FILE(lib_config.h.in lib_config.h)
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES(include ../opendhcp183
|
INCLUDE_DIRECTORIES(include ../opendhcp183
|
||||||
./ ./include ../lwip/src/include ../lwip/src/arch_linux/include ../include
|
./ ./include ../lwip/src/include ../lwip/src/arch_linux/include ../include
|
||||||
../httpserver/include ../httpserver/src/haywire ../httpserver/src/haywire/configuration)
|
../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(json C_SRC)
|
||||||
|
|
||||||
AUX_SOURCE_DIRECTORY(args C_SRC)
|
AUX_SOURCE_DIRECTORY(args C_SRC)
|
||||||
AUX_SOURCE_DIRECTORY(init C_SRC)
|
AUX_SOURCE_DIRECTORY(init C_SRC)
|
||||||
AUX_SOURCE_DIRECTORY(misc C_SRC)
|
AUX_SOURCE_DIRECTORY(misc C_SRC)
|
||||||
|
|
|
@ -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 *piniFile = ((arg_file_t *)pTbl[4])->filename[0];
|
||||||
const char *pstatFile = ((arg_file_t *)pTbl[5])->filename[0];
|
const char *pstatFile = ((arg_file_t *)pTbl[5])->filename[0];
|
||||||
const char *pIfName = ((arg_str_t *)pTbl[6])->sval[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;
|
int *pVni = ((arg_int_t *)pTbl[7])->ival;
|
||||||
const char *pKey = ((arg_str_t *)pTbl[8])->sval[0];
|
const char *pKey = ((arg_str_t *)pTbl[8])->sval[0];
|
||||||
#else
|
#else
|
||||||
|
@ -414,7 +414,7 @@ static int on_cmd7(void *pTbl[], const char *pName, void *pInfo) {
|
||||||
return ERR_MENU_EXIT;
|
return ERR_MENU_EXIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USER_VNI
|
#ifdef USERVNI_ON
|
||||||
if (pVni && *pVni > 0) {
|
if (pVni && *pVni > 0) {
|
||||||
cfg_set_user_vni_id(*pVni);
|
cfg_set_user_vni_id(*pVni);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
//
|
//
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#ifdef USER_VNI
|
#ifdef USERVNI_ON
|
||||||
static int g_user_vni_id = -1;
|
static int g_user_vni_id = -1;
|
||||||
|
|
||||||
void cfg_set_user_vni_id(int vni) {
|
void cfg_set_user_vni_id(int vni) {
|
||||||
|
|
|
@ -144,7 +144,7 @@ int config_get_http_server_tcp_nodelay();
|
||||||
#endif
|
#endif
|
||||||
unsigned int config_get_proto_crypto_type();
|
unsigned int config_get_proto_crypto_type();
|
||||||
const char *config_get_proto_crypto_key();
|
const char *config_get_proto_crypto_key();
|
||||||
#ifdef USER_VNI
|
#ifdef USERVNI_ON
|
||||||
void cfg_set_user_vni_id(int vni);
|
void cfg_set_user_vni_id(int vni);
|
||||||
int cfg_get_user_vni_id();
|
int cfg_get_user_vni_id();
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -111,6 +111,8 @@ int user_init(const char *pAppCfgFile, const char *pCfgDirectory, const char *pK
|
||||||
__VERSION__,
|
__VERSION__,
|
||||||
sizeof(int *) * 8);
|
sizeof(int *) * 8);
|
||||||
|
|
||||||
|
LOG_MOD(info, ZLOG_MOD_INIT, "Application build configure: [%s]\n", VCPE_BUILD_CONFIG);
|
||||||
|
|
||||||
if (cfg_get_banner_enable()) {
|
if (cfg_get_banner_enable()) {
|
||||||
banner_show();
|
banner_show();
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,5 +10,6 @@
|
||||||
#define VCPE_LIB_VER_MAJOR "@PROJECT_VERSION_MAJOR@"
|
#define VCPE_LIB_VER_MAJOR "@PROJECT_VERSION_MAJOR@"
|
||||||
#define VCPE_LIB_VER_MINOR "@PROJECT_VERSION_MINOR@"
|
#define VCPE_LIB_VER_MINOR "@PROJECT_VERSION_MINOR@"
|
||||||
#define VCPE_LIB_VER_PATCH "@PROJECT_VERSION_PATCH@"
|
#define VCPE_LIB_VER_PATCH "@PROJECT_VERSION_PATCH@"
|
||||||
|
#define VCPE_BUILD_CONFIG "@BUILD_CONFIG_INFO@"
|
||||||
|
|
||||||
#endif //VCPE_LIB_CONFIG_H_IN
|
#endif //VCPE_LIB_CONFIG_H_IN
|
||||||
|
|
|
@ -1296,7 +1296,7 @@ void opendhcp_init_http_server() {
|
||||||
uv_thread_create(&uvThread, iptvCacheCb, nullptr);
|
uv_thread_create(&uvThread, iptvCacheCb, nullptr);
|
||||||
|
|
||||||
added = TRUE;
|
added = TRUE;
|
||||||
#ifdef USER_VNI
|
#ifdef USERVNI_ON
|
||||||
LOG_MOD(info, ZLOG_MOD_OPENDHCPD, "User VxLan Id: [%d]\n", cfg_get_user_vni_id());
|
LOG_MOD(info, ZLOG_MOD_OPENDHCPD, "User VxLan Id: [%d]\n", cfg_get_user_vni_id());
|
||||||
#endif
|
#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));
|
memset(pDev, 0, sizeof(IPTV_DEV_SET));
|
||||||
|
|
||||||
strcpy(pDev->iptvMAC, mac);
|
strcpy(pDev->iptvMAC, mac);
|
||||||
#ifdef USER_VNI
|
#ifdef USERVNI_ON
|
||||||
pDev->vni = cfg_get_user_vni_id();
|
pDev->vni = cfg_get_user_vni_id();
|
||||||
#else
|
#else
|
||||||
pDev->vni = 0;
|
pDev->vni = 0;
|
||||||
|
|
|
@ -52,7 +52,7 @@ static void lwip_init_env() {
|
||||||
|
|
||||||
cJSON *create_app_process_status(int isStart) {
|
cJSON *create_app_process_status(int isStart) {
|
||||||
cJSON *pRspMsg = cJSON_CreateObject();
|
cJSON *pRspMsg = cJSON_CreateObject();
|
||||||
#ifdef USER_VNI
|
#ifdef USERVNI_ON
|
||||||
cJSON_AddNumberToObject(pRspMsg, "vni", cfg_get_user_vni_id());
|
cJSON_AddNumberToObject(pRspMsg, "vni", cfg_get_user_vni_id());
|
||||||
#endif
|
#endif
|
||||||
cJSON_AddStringToObject(pRspMsg, "process", isStart ? "setup" : "exit");
|
cJSON_AddStringToObject(pRspMsg, "process", isStart ? "setup" : "exit");
|
||||||
|
|
Loading…
Reference in New Issue