v2
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package protocol.client;
|
||||
|
||||
message QuicProxyHandshake{
|
||||
oneof handshake{
|
||||
TcpProxyHandshake tcp = 1;
|
||||
IpProxyHandshake ip = 2;
|
||||
PortProxyHandshake tcp_port_mapping = 3;
|
||||
PortProxyHandshake udp_port_mapping = 4;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
message TcpProxyHandshake{
|
||||
fixed32 src_ip = 1;
|
||||
uint32 src_port = 2;
|
||||
fixed32 dst_ip = 3;
|
||||
uint32 dst_port = 4;
|
||||
}
|
||||
message PortProxyHandshake{
|
||||
string src_ip = 1;
|
||||
uint32 src_port = 2;
|
||||
string dst_host = 3;
|
||||
uint32 dst_port = 4;
|
||||
}
|
||||
|
||||
message IpProxyHandshake{
|
||||
uint32 ip_next_header_protocol = 1;
|
||||
fixed32 src_ip = 2;
|
||||
fixed32 dst_ip = 3;
|
||||
}
|
||||
|
||||
enum NatType {
|
||||
NAT_TYPE_CONE = 0;
|
||||
NAT_TYPE_SYMMETRIC = 1;
|
||||
}
|
||||
message NatInfo {
|
||||
|
||||
NatType nat_type = 1;
|
||||
|
||||
repeated fixed32 public_ips = 2;
|
||||
|
||||
repeated uint32 public_udp_ports = 3;
|
||||
|
||||
uint32 public_port_range = 4;
|
||||
|
||||
repeated fixed32 local_ipv4s = 5;
|
||||
|
||||
optional bytes ipv6 = 6;
|
||||
|
||||
repeated uint32 local_udp_ports = 7;
|
||||
|
||||
uint32 local_tcp_port = 8;
|
||||
|
||||
uint32 public_tcp_port = 9;
|
||||
}
|
||||
|
||||
message PunchInfo{
|
||||
NatInfo nat_info = 1;
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package protocol.control_message;
|
||||
|
||||
enum RegistrationMode {
|
||||
NORMAL = 0;
|
||||
PRE_REGISTER = 1;
|
||||
}
|
||||
|
||||
message RegRequestMsg {
|
||||
string network_code = 1;
|
||||
string device_id = 2;
|
||||
optional fixed32 ip = 3;
|
||||
string name = 4;
|
||||
string version = 5;
|
||||
optional string key_sign = 6;
|
||||
bool ip_variable = 7;
|
||||
fixed32 server_id = 8;
|
||||
RegistrationMode registration_mode = 9;
|
||||
}
|
||||
|
||||
|
||||
message RegResponseMsg {
|
||||
fixed32 ip = 1;
|
||||
uint32 prefix_len = 2;
|
||||
fixed32 gateway = 3;
|
||||
string server_version = 4;
|
||||
}
|
||||
|
||||
message ConfirmRegMsg {
|
||||
}
|
||||
|
||||
message ConfirmRegResponseMsg {
|
||||
bool success = 1;
|
||||
}
|
||||
|
||||
message ErrorResponseMsg {
|
||||
uint32 code = 1;
|
||||
string message = 2;
|
||||
}
|
||||
|
||||
message RequestMessage{
|
||||
oneof request_payload{
|
||||
RegRequestMsg reg = 1;
|
||||
ConfirmRegMsg confirm_reg = 2;
|
||||
}
|
||||
}
|
||||
message ResponseMessage{
|
||||
oneof response_payload{
|
||||
RegResponseMsg reg = 1;
|
||||
ErrorResponseMsg error = 2;
|
||||
ConfirmRegResponseMsg confirm_reg = 3;
|
||||
}
|
||||
}
|
||||
|
||||
message SelectiveBroadcast {
|
||||
repeated fixed32 ips = 1;
|
||||
bytes data = 2;
|
||||
}
|
||||
|
||||
message ClientSimpleInfo{
|
||||
fixed32 ip = 1;
|
||||
bool online = 2;
|
||||
}
|
||||
|
||||
message ClientSimpleInfoList{
|
||||
uint64 data_version = 1;
|
||||
repeated ClientSimpleInfo list = 2;
|
||||
bool is_all = 3;
|
||||
int64 time = 4;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package protocol.fec;
|
||||
|
||||
message FecPacket {
|
||||
uint64 group_id = 1; // FEC 组号(按目标IP分组)
|
||||
uint32 packet_index = 2; // 包在组内的序号(0-based)
|
||||
bytes payload = 3;
|
||||
optional ParityData parity_data = 4;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 冗余包(携带FEC恢复所需的元数据)
|
||||
message ParityData {
|
||||
uint32 data_shards = 1; // 原始包数量
|
||||
uint32 parity_shards = 2; // 冗余包数量
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package protocol.rpc;
|
||||
|
||||
message RpcMessageRequest{
|
||||
uint64 id = 1;
|
||||
oneof rpc_req_payload{
|
||||
ClientListRequest client_list_req = 2;
|
||||
}
|
||||
}
|
||||
|
||||
message ClientListRequest{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
message RpcMessageResponse{
|
||||
uint64 id = 1;
|
||||
oneof rpc_res_payload{
|
||||
ClientListResponse client_list_res = 2;
|
||||
}
|
||||
}
|
||||
|
||||
message ClientInfo{
|
||||
string name = 1;
|
||||
string version = 2;
|
||||
fixed32 ip = 3;
|
||||
optional string key_sign = 4;
|
||||
bool online = 5;
|
||||
int64 last_connected_time = 6;
|
||||
string id = 7;
|
||||
}
|
||||
|
||||
message ClientListResponse{
|
||||
repeated ClientInfo list = 1;
|
||||
}
|
||||
Reference in New Issue
Block a user