From 809913da5db3c6cb27eae7091c44dafb76ae2f23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=98=95?= Date: Thu, 15 Dec 2022 16:26:39 +0800 Subject: [PATCH] =?UTF-8?q?OCT=20=E4=BF=AE=E6=AD=A3=E9=83=A8=E5=88=86?= =?UTF-8?q?=E7=BC=96=E8=AF=91=E9=80=89=E9=A1=B9=E5=BC=80=E5=85=B3=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- srcs/CMakeLists.txt | 6 ++++-- srcs/libs/CMakeLists.txt | 8 ++++---- srcs/libs/cmdline/cmd_menu.c | 2 +- srcs/libs/configure/config.c | 3 ++- srcs/vcpe_main.c | 12 +----------- 5 files changed, 12 insertions(+), 19 deletions(-) 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);