1#[derive(Clone, PartialEq, ::prost::Message)]
5pub struct SetupConnectionRequest {
6 #[prost(string, tag = "1")]
8 pub target: ::prost::alloc::string::String,
9 #[prost(string, tag = "2")]
11 pub user: ::prost::alloc::string::String,
12 #[prost(map = "string, string", tag = "3")]
14 pub env: ::std::collections::HashMap<
15 ::prost::alloc::string::String,
16 ::prost::alloc::string::String,
17 >,
18 #[prost(string, tag = "4")]
20 pub command: ::prost::alloc::string::String,
21 #[prost(string, repeated, tag = "5")]
23 pub argv: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
24 #[prost(int32, tag = "6")]
26 pub window_rows: i32,
27 #[prost(int32, tag = "7")]
29 pub window_cols: i32,
30 #[prost(bool, tag = "8")]
34 pub nopty: bool,
35 #[prost(string, tag = "9")]
37 pub cwd: ::prost::alloc::string::String,
38 #[prost(int32, tag = "10")]
40 pub cwd_pid: i32,
41}
42#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
44pub struct SetupConnectionResponse {
45 #[prost(enumeration = "ConnectionStatus", tag = "1")]
47 pub status: i32,
48 #[prost(string, tag = "2")]
51 pub description: ::prost::alloc::string::String,
52 #[prost(int32, tag = "3")]
54 pub pid: i32,
55}
56#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
59pub struct ConnectionStatusMessage {
60 #[prost(enumeration = "ConnectionStatus", tag = "1")]
63 pub status: i32,
64 #[prost(string, tag = "2")]
66 pub description: ::prost::alloc::string::String,
67 #[prost(sint32, tag = "3")]
69 pub code: i32,
70}
71#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
73pub struct DataMessage {
74 #[prost(enumeration = "StdioStream", tag = "1")]
76 pub stream: i32,
77 #[prost(bytes = "vec", tag = "2")]
79 pub data: ::prost::alloc::vec::Vec<u8>,
80}
81#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
84pub struct WindowResizeMessage {
85 #[prost(int32, tag = "1")]
87 pub rows: i32,
88 #[prost(int32, tag = "2")]
90 pub cols: i32,
91}
92#[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}
98pub 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#[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}
114pub 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#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
130#[repr(i32)]
131pub enum ConnectionStatus {
132 Unknown = 0,
134 Ready = 1,
137 Exited = 2,
140 Failed = 3,
142}
143impl ConnectionStatus {
144 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 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#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
169#[repr(i32)]
170pub enum StdioStream {
171 InvalidStream = 0,
173 StdinStream = 1,
175 StdoutStream = 2,
177 StderrStream = 3,
179}
180impl StdioStream {
181 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 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#[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 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 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}