syntax = "proto3";

option go_package = ".;mlbctl";

package mlbctl;

service Control {
  rpc getHello(getHelloParams) returns (getHelloResult) {};
  rpc createForwarder(createForwarderParams) returns (createForwarderResult) {};
  rpc listForwarders(listForwardersParams) returns (listForwardersResult) {};
  rpc deleteForwarder(deleteForwarderParams) returns (deleteForwarderResult) {};
}

message getHelloParams {}
message getHelloResult {
  string message      = 1;
}

message forwarder {
  string type         = 1;
  uint32 lport        = 2;
  uint32 dport        = 3;
  repeated destination destinations  = 4;
}

message destination {
  string address      = 1;
}

message listForwardersParams {}
message listForwardersResult {
  repeated forwarder forwarders = 1;
}

message createForwarderParams {
  string type         = 1;
  uint32 lport        = 2;
  uint32 dport        = 3;
  repeated string destinations  = 4;
}
message createForwarderResult {}

message deleteForwarderParams {
  string type  = 1;
  uint32 lport = 2;
}
message deleteForwarderResult {}
