TSG-10769: 一个链接命中多个monitor策略,支持通知多个数据包存储路径
This commit is contained in:
@@ -135,6 +135,12 @@ struct mirrored_stat
|
||||
int compile_id;
|
||||
};
|
||||
|
||||
struct policy_capture_result
|
||||
{
|
||||
int compile_id;
|
||||
char *packet_path;
|
||||
};
|
||||
|
||||
struct tsg_notify_data
|
||||
{
|
||||
int compile_id;
|
||||
@@ -149,7 +155,8 @@ struct tsg_notify_data
|
||||
struct tsg_notify_execution_result
|
||||
{
|
||||
int stat_mirrored_cnt;
|
||||
char *capture_packet_path;
|
||||
int capture_result_cnt;
|
||||
struct policy_capture_result capture_result[MAX_RESULT_NUM];
|
||||
struct mirrored_stat stat_mirrored[MAX_RESULT_NUM];
|
||||
};
|
||||
|
||||
|
||||
@@ -1513,22 +1513,27 @@ int set_notify_execution_result(struct tsg_log_instance_t *_instance, struct TLD
|
||||
return 0;
|
||||
}
|
||||
|
||||
TLD_delete(_handle, _instance->id2field[LOG_COMMON_MIRRORED_PKTS].name);
|
||||
TLD_delete(_handle, _instance->id2field[LOG_COMMON_MIRRORED_BYTES].name);
|
||||
TLD_delete(_handle, _instance->id2field[LOG_COMMON_PACKET_CAPTURE_FILE].name);
|
||||
|
||||
for(i=0; i<execution_result->stat_mirrored_cnt; i++)
|
||||
{
|
||||
if(execution_result->stat_mirrored[i].compile_id==p_result->config_id)
|
||||
{
|
||||
TLD_delete(_handle, _instance->id2field[LOG_COMMON_MIRRORED_PKTS].name);
|
||||
TLD_delete(_handle, _instance->id2field[LOG_COMMON_MIRRORED_BYTES].name);
|
||||
TLD_append(_handle, _instance->id2field[LOG_COMMON_MIRRORED_PKTS].name, (void *)(execution_result->stat_mirrored[i].packets), TLD_TYPE_LONG);
|
||||
TLD_append(_handle, _instance->id2field[LOG_COMMON_MIRRORED_BYTES].name, (void *)(execution_result->stat_mirrored[i].bytes), TLD_TYPE_LONG);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(execution_result->capture_packet_path!=NULL)
|
||||
for(i=0; i<execution_result->capture_result_cnt; i++)
|
||||
{
|
||||
TLD_delete(_handle, _instance->id2field[LOG_COMMON_PACKET_CAPTURE_FILE].name);
|
||||
TLD_append(_handle, _instance->id2field[LOG_COMMON_PACKET_CAPTURE_FILE].name, (void *)(execution_result->capture_packet_path), TLD_TYPE_STRING);
|
||||
if(execution_result->capture_result[i].compile_id==p_result->config_id)
|
||||
{
|
||||
TLD_append(_handle, _instance->id2field[LOG_COMMON_PACKET_CAPTURE_FILE].name, (void *)(execution_result->capture_result[i].packet_path), TLD_TYPE_STRING);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user