diff --git a/CMakeLists.txt b/CMakeLists.txt index 3e6514f..8f3e4c0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,11 +3,11 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.10 FATAL_ERROR) PROJECT(vCPE_project) OPTION(VCPE_AGENT "Enable vCPE agent test application" OFF) -OPTION(USED_LWIP "PPPoE for vCPE" OFF) +OPTION(USED_LWIP "PPPoE of LWIP support for vCPE" OFF) OPTION(USED_OPENDHCPD "DHCP server for vCPE" ON) OPTION(USED_OPENDHCPDDNS "DHCP And DNS server for vCPE" OFF) - +# 数据库开关 OPTION(USED_REDIS "Add redis database support for vCPE" OFF) OPTION(USED_MYSQL "Add mysql database support for vCPE" OFF) OPTION(USED_SQLITE "Add sqlite3 database support for vCPE" ON) diff --git a/srcs/libs/configure/config_help.c b/srcs/libs/configure/config_help.c index 083c462..fd697d9 100644 --- a/srcs/libs/configure/config_help.c +++ b/srcs/libs/configure/config_help.c @@ -99,6 +99,16 @@ unsigned int cfg_get_sensor_refresh_period() { return cfg_get_integral_value(CFG_SENSOR_REFRESH); } +#ifdef USED_SQLITE +const char *cfg_get_sqlite_db_name() { + return cfg_get_string_value(CFG_DB_SQLITE_DB_NAME); +} + +const char *cfg_get_sqlite_passwd() { + return cfg_get_string_value(CFG_DB_SQLITE_PASSWD); +} +#endif + #ifdef USED_REDIS const char *cfg_get_redis_server() { return cfg_get_string_value(CFG_DB_REDIS_SERVER); diff --git a/srcs/libs/include/config.h b/srcs/libs/include/config.h index 01e480f..9484c3b 100644 --- a/srcs/libs/include/config.h +++ b/srcs/libs/include/config.h @@ -103,6 +103,10 @@ const char *cfg_get_mysql_user(); const char *cfg_get_mysql_passwd(); const char *cfg_get_mysql_database(); #endif +#ifdef USED_SQLITE +const char *cfg_get_sqlite_db_name(); +const char *cfg_get_sqlite_passwd(); +#endif int cfg_get_zero_mq_port(); const char *cfg_get_zero_mq_data_path();