2021-03-26 00:17:52 +08:00
|
|
|
syntax = "proto3";
|
|
|
|
package node;
|
|
|
|
option go_package = "google.golang.org/protobuf/types/known/nodepb";
|
|
|
|
|
|
|
|
service NodeService {
|
|
|
|
rpc Login(LoginRequest) returns (LoginResponse);
|
|
|
|
rpc CreateNode(CreateNodeReq) returns (CreateNodeRes);
|
|
|
|
rpc ReadNode(ReadNodeReq) returns (ReadNodeRes);
|
|
|
|
rpc UpdateNode(UpdateNodeReq) returns (UpdateNodeRes);
|
|
|
|
rpc DeleteNode(DeleteNodeReq) returns (DeleteNodeRes);
|
|
|
|
rpc GetPeers(GetPeersReq) returns (stream GetPeersRes);
|
|
|
|
rpc CheckIn(CheckInReq) returns (CheckInRes);
|
|
|
|
}
|
|
|
|
|
|
|
|
message LoginRequest {
|
|
|
|
string macaddress = 1;
|
|
|
|
string password = 2;
|
2021-04-07 21:39:40 +08:00
|
|
|
string network = 3;
|
2021-03-26 00:17:52 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
message LoginResponse { string accesstoken = 1; }
|
|
|
|
|
|
|
|
message Node {
|
|
|
|
string id = 1;
|
|
|
|
string name = 2;
|
|
|
|
string address = 3;
|
2021-05-06 19:41:11 +08:00
|
|
|
string address6 = 26;
|
2021-03-26 00:17:52 +08:00
|
|
|
int32 listenport = 4;
|
|
|
|
string publickey = 5;
|
|
|
|
string endpoint = 6;
|
|
|
|
string macaddress = 7;
|
|
|
|
string password = 8;
|
2021-04-13 12:42:35 +08:00
|
|
|
string nodenetwork = 9;
|
2021-03-26 00:17:52 +08:00
|
|
|
bool ispending = 10;
|
|
|
|
string postup = 11;
|
2021-04-13 14:55:49 +08:00
|
|
|
string postdown = 12;
|
2021-03-26 00:17:52 +08:00
|
|
|
int32 keepalive = 13;
|
|
|
|
bool saveconfig = 14;
|
|
|
|
string accesskey = 15;
|
|
|
|
string interface = 16;
|
|
|
|
string lastcheckin = 17;
|
|
|
|
string lastmodified = 18;
|
|
|
|
int32 checkininterval = 19;
|
|
|
|
string localaddress = 20;
|
|
|
|
string postchanges = 21;
|
2021-04-13 14:55:49 +08:00
|
|
|
string allowedips = 22;
|
2021-04-18 00:13:26 +08:00
|
|
|
bool islocal = 23;
|
2021-05-06 19:41:11 +08:00
|
|
|
bool isdualstack = 27;
|
2021-05-06 08:51:59 +08:00
|
|
|
bool dnsoff = 24;
|
|
|
|
string localrange = 25;
|
2021-03-26 00:17:52 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
message CheckInResponse {
|
|
|
|
bool success = 1;
|
|
|
|
bool needpeerupdate = 2;
|
|
|
|
bool needconfigupdate = 3;
|
|
|
|
string nodemessage = 4;
|
|
|
|
bool ispending = 5;
|
2021-04-06 06:09:21 +08:00
|
|
|
bool needkeyupdate = 6;
|
2021-04-06 08:47:19 +08:00
|
|
|
bool needdelete = 7;
|
2021-03-26 00:17:52 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
message PeersResponse {
|
2021-04-13 14:55:49 +08:00
|
|
|
bool isgateway = 1;
|
|
|
|
string gatewayrange = 2;
|
2021-03-26 00:17:52 +08:00
|
|
|
string publickey = 5;
|
|
|
|
string endpoint = 6;
|
|
|
|
string address = 3;
|
2021-05-06 19:41:11 +08:00
|
|
|
string address6 = 8;
|
2021-03-26 00:17:52 +08:00
|
|
|
int32 listenport = 4;
|
|
|
|
string localaddress = 7;
|
|
|
|
int32 keepalive = 13;
|
|
|
|
}
|
|
|
|
|
|
|
|
message CreateNodeReq {
|
|
|
|
Node node = 1; // Node id blank
|
|
|
|
}
|
|
|
|
|
|
|
|
message CreateNodeRes {
|
|
|
|
Node node = 1; // Node id filled in
|
|
|
|
}
|
|
|
|
|
|
|
|
message UpdateNodeReq {
|
|
|
|
Node node = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message UpdateNodeRes {
|
|
|
|
Node node = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message ReadNodeReq {
|
|
|
|
string macaddress = 1;
|
2021-04-13 12:42:35 +08:00
|
|
|
string network = 2;
|
2021-03-26 00:17:52 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
message ReadNodeRes {
|
|
|
|
Node node = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message DeleteNodeReq {
|
|
|
|
string macaddress = 1;
|
2021-04-13 12:42:35 +08:00
|
|
|
string networkName = 2;
|
2021-03-26 00:17:52 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
message DeleteNodeRes {
|
|
|
|
bool success = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message GetPeersReq {
|
|
|
|
string macaddress = 1;
|
2021-04-13 12:42:35 +08:00
|
|
|
string network = 2;
|
2021-03-26 00:17:52 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
message GetPeersRes {
|
|
|
|
PeersResponse peers = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message CheckInReq {
|
|
|
|
Node node = 1;
|
|
|
|
// bool postchanges = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message CheckInRes {
|
|
|
|
CheckInResponse checkinresponse = 1;
|
|
|
|
}
|
|
|
|
|