blob: 7acbf1db5d03daf9afd95404034c47675b6c641a [file] [log] [blame]
Cody Schuffelen5bc697c2019-01-28 21:05:29 -08001#pragma once
2
Cody Schuffelen17b34722019-01-28 22:57:14 -08003#include <functional>
Cody Schuffelenb13869b2019-11-26 18:46:34 -08004#include <set>
5#include <string>
Cody Schuffelen17b34722019-01-28 22:57:14 -08006
Cody Schuffelenb13869b2019-11-26 18:46:34 -08007#include "common/libs/fs/shared_fd.h"
Cody Schuffelen5bc697c2019-01-28 21:05:29 -08008#include "common/libs/utils/subprocess.h"
Cody Schuffelen147b88e2019-09-09 16:00:11 -07009#include "host/commands/run_cvd/process_monitor.h"
Cody Schuffelen5bc697c2019-01-28 21:05:29 -080010#include "host/libs/config/cuttlefish_config.h"
11
Jorge E. Moreira277e1c42019-05-06 17:24:27 -070012std::vector <cvd::SharedFD> LaunchKernelLogMonitor(
13 const vsoc::CuttlefishConfig& config,
14 cvd::ProcessMonitor* process_monitor,
15 unsigned int number_of_event_pipes);
Cody Schuffelen660d9e82019-01-29 16:33:33 -080016void LaunchAdbConnectorIfEnabled(cvd::ProcessMonitor* process_monitor,
Jorge E. Moreira9ec15852019-05-02 17:52:58 -070017 const vsoc::CuttlefishConfig& config,
18 cvd::SharedFD adbd_events_pipe);
Cody Schuffelen660d9e82019-01-29 16:33:33 -080019void LaunchSocketVsockProxyIfEnabled(cvd::ProcessMonitor* process_monitor,
20 const vsoc::CuttlefishConfig& config);
Cody Schuffelenb13869b2019-11-26 18:46:34 -080021
Jorge E. Moreirae1390262019-12-18 18:17:48 -080022struct StreamerLaunchResult {
Jason Macnakaa1ccbb2019-12-19 13:34:02 -080023 bool launched = false;
Jorge E. Moreira36845e32019-12-19 14:40:24 -080024 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 Schuffelenb13869b2019-11-26 18:46:34 -080027};
Jorge E. Moreirae1390262019-12-18 18:17:48 -080028StreamerLaunchResult LaunchVNCServer(
Cody Schuffelenb13869b2019-11-26 18:46:34 -080029 const vsoc::CuttlefishConfig& config,
30 cvd::ProcessMonitor* process_monitor,
31 std::function<bool(cvd::MonitorEntry*)> callback);
Cody Schuffelend3f27b92019-11-26 19:04:43 -080032
33struct TombstoneReceiverPorts {
Jorge E. Moreira36845e32019-12-19 14:40:24 -080034 std::optional<unsigned int> server_vsock_port;
Cody Schuffelend3f27b92019-11-26 19:04:43 -080035};
36TombstoneReceiverPorts LaunchTombstoneReceiverIfEnabled(
37 const vsoc::CuttlefishConfig& config, cvd::ProcessMonitor* process_monitor);
Cody Schuffelenc9183ba2019-12-05 15:23:46 -080038
39struct ConfigServerPorts {
Jorge E. Moreira36845e32019-12-19 14:40:24 -080040 std::optional<unsigned int> server_vsock_port;
Cody Schuffelenc9183ba2019-12-05 15:23:46 -080041};
42ConfigServerPorts LaunchConfigServer(const vsoc::CuttlefishConfig& config,
43 cvd::ProcessMonitor* process_monitor);
Cody Schuffeleneb5c2152019-12-05 15:44:49 -080044
45struct LogcatServerPorts {
Jorge E. Moreira36845e32019-12-19 14:40:24 -080046 std::optional<unsigned int> server_vsock_port;
Cody Schuffeleneb5c2152019-12-05 15:44:49 -080047};
48LogcatServerPorts LaunchLogcatReceiverIfEnabled(const vsoc::CuttlefishConfig& config,
49 cvd::ProcessMonitor* process_monitor);
Jorge E. Moreirae1390262019-12-18 18:17:48 -080050
51StreamerLaunchResult LaunchWebRTC(cvd::ProcessMonitor* process_monitor,
52 const vsoc::CuttlefishConfig& config);