Cody Schuffelen | 5bc697c | 2019-01-28 21:05:29 -0800 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Cody Schuffelen | 17b3472 | 2019-01-28 22:57:14 -0800 | [diff] [blame] | 3 | #include <functional> |
Cody Schuffelen | b13869b | 2019-11-26 18:46:34 -0800 | [diff] [blame] | 4 | #include <set> |
| 5 | #include <string> |
Cody Schuffelen | 17b3472 | 2019-01-28 22:57:14 -0800 | [diff] [blame] | 6 | |
Cody Schuffelen | b13869b | 2019-11-26 18:46:34 -0800 | [diff] [blame] | 7 | #include "common/libs/fs/shared_fd.h" |
Cody Schuffelen | 5bc697c | 2019-01-28 21:05:29 -0800 | [diff] [blame] | 8 | #include "common/libs/utils/subprocess.h" |
Cody Schuffelen | 147b88e | 2019-09-09 16:00:11 -0700 | [diff] [blame] | 9 | #include "host/commands/run_cvd/process_monitor.h" |
Cody Schuffelen | 5bc697c | 2019-01-28 21:05:29 -0800 | [diff] [blame] | 10 | #include "host/libs/config/cuttlefish_config.h" |
| 11 | |
Jorge E. Moreira | 277e1c4 | 2019-05-06 17:24:27 -0700 | [diff] [blame] | 12 | std::vector <cvd::SharedFD> LaunchKernelLogMonitor( |
| 13 | const vsoc::CuttlefishConfig& config, |
| 14 | cvd::ProcessMonitor* process_monitor, |
| 15 | unsigned int number_of_event_pipes); |
Cody Schuffelen | 660d9e8 | 2019-01-29 16:33:33 -0800 | [diff] [blame] | 16 | void LaunchAdbConnectorIfEnabled(cvd::ProcessMonitor* process_monitor, |
Jorge E. Moreira | 9ec1585 | 2019-05-02 17:52:58 -0700 | [diff] [blame] | 17 | const vsoc::CuttlefishConfig& config, |
| 18 | cvd::SharedFD adbd_events_pipe); |
Cody Schuffelen | 660d9e8 | 2019-01-29 16:33:33 -0800 | [diff] [blame] | 19 | void LaunchSocketVsockProxyIfEnabled(cvd::ProcessMonitor* process_monitor, |
| 20 | const vsoc::CuttlefishConfig& config); |
Cody Schuffelen | b13869b | 2019-11-26 18:46:34 -0800 | [diff] [blame] | 21 | |
Jorge E. Moreira | e139026 | 2019-12-18 18:17:48 -0800 | [diff] [blame] | 22 | struct StreamerLaunchResult { |
Jason Macnak | aa1ccbb | 2019-12-19 13:34:02 -0800 | [diff] [blame] | 23 | bool launched = false; |
Jorge E. Moreira | 36845e3 | 2019-12-19 14:40:24 -0800 | [diff] [blame] | 24 | std::optional<unsigned int> frames_server_vsock_port; |
| 25 | std::optional<unsigned int> touch_server_vsock_port; |
| 26 | std::optional<unsigned int> keyboard_server_vsock_port; |
Cody Schuffelen | b13869b | 2019-11-26 18:46:34 -0800 | [diff] [blame] | 27 | }; |
Jorge E. Moreira | e139026 | 2019-12-18 18:17:48 -0800 | [diff] [blame] | 28 | StreamerLaunchResult LaunchVNCServer( |
Cody Schuffelen | b13869b | 2019-11-26 18:46:34 -0800 | [diff] [blame] | 29 | const vsoc::CuttlefishConfig& config, |
| 30 | cvd::ProcessMonitor* process_monitor, |
| 31 | std::function<bool(cvd::MonitorEntry*)> callback); |
Cody Schuffelen | d3f27b9 | 2019-11-26 19:04:43 -0800 | [diff] [blame] | 32 | |
| 33 | struct TombstoneReceiverPorts { |
Jorge E. Moreira | 36845e3 | 2019-12-19 14:40:24 -0800 | [diff] [blame] | 34 | std::optional<unsigned int> server_vsock_port; |
Cody Schuffelen | d3f27b9 | 2019-11-26 19:04:43 -0800 | [diff] [blame] | 35 | }; |
| 36 | TombstoneReceiverPorts LaunchTombstoneReceiverIfEnabled( |
| 37 | const vsoc::CuttlefishConfig& config, cvd::ProcessMonitor* process_monitor); |
Cody Schuffelen | c9183ba | 2019-12-05 15:23:46 -0800 | [diff] [blame] | 38 | |
| 39 | struct ConfigServerPorts { |
Jorge E. Moreira | 36845e3 | 2019-12-19 14:40:24 -0800 | [diff] [blame] | 40 | std::optional<unsigned int> server_vsock_port; |
Cody Schuffelen | c9183ba | 2019-12-05 15:23:46 -0800 | [diff] [blame] | 41 | }; |
| 42 | ConfigServerPorts LaunchConfigServer(const vsoc::CuttlefishConfig& config, |
| 43 | cvd::ProcessMonitor* process_monitor); |
Cody Schuffelen | eb5c215 | 2019-12-05 15:44:49 -0800 | [diff] [blame] | 44 | |
| 45 | struct LogcatServerPorts { |
Jorge E. Moreira | 36845e3 | 2019-12-19 14:40:24 -0800 | [diff] [blame] | 46 | std::optional<unsigned int> server_vsock_port; |
Cody Schuffelen | eb5c215 | 2019-12-05 15:44:49 -0800 | [diff] [blame] | 47 | }; |
| 48 | LogcatServerPorts LaunchLogcatReceiverIfEnabled(const vsoc::CuttlefishConfig& config, |
| 49 | cvd::ProcessMonitor* process_monitor); |
Jorge E. Moreira | e139026 | 2019-12-18 18:17:48 -0800 | [diff] [blame] | 50 | |
| 51 | StreamerLaunchResult LaunchWebRTC(cvd::ProcessMonitor* process_monitor, |
| 52 | const vsoc::CuttlefishConfig& config); |