diff options
| author | lijia <[email protected]> | 2024-04-24 19:16:24 +0800 |
|---|---|---|
| committer | lijia <[email protected]> | 2024-04-24 21:46:24 +0800 |
| commit | 414b9bcf81c482767ee25fc4e1ab427ea933e94b (patch) | |
| tree | 8a7d4274d957e01a6c523e3e040efda062b30c08 /include | |
| parent | f08462047208a3236a98d114fd7c099bd4f7cd6b (diff) | |
TSG-20863 : add get tcp rtt; dup traffic check first N pkt use config file instead of macro fix value.
Diffstat (limited to 'include')
| -rw-r--r-- | include/private/duplicate_pkt_distinguish.h | 2 | ||||
| -rw-r--r-- | include/private/sapp_global_val.h | 39 | ||||
| -rw-r--r-- | include/private/stream_internal.h | 4 | ||||
| -rw-r--r-- | include/public/stream_inc/stream_control.h | 2 |
4 files changed, 26 insertions, 21 deletions
diff --git a/include/private/duplicate_pkt_distinguish.h b/include/private/duplicate_pkt_distinguish.h index 9e9ceb0..dffd6e8 100644 --- a/include/private/duplicate_pkt_distinguish.h +++ b/include/private/duplicate_pkt_distinguish.h @@ -4,8 +4,6 @@ #include "mesa_net.h" #include "stream_internal.h" -#define SAPP_DUP_FIRST_PKT_NUM (3) /* 通过前N个包识别是否有重复流量 */ - /* 网络序, network order */ /* ipv4和ipv6分别定义, 因为ipv6地址巨大, 比例也相对较少, diff --git a/include/private/sapp_global_val.h b/include/private/sapp_global_val.h index bb7905f..b4b41da 100644 --- a/include/private/sapp_global_val.h +++ b/include/private/sapp_global_val.h @@ -18,7 +18,7 @@ enum pkt_dump_mode{ /* - vxlan��vlan_flipping�ǿ��Թ����, + vxlan��vlan_flipping�ǿ��Թ����?, vxlan������������, vlan_flipping���ڱ����Լ�����, */ @@ -42,7 +42,7 @@ typedef struct{ typedef struct{ int worker_threads; - int send_only_threads_max_num; /* �������߳��������, �Dz����̬������, sapp������Ԥ֪, ֻ��������ֵ */ + int send_only_threads_max_num; /* �������߳��������?, �Dz����̬������?, sapp������Ԥ֪, ֻ��������ֵ */ int bind_mask_array_num; long bind_mask_array[SAPP_MAX_THREADS]; long bind_mask; /* bind_mask_array�е�ÿ��������Ϊbit_indexת�ɵ�����ֵ */ @@ -117,7 +117,7 @@ typedef struct{ int timeout; int meaningful_statistics_minimum_pkt; int meaningful_statistics_minimum_byte; - unsigned short *well_known_ports_array; /* �����½�����ȷ��server��, ����4001->8000, ʵ������OICQ��C2S�������ݰ�,֮ǰ�İ汾�ᱻ��ʶ��ΪS2C����� */ + unsigned short *well_known_ports_array; /* �����½�����ȷ��server��, ����4001->8000, ʵ������OICQ��C2S�������ݰ�,֮ǰ�İ汾�ᱻ��ʶ��ΪS2C�����? */ int well_known_ports_array_num; int max_timeouts_per_sec; int max_opening_per_sec; @@ -161,9 +161,9 @@ typedef struct{ int process_latency_refresh_interval_s; int process_latency_threshold_in_us; /* �����ļ��ﵥλ��microsecond, ��Ҫ����1000 */ /* ��ȷģʽ������, fs2����ͳ��Ҳ�dz���CPU, ÿ������Ҫ����FS_operate(), - ���ͣ�þ�ȷģʽ, ����fs2���DZ������һ��ʱ������ֵ, ��Сֵ����һ��ʱ���ƽ��ֵ, ������FS_operate()����, + ���ͣ�þ�ȷģ�?, ����fs2���DZ������һ��ʱ�������?, ��Сֵ����һ��ʱ���ƽ���?, ������FS_operate()����, ��ȷ�Ƚ�����һЩ, ���������˵���FS_operate()�Ĵ���. - ����pkt_latency_accurate_enable��ƽ��ֵ�����ǶԵ�, ������Ͳ���. + ����pkt_latency_accurate_enable��ƽ��ֵ�����ǶԵ�, ������Ͳ���?. */ int process_latency_clock_id; @@ -191,7 +191,7 @@ enum __sapp_config_packet_io_deployment_mode{ SAPP_CFG_PKT_IO_DEPOLY_MODE_TRANSPARENT, }; -#define MAX_VLAN_FLIPPING_MAP_NUM (4096) /* vlan_id���Χ��0~4095, ���鳤����4096 */ +#define MAX_VLAN_FLIPPING_MAP_NUM (4096) /* vlan_id���Χ��?0~4095, ���鳤����4096 */ typedef struct{ unsigned short couple_vlan_id; /* vlan flipping�dzɶԴ���, �����±��ʾһ��vlanid, Ԫ�ص�ֵ����һ��vlanid, host order */ @@ -225,6 +225,7 @@ typedef struct{ int bloom_slice_num; enum bloom_library bloom_library; double bloom_error_rate; + int first_packets; }sapp_dup_pkt_t; typedef struct{ @@ -241,17 +242,17 @@ typedef struct{ sapp_config_packet_io_tunnel_t packet_io_tunnel; const char *input_bpf_filter; char deployment_mode_str[NAME_MAX]; /* [mirror, inline, transparent, dumpfile] */ - enum sapp_deploment_mode_t deployment_mode_bin; /* ��������ڴ���, ת����ֵ��ʽ, ��1:mirror; 2:transparent; 3:inline��, ���: enum sapp_deploment_mode_t */ + enum sapp_deploment_mode_t deployment_mode_bin; /* ��������ڴ���?, ת����ֵ��ʽ, ��1:mirror; 2:transparent; 3:inline��, ���?: enum sapp_deploment_mode_t */ sapp_config_packet_io_dev_t internal; sapp_config_packet_io_dev_t external; char pcap_dumpfile_name[NAME_MAX]; int polling_priority; /* call sapp_recv_pkt every call polling_entry times, ���ö��ٴ�polling�����һ��recv pkt, 1��ʾ�������ȼ���ͬ */ int work_percent; int without_usleep; /* ���ܲ���ģʽ, �������usleep, CPU��100% */ - int inbound_route_dir; /* ��ʾ�뾳, I2C�����ֵ��0����1 */ + int inbound_route_dir; /* ��ʾ�뾳, I2C�����ֵ��?0����1 */ char pcap_capture_direction[NAME_MAX]; /* in, out, inout */ char inject_pkt_mode_string[NAME_MAX]; - int inject_pkt_mode; /* ��ע�뷽ʽ������ֵ, ���: enum send_fake_packet_mode */ + int inject_pkt_mode; /* ��ע�뷽ʽ������ֵ, ���?: enum send_fake_packet_mode */ int inject_pkt_prepend_segment_id; unsigned short inject_mode_inline_device_sport; /* udp socket�ı���Դ�˿�, host order, ������ */ char inject_mode_single_gateway_device[NAME_MAX]; @@ -305,7 +306,7 @@ typedef struct{ const char *cfg_file_inline_dev_relative; const char *cfg_file_inline_dev_absolute; - const char *cfg_file_necessary_plug_relative; /* ��Ҫ����б�, �������ʧ��sapp���˳� */ + const char *cfg_file_necessary_plug_relative; /* ��Ҫ����б�?, �������ʧ��sapp���˳� */ const char *cfg_file_necessary_plug_absolute; const char *cfg_file_stream_compare_layer_relative; @@ -356,7 +357,7 @@ typedef struct{ typedef struct{ int ipv6_decapsulation_enabled; /* �Ƿ����ipv6���ݰ� */ - int ipv6_send_packet_enabled; /* �Ƿ�֧�ַ���ipv6���ݰ�, ��������ϵͳipv6�ں�ģ���Ƿ���� */ + int ipv6_send_packet_enabled; /* �Ƿ�֧�ַ���ipv6���ݰ�, ��������ϵͳipv6�ں�ģ���Ƿ����? */ int tcp_drop_pure_ack_pkt; /* ����û�и��صĴ�ack��, ���Խ�Լһ��������ѯ, ����ҵ���������� */ int tcp_syn_option_parse_enabled; /* �Ƿ����tcp syn��ͷ��ѡ�� */ int skip_not_ip_layer_over_eth; /* ������ip��, ��֤�ڲ���ģʽ��, ����ͨ��ϵͳ·�ɷ���rst�� */ @@ -421,15 +422,15 @@ typedef struct{ pthread_t thread_timer_loop_id; int cpu_bind_core_id_per_thread[SAPP_MAX_THREADS]; /* ���������bind_mask, ��¼ÿ��IO�����̰߳�cpu core id */ void *breakpad; - char overlay_layer_def[__ADDR_TYPE_MAX][SAPP_SUPPORT_LAYER_NUM_MAX]; /* ��ʾ��ԭʼ���Ļ����Ϸ�װ������, ��vxlan, ��Щ�㲻Ӧ�õ��ò��, ��עʱ��Ҫ����� */ - char prune_layer_def[__ADDR_TYPE_MAX][SAPP_SUPPORT_LAYER_NUM_MAX]; /* ��ʾע���ʱ��Ҫ�����IJ�, ���ڴ�������������ļ�: skip_not_iop_layer, ����vlan, mpls��, ����mirrorģʽ��, ������ע��㲻һ�������绷�� */ + char overlay_layer_def[__ADDR_TYPE_MAX][SAPP_SUPPORT_LAYER_NUM_MAX]; /* ��ʾ��ԭʼ���Ļ����Ϸ�װ������, ��vxlan, ��Щ�㲻Ӧ�õ��ò��?, ��עʱ��Ҫ����� */ + char prune_layer_def[__ADDR_TYPE_MAX][SAPP_SUPPORT_LAYER_NUM_MAX]; /* ��ʾע���ʱ��Ҫ�����IJ�?, ���ڴ�������������ļ�?: skip_not_iop_layer, ����vlan, mpls��, ����mirrorģʽ��, ������ע��㲻һ�������绷��? */ void *under_ddos_handle; pthread_t gdev_keepalive_log_thread_id; }sapp_gval_individual_fixed_t; typedef struct{ - unsigned long long count[SAPP_STAT_NUM_MAX]; /* ������, �����, �½�������, ������������ */ + unsigned long long count[SAPP_STAT_NUM_MAX]; /* ������, �����?, �½�������, ������������ */ unsigned long long length[SAPP_STAT_NUM_MAX]; /* ������, �����ݰ����ֽ��� */ unsigned long long count_per_layer[__ADDR_TYPE_MAX][SAPP_SUPPORT_LAYER_NUM_MAX]; unsigned long long length_per_layer[__ADDR_TYPE_MAX][SAPP_SUPPORT_LAYER_NUM_MAX]; @@ -456,7 +457,7 @@ struct __sapp_gval_mthread{ sapp_fuzzy_latency_stat_t fuzzy_pkt_latency_stat_per_thread; sapp_fuzzy_latency_stat_t fuzzy_pkt_latency_stat_per_entry_per_thread[SAPP_MAX_PLUG_ENTRY_NUM]; const raw_pkt_t *raw_pkt; /* ��ΪMESA_fakepacket_send_xxxϵ�к���û��raw_pkt����, Ҳû��stream_info, Ϊ����ǰ����, �����Ľӿ�, ����ȫ�ֱ������ڴ洢��ǰ�� */ - void *dup_pkt_distinguish_handle; /* ����������ڿ���, inject, ipv4_tcp, ipv4_udp, ��ͬʹ��һ��bloom��� */ + void *dup_pkt_distinguish_handle; /* ����������ڿ���?, inject, ipv4_tcp, ipv4_udp, ��ͬʹ��һ��bloom���? */ volatile int destory_env_done; //0:do nothing; 1:doing; 2:done sapp_mem_used_stat_t mem_used_stat; }__attribute__ ((aligned (64))); /* for multi-thread, must 64byte alignment */ @@ -475,16 +476,16 @@ typedef struct{ sapp_cmd_args_val_t **cmd_args_array; int cmd_args_num; char **dumpfie_list_array; /* ����--dumpfile-list����ִ�к�, �õ����ļ��б�, �ַ���ָ������ */ - int slient_mode; /* ��Ĭģʽ, ǰ̨������κ���Ϣ */ + int slient_mode; /* ��Ĭģʽ, ǰ̨������κ����? */ }sapp_cla_t; typedef struct{ sapp_cla_t cla; sapp_config_t config; - sapp_gval_individual_fixed_t individual_fixed; /* ��ʼ�����ٸı�ı��� */ - sapp_gval_individual_volatile_t *individual_volatile; /* �����������ʵʱ���µĶ������� */ - sapp_gval_mthread_t *mthread_volatile[SAPP_MAX_THREADS]; /* �����������ʵʱ���µĶ��̱߳��� */ + sapp_gval_individual_fixed_t individual_fixed; /* ��ʼ�����ٸı�ı���? */ + sapp_gval_individual_volatile_t *individual_volatile; /* �����������ʵʱ���µĶ�������? */ + sapp_gval_mthread_t *mthread_volatile[SAPP_MAX_THREADS]; /* �����������ʵʱ���µĶ��̱߳���? */ }sapp_global_t; extern embed_layer_t g_stream_compare_layer_set; diff --git a/include/private/stream_internal.h b/include/private/stream_internal.h index 06267b2..90030b5 100644 --- a/include/private/stream_internal.h +++ b/include/private/stream_internal.h @@ -304,6 +304,10 @@ struct tcpdetail_private void *pAllpktpme; //��״̬��tcp���������� struct tcp_flow_stat *flow_stat; /* 2016-07-14 lijia add, ���ڼ�¼TCP��data���ļ���, ʵ���ڴ������ͷ���projectģ�����, ����ΪNULL, */ struct tcp_flow_stat *deduce_flow_stat; /* 2018-10-30 lijia add, ���ڼ�¼������ƶϳ������ϴ��������, ���������ij���; �Լ������������, �Զ�Ӧ���յ������� */ + unsigned short rtt_csc; + unsigned short rtt_scs; + long long last_c2s_pkt_rcv_time; + long long last_s2c_pkt_rcv_time; }; struct udpdetail_private diff --git a/include/public/stream_inc/stream_control.h b/include/public/stream_inc/stream_control.h index 0eb3989..0b53511 100644 --- a/include/public/stream_inc/stream_control.h +++ b/include/public/stream_inc/stream_control.h @@ -65,6 +65,8 @@ enum MESA_stream_opt{ MSO_STREAM_S2C_ROUTE_CTX,
MSO_IP_TTL_C2S, /* opt_val type must be unsigned char, IPv4 is TTL, IPv6 is Hop Limit */
MSO_IP_TTL_S2C, /* opt_val type must be unsigned char, IPv4 is TTL, IPv6 is Hop Limit */
+ MSO_TCP_RTT_CSC, /* opt_val type must be unsigned short, the full RTT is client->tsg->server->tsg->client, this is |tsg->server->tsg| */
+ MSO_TCP_RTT_SCS, /* opt_val type must be unsigned short, the full RTT is server->tsg->client->tsg->server, this is |tsg->client->tsg| */
__MSO_MAX,
};
|
