修改读取配置文件位置,从conf/radius/radius.conf文件中获取
This commit is contained in:
@@ -25,8 +25,8 @@
|
||||
|
||||
#include "ntc_radius_plug.h"
|
||||
|
||||
static int NTC_RADIUS_PLUG_VERSION_20191206=0;
|
||||
const char *config_file="t1conf/main.conf";
|
||||
static int NTC_RADIUS_PLUG_VERSION_20191211=0;
|
||||
const char *config_file="conf/radius/radius.conf";
|
||||
g_ntc_radius_plug_t g_ntc_radius_plug;
|
||||
|
||||
|
||||
@@ -311,13 +311,13 @@ int NTC_RADIUS_PLUG_INIT(void)
|
||||
rd_kafka_topic_conf_t *topic_conf;
|
||||
|
||||
memset(&g_ntc_radius_plug,0,sizeof(g_ntc_radius_plug_t));
|
||||
MESA_load_profile_string_def(config_file, "SYSTEM", "NIC_NAME", nic_name, sizeof(nic_name), "eth0");
|
||||
MESA_load_profile_string_def(config_file, "RADIUS","LOG_PATH",g_ntc_radius_plug.pathname, sizeof(g_ntc_radius_plug.pathname), "./t1log/ntc_radius_plug/ntc_radius_plug");
|
||||
MESA_load_profile_int_def(config_file, "RADIUS", "SERVICE_ID", &g_ntc_radius_plug.service_id, 0xA2);
|
||||
MESA_load_profile_int_def(config_file, "RADIUS","LEVEL", &g_ntc_radius_plug.level, RLOG_LV_FATAL);
|
||||
MESA_load_profile_string_def(config_file, "RADIUS", "COLLECT_TOPIC", g_ntc_radius_plug.topic_name, sizeof(g_ntc_radius_plug.topic_name), "eth0");
|
||||
MESA_load_profile_string_def(config_file, "RADIUS", "BROKERLIST", g_ntc_radius_plug.brokerlist, sizeof(g_ntc_radius_plug.brokerlist), "127.0.0.1:9092");
|
||||
MESA_load_profile_int_def(config_file, "RADIUS", "DEVICE_ID", &g_ntc_radius_plug.device_id, 0);
|
||||
MESA_load_profile_string_def(config_file, "RADIUS_PLUG", "NIC_NAME", nic_name, sizeof(nic_name), "eth0");
|
||||
MESA_load_profile_string_def(config_file, "RADIUS_PLUG","LOG_PATH",g_ntc_radius_plug.pathname, sizeof(g_ntc_radius_plug.pathname), "./log/ntc_radius_plug/ntc_radius_plug");
|
||||
MESA_load_profile_int_def(config_file, "RADIUS_PLUG", "SERVICE_ID", &g_ntc_radius_plug.service_id, 0xA2);
|
||||
MESA_load_profile_int_def(config_file, "RADIUS_PLUG","LEVEL", &g_ntc_radius_plug.level, RLOG_LV_FATAL);
|
||||
MESA_load_profile_string_def(config_file, "RADIUS_PLUG", "COLLECT_TOPIC", g_ntc_radius_plug.topic_name, sizeof(g_ntc_radius_plug.topic_name), "RADIUS-RECORD-LOG");
|
||||
MESA_load_profile_string_def(config_file, "RADIUS_PLUG", "BROKERLIST", g_ntc_radius_plug.brokerlist, sizeof(g_ntc_radius_plug.brokerlist), "127.0.0.1:9092");
|
||||
MESA_load_profile_int_def(config_file, "RADIUS_PLUG", "DEVICE_ID", &g_ntc_radius_plug.device_id, 0);
|
||||
|
||||
g_ntc_radius_plug.logger = MESA_create_runtime_log_handle(g_ntc_radius_plug.pathname, g_ntc_radius_plug.level);
|
||||
if(g_ntc_radius_plug.logger == NULL)
|
||||
@@ -360,7 +360,7 @@ int NTC_RADIUS_PLUG_INIT(void)
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("INIT NTC_RADIUS_PLUG SUCCESS, VERSION: %d\n", NTC_RADIUS_PLUG_VERSION_20191206);
|
||||
printf("INIT NTC_RADIUS_PLUG SUCCESS, VERSION: %d\n", NTC_RADIUS_PLUG_VERSION_20191211);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user