From 6f47bd421d5f9016eb988f71c12b4cb013fc8da1 Mon Sep 17 00:00:00 2001 From: zzz9527me Date: Tue, 12 Jul 2022 15:15:21 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=8A=8Astring=E7=B1=BB=E5=9E=8B=E6=94=B9?= =?UTF-8?q?=E4=B8=BAbytes=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ApmBaseDataFlow.proto | 10 +++++----- AppFlow.proto | 8 ++++---- BacktrackingFlow.proto | 38 +++++++++++++++++++------------------- BussFlowDb.proto | 24 ++++++++++++------------ BussFlowExternal.proto | 16 ++++++++-------- BussFlowMidd.proto | 18 +++++++++--------- BussFlowWeb.proto | 34 +++++++++++++++++----------------- UsrFlow.proto | 14 ++++++++------ 8 files changed, 82 insertions(+), 80 deletions(-) diff --git a/ApmBaseDataFlow.proto b/ApmBaseDataFlow.proto index fa3a247..ccd393b 100644 --- a/ApmBaseDataFlow.proto +++ b/ApmBaseDataFlow.proto @@ -16,10 +16,10 @@ message ApmBaseDataFlow { uint32 probe_if = 2; uint32 tuple_source = 3; uint32 tuple_dest = 4; - uint32 tuple_saddr = 5; - uint32 tuple_daddr = 6; - string src_mac = 7; - string dst_mac = 8; + IPAddress tuple_saddr = 5; + IPAddress tuple_daddr = 6; + bytes src_mac = 7; + bytes dst_mac = 8; uint32 vlan_id = 9; uint32 start_tm_tv_sec = 10; uint32 start_tm_tv_usec = 11; @@ -48,7 +48,7 @@ message ApmBaseDataFlow { uint32 new_session = 34; uint32 cs_alert = 35; uint32 sc_alert = 36; - string protocol = 37; + bytes protocol = 37; } diff --git a/AppFlow.proto b/AppFlow.proto index 31fc2e6..a04e2b9 100644 --- a/AppFlow.proto +++ b/AppFlow.proto @@ -11,9 +11,9 @@ package dataflow; message AppFlow { int32 table_id = 1; //编号17 - uint32 src_ip = 2; + IPAddress src_ip = 2; uint32 src_port = 3; - uint32 dst_ip = 4; + IPAddress dst_ip = 4; uint32 dst_port = 5; uint32 s_tv_sec = 6; uint32 s_tv_usec = 7; @@ -25,10 +25,10 @@ message AppFlow { uint32 output_packets = 13; uint32 input_bytes = 14; uint32 output_bytes = 15; - string protocol = 16; + bytes protocol = 16; uint32 app_id = 17; uint32 app_group_id = 18; - uint32 probe_id = 19; + uint32 probe_if = 19; uint32 app_style = 20; uint32 time_flag = 21; int32 vlan_id = 22; diff --git a/BacktrackingFlow.proto b/BacktrackingFlow.proto index 9ba178d..872341d 100644 --- a/BacktrackingFlow.proto +++ b/BacktrackingFlow.proto @@ -12,22 +12,22 @@ package dataflow; message BacktrackingFlow { int32 table_id = 1; //编号20 -int64 mac_src = 2; -int64 mac_dst = 3; -int64 ip_src = 4; -int64 ip_dst = 5; -int32 port_src = 6; -int32 port_dst = 7; -int32 l3_proto = 8; -int32 l4_proto = 9; -int32 tos = 10; -int32 vlan_id = 11; -uint64 bytes = 12; -uint64 packets = 13; -uint64 tcp_sp = 14; -uint64 tcp_scpn = 15; -uint64 tcp_srp = 16; -uint32 app_id = 17; -uint32 app_group_id = 18; -int32 mpls_label = 19; -} \ No newline at end of file + int64 mac_src = 2; + int64 mac_dst = 3; + IPAddress ip_src = 4; + IPAddress ip_dst = 5; + int32 port_src = 6; + int32 port_dst = 7; + int32 l3_proto = 8; + int32 l4_proto = 9; + int32 tos = 10; + int32 vlan_id = 11; + uint64 bytes = 12; + uint64 packets = 13; + uint64 tcp_sp = 14; + uint64 tcp_scpn = 15; + uint64 tcp_srp = 16; + uint32 app_id = 17; + uint32 app_group_id = 18; + int32 mpls_label = 19; +} diff --git a/BussFlowDb.proto b/BussFlowDb.proto index d8d568a..be7867b 100644 --- a/BussFlowDb.proto +++ b/BussFlowDb.proto @@ -14,7 +14,7 @@ message BussFlowDb { int32 table_id = 1; //编号24 uint32 msg_type = 2; -string msg_version = 3; +bytes msg_version = 3; uint32 msg_seq = 4; uint32 msg_len = 5; uint64 src_mac = 6; @@ -29,14 +29,14 @@ uint32 response_bytes = 14; uint32 request_bytes = 15; uint32 response_packets = 16; uint32 request_packets = 17; -string seq_ack = 18; +bytes seq_ack = 18; uint32 recog_status = 19; uint32 probe_if = 20; -string channel = 21; -string dbname = 22; -uint32 request_ip = 23; +bytes channel = 21; +bytes dbname = 22; +IPAddress request_ip = 23; uint32 request_port = 24; -uint32 response_ip = 25; +IPAddress response_ip = 25; uint32 response_port = 26; int64 status = 27; int64 server_translate_time = 28; @@ -57,10 +57,10 @@ uint32 detail_msg_len = 42; uint32 req_len = 43; uint32 res_len = 44; uint32 reserved_len = 45; -string sql = 46; -string bussiness_detail_mesg = 47; -string req_data = 48; -string res_data = 49; -string reserved = 50; +bytes sql = 46; +bytes bussiness_detail_mesg = 47; +bytes req_data = 48; +bytes res_data = 49; +bytes reserved = 50; -} \ No newline at end of file +} diff --git a/BussFlowExternal.proto b/BussFlowExternal.proto index 557b732..38f7702 100644 --- a/BussFlowExternal.proto +++ b/BussFlowExternal.proto @@ -33,12 +33,12 @@ message BussFlowExternal { uint32 key_msg_len = 21; uint32 detail_msg_len = 22; uint32 remain_len = 23; - string busi_code = 24; - string sessionid = 25; - string req_data = 26; - string res_data = 27; - string busi_msg = 28; - string busi_key_msg = 29; - string busi_detail_msg = 30; - string remain_data = 31; + bytes busi_code = 24; + bytes sessionid = 25; + bytes req_data = 26; + bytes res_data = 27; + bytes busi_msg = 28; + bytes busi_key_msg = 29; + bytes busi_detail_msg = 30; + bytes remain_data = 31; } \ No newline at end of file diff --git a/BussFlowMidd.proto b/BussFlowMidd.proto index a6d7e8a..3fdb47f 100644 --- a/BussFlowMidd.proto +++ b/BussFlowMidd.proto @@ -12,7 +12,7 @@ package dataflow; message BussFlowMidd { int32 table_id = 1; //编号23 uint32 msg_type = 2; //消息类型 - string msg_version = 3; //数据库版本 + bytes msg_version = 3; //数据库版本 uint32 msg_seq = 4; //消息的序列号 uint32 msg_len = 5; //消息的长度 uint64 src_mac = 6; //源端口物理地址 @@ -27,10 +27,10 @@ message BussFlowMidd { uint32 request_bytes = 15; //输出字节数 uint32 response_packets = 16; //输入数据报个数 uint32 request_packets = 17; //输出数据报个数 - string seq_ack = 18; //序列号和响应序号 + bytes seq_ack = 18; //序列号和响应序号 uint32 recog_status = 19; uint32 probe_if = 20; //探针编号 - string channel = 21; //通道 + bytes channel = 21; //通道 IPAddress request_ip = 22; //请求地址 uint32 request_port = 23; //请求端口 IPAddress response_ip = 24; //响应地址 @@ -56,10 +56,10 @@ message BussFlowMidd { uint32 req_len = 44; //请求详情报文长度 uint32 res_len = 45; //响应详情报文长度 uint32 remain_len = 46; - string bussiness_detail_mesg = 47; //业务纤细信息 - string bussiness_key_mesg = 48; //业务关键字 - string api = 49; //应用名称 - string req_data = 50; //请求详情报文 - string res_data = 51; //响应详情报文 - string remain_data = 52; + bytes bussiness_detail_mesg = 47; //业务纤细信息 + bytes bussiness_key_mesg = 48; //业务关键字 + bytes api = 49; //应用名称 + bytes req_data = 50; //请求详情报文 + bytes res_data = 51; //响应详情报文 + bytes remain_data = 52; } diff --git a/BussFlowWeb.proto b/BussFlowWeb.proto index 8a51d89..3d34b93 100644 --- a/BussFlowWeb.proto +++ b/BussFlowWeb.proto @@ -12,7 +12,7 @@ package dataflow; message BussFlowWeb { int32 table_id = 1; //编号22 uint32 msg_type = 2; //消息类型 - string msg_version = 3; //数据库版本 + bytes msg_version = 3; //数据库版本 uint32 msg_seq = 4; //消息的序列号 uint32 msg_len = 5; //消息长度 uint64 src_mac = 6; //源端口物理地址 @@ -27,14 +27,14 @@ message BussFlowWeb { uint32 request_bytes = 15; //输出字节数 uint32 response_packets = 16; //输入数据报个数 uint32 request_packets = 17; //输出数据报个数 - string seq_ack = 18; //序列号和响应序号 + bytes seq_ack = 18; //序列号和响应序号 uint32 recog_status = 19; uint32 req_method = 20; //请求方法 - string content_type = 21; //请求内容 - string accept = 22; //接受 + bytes content_type = 21; //请求内容 + bytes accept = 22; //接受 uint32 probe_if = 23; //探针编号 - string channel = 24; //业务类型 - string sessionid = 25; //会话id + bytes channel = 24; //业务类型 + bytes sessionid = 25; //会话id IPAddress request_ip = 26; //请求ip地址 uint32 request_port = 27; //请求端口 IPAddress response_ip = 28; //响应ip地址 @@ -53,10 +53,10 @@ message BussFlowWeb { int64 locate_server_translate_time = 41; //本地服务传输时长 int64 locate_server_response_time = 42; //本地服务响应时长 int64 locate_client_translate_time = 43; //本地客户传输时长 - string x_requested_with = 44; - string operating_sytem = 45; //操作系统 + bytes x_requested_with = 44; + bytes operating_sytem = 45; //操作系统 uint32 server_res_code = 46; //服务器返回状态 - string browser = 47; //浏览器名称 + bytes browser = 47; //浏览器名称 int32 is_uncomplete = 48; //数据完整性 uint32 time_flag = 49; //时间戳 uint32 detail_msg_len = 50; //业务纤细信息长度 @@ -67,12 +67,12 @@ message BussFlowWeb { uint32 begin_url_len = 55; //主URL长度 uint32 refer_url_len = 56; //引用URL长度 uint32 remain_len = 57; - string bussiness_detail_mesg = 58; //业务纤细信息 - string bussiness_key_mesg = 59; //业务关键字 - string req_data = 60; //请求详情报文 - string res_data = 61; //响应详情报文 - string cookie_data = 62; //cookie详情报文 - string begin_url = 63; //主url详情 - string refer_url = 64; //引用url详情 - string remain_data = 65; + bytes bussiness_detail_mesg = 58; //业务纤细信息 + bytes bussiness_key_mesg = 59; //业务关键字 + bytes req_data = 60; //请求详情报文 + bytes res_data = 61; //响应详情报文 + bytes cookie_data = 62; //cookie详情报文 + bytes begin_url = 63; //主url详情 + bytes refer_url = 64; //引用url详情 + bytes remain_data = 65; } diff --git a/UsrFlow.proto b/UsrFlow.proto index 49995d2..5ab1928 100644 --- a/UsrFlow.proto +++ b/UsrFlow.proto @@ -1,5 +1,7 @@ syntax = "proto3"; +import "Base.proto"; + option java_multiple_files = false; option java_package = "com.yuandian.dataflow.proto.msgtype"; option go_package = "../grpc-gen;grpcgen"; @@ -11,8 +13,8 @@ message UsrFlow { int32 table_id = 1; //编号19 uint32 probe_if = 2; - uint32 server_ip = 3; - uint32 client_ip = 4; + IPAddress server_ip = 3; + IPAddress client_ip = 4; uint32 client_port = 5; uint32 client_rtt = 6; uint32 server_rtt = 7; @@ -24,8 +26,8 @@ message UsrFlow { uint32 page_size = 13; uint32 app_id = 14; uint32 app_group_id = 15; - string request_url = 16; - string referer_url = 17; + bytes request_url = 16; + bytes referer_url = 17; uint32 return_code = 18; uint32 err_tv_sec = 19; uint32 err_tv_usec = 20; @@ -35,8 +37,8 @@ message UsrFlow { uint32 server_bytes = 24; uint32 client_packets = 25; uint32 server_packets = 26; - string user_agent = 27; - string content_type = 28; + bytes user_agent = 27; + bytes content_type = 28; uint32 request_transfer_tm = 29; uint32 time_flag = 30; From 87b474729611284b084410aa89b08d3c93de98d4 Mon Sep 17 00:00:00 2001 From: yangdechang Date: Thu, 28 Jul 2022 14:49:21 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=B8=BA=E9=83=A8=E5=88=86=E6=B5=81?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ApmBaseDataFlow.proto | 4 ++-- AppFlow.proto | 10 ++++---- BacktrackingFlow.proto | 30 +++++++++++------------ BussFlowExternal.proto | 8 +++---- QoeFlow.proto | 54 +++++++++++++++++++++--------------------- 5 files changed, 53 insertions(+), 53 deletions(-) diff --git a/ApmBaseDataFlow.proto b/ApmBaseDataFlow.proto index ccd393b..f272d5a 100644 --- a/ApmBaseDataFlow.proto +++ b/ApmBaseDataFlow.proto @@ -37,14 +37,14 @@ message ApmBaseDataFlow { uint32 time_flag = 23; uint32 end_tm_tv_sec = 24; uint32 end_tm_tv_usec = 25; - uint32 respon_num = 26; + uint32 respon_num = 26; //总响应数 uint32 cs_window = 27; uint32 sc_window = 28; uint32 cs_reset = 29; uint32 sc_reset = 30; uint32 cs_retran = 31; uint32 sc_retran = 32; - uint32 conn_setup_tm = 33; + uint32 conn_setup_tm = 33; //会话建立时间【三次握手时间】 uint32 new_session = 34; uint32 cs_alert = 35; uint32 sc_alert = 36; diff --git a/AppFlow.proto b/AppFlow.proto index a04e2b9..482d4dd 100644 --- a/AppFlow.proto +++ b/AppFlow.proto @@ -21,13 +21,13 @@ message AppFlow { uint32 l_tv_usec = 9; uint32 e_tv_sec = 10; uint32 e_tv_usec = 11; - uint32 input_packets = 12; - uint32 output_packets = 13; - uint32 input_bytes = 14; + uint32 input_packets = 12; //< input packets (dst->src) + uint32 output_packets = 13 //< output packets (src->dst) + uint32 input_bytes = 14; //< input bytes (dst->src) uint32 output_bytes = 15; - bytes protocol = 16; + bytes protocol = 16; //< protocol uint32 app_id = 17; - uint32 app_group_id = 18; + uint32 app_group_id = 18; //< application group idectification uint32 probe_if = 19; uint32 app_style = 20; uint32 time_flag = 21; diff --git a/BacktrackingFlow.proto b/BacktrackingFlow.proto index 872341d..ca2ab69 100644 --- a/BacktrackingFlow.proto +++ b/BacktrackingFlow.proto @@ -12,21 +12,21 @@ package dataflow; message BacktrackingFlow { int32 table_id = 1; //编号20 - int64 mac_src = 2; - int64 mac_dst = 3; - IPAddress ip_src = 4; - IPAddress ip_dst = 5; - int32 port_src = 6; - int32 port_dst = 7; - int32 l3_proto = 8; - int32 l4_proto = 9; - int32 tos = 10; - int32 vlan_id = 11; - uint64 bytes = 12; - uint64 packets = 13; - uint64 tcp_sp = 14; - uint64 tcp_scpn = 15; - uint64 tcp_srp = 16; + int64 mac_src = 2; //源MAC + int64 mac_dst = 3; //目标MAC + IPAddress ip_src = 4; //源IP + IPAddress ip_dst = 5; //目标IP + int32 port_src = 6; //源端口,如果没有,为-1 + int32 port_dst = 7; //目标端口,如果没有,为-1 + int32 l3_proto = 8; //第三层协议ID,如果没有,为-1 + int32 l4_proto = 9; //第四层协议ID,如果没有,为-1 + int32 tos = 10; //Tos,一个字节,如果没有,为-1 + int32 vlan_id = 11; //vlan ID,如果没有,为-1 + uint64 bytes = 12; //字节总数 + uint64 packets = 13; //数据包总数 + uint64 tcp_sp = 14; //TCP同步包数 + uint64 tcp_scpn = 15; //TCP同步确认包数 + uint64 tcp_srp = 16; //TCP同步重置包数 uint32 app_id = 17; uint32 app_group_id = 18; int32 mpls_label = 19; diff --git a/BussFlowExternal.proto b/BussFlowExternal.proto index 38f7702..f647766 100644 --- a/BussFlowExternal.proto +++ b/BussFlowExternal.proto @@ -29,10 +29,10 @@ message BussFlowExternal { uint32 end_time_tv_usec = 17; uint32 req_len = 18; uint32 res_len = 19; - uint32 busi_msg_len = 20; - uint32 key_msg_len = 21; - uint32 detail_msg_len = 22; - uint32 remain_len = 23; + uint32 busi_msg_len = 20; //bussiness resouce data length + uint32 key_msg_len = 21; // sub bussiness resouce data length + uint32 detail_msg_len = 22; //parents bussiness data length + uint32 remain_len = 23; //reserve data length bytes busi_code = 24; bytes sessionid = 25; bytes req_data = 26; diff --git a/QoeFlow.proto b/QoeFlow.proto index 99c8782..47eeb40 100644 --- a/QoeFlow.proto +++ b/QoeFlow.proto @@ -17,37 +17,37 @@ message QoeFlow { uint32 s_tv_usec = 5; uint32 l_tv_sec = 6; uint32 l_tv_usec = 7; - uint32 dst2_respon_num = 8; - uint32 dst2_fast = 9; - uint32 dst2_fast_expected = 10; - uint32 dst2_expected_degrated = 11; - uint32 dst2_degrated_service = 12; - uint32 dst2_service_availability = 13; - uint32 dst2_respon_timeout = 14; - uint32 dst2_respon_success = 15; - uint32 dst2_respon_fail = 16; - uint32 dst2_respin_peek = 17; - uint32 dst2_respon_average = 18; - uint32 cs_window = 19; - uint32 sc_window = 20; - uint32 cs_reset = 21; - uint32 sc_reset = 22; - uint32 cs_retran = 23; - uint32 sc_retran = 24; + uint32 dst2_respon_num = 8; //< response number (dst->src) + uint32 dst2_fast = 9; //< fast response (dst->src) + uint32 dst2_fast_expected = 10; //< fast expected (dst->src) + uint32 dst2_expected_degrated = 11; //< expected degrated (dst->src) + uint32 dst2_degrated_service = 12; //< degrated service (dst->src) + uint32 dst2_service_availability = 13; //< service availability (dst->src) + uint32 dst2_respon_timeout = 14; //< response timeout (dst->src) + uint32 dst2_respon_success = 15; //< response success (dst->src) + uint32 dst2_respon_fail = 16; //< response fail (dst->src) + uint32 dst2_respin_peek = 17; //< response peek time (dst->src) ms + uint32 dst2_respon_average = 18; //< response average time(dst->src) ms + uint32 cs_window = 19; //< cs window event + uint32 sc_window = 20; //< sc window event; + uint32 cs_reset = 21; //< cs reset + uint32 sc_reset = 22; //< sc reset + uint32 cs_retran = 23; //< cs retran + uint32 sc_retran = 24; //< sc retran uint32 app_id = 25; - uint32 app_group_id = 26; + uint32 app_group_id = 26; //< application id uint32 probe_if = 27; uint32 app_style = 28; uint32 time_flag = 29; - uint32 conn_setup_tm = 30; - uint32 data_transfer_tm = 31; - uint32 retrans_delay_tm = 32; - uint32 network_inbound = 33; - uint32 network_outbound = 34; - uint32 new_session = 35; - uint32 user_events = 36; - uint32 server_events = 37; - uint32 conn_setup_peek = 38; + uint32 conn_setup_tm = 30; //连接建立时间 + uint32 data_transfer_tm = 31; //数据传输时间 + uint32 retrans_delay_tm = 32; //数据重传时延 + uint32 network_inbound = 33; //网络响应时间(客户端->服务器) + uint32 network_outbound = 34; //网络响应时间(服务器->客户端) + uint32 new_session = 35; //新会话数 + uint32 user_events = 36; //用户事件 + uint32 server_events = 37; //服务事件 + uint32 conn_setup_peek = 38; //连接建立时间峰值 int32 vlan_id = 39; } \ No newline at end of file