microsoft/openvmm
Publicmirrored fromhttps://github.com/microsoft/openvmmAvailable
openhcl/diag_proto/src/diag.proto
108lines · modecode
| 1 | // Copyright (c) Microsoft Corporation. |
| 2 | // Licensed under the MIT License. |
| 3 | |
| 4 | syntax = "proto3"; |
| 5 | |
| 6 | package diag; |
| 7 | |
| 8 | import "google/protobuf/empty.proto"; |
| 9 | |
| 10 | // OpenHCL diagnostics services. |
| 11 | // |
| 12 | // Add new methods here, since the diagnostics service in use before this did |
| 13 | // not handle unknown methods correctly. |
| 14 | service OpenhclDiag { |
| 15 | // Ping the server, validating it is ready for use. |
| 16 | rpc Ping(google.protobuf.Empty) returns (google.protobuf.Empty); |
| 17 | } |
| 18 | |
| 19 | // Older methods. |
| 20 | service UnderhillDiag { |
| 21 | rpc Exec(ExecRequest) returns (ExecResponse); |
| 22 | rpc Wait(WaitRequest) returns (WaitResponse); |
| 23 | rpc Start(StartRequest) returns (google.protobuf.Empty); |
| 24 | rpc Crash(CrashRequest) returns (google.protobuf.Empty); |
| 25 | rpc Kmsg(KmsgRequest) returns (google.protobuf.Empty); |
| 26 | rpc Restart(google.protobuf.Empty) returns (google.protobuf.Empty); |
| 27 | rpc Pause(google.protobuf.Empty) returns (google.protobuf.Empty); |
| 28 | rpc Resume(google.protobuf.Empty) returns (google.protobuf.Empty); |
| 29 | rpc ReadFile(FileRequest) returns (google.protobuf.Empty); |
| 30 | rpc DumpSavedState(google.protobuf.Empty) returns (DumpSavedStateResponse); |
| 31 | rpc PacketCapture(NetworkPacketCaptureRequest) returns (NetworkPacketCaptureResponse); |
| 32 | } |
| 33 | |
| 34 | message ExecRequest { |
| 35 | string command = 1; |
| 36 | repeated string args = 2; |
| 37 | bool tty = 3; |
| 38 | uint64 stdin = 4; |
| 39 | uint64 stdout = 5; |
| 40 | uint64 stderr = 6; |
| 41 | bool combine_stderr = 7; |
| 42 | repeated EnvPair env = 8; |
| 43 | bool clear_env = 9; |
| 44 | bool raw_socket_io = 10; |
| 45 | } |
| 46 | |
| 47 | message EnvPair { |
| 48 | string name = 1; |
| 49 | optional string value = 2; |
| 50 | } |
| 51 | |
| 52 | message ExecResponse { |
| 53 | int32 pid = 1; |
| 54 | } |
| 55 | |
| 56 | message WaitRequest { |
| 57 | int32 pid = 1; |
| 58 | } |
| 59 | |
| 60 | message WaitResponse { |
| 61 | int32 exit_code = 1; |
| 62 | } |
| 63 | |
| 64 | message StartRequest { |
| 65 | repeated EnvPair env = 1; |
| 66 | repeated string args = 2; |
| 67 | } |
| 68 | |
| 69 | message KmsgRequest { |
| 70 | bool follow = 1; |
| 71 | uint64 conn = 2; |
| 72 | } |
| 73 | |
| 74 | message FileRequest { |
| 75 | bool follow = 1; |
| 76 | uint64 conn = 2; |
| 77 | string file_path = 3; |
| 78 | } |
| 79 | |
| 80 | message DumpSavedStateResponse { |
| 81 | bytes data = 1; |
| 82 | } |
| 83 | |
| 84 | message StartPacketCaptureData { |
| 85 | uint32 snaplen = 1; |
| 86 | repeated uint64 conns = 2; |
| 87 | } |
| 88 | |
| 89 | message NetworkPacketCaptureRequest { |
| 90 | enum Operation { |
| 91 | Query = 0; |
| 92 | Start = 1; |
| 93 | Stop = 2; |
| 94 | } |
| 95 | |
| 96 | Operation operation = 3; |
| 97 | oneof OpData { |
| 98 | StartPacketCaptureData start_data = 4; |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | message NetworkPacketCaptureResponse { |
| 103 | uint32 num_streams = 1; |
| 104 | } |
| 105 | |
| 106 | message CrashRequest { |
| 107 | int32 pid = 1; |
| 108 | } |
| 109 | |