Skip to main content

vsh_rust_proto/
vm_tools.vsh.rs

1// This file is @generated by prost-build.
2/// Request to set up a connection to a container. This must be the first
3/// message sent to the server from the client.
4#[derive(Clone, PartialEq, ::prost::Message)]
5pub struct SetupConnectionRequest {
6    /// Target container. "vm_shell" is a special value to get a VM shell.
7    #[prost(string, tag = "1")]
8    pub target: ::prost::alloc::string::String,
9    /// User to execute the target program.
10    #[prost(string, tag = "2")]
11    pub user: ::prost::alloc::string::String,
12    /// Map of environment variables to forward.
13    #[prost(map = "string, string", tag = "3")]
14    pub env: ::std::collections::HashMap<
15        ::prost::alloc::string::String,
16        ::prost::alloc::string::String,
17    >,
18    /// Deprecated. Target command. Empty indicates a login shell.
19    #[prost(string, tag = "4")]
20    pub command: ::prost::alloc::string::String,
21    /// Argv of the target program to run. Empty indicates a login shell.
22    #[prost(string, repeated, tag = "5")]
23    pub argv: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
24    /// Initial window size (rows) of the pty.
25    #[prost(int32, tag = "6")]
26    pub window_rows: i32,
27    /// Initial window size (cols) of the pty.
28    #[prost(int32, tag = "7")]
29    pub window_cols: i32,
30    /// True if using a noninteractive client and a pty should not be allocated.
31    /// The logic here is inverted to keep backwards compatibility with the
32    /// current behavior (always allocate a pty).
33    #[prost(bool, tag = "8")]
34    pub nopty: bool,
35    /// Optional: directory to set for current working directory.
36    #[prost(string, tag = "9")]
37    pub cwd: ::prost::alloc::string::String,
38    /// Optional: use /proc/<cwd_pid>/cwd for current working directory.
39    #[prost(int32, tag = "10")]
40    pub cwd_pid: i32,
41}
42/// Response to a SetupConnectionRequest.
43#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
44pub struct SetupConnectionResponse {
45    /// Status of the connection.
46    #[prost(enumeration = "ConnectionStatus", tag = "1")]
47    pub status: i32,
48    /// Short description of any error encountered when setting up the
49    /// connection.
50    #[prost(string, tag = "2")]
51    pub description: ::prost::alloc::string::String,
52    /// Process ID of new shell.
53    #[prost(int32, tag = "3")]
54    pub pid: i32,
55}
56/// A message that indicates to either the server or the client a change
57/// in connection status.
58#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
59pub struct ConnectionStatusMessage {
60    /// New connection status. If the connection status is changed to anything
61    /// except READY, the recipient must shut down.
62    #[prost(enumeration = "ConnectionStatus", tag = "1")]
63    pub status: i32,
64    /// Short description of any error that triggered the status change.
65    #[prost(string, tag = "2")]
66    pub description: ::prost::alloc::string::String,
67    /// Return code of the command, if any.
68    #[prost(sint32, tag = "3")]
69    pub code: i32,
70}
71/// DataMessages encapsulate stdio to be forwarded between the server and client.
72#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
73pub struct DataMessage {
74    /// Type of stream in this message.
75    #[prost(enumeration = "StdioStream", tag = "1")]
76    pub stream: i32,
77    /// Data to be forwarded.
78    #[prost(bytes = "vec", tag = "2")]
79    pub data: ::prost::alloc::vec::Vec<u8>,
80}
81/// Indicates that the server should resize its pseudoterminal to the given
82/// dimensions. Sent by the client in response to SIGWINCH.
83#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
84pub struct WindowResizeMessage {
85    /// New number of rows for the tty.
86    #[prost(int32, tag = "1")]
87    pub rows: i32,
88    /// New number of cols for the tty.
89    #[prost(int32, tag = "2")]
90    pub cols: i32,
91}
92/// Wrapper message for all messages that can be sent to the host/client.
93#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
94pub struct HostMessage {
95    #[prost(oneof = "host_message::Msg", tags = "1, 2")]
96    pub msg: ::core::option::Option<host_message::Msg>,
97}
98/// Nested message and enum types in `HostMessage`.
99pub mod host_message {
100    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
101    pub enum Msg {
102        #[prost(message, tag = "1")]
103        DataMessage(super::DataMessage),
104        #[prost(message, tag = "2")]
105        StatusMessage(super::ConnectionStatusMessage),
106    }
107}
108/// Wrapper message for all messages that can be sent to the guest/server.
109#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
110pub struct GuestMessage {
111    #[prost(oneof = "guest_message::Msg", tags = "1, 2, 3, 4")]
112    pub msg: ::core::option::Option<guest_message::Msg>,
113}
114/// Nested message and enum types in `GuestMessage`.
115pub mod guest_message {
116    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
117    pub enum Msg {
118        #[prost(message, tag = "1")]
119        DataMessage(super::DataMessage),
120        #[prost(message, tag = "2")]
121        StatusMessage(super::ConnectionStatusMessage),
122        #[prost(message, tag = "3")]
123        ResizeMessage(super::WindowResizeMessage),
124        #[prost(enumeration = "super::Signal", tag = "4")]
125        Signal(i32),
126    }
127}
128/// Indicates the status of a connection.
129#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
130#[repr(i32)]
131pub enum ConnectionStatus {
132    /// Connection status is unknown.
133    Unknown = 0,
134    /// Connection was set up successfully. Server and client may now exchange
135    /// messages.
136    Ready = 1,
137    /// The server's target program has exited. The server will immediately close
138    /// the connection, and the client is expected to exit after its cleanup.
139    Exited = 2,
140    /// A fatal error was encountered. The connection will be closed.
141    Failed = 3,
142}
143impl ConnectionStatus {
144    /// String value of the enum field names used in the ProtoBuf definition.
145    ///
146    /// The values are not transformed in any way and thus are considered stable
147    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
148    pub fn as_str_name(&self) -> &'static str {
149        match self {
150            Self::Unknown => "UNKNOWN",
151            Self::Ready => "READY",
152            Self::Exited => "EXITED",
153            Self::Failed => "FAILED",
154        }
155    }
156    /// Creates an enum from field names used in the ProtoBuf definition.
157    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
158        match value {
159            "UNKNOWN" => Some(Self::Unknown),
160            "READY" => Some(Self::Ready),
161            "EXITED" => Some(Self::Exited),
162            "FAILED" => Some(Self::Failed),
163            _ => None,
164        }
165    }
166}
167/// Type of stdio stream that is being sent.
168#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
169#[repr(i32)]
170pub enum StdioStream {
171    /// The stream is invalid.
172    InvalidStream = 0,
173    /// This is a stdin stream, flowing from client to server.
174    StdinStream = 1,
175    /// This is a stdout stream, flowing from server to client.
176    StdoutStream = 2,
177    /// This is a stderr stream, flowing from server to client.
178    StderrStream = 3,
179}
180impl StdioStream {
181    /// String value of the enum field names used in the ProtoBuf definition.
182    ///
183    /// The values are not transformed in any way and thus are considered stable
184    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
185    pub fn as_str_name(&self) -> &'static str {
186        match self {
187            Self::InvalidStream => "INVALID_STREAM",
188            Self::StdinStream => "STDIN_STREAM",
189            Self::StdoutStream => "STDOUT_STREAM",
190            Self::StderrStream => "STDERR_STREAM",
191        }
192    }
193    /// Creates an enum from field names used in the ProtoBuf definition.
194    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
195        match value {
196            "INVALID_STREAM" => Some(Self::InvalidStream),
197            "STDIN_STREAM" => Some(Self::StdinStream),
198            "STDOUT_STREAM" => Some(Self::StdoutStream),
199            "STDERR_STREAM" => Some(Self::StderrStream),
200            _ => None,
201        }
202    }
203}
204/// Encapsulates a POSIX signal to be sent to the target program.
205#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
206#[repr(i32)]
207pub enum Signal {
208    Unknown = 0,
209    Hup = 1,
210    Int = 2,
211    Quit = 3,
212    Term = 15,
213}
214impl Signal {
215    /// String value of the enum field names used in the ProtoBuf definition.
216    ///
217    /// The values are not transformed in any way and thus are considered stable
218    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
219    pub fn as_str_name(&self) -> &'static str {
220        match self {
221            Self::Unknown => "SIGNAL_UNKNOWN",
222            Self::Hup => "SIGNAL_HUP",
223            Self::Int => "SIGNAL_INT",
224            Self::Quit => "SIGNAL_QUIT",
225            Self::Term => "SIGNAL_TERM",
226        }
227    }
228    /// Creates an enum from field names used in the ProtoBuf definition.
229    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
230        match value {
231            "SIGNAL_UNKNOWN" => Some(Self::Unknown),
232            "SIGNAL_HUP" => Some(Self::Hup),
233            "SIGNAL_INT" => Some(Self::Int),
234            "SIGNAL_QUIT" => Some(Self::Quit),
235            "SIGNAL_TERM" => Some(Self::Term),
236            _ => None,
237        }
238    }
239}