增加event-timestamp日志字段
This commit is contained in:
@@ -25,6 +25,28 @@
|
|||||||
|
|
||||||
#include "ntc_radius_plug.h"
|
#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;
|
static int NTC_RADIUS_PLUG_VERSION_20191211=0;
|
||||||
const char *config_file="conf/radius/radius.conf";
|
const char *config_file="conf/radius/radius.conf";
|
||||||
g_ntc_radius_plug_t g_ntc_radius_plug;
|
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:
|
case ACCT_INTERIM_INTERVAL:
|
||||||
cJSON_AddNumberToObject(radius_debug, "radius_acct_interim_interval", *(unsigned int *)(radius_body->attribute[i].value));
|
cJSON_AddNumberToObject(radius_debug, "radius_acct_interim_interval", *(unsigned int *)(radius_body->attribute[i].value));
|
||||||
break;
|
break;
|
||||||
|
case ACCT_EVENT_TIMESTAMP:
|
||||||
|
cJSON_AddNumberToObject(radius_debug, "radius_event_timestamp", *(unsigned int *)(radius_body->attribute[i].value));
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
continue;
|
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", "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_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", "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", "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_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);
|
MESA_load_profile_int_def(config_file, "RADIUS_PLUG", "DEVICE_ID", &g_ntc_radius_plug.device_id, 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user