From f93c343c5f061638df4558f70d04bc3517c85802 Mon Sep 17 00:00:00 2001 From: liuxueli Date: Fri, 20 Dec 2019 18:03:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0event-timestamp=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ntc_radius_plug.cpp | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/ntc_radius_plug.cpp b/src/ntc_radius_plug.cpp index b8829a1..3dc5e78 100644 --- a/src/ntc_radius_plug.cpp +++ b/src/ntc_radius_plug.cpp @@ -25,6 +25,28 @@ #include "ntc_radius_plug.h" +#ifdef __cplusplus +extern "C" +{ +#endif + +#define GIT_VERSION_CATTER(v) __attribute__((__used__)) const char * GIT_VERSION_##v = NULL +#define GIT_VERSION_EXPEND(v) GIT_VERSION_CATTER(v) + +/* VERSION TAG */ +#ifdef GIT_VERSION +GIT_VERSION_EXPEND(GIT_VERSION); +#else +static __attribute__((__used__)) const char * GIT_VERSION_UNKNOWN = NULL; +#endif +#undef GIT_VERSION_CATTER +#undef GIT_VERSION_EXPEND + +#ifdef __cplusplus +} +#endif + + 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; @@ -156,6 +178,9 @@ int get_radius_object_element(cJSON *radius_info_object, cJSON *radius_debug, ra case ACCT_INTERIM_INTERVAL: cJSON_AddNumberToObject(radius_debug, "radius_acct_interim_interval", *(unsigned int *)(radius_body->attribute[i].value)); break; + case ACCT_EVENT_TIMESTAMP: + cJSON_AddNumberToObject(radius_debug, "radius_event_timestamp", *(unsigned int *)(radius_body->attribute[i].value)); + break; default: continue; } @@ -314,7 +339,7 @@ int NTC_RADIUS_PLUG_INIT(void) 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_int_def(config_file, "RADIUS_PLUG","LOG_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);