mirror of
https://mirror.suhoan.cn/https://github.com/EasyTier/EasyTier.git
synced 2025-12-14 13:47:24 +08:00
add more debug info for route (#155)
1. use info log for sync_route_info 2. allow dump route info with cli tool. 3. dump route info every 60s
This commit is contained in:
@@ -2,174 +2,171 @@ syntax = "proto3";
|
||||
package cli;
|
||||
|
||||
message Status {
|
||||
int32 code = 1;
|
||||
string message = 2;
|
||||
int32 code = 1;
|
||||
string message = 2;
|
||||
}
|
||||
|
||||
message PeerConnStats {
|
||||
uint64 rx_bytes = 1;
|
||||
uint64 tx_bytes = 2;
|
||||
uint64 rx_bytes = 1;
|
||||
uint64 tx_bytes = 2;
|
||||
|
||||
uint64 rx_packets = 3;
|
||||
uint64 tx_packets = 4;
|
||||
uint64 rx_packets = 3;
|
||||
uint64 tx_packets = 4;
|
||||
|
||||
uint64 latency_us = 5;
|
||||
uint64 latency_us = 5;
|
||||
}
|
||||
|
||||
message TunnelInfo {
|
||||
string tunnel_type = 1;
|
||||
string local_addr = 2;
|
||||
string remote_addr = 3;
|
||||
string tunnel_type = 1;
|
||||
string local_addr = 2;
|
||||
string remote_addr = 3;
|
||||
}
|
||||
|
||||
message PeerConnInfo {
|
||||
string conn_id = 1;
|
||||
uint32 my_peer_id = 2;
|
||||
uint32 peer_id = 3;
|
||||
repeated string features = 4;
|
||||
TunnelInfo tunnel = 5;
|
||||
PeerConnStats stats = 6;
|
||||
float loss_rate = 7;
|
||||
string conn_id = 1;
|
||||
uint32 my_peer_id = 2;
|
||||
uint32 peer_id = 3;
|
||||
repeated string features = 4;
|
||||
TunnelInfo tunnel = 5;
|
||||
PeerConnStats stats = 6;
|
||||
float loss_rate = 7;
|
||||
}
|
||||
|
||||
message PeerInfo {
|
||||
uint32 peer_id = 1;
|
||||
repeated PeerConnInfo conns = 2;
|
||||
uint32 peer_id = 1;
|
||||
repeated PeerConnInfo conns = 2;
|
||||
}
|
||||
|
||||
message ListPeerRequest {}
|
||||
|
||||
message ListPeerResponse {
|
||||
repeated PeerInfo peer_infos = 1;
|
||||
}
|
||||
message ListPeerResponse { repeated PeerInfo peer_infos = 1; }
|
||||
|
||||
enum NatType {
|
||||
// has NAT; but own a single public IP, port is not changed
|
||||
Unknown = 0;
|
||||
OpenInternet = 1;
|
||||
NoPAT = 2;
|
||||
FullCone = 3;
|
||||
Restricted = 4;
|
||||
PortRestricted = 5;
|
||||
Symmetric = 6;
|
||||
SymUdpFirewall = 7;
|
||||
// has NAT; but own a single public IP, port is not changed
|
||||
Unknown = 0;
|
||||
OpenInternet = 1;
|
||||
NoPAT = 2;
|
||||
FullCone = 3;
|
||||
Restricted = 4;
|
||||
PortRestricted = 5;
|
||||
Symmetric = 6;
|
||||
SymUdpFirewall = 7;
|
||||
}
|
||||
|
||||
message StunInfo {
|
||||
NatType udp_nat_type = 1;
|
||||
NatType tcp_nat_type = 2;
|
||||
int64 last_update_time = 3;
|
||||
repeated string public_ip = 4;
|
||||
uint32 min_port = 5;
|
||||
uint32 max_port = 6;
|
||||
NatType udp_nat_type = 1;
|
||||
NatType tcp_nat_type = 2;
|
||||
int64 last_update_time = 3;
|
||||
repeated string public_ip = 4;
|
||||
uint32 min_port = 5;
|
||||
uint32 max_port = 6;
|
||||
}
|
||||
|
||||
message Route {
|
||||
uint32 peer_id = 1;
|
||||
string ipv4_addr = 2;
|
||||
uint32 next_hop_peer_id = 3;
|
||||
int32 cost = 4;
|
||||
repeated string proxy_cidrs = 5;
|
||||
string hostname = 6;
|
||||
StunInfo stun_info = 7;
|
||||
string inst_id = 8;
|
||||
uint32 peer_id = 1;
|
||||
string ipv4_addr = 2;
|
||||
uint32 next_hop_peer_id = 3;
|
||||
int32 cost = 4;
|
||||
repeated string proxy_cidrs = 5;
|
||||
string hostname = 6;
|
||||
StunInfo stun_info = 7;
|
||||
string inst_id = 8;
|
||||
}
|
||||
|
||||
message ListRouteRequest {}
|
||||
|
||||
message ListRouteResponse {
|
||||
repeated Route routes = 1;
|
||||
}
|
||||
message ListRouteResponse { repeated Route routes = 1; }
|
||||
|
||||
message DumpRouteRequest {}
|
||||
|
||||
message DumpRouteResponse { string result = 1; }
|
||||
|
||||
service PeerManageRpc {
|
||||
rpc ListPeer (ListPeerRequest) returns (ListPeerResponse);
|
||||
rpc ListRoute (ListRouteRequest) returns (ListRouteResponse);
|
||||
rpc ListPeer(ListPeerRequest) returns (ListPeerResponse);
|
||||
rpc ListRoute(ListRouteRequest) returns (ListRouteResponse);
|
||||
rpc DumpRoute(DumpRouteRequest) returns (DumpRouteResponse);
|
||||
}
|
||||
|
||||
enum ConnectorStatus {
|
||||
CONNECTED = 0;
|
||||
DISCONNECTED = 1;
|
||||
CONNECTING = 2;
|
||||
CONNECTED = 0;
|
||||
DISCONNECTED = 1;
|
||||
CONNECTING = 2;
|
||||
}
|
||||
|
||||
message Connector {
|
||||
string url = 1;
|
||||
ConnectorStatus status = 2;
|
||||
string url = 1;
|
||||
ConnectorStatus status = 2;
|
||||
}
|
||||
|
||||
message ListConnectorRequest {}
|
||||
|
||||
message ListConnectorResponse {
|
||||
repeated Connector connectors = 1;
|
||||
}
|
||||
message ListConnectorResponse { repeated Connector connectors = 1; }
|
||||
|
||||
enum ConnectorManageAction {
|
||||
ADD = 0;
|
||||
REMOVE = 1;
|
||||
ADD = 0;
|
||||
REMOVE = 1;
|
||||
}
|
||||
|
||||
message ManageConnectorRequest {
|
||||
ConnectorManageAction action = 1;
|
||||
string url = 2;
|
||||
ConnectorManageAction action = 1;
|
||||
string url = 2;
|
||||
}
|
||||
|
||||
message ManageConnectorResponse { }
|
||||
message ManageConnectorResponse {}
|
||||
|
||||
service ConnectorManageRpc {
|
||||
rpc ListConnector (ListConnectorRequest) returns (ListConnectorResponse);
|
||||
rpc ManageConnector (ManageConnectorRequest) returns (ManageConnectorResponse);
|
||||
rpc ListConnector(ListConnectorRequest) returns (ListConnectorResponse);
|
||||
rpc ManageConnector(ManageConnectorRequest) returns (ManageConnectorResponse);
|
||||
}
|
||||
|
||||
message DirectConnectedPeerInfo {
|
||||
int32 latency_ms = 1;
|
||||
}
|
||||
message DirectConnectedPeerInfo { int32 latency_ms = 1; }
|
||||
|
||||
message PeerInfoForGlobalMap {
|
||||
map<uint32, DirectConnectedPeerInfo> direct_peers = 1;
|
||||
map<uint32, DirectConnectedPeerInfo> direct_peers = 1;
|
||||
}
|
||||
|
||||
message GetGlobalPeerMapRequest {}
|
||||
|
||||
message GetGlobalPeerMapResponse {
|
||||
map<uint32, PeerInfoForGlobalMap> global_peer_map = 1;
|
||||
map<uint32, PeerInfoForGlobalMap> global_peer_map = 1;
|
||||
}
|
||||
|
||||
service PeerCenterRpc {
|
||||
rpc GetGlobalPeerMap (GetGlobalPeerMapRequest) returns (GetGlobalPeerMapResponse);
|
||||
rpc GetGlobalPeerMap(GetGlobalPeerMapRequest)
|
||||
returns (GetGlobalPeerMapResponse);
|
||||
}
|
||||
|
||||
message VpnPortalInfo {
|
||||
string vpn_type = 1;
|
||||
string client_config = 2;
|
||||
repeated string connected_clients = 3;
|
||||
string vpn_type = 1;
|
||||
string client_config = 2;
|
||||
repeated string connected_clients = 3;
|
||||
}
|
||||
|
||||
message GetVpnPortalInfoRequest {}
|
||||
message GetVpnPortalInfoResponse {
|
||||
VpnPortalInfo vpn_portal_info = 1;
|
||||
}
|
||||
message GetVpnPortalInfoResponse { VpnPortalInfo vpn_portal_info = 1; }
|
||||
|
||||
service VpnPortalRpc {
|
||||
rpc GetVpnPortalInfo (GetVpnPortalInfoRequest) returns (GetVpnPortalInfoResponse);
|
||||
rpc GetVpnPortalInfo(GetVpnPortalInfoRequest)
|
||||
returns (GetVpnPortalInfoResponse);
|
||||
}
|
||||
|
||||
message HandshakeRequest {
|
||||
uint32 magic = 1;
|
||||
uint32 my_peer_id = 2;
|
||||
uint32 version = 3;
|
||||
repeated string features = 4;
|
||||
string network_name = 5;
|
||||
bytes network_secret_digrest = 6;
|
||||
uint32 magic = 1;
|
||||
uint32 my_peer_id = 2;
|
||||
uint32 version = 3;
|
||||
repeated string features = 4;
|
||||
string network_name = 5;
|
||||
bytes network_secret_digrest = 6;
|
||||
}
|
||||
|
||||
message TaRpcPacket {
|
||||
uint32 from_peer = 1;
|
||||
uint32 to_peer = 2;
|
||||
uint32 service_id = 3;
|
||||
uint32 transact_id = 4;
|
||||
bool is_req = 5;
|
||||
bytes content = 6;
|
||||
uint32 from_peer = 1;
|
||||
uint32 to_peer = 2;
|
||||
uint32 service_id = 3;
|
||||
uint32 transact_id = 4;
|
||||
bool is_req = 5;
|
||||
bytes content = 6;
|
||||
|
||||
uint32 total_pieces = 7;
|
||||
uint32 piece_idx = 8;
|
||||
uint32 total_pieces = 7;
|
||||
uint32 piece_idx = 8;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user