| 1 | syntax = "proto3"; |
| 2 | |
| 3 | import "google/protobuf/empty.proto"; |
| 4 | import "google/protobuf/timestamp.proto"; |
| 5 | |
| 6 | option go_package = "github.com/lima-vm/lima/v2/pkg/guestagent/api"; |
| 7 | |
| 8 | service GuestService { |
| 9 | rpc GetInfo(google.protobuf.Empty) returns (Info); |
| 10 | rpc GetEvents(google.protobuf.Empty) returns (stream Event); |
| 11 | rpc PostInotify(stream Inotify) returns (google.protobuf.Empty); |
| 12 | |
| 13 | rpc Tunnel(stream TunnelMessage) returns (stream TunnelMessage); |
| 14 | rpc SyncTime(TimeSyncRequest) returns (TimeSyncResponse); |
| 15 | } |
| 16 | |
| 17 | message Info { |
| 18 | repeated IPPort local_ports = 1; |
| 19 | } |
| 20 | |
| 21 | message Event { |
| 22 | google.protobuf.Timestamp time = 1; |
| 23 | repeated IPPort added_local_ports = 2; |
| 24 | repeated IPPort removed_local_ports = 3; |
| 25 | repeated string errors = 4; |
| 26 | } |
| 27 | |
| 28 | message IPPort { |
| 29 | string protocol = 1; // tcp, udp |
| 30 | string ip = 2; |
| 31 | int32 port = 3; |
| 32 | } |
| 33 | |
| 34 | message Inotify { |
| 35 | string mount_path = 1; |
| 36 | google.protobuf.Timestamp time = 2; |
| 37 | // removed is set when mount_path was removed on the host. |
| 38 | bool removed = 3; |
| 39 | } |
| 40 | |
| 41 | message TunnelMessage { |
| 42 | string id = 1; |
| 43 | string protocol = 2; // tcp, udp |
| 44 | bytes data = 3; |
| 45 | string guest_addr = 4; |
| 46 | string udp_target_addr = 5; |
| 47 | } |
| 48 | |
| 49 | message TimeSyncRequest { |
| 50 | google.protobuf.Timestamp host_time = 1; |
| 51 | } |
| 52 | |
| 53 | message TimeSyncResponse { |
| 54 | bool adjusted = 1; |
| 55 | int64 drift_ms = 2; |
| 56 | string error = 3; |
| 57 | } |