syntax = "proto2";
package et;
option optimize_for = LITE_RUNTIME;

enum EtPacketType {
  // Count down from 254 to avoid collisions
  HEARTBEAT = 254;
  INITIAL_PAYLOAD = 253;
  INITIAL_RESPONSE = 252;
}

message ConnectRequest {
  optional string clientId = 1;
  optional int32 version = 2;
}

enum ConnectStatus {
  NEW_CLIENT = 1;
  RETURNING_CLIENT = 2;
  INVALID_KEY = 3;
  MISMATCHED_PROTOCOL = 4;
}

message ConnectResponse {
  optional ConnectStatus status = 1;
  optional string error = 2;
}

message SequenceHeader { optional int32 sequenceNumber = 1; }

message CatchupBuffer { repeated bytes buffer = 1; }

message SocketEndpoint {
  optional string name = 1;
  optional int32 port = 2;
}
