From 3ba0ff98727767d7af204d4ab2bd0359b94d3d76 Mon Sep 17 00:00:00 2001 From: zzz9527me Date: Thu, 30 Jun 2022 11:41:01 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E7=9B=B8=E5=85=B3=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E7=BC=BA=E5=B0=91=E5=88=86=E5=8F=B7=EF=BC=8C=E5=8A=A0=E4=B8=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AppFlow.proto | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/AppFlow.proto b/AppFlow.proto index 1c8fb99..730b80f 100644 --- a/AppFlow.proto +++ b/AppFlow.proto @@ -9,10 +9,10 @@ package dataflow; message AppFlow { int32 table_id = 1; //编号17 - uint32 src_ip = 2 + uint32 src_ip = 2; uint32 src_port = 3; uint32 dst_ip = 4; - uint32 dst_port = 5 + uint32 dst_port = 5; uint32 s_tv_sec = 6; uint32 s_tv_usec = 7; uint32 l_tv_sec = 8; @@ -32,4 +32,4 @@ message AppFlow { int32 vlan_id = 22; int32 mpls_label = 23; int32 tos = 24; -} \ No newline at end of file +} From e7efff5fd246db0ffb5e88488a149e19d037c10c Mon Sep 17 00:00:00 2001 From: huangsimin Date: Mon, 4 Jul 2022 13:42:09 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20IPAddress=E7=BB=93?= =?UTF-8?q?=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ApmBaseDataFlow.proto | 2 ++ AppFlow.proto | 2 ++ BacktrackingFlow.proto | 2 ++ Base.proto | 8 +++++++- BussFlowDb.proto | 4 +++- BussFlowExternal.proto | 6 ++++-- BussFlowMidd.proto | 6 ++++-- BussFlowWeb.proto | 6 ++++-- QoeFlow.proto | 6 ++++-- 9 files changed, 32 insertions(+), 10 deletions(-) diff --git a/ApmBaseDataFlow.proto b/ApmBaseDataFlow.proto index 18f04e4..fa3a247 100644 --- a/ApmBaseDataFlow.proto +++ b/ApmBaseDataFlow.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"; diff --git a/AppFlow.proto b/AppFlow.proto index 730b80f..31fc2e6 100644 --- a/AppFlow.proto +++ b/AppFlow.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"; diff --git a/BacktrackingFlow.proto b/BacktrackingFlow.proto index 25be7f1..9ba178d 100644 --- a/BacktrackingFlow.proto +++ b/BacktrackingFlow.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"; diff --git a/Base.proto b/Base.proto index 4b00fb3..0b6adbc 100644 --- a/Base.proto +++ b/Base.proto @@ -5,7 +5,6 @@ import "google/protobuf/any.proto"; option java_multiple_files = false; //不要拆分成多个文件 option java_package = "com.yuandian.dataflow.proto"; - option go_package = "../grpc-gen;grpcgen"; package dataflow; @@ -22,6 +21,13 @@ message Request { repeated google.protobuf.Any param = 3; // 请求的可变参数. 暂不使用 } +message IPAddress { + oneof IP { + bytes v4 = 1; + bytes v6 = 2; + } +} + service CollectPacketsServer { rpc GetPackets (Request) returns (stream Response); } diff --git a/BussFlowDb.proto b/BussFlowDb.proto index 3c15c9c..d8d568a 100644 --- a/BussFlowDb.proto +++ b/BussFlowDb.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"; @@ -10,7 +12,7 @@ package dataflow; message BussFlowDb { - int32 table_id = 1; //编号24 +int32 table_id = 1; //编号24 uint32 msg_type = 2; string msg_version = 3; uint32 msg_seq = 4; diff --git a/BussFlowExternal.proto b/BussFlowExternal.proto index 838f648..557b732 100644 --- a/BussFlowExternal.proto +++ b/BussFlowExternal.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"; @@ -15,9 +17,9 @@ message BussFlowExternal { uint32 msg_len = 5; uint64 src_mac = 6; uint64 dst_mac = 7; - uint32 request_ip = 8; + IPAddress request_ip = 8; uint32 request_port = 9; - uint32 response_ip = 10; + IPAddress response_ip = 10; uint32 response_port = 11; uint32 probeif = 12; uint32 protocol = 13; diff --git a/BussFlowMidd.proto b/BussFlowMidd.proto index d029a07..a6d7e8a 100644 --- a/BussFlowMidd.proto +++ b/BussFlowMidd.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"; @@ -29,9 +31,9 @@ message BussFlowMidd { uint32 recog_status = 19; uint32 probe_if = 20; //探针编号 string channel = 21; //通道 - uint32 request_ip = 22; //请求地址 + IPAddress request_ip = 22; //请求地址 uint32 request_port = 23; //请求端口 - uint32 response_ip = 24; //响应地址 + IPAddress response_ip = 24; //响应地址 uint32 response_port = 25; //响应端口 uint32 start_time_tv_sec = 26; //开始时间(秒) uint32 start_time_tv_usec = 27; //开始时间(毫秒) diff --git a/BussFlowWeb.proto b/BussFlowWeb.proto index 7e4ae05..8a51d89 100644 --- a/BussFlowWeb.proto +++ b/BussFlowWeb.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"; @@ -33,9 +35,9 @@ message BussFlowWeb { uint32 probe_if = 23; //探针编号 string channel = 24; //业务类型 string sessionid = 25; //会话id - uint32 request_ip = 26; //请求ip地址 + IPAddress request_ip = 26; //请求ip地址 uint32 request_port = 27; //请求端口 - uint32 response_ip = 28; //响应ip地址 + IPAddress response_ip = 28; //响应ip地址 uint32 response_port = 29; //响应端口 uint32 start_time_tv_sec = 30; //开始时间(秒) uint32 start_time_tv_usec = 31; //开始时间(毫秒) diff --git a/QoeFlow.proto b/QoeFlow.proto index 3274363..99c8782 100644 --- a/QoeFlow.proto +++ b/QoeFlow.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"; @@ -9,8 +11,8 @@ package dataflow; message QoeFlow { int32 table_id = 1; //编号18 - uint32 src_ip = 2; - uint32 dst_ip = 3; + IPAddress src_ip = 2; + IPAddress dst_ip = 3; uint32 s_tv_sec = 4; uint32 s_tv_usec = 5; uint32 l_tv_sec = 6; From bdaf30bd5f7e1c4ee02c2ec0a4fda1536dd0e8bb Mon Sep 17 00:00:00 2001 From: huangsimin Date: Mon, 4 Jul 2022 14:02:16 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=B7=BB=E5=8A=A0vscode=20protoc=20?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/setting.json | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .vscode/setting.json diff --git a/.vscode/setting.json b/.vscode/setting.json new file mode 100644 index 0000000..f968b10 --- /dev/null +++ b/.vscode/setting.json @@ -0,0 +1,5 @@ +{ + "protoc": { + "options": ["-I proto"] + } +} \ No newline at end of file From 5ade0479eca7c830c959c37b4402110ab9b50a63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E5=BE=B7=E6=98=8C?= Date: Thu, 7 Jul 2022 10:26:04 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E8=A1=A5=E5=85=A8=E5=85=B6=E4=BD=99?= =?UTF-8?q?=E6=B5=81=E5=9C=B0=E5=9D=80=E7=9A=84=E4=BD=BF=E7=94=A8=E6=A0=87?= =?UTF-8?q?=E8=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ApmBaseDataFlow.proto | 4 ++-- AppFlow.proto | 6 +++--- BacktrackingFlow.proto | 38 +++++++++++++++++++------------------- BussFlowDb.proto | 6 +++--- UsrFlow.proto | 6 ++++-- 5 files changed, 31 insertions(+), 29 deletions(-) diff --git a/ApmBaseDataFlow.proto b/ApmBaseDataFlow.proto index fa3a247..661d33f 100644 --- a/ApmBaseDataFlow.proto +++ b/ApmBaseDataFlow.proto @@ -16,8 +16,8 @@ message ApmBaseDataFlow { uint32 probe_if = 2; uint32 tuple_source = 3; uint32 tuple_dest = 4; - uint32 tuple_saddr = 5; - uint32 tuple_daddr = 6; + IPAddress tuple_saddr = 5; + IPAddress tuple_daddr = 6; string src_mac = 7; string dst_mac = 8; uint32 vlan_id = 9; diff --git a/AppFlow.proto b/AppFlow.proto index 31fc2e6..e4bbfb1 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; @@ -28,7 +28,7 @@ message AppFlow { string 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..9509be6 100644 --- a/BussFlowDb.proto +++ b/BussFlowDb.proto @@ -34,9 +34,9 @@ uint32 recog_status = 19; uint32 probe_if = 20; string channel = 21; string dbname = 22; -uint32 request_ip = 23; +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; @@ -63,4 +63,4 @@ string req_data = 48; string res_data = 49; string reserved = 50; -} \ No newline at end of file +} diff --git a/UsrFlow.proto b/UsrFlow.proto index 49995d2..6d739ce 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;