2024-11-12 22:59:37 +09:00
|
|
|
syntax = "proto3";
|
|
|
|
|
2024-11-23 12:30:23 +09:00
|
|
|
option go_package = "./hodu";
|
2024-11-12 22:59:37 +09:00
|
|
|
|
2024-12-08 23:16:43 +09:00
|
|
|
// this one affects the full name of the the actual calls.
|
|
|
|
// /<package-name>.<service-name>/<call-name>
|
|
|
|
// i want to keep the package line commented out such that
|
|
|
|
// the full name is /<service-name>/<call-name> (e.g. /Hodu/GetSeed)
|
|
|
|
//package hodu;
|
2024-11-12 22:59:37 +09:00
|
|
|
|
|
|
|
service Hodu {
|
2024-11-20 00:31:14 +09:00
|
|
|
rpc GetSeed (Seed) returns (Seed) {}
|
2024-11-12 22:59:37 +09:00
|
|
|
rpc PacketStream (stream Packet) returns (stream Packet) {}
|
|
|
|
}
|
|
|
|
|
2024-11-20 00:31:14 +09:00
|
|
|
message Seed {
|
|
|
|
uint32 Version = 1;
|
|
|
|
uint64 Flags = 2;
|
|
|
|
}
|
|
|
|
|
2024-11-12 22:59:37 +09:00
|
|
|
enum ROUTE_PROTO {
|
|
|
|
TCP = 0;
|
|
|
|
TCP4 = 1;
|
|
|
|
TCP6 = 2;
|
|
|
|
};
|
|
|
|
|
|
|
|
message RouteDesc {
|
|
|
|
uint32 RouteId = 1;
|
2024-12-05 18:24:42 +09:00
|
|
|
string TargetAddrStr = 2;
|
|
|
|
ROUTE_PROTO ServiceProto = 3;
|
2024-12-05 01:31:59 +09:00
|
|
|
string ServiceNetStr = 4;
|
2024-11-12 22:59:37 +09:00
|
|
|
};
|
|
|
|
|
|
|
|
message PeerDesc {
|
|
|
|
uint32 RouteId = 1;
|
|
|
|
uint32 PeerId = 2;
|
2024-12-01 17:20:16 +09:00
|
|
|
string RemoteAddrStr = 3;
|
|
|
|
string LocalAddrStr = 4;
|
2024-11-12 22:59:37 +09:00
|
|
|
};
|
|
|
|
|
|
|
|
message PeerData {
|
|
|
|
uint32 RouteId = 1;
|
|
|
|
uint32 PeerId = 2;
|
|
|
|
bytes Data = 3;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum PACKET_KIND {
|
2024-12-05 01:26:44 +09:00
|
|
|
RESERVED = 0; // not used
|
|
|
|
ROUTE_START = 1;
|
|
|
|
ROUTE_STOP = 2;
|
|
|
|
ROUTE_STARTED = 3;
|
|
|
|
ROUTE_STOPPED = 4;
|
|
|
|
PEER_STARTED = 5;
|
|
|
|
PEER_STOPPED = 6;
|
|
|
|
PEER_ABORTED = 7;
|
|
|
|
PEER_EOF = 8;
|
|
|
|
PEER_DATA = 9;
|
2024-11-12 22:59:37 +09:00
|
|
|
};
|
|
|
|
|
|
|
|
message Packet {
|
|
|
|
PACKET_KIND Kind = 1;
|
|
|
|
|
|
|
|
oneof U {
|
|
|
|
RouteDesc Route = 2;
|
|
|
|
PeerDesc Peer = 3;
|
|
|
|
PeerData Data = 4;
|
|
|
|
};
|
|
|
|
}
|