2019-10-22 09:39:20 +08:00
|
|
|
syntax = "proto3";
|
|
|
|
option go_package = "pingtunnel";
|
2019-10-25 21:28:30 +08:00
|
|
|
|
2019-10-22 09:39:20 +08:00
|
|
|
message MyMsg {
|
2019-10-22 10:14:00 +08:00
|
|
|
enum TYPE {
|
|
|
|
DATA = 0;
|
|
|
|
PING = 1;
|
2019-10-31 21:48:32 +08:00
|
|
|
KICK = 2;
|
2019-10-25 21:28:30 +08:00
|
|
|
MAGIC = 0xdead;
|
2019-10-22 10:14:00 +08:00
|
|
|
}
|
|
|
|
|
2019-10-22 09:39:20 +08:00
|
|
|
string id = 1;
|
|
|
|
int32 type = 2;
|
|
|
|
string target = 3;
|
|
|
|
bytes data = 4;
|
2019-10-25 21:42:02 +08:00
|
|
|
sint32 rproto = 5;
|
|
|
|
sint32 magic = 6;
|
|
|
|
sint32 key = 7;
|
2019-10-27 19:06:55 +08:00
|
|
|
int32 timeout = 8;
|
|
|
|
int32 tcpmode = 9;
|
|
|
|
int32 tcpmode_buffersize = 10;
|
|
|
|
int32 tcpmode_maxwin = 11;
|
|
|
|
int32 tcpmode_resend_timems = 12;
|
|
|
|
int32 tcpmode_compress = 13;
|
2019-10-28 11:58:01 +08:00
|
|
|
int32 tcpmode_stat = 14;
|
2019-10-22 09:39:20 +08:00
|
|
|
}
|
|
|
|
|
2019-10-27 18:16:57 +08:00
|
|
|
message FrameData {
|
|
|
|
enum TYPE {
|
|
|
|
USER_DATA = 0;
|
|
|
|
CONN = 1;
|
|
|
|
CONNRSP = 2;
|
|
|
|
CLOSE = 3;
|
|
|
|
}
|
|
|
|
int32 type = 1;
|
|
|
|
bytes data = 2;
|
2019-10-27 19:06:55 +08:00
|
|
|
bool compress = 3;
|
2019-10-27 18:16:57 +08:00
|
|
|
}
|
|
|
|
|
2019-10-22 09:39:20 +08:00
|
|
|
message Frame {
|
2019-10-22 21:27:21 +08:00
|
|
|
enum TYPE {
|
|
|
|
DATA = 0;
|
|
|
|
REQ = 1;
|
|
|
|
ACK = 2;
|
2019-10-26 19:54:49 +08:00
|
|
|
PING = 3;
|
|
|
|
PONG = 4;
|
2019-10-22 21:27:21 +08:00
|
|
|
}
|
|
|
|
|
2019-10-22 09:39:20 +08:00
|
|
|
int32 type = 1;
|
|
|
|
bool resend = 2;
|
|
|
|
int64 sendtime = 3;
|
|
|
|
int32 id = 4;
|
2019-10-27 18:16:57 +08:00
|
|
|
FrameData data = 5;
|
2019-10-22 09:39:20 +08:00
|
|
|
repeated int32 dataid = 6;
|
|
|
|
}
|