支持处理的配置数据包类型
This commit is contained in:
@@ -23,4 +23,5 @@ if [[ -z `grep -rn '\[RADIUS_PLUG\]' ${DST}/${CONFILE}` ]];then
|
|||||||
sed -i '/\[RADIUS_PLUG\]/a\COLLECT_TOPIC=RADIUS-RECORD-LOG' ${DST}/${CONFILE}
|
sed -i '/\[RADIUS_PLUG\]/a\COLLECT_TOPIC=RADIUS-RECORD-LOG' ${DST}/${CONFILE}
|
||||||
sed -i '/\[RADIUS_PLUG\]/a\BROKERLIST=127.0.0.1:9092' ${DST}/${CONFILE}
|
sed -i '/\[RADIUS_PLUG\]/a\BROKERLIST=127.0.0.1:9092' ${DST}/${CONFILE}
|
||||||
sed -i '/\[RADIUS_PLUG\]/a\DEVICE_ID=0' ${DST}/${CONFILE}
|
sed -i '/\[RADIUS_PLUG\]/a\DEVICE_ID=0' ${DST}/${CONFILE}
|
||||||
|
sed -i '/\[RADIUS_PLUG\]/a\PACKET_TYPE_FLAG=16' ${DST}/${CONFILE}
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -8,5 +8,5 @@ if [ $1 == 0 ]; then
|
|||||||
touch ${DST}/${CONFILE}
|
touch ${DST}/${CONFILE}
|
||||||
|
|
||||||
sed -i '/fw_mail_plug.inf/d' ${DST}/plug/conflist.inf
|
sed -i '/fw_mail_plug.inf/d' ${DST}/plug/conflist.inf
|
||||||
sed -i '/\[RADIUS_PLUG\]/,+7d' ${DST}/${CONFILE}
|
sed -i '/\[RADIUS_PLUG\]/,+8d' ${DST}/${CONFILE}
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ static __attribute__((__used__)) const char * GIT_VERSION_UNKNOWN = NULL;
|
|||||||
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;
|
||||||
|
|
||||||
|
|
||||||
void set_one_maat_rule(Maat_rule_t *maat_rule)
|
void set_one_maat_rule(Maat_rule_t *maat_rule)
|
||||||
{
|
{
|
||||||
@@ -341,6 +340,13 @@ char NTC_RADIUS_PLUG_ENTRY(stSessionInfo *session_info, void **pme, int thread_s
|
|||||||
int payload_len=0,index=0;
|
int payload_len=0,index=0;
|
||||||
char *payload=NULL;
|
char *payload=NULL;
|
||||||
radius_info_t *radius_info=(radius_info_t *)session_info->app_info;
|
radius_info_t *radius_info=(radius_info_t *)session_info->app_info;
|
||||||
|
|
||||||
|
if(!((g_ntc_radius_plug.interesting_type>>(radius_info->header.code))&0x1))
|
||||||
|
{
|
||||||
|
return PROT_STATE_GIVEME;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
cJSON *radius_info_object=cJSON_CreateObject();
|
cJSON *radius_info_object=cJSON_CreateObject();
|
||||||
|
|
||||||
streamInfo2jsonObject(radius_info_object, stream);
|
streamInfo2jsonObject(radius_info_object, stream);
|
||||||
@@ -381,7 +387,7 @@ char NTC_RADIUS_PLUG_ENTRY(stSessionInfo *session_info, void **pme, int thread_s
|
|||||||
cJSON_Delete(radius_debug);
|
cJSON_Delete(radius_debug);
|
||||||
radius_debug = NULL;
|
radius_debug = NULL;
|
||||||
|
|
||||||
return APP_STATE_GIVEME;
|
return PROT_STATE_GIVEME;
|
||||||
}
|
}
|
||||||
|
|
||||||
int NTC_RADIUS_PLUG_INIT(void)
|
int NTC_RADIUS_PLUG_INIT(void)
|
||||||
@@ -402,6 +408,8 @@ int NTC_RADIUS_PLUG_INIT(void)
|
|||||||
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);
|
||||||
|
|
||||||
|
MESA_load_profile_int_def(config_file, "RADIUS_PLUG", "PACKET_TYPE_FLAG", &g_ntc_radius_plug.interesting_type, 0x10);
|
||||||
|
|
||||||
g_ntc_radius_plug.logger = MESA_create_runtime_log_handle(g_ntc_radius_plug.pathname, g_ntc_radius_plug.level);
|
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)
|
if(g_ntc_radius_plug.logger == NULL)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ extern "C"
|
|||||||
|
|
||||||
typedef struct _ntc_radius_plug
|
typedef struct _ntc_radius_plug
|
||||||
{
|
{
|
||||||
|
int interesting_type;
|
||||||
int level;
|
int level;
|
||||||
int service_id;
|
int service_id;
|
||||||
int device_id;
|
int device_id;
|
||||||
|
|||||||
Reference in New Issue
Block a user