summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorliuxueli <[email protected]>2019-12-20 18:03:42 +0800
committerliuxueli <[email protected]>2019-12-20 18:03:42 +0800
commitf93c343c5f061638df4558f70d04bc3517c85802 (patch)
tree64bcb56bedd4ee1fed183766599bd7d70e9c8328
parentf1e0dfa1c65717f33dbb164f915981cf8b795ef2 (diff)
增加event-timestamp日志字段
-rw-r--r--src/ntc_radius_plug.cpp27
1 files changed, 26 insertions, 1 deletions
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);