fix message proto
This commit is contained in:
parent
adbced1cad
commit
e0afccfced
@ -26,92 +26,81 @@ message SDLWelcome {
|
||||
uint32 heartbeat_sec = 4;
|
||||
}
|
||||
|
||||
// quic 通讯消息
|
||||
message SDLEmpty {
|
||||
uint32 pkt_id = 1;
|
||||
}
|
||||
|
||||
// 这里修改成了扁平的结构, 否则有些字段不好找放的位置
|
||||
message SDLRegisterSuper {
|
||||
uint32 pkt_id = 1;
|
||||
string client_id = 2;
|
||||
string client_id = 1;
|
||||
// 网络地址信息已经有https请求分配了
|
||||
// 注册的时候需要带上(network_id, mac, ip, mask_len, hostname)
|
||||
uint32 network_id = 3;
|
||||
bytes mac = 4;
|
||||
uint32 ip = 5;
|
||||
uint32 mask_len = 6;
|
||||
string hostname = 7;
|
||||
uint32 network_id = 2;
|
||||
bytes mac = 3;
|
||||
uint32 ip = 4;
|
||||
uint32 mask_len = 5;
|
||||
string hostname = 6;
|
||||
|
||||
string pub_key = 8;
|
||||
string pub_key = 7;
|
||||
// 客户端使用http协议请求后端,通过token或者账号密码登录时, 统一返回一个access_token;
|
||||
// RegisterSuper的时候,验证凭证是否合法 (access_token)
|
||||
string access_token = 9;
|
||||
string access_token = 8;
|
||||
}
|
||||
|
||||
// 客户端的升级逻辑,在https的接口里面去完成
|
||||
// 部分逻辑会脱离quic去通讯,增加session_token校验
|
||||
message SDLRegisterSuperAck {
|
||||
uint32 pkt_id = 1;
|
||||
// 目前支持aes, chacha20
|
||||
string algorithm = 2;
|
||||
bytes key = 3;
|
||||
string algorithm = 1;
|
||||
bytes key = 2;
|
||||
// 逻辑分段,chacha20加密算法需要使用该字段
|
||||
uint32 region_id = 4;
|
||||
bytes session_token = 5;
|
||||
uint32 region_id = 3;
|
||||
bytes session_token = 4;
|
||||
}
|
||||
|
||||
message SDLRegisterSuperNak {
|
||||
uint32 pkt_id = 1;
|
||||
uint32 error_code = 2;
|
||||
string error_message = 3;
|
||||
uint32 error_code = 1;
|
||||
string error_message = 2;
|
||||
}
|
||||
|
||||
// 网络地址查询
|
||||
|
||||
message SDLQueryInfo {
|
||||
uint32 pkt_id = 1;
|
||||
bytes dst_mac = 2;
|
||||
bytes dst_mac = 1;
|
||||
}
|
||||
|
||||
message SDLPeerInfo {
|
||||
uint32 pkt_id = 1;
|
||||
bytes dst_mac = 2;
|
||||
SDLV4Info v4_info = 3;
|
||||
optional SDLV6Info v6_info = 4;
|
||||
bytes dst_mac = 1;
|
||||
SDLV4Info v4_info = 2;
|
||||
optional SDLV6Info v6_info = 3;
|
||||
}
|
||||
|
||||
// ARP查询相关
|
||||
// 真实的arp请求是通过广播的形式获取到的,但是针对于macos这种tun的实现;是能够分析出arp请求包的;
|
||||
// 对于当前网络来说,服务端是知道mac对应的ip地址的,因此没有必要广播;直接通过服务器端返回
|
||||
message SDLArpRequest {
|
||||
uint32 pkt_id = 1;
|
||||
uint32 target_ip = 2;
|
||||
uint32 target_ip = 1;
|
||||
uint32 origin_ip = 2;
|
||||
bytes context = 3;
|
||||
}
|
||||
|
||||
message SDLArpResponse {
|
||||
uint32 pkt_id = 1;
|
||||
uint32 target_ip = 2;
|
||||
bytes target_mac = 3;
|
||||
uint32 target_ip = 1;
|
||||
bytes target_mac = 2;
|
||||
uint32 origin_ip = 3;
|
||||
bytes context = 4;
|
||||
}
|
||||
|
||||
// 权限请求查询相关
|
||||
message SDLPolicyRequest {
|
||||
uint32 pkt_id = 1;
|
||||
uint32 src_identity_id = 2;
|
||||
uint32 dst_identity_id = 3;
|
||||
uint32 version = 4;
|
||||
uint32 src_identity_id = 1;
|
||||
uint32 dst_identity_id = 2;
|
||||
uint32 version = 3;
|
||||
}
|
||||
|
||||
// 基于quic通讯,rules部分已经没有了长度限制
|
||||
message SDLPolicyResponse {
|
||||
uint32 pkt_id = 1;
|
||||
uint32 src_identity_id = 2;
|
||||
uint32 dst_identity_id = 3;
|
||||
uint32 src_identity_id = 1;
|
||||
uint32 dst_identity_id = 2;
|
||||
// 版本号,客户端需要比较版本号确定是否覆盖; 请求端自己去管理版本号,服务端只是原样回写
|
||||
uint32 version = 4;
|
||||
uint32 version = 3;
|
||||
// 1 + 2稀疏序列化规则, 按照: <<Proto:8, Port:16>> 这个格式序列号所有的规则信息; 下发的数据默认都是allow,deny规则的服务器端已经屏蔽
|
||||
bytes rules = 5;
|
||||
bytes rules = 4;
|
||||
}
|
||||
|
||||
// 事件定义
|
||||
@ -137,18 +126,16 @@ message SDLNetworkShutdownEvent {
|
||||
|
||||
// client和stun之间的心跳包,客户端需要和super的udp之间的存活逻辑
|
||||
message SDLStunRequest {
|
||||
uint32 cookie = 1;
|
||||
string client_id = 2;
|
||||
uint32 network_id = 3;
|
||||
bytes mac = 4;
|
||||
uint32 ip = 5;
|
||||
uint32 nat_type = 6;
|
||||
optional SDLV6Info v6_info = 7;
|
||||
bytes session_token = 8;
|
||||
string client_id = 1;
|
||||
uint32 network_id = 2;
|
||||
bytes mac = 3;
|
||||
uint32 ip = 4;
|
||||
uint32 nat_type = 5;
|
||||
optional SDLV6Info v6_info = 6;
|
||||
bytes session_token = 7;
|
||||
}
|
||||
|
||||
message SDLStunReply {
|
||||
uint32 cookie = 1;
|
||||
}
|
||||
|
||||
message SDLData {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user