2022-05-10 06:43:27 +00:00
|
|
|
//
|
|
|
|
// Created by xajhu on 2021/7/1 0001.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef DAEMON_AGENT_INCLUDE_CONFIG_H
|
|
|
|
#define DAEMON_AGENT_INCLUDE_CONFIG_H
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define DEFAULT_INTEGRAL_ERR_VALUE (0x0AFFFFAA)
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
VALUE_TYPE_INTEGRAL = 0,
|
|
|
|
VALUE_TYPE_FLOAT = 1,
|
|
|
|
VALUE_TYPE_STRING = 2,
|
|
|
|
VALUE_TYPE_BOOL = 3,
|
|
|
|
VALUE_TYPE_ARRAY = 4,
|
|
|
|
} CONFIG_VALUE_TYPE;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
CFG_DIRECTORY = 0,
|
|
|
|
CFG_CURL_CA_PATH = 1,
|
|
|
|
CFG_BANNER_SHOW = 2,
|
|
|
|
CFG_HARDWARE_WATCH = 3,
|
|
|
|
CFG_HARDWARE_REFRESH = 4,
|
|
|
|
CFG_WATCH_CPU = 5,
|
|
|
|
CFG_WATCH_MEMORY = 6,
|
|
|
|
CFG_WATCH_DISK = 7,
|
|
|
|
CFG_WATCH_SENSOR = 8,
|
|
|
|
CFG_CPU_REFRESH = 9,
|
|
|
|
CFG_MEM_REFRESH = 10,
|
|
|
|
CFG_DISK_REFRESH = 11,
|
|
|
|
CFG_SENSOR_REFRESH = 12,
|
|
|
|
CFG_DB_REDIS_SERVER = 13,
|
|
|
|
CFG_DB_REDIS_PORT = 14,
|
|
|
|
CFG_DB_REDIS_PASSWD = 15,
|
|
|
|
CFG_DB_MYSQL_SERVER = 16,
|
|
|
|
CFG_DB_MYSQL_PORT = 17,
|
|
|
|
CFG_DB_MYSQL_USER = 18,
|
|
|
|
CFG_DB_MYSQL_PASSWD = 19,
|
|
|
|
CFG_DB_MYSQL_DB_NAME = 20,
|
|
|
|
CFG_MQ_SVR_PORT = 21,
|
2022-06-06 03:46:09 +00:00
|
|
|
CFG_MQ_DATA_CH = 22,
|
2022-06-10 09:03:27 +00:00
|
|
|
CFG_VXLAN_NIC_NAME = 23,
|
2022-06-06 03:46:09 +00:00
|
|
|
CFG_VXLAN_SUPPORT = 24,
|
2022-06-10 09:03:27 +00:00
|
|
|
CFG_VXLAN_PEER_IP = 25,
|
|
|
|
CFG_VXLAN_PEER_MAC = 26,
|
2022-06-12 10:00:43 +00:00
|
|
|
CFG_VXLAN_PKG_FILTER = 27,
|
2022-05-10 06:43:27 +00:00
|
|
|
CONFIG_ITEM_ID_MAX
|
|
|
|
} CONFIG_ITEM_ID;
|
|
|
|
|
|
|
|
const char *get_cur_process_dir();
|
|
|
|
|
|
|
|
const char *config_get_ssl_ca_path();
|
|
|
|
const char *cfg_get_config_directory();
|
|
|
|
int cfg_get_banner_enable();
|
|
|
|
int cfg_get_hardware_watch_enable();
|
|
|
|
unsigned int cfg_get_hardware_refresh_period();
|
|
|
|
int cfg_get_watch_cpu();
|
|
|
|
int cfg_get_watch_memory();
|
|
|
|
int cfg_get_watch_disk();
|
|
|
|
int cfg_get_watch_sensor();
|
|
|
|
unsigned int cfg_get_cpu_refresh_period();
|
|
|
|
unsigned int cfg_get_mem_refresh_period();
|
|
|
|
unsigned int cfg_get_disk_refresh_period();
|
|
|
|
unsigned int cfg_get_sensor_refresh_period();
|
|
|
|
const char *cfg_get_redis_server();
|
|
|
|
int cfg_get_redis_port();
|
|
|
|
const char *cfg_get_redis_passwd();
|
|
|
|
const char *cfg_get_mysql_server();
|
|
|
|
int cfg_get_mysql_port();
|
|
|
|
const char *cfg_get_mysql_user();
|
|
|
|
const char *cfg_get_mysql_passwd();
|
|
|
|
const char *cfg_get_mysql_database();
|
|
|
|
int cfg_get_zero_mq_port();
|
2022-06-06 03:46:09 +00:00
|
|
|
int cfg_get_zero_mq_data_channel();
|
2022-05-10 06:43:27 +00:00
|
|
|
|
|
|
|
const char *cfg_get_string_value(CONFIG_ITEM_ID id);
|
|
|
|
long double cfg_get_float_value(CONFIG_ITEM_ID id);
|
|
|
|
int cfg_get_bool_value(CONFIG_ITEM_ID id);
|
|
|
|
long long cfg_get_integral_value(CONFIG_ITEM_ID id);
|
|
|
|
int init_config_system(const char *pCfgFile, const char *pKey);
|
|
|
|
void config_item_dump(const char *titleMessage);
|
|
|
|
const char *config_item_dump_fmt(const char *titleMessage);
|
|
|
|
const char *get_config_key(const char *pKeygen);
|
|
|
|
const char *get_config_keygen();
|
2022-06-02 08:18:43 +00:00
|
|
|
int cfg_get_support_vxlan();
|
2022-06-10 09:03:27 +00:00
|
|
|
const char *config_get_vxlan_nic_name();
|
|
|
|
const char *config_get_vxlan_peer_mac();
|
|
|
|
const char *config_get_vxlan_peer_ip();
|
2022-06-12 10:00:43 +00:00
|
|
|
const char *config_get_vxlan_pkg_filter();
|
2022-05-10 06:43:27 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif//DAEMON_AGENT_INCLUDE_CONFIG_H
|