syntax = "proto3"; package carrier.broker.v1; message Path { enum Category { Invalid = 0; Local = 1; Internet = 2; BrokerOrigin = 3; } string ipaddr = 1; Category category = 2; } message SubscribeRequest { bytes shadow = 1; // filter = 2; bytes group_identity = 3; bytes group_signature = 4; } message Publish { bytes identity = 1; bytes xaddr = 2; } message Unpublish { bytes identity = 1; } message Supersede { } message SubscribeChange{ oneof m { Publish publish = 1; Unpublish unpublish = 2; Supersede supersede = 3; } } message PublishRequest { bytes xaddr = 1; bytes shadow = 2; } message PublishChange{ oneof m { Supersede supersede = 1; } } message ConnectRequest { bytes target = 1; uint64 timestamp = 2; bytes handshake = 3; repeated Path paths = 4; bytes principal = 5; uint32 timeout = 6; } message ConnectResponse { bool ok = 1; bytes handshake = 2; uint64 route = 3; repeated Path paths = 4; string error = 5; } message ClusterShard { oneof m { bool this = 1; string other = 2; } } message ExceptionalRoute { bytes identity = 1; oneof m { bool this = 2; string other = 3; bool blocked = 4; } } message ClusterConfig { repeated ClusterShard shards = 1; repeated ExceptionalRoute exceptional_routes = 2; uint64 epoch = 3; uint64 default_shadow_publisher_limit = 4; uint64 default_shadow_traffic_limit_32 = 5; } message ClusterState { ClusterConfig config = 1; } message TraceRequest { string target = 1; } message TraceShadow { bytes xaddress = 1; uint64 publisher_count = 2; uint64 publisher_soft_limit = 3; uint64 publisher_hard_limit = 4; uint64 traffic_epoch_64 = 5; uint64 traffic_limit_64 = 6; } message TraceResponse { repeated TraceShadow publishing = 1; uint64 epoch = 2; uint64 rx_bytes_32 = 3; uint64 tx_bytes_32 = 4; uint64 last_seen = 5; uint64 first_seen = 6; string allocation = 7; string brokerip = 8; uint64 pkts_sent = 9; uint64 pkts_lost = 10; uint64 rtt = 11; } service Broker { rpc subscribe (SubscribeRequest) returns (stream SubscribeChange) {} rpc publish (PublishRequest) returns (stream PublishChange) {} rpc connect (ConnectRequest) returns (stream ConnectResponse) {} rpc trace (TraceRequest) returns (stream TraceResponse) {} rpc get_cluster (Empty) returns (ClusterConfig) {} rpc patch_cluster (ClusterConfig) returns (Confirmation) {} } message PeerConnectRequest { bytes identity = 1; uint64 timestamp = 2; bytes handshake = 3; uint64 route = 4; repeated Path paths = 5; } message PeerConnectResponse { bool ok = 1; bytes handshake = 2; repeated Path paths = 3; string error = 4; } service Peer { rpc connect (PeerConnectRequest) returns (PeerConnectResponse) {} } message ProtoHeader { uint64 len = 1; } message Empty {} message Confirmation { bool ok = 1; string error = 2; } message MoveInstruction { string ipaddr = 1; bytes xaddr = 2; } message InnerTraceRequest { oneof m { bool Invalid = 1; bytes Ping = 2; } } message InnerTraceResponse { oneof m { bool Invalid = 1; bytes Pong = 2; } }