diff --git a/srcs/CMakeLists.txt b/srcs/CMakeLists.txt index 957a782..c956478 100644 --- a/srcs/CMakeLists.txt +++ b/srcs/CMakeLists.txt @@ -51,10 +51,12 @@ ENDIF () IF (USED_OPENDHCPDDNS) TARGET_LINK_LIBRARIES(${PROJECT_TARGET} dualserverd) -ELSE () - TARGET_LINK_LIBRARIES(${PROJECT_TARGET} opendhcpd) ENDIF () +IF (USED_OPENDHCPD) + TARGET_LINK_LIBRARIES(${PROJECT_TARGET} opendhcpd) +ENDIF() + TARGET_LINK_LIBRARIES(${PROJECT_TARGET} common) TARGET_LINK_LIBRARIES(${PROJECT_TARGET} ${COMMON_LIBS}) TARGET_INCLUDE_DIRECTORIES(${PROJECT_TARGET} PUBLIC ${PROJECT_BINARY_DIR}/../) diff --git a/srcs/libs/CMakeLists.txt b/srcs/libs/CMakeLists.txt index 07e5c3a..2f515c9 100644 --- a/srcs/libs/CMakeLists.txt +++ b/srcs/libs/CMakeLists.txt @@ -57,9 +57,9 @@ LINK_LIBRARIES(${COMMON_LIBS}) ADD_LIBRARY(${LIB_PROJECT_TARGET} ${C_SRC} ${C_HEADS}) TARGET_LINK_LIBRARIES(${LIB_PROJECT_TARGET} haywire) -TARGET_LINK_LIBRARIES(${LIB_PROJECT_TARGET} opendhcpd) -#TARGET_INCLUDE_DIRECTORIES(${LIB_PROJECT_TARGET} PUBLIC "${PROJECT_BINARY_DIR}/srcs/libs") -TARGET_INCLUDE_DIRECTORIES(${LIB_PROJECT_TARGET} PUBLIC ${PROJECT_BINARY_DIR}/) +IF (USED_OPENDHCPD) + TARGET_LINK_LIBRARIES(${LIB_PROJECT_TARGET} opendhcpd) +ENDIF() -MESSAGE(+++++++++++++++++++${PROJECT_BINARY_DIR}) \ No newline at end of file +TARGET_INCLUDE_DIRECTORIES(${LIB_PROJECT_TARGET} PUBLIC ${PROJECT_BINARY_DIR}/) \ No newline at end of file diff --git a/srcs/libs/cmdline/cmd_menu.c b/srcs/libs/cmdline/cmd_menu.c index 275377d..bf8fab1 100644 --- a/srcs/libs/cmdline/cmd_menu.c +++ b/srcs/libs/cmdline/cmd_menu.c @@ -366,6 +366,7 @@ typedef struct { const char *pIfName; } DHCPD_SETUP, *PDHCPD_SETUP; +#ifdef OPENDHCPD_ON static void dhcpd_task(void *pArg) { PDHCPD_SETUP p = (PDHCPD_SETUP)pArg; @@ -388,7 +389,6 @@ static void dhcpd_task(void *pArg) { } } -#if OPENDHCPD_ON static int on_cmd7(void *pTbl[], const char *pName, void *pInfo) { int ret; PDHCPD_SETUP p; diff --git a/srcs/libs/configure/config.c b/srcs/libs/configure/config.c index 632c17c..377318d 100644 --- a/srcs/libs/configure/config.c +++ b/srcs/libs/configure/config.c @@ -251,6 +251,7 @@ static int load_array_obj(const char *pKeyName, PCONFIG_ITEM pValue) { config_setting_t *pObj = config_setting_get_elem(pItem, i); switch (pValue->cfgId) { +#if OPENDHCPD_ON case CFG_DHCP_RANGE_SET: { zvect_index idx = -1; const char *rangAddr, *subnet, *dnsSvr, *gateway; @@ -282,7 +283,7 @@ static int load_array_obj(const char *pKeyName, PCONFIG_ITEM pValue) { pValue->isChanged = TRUE; } } break; - +#endif default: break; } diff --git a/srcs/vcpe_main.c b/srcs/vcpe_main.c index be1e6fc..8fefbf7 100644 --- a/srcs/vcpe_main.c +++ b/srcs/vcpe_main.c @@ -10,6 +10,7 @@ #include "init.h" #include "prj_config.h" +#include "user_errno.h" #if LWIP_ON #include "user_info.h" @@ -49,17 +50,6 @@ static void lwip_init_env() { #endif int main(int argc, char **argv) { - const char *pJson = - "{\n" - " \"ver\": 3,\n" - " \"cryptoType\": 1,\n" - " \"timeStamp\": 1599187216753,\n" - " \"msgContent\": " - "\"ewogICAgInVzZXJNYWMiOiBbCiAgICAgICIwMDowYzoyOTpiNTpkMzozYSIsCiAgICAgICIwMDowYzoyOTpiNTpk" - "MzozYiIsCiAgICAgICIw" - "MDowYzoyOTowZDo2Nzo2ZSIsCiAgICBdCn0=\"\n" - "}"; - int ret; #ifdef OPENDHCPDDNS_ON return dual_server_main(argc, argv);