hodu/hodu.proto

93 lines
2.0 KiB
Protocol Buffer
Raw Normal View History

syntax = "proto3";
option go_package = "./hodu";
// 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;
service Hodu {
rpc GetSeed (Seed) returns (Seed) {}
rpc PacketStream (stream Packet) returns (stream Packet) {}
}
message Seed {
uint32 Version = 1;
uint64 Flags = 2;
}
enum ROUTE_OPTION {
UNSPEC = 0;
TCP = 1;
TCP4 = 2;
TCP6 = 4;
TTY = 8;
HTTP = 16;
HTTPS = 32;
2024-12-13 02:25:27 +09:00
SSH = 64;
};
message RouteDesc {
uint32 RouteId = 1;
// C->S(ROUTE_START): client-side peer address
// S->C(ROUTE_STARTED): server-side listening address
string TargetAddrStr = 2;
2024-12-14 00:19:12 +09:00
// C->S(ROUTE_START): human-readable name of client-side peer
// S->C(ROUTE_STARTED): clone as sent by C
string TargetName= 3;
2024-12-14 00:19:12 +09:00
// C->S(ROUTE_START): desired listening option on the server-side(e.g. tcp, tcp4, tcp6) +
// hint to the service-side peer(e.g. local) +
// hint to the client-side peer(e.g. tty, http, https)
// S->C(ROUTE_STARTED): cloned as sent by C.
2024-12-14 00:19:12 +09:00
uint32 ServiceOption = 4;
// C->S(ROUTE_START): desired lisening address on the service-side
// S->C(ROUTE_STARTED): cloned as sent by C
2024-12-14 00:19:12 +09:00
string ServiceAddrStr = 5;
// C->S(ROUTE_START): permitted network of server-side peers.
// S->C(ROUTE_STARTED): cloned as sent by C.
2024-12-14 00:19:12 +09:00
string ServiceNetStr = 6;
};
message PeerDesc {
uint32 RouteId = 1;
uint32 PeerId = 2;
string RemoteAddrStr = 3;
string LocalAddrStr = 4;
};
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;
};
message Packet {
PACKET_KIND Kind = 1;
oneof U {
RouteDesc Route = 2;
PeerDesc Peer = 3;
PeerData Data = 4;
};
}