OCT 更新编辑配置,增加DHCP/DNS双栈服务支持编译

This commit is contained in:
huangxin 2022-10-28 15:37:01 +08:00
parent 189f61d953
commit 31ab5d8fc6
3 changed files with 24 additions and 4 deletions

View File

@ -39,6 +39,11 @@ if (USED_OPENDHCPD)
ADD_SUBDIRECTORY(srcs/open_dhcp) ADD_SUBDIRECTORY(srcs/open_dhcp)
endif () endif ()
if (USED_OPENDHCPDDNS)
MESSAGE("Select Option USED_OPENDHCPDDNS")
ADD_SUBDIRECTORY(srcs/dual_server)
endif ()
if (USED_LWIP OR VCPE_AGENT) if (USED_LWIP OR VCPE_AGENT)
ADD_SUBDIRECTORY(srcs/lwip) ADD_SUBDIRECTORY(srcs/lwip)
endif () endif ()

View File

@ -40,6 +40,10 @@ if (USED_OPENDHCPD)
ADD_DEFINITIONS(-DOPENDHCPD_ON) ADD_DEFINITIONS(-DOPENDHCPD_ON)
endif () endif ()
if (USED_OPENDHCPDDNS)
ADD_DEFINITIONS(-DOPENDHCPDDNS_ON)
endif ()
ADD_EXECUTABLE(${PROJECT_TARGET} ${VCPE_SRC} ${VCPE_HEADS} vcpe_main.c) ADD_EXECUTABLE(${PROJECT_TARGET} ${VCPE_SRC} ${VCPE_HEADS} vcpe_main.c)
if (VCPE_AGENT) if (VCPE_AGENT)
@ -50,7 +54,9 @@ if (USED_LWIP)
TARGET_LINK_LIBRARIES(${PROJECT_TARGET} lwip_linux) TARGET_LINK_LIBRARIES(${PROJECT_TARGET} lwip_linux)
endif () endif ()
if (USED_OPENDHCPD) if (USED_OPENDHCPDDNS)
TARGET_LINK_LIBRARIES(${PROJECT_TARGET} dualserverd)
else ()
TARGET_LINK_LIBRARIES(${PROJECT_TARGET} opendhcpd) TARGET_LINK_LIBRARIES(${PROJECT_TARGET} opendhcpd)
endif () endif ()

View File

@ -10,7 +10,14 @@
#include "user_info.h" #include "user_info.h"
#include "lwip/tcpip.h" #include "lwip/tcpip.h"
#endif #endif
#ifdef OPENDHCPD_ON
#include "open_dhcp/dhcpd.h" #include "open_dhcp/dhcpd.h"
#endif
#ifdef OPENDHCPDDNS_ON
#include "dual_server/dualsvr.h"
#endif
#if LWIP_ON #if LWIP_ON
static void test_init(void *arg) { /* remove compiler warning */ static void test_init(void *arg) { /* remove compiler warning */
@ -20,7 +27,6 @@ static void test_init(void *arg) { /* remove compiler warning */
srand((unsigned int)time(0)); srand((unsigned int)time(0));
sys_sem_signal(init_sem); sys_sem_signal(init_sem);
} }
@ -37,7 +43,10 @@ static void lwip_init_env() {
#endif #endif
int main(int argc, char **argv) { int main(int argc, char **argv) {
#if OPENDHCPD_ON
#ifdef OPENDHCPDDNS_ON
return dual_server_main(argc, argv);
#elif OPENDHCPDDNS
return dhcpd_main(argc, argv); return dhcpd_main(argc, argv);
#else #else
uv_setup_args(argc, argv); uv_setup_args(argc, argv);