TSG-7968: TCP会话创建延迟无数据
This commit is contained in:
@@ -3,7 +3,7 @@ variables:
|
||||
GIT_STRATEGY: "clone"
|
||||
BUILD_PADDING_PREFIX: /tmp/padding_for_CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX_PREFIX_PREFIX_PREFIX_PREFIX_PREFIX/
|
||||
INSTALL_PREFIX: "/home/mesasoft/sapp_run/"
|
||||
INSTALL_DEPENDENCY_LIBRARY: libMESA_handle_logger-devel libcjson-devel libMESA_field_stat2-devel sapp sapp-devel framework_env libMESA_prof_load-devel http-devel dns-devel ftp-devel mail-devel ssl-devel librdkafka-devel libmaatframe-devel quic-devel mesa_sip-devel gtp-devel libMESA_htable-devel libasan mrzcpd rapidjson-devel
|
||||
INSTALL_DEPENDENCY_LIBRARY: libMESA_handle_logger-devel libcjson-devel libMESA_field_stat2-devel sapp sapp-devel framework_env libMESA_prof_load-devel http-devel dns-devel ftp-devel mail-devel ssl-devel librdkafka-devel libmaatframe-devel quic-devel mesa_sip-devel gtp-devel libMESA_htable-devel libasan mrzcpd rapidjson-devel libMESA_jump_layer-devel
|
||||
|
||||
stages:
|
||||
- build
|
||||
|
||||
@@ -8,7 +8,7 @@ include_directories(${CMAKE_SOURCE_DIR}/inc)
|
||||
include_directories(/opt/MESA/include/MESA/)
|
||||
include_directories(/usr/include/)
|
||||
|
||||
set(TSG_MASTER_DEPEND_DYN_LIB MESA_handle_logger MESA_prof_load maatframe pthread MESA_field_stat2 rdkafka cjson marsio)
|
||||
set(TSG_MASTER_DEPEND_DYN_LIB MESA_handle_logger MESA_prof_load maatframe pthread MESA_field_stat2 rdkafka cjson marsio MESA_jump_layer)
|
||||
|
||||
set(CMAKE_INSTALL_PREFIX /home/mesasoft/sapp_run)
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <MESA/stream.h>
|
||||
#include <MESA/MESA_prof_load.h>
|
||||
#include <MESA/MESA_handle_logger.h>
|
||||
#include <MESA/MESA_jump_layer.h>
|
||||
|
||||
#include "app_label.h"
|
||||
#include "tsg_rule.h"
|
||||
@@ -987,6 +988,37 @@ void set_session_attribute_label(const struct streaminfo *a_stream, enum TSG_ATT
|
||||
return ;
|
||||
}
|
||||
|
||||
static int set_tcp_establish_latency_ms(const struct streaminfo *a_tcp, int thread_seq,const void *ip_hdr)
|
||||
{
|
||||
struct tcphdr *tcp=NULL;
|
||||
|
||||
if(ip_hdr==NULL || a_tcp==NULL)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
switch(a_tcp->addr.addrtype)
|
||||
{
|
||||
case ADDR_TYPE_IPV4:
|
||||
tcp=(struct tcphdr *)MESA_net_jump_to_layer(ip_hdr, __ADDR_TYPE_IP_PAIR_V4, ADDR_TYPE_TCP);
|
||||
break;
|
||||
case ADDR_TYPE_IPV6:
|
||||
tcp=(struct tcphdr *)MESA_net_jump_to_layer(ip_hdr, __ADDR_TYPE_IP_PAIR_V6, ADDR_TYPE_TCP);
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
|
||||
if(!(tcp->syn))
|
||||
{
|
||||
set_session_attribute_label(a_tcp, TSG_ATTRIBUTE_TYPE_ESTABLISH_LATECY, NULL, 0, a_tcp->threadnum);
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int tsg_set_device_id_to_telegraf(char *device_sn)
|
||||
{
|
||||
char buff[128]={0};
|
||||
@@ -1731,6 +1763,24 @@ extern "C" unsigned char TSG_MASTER_UDP_ENTRY(const struct streaminfo *a_udp, vo
|
||||
|
||||
extern "C" unsigned char TSG_MASTER_TCPALL_ENTRY(const struct streaminfo *a_tcp, void **pme, int thread_seq, const void *a_packet)
|
||||
{
|
||||
if(*pme==NULL)
|
||||
{
|
||||
*pme=(void *)get_struct_project(a_tcp, g_tsg_para.tcpall_project_id);
|
||||
if(*pme==NULL)
|
||||
{
|
||||
*pme=(struct tcpall_context *)dictator_malloc(thread_seq, sizeof(struct tcpall_context));
|
||||
memset(*pme, 0, sizeof(struct tcpall_context));
|
||||
set_struct_project(a_tcp, g_tsg_para.tcpall_project_id, (void *)(*pme));
|
||||
}
|
||||
}
|
||||
|
||||
struct tcpall_context *_context=(struct tcpall_context *)(*pme);
|
||||
|
||||
if(_context->set_latency_flag==0)
|
||||
{
|
||||
_context->set_latency_flag=set_tcp_establish_latency_ms(a_tcp, thread_seq, a_packet);
|
||||
}
|
||||
|
||||
return tsg_master_all_entry(a_tcp, a_tcp->pktstate, pme, thread_seq, a_packet);
|
||||
}
|
||||
|
||||
|
||||
@@ -199,6 +199,7 @@ struct mirrored_vlan
|
||||
|
||||
struct tcpall_context
|
||||
{
|
||||
int set_latency_flag;
|
||||
int vlan_num;
|
||||
enum TSG_METHOD_TYPE method_type;
|
||||
union
|
||||
|
||||
@@ -2550,14 +2550,18 @@ int tsg_set_vlan_id_to_tcpall(const struct streaminfo *a_stream, struct tcpall_c
|
||||
_context=(struct tcpall_context *)dictator_malloc(thread_seq, sizeof(struct tcpall_context));
|
||||
memset(_context, 0, sizeof(struct tcpall_context));
|
||||
_context->method_type=TSG_METHOD_TYPE_MIRRORED;
|
||||
|
||||
_context->vlan=(struct mirrored_vlan *)dictator_malloc(thread_seq, sizeof(struct mirrored_vlan)*MAX_RESULT_NUM);
|
||||
memset(_context->vlan, 0, sizeof(struct mirrored_vlan));
|
||||
|
||||
set_struct_project(a_stream, g_tsg_para.tcpall_project_id, (void *)_context);
|
||||
}
|
||||
|
||||
|
||||
if(_context->method_type==TSG_METHOD_TYPE_MIRRORED || _context->method_type==TSG_METHOD_TYPE_UNKNOWN)
|
||||
{
|
||||
if(_context->vlan==NULL)
|
||||
{
|
||||
_context->method_type=TSG_METHOD_TYPE_MIRRORED;
|
||||
_context->vlan=(struct mirrored_vlan *)dictator_malloc(thread_seq, sizeof(struct mirrored_vlan)*MAX_RESULT_NUM);
|
||||
memset(_context->vlan, 0, sizeof(struct mirrored_vlan));
|
||||
}
|
||||
|
||||
for(i=0; i<vlan_num; i++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user