//
// Sysbox-fs Protobuffer Definitions.
//

syntax = "proto3";

option go_package = "./;sysboxFsProtobuf";

import "google/protobuf/timestamp.proto";

package protobuf;

// ContainerRegistration/Unregistration service definition.
service sysboxStateChannel {

    // Queries sysbox-fs for the FUSE mountpoint
    rpc GetMountpoint(MountpointReq) returns (MountpointResp) {}

    // Generates a container-preregistration message
    rpc ContainerPreRegistration (ContainerData) returns (Response) {}

    // Generates a container-registration message
    rpc ContainerRegistration (ContainerData) returns (Response) {}

    // Generates a container-unregistration message
    rpc ContainerUnregistration (ContainerData) returns (Response) {}

    // Generates a container-update message
    rpc ContainerUpdate (ContainerData) returns (Response) {}
}

//
// Request message sent by runC to sysbox-fs process during container
// registration, unregistration and update phases.
//
message ContainerData {
  string Id                       = 1;
  int32 InitPid                   = 2;
  string Hostname                 = 3;
  google.protobuf.Timestamp Ctime = 4;
  int32 UidFirst                  = 5;
  int32 UidSize                   = 6;
  int32 GidFirst                  = 7;
  int32 GidSize                   = 8;
  repeated string ProcRoPaths     = 9;
  repeated string ProcMaskPaths   = 10;
  string Netns                    = 11;
}

// Response message sent from sysbox-fs to runC process.
message Response {
  bool Success = 1;
}

message MountpointReq {
}

message MountpointResp {
  string Mountpoint = 1;
}