OCT 1. 增加 OpenDHCPD 配置项编译宏开关
This commit is contained in:
parent
2447a88a70
commit
167000ba47
|
@ -73,8 +73,8 @@ static CFG_ITEM g_cfgItem[] = {
|
|||
DEF_CFG_ITEM(CFG_MEM_REFRESH, "watch_params.mem_refresh", VAL_INT, "10", "Memory information refresh frequency"),
|
||||
DEF_CFG_ITEM(CFG_DISK_REFRESH, "watch_params.disk_refresh", VAL_INT, "10", "Disk information refresh frequency"),
|
||||
DEF_CFG_ITEM(CFG_SENSOR_REFRESH, "watch_params.sensor_refresh", VAL_INT, "10", "Sensor information refresh frequency"),
|
||||
/* 数据库相配置 */
|
||||
/* Redis配置 */
|
||||
/* 数据库相配置 */
|
||||
/* Redis配置 */
|
||||
#ifdef USED_REDIS
|
||||
DEF_CFG_ITEM(CFG_DB_REDIS_SERVER, "database.redis_server", VAL_STR, "127.0.0.1", "Redis database server ip address"),
|
||||
DEF_CFG_ITEM(CFG_DB_REDIS_PORT, "database.redis_port", VAL_INT, "6379", "Redis database server port"),
|
||||
|
@ -88,7 +88,7 @@ static CFG_ITEM g_cfgItem[] = {
|
|||
DEF_CFG_ITEM(CFG_DB_MYSQL_PASSWD, "database.mysql_passwd", VAL_STR, "", "MySQL database server password"),
|
||||
DEF_CFG_ITEM(CFG_DB_MYSQL_DB_NAME, "database.mysql_database", VAL_STR, ".main", "MySQL database used"),
|
||||
#endif
|
||||
/* SQLite3配置 */
|
||||
/* SQLite3配置 */
|
||||
#ifdef USED_SQLITE
|
||||
DEF_CFG_ITEM(CFG_DB_SQLITE_DB_NAME, "database.sqlite_dbname", VAL_STR, "", "SQLite3 database file name"),
|
||||
DEF_CFG_ITEM(CFG_DB_SQLITE_PASSWD, "database.sqlite_passwd", VAL_STR, ".main", "SQLite3 database password"),
|
||||
|
@ -107,9 +107,12 @@ static CFG_ITEM g_cfgItem[] = {
|
|||
DEF_CFG_ITEM(CFG_HTTP_SVR_ADDR, "http_svr.listen_addr", VAL_STR, "0.0.0.0", "Network address to listen on"),
|
||||
DEF_CFG_ITEM(CFG_HTTP_SVR_PORT, "http_svr.listen_port", VAL_INT, "6789", "Network port to listen on"),
|
||||
DEF_CFG_ITEM(CFG_HTTP_SVR_TCP_NODELAY, "http_svr.tcp_nodelay", VAL_BOOL, "1", "TCP delay switch"),
|
||||
#ifdef OPENDHCPD_ON
|
||||
// 配置DHCP服务器
|
||||
DEF_CFG_ITEM(CFG_DHCP_LISTEN_ON, "dhcp_server.listen_on", VAL_ARRAY_STR, "", "DHCP listen interface"),
|
||||
DEF_CFG_ITEM(CFG_DHCP_REPLICATION_SVR, "dhcp_server.replication", VAL_ARRAY_STR, "", "DHCP replication server configure"),
|
||||
DEF_CFG_ITEM(CFG_DHCP_RANGE_SET, "dhcp_server.range_set", VAL_ARRAY_OBJ, "", "DHCP IP pool"),
|
||||
#endif
|
||||
};
|
||||
|
||||
static int cfg_is_upgrade(PCONFIG_ITEM pItem) {
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
//
|
||||
#include "config.h"
|
||||
|
||||
#ifdef OPENDHCPD_ON
|
||||
const vector config_get_dhcp_server_range_set() {
|
||||
return cfg_get_vector(CFG_DHCP_RANGE_SET);
|
||||
}
|
||||
|
@ -14,6 +15,7 @@ const vector config_get_dhcp_listen_on() {
|
|||
const vector config_get_dhcp_replication_svr() {
|
||||
return cfg_get_vector(CFG_DHCP_REPLICATION_SVR);
|
||||
}
|
||||
#endif
|
||||
|
||||
const char* config_get_http_server_addr() {
|
||||
return cfg_get_string_value(CFG_HTTP_SVR_ADDR);
|
||||
|
|
|
@ -129,9 +129,11 @@ const char *config_get_vxlan_pkg_filter();
|
|||
const char *config_get_http_server_addr();
|
||||
unsigned int config_get_http_server_port();
|
||||
int config_get_http_server_tcp_nodelay();
|
||||
#ifdef OPENDHCPD_ON
|
||||
const vector config_get_dhcp_server_range_set();
|
||||
const vector config_get_dhcp_listen_on();
|
||||
const vector config_get_dhcp_replication_svr();
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -8,7 +8,7 @@ INCLUDE_DIRECTORIES(../libs/include ./ ../httpserver/include)
|
|||
|
||||
FILE(GLOB DHCPD_HEADS ./*.h)
|
||||
|
||||
ADD_DEFINITIONS(-Wno-format-overflow -std=c++11)
|
||||
ADD_DEFINITIONS(-Wno-format-overflow -std=c++11 ${COMMON_DEFINE})
|
||||
#ADD_EXECUTABLE(${PROJECT_TARGET} opendhcpd.cpp ${DHCPD_HEADS})
|
||||
ADD_LIBRARY(${DHCPD_PROJECT_TARGET} opendhcpd.cpp ${DHCPD_HEADS} query.cpp)
|
||||
|
||||
|
|
Loading…
Reference in New Issue