From b1d272f8fb8fd257bc990cf4d804393660cd9200 Mon Sep 17 00:00:00 2001 From: ghe0 Date: Fri, 3 Jan 2025 18:08:23 +0200 Subject: [PATCH] new proto that has MeasurementArgs --- brain.proto | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/brain.proto b/brain.proto index 1c5bc4e..b8ef0ee 100644 --- a/brain.proto +++ b/brain.proto @@ -24,6 +24,17 @@ message NodeResourceReq { uint32 max_ports_per_vm = 8; } +message MeasurementArgs { + // this will be IP:Port of the dtrfs API + // actually not a measurement arg, but needed for the injector + string dtrfs_api_endpoint = 1; + repeated uint32 exposed_ports = 2; + string ovmf_hash = 5; + // This is needed to allow the CLI to build the kernel params from known data. + // The CLI will use the kernel params to get the measurement. + repeated NewVmRespIP ips = 6; +} + message NewVMReq { string uuid = 1; // UUID is empty when CLI sends request; brain sets UUID string hostname = 2; @@ -41,6 +52,12 @@ message NewVMReq { string dtrfs_sha = 14; } +message NewVMResp { + string uuid = 1; + string error = 2; + MeasurementArgs args = 3; +} + message UpdateVMReq { string uuid = 1; uint32 disk_size_gb = 2; @@ -55,7 +72,7 @@ message UpdateVMReq { message UpdateVMResp { string uuid = 1; string error = 2; - string ovmf_hash = 3; + MeasurementArgs args = 3; } message VMContract { @@ -88,16 +105,6 @@ message NewVmRespIP { string gateway = 4; } -message NewVMResp { - string uuid = 1; - repeated uint32 exposed_ports = 2; - string ovmf_hash = 5; - // This is needed to allow the CLI to build the kernel params from known data. - // The CLI will use the kernel params to get the measurement. - repeated NewVmRespIP ips = 6; - string error = 7; -} - message DeleteVMReq { string uuid = 1; } @@ -111,6 +118,7 @@ service BrainDaemonService { rpc ListVMContracts (ListVMContractsReq) returns (stream VMContract); rpc GetUpdateVMReq (NodePubkey) returns (stream UpdateVMReq); rpc SendUpdateVMResp (stream UpdateVMResp) returns (Empty); + // rpc SendMeasurementArgs (NodePubkey) returns (MeasurementArgs); } message NodeFilters { @@ -143,4 +151,5 @@ service BrainCliService { rpc GetOneNode (NodeFilters) returns (NodeListResp); rpc DeleteVM (DeleteVMReq) returns (Empty); rpc UpdateVM (UpdateVMReq) returns (UpdateVMResp); -} \ No newline at end of file + // rpc GetMeasurementArgs (ListVMContractsReq) returns (MeasurementArgs); +}